/*
* Geeqie
* (C) 2004 John Ellis
- * Copyright (C) 2008 - 2009 The Geeqie Team
+ * Copyright (C) 2008 - 2012 The Geeqie Team
*
* Author: John Ellis
*
gpointer submenu_item_get_data(GtkWidget *menu)
{
- if (!menu->parent || !GTK_IS_MENU(menu->parent)) return NULL;
+ if (!gtk_widget_get_parent(menu) || !GTK_IS_MENU(gtk_widget_get_parent(menu))) return NULL;
- return g_object_get_data(G_OBJECT(menu->parent), "submenu_data");
+ return g_object_get_data(G_OBJECT(gtk_widget_get_parent(menu)), "submenu_data");
}
/*
work = work->next;
gboolean active = TRUE;
- if (fd_list && EDITOR_ERRORS(editor_command_parse(editor, fd_list, NULL)))
+ if (fd_list && EDITOR_ERRORS(editor_command_parse(editor, fd_list, FALSE, NULL)))
active = FALSE;
if (active)
g_signal_connect(G_OBJECT(item), "destroy", G_CALLBACK(edit_item_destroy_cb), key);
}
}
-
+
g_list_free(editors_list);
}
case SORT_TIME:
return _("Sort by date");
break;
+ case SORT_EXIFTIME:
+ return _("Sort by Exif-date");
+ break;
case SORT_NONE:
return _("Unsorted");
break;
return "";
}
-static GtkWidget *submenu_add_sort_item(GtkWidget *menu, GtkWidget *parent,
+static GtkWidget *submenu_add_sort_item(GtkWidget *menu,
GCallback func, SortType type,
gboolean show_current, SortType show_type)
{
if (show_current)
{
- item = menu_item_add_radio(menu, parent,
- sort_type_get_text(type), (type == show_type),
+ item = menu_item_add_radio(menu,
+ sort_type_get_text(type), GINT_TO_POINTER((gint)type), (type == show_type),
func, GINT_TO_POINTER((gint)type));
}
else
gboolean show_current, SortType type)
{
GtkWidget *submenu;
- GtkWidget *parent;
submenu = gtk_menu_new();
g_object_set_data(G_OBJECT(submenu), "submenu_data", data);
- parent = submenu_add_sort_item(submenu, NULL, func, SORT_NAME, show_current, type);
+ submenu_add_sort_item(submenu, func, SORT_NAME, show_current, type);
#ifdef HAVE_STRVERSCMP
- submenu_add_sort_item(submenu, parent, func, SORT_NUMBER, show_current, type);
+ submenu_add_sort_item(submenu, func, SORT_NUMBER, show_current, type);
#endif
- submenu_add_sort_item(submenu, parent, func, SORT_TIME, show_current, type);
- submenu_add_sort_item(submenu, parent, func, SORT_SIZE, show_current, type);
- if (include_path) submenu_add_sort_item(submenu, parent, func, SORT_PATH, show_current, type);
- if (include_none) submenu_add_sort_item(submenu, parent, func, SORT_NONE, show_current, type);
+ submenu_add_sort_item(submenu, func, SORT_TIME, show_current, type);
+ submenu_add_sort_item(submenu, func, SORT_EXIFTIME, show_current, type);
+ submenu_add_sort_item(submenu, func, SORT_SIZE, show_current, type);
+ if (include_path) submenu_add_sort_item(submenu, func, SORT_PATH, show_current, type);
+ if (include_none) submenu_add_sort_item(submenu, func, SORT_NONE, show_current, type);
if (menu)
{