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

# Form implementation generated from reading ui file '/home/detlev/Development/Python/Eric/eric3_6/eric3/PyUnit/UnittestForm.ui'
#
# Created: Do Dez 30 14:12:28 2004
#      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 UnittestForm(QWidget):
    def __init__(self,parent = None,name = None,fl = 0):
        QWidget.__init__(self,parent,name,fl)

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


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

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

        self.testsuiteLabel = QLabel(self,"testsuiteLabel")
        testsuiteLayout.addWidget(self.testsuiteLabel)

        self.testsuiteComboBox = QComboBox(0,self,"testsuiteComboBox")
        self.testsuiteComboBox.setSizePolicy(QSizePolicy(QSizePolicy.MinimumExpanding,QSizePolicy.Fixed,0,0,self.testsuiteComboBox.sizePolicy().hasHeightForWidth()))
        self.testsuiteComboBox.setEditable(1)
        self.testsuiteComboBox.setInsertionPolicy(QComboBox.AtTop)
        self.testsuiteComboBox.setAutoCompletion(1)
        self.testsuiteComboBox.setDuplicatesEnabled(0)
        testsuiteLayout.addWidget(self.testsuiteComboBox)

        self.fileDialogButton = QPushButton(self,"fileDialogButton")
        testsuiteLayout.addWidget(self.fileDialogButton)
        UnittestFormLayout.addLayout(testsuiteLayout)

        self.optionsButtonGroup = QButtonGroup(self,"optionsButtonGroup")
        self.optionsButtonGroup.setFrameShape(QButtonGroup.NoFrame)
        self.optionsButtonGroup.setColumnLayout(0,Qt.Vertical)
        self.optionsButtonGroup.layout().setSpacing(6)
        self.optionsButtonGroup.layout().setMargin(0)
        optionsButtonGroupLayout = QHBoxLayout(self.optionsButtonGroup.layout())
        optionsButtonGroupLayout.setAlignment(Qt.AlignTop)

        self.localCheckBox = QCheckBox(self.optionsButtonGroup,"localCheckBox")
        optionsButtonGroupLayout.addWidget(self.localCheckBox)

        self.coverageCheckBox = QCheckBox(self.optionsButtonGroup,"coverageCheckBox")
        optionsButtonGroupLayout.addWidget(self.coverageCheckBox)

        self.coverageEraseCheckBox = QCheckBox(self.optionsButtonGroup,"coverageEraseCheckBox")
        self.coverageEraseCheckBox.setEnabled(0)
        optionsButtonGroupLayout.addWidget(self.coverageEraseCheckBox)
        UnittestFormLayout.addWidget(self.optionsButtonGroup)

        self.progressGroupBox = QGroupBox(self,"progressGroupBox")
        self.progressGroupBox.setColumnLayout(0,Qt.Vertical)
        self.progressGroupBox.layout().setSpacing(6)
        self.progressGroupBox.layout().setMargin(11)
        progressGroupBoxLayout = QVBoxLayout(self.progressGroupBox.layout())
        progressGroupBoxLayout.setAlignment(Qt.AlignTop)

        self.progressTextLabel = QLabel(self.progressGroupBox,"progressTextLabel")
        progressGroupBoxLayout.addWidget(self.progressTextLabel)

        self.progressProgressBar = QProgressBar(self.progressGroupBox,"progressProgressBar")
        progressGroupBoxLayout.addWidget(self.progressProgressBar)

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

        self.progressCounterRunLabel = QLabel(self.progressGroupBox,"progressCounterRunLabel")
        progressCounterLayout.addWidget(self.progressCounterRunLabel)

        self.progressCounterRunCount = QLabel(self.progressGroupBox,"progressCounterRunCount")
        self.progressCounterRunCount.setPaletteForegroundColor(QColor(0,0,255))
        progressCounterLayout.addWidget(self.progressCounterRunCount)

        self.progressCounterFailureLabel = QLabel(self.progressGroupBox,"progressCounterFailureLabel")
        progressCounterLayout.addWidget(self.progressCounterFailureLabel)

        self.progressCounterFailureCount = QLabel(self.progressGroupBox,"progressCounterFailureCount")
        self.progressCounterFailureCount.setPaletteForegroundColor(QColor(0,0,255))
        progressCounterLayout.addWidget(self.progressCounterFailureCount)

        self.progressCounterErrorLabel = QLabel(self.progressGroupBox,"progressCounterErrorLabel")
        progressCounterLayout.addWidget(self.progressCounterErrorLabel)

        self.progressCounterErrorCount = QLabel(self.progressGroupBox,"progressCounterErrorCount")
        self.progressCounterErrorCount.setPaletteForegroundColor(QColor(0,0,255))
        progressCounterLayout.addWidget(self.progressCounterErrorCount)

        self.progressCounterRemLabel = QLabel(self.progressGroupBox,"progressCounterRemLabel")
        progressCounterLayout.addWidget(self.progressCounterRemLabel)

        self.progressCounterRemCount = QLabel(self.progressGroupBox,"progressCounterRemCount")
        self.progressCounterRemCount.setPaletteForegroundColor(QColor(0,0,255))
        progressCounterLayout.addWidget(self.progressCounterRemCount)
        progressCounterSpacer = QSpacerItem(20,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        progressCounterLayout.addItem(progressCounterSpacer)
        progressGroupBoxLayout.addLayout(progressCounterLayout)
        UnittestFormLayout.addWidget(self.progressGroupBox)

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

        self.testsListBox = QListBox(self,"testsListBox")
        UnittestFormLayout.addWidget(self.testsListBox)

        self.listboxLabel = QLabel(self,"listboxLabel")
        UnittestFormLayout.addWidget(self.listboxLabel)

        self.errorsListBox = QListBox(self,"errorsListBox")
        UnittestFormLayout.addWidget(self.errorsListBox)

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

        self.startButton = QPushButton(self,"startButton")
        self.startButton.setEnabled(1)
        self.startButton.setDefault(1)
        layout5.addWidget(self.startButton)

        self.stopButton = QPushButton(self,"stopButton")
        self.stopButton.setEnabled(0)
        layout5.addWidget(self.stopButton)

        self.closeButton = QPushButton(self,"closeButton")
        layout5.addWidget(self.closeButton)
        spacer4 = QSpacerItem(40,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        layout5.addItem(spacer4)
        UnittestFormLayout.addLayout(layout5)

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

        self.sbLabel = QLabel(self,"sbLabel")
        self.sbLabel.setSizePolicy(QSizePolicy(QSizePolicy.Preferred,QSizePolicy.Preferred,0,0,self.sbLabel.sizePolicy().hasHeightForWidth()))
        Layout7.addWidget(self.sbLabel)
        Spacer3 = QSpacerItem(20,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        Layout7.addItem(Spacer3)
        UnittestFormLayout.addLayout(Layout7)

        self.languageChange()

        self.resize(QSize(610,673).expandedTo(self.minimumSizeHint()))
        self.clearWState(Qt.WState_Polished)

        self.connect(self.closeButton,SIGNAL("clicked()"),self.close)
        self.connect(self.startButton,SIGNAL("clicked()"),self.handleStartTest)
        self.connect(self.stopButton,SIGNAL("clicked()"),self.handleStopTest)
        self.connect(self.fileDialogButton,SIGNAL("clicked()"),self.handleFileDialog)
        self.connect(self.errorsListBox,SIGNAL("doubleClicked(QListBoxItem*)"),self.handleListboxDoubleClick)
        self.connect(self.errorsListBox,SIGNAL("highlighted(const QString&)"),self.handleErrorHighlighted)
        self.connect(self.coverageCheckBox,SIGNAL("toggled(bool)"),self.coverageEraseCheckBox.setEnabled)

        self.testsuiteLabel.setBuddy(self.testsuiteComboBox)


    def languageChange(self):
        self.setCaption(self.__tr("UnittestForm"))
        QToolTip.add(self,QString.null)
        self.testsuiteLabel.setText(self.__tr("Enter &test name:"))
        QToolTip.add(self.testsuiteComboBox,self.__tr("Enter name of file defining the testsuite"))
        QWhatsThis.add(self.testsuiteComboBox,self.__tr("<b>Testsuite</b>\n"
"<p>Enter the name of the file defining the testsuite.\n"
"It should have a method called suite() returning a\n"
"unittest.TestSuite object. If no such method can be\n"
"found, the module will be inspected for proper test\n"
"cases.</p>"))
        self.fileDialogButton.setText(self.__tr("..."))
        QToolTip.add(self.fileDialogButton,self.__tr("Open a file selection dialog"))
        self.optionsButtonGroup.setTitle(QString.null)
        self.localCheckBox.setText(self.__tr("Run local"))
        QToolTip.add(self.localCheckBox,self.__tr("Select whether you want to run the test locally"))
        self.coverageCheckBox.setText(self.__tr("Collect coverage data"))
        QToolTip.add(self.coverageCheckBox,self.__tr("Select whether coverage data should be collected"))
        self.coverageEraseCheckBox.setText(self.__tr("Erase coverage data"))
        QToolTip.add(self.coverageEraseCheckBox,self.__tr("Select whether old coverage data should be erased"))
        self.progressGroupBox.setTitle(QString.null)
        QToolTip.add(self.progressGroupBox,self.__tr("Progress information"))
        self.progressTextLabel.setText(self.__tr("Progress:"))
        QToolTip.add(self.progressProgressBar,QString.null)
        self.progressCounterRunLabel.setText(self.__tr("Run:"))
        self.progressCounterRunCount.setText(self.__tr("0"))
        QToolTip.add(self.progressCounterRunCount,self.__tr("Number of tests run"))
        self.progressCounterFailureLabel.setText(self.__tr("Failures:"))
        self.progressCounterFailureCount.setText(self.__tr("0"))
        QToolTip.add(self.progressCounterFailureCount,self.__tr("Number of test failures"))
        self.progressCounterErrorLabel.setText(self.__tr("Errors:"))
        self.progressCounterErrorCount.setText(self.__tr("0"))
        QToolTip.add(self.progressCounterErrorCount,self.__tr("Number of test errors"))
        self.progressCounterRemLabel.setText(self.__tr("Remaining:"))
        self.progressCounterRemCount.setText(self.__tr("0"))
        QToolTip.add(self.progressCounterRemCount,self.__tr("Number of tests to be run"))
        self.textLabel1.setText(self.__tr("Tests performed:"))
        self.listboxLabel.setText(self.__tr("Failures and errors:"))
        QToolTip.add(self.errorsListBox,self.__tr("Failures and Errors list"))
        QWhatsThis.add(self.errorsListBox,self.__tr("<b>Failures and Errors list</b>\n"
"<p>This list shows all failed and errored tests.\n"
"Double clicking on an entry will show the respective traceback.</p>"))
        self.startButton.setText(self.__tr("&Start"))
        QToolTip.add(self.startButton,self.__tr("Start the selected testsuite"))
        QWhatsThis.add(self.startButton,self.__tr("<b>Start Test</b>\n"
"<p>This button starts the selected testsuite.</p>"))
        self.stopButton.setText(self.__tr("Sto&p"))
        QToolTip.add(self.stopButton,self.__tr("Stop the running unittest"))
        QWhatsThis.add(self.stopButton,self.__tr("<b>Stop Test</b>\n"
"<p>This button stops a running unittest.</p>"))
        self.closeButton.setText(self.__tr("&Close"))
        QToolTip.add(self.closeButton,self.__tr("Close this window"))
        QWhatsThis.add(self.closeButton,self.__tr("<b>Close Dialog</b>\n"
"<p>This button closes the unittest dialog</p>"))
        self.sbLabel.setText(self.__tr("Idle"))


    def handleFileDialog(self):
        print "UnittestForm.handleFileDialog(): Not implemented yet"

    def handleStartTest(self):
        print "UnittestForm.handleStartTest(): Not implemented yet"

    def handleStopTest(self):
        print "UnittestForm.handleStopTest(): Not implemented yet"

    def handleListboxDoubleClick(self,a0):
        print "UnittestForm.handleListboxDoubleClick(QListBoxItem*): Not implemented yet"

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

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

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