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 ({
22
title: _("GPump preferences")
25
this._prepare_header_bar ();
26
this._prepare_list_box ();
28
this.set_property ('resizable', false);
33
_prepare_header_bar: function () {
35
this.headerbar = this.get_header_bar ();
36
this.headerbar.set_show_close_button (false);
37
this.headerbar.pack_end ((this.close_btn = new Gtk.Button ({
41
this.close_btn.connect ('clicked', Lang.bind (this, function () {
47
_prepare_list_box: function () {
48
/*this.get_content_area ().pack_start ()),
50
this.get_content_area ().set_center_widget (
51
(this.list_box = new Gtk.ListBox ({
54
selection_mode: Gtk.SelectionMode.NONE
57
let settings_object = SettingsData.get_settings ();
59
/*************************** Use dark setting *****************************/
60
let edit_clear_icon = new Gtk.Image ({icon_name: 'edit-clear'});
62
this.use_dark_hbox = Gtk.Box.new (Gtk.Orientation.HORIZONTAL, 5);
64
this.list_box.add (this.use_dark_hbox);
66
this.use_dark_hbox.pack_start ((new Gtk.Label ({
67
label: _("Use dark theme")
70
this.use_dark_hbox.pack_end ((this.use_dark_reset =
72
image: edit_clear_icon})),
74
this.use_dark_hbox.pack_end ((this.use_dark_switch = new Gtk.Switch ()),
77
this.use_dark_switch.set_active (
78
settings_object.get_setting("main.use_dark").data
81
/*************************** Privacy settings *****************************/
82
this.list_box.add ((new Gtk.Label ({label: _("Privacy settings")})));
84
/************************ show full name setting **************************/
85
let edit_clear_icon = new Gtk.Image ({icon_name: 'edit-clear'});
87
this.show_full_name_hbox = Gtk.Box.new (Gtk.Orientation.HORIZONTAL, 5);
89
this.list_box.add (this.show_full_name_hbox);
91
this.show_full_name_hbox.pack_start ((new Gtk.Label ({
92
label: _("Show full name")
95
this.show_full_name_hbox.pack_end ((this.show_full_name_reset =
97
image: edit_clear_icon})),
99
this.show_full_name_hbox.pack_end (
100
(this.show_full_name_switch = new Gtk.Switch ()),
102
this.show_full_name_switch.set_active (
103
settings_object.get_setting ("main.privacy.show_full_name").data
106
/*********************** only show avatar setting **************************/
107
let edit_clear_icon = new Gtk.Image ({icon_name: 'edit-clear'});
109
this.only_show_avatar_hbox = Gtk.Box.new (Gtk.Orientation.HORIZONTAL, 5);
111
this.list_box.add (this.only_show_avatar_hbox);
113
this.only_show_avatar_hbox.pack_start ((new Gtk.Label ({
114
label: _("Only show avatar")
117
this.only_show_avatar_hbox.pack_end ((this.only_show_avatar_reset =
119
image: edit_clear_icon})),
121
this.only_show_avatar_hbox.pack_end (
122
(this.only_show_avatar_switch = new Gtk.Switch ()),
124
this.only_show_avatar_switch.set_active (
125
settings_object.get_setting ("main.privacy.only_show_avatar").data
129
//this.list_box.add ((new Gtk.Label ()));
131
/* Reset all settings */
132
this.list_box.add ((this.reset_all_btn = new Gtk.Button ({
133
label: _("Reset all settings"),