Sun, 31 Dec 2017 16:52:09 +0100
Updated copyright for 2018.
6020
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
6048
82ad8ec9548c
Updated copyright for 2018.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6020
diff
changeset
|
3 | # Copyright (c) 2014 - 2018 Detlev Offenbach <detlev@die-offenbachs.de> |
6020
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing a dialog to enter the data for applying a bundle. |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
10 | from __future__ import unicode_literals |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | from PyQt5.QtWidgets import QDialog |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
14 | from .Ui_GitApplyBundleDataDialog import Ui_GitApplyBundleDataDialog |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
15 | |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
17 | class GitApplyBundleDataDialog(QDialog, Ui_GitApplyBundleDataDialog): |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | """ |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | Class implementing a dialog to enter the data for applying a bundle. |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
20 | """ |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | def __init__(self, bundleHeads, branches, parent=None): |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | """ |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | Constructor |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | @param bundleHeads list of heads contained in a bundle |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
26 | (list of strings) |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | @param branches list of available branch names (list of strings) |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | @param parent reference to the parent widget (QWidget) |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | """ |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | super(GitApplyBundleDataDialog, self).__init__(parent) |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | self.setupUi(self) |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | self.headCombo.addItems(sorted(bundleHeads)) |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | self.branchCombo.addItems([""] + sorted(branches)) |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | def getData(self): |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | """ |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | Public method to get the entered data. |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | @return tuple with the bundle head (string) and the local branch |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
41 | name (string) |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | """ |
baf6da1ae288
Added the git plug-in to the core plug-ins.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
43 | return self.headCombo.currentText(), self.branchCombo.currentText() |