| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
from PyQt5 import QtWidgets |
| 24 |
|
| 25 |
from breezy.plugins.qbrz.lib.i18n import gettext |
| 26 |
from breezy.plugins.qbrz.lib.subprocess import SubProcessDialog |
| 27 |
from breezy.plugins.qbrz.lib.util import ( |
| 28 |
url_for_display, |
| 29 |
) |
| 30 |
|
| 31 |
|
| 32 |
class QBzrUnbindDialog(SubProcessDialog): |
| 33 |
|
| 34 |
def __init__(self, branch, ui_mode=None, immediate=False): |
| 35 |
|
| 36 |
super(QBzrUnbindDialog, self).__init__( |
| 37 |
gettext("Unbind branch"), |
| 38 |
name = "unbind", |
| 39 |
default_size = (200, 200), |
| 40 |
ui_mode = ui_mode, |
| 41 |
dialog = True, |
| 42 |
parent = None, |
| 43 |
hide_progress=False, |
| 44 |
immediate = immediate |
| 45 |
) |
| 46 |
self.branch = branch |
| 47 |
|
| 48 |
gbBind = QtWidgets.QGroupBox(gettext("Unbind"), self) |
| 49 |
bind_box = QtWidgets.QFormLayout(gbBind) |
| 50 |
info_label = QtWidgets.QLabel(url_for_display(branch.base)) |
| 51 |
bind_box.addRow(gettext("Branch:"), info_label) |
| 52 |
|
| 53 |
self.currbound = branch.get_bound_location() |
| 54 |
if self.currbound is not None: |
| 55 |
curr_label = QtWidgets.QLabel(url_for_display(self.currbound)) |
| 56 |
bind_box.addRow(gettext("Bound to:"), curr_label) |
| 57 |
|
| 58 |
layout = QtWidgets.QVBoxLayout(self) |
| 59 |
layout.addWidget(gbBind) |
| 60 |
layout.addWidget(self.make_default_status_box()) |
| 61 |
layout.addWidget(self.buttonbox) |
| 62 |
|
| 63 |
def do_start(self): |
| 64 |
self.process_widget.do_start(None, 'unbind') |