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

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

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

        self.setSizeGripEnabled(1)

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

        self.filetypeAssociationList = QListView(self,"filetypeAssociationList")
        self.filetypeAssociationList.addColumn(self.__tr("Filename Pattern"))
        self.filetypeAssociationList.addColumn(self.__tr("Filetype"))
        self.filetypeAssociationList.setAllColumnsShowFocus(1)
        self.filetypeAssociationList.setShowSortIndicator(1)
        FiletypeAssociationFormLayout.addWidget(self.filetypeAssociationList)

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

        self.deleteAssociationButton = QPushButton(self,"deleteAssociationButton")
        self.deleteAssociationButton.setEnabled(0)

        layout22.addWidget(self.deleteAssociationButton,1,2)

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

        layout22.addWidget(self.filetypeCombo,1,1)

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

        layout22.addWidget(self.textLabel3_3,1,0)

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

        layout22.addWidget(self.filePatternEdit,0,1)

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

        layout22.addWidget(self.textLabel2_6,0,0)

        self.addAssociationButton = QPushButton(self,"addAssociationButton")
        self.addAssociationButton.setEnabled(0)

        layout22.addWidget(self.addAssociationButton,0,2)
        FiletypeAssociationFormLayout.addLayout(layout22)

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

        self.okButton = QPushButton(self,"okButton")
        self.okButton.setDefault(1)
        layout30.addWidget(self.okButton)

        self.cancelButton = QPushButton(self,"cancelButton")
        layout30.addWidget(self.cancelButton)
        spacer60 = QSpacerItem(40,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        layout30.addItem(spacer60)
        FiletypeAssociationFormLayout.addLayout(layout30)

        self.languageChange()

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

        self.connect(self.filetypeAssociationList,SIGNAL("clicked(QListViewItem*)"),self.handleAssociationSelected)
        self.connect(self.addAssociationButton,SIGNAL("clicked()"),self.handleAssociationAdd)
        self.connect(self.deleteAssociationButton,SIGNAL("clicked()"),self.handleAssociationDelete)
        self.connect(self.okButton,SIGNAL("clicked()"),self.accept)
        self.connect(self.cancelButton,SIGNAL("clicked()"),self.reject)
        self.connect(self.filePatternEdit,SIGNAL("textChanged(const QString&)"),self.handlePatternTextChanged)
        self.connect(self.filetypeAssociationList,SIGNAL("selectionChanged(QListViewItem*)"),self.handleAssociationSelected)


    def languageChange(self):
        self.setCaption(self.__tr("Filetype Associations"))
        self.filetypeAssociationList.header().setLabel(0,self.__tr("Filename Pattern"))
        self.filetypeAssociationList.header().setLabel(1,self.__tr("Filetype"))
        self.deleteAssociationButton.setText(self.__tr("Delete"))
        QToolTip.add(self.deleteAssociationButton,self.__tr("Press to delete the selected association"))
        QToolTip.add(self.filetypeCombo,self.__tr("Select the filetype to associate"))
        self.textLabel3_3.setText(self.__tr("Filetype:"))
        QToolTip.add(self.filePatternEdit,self.__tr("Enter the filename pattern to be associated"))
        self.textLabel2_6.setText(self.__tr("Filename Pattern:"))
        self.addAssociationButton.setText(self.__tr("Add/Change"))
        QToolTip.add(self.addAssociationButton,self.__tr("Press to add or change the entered association"))
        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 handleAssociationSelected(self,a0):
        print "FiletypeAssociationForm.handleAssociationSelected(QListViewItem*): Not implemented yet"

    def handleAssociationAdd(self):
        print "FiletypeAssociationForm.handleAssociationAdd(): Not implemented yet"

    def handleAssociationDelete(self):
        print "FiletypeAssociationForm.handleAssociationDelete(): Not implemented yet"

    def handlePatternTextChanged(self,a0):
        print "FiletypeAssociationForm.handlePatternTextChanged(const QString&): Not implemented yet"

    def handleSelectionChanged(self):
        print "FiletypeAssociationForm.handleSelectionChanged(): Not implemented yet"

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

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