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

# Form implementation generated from reading ui file '/home/detlev/Development/Python/Eric/eric3/Preferences/ShortcutForm.ui'
#
# Created: Sam Jul 26 18:43:25 2003
#      by: The PyQt User Interface Compiler (pyuic) 3.7
#
# WARNING! All changes made in this file will be lost!


import sys
from qt import *


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

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


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

        self.groupBox1 = QGroupBox(self,"groupBox1")
        self.groupBox1.setColumnLayout(0,Qt.Vertical)
        self.groupBox1.layout().setSpacing(12)
        self.groupBox1.layout().setMargin(6)
        groupBox1Layout = QHBoxLayout(self.groupBox1.layout())
        groupBox1Layout.setAlignment(Qt.AlignTop)

        self.clearButton = QPushButton(self.groupBox1,"clearButton")
        self.clearButton.setFocusPolicy(QPushButton.NoFocus)
        groupBox1Layout.addWidget(self.clearButton)

        self.keyLabel = QLabel(self.groupBox1,"keyLabel")
        self.keyLabel.setSizePolicy(QSizePolicy(7,5,0,0,self.keyLabel.sizePolicy().hasHeightForWidth()))
        self.keyLabel.setFrameShape(QLabel.Panel)
        self.keyLabel.setFrameShadow(QLabel.Sunken)
        groupBox1Layout.addWidget(self.keyLabel)
        ShortcutFormLayout.addWidget(self.groupBox1)

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

        self.okButton = QPushButton(self,"okButton")
        self.okButton.setFocusPolicy(QPushButton.NoFocus)
        self.okButton.setDefault(1)
        layout1.addWidget(self.okButton)

        self.cancelButton = QPushButton(self,"cancelButton")
        self.cancelButton.setFocusPolicy(QPushButton.NoFocus)
        layout1.addWidget(self.cancelButton)
        spacer_2 = QSpacerItem(40,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        layout1.addItem(spacer_2)
        ShortcutFormLayout.addLayout(layout1)

        self.languageChange()

        self.resize(QSize(465,87).expandedTo(self.minimumSizeHint()))
        self.clearWState(Qt.WState_Polished)

        self.connect(self.okButton,SIGNAL("clicked()"),self.handleOk)
        self.connect(self.cancelButton,SIGNAL("clicked()"),self,SLOT("reject()"))
        self.connect(self.clearButton,SIGNAL("clicked()"),self.handleClear)


    def languageChange(self):
        self.setCaption(self.__tr("Edit Shortcut"))
        QToolTip.add(self,self.__tr("Press your shortcut keys and select OK"))
        self.groupBox1.setTitle(QString.null)
        self.clearButton.setText(self.__tr("Clear"))
        QToolTip.add(self.clearButton,self.__tr("Press to clear the key sequence buffer."))
        self.keyLabel.setText(QString.null)
        QToolTip.add(self.keyLabel,QString.null)
        self.okButton.setText(self.__tr("OK"))
        self.cancelButton.setText(self.__tr("Cancel"))


    def handleOk(self):
        print "ShortcutForm.handleOk(): Not implemented yet"

    def handleClear(self):
        print "ShortcutForm.handleClear(): Not implemented yet"

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

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