eric6/Plugins/VcsPlugins/vcsSubversion/SvnTagDialog.py

changeset 6942
2602857055c5
parent 6645
ad476851d7e0
child 7229
53054eb5b15a
equal deleted inserted replaced
6941:f99d60d6b59b 6942:2602857055c5
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2003 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing a dialog to enter the data for a tagging operation.
8 """
9
10 from __future__ import unicode_literals
11
12 from PyQt5.QtWidgets import QDialog, QDialogButtonBox
13
14 from .Ui_SvnTagDialog import Ui_SvnTagDialog
15
16
17 class SvnTagDialog(QDialog, Ui_SvnTagDialog):
18 """
19 Class implementing a dialog to enter the data for a tagging operation.
20 """
21 def __init__(self, taglist, reposURL, standardLayout, parent=None):
22 """
23 Constructor
24
25 @param taglist list of previously entered tags (list of strings)
26 @param reposURL repository path (string) or None
27 @param standardLayout flag indicating the layout of the
28 repository (boolean)
29 @param parent parent widget (QWidget)
30 """
31 super(SvnTagDialog, self).__init__(parent)
32 self.setupUi(self)
33
34 self.okButton = self.buttonBox.button(QDialogButtonBox.Ok)
35 self.okButton.setEnabled(False)
36
37 self.tagCombo.clear()
38 self.tagCombo.addItems(sorted(taglist, reverse=True))
39
40 if reposURL is not None and reposURL != "":
41 self.tagCombo.setEditText(reposURL)
42
43 if not standardLayout:
44 self.TagActionGroup.setEnabled(False)
45
46 msh = self.minimumSizeHint()
47 self.resize(max(self.width(), msh.width()), msh.height())
48
49 def on_tagCombo_editTextChanged(self, text):
50 """
51 Private method used to enable/disable the OK-button.
52
53 @param text text of the tag combobox (string)
54 """
55 self.okButton.setDisabled(text == "")
56
57 def getParameters(self):
58 """
59 Public method to retrieve the tag data.
60
61 @return tuple of string and int (tag, tag operation)
62 """
63 tag = self.tagCombo.currentText()
64 tagOp = 0
65 if self.createRegularButton.isChecked():
66 tagOp = 1
67 elif self.createBranchButton.isChecked():
68 tagOp = 2
69 elif self.deleteRegularButton.isChecked():
70 tagOp = 4
71 elif self.deleteBranchButton.isChecked():
72 tagOp = 8
73 return (tag, tagOp)

eric ide

mercurial