Debian Codegraph @

lib/unbind.py

raw symbols SCIP
1 # -*- coding: utf-8 -*-
2 #
3 # QBrz - Qt frontend to Breezy commands
4 #
5 # Contributors:
6 # Javier Der Derian <[email protected]>
7 #
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License
10 # as published by the Free Software Foundation; either version 2
11 # of the License, or (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
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')