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

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

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


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

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

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

        self.fileNameEdit = QLineEdit(self,"fileNameEdit")
        self.fileNameEdit.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Fixed,9,0,self.fileNameEdit.sizePolicy().hasHeightForWidth()))
        layout4.addWidget(self.fileNameEdit)

        self.extsepLabel = QLabel(self,"extsepLabel")
        layout4.addWidget(self.extsepLabel)

        self.fileExtEdit = QLineEdit(self,"fileExtEdit")
        self.fileExtEdit.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Fixed,1,0,self.fileExtEdit.sizePolicy().hasHeightForWidth()))
        layout4.addWidget(self.fileExtEdit)
        FindFileNameFormLayout.addLayout(layout4)

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

        self.projectCheckBox = QCheckBox(self,"projectCheckBox")
        layout3.addWidget(self.projectCheckBox)

        self.syspathCheckBox = QCheckBox(self,"syspathCheckBox")
        layout3.addWidget(self.syspathCheckBox)
        FindFileNameFormLayout.addLayout(layout3)

        self.fileView = QListView(self,"fileView")
        self.fileView.addColumn(self.__tr("Filename"))
        self.fileView.addColumn(self.__tr("Path"))
        self.fileView.setAllColumnsShowFocus(1)
        self.fileView.setShowSortIndicator(1)
        FindFileNameFormLayout.addWidget(self.fileView)

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

        self.openButton = QPushButton(self,"openButton")
        layout2.addWidget(self.openButton)

        self.closeButton = QPushButton(self,"closeButton")
        self.closeButton.setDefault(1)
        layout2.addWidget(self.closeButton)
        spacer2 = QSpacerItem(40,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        layout2.addItem(spacer2)
        FindFileNameFormLayout.addLayout(layout2)

        self.languageChange()

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

        self.connect(self.closeButton,SIGNAL("clicked()"),self.close)
        self.connect(self.openButton,SIGNAL("clicked()"),self.handleOpen)
        self.connect(self.fileView,SIGNAL("doubleClicked(QListViewItem*)"),self.handleOpen)
        self.connect(self.projectCheckBox,SIGNAL("toggled(bool)"),self.searchFile)
        self.connect(self.syspathCheckBox,SIGNAL("toggled(bool)"),self.searchFile)
        self.connect(self.fileNameEdit,SIGNAL("textChanged(const QString&)"),self.searchFile)
        self.connect(self.fileExtEdit,SIGNAL("textChanged(const QString&)"),self.searchFile)


    def languageChange(self):
        self.setCaption(self.__tr("Find File"))
        self.textLabel1.setText(self.__tr("Enter filename (? matches any single character, * matches everything)"))
        QToolTip.add(self.fileNameEdit,self.__tr("Enter file name to search for "))
        self.extsepLabel.setText(self.__tr("."))
        QToolTip.add(self.fileExtEdit,self.__tr("Enter file extension to search for"))
        self.projectCheckBox.setText(self.__tr("Search in &project"))
        self.projectCheckBox.setAccel(self.__tr("Alt+P"))
        QToolTip.add(self.projectCheckBox,self.__tr("Select to search in the project path"))
        self.syspathCheckBox.setText(self.__tr("Search in &sys.path"))
        self.syspathCheckBox.setAccel(self.__tr("Alt+S"))
        QToolTip.add(self.syspathCheckBox,self.__tr("Select to search in sys.path"))
        self.fileView.header().setLabel(0,self.__tr("Filename"))
        self.fileView.header().setLabel(1,self.__tr("Path"))
        self.openButton.setText(self.__tr("&Open"))
        self.openButton.setAccel(self.__tr("Alt+O"))
        QToolTip.add(self.openButton,self.__tr("Opens the selected file"))
        self.closeButton.setText(self.__tr("&Close"))
        self.closeButton.setAccel(self.__tr("Alt+C"))
        QToolTip.add(self.closeButton,self.__tr("Closes the dialog"))


    def handleOpen(self):
        print "FindFileNameForm.handleOpen(): Not implemented yet"

    def searchFile(self):
        print "FindFileNameForm.searchFile(): Not implemented yet"

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

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