~ubuntu-branches/ubuntu/karmic/eric/karmic

« back to all changes in this revision

Viewing changes to eric/VCS/cvsPackage/NewProjectDialog.py

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2008-01-28 18:02:25 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080128180225-6nrox6yrworh2c4v
Tags: 4.0.4-1ubuntu1
* Add python-qt3 to build-depends becuase that's where Ubuntu puts 
  pyqtconfig
* Change maintainer to MOTU

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# -*- coding: utf-8 -*-
2
 
 
3
 
# Copyright (c) 2002 - 2007 Detlev Offenbach <detlev@die-offenbachs.de>
4
 
#
5
 
 
6
 
"""
7
 
Module implementing the CVS Options Dialog for a new project from the repository.
8
 
"""
9
 
 
10
 
import os
11
 
 
12
 
from qt import *
13
 
 
14
 
from KdeQt import KQFileDialog
15
 
 
16
 
from NewProjectForm import CvsNewProjectOptionsForm
17
 
 
18
 
class CvsNewProjectOptionsDialog(CvsNewProjectOptionsForm):
19
 
    """
20
 
    Class implementing the Options Dialog for a new project from the repository.
21
 
    """
22
 
    def __init__(self, parent=None):
23
 
        """
24
 
        Constructor
25
 
        
26
 
        @param parent parent widget (QWidget)
27
 
        """
28
 
        CvsNewProjectOptionsForm.__init__(self, parent, None, 1)
29
 
        
30
 
        hd = QDir.convertSeparators(QDir.homeDirPath())
31
 
        hd = os.path.join(unicode(hd), 'cvsroot')
32
 
        self.vcsDirectoryEdit.setText(hd)
33
 
        
34
 
        self.cvsTagValidator = QRegExpValidator(QRegExp(r"[a-zA-Z][a-zA-Z0-9_-]*"), self)
35
 
        
36
 
        self.vcsTagEdit.setValidator(self.cvsTagValidator)
37
 
        
38
 
    def handleDirectory(self):
39
 
        """
40
 
        Private slot to display a directory selection dialog.
41
 
        """
42
 
        directory = KQFileDialog.getExistingDirectory(self.vcsDirectoryEdit.text(),
43
 
            self, None, self.trUtf8("Select Repository-Directory"), 1)
44
 
            
45
 
        if not directory.isNull():
46
 
            self.vcsDirectoryEdit.setText(QDir.convertSeparators(directory))
47
 
            
48
 
    def handleProjectDir(self):
49
 
        """
50
 
        Private slot to display a directory selection dialog.
51
 
        """
52
 
        directory = KQFileDialog.getExistingDirectory(self.vcsProjectDirEdit.text(),
53
 
            self, None, self.trUtf8("Select Project Directory"), 1)
54
 
            
55
 
        if not directory.isNull():
56
 
            self.vcsProjectDirEdit.setText(QDir.convertSeparators(directory))
57
 
            
58
 
    def getData(self):
59
 
        """
60
 
        Public slot to retrieve the data entered into the dialog.
61
 
        
62
 
        @return a tuple of a string (project directory) and a dictionary
63
 
            containing the data entered.
64
 
        """
65
 
        vcsdatadict = {
66
 
            "repository" : unicode(self.vcsDirectoryEdit.text()),
67
 
            "archive" : unicode(self.vcsArchiveEdit.text()),
68
 
            "tag" : unicode(self.vcsTagEdit.text()),
69
 
        }
70
 
        return (unicode(self.vcsProjectDirEdit.text()), vcsdatadict)