Plugins/VcsPlugins/vcsSubversion/SvnSwitchDialog.py

Sun, 03 Nov 2013 15:58:22 +0100

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Sun, 03 Nov 2013 15:58:22 +0100
branch
Py2 comp.
changeset 3060
5883ce99ee12
parent 2525
8b507a9a2d40
child 3145
a9de05d4a22f
permissions
-rw-r--r--

Merge with default branch after fixed indentation issues and lates changes.

# -*- coding: utf-8 -*-

# Copyright (c) 2003 - 2013 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing a dialog to enter the data for a switch operation.
"""

from __future__ import unicode_literals    # __IGNORE_WARNING__

from PyQt4.QtGui import QDialog

from .Ui_SvnSwitchDialog import Ui_SvnSwitchDialog


class SvnSwitchDialog(QDialog, Ui_SvnSwitchDialog):
    """
    Class implementing a dialog to enter the data for a switch operation.
    """
    def __init__(self, taglist, reposURL, standardLayout, parent=None):
        """
        Constructor
        
        @param taglist list of previously entered tags (list of strings)
        @param reposURL repository path (string) or None
        @param standardLayout flag indicating the layout of the
            repository (boolean)
        @param parent parent widget (QWidget)
        """
        super(SvnSwitchDialog, self).__init__(parent)
        self.setupUi(self)
       
        self.tagCombo.clear()
        self.tagCombo.addItems(sorted(taglist))
        
        if reposURL is not None and reposURL != "":
            self.tagCombo.setEditText(reposURL)
            
        if not standardLayout:
            self.TagTypeGroup.setEnabled(False)
        
    def getParameters(self):
        """
        Public method to retrieve the tag data.
        
        @return tuple of string and int (tag, tag type)
        """
        tag = self.tagCombo.currentText()
        tagType = 0
        if self.regularButton.isChecked():
            tagType = 1
        elif self.branchButton.isChecked():
            tagType = 2
        if not tag:
            tagType = 4
        return (tag, tagType)

eric ide

mercurial