/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 commit.py

  • Committer: Szilveszter Farkas (Phanatic)
  • Date: 2007-03-10 17:16:44 UTC
  • mfrom: (169 trunk)
  • mto: (170.1.3 trunk)
  • mto: This revision was merged to the branch mainline in revision 172.
  • Revision ID: szilveszter.farkas@gmail.com-20070310171644-83yc6fd8ique6scx
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
from dialog import error_dialog, question_dialog
33
33
from errors import show_bzr_error
34
34
 
 
35
try:
 
36
    import dbus
 
37
    import dbus.glib
 
38
    bus = dbus.SystemBus()
 
39
    proxy_obj = bus.get_object('org.freedesktop.NetworkManager', 
 
40
                              '/org/freedesktop/NetworkManager')
 
41
    dbus_iface = dbus.Interface(proxy_obj, 'org.freedesktop.NetworkManager')
 
42
    have_nm = True
 
43
except ImportError:
 
44
    have_nm = False
 
45
 
35
46
class CommitDialog(gtk.Dialog):
36
47
    """ New implementation of the Commit dialog. """
37
48
    def __init__(self, wt, wtpath, notbranch, selected=None, parent=None):
79
90
        
80
91
        # Create the widgets
81
92
        self._button_commit = gtk.Button(_("Comm_it"), use_underline=True)
82
 
        if self._is_checkout:
83
 
            self._check_local = gtk.CheckButton(_("_Only commit locally"),
84
 
                                                use_underline=True)
85
93
        self._check_strict = gtk.CheckButton(_("_Allow unknown files"),
86
94
                                             use_underline=True)
87
95
        self._expander_files = gtk.Expander(_("File(s) to commit"))
141
149
        self._vpaned_main.add2(self._vbox_message)
142
150
        
143
151
        self.vbox.pack_start(self._vpaned_main, True, True)
144
 
        if self._is_checkout:
 
152
        if self._is_checkout: 
 
153
            self._check_local = gtk.CheckButton(_("_Only commit locally"),
 
154
                                                use_underline=True)
145
155
            self.vbox.pack_start(self._check_local, False, False)
 
156
            if have_nm:
 
157
                # 3 is the enum value for STATE_CONNECTED
 
158
                self._check_local.set_active(dbus_iface.state() != 3)
146
159
        self.vbox.pack_start(self._check_strict, False, False)
147
160
        
148
161
        # Create the file list