From: Colin Clark Date: Sat, 7 Jul 2018 18:50:31 +0000 (+0100) Subject: Collections changes X-Git-Tag: v1.5~110 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?p=geeqie.git;a=commitdiff_plain;h=da34a2b65ab4d922fbad9a9ef4a51deee17e15a2 Collections changes Implement a file class for Collections Include an icon for collections (temporary icon until someone creates an appropriate one) Double-click on a .gqv icon in the files pane opens the collection window Option in Preferences/Behavior to open collection windows on top N.B. current users have to manually edit the Collections entry in Preferences/Files to change the collections class from metadata to collection --- diff --git a/doc/docbook/GuideOptionsBehavior.xml b/doc/docbook/GuideOptionsBehavior.xml index a5c61020..c166c2d0 100644 --- a/doc/docbook/GuideOptionsBehavior.xml +++ b/doc/docbook/GuideOptionsBehavior.xml @@ -132,6 +132,22 @@ Save all marks that have been set. Note that marks that are linked to a keyword will always be saved irrespective of this setting. + + + Use "With Rename" as default for Copy/Move dialogs + + + Move the "With Rename" button to the default position. + + + + + Open Collections on top + + + Open collection windows with "Always on Top" set. + + Recent folder list maximum size diff --git a/doc/docbook/GuideOptionsFiltering.xml b/doc/docbook/GuideOptionsFiltering.xml index 371d8d5c..55e560d4 100644 --- a/doc/docbook/GuideOptionsFiltering.xml +++ b/doc/docbook/GuideOptionsFiltering.xml @@ -152,12 +152,14 @@ This may be used to define sets of file types, for use in the Grouping - function described above. The drop-down list has 4 entries: + function described above. The drop-down list has 6 entries: Unknown Image RAW Image Metadata + Video + Collection diff --git a/src/collect.c b/src/collect.c index 57730136..046c24b5 100644 --- a/src/collect.c +++ b/src/collect.c @@ -1288,6 +1288,10 @@ CollectWindow *collection_window_new(const gchar *path) gtk_window_set_geometry_hints(GTK_WINDOW(cw->window), NULL, &geometry, GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE); + if (options->collections_on_top) + { + gtk_window_set_keep_above(GTK_WINDOW(cw->window), TRUE); + } if (options->save_window_positions && path && collection_load_only_geometry(cw->cd, path)) { diff --git a/src/filefilter.c b/src/filefilter.c index 84324966..0a3df19e 100644 --- a/src/filefilter.c +++ b/src/filefilter.c @@ -254,7 +254,7 @@ void filter_add_defaults(void) /* non-image files that might be desirable to show */ filter_add_if_missing("xmp", "XMP sidecar", ".xmp", FORMAT_CLASS_META, TRUE, FALSE, TRUE); filter_add_if_missing("meta", "GQview legacy metadata", GQ_CACHE_EXT_METADATA, FORMAT_CLASS_META, TRUE, FALSE, TRUE); - filter_add_if_missing("gqv", GQ_APPNAME " image collection", GQ_COLLECTION_EXT, FORMAT_CLASS_META, FALSE, FALSE, TRUE); + filter_add_if_missing("gqv", GQ_APPNAME " image collection", GQ_COLLECTION_EXT, FORMAT_CLASS_COLLECTION, FALSE, FALSE, TRUE); filter_add_if_missing("ufraw", "UFRaw ID file", ".ufraw", FORMAT_CLASS_META, FALSE, FALSE, TRUE); filter_add_if_missing("pto", "Panorama script file", ".pto", FORMAT_CLASS_META, FALSE, FALSE, TRUE); @@ -469,6 +469,7 @@ FileFormatClass filter_file_get_class(const gchar *name) if (filter_file_class(name, FORMAT_CLASS_RAWIMAGE)) return FORMAT_CLASS_RAWIMAGE; if (filter_file_class(name, FORMAT_CLASS_META)) return FORMAT_CLASS_META; if (filter_file_class(name, FORMAT_CLASS_VIDEO)) return FORMAT_CLASS_VIDEO; + if (filter_file_class(name, FORMAT_CLASS_COLLECTION)) return FORMAT_CLASS_COLLECTION; return FORMAT_CLASS_UNKNOWN; } diff --git a/src/icons/Makefile.am b/src/icons/Makefile.am index ac8fce70..9bc0c031 100644 --- a/src/icons/Makefile.am +++ b/src/icons/Makefile.am @@ -15,6 +15,7 @@ ICONS_INLINE = \ sheet_metadata.png \ sheet_unknown.png \ sheet_video.png \ + collection.png \ icon_float.png \ icon_thumb.png \ icon_book.png \ @@ -36,6 +37,7 @@ ICONS_INLINE_PAIRS = \ icon_metadata $(srcdir)/sheet_metadata.png \ icon_unknown $(srcdir)/sheet_unknown.png \ icon_video $(srcdir)/sheet_video.png \ + icon_collection $(srcdir)/collection.png \ icon_book $(srcdir)/icon_book.png \ icon_config $(srcdir)/icon_config.png \ icon_tools $(srcdir)/icon_tools.png \ diff --git a/src/icons/collection.png b/src/icons/collection.png new file mode 100644 index 00000000..8132285d Binary files /dev/null and b/src/icons/collection.png differ diff --git a/src/image.c b/src/image.c index 4ad1cd66..e644a6df 100644 --- a/src/image.c +++ b/src/image.c @@ -697,6 +697,8 @@ static void image_load_done_cb(ImageLoader *il, gpointer data) break; case FORMAT_CLASS_VIDEO: pixbuf = pixbuf_inline(PIXBUF_INLINE_VIDEO); + case FORMAT_CLASS_COLLECTION: + pixbuf = pixbuf_inline(PIXBUF_INLINE_COLLECTION); break; default: pixbuf = pixbuf_inline(PIXBUF_INLINE_BROKEN); diff --git a/src/options.c b/src/options.c index b3e0ced5..d7c02fc8 100644 --- a/src/options.c +++ b/src/options.c @@ -83,6 +83,7 @@ ConfOptions *init_options(ConfOptions *options) options->marks_save = TRUE; options->with_rename = FALSE; + options->collections_on_top = FALSE; memset(&options->image.border_color, 0, sizeof(options->image.border_color)); memset(&options->image.alpha_color_1, 0, sizeof(options->image.alpha_color_1)); diff --git a/src/options.h b/src/options.h index a1300e9a..95181c1d 100644 --- a/src/options.h +++ b/src/options.h @@ -66,6 +66,7 @@ struct _ConfOptions gchar *marks_tooltips[FILEDATA_MARKS_SIZE]; gboolean with_rename; + gboolean collections_on_top; gchar *help_search_engine; diff --git a/src/pixbuf_util.c b/src/pixbuf_util.c index acefbdd3..bb2469ca 100644 --- a/src/pixbuf_util.c +++ b/src/pixbuf_util.c @@ -111,6 +111,7 @@ static PixbufInline inline_pixbuf_data[] = { { PIXBUF_INLINE_METADATA, icon_metadata }, { PIXBUF_INLINE_UNKNOWN, icon_unknown }, { PIXBUF_INLINE_VIDEO, icon_video }, + { PIXBUF_INLINE_COLLECTION, icon_collection }, { PIXBUF_INLINE_ICON, gqview_icon }, { PIXBUF_INLINE_LOGO, geeqie_logo }, { PIXBUF_INLINE_ICON_FLOAT, icon_float }, @@ -254,6 +255,9 @@ GdkPixbuf *pixbuf_fallback(FileData *fd, gint requested_width, gint requested_he case FORMAT_CLASS_VIDEO: pixbuf = pixbuf_inline(PIXBUF_INLINE_VIDEO); break; + case FORMAT_CLASS_COLLECTION: + pixbuf = pixbuf_inline(PIXBUF_INLINE_COLLECTION); + break; default: pixbuf = pixbuf_inline(PIXBUF_INLINE_BROKEN); } diff --git a/src/pixbuf_util.h b/src/pixbuf_util.h index 2cf1d8c7..b4a61d7a 100644 --- a/src/pixbuf_util.h +++ b/src/pixbuf_util.h @@ -43,6 +43,7 @@ gboolean pixbuf_scale_aspect(gint req_w, gint req_h, gint old_w, gint old_h, gin #define PIXBUF_INLINE_METADATA "metadata" #define PIXBUF_INLINE_UNKNOWN "unknown" #define PIXBUF_INLINE_VIDEO "video" +#define PIXBUF_INLINE_COLLECTION "collection" #define PIXBUF_INLINE_ICON "icon" #define PIXBUF_INLINE_LOGO "logo" diff --git a/src/preferences.c b/src/preferences.c index e319c62e..3eb493f9 100644 --- a/src/preferences.c +++ b/src/preferences.c @@ -109,7 +109,8 @@ gchar *format_class_list[] = { N_("Image"), N_("RAW Image"), N_("Metadata"), - N_("Video") + N_("Video"), + N_("Collection") }; /* config memory values */ @@ -410,6 +411,7 @@ static void config_window_apply(void) options->marks_save = c_options->marks_save; options->with_rename = c_options->with_rename; + options->collections_on_top = c_options->collections_on_top; config_entry_to_option(help_search_engine_entry, &options->help_search_engine, NULL); options->read_metadata_in_idle = c_options->read_metadata_in_idle; @@ -2544,6 +2546,7 @@ static void config_tab_behavior(GtkWidget *notebook) GtkWidget *table; GtkWidget *marks; GtkWidget *with_rename; + GtkWidget *collections_on_top; vbox = scrolled_notebook_page(notebook, _("Behavior")); @@ -2605,6 +2608,10 @@ static void config_tab_behavior(GtkWidget *notebook) options->with_rename, &c_options->with_rename); gtk_widget_set_tooltip_text(with_rename,"Change the default button for Copy/Move dialogs"); + collections_on_top = pref_checkbox_new_int(group, _("Open collections on top"), + options->collections_on_top, &c_options->collections_on_top); + gtk_widget_set_tooltip_text(collections_on_top,"Open collections window on top"); + pref_spin_new_int(group, _("Recent folder list maximum size"), NULL, 1, 50, 1, options->open_recent_list_maxsize, &c_options->open_recent_list_maxsize); diff --git a/src/rcfile.c b/src/rcfile.c index 804e92f0..a68ab470 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -348,6 +348,7 @@ static void write_global_attributes(GString *outstr, gint indent) WRITE_NL(); WRITE_CHAR(*options, help_search_engine); WRITE_NL(); WRITE_BOOL(*options, with_rename); + WRITE_NL(); WRITE_BOOL(*options, collections_on_top); /* File operations Options */ WRITE_NL(); WRITE_BOOL(*options, file_ops.enable_in_place_rename); @@ -681,6 +682,8 @@ static gboolean load_global_params(const gchar **attribute_names, const gchar ** if (READ_BOOL(*options, marks_save)) continue; if (READ_CHAR(*options, help_search_engine)) continue; + if (READ_BOOL(*options, collections_on_top)) continue; + /* Properties dialog options */ if (READ_CHAR(*options, properties.tabs_order)) continue; diff --git a/src/typedefs.h b/src/typedefs.h index b23e5750..66e828c8 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -143,6 +143,7 @@ typedef enum { FORMAT_CLASS_RAWIMAGE, FORMAT_CLASS_META, FORMAT_CLASS_VIDEO, + FORMAT_CLASS_COLLECTION, FILE_FORMAT_CLASSES } FileFormatClass; diff --git a/src/view_file/view_file_icon.c b/src/view_file/view_file_icon.c index fea73b94..210af6c8 100644 --- a/src/view_file/view_file_icon.c +++ b/src/view_file/view_file_icon.c @@ -1367,8 +1367,15 @@ gboolean vficon_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer dat if (bevent->type == GDK_2BUTTON_PRESS && vf->layout) { - vficon_selection_remove(vf, VFICON(vf)->click_fd, SELECTION_PRELIGHT, &iter); - layout_image_full_screen_start(vf->layout); + if (VFICON(vf)->click_fd->format_class == FORMAT_CLASS_COLLECTION) + { + collection_window_new(VFICON(vf)->click_fd->path); + } + else + { + vficon_selection_remove(vf, VFICON(vf)->click_fd, SELECTION_PRELIGHT, &iter); + layout_image_full_screen_start(vf->layout); + } } break; case MOUSE_BUTTON_RIGHT: diff --git a/src/view_file/view_file_list.c b/src/view_file/view_file_list.c index 650592d9..168bf57f 100644 --- a/src/view_file/view_file_list.c +++ b/src/view_file/view_file_list.c @@ -24,6 +24,7 @@ #include "bar.h" #include "cache_maint.h" +#include "collect.h" #include "dnd.h" #include "editors.h" #include "img-view.h" @@ -39,6 +40,7 @@ #include "uri_utils.h" #include "view_file.h" + #include /* for keyboard values */ /* Index to tree store */ @@ -644,7 +646,14 @@ gboolean vflist_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer dat if (bevent->button == MOUSE_BUTTON_LEFT && bevent->type == GDK_2BUTTON_PRESS) { - if (vf->layout) layout_image_full_screen_start(vf->layout); + if (VFLIST(vf)->click_fd->format_class == FORMAT_CLASS_COLLECTION) + { + collection_window_new(VFLIST(vf)->click_fd->path); + } + else + { + if (vf->layout) layout_image_full_screen_start(vf->layout); + } } return FALSE; diff --git a/web/help/GuideOptionsBehavior.html b/web/help/GuideOptionsBehavior.html index f64f91d5..84ce4cea 100644 --- a/web/help/GuideOptionsBehavior.html +++ b/web/help/GuideOptionsBehavior.html @@ -579,6 +579,18 @@ dd.answer div.label { float: left; }

Save all marks that have been set. Note that marks that are linked to a keyword will always be saved irrespective of this setting.

+
+ Use "With Rename" as default for Copy/Move dialogs +
+
+

Move the "With Rename" button to the default position.

+
+
+ Open Collections on top +
+
+

Open collection windows with "Always on Top" set.

+
Recent folder list maximum size
diff --git a/web/help/GuideOptionsFiltering.html b/web/help/GuideOptionsFiltering.html index fa516e4b..6fdc9f3d 100644 --- a/web/help/GuideOptionsFiltering.html +++ b/web/help/GuideOptionsFiltering.html @@ -593,12 +593,14 @@ dd.answer div.label { float: left; }
This may be used to define sets of file types, for use in the Grouping - function described above. The drop-down list has 4 entries: + function described above. The drop-down list has 6 entries:
  • Unknown
  • Image
  • RAW Image
  • Metadata
  • +
  • Video
  • +
  • Collection