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

# Form implementation generated from reading ui file '/home/detlev/Development/Python/Eric/eric3_9/eric3/Preferences/ShortcutsForm.ui'
#
# Created: Sa Dez 3 18:06:20 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 ShortcutsForm(QDialog):
    def __init__(self,parent = None,name = None,modal = 0,fl = 0):
        QDialog.__init__(self,parent,name,modal,fl)

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


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

        self.shortcutsList = QListView(self,"shortcutsList")
        self.shortcutsList.addColumn(self.__tr("Action"))
        self.shortcutsList.addColumn(self.__tr("Shortcut"))
        self.shortcutsList.addColumn(self.__tr("Alternativ"))
        self.shortcutsList.addColumn(self.__tr("name"))
        self.shortcutsList.setAllColumnsShowFocus(1)
        self.shortcutsList.setRootIsDecorated(1)
        ShortcutsFormLayout.addWidget(self.shortcutsList)

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

        self.languageChange()

        self.resize(QSize(600,480).expandedTo(self.minimumSizeHint()))
        self.clearWState(Qt.WState_Polished)

        self.connect(self.okButton,SIGNAL("clicked()"),self.handleOk)
        self.connect(self.cancelButton,SIGNAL("clicked()"),self.reject)
        self.connect(self.shortcutsList,SIGNAL("doubleClicked(QListViewItem*)"),self.handleDoubleClicked)


    def languageChange(self):
        self.setCaption(self.__tr("Keyboard Shortcuts"))
        self.shortcutsList.header().setLabel(0,self.__tr("Action"))
        self.shortcutsList.header().setLabel(1,self.__tr("Shortcut"))
        self.shortcutsList.header().setLabel(2,self.__tr("Alternativ"))
        self.shortcutsList.header().setLabel(3,self.__tr("name"))
        QToolTip.add(self.shortcutsList,self.__tr("This list shows all keyboard shortcuts."))
        QWhatsThis.add(self.shortcutsList,self.__tr("<b>Keyboard Shortcuts List</b>\n"
"<p>This list shows all keyboard shortcuts defined in the application. Double click an entry in order to change the respective shortcut. Alternatively, the shortcut might be changed by editing the key sequence in the respective column.</p>"))
        self.okButton.setText(self.__tr("&OK"))
        self.okButton.setAccel(self.__tr("Alt+O"))
        self.cancelButton.setText(self.__tr("&Cancel"))


    def handleDoubleClicked(self,a0):
        print "ShortcutsForm.handleDoubleClicked(QListViewItem*): Not implemented yet"

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

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

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