eric7/Plugins/VcsPlugins/vcsPySvn/SvnSwitchDialog.py

branch
eric7
changeset 8312
800c432b34c8
parent 8218
7c09585bd960
child 8318
962bce857696
equal deleted inserted replaced
8311:4e8b98454baa 8312:800c432b34c8
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2003 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing a dialog to enter the data for a switch operation.
8 """
9
10 from PyQt5.QtWidgets import QDialog
11
12 from .Ui_SvnSwitchDialog import Ui_SvnSwitchDialog
13
14
15 class SvnSwitchDialog(QDialog, Ui_SvnSwitchDialog):
16 """
17 Class implementing a dialog to enter the data for a switch operation.
18 """
19 def __init__(self, taglist, reposURL, standardLayout, parent=None):
20 """
21 Constructor
22
23 @param taglist list of previously entered tags (list of strings)
24 @param reposURL repository path (string) or None
25 @param standardLayout flag indicating the layout of the
26 repository (boolean)
27 @param parent parent widget (QWidget)
28 """
29 super().__init__(parent)
30 self.setupUi(self)
31
32 self.tagCombo.clear()
33 self.tagCombo.addItems(sorted(taglist))
34
35 if reposURL is not None and reposURL != "":
36 self.tagCombo.setEditText(reposURL)
37
38 if not standardLayout:
39 self.TagTypeGroup.setEnabled(False)
40
41 msh = self.minimumSizeHint()
42 self.resize(max(self.width(), msh.width()), msh.height())
43
44 def getParameters(self):
45 """
46 Public method to retrieve the tag data.
47
48 @return tuple of string and int (tag, tag type)
49 """
50 tag = self.tagCombo.currentText()
51 tagType = 0
52 if self.regularButton.isChecked():
53 tagType = 1
54 elif self.branchButton.isChecked():
55 tagType = 2
56 if not tag:
57 tagType = 4
58 return (tag, tagType)

eric ide

mercurial