[gnome-commander] GnomeCmdData: move Devices options to GnomeCmdData::Options
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] GnomeCmdData: move Devices options to GnomeCmdData::Options
- Date: Sat, 12 Nov 2011 21:15:06 +0000 (UTC)
commit 344bcf475650bc069e35201915fd48fada2f032d
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Sat Nov 12 22:08:16 2011 +0100
GnomeCmdData: move Devices options to GnomeCmdData::Options
src/gnome-cmd-data.cc | 11 ++++-------
src/gnome-cmd-data.h | 10 ++++++----
src/gnome-cmd-file-selector.cc | 2 +-
src/gnome-cmd-main-win.cc | 2 +-
src/gnome-cmd-options-dialog.cc | 8 ++++----
5 files changed, 16 insertions(+), 17 deletions(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 36103be..de47d96 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -836,7 +836,6 @@ GnomeCmdData::GnomeCmdData(): search_defaults(selections)
buttonbar_visibility = TRUE;
dev_icon_size = 16;
- device_only_icon = FALSE;
memset(fs_col_width, 0, sizeof(fs_col_width));
gui_update_rate = DEFAULT_GUI_UPDATE_RATE;
button_relief = GTK_RELIEF_NONE;
@@ -846,8 +845,6 @@ GnomeCmdData::GnomeCmdData(): search_defaults(selections)
use_gcmd_block = FALSE;
- skip_mounting = FALSE;
-
main_win_width = 600;
main_win_height = 400;
@@ -1081,7 +1078,7 @@ void GnomeCmdData::load()
options.alt_quick_search = gnome_cmd_data_get_bool ("/programs/alt_quick_search", FALSE);
options.quick_search_exact_match_begin = gnome_cmd_data_get_bool ("/programs/quick_search_exact_match_begin", TRUE);
options.quick_search_exact_match_end = gnome_cmd_data_get_bool ("/programs/quick_search_exact_match_end", FALSE);
- skip_mounting = gnome_cmd_data_get_bool ("/programs/skip_mounting", FALSE);
+ options.skip_mounting = gnome_cmd_data_get_bool ("/programs/skip_mounting", FALSE);
priv->symlink_prefix = gnome_cmd_data_get_string ("/options/symlink_prefix", _("link to %s"));
if (!*priv->symlink_prefix || strcmp(priv->symlink_prefix, _("link to %s"))==0)
@@ -1097,7 +1094,7 @@ void GnomeCmdData::load()
use_gcmd_block = gnome_cmd_data_get_bool ("/programs/use_gcmd_block", FALSE);
- device_only_icon = gnome_cmd_data_get_bool ("/devices/only_icon", FALSE);
+ options.device_only_icon = gnome_cmd_data_get_bool ("/devices/only_icon", FALSE);
gnome_cmd_data_get_color ("/colors/ls_colors_black_fg", options.ls_colors_palette.black_fg);
gnome_cmd_data_get_color ("/colors/ls_colors_black_bg", options.ls_colors_palette.black_bg);
@@ -1492,7 +1489,7 @@ void GnomeCmdData::save()
gnome_cmd_data_set_bool ("/programs/alt_quick_search", options.alt_quick_search);
gnome_cmd_data_set_bool ("/programs/quick_search_exact_match_begin", options.quick_search_exact_match_begin);
gnome_cmd_data_set_bool ("/programs/quick_search_exact_match_end", options.quick_search_exact_match_end);
- gnome_cmd_data_set_bool ("/programs/skip_mounting", skip_mounting);
+ gnome_cmd_data_set_bool ("/programs/skip_mounting", options.skip_mounting);
gnome_cmd_data_set_bool ("/programs/toolbar_visibility", toolbar_visibility);
gnome_cmd_data_set_bool ("/options/conbuttons_visibility", conbuttons_visibility);
@@ -1515,7 +1512,7 @@ void GnomeCmdData::save()
gnome_cmd_data_set_bool ("/programs/use_gcmd_block", use_gcmd_block);
- gnome_cmd_data_set_bool ("/devices/only_icon", device_only_icon);
+ gnome_cmd_data_set_bool ("/devices/only_icon", options.device_only_icon);
const gchar *quick_connect_uri = gnome_cmd_con_get_uri (GNOME_CMD_CON (quick_connect));
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index 40a3f44..6f98e0a 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -131,6 +131,9 @@ struct GnomeCmdData
gchar *differ;
gchar *term;
GList *fav_apps;
+ // Devices
+ gboolean device_only_icon;
+ gboolean skip_mounting;
Options(): left_mouse_button_mode(LEFT_BUTTON_OPENS_WITH_DOUBLE_CLICK),
left_mouse_button_unselects(TRUE),
@@ -171,7 +174,9 @@ struct GnomeCmdData
editor(NULL),
differ(NULL),
term(NULL),
- fav_apps(NULL)
+ fav_apps(NULL),
+ device_only_icon(FALSE),
+ skip_mounting(FALSE)
{
memset(&ls_colors_palette, 0, sizeof(ls_colors_palette));
}
@@ -399,7 +404,6 @@ struct GnomeCmdData
gboolean buttonbar_visibility;
guint dev_icon_size;
- gboolean device_only_icon;
guint fs_col_width[GnomeCmdFileList::NUM_COLUMNS];
guint gui_update_rate;
GtkReliefStyle button_relief;
@@ -409,8 +413,6 @@ struct GnomeCmdData
gboolean use_gcmd_block;
- gboolean skip_mounting;
-
gint main_win_width;
gint main_win_height;
GdkWindowState main_win_state;
diff --git a/src/gnome-cmd-file-selector.cc b/src/gnome-cmd-file-selector.cc
index 3c6c33a..34e87ca 100644
--- a/src/gnome-cmd-file-selector.cc
+++ b/src/gnome-cmd-file-selector.cc
@@ -405,7 +405,7 @@ static void create_con_buttons (GnomeCmdFileSelector *fs)
}
}
- if (!gnome_cmd_data.device_only_icon || !pm)
+ if (!gnome_cmd_data.options.device_only_icon || !pm)
{
GtkWidget *label = gtk_label_new (gnome_cmd_con_get_alias (con));
g_object_ref (label);
diff --git a/src/gnome-cmd-main-win.cc b/src/gnome-cmd-main-win.cc
index ac35531..d8f1c54 100644
--- a/src/gnome-cmd-main-win.cc
+++ b/src/gnome-cmd-main-win.cc
@@ -570,7 +570,7 @@ void GnomeCmdMainWin::update_drop_con_button(GnomeCmdFileList *fl)
return;
if (!gnome_cmd_data.toolbar_visibility
- || (gnome_cmd_data.skip_mounting && GNOME_CMD_IS_CON_DEVICE (con)))
+ || (gnome_cmd_data.options.skip_mounting && GNOME_CMD_IS_CON_DEVICE (con)))
return;
GtkWidget *btn = priv->tb_con_drop_btn;
diff --git a/src/gnome-cmd-options-dialog.cc b/src/gnome-cmd-options-dialog.cc
index e359b5a..e63b54e 100644
--- a/src/gnome-cmd-options-dialog.cc
+++ b/src/gnome-cmd-options-dialog.cc
@@ -1891,11 +1891,11 @@ inline GtkWidget *create_devices_tab (GtkWidget *parent, GnomeCmdData &cfg)
check = create_check (parent, _("Show only the icons"), "device_only_icon");
gtk_container_add (GTK_CONTAINER (cat_box), check);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), cfg.device_only_icon);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), cfg.options.device_only_icon);
check = create_check (parent, _("Skip mounting (useful when using super-mount)"), "skip_mounting");
gtk_container_add (GTK_CONTAINER (cat_box), check);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), cfg.skip_mounting);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), cfg.options.skip_mounting);
clist = (GtkWidget *) g_object_get_data (G_OBJECT (parent), "device_clist");
@@ -1912,8 +1912,8 @@ inline void store_devices_options (GtkWidget *dialog, GnomeCmdData &cfg)
GtkWidget *device_only_icon = lookup_widget (dialog, "device_only_icon");
GtkWidget *skip_mounting = lookup_widget (dialog, "skip_mounting");
- cfg.device_only_icon = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (device_only_icon));
- cfg.skip_mounting = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (skip_mounting));
+ cfg.options.device_only_icon = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (device_only_icon));
+ cfg.options.skip_mounting = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (skip_mounting));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]