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

# Form implementation generated from reading ui file '/home/detlev/Development/Python/Eric/eric3_6/eric3/VCS/cvsPackage/CommandForm.ui'
#
# Created: Do Dez 30 14:12:39 2004
#      by: The PyQt User Interface Compiler (pyuic) snapshot-20041229
#
# 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.workdirCombo,SIGNAL("textChanged(const QString&)"),self.enableOkButton)
        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("CVS Command"))
        self.textLabel1.setText(self.__tr("CVS Command:"))
        QToolTip.add(self.textLabel1,QString.null)
        QToolTip.add(self.commandCombo,self.__tr("Enter the CVS command to be executed with all neccessary parameters"))
        QWhatsThis.add(self.commandCombo,self.__tr("<b>CVS Command</b>\n"
"<p>Enter the CVS command to be executed including all neccessary parameters.\n"
"If a parameter of the commandline includes a space you have to surround this\n"
"parameter by single or double quotes. Do not include the name of the cvs executable \n"
"(i.e. cvs).</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 CVS command via a directory selection dialog.</p>"))
        QToolTip.add(self.workdirCombo,self.__tr("Enter the working directory for the CVS command"))
        QWhatsThis.add(self.workdirCombo,self.__tr("<b>Working directory</b>\n"
"<p>Enter the working directory for the CVS command.\n"
"The button to the right will open a directory selection dialog.</p>"))
        self.textLabel2.setText(self.__tr("Working Directory:"))
        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()
