* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#include "main.h"
#include "preferences.h"
+#include <config.h>
+
+#include <cstdlib>
+#include <cstring>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+#include <gdk/gdk.h>
+#include <gio/gio.h>
+#include <glib-object.h>
+
+#if HAVE_SPELL
+#include <gspell/gspell.h>
+#endif
+
+#if HAVE_LCMS
+#if HAVE_LCMS2
+#include <lcms2.h>
+#else
+#include <lcms.h>
+#endif
+#endif
+
+#include <pango/pango.h>
+
#include "bar-keywords.h"
#include "cache.h"
#include "color-man.h"
+#include "compat.h"
+#include "debug.h"
#include "editors.h"
#include "filedata.h"
#include "filefilter.h"
#include "fullscreen.h"
-#include "image.h"
#include "image-overlay.h"
+#include "image.h"
#include "img-view.h"
+#include "intl.h"
#include "layout-util.h"
+#include "layout.h"
+#include "main-defines.h"
+#include "main.h"
#include "metadata.h"
#include "misc.h"
+#include "options.h"
#include "osd.h"
#include "pixbuf-util.h"
#include "rcfile.h"
#include "slideshow.h"
+#include "third-party/zonedetect.h"
#include "toolbar.h"
#include "trash.h"
-#include "utilops.h"
+#include "typedefs.h"
#include "ui-fileops.h"
#include "ui-misc.h"
#include "ui-tabcomp.h"
+#include "ui-utildlg.h"
+#include "utilops.h"
#include "window.h"
-#include "zonedetect.h"
-#ifdef HAVE_LCMS
-#ifdef HAVE_LCMS2
-#include <lcms2.h>
-#else
-#include <lcms.h>
-#endif
-#endif
+struct ZoneDetect;
-#ifdef HAVE_SPELL
-#include <gspell/gspell.h>
-#endif
-
-#define EDITOR_NAME_MAX_LENGTH 32
-#define EDITOR_COMMAND_MAX_LENGTH 1024
+enum {
+ EDITOR_NAME_MAX_LENGTH = 32,
+ EDITOR_COMMAND_MAX_LENGTH = 1024
+};
static void image_overlay_set_text_colors();
static GtkWidget *sidecar_ext_entry;
static GtkWidget *help_search_engine_entry;
+static GtkWidget *log_window_f1_entry;
-#define CONFIG_WINDOW_DEF_WIDTH 700
-#define CONFIG_WINDOW_DEF_HEIGHT 600
+
+enum {
+ CONFIG_WINDOW_DEF_WIDTH = 700,
+ CONFIG_WINDOW_DEF_HEIGHT = 600
+};
/*
*-----------------------------------------------------------------------------
static void slideshow_delay_hours_cb(GtkWidget *spin, gpointer)
{
- gint mins_secs_tenths, delay;
+ gint mins_secs_tenths;
+ gint delay;
mins_secs_tenths = c_options->slideshow.delay %
(3600 * SLIDESHOW_SUBSECOND_PRECISION);
static void slideshow_delay_minutes_cb(GtkWidget *spin, gpointer)
{
- gint hours, secs_tenths, delay;
+ gint hours;
+ gint secs_tenths;
+ gint delay;
hours = c_options->slideshow.delay / (3600 * SLIDESHOW_SUBSECOND_PRECISION);
secs_tenths = c_options->slideshow.delay % (60 * SLIDESHOW_SUBSECOND_PRECISION);
static void slideshow_delay_seconds_cb(GtkWidget *spin, gpointer)
{
- gint hours_mins, delay;
+ gint hours_mins;
+ gint delay;
hours_mins = c_options->slideshow.delay / (60 * SLIDESHOW_SUBSECOND_PRECISION);
static gboolean accel_apply_cb(GtkTreeModel *model, GtkTreePath *, GtkTreeIter *iter, gpointer)
{
- gchar *accel_path, *accel;
+ gchar *accel_path;
+ gchar *accel;
gtk_tree_model_get(model, iter, AE_ACCEL, &accel_path, AE_KEY, &accel, -1);
static void config_window_apply()
{
gboolean refresh = FALSE;
-#ifdef HAVE_LCMS2
+#if HAVE_LCMS2
int i = 0;
#endif
if (options->thumbnails.max_width != c_options->thumbnails.max_width
|| options->thumbnails.max_height != c_options->thumbnails.max_height
|| options->thumbnails.quality != c_options->thumbnails.quality)
- {
- thumb_format_changed = TRUE;
+ {
+ thumb_format_changed = TRUE;
refresh = TRUE;
options->thumbnails.max_width = c_options->thumbnails.max_width;
options->thumbnails.max_height = c_options->thumbnails.max_height;
options->show_predefined_keyword_tree = c_options->show_predefined_keyword_tree;
options->expand_menu_toolbar = c_options->expand_menu_toolbar;
+ options->hamburger_menu = c_options->hamburger_menu;
options->selectable_bars.menu_bar = c_options->selectable_bars.menu_bar;
options->selectable_bars.tool_bar = c_options->selectable_bars.tool_bar;
options->threads.duplicates = c_options->threads.duplicates > 0 ? c_options->threads.duplicates : -1;
+ options->alternate_similarity_algorithm.enabled = c_options->alternate_similarity_algorithm.enabled;
+ options->alternate_similarity_algorithm.grayscale = c_options->alternate_similarity_algorithm.grayscale;
+
#ifdef DEBUG
set_debug_level(debug_c);
+ config_entry_to_option(log_window_f1_entry, &options->log_window.action, nullptr);
#endif
-#ifdef HAVE_LCMS
+#if HAVE_LCMS
for (i = 0; i < COLOR_PROFILE_INPUTS; i++)
{
config_entry_to_option(color_profile_input_name_entry[i], &options->color_profile.input_name[i], nullptr);
current = -1;
for (i = 0; static_cast<guint>(i) < sizeof(thumb_size_list) / sizeof(ThumbSize); i++)
{
- gint w, h;
+ gint w;
+ gint h;
gchar *buf;
w = thumb_size_list[i].w;
static void accel_store_populate()
{
LayoutWindow *lw;
- GList *groups, *actions;
+ GList *groups;
+ GList *actions;
GtkAction *action;
const gchar *accel_path;
GtkAccelKey key;
accel_path = gtk_action_get_accel_path(action);
if (accel_path && gtk_accel_map_lookup_entry(accel_path, &key))
{
- gchar *label, *label2, *tooltip, *accel;
+ gchar *label;
+ gchar *label2;
+ gchar *tooltip;
+ gchar *accel;
g_object_get(action,
"tooltip", &tooltip,
"label", &label,
GtkTreeIter iter;
gchar *acc;
gchar *accel_path;
- GtkAccelKey old_key, key;
+ GtkAccelKey old_key;
+ GtkAccelKey key;
GtkTreePath *path = gtk_tree_path_new_from_string(path_string);
gtk_tree_model_get_iter(model, &iter, path);
void accel_reset_selection(GtkTreeModel *model, GtkTreePath *, GtkTreeIter *iter, gpointer)
{
GtkAccelKey key;
- gchar *accel_path, *accel;
+ gchar *accel_path;
+ gchar *accel;
gtk_tree_model_get(model, iter, AE_ACCEL, &accel_path, -1);
gtk_accel_map_lookup_entry(accel_path, &key);
GtkWidget *ct_button;
GtkWidget *table;
GtkWidget *spin;
- gint hours, minutes, remainder;
+ gint hours;
+ gint minutes;
+ gint remainder;
gdouble seconds;
GtkWidget *star_rating_entry;
GString *str;
options->thumbnails.collection_preview, &c_options->thumbnails.collection_preview);
gtk_widget_set_tooltip_text(spin, _("The maximum number of thumbnails shown in a Collection preview montage"));
-#ifdef HAVE_FFMPEGTHUMBNAILER_METADATA
+#if HAVE_FFMPEGTHUMBNAILER_METADATA
pref_checkbox_new_int(group, _("Use embedded metadata in video files as thumbnails when available"),
options->thumbnails.use_ft_metadata, &c_options->thumbnails.use_ft_metadata);
#endif
pref_spacer(group, PREF_PAD_GROUP);
- group = pref_group_new(vbox, FALSE, _("Expand menu and toolbar"), GTK_ORIENTATION_VERTICAL);
+ group = pref_group_new(vbox, FALSE, _("Menu style"), GTK_ORIENTATION_VERTICAL);
- pref_checkbox_new_int(group, _("Expand menu and toolbar (NOTE! Geeqie must be restarted for change to take effect)"),
+ pref_checkbox_new_int(group, _("☰ style menu button (NOTE! Geeqie must be restarted for change to take effect)"),
+ options->hamburger_menu, &c_options->hamburger_menu);
+ gtk_widget_set_tooltip_text(group, _("Use a ☰ style menu button instead of the classic style across the top of the frame"));
+
+ pref_spacer(group, PREF_PAD_GROUP);
+
+ group = pref_group_new(vbox, FALSE, _("Expand toolbar"), GTK_ORIENTATION_VERTICAL);
+
+ pref_checkbox_new_int(group, _("Expand menu/toolbar (NOTE! Geeqie must be restarted for change to take effect)"),
options->expand_menu_toolbar, &c_options->expand_menu_toolbar);
- gtk_widget_set_tooltip_text(group, _("Expand the menu and toolbar to the full width of the window"));
+ gtk_widget_set_tooltip_text(group, _("Expand the menu/toolbar to the full width of the window"));
pref_spacer(group, PREF_PAD_GROUP);
gtk_widget_set_tooltip_text(GTK_WIDGET(hbox), _("Enable this to allow Geeqie to increase the image size for images that are smaller than the current view area when the zoom is set to \"Fit image to window\". This value sets the maximum expansion permitted in percent i.e. 100% is full-size."));
hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
- ct_button = pref_checkbox_new_int(hbox, _("Virtual window size (% of actual window):"),
+ ct_button = pref_checkbox_new_int(hbox, _("Virtual window size (%% of actual window):"),
options->image.limit_autofit_size, &c_options->image.limit_autofit_size);
spin = pref_spin_new_int(hbox, nullptr, nullptr,
10, 150, 1,
GtkWidget *group;
GtkWidget *subgroup;
GtkWidget *button;
+ GtkWidget *checkbox;
GtkWidget *ct_button;
GtkWidget *spin;
ct_button = pref_checkbox_new_int(group, _("Remember session"),
options->save_window_positions, &c_options->save_window_positions);
- button = pref_checkbox_new_int(group, _("Use saved window positions also for new windows"),
+ checkbox = pref_checkbox_new_int(group, _("Use saved window positions also for new windows"),
options->use_saved_window_positions_for_new_windows, &c_options->use_saved_window_positions_for_new_windows);
- pref_checkbox_link_sensitivity(ct_button, button);
+ pref_checkbox_link_sensitivity(ct_button, checkbox);
- button = pref_checkbox_new_int(group, _("Remember window workspace"),
+ checkbox = pref_checkbox_new_int(group, _("Remember window workspace"),
options->save_window_workspace, &c_options->save_window_workspace);
- pref_checkbox_link_sensitivity(ct_button, button);
+ pref_checkbox_link_sensitivity(ct_button, checkbox);
pref_checkbox_new_int(group, _("Remember tool state (float/hidden)"),
options->tools_restore_state, &c_options->tools_restore_state);
options->fullscreen.disable_saver, &c_options->fullscreen.disable_saver);
}
-#define PRE_FORMATTED_COLUMNS 5
+enum {
+ PRE_FORMATTED_COLUMNS = 5
+};
static void config_tab_osd(GtkWidget *notebook)
{
GtkWidget *hbox;
group = pref_group_new(vbox, FALSE, _("Metadata writing sequence"), GTK_ORIENTATION_VERTICAL);
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
label = pref_label_new(group, _("Warning: Geeqie is built without Exiv2. Some options are disabled."));
#endif
label = pref_label_new(group, _("When writing metadata, Geeqie will follow these steps, if selected. This process will stop when the first successful write occurs."));
gtk_widget_set_tooltip_markup(ct_button, markup);
g_free(markup);
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
gtk_widget_set_sensitive(ct_button, FALSE);
#endif
pref_spacer(group, PREF_PAD_GROUP);
group = pref_group_new(vbox, FALSE, _("Step 1 Options:"), GTK_ORIENTATION_VERTICAL);
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
gtk_widget_set_sensitive(group, FALSE);
#endif
pref_spacer(group, PREF_PAD_GROUP);
group = pref_group_new(vbox, FALSE, _("Steps 2 and 3 Option:"), GTK_ORIENTATION_VERTICAL);
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
gtk_widget_set_sensitive(group, FALSE);
#endif
ct_button = pref_checkbox_new_int(group, _("Write altered image orientation to the metadata"), options->metadata.write_orientation, &c_options->metadata.write_orientation);
gtk_widget_set_tooltip_text(ct_button, _("If checked, the results of orientation commands (Rotate, Mirror and Flip) issued on an image will be written to metadata\nNote: If this option is not checked, the results of orientation commands will be lost when Geeqie closes"));
-#ifndef HAVE_EXIV2
+#if !HAVE_EXIV2
gtk_widget_set_sensitive(ct_button, FALSE);
#endif
pref_spacer(group, PREF_PAD_GROUP);
-#ifdef HAVE_SPELL
+#if HAVE_SPELL
group = pref_group_new(vbox, FALSE, _("Spelling checks"), GTK_ORIENTATION_VERTICAL);
ct_button = pref_checkbox_new_int(group, _("Check spelling - Requires restart"), options->metadata.check_spelling, &c_options->metadata.check_spelling);
guint idle_id; /* event source id */
};
-#define KEYWORD_DIALOG_WIDTH 400
+enum {
+ KEYWORD_DIALOG_WIDTH = 400
+};
static void keywords_find_folder(KeywordFindData *kfd, FileData *dir_fd)
{
return (G_SOURCE_CONTINUE);
}
- else if (kfd->list_dir)
+
+ if (kfd->list_dir)
{
FileData *fd;
static void config_tab_keywords_save()
{
- GtkTextIter start, end;
+ GtkTextIter start;
+ GtkTextIter end;
GtkTextBuffer *buffer;
GList *kw_list = nullptr;
GList *work;
GtkTextIter iter;
GtkTextBuffer *buffer;
gchar *tmp;
-#ifdef HAVE_SPELL
+#if HAVE_SPELL
GspellTextView *gspell_view;
#endif
gq_gtk_box_pack_start(GTK_BOX(group), scrolled, TRUE, TRUE, 0);
gtk_widget_show(scrolled);
-#ifdef HAVE_SPELL
+#if HAVE_SPELL
if (options->metadata.check_spelling)
{
gspell_view = gspell_text_view_get_from_gtk_text_view(GTK_TEXT_VIEW(keyword_text));
}
/* metadata tab */
-#ifdef HAVE_LCMS
+#if HAVE_LCMS
static void intent_menu_cb(GtkWidget *combo, gpointer data)
{
auto option = static_cast<gint *>(data);
vbox = scrolled_notebook_page(notebook, _("Color management"));
group = pref_group_new(vbox, FALSE, _("Input profiles"), GTK_ORIENTATION_VERTICAL);
-#ifndef HAVE_LCMS
+#if !HAVE_LCMS
gtk_widget_set_sensitive(pref_group_parent(group), FALSE);
#endif
}
group = pref_group_new(vbox, FALSE, _("Screen profile"), GTK_ORIENTATION_VERTICAL);
-#ifndef HAVE_LCMS
+#if !HAVE_LCMS
gtk_widget_set_sensitive(pref_group_parent(group), FALSE);
#endif
pref_checkbox_new_int(group, _("Use system screen profile if available"),
options->color_profile.screen_file, nullptr, ".icc", "ICC Files", nullptr);
tab_completion_add_select_button(color_profile_screen_file_entry, _("Select color profile"), FALSE);
gtk_widget_set_size_request(color_profile_screen_file_entry, 160, -1);
-#ifdef HAVE_LCMS
+#if HAVE_LCMS
add_intent_menu(table, 0, 1, _("Render Intent:"), options->color_profile.render_intent, &c_options->color_profile.render_intent);
#endif
gq_gtk_grid_attach(GTK_GRID(table), tabcomp, 1, 2, 0, 1, static_cast<GtkAttachOptions>(GTK_FILL | GTK_EXPAND), static_cast<GtkAttachOptions>(0), 0, 0);
pref_spin_new_int(group, _("Log Window max. lines:"), nullptr,
1, 99999, 1, options->log_window_lines, &options->log_window_lines);
+
+ hbox = pref_box_new(group, FALSE, GTK_ORIENTATION_HORIZONTAL, PREF_PAD_SPACE);
+ pref_label_new(hbox, _("Log Window F1 command: "));
+ log_window_f1_entry = gtk_entry_new();
+ gq_gtk_entry_set_text(GTK_ENTRY(log_window_f1_entry), options->log_window.action);
+ gq_gtk_box_pack_start(GTK_BOX(hbox), log_window_f1_entry, FALSE, FALSE, 0);
+ gtk_entry_set_width_chars(GTK_ENTRY(log_window_f1_entry), 15);
+ gtk_widget_show(log_window_f1_entry);
#endif
}
static void config_tab_advanced(GtkWidget *notebook)
{
- GtkWidget *vbox;
- GtkWidget *group;
- GSList *formats_list;
- GList *extensions_list = nullptr;
gchar **extensions;
- GtkWidget *tabcomp;
GdkPixbufFormat *fm;
gint i;
+ GList *extensions_list = nullptr;
+ GSList *formats_list;
GString *types_string = g_string_new(nullptr);
- GtkWidget *types_string_label;
- GtkWidget *threads_string_label;
+ GtkWidget *alternate_checkbox;
GtkWidget *dupes_threads_spin;
+ GtkWidget *group;
+ GtkWidget *subgroup;
+ GtkWidget *tabcomp;
+ GtkWidget *threads_string_label;
+ GtkWidget *types_string_label;
+ GtkWidget *vbox;
vbox = scrolled_notebook_page(notebook, _("Advanced"));
group = pref_group_new(vbox, FALSE, _("External preview extraction"), GTK_ORIENTATION_VERTICAL);
dupes_threads_spin = pref_spin_new_int(vbox, _("Duplicate check:"), _("max. threads"), 0, get_cpu_cores(), 1, options->threads.duplicates, &c_options->threads.duplicates);
gtk_widget_set_tooltip_markup(dupes_threads_spin, _("Set to 0 for unlimited"));
+
+ pref_spacer(group, PREF_PAD_GROUP);
+
+ pref_line(vbox, PREF_PAD_SPACE);
+
+ group = pref_group_new(vbox, FALSE, _("Alternate similarity alogorithm"), GTK_ORIENTATION_VERTICAL);
+
+ alternate_checkbox = pref_checkbox_new_int(group, _("Enable alternate similarity algorithm"), options->alternate_similarity_algorithm.enabled, &c_options->alternate_similarity_algorithm.enabled);
+
+ subgroup = pref_box_new(group, FALSE, GTK_ORIENTATION_VERTICAL, PREF_PAD_GAP);
+ pref_checkbox_link_sensitivity(alternate_checkbox, subgroup);
+
+ alternate_checkbox = pref_checkbox_new_int(subgroup, _("Use grayscale"), options->alternate_similarity_algorithm.grayscale, &c_options->alternate_similarity_algorithm.grayscale);
+ gtk_widget_set_tooltip_text(alternate_checkbox, _("Reduce fingerprint to grayscale"));
}
/* stereo tab */