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

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

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


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

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

        self.newSpinBox = QSpinBox(self,"newSpinBox")
        self.newSpinBox.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Fixed,0,0,self.newSpinBox.sizePolicy().hasHeightForWidth()))
        self.newSpinBox.setMaxValue(999999999)
        self.newSpinBox.setMinValue(-1)
        self.newSpinBox.setValue(-1)

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

        self.oldSpinBox = QSpinBox(self,"oldSpinBox")
        self.oldSpinBox.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Fixed,0,0,self.oldSpinBox.sizePolicy().hasHeightForWidth()))
        self.oldSpinBox.setMaxValue(999999999)
        self.oldSpinBox.setMinValue(-1)
        self.oldSpinBox.setValue(-1)

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

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

        layout3.addMultiCellWidget(self.textLabel3,0,0,0,1)

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

        layout3.addWidget(self.textLabel2,2,0)

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

        layout3.addWidget(self.textLabel1,1,0)
        RevisionSelectionFormLayout.addLayout(layout3)

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

        self.okButton = QPushButton(self,"okButton")
        layout1.addWidget(self.okButton)

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

        self.languageChange()

        self.resize(QSize(291,129).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.oldSpinBox,SIGNAL("valueChanged(int)"),self.handleOldChanged)

        self.setTabOrder(self.oldSpinBox,self.newSpinBox)
        self.setTabOrder(self.newSpinBox,self.okButton)
        self.setTabOrder(self.okButton,self.cancelButton)

        self.textLabel2.setBuddy(self.newSpinBox)
        self.textLabel1.setBuddy(self.oldSpinBox)


    def languageChange(self):
        self.setCaption(self.__tr("Mercurial Diff"))
        QToolTip.add(self.newSpinBox,self.__tr("Enter a revision number"))
        QToolTip.add(self.oldSpinBox,self.__tr("Enter a revision number"))
        self.textLabel3.setText(self.__tr("Enter the revisions to compare (-1 = current)"))
        self.textLabel2.setText(self.__tr("&New revision:"))
        self.textLabel1.setText(self.__tr("Old &revision:"))
        self.okButton.setText(self.__tr("&OK"))
        self.okButton.setAccel(self.__tr("Alt+O"))
        self.cancelButton.setText(self.__tr("&Cancel"))
        self.cancelButton.setAccel(self.__tr("Alt+C"))


    def handleOldChanged(self,a0):
        print "RevisionSelectionForm.handleOldChanged(int): Not implemented yet"

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

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