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

« back to all changes in this revision

Viewing changes to eric/VCS/vcsPySvn/SvnSwitchDialog.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) 2003 - 2007 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 (QStringList)
 
24
        @param reposURL repository path (QString or 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 is not QString():
 
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 QString 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 tag.isEmpty():
 
54
            tagType = 4
 
55
        return (tag, tagType)
 
56