1
# -*- coding: utf-8 -*-
3
# Copyright (c) 2002 - 2007 Detlev Offenbach <detlev@die-offenbachs.de>
7
Module implementing the CVS Options Dialog for a new project from the repository.
14
from KdeQt import KQFileDialog
16
from NewProjectForm import CvsNewProjectOptionsForm
18
class CvsNewProjectOptionsDialog(CvsNewProjectOptionsForm):
20
Class implementing the Options Dialog for a new project from the repository.
22
def __init__(self, parent=None):
26
@param parent parent widget (QWidget)
28
CvsNewProjectOptionsForm.__init__(self, parent, None, 1)
30
hd = QDir.convertSeparators(QDir.homeDirPath())
31
hd = os.path.join(unicode(hd), 'cvsroot')
32
self.vcsDirectoryEdit.setText(hd)
34
self.cvsTagValidator = QRegExpValidator(QRegExp(r"[a-zA-Z][a-zA-Z0-9_-]*"), self)
36
self.vcsTagEdit.setValidator(self.cvsTagValidator)
38
def handleDirectory(self):
40
Private slot to display a directory selection dialog.
42
directory = KQFileDialog.getExistingDirectory(self.vcsDirectoryEdit.text(),
43
self, None, self.trUtf8("Select Repository-Directory"), 1)
45
if not directory.isNull():
46
self.vcsDirectoryEdit.setText(QDir.convertSeparators(directory))
48
def handleProjectDir(self):
50
Private slot to display a directory selection dialog.
52
directory = KQFileDialog.getExistingDirectory(self.vcsProjectDirEdit.text(),
53
self, None, self.trUtf8("Select Project Directory"), 1)
55
if not directory.isNull():
56
self.vcsProjectDirEdit.setText(QDir.convertSeparators(directory))
60
Public slot to retrieve the data entered into the dialog.
62
@return a tuple of a string (project directory) and a dictionary
63
containing the data entered.
66
"repository" : unicode(self.vcsDirectoryEdit.text()),
67
"archive" : unicode(self.vcsArchiveEdit.text()),
68
"tag" : unicode(self.vcsTagEdit.text()),
70
return (unicode(self.vcsProjectDirEdit.text()), vcsdatadict)