+Sun Mar 14 21:03:15 2004 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpathbar.[ch]: Add _gtk_path_bar_up()/
+ _gtk_path_bar_down().
+
+ * gtk/gtkfilechooserdefault.c: Use _gtk_path_bar_up()/
+ _gtk_path_bar_down() as bindings for Alt-Up
+ and new Alt-Down. (Partly based on a patch by
+ Mark McLoughlin, #136987)
+
2004-03-14 Federico Mena Quintero <federico@ximian.com>
Fixes #136185, patch by Morten Welinder, with some changes.
+Sun Mar 14 21:03:15 2004 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpathbar.[ch]: Add _gtk_path_bar_up()/
+ _gtk_path_bar_down().
+
+ * gtk/gtkfilechooserdefault.c: Use _gtk_path_bar_up()/
+ _gtk_path_bar_down() as bindings for Alt-Up
+ and new Alt-Down. (Partly based on a patch by
+ Mark McLoughlin, #136987)
+
2004-03-14 Federico Mena Quintero <federico@ximian.com>
Fixes #136185, patch by Morten Welinder, with some changes.
+Sun Mar 14 21:03:15 2004 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpathbar.[ch]: Add _gtk_path_bar_up()/
+ _gtk_path_bar_down().
+
+ * gtk/gtkfilechooserdefault.c: Use _gtk_path_bar_up()/
+ _gtk_path_bar_down() as bindings for Alt-Up
+ and new Alt-Down. (Partly based on a patch by
+ Mark McLoughlin, #136987)
+
2004-03-14 Federico Mena Quintero <federico@ximian.com>
Fixes #136185, patch by Morten Welinder, with some changes.
+Sun Mar 14 21:03:15 2004 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpathbar.[ch]: Add _gtk_path_bar_up()/
+ _gtk_path_bar_down().
+
+ * gtk/gtkfilechooserdefault.c: Use _gtk_path_bar_up()/
+ _gtk_path_bar_down() as bindings for Alt-Up
+ and new Alt-Down. (Partly based on a patch by
+ Mark McLoughlin, #136987)
+
2004-03-14 Federico Mena Quintero <federico@ximian.com>
Fixes #136185, patch by Morten Welinder, with some changes.
+Sun Mar 14 21:03:15 2004 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkpathbar.[ch]: Add _gtk_path_bar_up()/
+ _gtk_path_bar_down().
+
+ * gtk/gtkfilechooserdefault.c: Use _gtk_path_bar_up()/
+ _gtk_path_bar_down() as bindings for Alt-Up
+ and new Alt-Down. (Partly based on a patch by
+ Mark McLoughlin, #136987)
+
2004-03-14 Federico Mena Quintero <federico@ximian.com>
Fixes #136185, patch by Morten Welinder, with some changes.
GtkFilePath *current_volume_path;
GtkFilePath *current_folder;
+ GtkFilePath *lowest_folder;
GtkFilePath *preview_path;
char *preview_display_name;
enum {
LOCATION_POPUP,
UP_FOLDER,
+ DOWN_FOLDER,
HOME_FOLDER,
LAST_SIGNAL
};
static void location_popup_handler (GtkFileChooserDefault *impl);
static void up_folder_handler (GtkFileChooserDefault *impl);
+static void down_folder_handler (GtkFileChooserDefault *impl);
static void home_folder_handler (GtkFileChooserDefault *impl);
static void update_appearance (GtkFileChooserDefault *impl);
NULL, NULL,
_gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
+ signals[DOWN_FOLDER] =
+ _gtk_binding_signal_new ("down-folder",
+ G_OBJECT_CLASS_TYPE (class),
+ G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+ G_CALLBACK (down_folder_handler),
+ NULL, NULL,
+ _gtk_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
signals[HOME_FOLDER] =
_gtk_binding_signal_new ("home-folder",
G_OBJECT_CLASS_TYPE (class),
"up-folder",
0);
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_Down, GDK_MOD1_MASK,
+ "down-folder",
+ 0);
+ gtk_binding_entry_add_signal (binding_set,
+ GDK_KP_Down, GDK_MOD1_MASK,
+ "down-folder",
+ 0);
+
gtk_binding_entry_add_signal (binding_set,
GDK_Home, GDK_MOD1_MASK,
"home-folder",
static void
up_folder_handler (GtkFileChooserDefault *impl)
{
- GtkFilePath *parent_path;
- GError *error;
+ _gtk_path_bar_up (GTK_PATH_BAR (impl->browse_path_bar));
+}
- error = NULL;
- if (gtk_file_system_get_parent (impl->file_system, impl->current_folder, &parent_path, &error))
- {
- if (parent_path) /* If we were on a root, parent_path will be NULL */
- {
- change_folder_and_display_error (impl, parent_path);
- gtk_file_path_free (parent_path);
- }
- }
- else
- {
- error_dialog (impl,
- _("Could not go to the parent folder of %s:\n%s"),
- impl->current_folder, error);
- }
+/* Handler for the "down-folder" keybinding signal */
+static void
+down_folder_handler (GtkFileChooserDefault *impl)
+{
+ _gtk_path_bar_down (GTK_PATH_BAR (impl->browse_path_bar));
}
/* Handler for the "home-folder" keybinding signal */
path_bar->root_path = gtk_file_system_filename_to_path (path_bar->file_system, "/");
g_free (desktop);
}
+
+/**
+ * _gtk_path_bar_up:
+ * @path_bar: a #GtkPathBar
+ *
+ * If the selected button in the pathbar is not the furthest button "up" (in the
+ * root direction), act as if the user clicked on the next button up.
+ **/
+void
+_gtk_path_bar_up (GtkPathBar *path_bar)
+{
+ GList *l;
+
+ for (l = path_bar->button_list; l; l = l->next)
+ {
+ GtkWidget *button = BUTTON_DATA (l->data)->button;
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
+ {
+ if (l->next)
+ {
+ GtkWidget *next_button = BUTTON_DATA (l->next->data)->button;
+ button_clicked_cb (next_button, l->next->data);
+ }
+ break;
+ }
+ }
+}
+
+/**
+ * _gtk_path_bar_down:
+ * @path_bar: a #GtkPathBar
+ *
+ * If the selected button in the pathbar is not the furthest button "down" (in the
+ * leaf direction), act as if the user clicked on the next button down.
+ **/
+void
+_gtk_path_bar_down (GtkPathBar *path_bar)
+{
+ GList *l;
+
+ for (l = path_bar->button_list; l; l = l->next)
+ {
+ GtkWidget *button = BUTTON_DATA (l->data)->button;
+ if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)))
+ {
+ if (l->prev)
+ {
+ GtkWidget *prev_button = BUTTON_DATA (l->prev->data)->button;
+ button_clicked_cb (prev_button, l->prev->data);
+ }
+ break;
+ }
+ }
+}