Mercurial > gftp.yaz
changeset 603:76d372913c71
2004-11-1 Brian Masney <masneyb@gftp.org>
* src/gtk/bookmarks.c - don't allow the main bookmarks dialog to be
closed if a child entry is being edited. Fixes for a toplevel folder
that has no children
author | masneyb |
---|---|
date | Tue, 02 Nov 2004 01:02:04 +0000 |
parents | 89216879202f |
children | 5df5eac28f47 |
files | ChangeLog src/gtk/bookmarks.c |
diffstat | 2 files changed, 52 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Tue Nov 02 00:19:09 2004 +0000 +++ b/ChangeLog Tue Nov 02 01:02:04 2004 +0000 @@ -1,4 +1,8 @@ 2004-11-1 Brian Masney <masneyb@gftp.org> + * src/gtk/bookmarks.c - don't allow the main bookmarks dialog to be + closed if a child entry is being edited. Fixes for a toplevel folder + that has no children + * src/gtk/transfer.c (update_file_status) - if the % transferred goes over 100%, then set the update string to unknown percentage transfered. This will occur whenever the reported transfer size is different than @@ -2985,7 +2989,7 @@ * cvsclean - added this script - * *.[ch] - added $Id: ChangeLog,v 1.352 2004/11/02 00:19:09 masneyb Exp $ tags + * *.[ch] - added $Id: ChangeLog,v 1.353 2004/11/02 01:02:04 masneyb Exp $ tags * debian/* - updated files from Debian maintainer
--- a/src/gtk/bookmarks.c Tue Nov 02 00:19:09 2004 +0000 +++ b/src/gtk/bookmarks.c Tue Nov 02 01:02:04 2004 +0000 @@ -286,6 +286,12 @@ gftp_bookmarks_var * tempentry, * delentry; char *tempstr; + if (bm_dialog != NULL) + { + gtk_widget_grab_focus (bm_dialog); + return; + } + if (gftp_bookmarks != NULL) { tempentry = gftp_bookmarks->children; @@ -372,10 +378,7 @@ bm_close_dialog (GtkWidget * widget, GtkWidget * dialog) { if (bm_dialog != NULL) - { - gtk_widget_grab_focus (bm_dialog); - return; - } + return; if (new_bookmarks_htable != NULL) { @@ -612,32 +615,46 @@ } else { - pos = tempentry->path; - while ((pos = strchr (pos, '/')) != NULL) - { - *pos = '\0'; - str = g_strdup (tempentry->path); - *pos = '/'; - preventry = g_hash_table_lookup (new_bookmarks_htable, str); - if (preventry->cnode == NULL) - { - if ((prevpos = strrchr (str, '/')) == NULL) - prevpos = str; - else - prevpos++; - text[0] = text[1] = prevpos; - preventry->cnode = gtk_ctree_insert_node (GTK_CTREE (tree), - preventry->prev->cnode, NULL, text, - 5, closedir_pixmap, closedir_bitmap, - opendir_pixmap, opendir_bitmap, - FALSE, FALSE); - gtk_ctree_node_set_row_data (GTK_CTREE (tree), - preventry->cnode, preventry); - } - - g_free (str); - pos++; - } + if (strchr (tempentry->path, '/') == NULL && tempentry->isfolder) + { + text[0] = text[1] = tempentry->path; + tempentry->cnode = gtk_ctree_insert_node (GTK_CTREE (tree), + tempentry->prev->cnode, NULL, text, + 5, closedir_pixmap, closedir_bitmap, + opendir_pixmap, opendir_bitmap, + FALSE, FALSE); + gtk_ctree_node_set_row_data (GTK_CTREE (tree), tempentry->cnode, + tempentry); + } + else + { + pos = tempentry->path; + while ((pos = strchr (pos, '/')) != NULL) + { + *pos = '\0'; + str = g_strdup (tempentry->path); + *pos = '/'; + preventry = g_hash_table_lookup (new_bookmarks_htable, str); + if (preventry->cnode == NULL) + { + if ((prevpos = strrchr (str, '/')) == NULL) + prevpos = str; + else + prevpos++; + text[0] = text[1] = prevpos; + preventry->cnode = gtk_ctree_insert_node (GTK_CTREE (tree), + preventry->prev->cnode, NULL, text, + 5, closedir_pixmap, closedir_bitmap, + opendir_pixmap, opendir_bitmap, + FALSE, FALSE); + gtk_ctree_node_set_row_data (GTK_CTREE (tree), + preventry->cnode, preventry); + } + + g_free (str); + pos++; + } + } } if ((pos = strrchr (tempentry->path, '/')) == NULL)