[gnome-commander] GnomeCmdData: move Confirmation options to GnomeCmdData::Options
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] GnomeCmdData: move Confirmation options to GnomeCmdData::Options
- Date: Thu, 10 Nov 2011 22:32:17 +0000 (UTC)
commit 6ddea693a976cce231a84780d02bbde27db1cb77
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Thu Nov 10 23:27:07 2011 +0100
GnomeCmdData: move Confirmation options to GnomeCmdData::Options
src/gnome-cmd-data.cc | 21 ++++++++-------------
src/gnome-cmd-data.h | 16 ++++++++++------
src/gnome-cmd-delete-dialog.cc | 2 +-
src/gnome-cmd-file-list.cc | 2 +-
src/gnome-cmd-options-dialog.cc | 32 ++++++++++++++++----------------
src/gnome-cmd-prepare-copy-dialog.cc | 2 +-
src/gnome-cmd-prepare-move-dialog.cc | 2 +-
7 files changed, 38 insertions(+), 39 deletions(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index eea5736..55c57c3 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -830,11 +830,6 @@ GnomeCmdData::GnomeCmdData(): search_defaults(selections)
XML_cfg_has_connections = FALSE;
XML_cfg_has_bookmarks = FALSE;
- confirm_delete = TRUE;
- confirm_copy_overwrite = GNOME_CMD_CONFIRM_OVERWRITE_QUERY;
- confirm_move_overwrite = GNOME_CMD_CONFIRM_OVERWRITE_QUERY;
- confirm_mouse_dnd = TRUE;
-
memset(&filter_settings, 0, sizeof(filter_settings));
filter_settings.hidden = TRUE;
filter_settings.backup = TRUE;
@@ -1009,10 +1004,10 @@ void GnomeCmdData::load()
options.list_row_height = gnome_cmd_data_get_int ("/options/list_row_height", 16);
- confirm_delete = gnome_cmd_data_get_bool ("/confirm/delete", TRUE);
- confirm_copy_overwrite = (GnomeCmdConfirmOverwriteMode) gnome_cmd_data_get_int ("/confirm/copy_overwrite", GNOME_CMD_CONFIRM_OVERWRITE_QUERY);
- confirm_move_overwrite = (GnomeCmdConfirmOverwriteMode) gnome_cmd_data_get_int ("/confirm/move_overwrite", GNOME_CMD_CONFIRM_OVERWRITE_QUERY);
- confirm_mouse_dnd = gnome_cmd_data_get_bool ("/confirm/confirm_mouse_dnd", TRUE);
+ options.confirm_delete = gnome_cmd_data_get_bool ("/confirm/delete", TRUE);
+ options.confirm_copy_overwrite = (GnomeCmdConfirmOverwriteMode) gnome_cmd_data_get_int ("/confirm/copy_overwrite", GNOME_CMD_CONFIRM_OVERWRITE_QUERY);
+ options.confirm_move_overwrite = (GnomeCmdConfirmOverwriteMode) gnome_cmd_data_get_int ("/confirm/move_overwrite", GNOME_CMD_CONFIRM_OVERWRITE_QUERY);
+ options.confirm_mouse_dnd = gnome_cmd_data_get_bool ("/confirm/confirm_mouse_dnd", TRUE);
filter_settings.file_types[GNOME_VFS_FILE_TYPE_UNKNOWN] = gnome_cmd_data_get_bool ("/options/show_unknown", FALSE);
filter_settings.file_types[GNOME_VFS_FILE_TYPE_REGULAR] = gnome_cmd_data_get_bool ("/options/show_regular", FALSE);
@@ -1445,10 +1440,10 @@ void GnomeCmdData::save()
gnome_cmd_data_set_string ("/options/date_disp_mode", utf8_date_format);
g_free (utf8_date_format);
- gnome_cmd_data_set_bool ("/confirm/delete", confirm_delete);
- gnome_cmd_data_set_int ("/confirm/copy_overwrite", confirm_copy_overwrite);
- gnome_cmd_data_set_int ("/confirm/move_overwrite", confirm_move_overwrite);
- gnome_cmd_data_set_bool ("/confirm/confirm_mouse_dnd", confirm_mouse_dnd);
+ gnome_cmd_data_set_bool ("/confirm/delete", options.confirm_delete);
+ gnome_cmd_data_set_int ("/confirm/copy_overwrite", options.confirm_copy_overwrite);
+ gnome_cmd_data_set_int ("/confirm/move_overwrite", options.confirm_move_overwrite);
+ gnome_cmd_data_set_bool ("/confirm/confirm_mouse_dnd", options.confirm_mouse_dnd);
gnome_cmd_data_set_bool ("/options/show_unknown", filter_settings.file_types[GNOME_VFS_FILE_TYPE_UNKNOWN]);
gnome_cmd_data_set_bool ("/options/show_regular", filter_settings.file_types[GNOME_VFS_FILE_TYPE_REGULAR]);
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index 553d5e1..f6e4c8e 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -99,6 +99,11 @@ struct GnomeCmdData
// Tabs
gboolean always_show_tabs;
int tab_lock_indicator;
+ // Confirmation
+ gboolean confirm_delete;
+ GnomeCmdConfirmOverwriteMode confirm_copy_overwrite;
+ GnomeCmdConfirmOverwriteMode confirm_move_overwrite;
+ gboolean confirm_mouse_dnd;
Options(): left_mouse_button_mode(LEFT_BUTTON_OPENS_WITH_DOUBLE_CLICK),
left_mouse_button_unselects(TRUE),
@@ -126,7 +131,11 @@ struct GnomeCmdData
theme_icon_dir(NULL),
document_icon_dir(NULL),
always_show_tabs(FALSE),
- tab_lock_indicator(TAB_LOCK_ICON)
+ tab_lock_indicator(TAB_LOCK_ICON),
+ confirm_delete(TRUE),
+ confirm_copy_overwrite(GNOME_CMD_CONFIRM_OVERWRITE_QUERY),
+ confirm_move_overwrite(GNOME_CMD_CONFIRM_OVERWRITE_QUERY),
+ confirm_mouse_dnd(TRUE)
{
memset(&ls_colors_palette, 0, sizeof(ls_colors_palette));
}
@@ -294,11 +303,6 @@ struct GnomeCmdData
gboolean XML_cfg_has_connections;
gboolean XML_cfg_has_bookmarks;
- gboolean confirm_delete;
- GnomeCmdConfirmOverwriteMode confirm_copy_overwrite;
- GnomeCmdConfirmOverwriteMode confirm_move_overwrite;
- gboolean confirm_mouse_dnd;
-
Options options;
FilterSettings filter_settings;
diff --git a/src/gnome-cmd-delete-dialog.cc b/src/gnome-cmd-delete-dialog.cc
index 19c3fa8..cf8c291 100644
--- a/src/gnome-cmd-delete-dialog.cc
+++ b/src/gnome-cmd-delete-dialog.cc
@@ -259,7 +259,7 @@ void gnome_cmd_delete_dialog_show (GList *files)
gint response = 1;
- if (gnome_cmd_data.confirm_delete)
+ if (gnome_cmd_data.options.confirm_delete)
{
gchar *msg = NULL;
diff --git a/src/gnome-cmd-file-list.cc b/src/gnome-cmd-file-list.cc
index 3e1becf..70b44ff 100644
--- a/src/gnome-cmd-file-list.cc
+++ b/src/gnome-cmd-file-list.cc
@@ -2786,7 +2786,7 @@ static void drag_data_received (GtkWidget *widget, GdkDragContext *context, gint
gdk_display_get_pointer (gdk_display_get_default (), NULL, &x, &y, &mask);
- if (gnome_cmd_data.confirm_mouse_dnd && !(mask&(GDK_SHIFT_MASK|GDK_CONTROL_MASK)))
+ if (gnome_cmd_data.options.confirm_mouse_dnd && !(mask&(GDK_SHIFT_MASK|GDK_CONTROL_MASK)))
{
gpointer *arr = g_new (gpointer, 2);
diff --git a/src/gnome-cmd-options-dialog.cc b/src/gnome-cmd-options-dialog.cc
index 2f18ccb..50866fb 100644
--- a/src/gnome-cmd-options-dialog.cc
+++ b/src/gnome-cmd-options-dialog.cc
@@ -909,7 +909,7 @@ inline GtkWidget *create_confirmation_tab (GtkWidget *parent, GnomeCmdData &cfg)
check = create_check (parent, _("Confirm before delete"), "confirm_delete_check");
gtk_box_pack_start (GTK_BOX (cat_box), check, FALSE, TRUE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), cfg.confirm_delete);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), cfg.options.confirm_delete);
/* Copy overwrite options
@@ -920,15 +920,15 @@ inline GtkWidget *create_confirmation_tab (GtkWidget *parent, GnomeCmdData &cfg)
radio = create_radio (parent, NULL, _("Silently"), "copy_overwrite_silently");
gtk_box_pack_start (GTK_BOX (cat_box), radio, FALSE, TRUE, 0);
- if (cfg.confirm_copy_overwrite==GNOME_CMD_CONFIRM_OVERWRITE_SILENTLY)
+ if (cfg.options.confirm_copy_overwrite==GNOME_CMD_CONFIRM_OVERWRITE_SILENTLY)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE);
radio = create_radio (parent, get_radio_group (radio), _("Query first"), "copy_overwrite_query");
gtk_container_add (GTK_CONTAINER (cat_box), radio);
- if (cfg.confirm_copy_overwrite==GNOME_CMD_CONFIRM_OVERWRITE_QUERY)
+ if (cfg.options.confirm_copy_overwrite==GNOME_CMD_CONFIRM_OVERWRITE_QUERY)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE);
radio = create_radio (parent, get_radio_group (radio), _("Skip all"), "copy_overwrite_skip_all");
gtk_container_add (GTK_CONTAINER (cat_box), radio);
- if (cfg.confirm_copy_overwrite==GNOME_CMD_CONFIRM_OVERWRITE_SKIP_ALL)
+ if (cfg.options.confirm_copy_overwrite==GNOME_CMD_CONFIRM_OVERWRITE_SKIP_ALL)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE);
@@ -940,15 +940,15 @@ inline GtkWidget *create_confirmation_tab (GtkWidget *parent, GnomeCmdData &cfg)
radio = create_radio (parent, NULL, _("Silently"), "move_overwrite_silently");
gtk_box_pack_start (GTK_BOX (cat_box), radio, FALSE, TRUE, 0);
- if (cfg.confirm_move_overwrite==GNOME_CMD_CONFIRM_OVERWRITE_SILENTLY)
+ if (cfg.options.confirm_move_overwrite==GNOME_CMD_CONFIRM_OVERWRITE_SILENTLY)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE);
radio = create_radio (parent, get_radio_group (radio), _("Query first"), "move_overwrite_query");
gtk_container_add (GTK_CONTAINER (cat_box), radio);
- if (cfg.confirm_move_overwrite==GNOME_CMD_CONFIRM_OVERWRITE_QUERY)
+ if (cfg.options.confirm_move_overwrite==GNOME_CMD_CONFIRM_OVERWRITE_QUERY)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE);
radio = create_radio (parent, get_radio_group (radio), _("Skip all"), "move_overwrite_skip_all");
gtk_container_add (GTK_CONTAINER (cat_box), radio);
- if (cfg.confirm_move_overwrite==GNOME_CMD_CONFIRM_OVERWRITE_SKIP_ALL)
+ if (cfg.options.confirm_move_overwrite==GNOME_CMD_CONFIRM_OVERWRITE_SKIP_ALL)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio), TRUE);
@@ -960,7 +960,7 @@ inline GtkWidget *create_confirmation_tab (GtkWidget *parent, GnomeCmdData &cfg)
check = create_check (parent, _("Confirm mouse operation"), "confirm_mouse_dnd_check");
gtk_box_pack_start (GTK_BOX (cat_box), check, FALSE, TRUE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), cfg.confirm_mouse_dnd);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), cfg.options.confirm_mouse_dnd);
return frame;
@@ -978,23 +978,23 @@ inline void store_confirmation_options (GtkWidget *dialog, GnomeCmdData &cfg)
GtkWidget *confirm_move_skip_all = lookup_widget (dialog, "move_overwrite_skip_all");
GtkWidget *confirm_mouse_dnd_check = lookup_widget (dialog, "confirm_mouse_dnd_check");
- cfg.confirm_delete = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (confirm_delete_check));
+ cfg.options.confirm_delete = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (confirm_delete_check));
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (confirm_copy_silent)))
- cfg.confirm_copy_overwrite = GNOME_CMD_CONFIRM_OVERWRITE_SILENTLY;
+ cfg.options.confirm_copy_overwrite = GNOME_CMD_CONFIRM_OVERWRITE_SILENTLY;
else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (confirm_copy_query)))
- cfg.confirm_copy_overwrite = GNOME_CMD_CONFIRM_OVERWRITE_QUERY;
+ cfg.options.confirm_copy_overwrite = GNOME_CMD_CONFIRM_OVERWRITE_QUERY;
else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (confirm_copy_skip_all)))
- cfg.confirm_copy_overwrite = GNOME_CMD_CONFIRM_OVERWRITE_SKIP_ALL;
+ cfg.options.confirm_copy_overwrite = GNOME_CMD_CONFIRM_OVERWRITE_SKIP_ALL;
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (confirm_move_silent)))
- cfg.confirm_move_overwrite = GNOME_CMD_CONFIRM_OVERWRITE_SILENTLY;
+ cfg.options.confirm_move_overwrite = GNOME_CMD_CONFIRM_OVERWRITE_SILENTLY;
else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (confirm_move_query)))
- cfg.confirm_move_overwrite = GNOME_CMD_CONFIRM_OVERWRITE_QUERY;
+ cfg.options.confirm_move_overwrite = GNOME_CMD_CONFIRM_OVERWRITE_QUERY;
else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (confirm_move_skip_all)))
- cfg.confirm_move_overwrite = GNOME_CMD_CONFIRM_OVERWRITE_SKIP_ALL;
+ cfg.options.confirm_move_overwrite = GNOME_CMD_CONFIRM_OVERWRITE_SKIP_ALL;
- cfg.confirm_mouse_dnd = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (confirm_mouse_dnd_check));
+ cfg.options.confirm_mouse_dnd = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (confirm_mouse_dnd_check));
}
diff --git a/src/gnome-cmd-prepare-copy-dialog.cc b/src/gnome-cmd-prepare-copy-dialog.cc
index bed33fc..6e29bff 100644
--- a/src/gnome-cmd-prepare-copy-dialog.cc
+++ b/src/gnome-cmd-prepare-copy-dialog.cc
@@ -108,7 +108,7 @@ void gnome_cmd_prepare_copy_dialog_show (GnomeCmdFileSelector *from, GnomeCmdFil
gtk_widget_show (data->skip);
gtk_box_pack_start (GTK_BOX (data->dialog->left_vbox), data->skip, FALSE, FALSE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (g_slist_nth_data (group, gnome_cmd_data.confirm_copy_overwrite)), TRUE);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (g_slist_nth_data (group, gnome_cmd_data.options.confirm_copy_overwrite)), TRUE);
data->follow_links = gtk_check_button_new_with_label (_("Follow Links"));
diff --git a/src/gnome-cmd-prepare-move-dialog.cc b/src/gnome-cmd-prepare-move-dialog.cc
index 42ca018..6387fd3 100644
--- a/src/gnome-cmd-prepare-move-dialog.cc
+++ b/src/gnome-cmd-prepare-move-dialog.cc
@@ -101,7 +101,7 @@ void gnome_cmd_prepare_move_dialog_show (GnomeCmdFileSelector *from, GnomeCmdFil
gtk_widget_show (data->skip);
gtk_box_pack_start (GTK_BOX (data->dialog->left_vbox), data->skip, FALSE, FALSE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (g_slist_nth_data (group, gnome_cmd_data.confirm_move_overwrite)), TRUE);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (g_slist_nth_data (group, gnome_cmd_data.options.confirm_move_overwrite)), TRUE);
// Customize prepare xfer widgets
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]