127
121
this.use_dark_reset.connect ("clicked", Lang.bind (this,
128
this._reset_use_dark_theme));
130
/*********************** Quit on close ************************************/
131
this.quit_on_close_hbox = new Gtk.Box ({
132
orientation: Gtk.Orientation.HORIZONTAL,
136
this.list_box.add (this.quit_on_close_hbox);
138
this.quit_on_close_hbox.pack_start ((new Gtk.Label ({
139
label: _("Quit on close")
140
})), false, false, 3);
142
this.quit_on_close_hbox.pack_end ((this.quit_on_close_reset =
144
image: (new Gtk.Image ({icon_name: "edit-clear"}))
145
})), false, false, 3);
147
this.quit_on_close_hbox.pack_end ((this.quit_on_close_switch =
148
new Gtk.Switch), false, false, 3);
150
if (settings_object.get_setting ("main.quit_on_close").data !=
151
SettingsData.QUIT_ON_CLOSE.UNKNOWN) {
152
this.quit_on_close_switch.set_active (Boolean (
153
settings_object.get_setting ("main.quit_on_close")));
156
this.quit_on_close_switch.set_active (false);
159
this.quit_on_close_switch.connect ("notify::active",
160
Lang.bind (this, function () {
161
let v = settings_object.get_setting ("main.quit_on_close").data;
164
case (SettingsData.QUIT_ON_CLOSE.YES):
165
case (SettingsData.QUIT_ON_CLOSE.NO):
166
if (this.quit_on_close_switch.get_active ()) {
167
settings_object.set_setting ("main.quit_on_close", SettingsData.QUIT_ON_CLOSE.YES);
169
settings_object.set_setting ("main.quit_on_close", SettingsData.QUIT_ON_CLOSE.NO);
173
case (SettingsData.QUIT_ON_CLOSE.UNKNOWN):
174
let popover = new Gtk.Popover ({relative_to: this.quit_on_close_switch, modal: true});
175
let popover_layout1 = new Gtk.Box ({parent: popover, orientation: Gtk.Orientation.VERTICAL});
176
popover_layout1.pack_start ((new Gtk.Label ({
177
label: _("This has not been set yet, if you like to set it to a " +
178
"value, click \"yes\" or \"no\", dismiss this to not set a value"),
182
let popover_layout2 = new Gtk.Box ({orientation: Gtk.Orientation.HORIZONTAL});
183
popover_layout2.get_style_context().add_class ("linked");
184
let btn_yes = new Gtk.Button ({label: _("Yes")});
185
let btn_no = new Gtk.Button ({label: _("No")});
186
popover_layout2.pack_end (btn_yes, true, true, 0);
187
popover_layout2.pack_start (btn_no, true, true, 0);
188
popover_layout1.pack_end (popover_layout2, false, false, 0);
189
btn_no.get_style_context ().add_class("suggested-action");
191
popover.connect_after ("hide", Lang.bind (popover, function () {
195
btn_no.connect ("clicked", Lang.bind ((popover, this), function () {
196
SettingsData.get_settings ().set_setting ("main.quit_on_close",
197
SettingsData.QUIT_ON_CLOSE.NO);
198
this.quit_on_close_switch.set_active (false);
202
btn_yes.connect ("clicked", Lang.bind ((popover, this), function () {
203
SettingsData.get_settings ().set_setting ("main.quit_on_close",
204
SettingsData.QUIT_ON_CLOSE.YES);
205
this.quit_on_close_switch.set_active (true);
212
print ("WOW! Something went wrong!");
213
print (JSON.stringify(v).toString ());
122
this._reset_use_dark_theme));
218
124
/*************************** Privacy settings *****************************/
219
125
this.list_box.add ((new Gtk.Label ({label: _("Privacy settings")})));
221
127
/************************ show full name setting **************************/
128
let edit_clear_icon = new Gtk.Image ({icon_name: 'edit-clear'});
223
this.show_full_name_hbox = new Gtk.Box ({
224
orientation: Gtk.Orientation.HORIZONTAL,
130
this.show_full_name_hbox = Gtk.Box.new (Gtk.Orientation.HORIZONTAL, 5);
228
132
this.list_box.add (this.show_full_name_hbox);