[gnome-commander] Options: save tabs on exit
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Options: save tabs on exit
- Date: Thu, 1 Jul 2010 21:57:07 +0000 (UTC)
commit 46c18f41cd2f20ccb28590bf565f964691ec76de
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Thu Jul 1 23:38:38 2010 +0200
Options: save tabs on exit
src/gnome-cmd-data.cc | 6 ++++++
src/gnome-cmd-data.h | 2 ++
src/gnome-cmd-options-dialog.cc | 12 ++++++++++++
3 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index e1df881..4cce00d 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -940,6 +940,8 @@ GnomeCmdData::GnomeCmdData()
cmdline_history = NULL;
cmdline_history_length = 0;
+ save_tabs_on_exit = TRUE;
+
allow_multiple_instances = FALSE;
use_internal_viewer = TRUE;
use_gcmd_block = FALSE;
@@ -1221,6 +1223,8 @@ void GnomeCmdData::load()
gnome_cmd_data_get_color ("/colors/ls_colors_white_fg", priv->ls_colors_palette.white_fg);
gnome_cmd_data_get_color ("/colors/ls_colors_white_bg", priv->ls_colors_palette.white_bg);
+ save_tabs_on_exit = gnome_cmd_data_get_bool ("/options/save_tabs_on_exit", TRUE);
+
priv->start_dirs[LEFT] = gnome_cmd_data_get_string ("/options/start_dir_left", g_get_home_dir ());
priv->start_dirs[RIGHT] = gnome_cmd_data_get_string ("/options/start_dir_right", g_get_home_dir ());
@@ -1638,6 +1642,8 @@ void GnomeCmdData::save()
g_free (tmp);
}
+ gnome_cmd_data_set_bool ("/options/save_tabs_on_exit", save_tabs_on_exit);
+
gnome_cmd_data_set_string ("/options/start_dir_left", priv->start_dirs[LEFT]);
gnome_cmd_data_set_string ("/options/start_dir_right", priv->start_dirs[RIGHT]);
gnome_cmd_data_set_string ("/defaults/last_pattern", priv->last_pattern);
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index f980bf9..81cddbe 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -227,6 +227,8 @@ struct GnomeCmdData
GList *cmdline_history;
gint cmdline_history_length;
+ gboolean save_tabs_on_exit;
+
gboolean allow_multiple_instances;
gboolean use_internal_viewer;
gboolean use_gcmd_block;
diff --git a/src/gnome-cmd-options-dialog.cc b/src/gnome-cmd-options-dialog.cc
index c94a75e..0950d2a 100644
--- a/src/gnome-cmd-options-dialog.cc
+++ b/src/gnome-cmd-options-dialog.cc
@@ -154,6 +154,16 @@ static GtkWidget *create_general_tab (GtkWidget *parent)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), !gnome_cmd_data.allow_multiple_instances);
+ // Save on exit
+ cat_box = create_vbox (parent, FALSE, 0);
+ cat = create_category (parent, cat_box, _("Save on exit"));
+ gtk_box_pack_start (GTK_BOX (vbox), cat, FALSE, TRUE, 0);
+
+ check = create_check (parent, _("Tabs"), "save_tabs");
+ gtk_box_pack_start (GTK_BOX (cat_box), check, FALSE, TRUE, 0);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), gnome_cmd_data.save_tabs_on_exit);
+
+
return frame;
}
@@ -167,6 +177,7 @@ inline void store_general_options (GnomeCmdOptionsDialog *dialog)
GtkWidget *case_sens_check = lookup_widget (GTK_WIDGET (dialog), "case_sens_check");
GtkWidget *alt_quick_search = lookup_widget (GTK_WIDGET (dialog), "alt_quick_search");
GtkWidget *multiple_instance_check = lookup_widget (GTK_WIDGET (dialog), "multiple_instance_check");
+ GtkWidget *save_tabs = lookup_widget (GTK_WIDGET (dialog), "save_tabs");
gnome_cmd_data.left_mouse_button_mode = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (lmb_singleclick_radio)) ? GnomeCmdData::LEFT_BUTTON_OPENS_WITH_SINGLE_CLICK : GnomeCmdData::LEFT_BUTTON_OPENS_WITH_DOUBLE_CLICK;
@@ -183,6 +194,7 @@ inline void store_general_options (GnomeCmdOptionsDialog *dialog)
gnome_cmd_data.case_sens_sort = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (case_sens_check));
gnome_cmd_data.alt_quick_search = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (alt_quick_search));
gnome_cmd_data.allow_multiple_instances = !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (multiple_instance_check));
+ gnome_cmd_data.save_tabs_on_exit = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (save_tabs));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]