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

# Form implementation generated from reading ui file '/home/detlev/Development/Python/Eric/eric3_8/eric3/Debugger/EditWatchpointForm.ui'
#
# Created: Di Jun 28 20:27:49 2005
#      by: The PyQt User Interface Compiler (pyuic) 3.14.1
#
# WARNING! All changes made in this file will be lost!


import sys
from qt import *


class EditWatchpointForm(QDialog):
    def __init__(self,parent = None,name = None,modal = 0,fl = 0):
        QDialog.__init__(self,parent,name,modal,fl)

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


        EditWatchpointFormLayout = QGridLayout(self,1,1,6,6,"EditWatchpointFormLayout")

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

        self.okButton = QPushButton(self,"okButton")
        self.okButton.setEnabled(0)
        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)

        EditWatchpointFormLayout.addMultiCellLayout(layout1,4,4,0,2)

        self.ignoreSpinBox = QSpinBox(self,"ignoreSpinBox")
        self.ignoreSpinBox.setMaxValue(9999)

        EditWatchpointFormLayout.addWidget(self.ignoreSpinBox,1,1)

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

        EditWatchpointFormLayout.addWidget(self.textLabel2,1,0)
        spacer3 = QSpacerItem(40,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        EditWatchpointFormLayout.addItem(spacer3,1,2)

        self.buttonGroup1 = QButtonGroup(self,"buttonGroup1")
        self.buttonGroup1.setFrameShape(QButtonGroup.NoFrame)
        self.buttonGroup1.setColumnLayout(0,Qt.Vertical)
        self.buttonGroup1.layout().setSpacing(6)
        self.buttonGroup1.layout().setMargin(0)
        buttonGroup1Layout = QGridLayout(self.buttonGroup1.layout())
        buttonGroup1Layout.setAlignment(Qt.AlignTop)

        self.conditionEdit = QLineEdit(self.buttonGroup1,"conditionEdit")

        buttonGroup1Layout.addWidget(self.conditionEdit,0,1)

        self.specialButton = QRadioButton(self.buttonGroup1,"specialButton")

        buttonGroup1Layout.addWidget(self.specialButton,1,0)

        self.specialEdit = QLineEdit(self.buttonGroup1,"specialEdit")
        self.specialEdit.setEnabled(0)

        buttonGroup1Layout.addWidget(self.specialEdit,1,1)

        self.conditionButton = QRadioButton(self.buttonGroup1,"conditionButton")
        self.conditionButton.setChecked(1)

        buttonGroup1Layout.addWidget(self.conditionButton,0,0)

        self.specialCombo = QComboBox(0,self.buttonGroup1,"specialCombo")
        self.specialCombo.setEnabled(0)

        buttonGroup1Layout.addWidget(self.specialCombo,2,1)

        EditWatchpointFormLayout.addMultiCellWidget(self.buttonGroup1,0,0,0,2)

        self.enabledCheckBox = QCheckBox(self,"enabledCheckBox")

        EditWatchpointFormLayout.addMultiCellWidget(self.enabledCheckBox,3,3,0,2)

        self.temporaryCheckBox = QCheckBox(self,"temporaryCheckBox")

        EditWatchpointFormLayout.addMultiCellWidget(self.temporaryCheckBox,2,2,0,2)

        self.languageChange()

        self.resize(QSize(402,197).expandedTo(self.minimumSizeHint()))
        self.clearWState(Qt.WState_Polished)

        self.connect(self.okButton,SIGNAL("clicked()"),self.accept)
        self.connect(self.cancelButton,SIGNAL("clicked()"),self.reject)
        self.connect(self.conditionEdit,SIGNAL("textChanged(const QString&)"),self.handleTextChanged)
        self.connect(self.specialEdit,SIGNAL("textChanged(const QString&)"),self.handleTextChanged)
        self.connect(self.specialButton,SIGNAL("toggled(bool)"),self.specialEdit.setEnabled)
        self.connect(self.conditionButton,SIGNAL("toggled(bool)"),self.conditionEdit.setEnabled)
        self.connect(self.specialButton,SIGNAL("toggled(bool)"),self.specialCombo.setEnabled)

        self.setTabOrder(self.conditionButton,self.conditionEdit)
        self.setTabOrder(self.conditionEdit,self.specialButton)
        self.setTabOrder(self.specialButton,self.specialEdit)
        self.setTabOrder(self.specialEdit,self.specialCombo)
        self.setTabOrder(self.specialCombo,self.ignoreSpinBox)
        self.setTabOrder(self.ignoreSpinBox,self.temporaryCheckBox)
        self.setTabOrder(self.temporaryCheckBox,self.enabledCheckBox)
        self.setTabOrder(self.enabledCheckBox,self.okButton)
        self.setTabOrder(self.okButton,self.cancelButton)


    def languageChange(self):
        self.setCaption(self.__tr("Edit Watchpoint"))
        self.okButton.setText(self.__tr("&OK"))
        self.okButton.setAccel(self.__tr("Alt+O"))
        self.cancelButton.setText(self.__tr("&Cancel"))
        QToolTip.add(self.ignoreSpinBox,self.__tr("Enter an ignore count for the watchpoint"))
        self.textLabel2.setText(self.__tr("Ignore Count:"))
        self.buttonGroup1.setTitle(QString.null)
        QToolTip.add(self.conditionEdit,self.__tr("Enter the condition for the watchpoint"))
        self.specialButton.setText(self.__tr("Variable:"))
        QToolTip.add(self.specialEdit,self.__tr("Enter a variable and select the special condition below"))
        self.conditionButton.setText(self.__tr("Condition:"))
        self.specialCombo.clear()
        self.specialCombo.insertItem(self.__tr("created"))
        self.specialCombo.insertItem(self.__tr("changed"))
        QToolTip.add(self.specialCombo,self.__tr("Select a special condition"))
        self.enabledCheckBox.setText(self.__tr("Enabled"))
        QToolTip.add(self.enabledCheckBox,self.__tr("Select, whether the watchpoint is enabled"))
        self.temporaryCheckBox.setText(self.__tr("Temporary Watchpoint"))
        QToolTip.add(self.temporaryCheckBox,self.__tr("Select whether this is a temporary watchpoint"))


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

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

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