src/eric7/Plugins/VcsPlugins/vcsPySvn/SvnCommandDialog.py

branch
eric7
changeset 9221
bf71ee032bb4
parent 9209
b99e7fd55fd3
child 9413
80c06d472826
equal deleted inserted replaced
9220:e9e7eca7efee 9221:bf71ee032bb4
17 17
18 18
19 class SvnCommandDialog(QDialog, Ui_SvnCommandDialog): 19 class SvnCommandDialog(QDialog, Ui_SvnCommandDialog):
20 """ 20 """
21 Class implementing the Subversion command dialog. 21 Class implementing the Subversion command dialog.
22 22
23 It implements a dialog that is used to enter an 23 It implements a dialog that is used to enter an
24 arbitrary subversion command. It asks the user to enter 24 arbitrary subversion command. It asks the user to enter
25 the commandline parameters and the working directory. 25 the commandline parameters and the working directory.
26 """ 26 """
27
27 def __init__(self, argvList, wdList, ppath, parent=None): 28 def __init__(self, argvList, wdList, ppath, parent=None):
28 """ 29 """
29 Constructor 30 Constructor
30 31
31 @param argvList history list of commandline arguments (list of strings) 32 @param argvList history list of commandline arguments (list of strings)
32 @param wdList history list of working directories (list of strings) 33 @param wdList history list of working directories (list of strings)
33 @param ppath pathname of the project directory (string) 34 @param ppath pathname of the project directory (string)
34 @param parent parent widget of this dialog (QWidget) 35 @param parent parent widget of this dialog (QWidget)
35 """ 36 """
36 super().__init__(parent) 37 super().__init__(parent)
37 self.setupUi(self) 38 self.setupUi(self)
38 39
39 self.workdirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE) 40 self.workdirPicker.setMode(EricPathPickerModes.DIRECTORY_MODE)
40 41
41 self.okButton = self.buttonBox.button( 42 self.okButton = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok)
42 QDialogButtonBox.StandardButton.Ok)
43 self.okButton.setEnabled(False) 43 self.okButton.setEnabled(False)
44 44
45 self.commandCombo.clear() 45 self.commandCombo.clear()
46 self.commandCombo.addItems(argvList) 46 self.commandCombo.addItems(argvList)
47 if len(argvList) > 0: 47 if len(argvList) > 0:
48 self.commandCombo.setCurrentIndex(0) 48 self.commandCombo.setCurrentIndex(0)
49 self.workdirPicker.clear() 49 self.workdirPicker.clear()
50 self.workdirPicker.addItems(wdList) 50 self.workdirPicker.addItems(wdList)
51 if len(wdList) > 0: 51 if len(wdList) > 0:
52 self.workdirPicker.setCurrentIndex(0) 52 self.workdirPicker.setCurrentIndex(0)
53 self.projectDirLabel.setText(ppath) 53 self.projectDirLabel.setText(ppath)
54 54
55 # modify some what's this help texts 55 # modify some what's this help texts
56 t = self.commandCombo.whatsThis() 56 t = self.commandCombo.whatsThis()
57 if t: 57 if t:
58 t += Utilities.getPercentReplacementHelp() 58 t += Utilities.getPercentReplacementHelp()
59 self.commandCombo.setWhatsThis(t) 59 self.commandCombo.setWhatsThis(t)
60 60
61 msh = self.minimumSizeHint() 61 msh = self.minimumSizeHint()
62 self.resize(max(self.width(), msh.width()), msh.height()) 62 self.resize(max(self.width(), msh.width()), msh.height())
63 63
64 def on_commandCombo_editTextChanged(self, text): 64 def on_commandCombo_editTextChanged(self, text):
65 """ 65 """
66 Private method used to enable/disable the OK-button. 66 Private method used to enable/disable the OK-button.
67 67
68 @param text ignored 68 @param text ignored
69 """ 69 """
70 self.okButton.setDisabled(self.commandCombo.currentText() == "") 70 self.okButton.setDisabled(self.commandCombo.currentText() == "")
71 71
72 def getData(self): 72 def getData(self):
73 """ 73 """
74 Public method to retrieve the data entered into this dialog. 74 Public method to retrieve the data entered into this dialog.
75 75
76 @return a tuple of argv, workdir 76 @return a tuple of argv, workdir
77 """ 77 """
78 return (self.commandCombo.currentText(), 78 return (self.commandCombo.currentText(), self.workdirPicker.currentText())
79 self.workdirPicker.currentText())

eric ide

mercurial