/gpump/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/gpump/trunk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* This file is part of GPump, a Pump.io client.
 *
 * GPump (THE SOFTWARE) is made available under the terms and conditions of the
 * GNU Lesser General Public Licence 3.0. A copy of the licence can be read
 * in the file lgpl-3.0.txt in the root of this project.
 */


const Gtk = imports.gi.Gtk;
const _ = imports.gettext.gettext;
const Lang = imports.lang;

/** @file
 */
 
 /** @class
 * AccountUI is the UI that is used for handling of accounts.
 */
const AccountUI = Lang.Class ({
  Name: "AccountUI",
  Extends: Gtk.Dialog,
  
  _init: function () {
    this.parent ({
      use_header_bar: true,
      modal: true,
      title: _("GPump Accounts")
    });
    
    this._prepare_header_bar ();
    
    this.show_all ();
  },
  
  _prepare_header_bar: function () {
    this.headerbar = this.get_header_bar ();
    this.headerbar.set_show_close_button (false);
    this.headerbar.pack_end ((this.close_btn = new Gtk.Button ({
      label: _("close")
    })));
    
    this.close_btn.connect ("clicked", Lang.bind (this, function () {
      this.destroy ();
    }));
    
    /* Install a custom style */
    let special_btn_style_ctx = this.close_btn.get_style_context ();
    special_btn_style_ctx.add_class ("suggested-action");
  },
  
  /**
   * add a new account to the list of accounts  
   */
  _add_new_account: function () {
    
  },
  
  _prepare_view: function () {
    
  }
  
});