/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: Jelmer Vernooij
  • Date: 2007-04-03 17:16:07 UTC
  • mfrom: (187 trunk)
  • mto: This revision was merged to the branch mainline in revision 188.
  • Revision ID: jelmer@samba.org-20070403171607-0zaskazouokrm4cq
Tags: bzr-gtk-0.15.2
PrepareĀ forĀ 0.15.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
try:
36
36
    import dbus
37
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
 
38
    have_dbus = True
43
39
except ImportError:
44
 
    have_nm = False
 
40
    have_dbus = False
45
41
 
46
42
class CommitDialog(gtk.Dialog):
47
43
    """ New implementation of the Commit dialog. """
90
86
        
91
87
        # Create the widgets
92
88
        self._button_commit = gtk.Button(_("Comm_it"), use_underline=True)
93
 
        self._check_strict = gtk.CheckButton(_("_Allow unknown files"),
94
 
                                             use_underline=True)
95
89
        self._expander_files = gtk.Expander(_("File(s) to commit"))
96
90
        self._vpaned_main = gtk.VPaned()
97
91
        self._scrolledwindow_files = gtk.ScrolledWindow()
153
147
            self._check_local = gtk.CheckButton(_("_Only commit locally"),
154
148
                                                use_underline=True)
155
149
            self.vbox.pack_start(self._check_local, False, False)
156
 
            if have_nm:
 
150
            if have_dbus:
 
151
                bus = dbus.SystemBus()
 
152
                proxy_obj = bus.get_object('org.freedesktop.NetworkManager', 
 
153
                              '/org/freedesktop/NetworkManager')
 
154
                dbus_iface = dbus.Interface(
 
155
                        proxy_obj, 'org.freedesktop.NetworkManager')
157
156
                # 3 is the enum value for STATE_CONNECTED
158
157
                self._check_local.set_active(dbus_iface.state() != 3)
159
 
        self.vbox.pack_start(self._check_strict, False, False)
160
158
        
161
159
        # Create the file list
162
160
        self._create_file_view()
220
218
            local = self._check_local.get_active()
221
219
        else:
222
220
            local = False
 
221
 
 
222
        if list(self.wt.unknowns()) != []:
 
223
            response = question_dialog(_("Commit with unknowns?"),
 
224
               _("Unknown files exist in the working tree. Commit anyway?"))
 
225
            if response == gtk.RESPONSE_NO:
 
226
                return
223
227
        
224
228
        try:
225
229
            self.wt.commit(message,
226
230
                       allow_pointless=False,
227
 
                       strict=self._check_strict.get_active(),
 
231
                       strict=False,
228
232
                       local=local,
229
233
                       specific_files=specific_files)
230
234
        except errors.PointlessCommit:
233
237
            if response == gtk.RESPONSE_YES:
234
238
                self.wt.commit(message,
235
239
                               allow_pointless=True,
236
 
                               strict=self._check_strict.get_active(),
 
240
                               strict=False,
237
241
                               local=local,
238
242
                               specific_files=specific_files)
239
243
        self.response(gtk.RESPONSE_OK)