|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2003 - 2009 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 PyQt4.QtCore import * |
|
11 from PyQt4.QtGui import * |
|
12 |
|
13 from Ui_SvnSwitchDialog import Ui_SvnSwitchDialog |
|
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 QDialog.__init__(self, parent) |
|
30 self.setupUi(self) |
|
31 |
|
32 self.tagCombo.clear() |
|
33 self.tagCombo.addItems(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 def getParameters(self): |
|
42 """ |
|
43 Public method to retrieve the tag data. |
|
44 |
|
45 @return tuple of string and int (tag, tag type) |
|
46 """ |
|
47 tag = self.tagCombo.currentText() |
|
48 tagType = 0 |
|
49 if self.regularButton.isChecked(): |
|
50 tagType = 1 |
|
51 elif self.branchButton.isChecked(): |
|
52 tagType = 2 |
|
53 if not tag: |
|
54 tagType = 4 |
|
55 return (tag, tagType) |
|
56 |