[pan2] https://bugzilla.gnome.org/show_bug.cgi?id=681036
- From: Heinrich MÃller <henmull src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan2] https://bugzilla.gnome.org/show_bug.cgi?id=681036
- Date: Mon, 20 Aug 2012 09:28:21 +0000 (UTC)
commit 4162e823291a328afb491102758b9299c360571c
Author: Heinrich MÃller <henmull src gnome org>
Date: Thu Aug 2 17:33:07 2012 +0200
https://bugzilla.gnome.org/show_bug.cgi?id=681036
pan/gui/prefs-ui.cc | 7 +++++--
pan/gui/prefs-ui.h | 3 +++
2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/pan/gui/prefs-ui.cc b/pan/gui/prefs-ui.cc
index e10cb92..2e9b2d3 100644
--- a/pan/gui/prefs-ui.cc
+++ b/pan/gui/prefs-ui.cc
@@ -294,6 +294,8 @@ namespace pan
{
PrefsDialog* pd(static_cast<PrefsDialog*>(castme));
save_accels();
+ pd->prefs().set_int("prefs-last-selected-page",
+ gtk_notebook_get_current_page(GTK_NOTEBOOK(pd->notebook())));
pd->prefs().remove_listener(pd);
delete pd;
}
@@ -921,7 +923,7 @@ PrefsDialog :: PrefsDialog (Prefs& prefs, GtkWindow* parent):
g_signal_connect (dialog, "response", G_CALLBACK(response_cb), this);
g_signal_connect_swapped (dialog, "destroy", G_CALLBACK(delete_prefs_dialog), this);
- GtkWidget * notebook = gtk_notebook_new ();
+ GtkWidget* notebook = _notebook = gtk_notebook_new ();
gtk_notebook_set_scrollable (GTK_NOTEBOOK(notebook), true);
// Behavior
@@ -1290,11 +1292,12 @@ PrefsDialog :: PrefsDialog (Prefs& prefs, GtkWindow* parent):
gtk_widget_show_all (scroll);
gtk_notebook_append_page (GTK_NOTEBOOK(notebook), scroll, new_label_with_icon(_("_Shortcuts"), _("Shortcuts"), icon_prefs_hotkeys, prefs));
- gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), 0);
gtk_widget_show_all (notebook);
gtk_box_pack_start (GTK_BOX(gtk_dialog_get_content_area( GTK_DIALOG(dialog))), notebook, true, true, 0);
_root = dialog;
+ gtk_notebook_set_current_page(GTK_NOTEBOOK(notebook), prefs.get_int("prefs-last-selected-page",1));
+
}
diff --git a/pan/gui/prefs-ui.h b/pan/gui/prefs-ui.h
index 8eca180..03b82aa 100644
--- a/pan/gui/prefs-ui.h
+++ b/pan/gui/prefs-ui.h
@@ -46,6 +46,7 @@ namespace pan
PrefsDialog (Prefs&, GtkWindow*) ;
~PrefsDialog () { }
Prefs& prefs () { return _prefs; }
+ GtkWidget* notebook () { return _notebook; }
GtkWidget* root() { return _root; }
static void populate_popup_cb (GtkEntry*, GtkMenu*, gpointer);
@@ -58,6 +59,8 @@ namespace pan
Prefs& _prefs;
GtkWidget* _root;
GtkWidget* charset_label;
+ GtkWidget* _notebook;
+
void update_default_charset_label(const StringView&);
void on_prefs_flag_changed (const StringView& key, bool value) ;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]