summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--ChangeLog.pre-2-109
-rw-r--r--gtk/gtkfilechooserdefault.c14
-rw-r--r--gtk/gtkmarshalers.list1
-rw-r--r--gtk/gtkpathbar.c15
-rw-r--r--gtk/gtkpathbar.h1
6 files changed, 44 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index a624108933..a6ea6f5ad3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2005-11-10 Matthias Clasen <mclasen@redhat.com>
+ Improve navigation to parent folders. (#318444, Andrei Yurkevich)
+
+ * gtk/gtkpathbar.[hc]: Add a child_path argument to
+ the path_clicked signal.
+ * gtk/gtkfilechooserdefault.c (path_bar_clicked): Select the
+ child_path, if it is provided.
+ * gtk/marshalers.list (path_bar_clicked): Add the necessary
+ glue.
+
* gtk/gtkmenu.c: Fix some compiler warnings. (#321141,
Kjartan Maraas)
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index a624108933..a6ea6f5ad3 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,5 +1,14 @@
2005-11-10 Matthias Clasen <mclasen@redhat.com>
+ Improve navigation to parent folders. (#318444, Andrei Yurkevich)
+
+ * gtk/gtkpathbar.[hc]: Add a child_path argument to
+ the path_clicked signal.
+ * gtk/gtkfilechooserdefault.c (path_bar_clicked): Select the
+ child_path, if it is provided.
+ * gtk/marshalers.list (path_bar_clicked): Add the necessary
+ glue.
+
* gtk/gtkmenu.c: Fix some compiler warnings. (#321141,
Kjartan Maraas)
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 7dfe4255e7..a9db44675e 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -371,6 +371,7 @@ static void select_func (GtkFileSystemModel *model,
static void path_bar_clicked (GtkPathBar *path_bar,
GtkFilePath *file_path,
+ GtkFilePath *child_path,
gboolean child_is_hidden,
GtkFileChooserDefault *impl);
@@ -6903,6 +6904,7 @@ list_row_activated (GtkTreeView *tree_view,
static void
path_bar_clicked (GtkPathBar *path_bar,
GtkFilePath *file_path,
+ GtkFilePath *child_path,
gboolean child_is_hidden,
GtkFileChooserDefault *impl)
{
@@ -6916,7 +6918,17 @@ path_bar_clicked (GtkPathBar *path_bar,
if (child_is_hidden)
g_object_set (impl, "show-hidden", TRUE, NULL);
- //gtk_widget_grab_focus (impl->browse_files_tree_view);
+ /* Say we have "/foo/bar/baz" and the user clicks on "bar". We should then
+ * focus the "baz" entry in the files list - the reason for this is that
+ * if user furst changed to /foo/bar/baz from /foo/bar unintentionally
+ * instead of /foo/bar/baz1, it will take quite some time to scroll to baz1
+ * in the file list, especially if this directory contains lots of folders
+ */
+ if (child_path != NULL)
+ {
+ gtk_file_chooser_default_select_path (impl, child_path, NULL);
+ browse_files_center_selected_row (impl);
+ }
}
static const GtkFileInfo *
diff --git a/gtk/gtkmarshalers.list b/gtk/gtkmarshalers.list
index 2c3a007bc7..c18388f8e0 100644
--- a/gtk/gtkmarshalers.list
+++ b/gtk/gtkmarshalers.list
@@ -88,6 +88,7 @@ VOID:OBJECT,STRING
VOID:POINTER
VOID:POINTER,INT
VOID:POINTER,BOOLEAN
+VOID:POINTER,POINTER,BOOLEAN
VOID:POINTER,POINTER,POINTER
VOID:POINTER,UINT
VOID:STRING
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index ade55d2197..ff99f52b43 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -191,8 +191,9 @@ gtk_path_bar_class_init (GtkPathBarClass *path_bar_class)
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkPathBarClass, path_clicked),
NULL, NULL,
- _gtk_marshal_VOID__POINTER_BOOLEAN,
- G_TYPE_NONE, 2,
+ _gtk_marshal_VOID__POINTER_POINTER_BOOLEAN,
+ G_TYPE_NONE, 3,
+ G_TYPE_POINTER,
G_TYPE_POINTER,
G_TYPE_BOOLEAN);
}
@@ -942,17 +943,23 @@ button_clicked_cb (GtkWidget *button,
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
+ GtkFilePath *child_path;
if (button_list->prev)
{
ButtonData *child_data;
child_data = BUTTON_DATA (button_list->prev->data);
+ child_path = child_data->path;
child_is_hidden = child_data->file_is_hidden;
}
else
- child_is_hidden = FALSE;
+ {
+ child_path = NULL;
+ child_is_hidden = FALSE;
+ }
- g_signal_emit (path_bar, path_bar_signals [PATH_CLICKED], 0, button_data->path, child_is_hidden);
+ g_signal_emit (path_bar, path_bar_signals [PATH_CLICKED], 0,
+ button_data->path, child_path, child_is_hidden);
}
static GdkPixbuf *
diff --git a/gtk/gtkpathbar.h b/gtk/gtkpathbar.h
index 349e1fcbd3..2dca06b6f4 100644
--- a/gtk/gtkpathbar.h
+++ b/gtk/gtkpathbar.h
@@ -72,6 +72,7 @@ struct _GtkPathBarClass
void (* path_clicked) (GtkPathBar *path_bar,
GtkFilePath *file_path,
+ GtkFilePath *child_path,
gboolean child_is_hidden);
};