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

# Form implementation generated from reading ui file '/home/detlev/Development/Python/Eric/eric3_6/eric3/UI/FindFileForm.ui'
#
# Created: Sa Jan 15 11:53:40 2005
#      by: The PyQt User Interface Compiler (pyuic) snapshot-20041229
#
# WARNING! All changes made in this file will be lost!


import sys
from qt import *


class FindFileForm(QWidget):
    def __init__(self,parent = None,name = None,fl = 0):
        QWidget.__init__(self,parent,name,fl)

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


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

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

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

        self.caseCheckBox = QCheckBox(self,"caseCheckBox")
        Layout4.addWidget(self.caseCheckBox)

        self.wordCheckBox = QCheckBox(self,"wordCheckBox")
        Layout4.addWidget(self.wordCheckBox)

        self.regexpCheckBox = QCheckBox(self,"regexpCheckBox")
        Layout4.addWidget(self.regexpCheckBox)

        Layout5.addMultiCellLayout(Layout4,1,1,1,2)

        self.ButtonGroup1 = QButtonGroup(self,"ButtonGroup1")
        self.ButtonGroup1.setColumnLayout(0,Qt.Vertical)
        self.ButtonGroup1.layout().setSpacing(6)
        self.ButtonGroup1.layout().setMargin(6)
        ButtonGroup1Layout = QVBoxLayout(self.ButtonGroup1.layout())
        ButtonGroup1Layout.setAlignment(Qt.AlignTop)

        self.sourcesButton = QRadioButton(self.ButtonGroup1,"sourcesButton")
        self.sourcesButton.setChecked(1)
        ButtonGroup1Layout.addWidget(self.sourcesButton)

        self.formsButton = QRadioButton(self.ButtonGroup1,"formsButton")
        ButtonGroup1Layout.addWidget(self.formsButton)

        self.allFilesButton = QRadioButton(self.ButtonGroup1,"allFilesButton")
        self.allFilesButton.setChecked(0)
        ButtonGroup1Layout.addWidget(self.allFilesButton)

        Layout5.addWidget(self.ButtonGroup1,2,1)

        self.findtextCombo = QComboBox(0,self,"findtextCombo")
        self.findtextCombo.setSizePolicy(QSizePolicy(QSizePolicy.Expanding,QSizePolicy.Fixed,0,0,self.findtextCombo.sizePolicy().hasHeightForWidth()))
        self.findtextCombo.setEditable(1)
        self.findtextCombo.setInsertionPolicy(QComboBox.AtTop)
        self.findtextCombo.setDuplicatesEnabled(0)

        Layout5.addMultiCellWidget(self.findtextCombo,0,0,1,2)

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

        Layout5.addWidget(self.TextLabel1,0,0)

        self.ButtonGroup2 = QButtonGroup(self,"ButtonGroup2")
        self.ButtonGroup2.setColumnLayout(0,Qt.Vertical)
        self.ButtonGroup2.layout().setSpacing(6)
        self.ButtonGroup2.layout().setMargin(6)
        ButtonGroup2Layout = QVBoxLayout(self.ButtonGroup2.layout())
        ButtonGroup2Layout.setAlignment(Qt.AlignTop)

        self.projectButton = QRadioButton(self.ButtonGroup2,"projectButton")
        self.projectButton.setChecked(1)
        ButtonGroup2Layout.addWidget(self.projectButton)

        self.dirButton = QRadioButton(self.ButtonGroup2,"dirButton")
        self.dirButton.setFocusPolicy(QRadioButton.NoFocus)
        ButtonGroup2Layout.addWidget(self.dirButton)

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

        self.dirEdit = QLineEdit(self.ButtonGroup2,"dirEdit")
        self.dirEdit.setEnabled(0)
        Layout4_2.addWidget(self.dirEdit)

        self.dirSelectButton = QPushButton(self.ButtonGroup2,"dirSelectButton")
        self.dirSelectButton.setEnabled(0)
        self.dirSelectButton.setFocusPolicy(QPushButton.NoFocus)
        Layout4_2.addWidget(self.dirSelectButton)
        ButtonGroup2Layout.addLayout(Layout4_2)

        Layout5.addWidget(self.ButtonGroup2,2,2)
        FindFileFormLayout.addLayout(Layout5)

        self.findProgress = QProgressBar(self,"findProgress")
        FindFileFormLayout.addWidget(self.findProgress)

        self.findList = QListView(self,"findList")
        self.findList.addColumn(self.__tr("File"))
        self.findList.addColumn(self.__tr("Line"))
        self.findList.addColumn(self.__tr("Text"))
        self.findList.addColumn(self.__tr("Start"))
        self.findList.addColumn(self.__tr("End"))
        FindFileFormLayout.addWidget(self.findList)

        Layout3 = QHBoxLayout(None,0,6,"Layout3")
        Spacer3 = QSpacerItem(30,0,QSizePolicy.Expanding,QSizePolicy.Minimum)
        Layout3.addItem(Spacer3)

        self.findButton = QPushButton(self,"findButton")
        self.findButton.setEnabled(0)
        self.findButton.setDefault(1)
        Layout3.addWidget(self.findButton)

        self.closeButton = QPushButton(self,"closeButton")
        Layout3.addWidget(self.closeButton)
        Spacer4 = QSpacerItem(30,0,QSizePolicy.Expanding,QSizePolicy.Minimum)
        Layout3.addItem(Spacer4)
        FindFileFormLayout.addLayout(Layout3)

        self.languageChange()

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

        self.connect(self.findtextCombo,SIGNAL("textChanged(const QString&)"),self.enableFindButton)
        self.connect(self.closeButton,SIGNAL("clicked()"),self.close)
        self.connect(self.findList,SIGNAL("doubleClicked(QListViewItem*)"),self.handleDoubleClick)
        self.connect(self.findButton,SIGNAL("clicked()"),self.findPressed)
        self.connect(self.dirButton,SIGNAL("toggled(bool)"),self.dirEdit.setEnabled)
        self.connect(self.dirButton,SIGNAL("toggled(bool)"),self.dirSelectButton.setEnabled)
        self.connect(self.dirSelectButton,SIGNAL("clicked()"),self.handleDirSelection)
        self.connect(self.projectButton,SIGNAL("clicked()"),self.enableFindButton)
        self.connect(self.dirButton,SIGNAL("clicked()"),self.enableFindButton)
        self.connect(self.dirEdit,SIGNAL("textChanged(const QString&)"),self.enableFindButton)

        self.setTabOrder(self.findtextCombo,self.caseCheckBox)
        self.setTabOrder(self.caseCheckBox,self.wordCheckBox)
        self.setTabOrder(self.wordCheckBox,self.regexpCheckBox)
        self.setTabOrder(self.regexpCheckBox,self.sourcesButton)
        self.setTabOrder(self.sourcesButton,self.formsButton)
        self.setTabOrder(self.formsButton,self.allFilesButton)
        self.setTabOrder(self.allFilesButton,self.projectButton)
        self.setTabOrder(self.projectButton,self.dirButton)
        self.setTabOrder(self.dirButton,self.dirEdit)
        self.setTabOrder(self.dirEdit,self.findList)
        self.setTabOrder(self.findList,self.findButton)
        self.setTabOrder(self.findButton,self.closeButton)
        self.setTabOrder(self.closeButton,self.dirSelectButton)

        self.TextLabel1.setBuddy(self.findtextCombo)


    def languageChange(self):
        self.setCaption(self.__tr("Find in Files"))
        self.caseCheckBox.setText(self.__tr("&Match upper/lower case"))
        QToolTip.add(self.caseCheckBox,self.__tr("Select to match case sensitive"))
        self.wordCheckBox.setText(self.__tr("Whole &word"))
        QToolTip.add(self.wordCheckBox,self.__tr("Select to match whole words only"))
        self.regexpCheckBox.setText(self.__tr("Regular &Expression"))
        QToolTip.add(self.regexpCheckBox,self.__tr("Select if the searchtext is a regular expression"))
        self.ButtonGroup1.setTitle(self.__tr("File type"))
        self.sourcesButton.setText(self.__tr("&Sources only"))
        QToolTip.add(self.sourcesButton,self.__tr("Search in source files only"))
        self.formsButton.setText(self.__tr("&Forms only"))
        QToolTip.add(self.formsButton,self.__tr("Search in forms only"))
        self.allFilesButton.setText(self.__tr("&Both"))
        self.allFilesButton.setAccel(self.__tr("Alt+B"))
        QToolTip.add(self.allFilesButton,self.__tr("Search in sources and forms"))
        QToolTip.add(self.findtextCombo,self.__tr("Enter the search text or regular expression"))
        self.TextLabel1.setText(self.__tr("Find &text:"))
        self.ButtonGroup2.setTitle(self.__tr("Find in"))
        self.projectButton.setText(self.__tr("&Project"))
        QToolTip.add(self.projectButton,self.__tr("Search in files of the current project"))
        self.dirButton.setText(self.__tr("&Directory tree"))
        QToolTip.add(self.dirButton,self.__tr("Search in files of a directory tree to be entered below"))
        QToolTip.add(self.dirEdit,self.__tr("Enter the directory to search in"))
        self.dirSelectButton.setText(self.__tr("..."))
        QToolTip.add(self.dirSelectButton,self.__tr("Select the directory via a directory selection dialog"))
        QToolTip.add(self.findProgress,self.__tr("Shows the progress of the search action"))
        self.findList.header().setLabel(0,self.__tr("File"))
        self.findList.header().setLabel(1,self.__tr("Line"))
        self.findList.header().setLabel(2,self.__tr("Text"))
        self.findList.header().setLabel(3,self.__tr("Start"))
        self.findList.header().setLabel(4,self.__tr("End"))
        self.findButton.setText(self.__tr("&Find"))
        self.findButton.setAccel(self.__tr("Alt+F"))
        self.closeButton.setText(self.__tr("&Close"))


    def enableFindButton(self):
        print "FindFileForm.enableFindButton(): Not implemented yet"

    def findPressed(self):
        print "FindFileForm.findPressed(): Not implemented yet"

    def handleDoubleClick(self,a0):
        print "FindFileForm.handleDoubleClick(QListViewItem*): Not implemented yet"

    def handleDirSelection(self):
        print "FindFileForm.handleDirSelection(): Not implemented yet"

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

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