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

# Form implementation generated from reading ui file '/home/detlev/Development/Python/Eric/eric3_9/eric3/VCS/subversionPackage/CommandForm.ui'
#
# Created: So Nov 27 16:12:58 2005
#      by: The PyQt User Interface Compiler (pyuic) 3.15
#
# WARNING! All changes made in this file will be lost!


import sys
from qt import *


class CommandForm(QDialog):
    def __init__(self,parent = None,name = None,modal = 0,fl = 0):
        QDialog.__init__(self,parent,name,modal,fl)

        if not name:
            self.setName("CommandForm")


        CommandFormLayout = QVBoxLayout(self,6,6,"CommandFormLayout")

        layout7 = QGridLayout(None,1,1,0,6,"layout7")

        self.textLabel1 = QLabel(self,"textLabel1")

        layout7.addWidget(self.textLabel1,0,0)

        self.commandCombo = QComboBox(0,self,"commandCombo")
        self.commandCombo.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Fixed,0,0,self.commandCombo.sizePolicy().hasHeightForWidth()))
        self.commandCombo.setEditable(1)
        self.commandCombo.setInsertionPolicy(QComboBox.AtTop)
        self.commandCombo.setAutoCompletion(1)
        self.commandCombo.setDuplicatesEnabled(0)

        layout7.addMultiCellWidget(self.commandCombo,0,0,1,2)

        self.dirButton = QPushButton(self,"dirButton")
        self.dirButton.setFocusPolicy(QPushButton.NoFocus)

        layout7.addWidget(self.dirButton,1,2)

        self.workdirCombo = QComboBox(0,self,"workdirCombo")
        self.workdirCombo.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Fixed,0,0,self.workdirCombo.sizePolicy().hasHeightForWidth()))
        self.workdirCombo.setEditable(1)
        self.workdirCombo.setInsertionPolicy(QComboBox.AtTop)
        self.workdirCombo.setAutoCompletion(1)
        self.workdirCombo.setDuplicatesEnabled(0)

        layout7.addWidget(self.workdirCombo,1,1)

        self.textLabel2 = QLabel(self,"textLabel2")

        layout7.addWidget(self.textLabel2,1,0)

        self.textLabel3 = QLabel(self,"textLabel3")
        self.textLabel3.setSizePolicy(QSizePolicy(QSizePolicy.Minimum,QSizePolicy.Preferred,0,0,self.textLabel3.sizePolicy().hasHeightForWidth()))

        layout7.addWidget(self.textLabel3,2,0)

        self.projectDirLabel = QLabel(self,"projectDirLabel")
        self.projectDirLabel.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Preferred,0,0,self.projectDirLabel.sizePolicy().hasHeightForWidth()))

        layout7.addMultiCellWidget(self.projectDirLabel,2,2,1,2)
        CommandFormLayout.addLayout(layout7)

        layout1 = QHBoxLayout(None,0,6,"layout1")
        spacer1 = QSpacerItem(40,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        layout1.addItem(spacer1)

        self.okButton = QPushButton(self,"okButton")
        self.okButton.setEnabled(0)
        self.okButton.setDefault(1)
        layout1.addWidget(self.okButton)

        self.cancelButton = QPushButton(self,"cancelButton")
        layout1.addWidget(self.cancelButton)
        spacer2 = QSpacerItem(40,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        layout1.addItem(spacer2)
        CommandFormLayout.addLayout(layout1)

        self.languageChange()

        self.resize(QSize(628,130).expandedTo(self.minimumSizeHint()))
        self.clearWState(Qt.WState_Polished)

        self.connect(self.okButton,SIGNAL("clicked()"),self.accept)
        self.connect(self.cancelButton,SIGNAL("clicked()"),self.reject)
        self.connect(self.dirButton,SIGNAL("clicked()"),self.handleDir)
        self.connect(self.commandCombo,SIGNAL("textChanged(const QString&)"),self.enableOkButton)


    def languageChange(self):
        self.setCaption(self.__tr("Subversion Command"))
        self.textLabel1.setText(self.__tr("Subversion Command:"))
        QToolTip.add(self.textLabel1,QString.null)
        QToolTip.add(self.commandCombo,self.__tr("Enter the Subversion command to be executed with all neccessary parameters"))
        QWhatsThis.add(self.commandCombo,self.__tr("<b>Subversion Command</b>\n"
"<p>Enter the Subversion command to be executed including all neccessary \n"
"parameters. If a parameter of the commandline includes a space you have to \n"
"surround this parameter by single or double quotes. Do not include the name \n"
"of the subversion client executable (i.e. svn).</p>"))
        self.dirButton.setText(self.__tr("..."))
        QToolTip.add(self.dirButton,self.__tr("Select the working directory via a directory selection dialog"))
        QWhatsThis.add(self.dirButton,self.__tr("<b>Working directory</b>\n"
"<p>Select the working directory for the Subversion command via a directory selection dialog.</p>"))
        QToolTip.add(self.workdirCombo,self.__tr("Enter the working directory for the Subversion command"))
        QWhatsThis.add(self.workdirCombo,self.__tr("<b>Working directory</b>\n"
"<p>Enter the working directory for the Subversion command.\n"
"This is an optional entry. The button to the right will open a \n"
"directory selection dialog.</p>"))
        self.textLabel2.setText(self.__tr("Working Directory:<br>(optional)"))
        self.textLabel3.setText(self.__tr("Project Directory:"))
        self.projectDirLabel.setText(self.__tr("project directory"))
        QToolTip.add(self.projectDirLabel,self.__tr("This shows the root directory of the current project."))
        self.okButton.setText(self.__tr("&OK"))
        self.cancelButton.setText(self.__tr("&Cancel"))


    def enableOkButton(self,a0):
        print "CommandForm.enableOkButton(const QString&): Not implemented yet"

    def handleDir(self):
        print "CommandForm.handleDir(): Not implemented yet"

    def __tr(self,s,c = None):
        return qApp.translate("CommandForm",s,c)

if __name__ == "__main__":
    a = QApplication(sys.argv)
    QObject.connect(a,SIGNAL("lastWindowClosed()"),a,SLOT("quit()"))
    w = CommandForm()
    a.setMainWidget(w)
    w.show()
    a.exec_loop()
