spek

Acoustic spectrum analyser
git clone http://git.hanabi.in/repos/spek.git
Log | Files | Refs | README

commit 4abb8c7f9947d9fe879f9136a9813b46a3ed77b7
parent 273eeeaac4c96d092d2a467c3e43195678488e15
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date:   Sun, 27 Mar 2011 16:58:41 +0800

Select the active language in the preferences

Diffstat:
Msrc/spek-preferences-dialog.vala | 10++++++++--
Msrc/spek-preferences.vala | 4++--
2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/spek-preferences-dialog.vala b/src/spek-preferences-dialog.vala @@ -45,9 +45,15 @@ namespace Spek { var language_label = new Label.with_mnemonic (_("_Language:")); language_box.pack_start (language_label, false, false, 0); var language_combo = new ComboBox.text (); - for (int i = 0; i < Preferences.instance.languages.length[0]; i++) { - language_combo.append_text (Preferences.instance.languages[i,1]); + int active_language = 0; + var prefs = Preferences.instance; + for (int i = 0; i < prefs.languages.length[0]; i++) { + language_combo.append_text (prefs.languages[i,1]); + if (prefs.languages[i,0] == prefs.language) { + active_language = i; + } } + language_combo.active = active_language; language_label.mnemonic_widget = language_combo; language_box.pack_start (language_combo, false, false, 0); general_subbox.pack_start(language_box, false, false, 0); diff --git a/src/spek-preferences.vala b/src/spek-preferences.vala @@ -79,13 +79,13 @@ namespace Spek { public int last_update { get { try { - return key_file.get_integer ("update", "last_update"); + return key_file.get_integer ("update", "last"); } catch (KeyFileError e) { } return 0; } set { - key_file.set_integer ("update", "last_update", value); + key_file.set_integer ("update", "last", value); } }