summaryrefslogtreecommitdiff
path: root/src/gui/settingsWindow.vala
diff options
context:
space:
mode:
authorAlessandro Ghedini <al3xbio@gmail.com>2012-03-05 12:20:00 +0100
committerAlessandro Ghedini <al3xbio@gmail.com>2012-03-05 12:20:00 +0100
commit9efffcc071e59e6c0fe5d0b406e558cc7319e8ee (patch)
tree1f4d8d555dc439403da78c52e413be3c29833c21 /src/gui/settingsWindow.vala
parent75655ffca55cb5e5ca51d8f6a4d3d600f1f54cdc (diff)
parent98f3ef2689de06e8ab8b46a91acfa7dd2056a3a6 (diff)
Merge tag 'upstream/0.5.1'
Upstream version 0.5.1
Diffstat (limited to 'src/gui/settingsWindow.vala')
-rw-r--r--src/gui/settingsWindow.vala38
1 files changed, 36 insertions, 2 deletions
diff --git a/src/gui/settingsWindow.vala b/src/gui/settingsWindow.vala
index 1eaa0b4..0e7af20 100644
--- a/src/gui/settingsWindow.vala
+++ b/src/gui/settingsWindow.vala
@@ -32,6 +32,7 @@ public class SettingsWindow : GLib.Object {
private ThemeList? theme_list = null;
private Gtk.ToggleButton? indicator = null;
private Gtk.ToggleButton? autostart = null;
+ private Gtk.ToggleButton? captions = null;
/////////////////////////////////////////////////////////////////////
/// C'tor creates, the dialog.
@@ -47,6 +48,14 @@ public class SettingsWindow : GLib.Object {
this.window = builder.get_object("window") as Gtk.Dialog;
this.theme_list = new ThemeList();
+ this.theme_list.on_select_new.connect(() => {
+ this.captions.active = Config.global.show_captions;
+ if (Config.global.theme.has_slice_captions) {
+ this.captions.sensitive = true;
+ } else {
+ this.captions.sensitive = false;
+ }
+ });
var scroll_area = builder.get_object("theme-scrolledwindow") as Gtk.ScrolledWindow;
scroll_area.add(this.theme_list);
@@ -59,6 +68,9 @@ public class SettingsWindow : GLib.Object {
this.indicator = (builder.get_object("indicator-checkbox") as Gtk.ToggleButton);
this.indicator.toggled.connect(on_indicator_toggled);
+ this.captions = (builder.get_object("captions-checkbox") as Gtk.ToggleButton);
+ this.captions.toggled.connect(on_captions_toggled);
+
var scale_slider = (builder.get_object("scale-hscale") as Gtk.HScale);
scale_slider.set_range(0.5, 2.0);
scale_slider.set_increments(0.05, 0.25);
@@ -108,8 +120,15 @@ public class SettingsWindow : GLib.Object {
public void show() {
this.indicator.active = Config.global.show_indicator;
- this.autostart.active = Config.global.auto_start;
-
+ this.autostart.active = Config.global.auto_start;
+ this.captions.active = Config.global.show_captions;
+
+ if (Config.global.theme.has_slice_captions) {
+ this.captions.sensitive = true;
+ } else {
+ this.captions.sensitive = false;
+ }
+
this.window.show_all();
}
@@ -119,6 +138,12 @@ public class SettingsWindow : GLib.Object {
private void on_close_button_clicked() {
this.window.hide();
+
+ Logger.stats("SETTINGS " + Config.global.theme.name +
+ (this.indicator.active ? " INDICATOR" : "") +
+ (this.autostart.active ? " AUTOSTART" : "") +
+ (this.captions.active ? " CAPTIONS" : "") +
+ " %f".printf(Config.global.global_scale));
}
/////////////////////////////////////////////////////////////////////
@@ -169,6 +194,15 @@ public class SettingsWindow : GLib.Object {
var check = check_box as Gtk.CheckButton;
Config.global.show_indicator = check.active;
}
+
+ /////////////////////////////////////////////////////////////////////
+ /// Shows or hides the captions of Slices.
+ /////////////////////////////////////////////////////////////////////
+
+ private void on_captions_toggled(Gtk.ToggleButton check_box) {
+ var check = check_box as Gtk.CheckButton;
+ Config.global.show_captions = check.active;
+ }
}
}