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

# Form implementation generated from reading ui file '/home/detlev/Development/Python/Eric/eric3_8/eric3/UI/TemplatePropertiesForm.ui'
#
# Created: So Jul 3 16:21:28 2005
#      by: The PyQt User Interface Compiler (pyuic) 3.14.1
#
# WARNING! All changes made in this file will be lost!


import sys
from qt import *


class TemplatePropertiesForm(QDialog):
    def __init__(self,parent = None,name = None,modal = 0,fl = 0):
        QDialog.__init__(self,parent,name,modal,fl)

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

        self.setSizeGripEnabled(1)

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

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

        self.templateEdit = QTextEdit(self,"templateEdit")
        self.templateEdit.setTextFormat(QTextEdit.PlainText)
        self.templateEdit.setWordWrap(QTextEdit.NoWrap)

        layout3.addMultiCellWidget(self.templateEdit,2,4,1,1)

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

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

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

        layout3.addWidget(self.helpButton,3,0)

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

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

        self.templateLabel = QLabel(self,"templateLabel")
        self.templateLabel.setAlignment(QLabel.AlignTop)

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

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

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

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

        layout3.addWidget(self.nameEdit,0,1)
        spacer3 = QSpacerItem(20,40,QSizePolicy.Minimum,QSizePolicy.Expanding)
        layout3.addItem(spacer3,4,0)
        TemplatePropertiesFormLayout.addLayout(layout3)

        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)
        TemplatePropertiesFormLayout.addLayout(layout1)

        self.languageChange()

        self.resize(QSize(448,323).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.helpButton,SIGNAL("clicked()"),self.handleHelp)

        self.setTabOrder(self.nameEdit,self.groupCombo)
        self.setTabOrder(self.groupCombo,self.templateEdit)
        self.setTabOrder(self.templateEdit,self.okButton)
        self.setTabOrder(self.okButton,self.cancelButton)
        self.setTabOrder(self.cancelButton,self.helpButton)


    def languageChange(self):
        self.setCaption(self.__tr("Template Properties"))
        QToolTip.add(self.templateEdit,self.__tr("Enter the text of the template"))
        QWhatsThis.add(self.templateEdit,self.__tr("<b>Template Text</b>\n"
"<p>Enter the template text in this area. Every occurance of $VAR$ will be replaced\n"
"by the associated text when the template is applied. The separator character might\n"
"be changed via the preferences dialog.</p>"))
        self.groupLabel.setText(self.__tr("Group:"))
        self.helpButton.setText(self.__tr("&Help"))
        self.helpButton.setAccel(self.__tr("Alt+H"))
        self.textLabel1.setText(self.__tr("Name:"))
        self.templateLabel.setText(self.__tr("Template:"))
        QToolTip.add(self.groupCombo,QString.null)
        QToolTip.add(self.nameEdit,self.__tr("Enter the name of the template/group"))
        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 handleHelp(self):
        print "TemplatePropertiesForm.handleHelp(): Not implemented yet"

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

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