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

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

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


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

        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.updateCheckBox = QCheckBox(self,"updateCheckBox")

        layout3.addMultiCellWidget(self.updateCheckBox,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)
        HgPullFormLayout.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)
        HgPullFormLayout.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 Pull"))
        QWhatsThis.add(self,self.__tr("<b>Pull 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("&Source:"))
        self.textLabel1.setText(self.__tr("&Protocol:"))
        self.updateCheckBox.setText(self.__tr("Perform &update"))
        self.updateCheckBox.setAccel(self.__tr("Alt+U"))
        QToolTip.add(self.updateCheckBox,self.__tr("Select, if an update should be performed after the pull operation"))
        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 source."))
        QWhatsThis.add(self.vcsDirectoryEdit,self.__tr("<b>Source</b>\n"
"<p>Enter the name of the directory or URL, that is the source for the pull operation. Leave it empty to use 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 "HgPullForm.handleProtocol(const QString&): Not implemented yet"

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

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

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