When a hotlist entry edit ends by cancelling, rather than confirming the change, end the whole edit and don't pass onto next element for edit.

svn path=/trunk/netsurf/; revision=11085
This commit is contained in:
Michael Drake 2010-12-17 11:10:22 +00:00
parent 96cb4b40e7
commit bb4bda0b3a
3 changed files with 8 additions and 2 deletions

View File

@ -64,10 +64,14 @@ static node_callback_resp hotlist_node_callback(void *user_data,
const char *text;
char *norm_text;
bool is_folder = tree_node_is_folder(node);
bool cancelled = false;
switch (msg_data->msg) {
case NODE_ELEMENT_EDIT_CANCELLED:
cancelled = true;
/* fall through */
case NODE_ELEMENT_EDIT_FINISHED:
if (creating_node &&
if (creating_node && !cancelled &&
(is_folder == false) &&
(msg_data->flag == TREE_ELEMENT_TITLE)) {
tree_url_node_edit_url(hotlist_tree, node);

View File

@ -879,7 +879,8 @@ static void tree_stop_edit(struct tree *tree, bool keep_changes)
tree_recalculate_size(tree);
if (element->parent->user_callback != NULL) {
msg_data.msg = NODE_ELEMENT_EDIT_FINISHED;
msg_data.msg = keep_changes ? NODE_ELEMENT_EDIT_FINISHED :
NODE_ELEMENT_EDIT_CANCELLED;
msg_data.flag = element->flag;
msg_data.node = element->parent;
element->parent->user_callback(element->parent->callback_data,

View File

@ -78,6 +78,7 @@ typedef enum {
NODE_DELETE_ELEMENT_IMG, /**< The bitmap or icon of a node is
* being deleted */
NODE_LAUNCH, /**< The node has been launched */
NODE_ELEMENT_EDIT_CANCELLED, /**< Editing opperation cancelled. */
NODE_ELEMENT_EDIT_FINISHING, /**< New text has to be accepted
* or rejected. */
NODE_ELEMENT_EDIT_FINISHED /**< Editing of a node_element has