1
# -*- coding: utf-8 -*-
3
# Copyright (c) 2003 - 2007 Detlev Offenbach <detlev@die-offenbachs.de>
7
Module implementing the Subversion command dialog.
12
from KdeQt import KQFileDialog
14
from CommandForm import CommandForm
17
class SvnCommandDialog(CommandForm):
19
Class implementing the Subversion command dialog.
21
It implements a dialog that is used to enter an
22
arbitrary subversion command. It asks the user to enter
23
the commandline parameters and the working directory.
25
def __init__(self, argvList, wdList, ppath, parent=None):
29
@param argvList history list of commandline arguments (QStringList)
30
@param wdList history list of working directories (QStringList)
31
@param ppath pathname of the project directory (string)
32
@param parent parent widget of this dialog (QWidget)
34
CommandForm.__init__(self, parent, None, 1)
36
self.commandCombo.clear()
37
self.commandCombo.insertStringList(argvList)
38
if argvList.count() > 0:
39
self.commandCombo.setCurrentItem(0)
40
self.workdirCombo.clear()
41
self.workdirCombo.insertStringList(wdList)
42
if wdList.count() > 0:
43
self.workdirCombo.setCurrentItem(0)
44
self.projectDirLabel.setText(ppath)
46
# modify some what's this help texts
47
t = QWhatsThis.textFor(self.commandCombo)
49
t = t.append(Utilities.getPercentReplacementHelp())
50
QWhatsThis.add(self.commandCombo, t)
54
Private method used to open a directory selection dialog.
56
cwd = self.workdirCombo.currentText()
58
cwd = self.projectDirLabel.text()
59
d = KQFileDialog.getExistingDirectory(cwd,
60
self, None, self.trUtf8('Working directory'))
63
self.workdirCombo.setCurrentText(QDir.convertSeparators(d))
65
def enableOkButton(self, text):
67
Private method used to enable/disable the OK-button.
71
self.okButton.setDisabled(self.commandCombo.currentText().isEmpty())
75
Public method to retrieve the data entered into this dialog.
77
@return a tuple of argv, workdir
79
return (self.commandCombo.currentText(),
80
self.workdirCombo.currentText())