/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to annotate/config.py

  • Committer: Curtis Hovey
  • Date: 2012-02-09 02:55:06 UTC
  • mto: This revision was merged to the branch mainline in revision 776.
  • Revision ID: sinzui.is@verizon.net-20120209025506-qa8yd8livobyv5yy
Replace unsupports notify event with an new strategy to set and pane size
when the config is saved.
Hush lint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
        self.pane.set_position(self['window'].as_int('pane_position'))
63
63
        self.window.set_default_size(self['window'].as_int('width'),
64
64
                                     self['window'].as_int('height'))
65
 
        self.window.move(self['window'].as_int('x'), self['window'].as_int('y'))
 
65
        self.window.move(
 
66
            self['window'].as_int('x'), self['window'].as_int('y'))
66
67
 
67
68
        if self['window'].as_bool('maximized'):
68
69
            self.window.maximize()
71
72
        self.window.connect("destroy", self._write)
72
73
        self.window.connect("configure-event", self._save_window_props)
73
74
        self.window.connect("window-state-event", self._save_window_props)
74
 
        self.pane.connect("notify", self._save_pane_props)
75
75
 
76
76
    def _save_window_props(self, w, e, *args):
77
77
        if e.window.get_state() & Gdk.WindowState.MAXIMIZED:
83
83
        self["window"]["maximized"] = maximized
84
84
        return False
85
85
 
86
 
    def _save_pane_props(self, w, gparam):
87
 
        if gparam and gparam.name == "position":
88
 
            self["window"]["pane_position"] = w.get_position()
89
 
 
90
 
        return False
 
86
    def _save_pane_props(self):
 
87
        self["window"]["pane_position"] = self.pane.get_position()
91
88
 
92
89
    def _write(self, *args):
 
90
        self._save_pane_props()
93
91
        config.ensure_config_dir_exists()
94
92
        self.write()
95
93
        return False
96