class Masin(QtGui.QMainWindow): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_MainWindow() self.ui.setupUi(self) self.signals() self.gci = Gcinvoice() def gnuCashClick(self): filename = QtGui.QFileDialog.getOpenFileName(self, 'Choose File', '.') self.ui.gnuCashEditline.setText(filename) def latexTemplateClick(self): filename = QtGui.QFileDialog.getOpenFileName(self, 'Choose File', '.') self.ui.latexTemplateEditline.setText(filename) def outputFilenameClick(self): filename = QtGui.QFileDialog.getOpenFileName(self, 'Create File', '.') self.ui.outputFilenameEditline.setText(filename) def signals(self): QtCore.QObject.connect(self.ui.gnuCashButton, QtCore.SIGNAL("clicked()"), self.gnuCashClick) QtCore.QObject.connect(self.ui.latexTemplateButton, QtCore.SIGNAL("clicked()"), self.latexTemplateClick) QtCore.QObject.connect(self.ui.outputFilenameButton, QtCore.SIGNAL("clicked()"), self.outputFilenameClick) QtCore.QObject.connect(self.ui.generateButton, QtCore.SIGNAL("clicked()"), self.generateClick) def generateClick(self): self.gci.parse(str(self.ui.gnuCashEditline.text())) self.gci.createInvoice(invoiceid=str(self.ui.invoiceNumberSpinbox.text()), template=str(self.ui.latexTemplateEditline.text()), outfile=str(self.ui.outputFilenameEditline.text())) print "done"
class Masin(QtGui.QMainWindow): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.ui = Ui_MainWindow() self.ui.setupUi(self) self.signals() self.gci = Gcinvoice() self.defaultBullShit() def defaultBullShit(self): self.ui.gnuCashEditline.setText("D:\\AerixSVN\\documents\\aerix_accounting.gnucash") self.ui.latexTemplateEditline.setText("D:\\Aerix\\facturen\\masin\\example\\invoice_template.tex") self.ui.outputFilenameEditline.setText("D:\\Aerix\\facturen\\masin\\src\\lol.tex") self.ui.invoiceNumberSpinbox.setValue(8) def gnuCashClick(self): filename = QtGui.QFileDialog.getOpenFileName(self, 'Choose GnuCash Data File', '.') self.ui.gnuCashEditline.setText(filename) def latexTemplateClick(self): filename = QtGui.QFileDialog.getOpenFileName(self, 'Choose Template File', '.') self.ui.latexTemplateEditline.setText(filename) def outputFilenameClick(self): filename = QtGui.QFileDialog.getSaveFileName(self, 'Create Output File', '.') self.ui.outputFilenameEditline.setText(filename) def signals(self): QtCore.QObject.connect(self.ui.gnuCashButton, QtCore.SIGNAL("clicked()"), self.gnuCashClick) QtCore.QObject.connect(self.ui.latexTemplateButton, QtCore.SIGNAL("clicked()"), self.latexTemplateClick) QtCore.QObject.connect(self.ui.outputFilenameButton, QtCore.SIGNAL("clicked()"), self.outputFilenameClick) QtCore.QObject.connect(self.ui.generateButton, QtCore.SIGNAL("clicked()"), self.generateClick) def generateClick(self): self.gci.parse(str(self.ui.gnuCashEditline.text())) self.gci.createInvoice(invoiceid=str(self.ui.invoiceNumberSpinbox.text()), template=str(self.ui.latexTemplateEditline.text()), outfile=str(self.ui.outputFilenameEditline.text())) print "done"