6
RESPONSE_CANCEL = gtk.RESPONSE_CANCEL
12
def acquire(branch, lock_type):
13
if branch.get_physical_lock_status():
14
dialog = LockDialog(branch)
15
response = dialog.run()
18
if response == RESPONSE_BREAK:
25
elif lock_type == WRITE:
32
if branch.get_physical_lock_status():
33
dialog = LockDialog(branch)
34
response = dialog.run()
37
if response == RESPONSE_BREAK:
39
elif response == RESPONSE_CANCEL:
47
class LockDialog(gtk.Dialog):
49
def __init__(self, branch):
50
gtk.Dialog.__init__(self)
54
self.set_title('Lock Not Held')
56
self.vbox.add(gtk.Label('This operation cannot be completed as ' \
57
'another application has locked the branch.'))
59
self.add_button('Break Lock', RESPONSE_BREAK)
60
self.add_button(gtk.STOCK_CANCEL, RESPONSE_CANCEL)