This request was made some years ago: https://sourceforge.net/p/geeqie/feature-requests/70/
I have attached a patch which implements this. Also, keyboard-only users will be able to use keyboard-accelerators to map a key to the Up function.
Unfortunately there is a usability problem. If the configuration file geeqirc.xml exists (which it will except for first-time installations) geeqie will not look at the programmed defaults, but will create the toolbar from the config file - and the Up icon will not be displayed.
If the user first executes a command such as this:sed -i '/toolitem action = "Back"/a <toolitem action = "Up" />' ~/.config/geeqie/geeqierc.xml
then all will be well. This is not ideal, but I see no other solution. Colin Clark
diff --git a/src/layout_util.c b/src/layout_util.c index a954019..5d99ea3 100644 --- a/src/layout_util.c +++ b/src/layout_util.c @@ -1066,6 +1066,25 @@ static void layout_menu_home_cb(GtkAction *action, gpointer data) } } +static void layout_menu_up_cb(GtkAction *action, gpointer data) +{ + LayoutWindow *lw = data; + ViewDir *vd = lw->vd; + gchar *path; + + if (!vd->dir_fd || strcmp(vd->dir_fd->path, G_DIR_SEPARATOR_S) == 0) return; + path = remove_level_from_path(vd->dir_fd->path); + + if (vd->select_func) + { + FileData *fd = file_data_new_dir(path); + vd->select_func(vd, fd, vd->select_data); + file_data_unref(fd); + } + + g_free(path); +} + /* *----------------------------------------------------------------------------- @@ -1275,6 +1294,7 @@ static GtkActionEntry menu_entries[] = { { "LastImage", GTK_STOCK_GOTO_BOTTOM, N_("_Last Image"), "End", N_("Last Image"), CB(layout_menu_image_last_cb) }, { "Back", GTK_STOCK_GO_BACK, N_("_Back"), NULL, N_("Back"), CB(layout_menu_back_cb) }, { "Home", GTK_STOCK_HOME, N_("_Home"), NULL, N_("Home"), CB(layout_menu_home_cb) }, + { "Up", GTK_STOCK_GO_UP, N_("_Up"), NULL, N_("Up"), CB(layout_menu_up_cb) }, { "NewWindow", GTK_STOCK_NEW, N_("New _window"), "<control>N", N_("New window"), CB(layout_menu_new_window_cb) }, { "NewCollection", GTK_STOCK_INDEX, N_("_New collection"), "C", N_("New collection"), CB(layout_menu_new_cb) }, @@ -1466,6 +1486,7 @@ static const gchar *menu_ui_description = " <menuitem action='LastImage'/>" " <separator/>" " <menuitem action='Back'/>" +" <menuitem action='Up'/>" " <menuitem action='Home'/>" " <separator/>" " </menu>" @@ -2152,6 +2173,7 @@ void layout_toolbar_add_default(LayoutWindow *lw, ToolbarType type) case TOOLBAR_MAIN: layout_toolbar_add(lw, type, "Thumbnails"); layout_toolbar_add(lw, type, "Back"); + layout_toolbar_add(lw, type, "Up"); layout_toolbar_add(lw, type, "Home"); layout_toolbar_add(lw, type, "Refresh"); layout_toolbar_add(lw, type, "ZoomIn"); diff --git a/src/view_dir_list.c b/src/view_dir_list.c index fa65a74..959eb31 100644 --- a/src/view_dir_list.c +++ b/src/view_dir_list.c @@ -146,15 +146,7 @@ static gboolean vdlist_populate(ViewDir *vd, gboolean clear) ret = filelist_read(vd->dir_fd, NULL, &VDLIST(vd)->list); VDLIST(vd)->list = filelist_sort(VDLIST(vd)->list, sort_type, sort_ascend); - /* add . and .. */ - - if (strcmp(vd->dir_fd->path, G_DIR_SEPARATOR_S) != 0) - { - filepath = g_build_filename(vd->dir_fd->path, "..", NULL); - fd = file_data_new_dir(filepath); - VDLIST(vd)->list = g_list_prepend(VDLIST(vd)->list, fd); - g_free(filepath); - } + /* add . */ if (options->file_filter.show_dot_directory) {
------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________ Geeqie-devel mailing list Geeqie-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geeqie-devel