bzr branch
http://gegoxaren.bato24.eu/bzr/gpump/trunk
52.1.9
by Gustav Hartvigsson
* Woops! |
1 |
/* This file is part of GPump, a Pump.io client.
|
2 |
*
|
|
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.
|
|
6 |
*/
|
|
7 |
||
8 |
||
9 |
const Gtk = imports.gi.Gtk; |
|
10 |
const _ = imports.gettext.gettext; |
|
11 |
const Lang = imports.lang; |
|
12 |
||
13 |
/** @file
|
|
14 |
*/
|
|
15 |
|
|
16 |
/** @class |
|
17 |
* AccountUI is the UI that is used for handling of accounts.
|
|
18 |
*/
|
|
19 |
const AccountUI = Lang.Class ({ |
|
20 |
Name: "AccountUI", |
|
21 |
Extends: Gtk.Dialog, |
|
22 |
|
|
23 |
_init: function () { |
|
24 |
this.parent ({ |
|
25 |
use_header_bar: true, |
|
26 |
modal: true, |
|
27 |
title: _("GPump Accounts") |
|
28 |
}); |
|
29 |
|
|
30 |
this._prepare_header_bar (); |
|
31 |
|
|
32 |
this.show_all (); |
|
33 |
}, |
|
34 |
|
|
35 |
_prepare_header_bar: function () { |
|
36 |
this.headerbar = this.get_header_bar (); |
|
37 |
this.headerbar.set_show_close_button (false); |
|
38 |
this.headerbar.pack_end ((this.close_btn = new Gtk.Button ({ |
|
39 |
label: _("close") |
|
40 |
}))); |
|
41 |
|
|
42 |
this.close_btn.connect ("clicked", Lang.bind (this, function () { |
|
43 |
this.destroy (); |
|
44 |
})); |
|
45 |
|
|
46 |
/* Install a custom style */ |
|
47 |
let special_btn_style_ctx = this.close_btn.get_style_context (); |
|
48 |
special_btn_style_ctx.add_class ("suggested-action"); |
|
49 |
}, |
|
50 |
|
|
51 |
/** |
|
52.1.10
by Gustav Hartvigsson
* made the UserButton work in tests. |
52 |
* add a new account to the list of accounts
|
52.1.9
by Gustav Hartvigsson
* Woops! |
53 |
*/
|
54 |
_add_new_account: function () { |
|
55 |
|
|
52.1.10
by Gustav Hartvigsson
* made the UserButton work in tests. |
56 |
}, |
57 |
|
|
58 |
_prepare_view: function () { |
|
59 |
|
|
52.1.9
by Gustav Hartvigsson
* Woops! |
60 |
} |
61 |
|
|
62 |
});
|
|
52.1.10
by Gustav Hartvigsson
* made the UserButton work in tests. |
63 |
|
64 |