/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: Jelmer Vernooij
  • Date: 2011-04-10 18:44:39 UTC
  • mto: This revision was merged to the branch mainline in revision 730.
  • Revision ID: jelmer@samba.org-20110410184439-g7hqaacexqtviq13
Move i18n support to a separate file, so gettext files aren't loaded unless bzr-gtk is used.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
import os
18
18
 
19
 
from gi.repository import Gdk
 
19
import gtk.gdk
20
20
 
21
21
from bzrlib import config
22
22
try:
38
38
    """
39
39
 
40
40
    def __init__(self, window):
41
 
        super(GAnnotateConfig, self).__init__(gannotate_config_filename())
 
41
        configobj.ConfigObj.__init__(self, gannotate_config_filename())
42
42
        self.window = window
43
43
        self.pane = window.pane
44
44
 
74
74
        self.pane.connect("notify", self._save_pane_props)
75
75
 
76
76
    def _save_window_props(self, w, e, *args):
77
 
        if e.window.get_state() & Gdk.WindowState.MAXIMIZED:
 
77
        if e.window.get_state() & gtk.gdk.WINDOW_STATE_MAXIMIZED:
78
78
            maximized = True
79
79
        else:
80
80
            self["window"]["width"], self["window"]["height"] = w.get_size()
84
84
        return False
85
85
 
86
86
    def _save_pane_props(self, w, gparam):
87
 
        if gparam and gparam.name == "position":
 
87
        if gparam.name == "position":
88
88
            self["window"]["pane_position"] = w.get_position()
89
89
 
90
90
        return False
91
91
 
92
92
    def _write(self, *args):
93
 
        config.ensure_config_dir_exists()
94
93
        self.write()
 
94
 
95
95
        return False
96
96