Use gtk_label_set_[x,y]align instead of gtk_misc_set_alignment
[geeqie.git] / src / preferences.c
index e8c2743..0928026 100644 (file)
@@ -245,8 +245,10 @@ static gboolean accel_apply_cb(GtkTreeModel *model, GtkTreePath *path, GtkTreeIt
 
 static void config_window_apply(void)
 {
-       gint i;
        gboolean refresh = FALSE;
+#ifdef HAVE_LCMS2
+       int i = 0;
+#endif
 
        config_entry_to_option(safe_delete_path_entry, &options->file_ops.safe_delete_path, remove_trailing_slash);
 
@@ -267,6 +269,7 @@ static void config_window_apply(void)
        options->tools_restore_state = c_options->tools_restore_state;
        options->save_window_positions = c_options->save_window_positions;
        options->use_saved_window_positions_for_new_windows = c_options->use_saved_window_positions_for_new_windows;
+       options->save_window_workspace = c_options->save_window_workspace;
        options->save_dialog_window_positions = c_options->save_dialog_window_positions;
        options->show_window_ids = c_options->show_window_ids;
        options->image.scroll_reset_method = c_options->image.scroll_reset_method;
@@ -426,6 +429,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;
+       options->hide_window_in_fullscreen = c_options->hide_window_in_fullscreen;
        config_entry_to_option(help_search_engine_entry, &options->help_search_engine, NULL);
 
        options->read_metadata_in_idle = c_options->read_metadata_in_idle;
@@ -454,6 +458,8 @@ static void config_window_apply(void)
        options->mouse_button_8 = c_options->mouse_button_8;
        options->mouse_button_9 = c_options->mouse_button_9;
 
+       options->override_disable_gpu = c_options->override_disable_gpu;
+
        config_tab_keywords_save();
 
        image_options_sync();
@@ -548,9 +554,6 @@ static void quality_menu_cb(GtkWidget *combo, gpointer data)
                case 2:
                        *option = GDK_INTERP_BILINEAR;
                        break;
-               case 3:
-                       *option = GDK_INTERP_HYPER;
-                       break;
                }
 }
 
@@ -579,12 +582,16 @@ static void clipboard_selection_menu_cb(GtkWidget *combo, gpointer data)
        switch (gtk_combo_box_get_active(GTK_COMBO_BOX(combo)))
                {
                case 0:
-               default:
-                       *option = PRIMARY;
+                       *option = CLIPBOARD_PRIMARY;
                        break;
                case 1:
-                       *option = CLIPBOARD;
+                       *option = CLIPBOARD_CLIPBOARD;
+                       break;
+               case 2:
+                       *option = CLIPBOARD_BOTH;
                        break;
+               default:
+                       *option = CLIPBOARD_BOTH;
                }
 }
 
@@ -604,10 +611,8 @@ static void add_quality_menu(GtkWidget *table, gint column, gint row, const gcha
        if (option == GDK_INTERP_NEAREST) current = 0;
        gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Tiles"));
        if (option == GDK_INTERP_TILES) current = 1;
-       gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Bilinear"));
+       gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Bilinear (best, but slowest)"));
        if (option == GDK_INTERP_BILINEAR) current = 2;
-       gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Hyper (best, but slowest)"));
-       if (option == GDK_INTERP_HYPER) current = 3;
 
        gtk_combo_box_set_active(GTK_COMBO_BOX(combo), current);
 
@@ -657,10 +662,12 @@ static void add_clipboard_selection_menu(GtkWidget *table, gint column, gint row
 
        combo = gtk_combo_box_text_new();
 
-       gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("PRIMARY"));
-       if (option == PRIMARY) current = 0;
-       gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("CLIPBOARD"));
-       if (option == CLIPBOARD) current = 1;
+       gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Primary"));
+       if (option == CLIPBOARD_PRIMARY) current = 0;
+       gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Clipboard"));
+       if (option == CLIPBOARD_CLIPBOARD) current = 1;
+       gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(combo), _("Both"));
+       if (option == CLIPBOARD_BOTH) current = 2;
 
        gtk_combo_box_set_active(GTK_COMBO_BOX(combo), current);
 
@@ -2186,6 +2193,9 @@ static void config_tab_image(GtkWidget *notebook)
        GtkWidget *table;
        GtkWidget *spin;
        GtkWidget *two_pass;
+#ifdef HAVE_CLUTTER
+       GtkWidget *gpu_accel;
+#endif
 
        vbox = scrolled_notebook_page(notebook, _("Image"));
 
@@ -2193,19 +2203,23 @@ static void config_tab_image(GtkWidget *notebook)
 
        table = pref_table_new(group, 2, 1, FALSE, FALSE);
        add_quality_menu(table, 0, 0, _("Quality:"), options->image.zoom_quality, &c_options->image.zoom_quality);
