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

# Form implementation generated from reading ui file '/home/detlev/Development/Python/Eric/eric3/UI/EmailForm.ui'
#
# Created: Di Nov 11 20:02:24 2003
#      by: The PyQt User Interface Compiler (pyuic) 3.8
#
# WARNING! All changes made in this file will be lost!


import sys
from qt import *


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

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


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

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

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

        self.subject = QLineEdit(self,"subject")
        layout2.addWidget(self.subject)
        EmailFormLayout.addLayout(layout2)

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

        self.message = QTextEdit(self,"message")
        self.message.setTextFormat(QTextEdit.PlainText)
        self.message.setWordWrap(QTextEdit.FixedColumnWidth)
        self.message.setWrapColumnOrWidth(70)
        EmailFormLayout.addWidget(self.message)

        self.textLabel3 = QLabel(self,"textLabel3")
        EmailFormLayout.addWidget(self.textLabel3)

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

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

        layout3.addWidget(self.deleteButton,1,1)

        self.attachments = QListView(self,"attachments")
        self.attachments.addColumn(self.__tr("Name"))
        self.attachments.addColumn(self.__tr("Type"))
        self.attachments.setAllColumnsShowFocus(1)

        layout3.addMultiCellWidget(self.attachments,0,1,0,0)

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

        layout3.addWidget(self.addButton,0,1)
        EmailFormLayout.addLayout(layout3)

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

        self.sendButton = QPushButton(self,"sendButton")
        layout1.addWidget(self.sendButton)

        self.cancelButton = QPushButton(self,"cancelButton")
        layout1.addWidget(self.cancelButton)
        spacer_2 = QSpacerItem(40,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        layout1.addItem(spacer_2)
        EmailFormLayout.addLayout(layout1)

        self.languageChange()

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

        self.connect(self.addButton,SIGNAL("clicked()"),self.handleAdd)
        self.connect(self.deleteButton,SIGNAL("clicked()"),self.handleDelete)
        self.connect(self.sendButton,SIGNAL("clicked()"),self.handleSend)
        self.connect(self.cancelButton,SIGNAL("clicked()"),self,SLOT("reject()"))

        self.setTabOrder(self.subject,self.message)
        self.setTabOrder(self.message,self.attachments)
        self.setTabOrder(self.attachments,self.addButton)
        self.setTabOrder(self.addButton,self.deleteButton)
        self.setTabOrder(self.deleteButton,self.sendButton)
        self.setTabOrder(self.sendButton,self.cancelButton)

        self.textLabel1.setBuddy(self.subject)
        self.textLabel2.setBuddy(self.message)
        self.textLabel3.setBuddy(self.attachments)


    def languageChange(self):
        self.setCaption(self.__tr("Send bug report"))
        self.textLabel1.setText(self.__tr("&Subject:"))
        QToolTip.add(self.subject,self.__tr("Enter the subject"))
        self.textLabel2.setText(self.__tr("Enter your &bug description below.  All needed version information is added automatically."))
        self.textLabel3.setText(self.__tr("A&ttachments"))
        self.deleteButton.setText(self.__tr("&Delete"))
        self.deleteButton.setAccel(self.__tr("Alt+D"))
        QToolTip.add(self.deleteButton,self.__tr("Delete the selected entry from the list of attachments"))
        self.attachments.header().setLabel(0,self.__tr("Name"))
        self.attachments.header().setLabel(1,self.__tr("Type"))
        self.addButton.setText(self.__tr("&Add..."))
        self.addButton.setAccel(self.__tr("Alt+A"))
        QToolTip.add(self.addButton,self.__tr("Press to add an attachment"))
        self.sendButton.setText(self.__tr("S&end"))
        self.sendButton.setAccel(self.__tr("Alt+E"))
        QToolTip.add(self.sendButton,self.__tr("Press to send your bug report"))
        self.cancelButton.setText(self.__tr("&Cancel"))
        self.cancelButton.setAccel(self.__tr("Alt+C"))
        QToolTip.add(self.cancelButton,QString.null)


    def handleAdd(self):
        print "EmailForm.handleAdd(): Not implemented yet"

    def handleDelete(self):
        print "EmailForm.handleDelete(): Not implemented yet"

    def handleSend(self):
        print "EmailForm.handleSend(): Not implemented yet"

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

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