From 0dde86bfc1d6821320f279dee901dc6588c618bf Mon Sep 17 00:00:00 2001 From: Leonardo Robol Date: Mon, 27 Apr 2009 19:52:00 +0200 Subject: [PATCH] =?UTF-8?q?Modifiche=20locali=20in=20vista=20di=20una=20es?= =?UTF-8?q?portazione=20pi=C3=B9=20seria?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- interface.py | 8 ++- interface.ui | 8 ++- latex_manager.py | 2 + options.py | 80 ++++++++++++++++++++++++++ options.ui | 164 +++++++++++++++++++++++++++++++++++++++++++++++++++++ songbook-editor.py | 17 ++++++ 6 files changed, 276 insertions(+), 3 deletions(-) create mode 100644 options.py create mode 100644 options.ui diff --git a/interface.py b/interface.py index 15ddc98..35b2e5f 100644 --- a/interface.py +++ b/interface.py @@ -2,7 +2,7 @@ # Form implementation generated from reading ui file 'interface.ui' # -# Created: Sun Apr 26 18:50:24 2009 +# Created: Sun Apr 26 19:28:13 2009 # by: PyQt4 UI code generator 4.4.4 # # WARNING! All changes made in this file will be lost! @@ -123,11 +123,14 @@ class Ui_MainWindow(object): self.actionImporta_canzone.setObjectName("actionImporta_canzone") self.actionEsporta_in_LaTeX = QtGui.QAction(MainWindow) self.actionEsporta_in_LaTeX.setObjectName("actionEsporta_in_LaTeX") + self.actionOpzioni_LaTeX = QtGui.QAction(MainWindow) + self.actionOpzioni_LaTeX.setObjectName("actionOpzioni_LaTeX") self.menuFile.addAction(self.actionApri) self.menuFile.addAction(self.actionSalva) self.menuFile.addSeparator() self.menuFile.addAction(self.actionEsci_2) self.menuCanzoniere.addAction(self.actionEsporta_in_LaTeX) + self.menuCanzoniere.addAction(self.actionOpzioni_LaTeX) self.menuCanzone.addAction(self.actionSalva_canzone) self.menuCanzone.addAction(self.actionImporta_canzone) self.menubar.addAction(self.menuFile.menuAction()) @@ -139,7 +142,7 @@ class Ui_MainWindow(object): QtCore.QMetaObject.connectSlotsByName(MainWindow) def retranslateUi(self, MainWindow): - MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "SongBook Editor 0.1", None, QtGui.QApplication.UnicodeUTF8)) + MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "SongBook Editor 0.2", None, QtGui.QApplication.UnicodeUTF8)) self.btn_new_song.setText(QtGui.QApplication.translate("MainWindow", "Nuova Canzone", None, QtGui.QApplication.UnicodeUTF8)) self.btn_delete_song.setText(QtGui.QApplication.translate("MainWindow", "Elimina Canzone", None, QtGui.QApplication.UnicodeUTF8)) self.label.setText(QtGui.QApplication.translate("MainWindow", "Titolo", None, QtGui.QApplication.UnicodeUTF8)) @@ -169,4 +172,5 @@ class Ui_MainWindow(object): self.actionSalva_canzone.setText(QtGui.QApplication.translate("MainWindow", "Salva canzone", None, QtGui.QApplication.UnicodeUTF8)) self.actionImporta_canzone.setText(QtGui.QApplication.translate("MainWindow", "Importa canzone", None, QtGui.QApplication.UnicodeUTF8)) self.actionEsporta_in_LaTeX.setText(QtGui.QApplication.translate("MainWindow", "Esporta in LaTeX", None, QtGui.QApplication.UnicodeUTF8)) + self.actionOpzioni_LaTeX.setText(QtGui.QApplication.translate("MainWindow", "Opzioni LaTeX", None, QtGui.QApplication.UnicodeUTF8)) diff --git a/interface.ui b/interface.ui index 6448a54..0c602c2 100644 --- a/interface.ui +++ b/interface.ui @@ -11,7 +11,7 @@ - SongBook Editor 0.1 + SongBook Editor 0.2 @@ -192,6 +192,7 @@ p, li { white-space: pre-wrap; } Canzoniere + @@ -240,6 +241,11 @@ p, li { white-space: pre-wrap; } Esporta in LaTeX + + + Opzioni LaTeX + + diff --git a/latex_manager.py b/latex_manager.py index eeb0441..13ed9d8 100644 --- a/latex_manager.py +++ b/latex_manager.py @@ -72,6 +72,8 @@ class latex_manager(): # New buffer buf = unicode() + + # TODO: Latex code to compile the songbook for song in song_list: buf += "\n\n" # Put some space between songs diff --git a/options.py b/options.py new file mode 100644 index 0000000..cc96075 --- /dev/null +++ b/options.py @@ -0,0 +1,80 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'options.ui' +# +# Created: Sun Apr 26 19:19:25 2009 +# by: PyQt4 UI code generator 4.4.4 +# +# WARNING! All changes made in this file will be lost! + +from PyQt4 import QtCore, QtGui + +class Ui_options(object): + def setupUi(self, options): + options.setObjectName("options") + options.resize(400, 266) + self.buttonBox = QtGui.QDialogButtonBox(options) + self.buttonBox.setGeometry(QtCore.QRect(30, 210, 341, 32)) + self.buttonBox.setOrientation(QtCore.Qt.Horizontal) + self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) + self.buttonBox.setObjectName("buttonBox") + self.gridLayoutWidget = QtGui.QWidget(options) + self.gridLayoutWidget.setGeometry(QtCore.QRect(30, 50, 341, 141)) + self.gridLayoutWidget.setObjectName("gridLayoutWidget") + self.gridLayout = QtGui.QGridLayout(self.gridLayoutWidget) + self.gridLayout.setObjectName("gridLayout") + self.label_2 = QtGui.QLabel(self.gridLayoutWidget) + self.label_2.setObjectName("label_2") + self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1) + self.comboBox = QtGui.QComboBox(self.gridLayoutWidget) + self.comboBox.setObjectName("comboBox") + self.comboBox.addItem(QtCore.QString()) + self.comboBox.addItem(QtCore.QString()) + self.gridLayout.addWidget(self.comboBox, 0, 1, 1, 1) + self.label_3 = QtGui.QLabel(self.gridLayoutWidget) + self.label_3.setObjectName("label_3") + self.gridLayout.addWidget(self.label_3, 1, 0, 1, 1) + self.comboBox_2 = QtGui.QComboBox(self.gridLayoutWidget) + self.comboBox_2.setObjectName("comboBox_2") + self.comboBox_2.addItem(QtCore.QString()) + self.comboBox_2.addItem(QtCore.QString()) + self.comboBox_2.addItem(QtCore.QString()) + self.gridLayout.addWidget(self.comboBox_2, 1, 1, 1, 1) + self.label_4 = QtGui.QLabel(self.gridLayoutWidget) + self.label_4.setObjectName("label_4") + self.gridLayout.addWidget(self.label_4, 2, 0, 1, 1) + self.lineEdit = QtGui.QLineEdit(self.gridLayoutWidget) + self.lineEdit.setObjectName("lineEdit") + self.gridLayout.addWidget(self.lineEdit, 2, 1, 1, 1) + self.label_5 = QtGui.QLabel(self.gridLayoutWidget) + self.label_5.setObjectName("label_5") + self.gridLayout.addWidget(self.label_5, 3, 0, 1, 1) + self.lineEdit_2 = QtGui.QLineEdit(self.gridLayoutWidget) + self.lineEdit_2.setObjectName("lineEdit_2") + self.gridLayout.addWidget(self.lineEdit_2, 3, 1, 1, 1) + self.label = QtGui.QLabel(options) + self.label.setGeometry(QtCore.QRect(160, 20, 141, 16)) + self.label.setObjectName("label") + + self.retranslateUi(options) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), options.accept) + QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), options.reject) + QtCore.QMetaObject.connectSlotsByName(options) + + def retranslateUi(self, options): + options.setWindowTitle(QtGui.QApplication.translate("options", "Opzioni LaTeX", None, QtGui.QApplication.UnicodeUTF8)) + self.label_2.setText(QtGui.QApplication.translate("options", "Formato", None, QtGui.QApplication.UnicodeUTF8)) + self.comboBox.setItemText(0, QtGui.QApplication.translate("options", "A4 (290mm x 210mm)", None, QtGui.QApplication.UnicodeUTF8)) + self.comboBox.setItemText(1, QtGui.QApplication.translate("options", "A5 (210mm x 145mm)", None, QtGui.QApplication.UnicodeUTF8)) + self.label_3.setText(QtGui.QApplication.translate("options", "Tipo di Canzoniere", None, QtGui.QApplication.UnicodeUTF8)) + self.comboBox_2.setItemText(0, QtGui.QApplication.translate("options", "Testo e accordi", None, QtGui.QApplication.UnicodeUTF8)) + self.comboBox_2.setItemText(1, QtGui.QApplication.translate("options", "Solo Testo", None, QtGui.QApplication.UnicodeUTF8)) + self.comboBox_2.setItemText(2, QtGui.QApplication.translate("options", "Slide", None, QtGui.QApplication.UnicodeUTF8)) + self.label_4.setText(QtGui.QApplication.translate("options", "Titolo", None, QtGui.QApplication.UnicodeUTF8)) + self.label_5.setText(QtGui.QApplication.translate("options", "Sottotitolo", None, QtGui.QApplication.UnicodeUTF8)) + self.label.setText(QtGui.QApplication.translate("options", "\n" +"\n" +"

