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

# Form implementation generated from reading ui file '/home/detlev/Development/Python/Eric/eric3_9/eric3/VCS/subversionPackage/PropSetForm.ui'
#
# Created: So Nov 27 16:13:02 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 PropSetForm(QDialog):
    def __init__(self,parent = None,name = None,modal = 0,fl = 0):
        QDialog.__init__(self,parent,name,modal,fl)

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


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

        layout2 = QHBoxLayout(None,0,6,"layout2")

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

        self.propNameEdit = QLineEdit(self,"propNameEdit")
        layout2.addWidget(self.propNameEdit)
        PropSetFormLayout.addLayout(layout2)

        self.buttonGroup1 = QButtonGroup(self,"buttonGroup1")
        self.buttonGroup1.setExclusive(1)
        self.buttonGroup1.setColumnLayout(0,Qt.Vertical)
        self.buttonGroup1.layout().setSpacing(6)
        self.buttonGroup1.layout().setMargin(6)
        buttonGroup1Layout = QGridLayout(self.buttonGroup1.layout())
        buttonGroup1Layout.setAlignment(Qt.AlignTop)

        self.propTextEdit = QTextEdit(self.buttonGroup1,"propTextEdit")
        self.propTextEdit.setTextFormat(QTextEdit.PlainText)

        buttonGroup1Layout.addMultiCellWidget(self.propTextEdit,1,1,0,1)

        self.propFileEdit = QLineEdit(self.buttonGroup1,"propFileEdit")
        self.propFileEdit.setEnabled(0)

        buttonGroup1Layout.addWidget(self.propFileEdit,3,0)

        self.fileRadioButton = QRadioButton(self.buttonGroup1,"fileRadioButton")
        self.fileRadioButton.setFocusPolicy(QRadioButton.NoFocus)

        buttonGroup1Layout.addWidget(self.fileRadioButton,2,0)

        self.textRadioButton = QRadioButton(self.buttonGroup1,"textRadioButton")
        self.textRadioButton.setChecked(1)

        buttonGroup1Layout.addWidget(self.textRadioButton,0,0)

        self.fileButton = QPushButton(self.buttonGroup1,"fileButton")
        self.fileButton.setEnabled(0)

        buttonGroup1Layout.addWidget(self.fileButton,3,1)
        PropSetFormLayout.addWidget(self.buttonGroup1)

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

        self.okButton = QPushButton(self,"okButton")
        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)
        PropSetFormLayout.addLayout(layout1)

        self.languageChange()

        self.resize(QSize(494,385).expandedTo(self.minimumSizeHint()))
        self.clearWState(Qt.WState_Polished)

        self.connect(self.textRadioButton,SIGNAL("toggled(bool)"),self.propTextEdit.setEnabled)
        self.connect(self.textRadioButton,SIGNAL("toggled(bool)"),self.propFileEdit.setDisabled)
        self.connect(self.textRadioButton,SIGNAL("toggled(bool)"),self.fileButton.setDisabled)
        self.connect(self.fileRadioButton,SIGNAL("toggled(bool)"),self.propTextEdit.setDisabled)
        self.connect(self.fileRadioButton,SIGNAL("toggled(bool)"),self.propFileEdit.setEnabled)
        self.connect(self.fileRadioButton,SIGNAL("toggled(bool)"),self.fileButton.setEnabled)
        self.connect(self.fileButton,SIGNAL("clicked()"),self.selectPropertyFile)
        self.connect(self.okButton,SIGNAL("clicked()"),self.accept)
        self.connect(self.cancelButton,SIGNAL("clicked()"),self.reject)

        self.setTabOrder(self.propNameEdit,self.textRadioButton)
        self.setTabOrder(self.textRadioButton,self.propTextEdit)
        self.setTabOrder(self.propTextEdit,self.propFileEdit)
        self.setTabOrder(self.propFileEdit,self.fileButton)
        self.setTabOrder(self.fileButton,self.okButton)
        self.setTabOrder(self.okButton,self.cancelButton)


    def languageChange(self):
        self.setCaption(self.__tr("Set Subversion Property"))
        self.textLabel1.setText(self.__tr("Property Name:"))
        QToolTip.add(self.propNameEdit,self.__tr("Enter the name of the property to be set"))
        self.buttonGroup1.setTitle(self.__tr("Select property source"))
        QToolTip.add(self.propTextEdit,self.__tr("Enter text of the property"))
        QToolTip.add(self.propFileEdit,self.__tr("Enter the name of a file for the property"))
        self.fileRadioButton.setText(self.__tr("File"))
        self.textRadioButton.setText(self.__tr("Text"))
        self.fileButton.setText(self.__tr("..."))
        QToolTip.add(self.fileButton,self.__tr("Press to select the file via a file selection dialog"))
        self.okButton.setText(self.__tr("&OK"))
        self.cancelButton.setText(self.__tr("&Cancel"))


    def selectPropertyFile(self):
        print "PropSetForm.selectPropertyFile(): Not implemented yet"

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

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