-       if (options->image.use_clutter_renderer)
+       if (options->image.use_clutter_renderer && !options->disable_gpu)
                {
                gtk_widget_set_sensitive(table, FALSE);
                }
 
 #ifdef HAVE_CLUTTER
-       pref_checkbox_new_int(group, _("Use GPU acceleration via Clutter library (Requires restart)"),
+       gpu_accel = pref_checkbox_new_int(group, _("Use GPU acceleration via Clutter library (Requires restart)"),
                              options->image.use_clutter_renderer, &c_options->image.use_clutter_renderer);
+       if (options->disable_gpu && !options->override_disable_gpu)
+               {
+               gtk_widget_set_sensitive(gpu_accel, FALSE);
+               }
 #endif
 
        two_pass = pref_checkbox_new_int(group, _("Two pass rendering (apply HQ zoom and color correction in second pass)"),
                              options->image.zoom_2pass, &c_options->image.zoom_2pass);
-       if (options->image.use_clutter_renderer)
+       if (options->image.use_clutter_renderer && !options->disable_gpu)
                {
                gtk_widget_set_sensitive(two_pass, FALSE);
                }
@@ -2285,6 +2299,10 @@ static void config_tab_windows(GtkWidget *notebook)
                                       options->use_saved_window_positions_for_new_windows, &c_options->use_saved_window_positions_for_new_windows);
        pref_checkbox_link_sensitivity(ct_button, button);
 
+       button = 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_new_int(group, _("Remember tool state (float/hidden)"),
                              options->tools_restore_state, &c_options->tools_restore_state);
 
@@ -2649,7 +2667,8 @@ static void config_tab_metadata(GtkWidget *notebook)
        label = pref_label_new(group, _("Warning: Geeqie is built without Exiv2. Some options are disabled."));
 #endif
        label = pref_label_new(group, _("Metadata are written in the following order. The process ends after first success."));
-       gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+       gtk_label_set_xalign(GTK_LABEL(label), 0.0);
+       gtk_label_set_yalign(GTK_LABEL(label), 0.5);
 
        ct_button = pref_checkbox_new_int(group, _("1) Save metadata in image files, or sidecar files, according to the XMP standard"),
                              options->metadata.save_in_image_file, &c_options->metadata.save_in_image_file);
@@ -2662,7 +2681,8 @@ static void config_tab_metadata(GtkWidget *notebook)
 
        text = g_strdup_printf(_("3) Save metadata in Geeqie private directory '%s'"), get_metadata_cache_dir());
        label = pref_label_new(group, text);
-       gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+       gtk_label_set_xalign(GTK_LABEL(label), 0.0);
+       gtk_label_set_yalign(GTK_LABEL(label), 0.5);
        gtk_misc_set_padding(GTK_MISC(label), 22, 0);
        g_free(text);
 
@@ -3253,6 +3273,8 @@ static void config_tab_behavior(GtkWidget *notebook)
        GtkWidget *marks;
        GtkWidget *with_rename;
        GtkWidget *collections_on_top;
+       GtkWidget *hide_window_in_fullscreen;
+       GtkWidget *checkbox;
 
        vbox = scrolled_notebook_page(notebook, _("Behavior"));
 
@@ -3328,6 +3350,10 @@ static void config_tab_behavior(GtkWidget *notebook)
                                options->collections_on_top, &c_options->collections_on_top);
        gtk_widget_set_tooltip_text(collections_on_top,"Open collections window on top");
 
+       hide_window_in_fullscreen = pref_checkbox_new_int(group, _("Hide window in fullscreen"),
+                               options->hide_window_in_fullscreen, &c_options->hide_window_in_fullscreen);
+       gtk_widget_set_tooltip_text(hide_window_in_fullscreen,"When alt-tabbing, prevent Geeqie window showing twice");
+
        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);
 
@@ -3363,6 +3389,14 @@ static void config_tab_behavior(GtkWidget *notebook)
        table = pref_table_new(group, 2, 1, FALSE, FALSE);
        add_mouse_selection_menu(table, 0, 0, _("Mouse button Forward:"), options->mouse_button_9, &c_options->mouse_button_9);
 
+       pref_spacer(group, PREF_PAD_GROUP);
+
+       group = pref_group_new(vbox, FALSE, _("GPU"), GTK_ORIENTATION_VERTICAL);
+
+       checkbox = pref_checkbox_new_int(group, _("Override disable GPU"),
+                               options->override_disable_gpu, &c_options->override_disable_gpu);
+       gtk_widget_set_tooltip_text(checkbox, "Contact the developers for usage");
+
 #ifdef DEBUG
        pref_spacer(group, PREF_PAD_GROUP);