diff options
author | Anders Carlsson <andersca@gnome.org> | 2004-02-24 10:11:47 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@src.gnome.org> | 2004-02-24 10:11:47 +0000 |
commit | 4ce7278ecfa4fa9153059ec19d10faa9735654f7 (patch) | |
tree | 9c902f4ec94b9f5d03e9fb99adb8a5704e286e09 | |
parent | a9f2fc171a5bf8832664c24c831a02bb9120de86 (diff) | |
download | gtk+-4ce7278ecfa4fa9153059ec19d10faa9735654f7.tar.gz |
Translate the desktop label.
2004-02-24 Anders Carlsson <andersca@gnome.org>
* gtk/gtkfilechooserdefault.c: (shortcuts_append_desktop):
Translate the desktop label.
(shortcuts_get_index), (shortcuts_add_bookmarks),
(shortcuts_insert_separator), (create_shortcuts_model):
Don't show the bookmark separator if there are no bookmarks.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 9 | ||||
-rw-r--r-- | ChangeLog.pre-2-4 | 9 | ||||
-rw-r--r-- | ChangeLog.pre-2-6 | 9 | ||||
-rw-r--r-- | ChangeLog.pre-2-8 | 9 | ||||
-rw-r--r-- | gtk/gtkfilechooserdefault.c | 32 |
6 files changed, 66 insertions, 11 deletions
@@ -1,3 +1,12 @@ +2004-02-24 Anders Carlsson <andersca@gnome.org> + + * gtk/gtkfilechooserdefault.c: (shortcuts_append_desktop): + Translate the desktop label. + + (shortcuts_get_index), (shortcuts_add_bookmarks), + (shortcuts_insert_separator), (create_shortcuts_model): + Don't show the bookmark separator if there are no bookmarks. + Tue Feb 24 01:41:30 2004 Jonathan Blandford <jrb@gnome.org> * gtk/gtkfilechooserdefault.c (location_popup_handler): Make the diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 864d856c70..315d92e477 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +2004-02-24 Anders Carlsson <andersca@gnome.org> + + * gtk/gtkfilechooserdefault.c: (shortcuts_append_desktop): + Translate the desktop label. + + (shortcuts_get_index), (shortcuts_add_bookmarks), + (shortcuts_insert_separator), (create_shortcuts_model): + Don't show the bookmark separator if there are no bookmarks. + Tue Feb 24 01:41:30 2004 Jonathan Blandford <jrb@gnome.org> * gtk/gtkfilechooserdefault.c (location_popup_handler): Make the diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 864d856c70..315d92e477 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,12 @@ +2004-02-24 Anders Carlsson <andersca@gnome.org> + + * gtk/gtkfilechooserdefault.c: (shortcuts_append_desktop): + Translate the desktop label. + + (shortcuts_get_index), (shortcuts_add_bookmarks), + (shortcuts_insert_separator), (create_shortcuts_model): + Don't show the bookmark separator if there are no bookmarks. + Tue Feb 24 01:41:30 2004 Jonathan Blandford <jrb@gnome.org> * gtk/gtkfilechooserdefault.c (location_popup_handler): Make the diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 864d856c70..315d92e477 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,12 @@ +2004-02-24 Anders Carlsson <andersca@gnome.org> + + * gtk/gtkfilechooserdefault.c: (shortcuts_append_desktop): + Translate the desktop label. + + (shortcuts_get_index), (shortcuts_add_bookmarks), + (shortcuts_insert_separator), (create_shortcuts_model): + Don't show the bookmark separator if there are no bookmarks. + Tue Feb 24 01:41:30 2004 Jonathan Blandford <jrb@gnome.org> * gtk/gtkfilechooserdefault.c (location_popup_handler): Make the diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 864d856c70..315d92e477 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +2004-02-24 Anders Carlsson <andersca@gnome.org> + + * gtk/gtkfilechooserdefault.c: (shortcuts_append_desktop): + Translate the desktop label. + + (shortcuts_get_index), (shortcuts_add_bookmarks), + (shortcuts_insert_separator), (create_shortcuts_model): + Don't show the bookmark separator if there are no bookmarks. + Tue Feb 24 01:41:30 2004 Jonathan Blandford <jrb@gnome.org> * gtk/gtkfilechooserdefault.c (location_popup_handler): Make the diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c index 7f1cd17fb1..b41f4458d6 100644 --- a/gtk/gtkfilechooserdefault.c +++ b/gtk/gtkfilechooserdefault.c @@ -751,7 +751,7 @@ shortcuts_append_desktop (GtkFileChooserDefault *impl) path = gtk_file_system_filename_to_path (impl->file_system, name); g_free (name); - impl->has_desktop = shortcuts_insert_path (impl, -1, FALSE, NULL, path, NULL, FALSE, NULL); + impl->has_desktop = shortcuts_insert_path (impl, -1, FALSE, NULL, path, _("Desktop"), FALSE, NULL); /* We do not actually pop up an error dialog if there is no desktop directory * because some people may really not want to have one. */ @@ -817,7 +817,8 @@ shortcuts_get_index (GtkFileChooserDefault *impl, if (where == SHORTCUTS_SEPARATOR) goto out; - n += 1; + /* If there are no bookmarks there won't be a separator */ + n += impl->num_shortcuts > 0 ? 1 : 0; if (where == SHORTCUTS_BOOKMARKS) goto out; @@ -919,30 +920,39 @@ shortcuts_add_bookmarks (GtkFileChooserDefault *impl) { GSList *bookmarks; - shortcuts_remove_rows (impl, - shortcuts_get_index (impl, SHORTCUTS_BOOKMARKS), - impl->num_bookmarks, - remove_bookmark_cb); + if (impl->num_bookmarks > 0) + { + shortcuts_remove_rows (impl, + shortcuts_get_index (impl, SHORTCUTS_SEPARATOR), + impl->num_bookmarks + 1, + remove_bookmark_cb); + } + bookmarks = gtk_file_system_list_bookmarks (impl->file_system); impl->num_bookmarks = shortcuts_append_paths (impl, bookmarks); gtk_file_paths_free (bookmarks); + + if (impl->num_bookmarks > 0) + { + shortcuts_insert_separator (impl); + } } -/* Appends the bookmarks separator node and the bookmarks from the file system. */ +/* Inserts the bookmarks separator node */ static void -shortcuts_append_bookmarks (GtkFileChooserDefault *impl) +shortcuts_insert_separator (GtkFileChooserDefault *impl) { GtkTreeIter iter; - gtk_list_store_append (impl->shortcuts_model, &iter); + gtk_list_store_insert (impl->shortcuts_model, &iter, + shortcuts_get_index (impl, SHORTCUTS_SEPARATOR)); gtk_list_store_set (impl->shortcuts_model, &iter, SHORTCUTS_COL_PIXBUF, NULL, SHORTCUTS_COL_PIXBUF_VISIBLE, FALSE, SHORTCUTS_COL_NAME, NULL, SHORTCUTS_COL_PATH, NULL, -1); - shortcuts_add_bookmarks (impl); } /* Creates the GtkTreeStore used as the shortcuts model */ @@ -965,7 +975,7 @@ create_shortcuts_model (GtkFileChooserDefault *impl) shortcuts_append_home (impl); shortcuts_append_desktop (impl); shortcuts_add_volumes (impl); - shortcuts_append_bookmarks (impl); + shortcuts_add_bookmarks (impl); } gtk_tree_view_set_model (GTK_TREE_VIEW (impl->shortcuts_tree), GTK_TREE_MODEL (impl->shortcuts_model)); |