/gpump/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/gpump/trunk

« back to all changes in this revision

Viewing changes to src/app.js

  • Committer: Gustav Hartvigsson
  • Date: 2014-12-15 21:45:36 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20141215214536-ty17fg5rq06clphg
* Code cleanup
* fixed a Gtk warning (by hooking up the parameters thingy)
* Hooked up "quit on exit" in the references UI.
  * added a popover to set it for the first time...
    This way of doing it is not so good, I think I will have
    to re-do how "quit on exit" is handled.
* Switched the order of the fealds in the return map in the
  SettingsData.get_setting.
  This should, hypothetically, make it posible to use the the ret
  data as is.
  This shoold probably be be redone to just return undefined.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
    let w_list = this.get_windows ();
50
50
    if (w_list.length) {
51
51
      w_list[0].present ();
52
 
      if (!(this._is_shown ())) {
53
 
        if (!(this.settings.get_setting ("ui.x").data < 0 &&
54
 
            this.settings.get_setting ("ui.y").data < 0)){
55
 
          this.window.move (this.settings.get_setting ("ui.x").data,
56
 
                                           this.settings.get_setting ("ui.y").data);
57
 
        }
58
 
      }
 
52
      w_list[0].move (this.settings.get_setting ("ui.x").data,
 
53
                             this.settings.get_setting ("ui.y").data);
59
54
      return;
60
55
    }
61
56
    
149
144
    /* * Hide the window so, so we can show it later */
150
145
    this.window.connect ('delete_event',
151
146
                         Lang.bind (this, function () {
 
147
      print ("balls to it!");
152
148
      this._save_settings ();
153
 
      this.window.hide_on_delete ();
 
149
      this.window.hide ();
 
150
      /* To Prevent the widow from rely being destroyed? */
 
151
      return true;
154
152
    }));
155
153
    
156
154
    this.add_window (this.window);
201
199
    
202
200
    let preferences_action = new Gio.SimpleAction ({name: "preferences"});
203
201
    preferences_action.connect ('activate', Lang.bind (this, function (){
204
 
      let pref_dialog = new PreferencesUI.PreferencesUI ();
205
 
      pref_dialog.set_transient_for (this.window);
 
202
      let pref_dialog = new PreferencesUI.PreferencesUI ({
 
203
        transient_for: this.window
 
204
      });
206
205
      pref_dialog.run ();
207
206
    }));
208
207
    this.add_action (preferences_action);
252
251
  
253
252
  _is_shown: function () {
254
253
    let win_pos = this.window.get_position ();
 
254
    JSON.stringify (win_pos);
255
255
    if (win_pos[0] == undefined || win_pos[1] == undefined) {
256
256
      return false;
257
257
    } else {