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

# Form implementation generated from reading ui file '/home/detlev/Development/Python/Eric/eric3_8/eric3/VCS/mercurialPackage/CommandForm.ui'
#
# Created: Sa Sep 10 15:11:49 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.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,86).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.commandCombo,SIGNAL("textChanged(const QString&)"),self.enableOkButton)


    def languageChange(self):
        self.setCaption(self.__tr("Mercurial Command"))
        self.textLabel1.setText(self.__tr("Mercurial Command:"))
        QToolTip.add(self.textLabel1,QString.null)
        QToolTip.add(self.commandCombo,self.__tr("Enter the Mercurial command to be executed with all neccessary parameters"))
        QWhatsThis.add(self.commandCombo,self.__tr("<b>Mercurial Command</b>\n"
"<p>Enter the Mercurial 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 Mercurial client executable (i.e. hg).</p>"))
        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 __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()
