1
/* This file is part of GPump, a Pump.io client.
3
* GPump (THE SOFTWARE) is made available under the terms and conditions of the
4
* GNU Lesser General Public Licence 3.0. A copy of the licence can be read
5
* in the file lgpl-3.0.txt in the root of this project.
8
const Gtk = imports.gi.Gtk;
9
const Lang = imports.lang;
10
const _ = imports.gettext.gettext;
12
const SettingsData = imports.settings_data;
14
const PreferencesUI = Lang.Class ({
21
title: _("GPump preferences")
24
this._prepare_header_bar ();
25
this._prepare_list_box ();
27
this.set_property ('resizable', false);
32
_prepare_header_bar: function () {
34
this.headerbar = this.get_header_bar ();
35
this.headerbar.set_show_close_button (false);
36
this.headerbar.pack_end ((this.close_btn = new Gtk.Button ({
40
this.close_btn.connect ('clicked', Lang.bind (this, function () {
46
_prepare_list_box: function () {
47
/*this.get_content_area ().pack_start ()),
49
this.get_content_area ().set_center_widget (
50
(this.list_box = new Gtk.ListBox ({
53
selection_mode: Gtk.SelectionMode.NONE
56
let settings_object = SettingsData.get_settings ();
58
/*************************** Use dark setting *****************************/
59
let edit_clear_icon = new Gtk.Image ({icon_name: 'edit-clear'});
61
this.use_dark_hbox = Gtk.Box.new (Gtk.Orientation.HORIZONTAL, 5);
63
this.list_box.add (this.use_dark_hbox);
65
this.use_dark_hbox.pack_start ((new Gtk.Label ({
66
label: _("Use dark theme")
69
this.use_dark_hbox.pack_end ((this.use_dark_reset =
71
image: edit_clear_icon})),
73
this.use_dark_hbox.pack_end ((this.use_dark_switch = new Gtk.Switch ()),
76
this.use_dark_switch.set_active (
77
settings_object.get_setting("main.use_dark").data
80
/*************************** Privacy settings *****************************/
81
this.list_box.add ((new Gtk.Label ({label: _("Privacy settings")})));
83
/************************ show full name setting **************************/
84
let edit_clear_icon = new Gtk.Image ({icon_name: 'edit-clear'});
86
this.show_full_name_hbox = Gtk.Box.new (Gtk.Orientation.HORIZONTAL, 5);
88
this.list_box.add (this.show_full_name_hbox);
90
this.show_full_name_hbox.pack_start ((new Gtk.Label ({
91
label: _("Show full name")
94
this.show_full_name_hbox.pack_end ((this.show_full_name_reset =
96
image: edit_clear_icon})),
98
this.show_full_name_hbox.pack_end (
99
(this.show_full_name_switch = new Gtk.Switch ()),
101
this.show_full_name_switch.set_active (
102
settings_object.get_setting ("main.privacy.show_full_name").data
105
/*********************** only show avatar setting **************************/
106
let edit_clear_icon = new Gtk.Image ({icon_name: 'edit-clear'});
108
this.only_show_avatar_hbox = Gtk.Box.new (Gtk.Orientation.HORIZONTAL, 5);
110
this.list_box.add (this.only_show_avatar_hbox);
112
this.only_show_avatar_hbox.pack_start ((new Gtk.Label ({
113
label: _("Only show avatar")
116
this.only_show_avatar_hbox.pack_end ((this.only_show_avatar_reset =
118
image: edit_clear_icon})),
120
this.only_show_avatar_hbox.pack_end (
121
(this.only_show_avatar_switch = new Gtk.Switch ()),
123
this.only_show_avatar_switch.set_active (
124
settings_object.get_setting ("main.privacy.only_show_avatar").data
128
//this.list_box.add ((new Gtk.Label ()));
130
/* Reset all settings */
131
this.list_box.add ((this.reset_all_btn = new Gtk.Button ({
132
label: _("Reset all settings"),