/*
- * Geeqie
- * (C) 2004 John Ellis
- * Copyright (C) 2008 - 2012 The Geeqie Team
+ * Copyright (C) 2004 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
*
* Author: John Ellis
*
- * This software is released under the GNU General Public License (GNU GPL).
- * Please read the included file COPYING for more information.
- * This software comes with no warranty of any kind, use at your own risk!
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-
#include "main.h"
#include "menu.h"
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_CTIME:
+ return _("Sort by file creation date");
+ break;
case SORT_EXIFTIME:
return _("Sort by Exif-date");
break;
submenu_add_sort_item(submenu, func, SORT_NUMBER, show_current, type);
#endif
submenu_add_sort_item(submenu, func, SORT_TIME, show_current, type);
+ submenu_add_sort_item(submenu, func, SORT_CTIME, 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);
return submenu;
}
+gchar *zoom_type_get_text(ZoomMode method)
+{
+ switch (method)
+ {
+ case ZOOM_RESET_ORIGINAL:
+ return _("Zoom to original size");
+ break;
+ case ZOOM_RESET_FIT_WINDOW:
+ return _("Fit image to window");
+ break;
+ case ZOOM_RESET_NONE:
+ return _("Leave Zoom at previous setting");
+ break;
+ default:
+ return _("Zoom to original size");
+ break;
+ }
+
+ return "";
+}
+
+static GtkWidget *submenu_add_zoom_item(GtkWidget *menu,
+ GCallback func, ZoomMode mode,
+ gboolean show_current, ZoomMode show_mode)
+{
+ GtkWidget *item;
+
+ if (show_current)
+ {
+ item = menu_item_add_radio(menu,
+ zoom_type_get_text(mode), GINT_TO_POINTER((gint)mode), (mode == show_mode),
+ func, GINT_TO_POINTER((gint)mode));
+ }
+ else
+ {
+ item = menu_item_add(menu, zoom_type_get_text(mode),
+ func, GINT_TO_POINTER((gint)mode));
+ }
+
+ return item;
+}
+
+GtkWidget *submenu_add_zoom(GtkWidget *menu, GCallback func, gpointer data,
+ gboolean include_none, gboolean include_path,
+ gboolean show_current, ZoomMode mode)
+{
+ GtkWidget *submenu;
+
+ if (!menu)
+ {
+ submenu = gtk_menu_new();
+ g_object_set_data(G_OBJECT(submenu), "submenu_data", data);
+ }
+ else
+ {
+ submenu = menu;
+ }
+
+ submenu_add_zoom_item(submenu, func, ZOOM_RESET_ORIGINAL, show_current, mode);
+ submenu_add_zoom_item(submenu, func, ZOOM_RESET_FIT_WINDOW, show_current, mode);
+ submenu_add_zoom_item(submenu, func, ZOOM_RESET_NONE, show_current, mode);
+
+ if (menu)
+ {
+ GtkWidget *item;
+
+ item = menu_item_add(menu, _("Zoom"), NULL, NULL);
+ gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu);
+ return item;
+ }
+
+ return submenu;
+}
+
/*
*-----------------------------------------------------------------------------
* altering