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

# Form implementation generated from reading ui file '/home/detlev/Development/Python/Eric/eric3_8/eric3/VCS/mercurialPackage/PushForm.ui'
#
# Created: Sa Sep 17 12:17:52 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 HgPushForm(QDialog):
    def __init__(self,parent = None,name = None,modal = 0,fl = 0):
        QDialog.__init__(self,parent,name,modal,fl)

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


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

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

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

        layout3.addWidget(self.TextLabel2,1,0)

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

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

        self.forceCheckBox = QCheckBox(self,"forceCheckBox")

        layout3.addMultiCellWidget(self.forceCheckBox,2,2,0,2)

        self.vcsDirButton = QPushButton(self,"vcsDirButton")

        layout3.addWidget(self.vcsDirButton,1,2)

        self.vcsDirectoryEdit = QLineEdit(self,"vcsDirectoryEdit")

        layout3.addWidget(self.vcsDirectoryEdit,1,1)

        self.protocolCombo = QComboBox(0,self,"protocolCombo")

        layout3.addWidget(self.protocolCombo,0,1)
        HgPushFormLayout.addLayout(layout3)

        Layout4 = QHBoxLayout(None,0,6,"Layout4")
        Spacer3 = QSpacerItem(30,0,QSizePolicy.Expanding,QSizePolicy.Minimum)
        Layout4.addItem(Spacer3)

        self.okButton = QPushButton(self,"okButton")
        self.okButton.setDefault(1)
        Layout4.addWidget(self.okButton)

        self.cancelButton = QPushButton(self,"cancelButton")
        Layout4.addWidget(self.cancelButton)
        Spacer4 = QSpacerItem(20,0,QSizePolicy.Expanding,QSizePolicy.Minimum)
        Layout4.addItem(Spacer4)
        HgPushFormLayout.addLayout(Layout4)

        self.languageChange()

        self.resize(QSize(562,120).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.vcsDirButton,SIGNAL("clicked()"),self.handleDirectory)
        self.connect(self.protocolCombo,SIGNAL("activated(const QString&)"),self.handleProtocol)

        self.setTabOrder(self.protocolCombo,self.vcsDirectoryEdit)
        self.setTabOrder(self.vcsDirectoryEdit,self.vcsDirButton)
        self.setTabOrder(self.vcsDirButton,self.okButton)
        self.setTabOrder(self.okButton,self.cancelButton)

        self.TextLabel2.setBuddy(self.vcsDirectoryEdit)
        self.textLabel1.setBuddy(self.protocolCombo)


    def languageChange(self):
        self.setCaption(self.__tr("Mercurial Push"))
        QWhatsThis.add(self,self.__tr("<b>Push Dialog</b>\n"
"<p>Enter the various repository infos into the entry fields. For remote repositories the Source must contain the hostname.</p>"))
        self.TextLabel2.setText(self.__tr("&Destination:"))
        self.textLabel1.setText(self.__tr("&Protocol:"))
        self.forceCheckBox.setText(self.__tr("&Force push operation"))
        self.forceCheckBox.setAccel(self.__tr("Alt+F"))
        QToolTip.add(self.forceCheckBox,self.__tr("Select, if the push operation should be forced"))
        self.vcsDirButton.setText(self.__tr("..."))
        QToolTip.add(self.vcsDirButton,self.__tr("Show directory selection dialog"))
        QWhatsThis.add(self.vcsDirButton,self.__tr("<b>VCS-Directory</b>\n"
"<p>Select VCS root directory via a directory selection dialog.</p>"))
        QToolTip.add(self.vcsDirectoryEdit,self.__tr("Enter the name of the destination."))
        QWhatsThis.add(self.vcsDirectoryEdit,self.__tr("<b>Destination</b>\n"
"<p>Enter the name of the directory or URL, that is the destination for the push operation. Leave it empty to use the default-push (if defined) or the default, registered during the clone operation.</p>"))
        QToolTip.add(self.protocolCombo,self.__tr("Select the protocol to access the repository"))
        self.okButton.setText(self.__tr("&OK"))
        self.cancelButton.setText(self.__tr("&Cancel"))


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

    def handleDirectory(self):
        print "HgPushForm.handleDirectory(): Not implemented yet"

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

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