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

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

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


        LoadScriptFormLayout = QGridLayout(self,1,1,11,6,"LoadScriptFormLayout")

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

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

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

        self.fileSelectButton = QPushButton(self,"fileSelectButton")

        LoadScriptFormLayout.addWidget(self.fileSelectButton,1,2)

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

        LoadScriptFormLayout.addWidget(self.textLabel2,1,0)

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

        LoadScriptFormLayout.addMultiCellWidget(self.deleteCheckBox,3,3,0,1)

        self.executeCheckBox = QCheckBox(self,"executeCheckBox")
        self.executeCheckBox.setChecked(1)

        LoadScriptFormLayout.addMultiCellWidget(self.executeCheckBox,2,2,0,1)

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

        LoadScriptFormLayout.addWidget(self.scriptFileEdit,1,1)

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

        LoadScriptFormLayout.addWidget(self.textLabel1,0,0)

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

        LoadScriptFormLayout.addMultiCellWidget(self.scriptNameEdit,0,0,1,2)

        self.languageChange()

        self.resize(QSize(488,168).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.fileSelectButton,SIGNAL("clicked()"),self.handleFileSelection)


    def languageChange(self):
        self.setCaption(self.__tr("Load Script"))
        self.okButton.setText(self.__tr("&OK"))
        self.okButton.setAccel(self.__tr("Alt+O"))
        self.cancelButton.setText(self.__tr("&Cancel"))
        self.fileSelectButton.setText(self.__tr("..."))
        QToolTip.add(self.fileSelectButton,self.__tr("Press to select the script file via a file selection dialog."))
        self.textLabel2.setText(self.__tr("Script file:"))
        self.deleteCheckBox.setText(self.__tr("Delete script after execution"))
        self.executeCheckBox.setText(self.__tr("Load and execute script"))
        QToolTip.add(self.executeCheckBox,self.__tr("Select whether the script should be loaded and executed."))
        QToolTip.add(self.scriptFileEdit,self.__tr("Enter the name of the script file."))
        self.textLabel1.setText(self.__tr("Script name:"))
        QToolTip.add(self.scriptNameEdit,self.__tr("Enter the name for the script"))


    def handleFileSelection(self):
        print "LoadScriptForm.handleFileSelection(): Not implemented yet"

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

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