Opzioni LaTex

", None, QtGui.QApplication.UnicodeUTF8)) + diff --git a/options.ui b/options.ui new file mode 100644 index 0000000..ebbb076 --- /dev/null +++ b/options.ui @@ -0,0 +1,164 @@ + + + options + + + + 0 + 0 + 400 + 266 + + + + Opzioni LaTeX + + + + + 30 + 210 + 341 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 30 + 50 + 341 + 141 + + + + + + + Formato + + + + + + + + A4 (290mm x 210mm) + + + + + A5 (210mm x 145mm) + + + + + + + + Tipo di Canzoniere + + + + + + + + Testo e accordi + + + + + Solo Testo + + + + + Slide + + + + + + + + Titolo + + + + + + + + + + Sottotitolo + + + + + + + + + + + + 160 + 20 + 141 + 16 + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Droid Sans'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Opzioni LaTex</span></p></body></html> + + + + + + + buttonBox + accepted() + options + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + options + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/songbook-editor.py b/songbook-editor.py index 1a4bdf2..1436478 100755 --- a/songbook-editor.py +++ b/songbook-editor.py @@ -2,6 +2,7 @@ from PyQt4 import QtGui, QtCore from interface import * +from options import * from song import * from latex_manager import * import re, sys @@ -12,6 +13,9 @@ class interface(QtGui.QMainWindow): self.ui = Ui_MainWindow() self.ui.setupUi(self) + # options dialog + self.opt = None + # Create an empty database of songs... self.song_db = [] @@ -193,6 +197,19 @@ class interface(QtGui.QMainWindow): handle.write(sbk.encode("utf-8")) handle.close() + def options(self): + self.opt = option_interface() + + +class option_interface(QtGui.QDialog): + def __init__(self, parent=None): + self.ui = Ui_options() + self.ui.setupUi(self) + + self.connect(self.ui.buttonBox, QtCore.SIGNAL("accepted()"), self.accepted) + + def accepted(self): + print "ciao" -- 2.1.4