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

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

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


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

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

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

        self.file1Edit = QLineEdit(self,"file1Edit")
        layout2.addWidget(self.file1Edit)

        self.file1Button = QPushButton(self,"file1Button")
        layout2.addWidget(self.file1Button)
        DiffFormLayout.addLayout(layout2)

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

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

        self.file2Edit = QLineEdit(self,"file2Edit")
        layout2_2.addWidget(self.file2Edit)

        self.file2Button = QPushButton(self,"file2Button")
        layout2_2.addWidget(self.file2Button)
        DiffFormLayout.addLayout(layout2_2)

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

        self.unifiedRadioButton = QRadioButton(self.diffFormatGroup,"unifiedRadioButton")
        self.unifiedRadioButton.setChecked(1)
        diffFormatGroupLayout.addWidget(self.unifiedRadioButton)

        self.contextRadioButton = QRadioButton(self.diffFormatGroup,"contextRadioButton")
        diffFormatGroupLayout.addWidget(self.contextRadioButton)
        spacer3 = QSpacerItem(40,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        diffFormatGroupLayout.addItem(spacer3)
        DiffFormLayout.addWidget(self.diffFormatGroup)

        self.contents = QTextBrowser(self,"contents")
        contents_font = QFont(self.contents.font())
        contents_font.setFamily("SUSE Sans Mono")
        self.contents.setFont(contents_font)
        self.contents.setFocusPolicy(QTextBrowser.NoFocus)
        self.contents.setTextFormat(QTextBrowser.PlainText)
        self.contents.setWordWrap(QTextBrowser.NoWrap)
        DiffFormLayout.addWidget(self.contents)

        layout4 = QHBoxLayout(None,0,6,"layout4")
        Spacer1 = QSpacerItem(180,16,QSizePolicy.Expanding,QSizePolicy.Minimum)
        layout4.addItem(Spacer1)

        self.PushButton1 = QPushButton(self,"PushButton1")
        self.PushButton1.setDefault(1)
        layout4.addWidget(self.PushButton1)

        self.diffButton = QPushButton(self,"diffButton")
        self.diffButton.setEnabled(0)
        layout4.addWidget(self.diffButton)

        self.saveButton = QPushButton(self,"saveButton")
        self.saveButton.setEnabled(0)
        layout4.addWidget(self.saveButton)
        Spacer2 = QSpacerItem(200,20,QSizePolicy.Expanding,QSizePolicy.Minimum)
        layout4.addItem(Spacer2)
        DiffFormLayout.addLayout(layout4)

        self.languageChange()

        self.resize(QSize(753,601).expandedTo(self.minimumSizeHint()))
        self.clearWState(Qt.WState_Polished)

        self.connect(self.PushButton1,SIGNAL("clicked()"),self.close)
        self.connect(self.saveButton,SIGNAL("clicked()"),self.handleSave)
        self.connect(self.file1Edit,SIGNAL("textChanged(const QString&)"),self.handleFileChanged)
        self.connect(self.file2Edit,SIGNAL("textChanged(const QString&)"),self.handleFileChanged)
        self.connect(self.file1Button,SIGNAL("clicked()"),self.handleSelectFile1)
        self.connect(self.file2Button,SIGNAL("clicked()"),self.handleSelectFile2)
        self.connect(self.diffButton,SIGNAL("clicked()"),self.handleDiff)

        self.setTabOrder(self.file1Edit,self.file1Button)
        self.setTabOrder(self.file1Button,self.file2Edit)
        self.setTabOrder(self.file2Edit,self.file2Button)
        self.setTabOrder(self.file2Button,self.diffButton)
        self.setTabOrder(self.diffButton,self.saveButton)
        self.setTabOrder(self.saveButton,self.PushButton1)
        self.setTabOrder(self.PushButton1,self.contents)

        self.textLabel1.setBuddy(self.file1Edit)
        self.textLabel2.setBuddy(self.file1Edit)


    def languageChange(self):
        self.setCaption(self.__tr("File Differences"))
        self.textLabel1.setText(self.__tr("File &1:"))
        QToolTip.add(self.file1Edit,self.__tr("Enter the name of the first file"))
        self.file1Button.setText(self.__tr("..."))
        QToolTip.add(self.file1Button,self.__tr("Press to select the file via a file selection dialog"))
        self.textLabel2.setText(self.__tr("File &2:"))
        QToolTip.add(self.file2Edit,self.__tr("Enter the name of the second file"))
        self.file2Button.setText(self.__tr("..."))
        QToolTip.add(self.file2Button,self.__tr("Press to select the file via a file selection dialog"))
        self.diffFormatGroup.setTitle(QString.null)
        self.unifiedRadioButton.setText(self.__tr("&Unified Diff"))
        self.unifiedRadioButton.setAccel(self.__tr("Alt+U"))
        QToolTip.add(self.unifiedRadioButton,self.__tr("Select to generate a unified diff"))
        self.contextRadioButton.setText(self.__tr("Co&ntext Diff"))
        self.contextRadioButton.setAccel(self.__tr("Alt+N"))
        QToolTip.add(self.contextRadioButton,self.__tr("Select to generate a context diff"))
        self.PushButton1.setText(self.__tr("&Close"))
        self.PushButton1.setAccel(self.__tr("Alt+C"))
        self.diffButton.setText(self.__tr("C&ompare"))
        self.diffButton.setAccel(self.__tr("Alt+O"))
        QToolTip.add(self.diffButton,self.__tr("Press to perform the comparison of the two files"))
        self.saveButton.setText(self.__tr("&Save"))
        self.saveButton.setAccel(self.__tr("Alt+S"))
        QToolTip.add(self.saveButton,self.__tr("Save the output to a patch file"))


    def handleSave(self):
        print "DiffForm.handleSave(): Not implemented yet"

    def handleDiff(self):
        print "DiffForm.handleDiff(): Not implemented yet"

    def handleFileChanged(self):
        print "DiffForm.handleFileChanged(): Not implemented yet"

    def handleSelectFile1(self):
        print "DiffForm.handleSelectFile1(): Not implemented yet"

    def handleSelectFile2(self):
        print "DiffForm.handleSelectFile2(): Not implemented yet"

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

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