From 0957c2f96f718dcdcb1bc645e44a7d4cf33ba2b7 Mon Sep 17 00:00:00 2001 From: Leonardo Robol Date: Sat, 13 Jun 2009 15:52:35 +0200 Subject: [PATCH] Riordino generale delle librerie --- interface.py | 176 --------------------------------- interface.pyc | Bin 7676 -> 0 bytes interface.ui | 269 -------------------------------------------------- latex_manager.py | 108 -------------------- libs/latex_manager.py | 108 ++++++++++++++++++++ libs/song.py | 78 +++++++++++++++ options.py | 78 --------------- options.ui | 131 ------------------------ song.py | 78 --------------- ui/interface.py | 176 +++++++++++++++++++++++++++++++++ ui/interface.ui | 269 ++++++++++++++++++++++++++++++++++++++++++++++++++ ui/options.py | 78 +++++++++++++++ ui/options.ui | 131 ++++++++++++++++++++++++ 13 files changed, 840 insertions(+), 840 deletions(-) delete mode 100644 interface.py delete mode 100644 interface.pyc delete mode 100644 interface.ui delete mode 100644 latex_manager.py create mode 100644 libs/latex_manager.py create mode 100644 libs/song.py delete mode 100644 options.py delete mode 100644 options.ui delete mode 100644 song.py create mode 100644 ui/interface.py create mode 100644 ui/interface.ui create mode 100644 ui/options.py create mode 100644 ui/options.ui diff --git a/interface.py b/interface.py deleted file mode 100644 index 35b2e5f..0000000 --- a/interface.py +++ /dev/null @@ -1,176 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'interface.ui' -# -# 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! - -from PyQt4 import QtCore, QtGui - -class Ui_MainWindow(object): - def setupUi(self, MainWindow): - MainWindow.setObjectName("MainWindow") - MainWindow.resize(800, 600) - self.centralwidget = QtGui.QWidget(MainWindow) - self.centralwidget.setObjectName("centralwidget") - self.gridLayoutWidget = QtGui.QWidget(self.centralwidget) - self.gridLayoutWidget.setGeometry(QtCore.QRect(10, 10, 781, 541)) - self.gridLayoutWidget.setObjectName("gridLayoutWidget") - self.gridLayout = QtGui.QGridLayout(self.gridLayoutWidget) - self.gridLayout.setSizeConstraint(QtGui.QLayout.SetMaximumSize) - self.gridLayout.setObjectName("gridLayout") - self.list_songs = QtGui.QListWidget(self.gridLayoutWidget) - sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Expanding) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(self.list_songs.sizePolicy().hasHeightForWidth()) - self.list_songs.setSizePolicy(sizePolicy) - self.list_songs.setObjectName("list_songs") - self.gridLayout.addWidget(self.list_songs, 1, 0, 1, 1) - self.horizontalLayout = QtGui.QHBoxLayout() - self.horizontalLayout.setObjectName("horizontalLayout") - self.btn_new_song = QtGui.QPushButton(self.gridLayoutWidget) - self.btn_new_song.setObjectName("btn_new_song") - self.horizontalLayout.addWidget(self.btn_new_song) - self.btn_delete_song = QtGui.QPushButton(self.gridLayoutWidget) - self.btn_delete_song.setObjectName("btn_delete_song") - self.horizontalLayout.addWidget(self.btn_delete_song) - self.gridLayout.addLayout(self.horizontalLayout, 2, 0, 2, 1) - self.verticalLayout = QtGui.QVBoxLayout() - self.verticalLayout.setObjectName("verticalLayout") - self.gridLayout_2 = QtGui.QGridLayout() - self.gridLayout_2.setObjectName("gridLayout_2") - self.le_title = QtGui.QLineEdit(self.gridLayoutWidget) - self.le_title.setObjectName("le_title") - self.gridLayout_2.addWidget(self.le_title, 0, 1, 1, 1) - self.le_tauthor = QtGui.QLineEdit(self.gridLayoutWidget) - self.le_tauthor.setObjectName("le_tauthor") - self.gridLayout_2.addWidget(self.le_tauthor, 1, 1, 1, 1) - self.label = QtGui.QLabel(self.gridLayoutWidget) - self.label.setObjectName("label") - self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) - self.label_2 = QtGui.QLabel(self.gridLayoutWidget) - self.label_2.setObjectName("label_2") - self.gridLayout_2.addWidget(self.label_2, 1, 0, 1, 1) - self.le_mauthor = QtGui.QLineEdit(self.gridLayoutWidget) - self.le_mauthor.setObjectName("le_mauthor") - self.gridLayout_2.addWidget(self.le_mauthor, 2, 1, 1, 1) - self.label_3 = QtGui.QLabel(self.gridLayoutWidget) - self.label_3.setObjectName("label_3") - self.gridLayout_2.addWidget(self.label_3, 2, 0, 1, 1) - self.le_year = QtGui.QLineEdit(self.gridLayoutWidget) - self.le_year.setObjectName("le_year") - self.gridLayout_2.addWidget(self.le_year, 3, 1, 1, 1) - self.le_tone = QtGui.QLineEdit(self.gridLayoutWidget) - self.le_tone.setObjectName("le_tone") - self.gridLayout_2.addWidget(self.le_tone, 4, 1, 1, 1) - self.label_4 = QtGui.QLabel(self.gridLayoutWidget) - self.label_4.setObjectName("label_4") - self.gridLayout_2.addWidget(self.label_4, 3, 0, 1, 1) - self.label_5 = QtGui.QLabel(self.gridLayoutWidget) - self.label_5.setObjectName("label_5") - self.gridLayout_2.addWidget(self.label_5, 4, 0, 1, 1) - self.verticalLayout.addLayout(self.gridLayout_2) - self.te_body = QtGui.QTextEdit(self.gridLayoutWidget) - self.te_body.setAcceptRichText(False) - self.te_body.setObjectName("te_body") - self.verticalLayout.addWidget(self.te_body) - self.gridLayout.addLayout(self.verticalLayout, 1, 1, 1, 1) - self.horizontalLayout_2 = QtGui.QHBoxLayout() - self.horizontalLayout_2.setObjectName("horizontalLayout_2") - self.btn_savesong = QtGui.QPushButton(self.gridLayoutWidget) - self.btn_savesong.setObjectName("btn_savesong") - self.horizontalLayout_2.addWidget(self.btn_savesong) - self.btn_create_latex_song = QtGui.QPushButton(self.gridLayoutWidget) - self.btn_create_latex_song.setObjectName("btn_create_latex_song") - self.horizontalLayout_2.addWidget(self.btn_create_latex_song) - self.gridLayout.addLayout(self.horizontalLayout_2, 2, 1, 2, 1) - self.label_6 = QtGui.QLabel(self.gridLayoutWidget) - self.label_6.setTextFormat(QtCore.Qt.RichText) - self.label_6.setAlignment(QtCore.Qt.AlignCenter) - self.label_6.setObjectName("label_6") - self.gridLayout.addWidget(self.label_6, 0, 0, 1, 1) - self.label_7 = QtGui.QLabel(self.gridLayoutWidget) - self.label_7.setObjectName("label_7") - self.gridLayout.addWidget(self.label_7, 0, 1, 1, 1) - MainWindow.setCentralWidget(self.centralwidget) - self.menubar = QtGui.QMenuBar(MainWindow) - self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 23)) - self.menubar.setObjectName("menubar") - self.menuFile = QtGui.QMenu(self.menubar) - self.menuFile.setObjectName("menuFile") - self.menuCanzoniere = QtGui.QMenu(self.menubar) - self.menuCanzoniere.setObjectName("menuCanzoniere") - self.menuCanzone = QtGui.QMenu(self.menubar) - self.menuCanzone.setObjectName("menuCanzone") - MainWindow.setMenuBar(self.menubar) - self.statusbar = QtGui.QStatusBar(MainWindow) - self.statusbar.setObjectName("statusbar") - MainWindow.setStatusBar(self.statusbar) - self.actionApri = QtGui.QAction(MainWindow) - self.actionApri.setObjectName("actionApri") - self.actionEsci = QtGui.QAction(MainWindow) - self.actionEsci.setObjectName("actionEsci") - self.actionSalva = QtGui.QAction(MainWindow) - self.actionSalva.setObjectName("actionSalva") - self.actionEsci_2 = QtGui.QAction(MainWindow) - self.actionEsci_2.setObjectName("actionEsci_2") - self.actionSalva_canzone = QtGui.QAction(MainWindow) - self.actionSalva_canzone.setObjectName("actionSalva_canzone") - self.actionImporta_canzone = QtGui.QAction(MainWindow) - 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()) - self.menubar.addAction(self.menuCanzoniere.menuAction()) - self.menubar.addAction(self.menuCanzone.menuAction()) - - self.retranslateUi(MainWindow) - QtCore.QObject.connect(self.actionEsci_2, QtCore.SIGNAL("activated()"), MainWindow.close) - QtCore.QMetaObject.connectSlotsByName(MainWindow) - - def retranslateUi(self, MainWindow): - 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)) - self.label_2.setText(QtGui.QApplication.translate("MainWindow", "Autore", None, QtGui.QApplication.UnicodeUTF8)) - self.label_3.setText(QtGui.QApplication.translate("MainWindow", "Copyright", None, QtGui.QApplication.UnicodeUTF8)) - self.label_4.setText(QtGui.QApplication.translate("MainWindow", "Anno", None, QtGui.QApplication.UnicodeUTF8)) - self.label_5.setText(QtGui.QApplication.translate("MainWindow", "Tonalità", None, QtGui.QApplication.UnicodeUTF8)) - self.btn_savesong.setText(QtGui.QApplication.translate("MainWindow", "Aggiungi al canzoniere", None, QtGui.QApplication.UnicodeUTF8)) - self.btn_create_latex_song.setText(QtGui.QApplication.translate("MainWindow", "Esporta canzone in LaTeX", None, QtGui.QApplication.UnicodeUTF8)) - self.label_6.setText(QtGui.QApplication.translate("MainWindow", "\n" -"\n" -"

Lista Canzoni

", None, QtGui.QApplication.UnicodeUTF8)) - self.label_7.setText(QtGui.QApplication.translate("MainWindow", "\n" -"\n" -"

Canzone selezionata

", None, QtGui.QApplication.UnicodeUTF8)) - self.menuFile.setTitle(QtGui.QApplication.translate("MainWindow", "File", None, QtGui.QApplication.UnicodeUTF8)) - self.menuCanzoniere.setTitle(QtGui.QApplication.translate("MainWindow", "Canzoniere", None, QtGui.QApplication.UnicodeUTF8)) - self.menuCanzone.setTitle(QtGui.QApplication.translate("MainWindow", "Canzone", None, QtGui.QApplication.UnicodeUTF8)) - self.actionApri.setText(QtGui.QApplication.translate("MainWindow", "Apri", None, QtGui.QApplication.UnicodeUTF8)) - self.actionEsci.setText(QtGui.QApplication.translate("MainWindow", "Esci", None, QtGui.QApplication.UnicodeUTF8)) - self.actionSalva.setText(QtGui.QApplication.translate("MainWindow", "Salva", None, QtGui.QApplication.UnicodeUTF8)) - self.actionEsci_2.setText(QtGui.QApplication.translate("MainWindow", "Esci", None, QtGui.QApplication.UnicodeUTF8)) - 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.pyc b/interface.pyc deleted file mode 100644 index d72621bf23344da390d627bdab54b4464ccf2ca8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7676 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 G-+us|I$=cs diff --git a/interface.ui b/interface.ui deleted file mode 100644 index 0c602c2..0000000 --- a/interface.ui +++ /dev/null @@ -1,269 +0,0 @@ - - - MainWindow - - - - 0 - 0 - 800 - 600 - - - - SongBook Editor 0.2 - - - - - - 10 - 10 - 781 - 541 - - - - - QLayout::SetMaximumSize - - - - - - 0 - 0 - - - - - - - - - - Nuova Canzone - - - - - - - Elimina Canzone - - - - - - - - - - - - - - - - - - - Titolo - - - - - - - Autore - - - - - - - - - - Copyright - - - - - - - - - - - - - Anno - - - - - - - Tonalità - - - - - - - - - false - - - - - - - - - - - Aggiungi al canzoniere - - - - - - - Esporta canzone in LaTeX - - - - - - - - - <!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;">Lista Canzoni</span></p></body></html> - - - Qt::RichText - - - Qt::AlignCenter - - - - - - - <!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 align="center" 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;">Canzone selezionata</span></p></body></html> - - - - - - - - - - 0 - 0 - 800 - 23 - - - - - File - - - - - - - - - Canzoniere - - - - - - - Canzone - - - - - - - - - - - - Apri - - - - - Esci - - - - - Salva - - - - - Esci - - - - - Salva canzone - - - - - Importa canzone - - - - - Esporta in LaTeX - - - - - Opzioni LaTeX - - - - - - - actionEsci_2 - activated() - MainWindow - close() - - - -1 - -1 - - - 399 - 299 - - - - - diff --git a/latex_manager.py b/latex_manager.py deleted file mode 100644 index b12418b..0000000 --- a/latex_manager.py +++ /dev/null @@ -1,108 +0,0 @@ -import re - -class latex_manager(): - def __init__(self): - ## TODO: Verify Latex Installation - return - - def create_song(self, song): - # Ci aspettiamo di ottenere un oggetto song - title = song.title - tone = song.tone - mauthor = song.mauthor - tauthor = song.tauthor - year = song.year - body = song.body - - # We really have to assume that latex_song is unicode, - # or the write() function will eat us! - latex_song = unicode() - latex_song += "\\begin{song}{" + title + "}{" + tone + "}\n{" + mauthor + "}\n{" + tauthor + "}\n{" + year + "}" + "{}\n\n\\index{" + title + "}\n\n" - - for item in body: - if(item.is_chorus()): - latex_song += "\n\\begin{SBChorus}\n" - latex_song += re.sub("\n", "\n\n", item.content()) - latex_song += "\n\\end{SBChorus}\n" - else: - latex_song += "\n\\begin{SBVerse}" - latex_song += re.sub("\n" , "\n\n", item.content()) - latex_song += "\n\\end{SBVerse}\n" - - latex_song += "\n\\end{song}\n\n" - - # Transform chords in LaTeX Chords (this part has to be removed..) - #latex_song = re.sub("\[", "\\Ch{", latex_song) - #latex_song = re.sub("\](\w|\s){4}", self.quadra_to_chord_end, latex_song) - #latex_song = re.sub("\]", "}{}", latex_song) - - latex_song = self.sub_chord(latex_song) - - return latex_song - - - def sub_chord(self,m): - j = 0 - # print j, len(m) this is just debug! - while(j < len(m)): - if(m[j] == '['): - # We have a chord!, then... - # 1) How many letters is the chords? - count = 0 - while(m[count + j + 1] != ']'): - count += 1 - # 2) Are there count + 1 words "free" after the chord? - free = count + 2 - for i in range(j + count + 2,j + count + 2 + (count + 2) ): - # print "m[i] = ", m[i] Removing debug - if( (m[i] == '\n') | (m[i] == '[') | (m[i] == '{') ): - free = i - j - count - 2 - break - # Debug is unuseful now! print "free = " , free - # Free what we need...and rebuild the new string... - m = m[0:j] + "\Ch{" + m[j+1:j+count+1] + "}{" + m[j+count+2:j+count+free+2] + "}" + m[j+count+free+2:len(m)] - j = j + count + free + 3 - else: - j += 1 - return m - - def export_songbook(self,song_list): - # Assume that song list is an array of songs and - # create a songbook with them - - # New buffer - buf = unicode() - - # TODO: Latex code to compile the songbook - # Document class - buf += "\documentclass[10pt,a5paper,twoside]{book}\n" - - # Packages - buf += "\usepackage[a5paper,chordbk]{songbook}\n" - buf += "\usepackage[utf8x]{inputenc}\n" - buf += "\usepackage{makeidx}\n" - buf += "\n\n" - - # Index generation - buf += "\MakeTitleIndex\n" - buf += "\MakeTitleContents\n" - buf += "\MakeKeyIndex\n" - buf += "\makeindex\n" - buf += "\n\n" - - # Document begins - buf += "\\begin{document}\n\n" - - for song in song_list: - buf += "\n\n" # Put some space between songs - buf += "% Canzone:" + song.title + "\n\n" - buf += self.create_song(song) - - # The Index - buf += "\printindex\n" - - # Document ends - buf += "\end{document}\n\n" - - # Give buffer back to be printed - return buf diff --git a/libs/latex_manager.py b/libs/latex_manager.py new file mode 100644 index 0000000..b12418b --- /dev/null +++ b/libs/latex_manager.py @@ -0,0 +1,108 @@ +import re + +class latex_manager(): + def __init__(self): + ## TODO: Verify Latex Installation + return + + def create_song(self, song): + # Ci aspettiamo di ottenere un oggetto song + title = song.title + tone = song.tone + mauthor = song.mauthor + tauthor = song.tauthor + year = song.year + body = song.body + + # We really have to assume that latex_song is unicode, + # or the write() function will eat us! + latex_song = unicode() + latex_song += "\\begin{song}{" + title + "}{" + tone + "}\n{" + mauthor + "}\n{" + tauthor + "}\n{" + year + "}" + "{}\n\n\\index{" + title + "}\n\n" + + for item in body: + if(item.is_chorus()): + latex_song += "\n\\begin{SBChorus}\n" + latex_song += re.sub("\n", "\n\n", item.content()) + latex_song += "\n\\end{SBChorus}\n" + else: + latex_song += "\n\\begin{SBVerse}" + latex_song += re.sub("\n" , "\n\n", item.content()) + latex_song += "\n\\end{SBVerse}\n" + + latex_song += "\n\\end{song}\n\n" + + # Transform chords in LaTeX Chords (this part has to be removed..) + #latex_song = re.sub("\[", "\\Ch{", latex_song) + #latex_song = re.sub("\](\w|\s){4}", self.quadra_to_chord_end, latex_song) + #latex_song = re.sub("\]", "}{}", latex_song) + + latex_song = self.sub_chord(latex_song) + + return latex_song + + + def sub_chord(self,m): + j = 0 + # print j, len(m) this is just debug! + while(j < len(m)): + if(m[j] == '['): + # We have a chord!, then... + # 1) How many letters is the chords? + count = 0 + while(m[count + j + 1] != ']'): + count += 1 + # 2) Are there count + 1 words "free" after the chord? + free = count + 2 + for i in range(j + count + 2,j + count + 2 + (count + 2) ): + # print "m[i] = ", m[i] Removing debug + if( (m[i] == '\n') | (m[i] == '[') | (m[i] == '{') ): + free = i - j - count - 2 + break + # Debug is unuseful now! print "free = " , free + # Free what we need...and rebuild the new string... + m = m[0:j] + "\Ch{" + m[j+1:j+count+1] + "}{" + m[j+count+2:j+count+free+2] + "}" + m[j+count+free+2:len(m)] + j = j + count + free + 3 + else: + j += 1 + return m + + def export_songbook(self,song_list): + # Assume that song list is an array of songs and + # create a songbook with them + + # New buffer + buf = unicode() + + # TODO: Latex code to compile the songbook + # Document class + buf += "\documentclass[10pt,a5paper,twoside]{book}\n" + + # Packages + buf += "\usepackage[a5paper,chordbk]{songbook}\n" + buf += "\usepackage[utf8x]{inputenc}\n" + buf += "\usepackage{makeidx}\n" + buf += "\n\n" + + # Index generation + buf += "\MakeTitleIndex\n" + buf += "\MakeTitleContents\n" + buf += "\MakeKeyIndex\n" + buf += "\makeindex\n" + buf += "\n\n" + + # Document begins + buf += "\\begin{document}\n\n" + + for song in song_list: + buf += "\n\n" # Put some space between songs + buf += "% Canzone:" + song.title + "\n\n" + buf += self.create_song(song) + + # The Index + buf += "\printindex\n" + + # Document ends + buf += "\end{document}\n\n" + + # Give buffer back to be printed + return buf diff --git a/libs/song.py b/libs/song.py new file mode 100644 index 0000000..f2ae222 --- /dev/null +++ b/libs/song.py @@ -0,0 +1,78 @@ +## Object song + +class chorus(): + def __init__(self): + self.body = "" + + def content(self): + return self.body + + def is_chorus(self): + return True + +class verse(): + def __init__(self): + self.body = "" + + def content(self): + return self.body + + def is_chorus(self): + return False + +class song(): + + def __init__(self, newtitle, newbody=[], newmauthor = "Unknown", newtauthor="Unknown", newtone="Unknown", newyear="Unknown"): + # Initialize vars.. + self.title = newtitle + # Body is an array of string with verses and + # chorus to be understood with __structure + self.body = newbody + + self.mauthor = newmauthor + self.tauthor = newtauthor + self.tone = newtone + self.year = newyear + + # Structure is an array of the type 'c' 'v' + # where c means Chorus, v means Verse + self.structure = [] + + + # Gives the number of chorus in the song + def n_chorus(self): + count = 0 + for item in self.structure: + if(item == 'c'): + count += 1 + return count + + # Gives the number of verse in the song + def n_verse(self): + count = 0 + for item in self.structure: + if(item == 'v'): + count += 1 + return count + + def is_chorus(self, n): + if(self.structure[n] == 'c'): + return 1 + return 0 + + def is_verse(self, n): + if(self.structure[n] == 'v'): + return 1 + return 0 + + def add_chorus(self, t_chorus): + newchorus = chorus() + newchorus.body = t_chorus + self.body.append(newchorus) + self.structure.append('c') + + def add_verse(self, t_verse): + newverse = verse() + newverse.body = t_verse + self.body.append(newverse) + self.structure.append('v') diff --git a/options.py b/options.py deleted file mode 100644 index df65a12..0000000 --- a/options.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- - -# Form implementation generated from reading ui file 'options.ui' -# -# Created: Fri May 15 17:06:57 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.paper_size = QtGui.QComboBox(self.gridLayoutWidget) - self.paper_size.setObjectName("paper_size") - self.paper_size.addItem(QtCore.QString()) - self.paper_size.addItem(QtCore.QString()) - self.gridLayout.addWidget(self.paper_size, 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.type = QtGui.QComboBox(self.gridLayoutWidget) - self.type.setObjectName("type") - self.type.addItem(QtCore.QString()) - self.type.addItem(QtCore.QString()) - self.type.addItem(QtCore.QString()) - self.gridLayout.addWidget(self.type, 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.title = QtGui.QLineEdit(self.gridLayoutWidget) - self.title.setObjectName("title") - self.gridLayout.addWidget(self.title, 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.subtitle = QtGui.QLineEdit(self.gridLayoutWidget) - self.subtitle.setObjectName("subtitle") - self.gridLayout.addWidget(self.subtitle, 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.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.paper_size.setItemText(0, QtGui.QApplication.translate("options", "A4 (290mm x 210mm)", None, QtGui.QApplication.UnicodeUTF8)) - self.paper_size.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.type.setItemText(0, QtGui.QApplication.translate("options", "Testo e accordi", None, QtGui.QApplication.UnicodeUTF8)) - self.type.setItemText(1, QtGui.QApplication.translate("options", "Solo Testo", None, QtGui.QApplication.UnicodeUTF8)) - self.type.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 deleted file mode 100644 index 39816c4..0000000 --- a/options.ui +++ /dev/null @@ -1,131 +0,0 @@ - - - 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> - - - - - - diff --git a/song.py b/song.py deleted file mode 100644 index f2ae222..0000000 --- a/song.py +++ /dev/null @@ -1,78 +0,0 @@ -## Object song - -class chorus(): - def __init__(self): - self.body = "" - - def content(self): - return self.body - - def is_chorus(self): - return True - -class verse(): - def __init__(self): - self.body = "" - - def content(self): - return self.body - - def is_chorus(self): - return False - -class song(): - - def __init__(self, newtitle, newbody=[], newmauthor = "Unknown", newtauthor="Unknown", newtone="Unknown", newyear="Unknown"): - # Initialize vars.. - self.title = newtitle - # Body is an array of string with verses and - # chorus to be understood with __structure - self.body = newbody - - self.mauthor = newmauthor - self.tauthor = newtauthor - self.tone = newtone - self.year = newyear - - # Structure is an array of the type 'c' 'v' - # where c means Chorus, v means Verse - self.structure = [] - - - # Gives the number of chorus in the song - def n_chorus(self): - count = 0 - for item in self.structure: - if(item == 'c'): - count += 1 - return count - - # Gives the number of verse in the song - def n_verse(self): - count = 0 - for item in self.structure: - if(item == 'v'): - count += 1 - return count - - def is_chorus(self, n): - if(self.structure[n] == 'c'): - return 1 - return 0 - - def is_verse(self, n): - if(self.structure[n] == 'v'): - return 1 - return 0 - - def add_chorus(self, t_chorus): - newchorus = chorus() - newchorus.body = t_chorus - self.body.append(newchorus) - self.structure.append('c') - - def add_verse(self, t_verse): - newverse = verse() - newverse.body = t_verse - self.body.append(newverse) - self.structure.append('v') diff --git a/ui/interface.py b/ui/interface.py new file mode 100644 index 0000000..35b2e5f --- /dev/null +++ b/ui/interface.py @@ -0,0 +1,176 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'interface.ui' +# +# 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! + +from PyQt4 import QtCore, QtGui + +class Ui_MainWindow(object): + def setupUi(self, MainWindow): + MainWindow.setObjectName("MainWindow") + MainWindow.resize(800, 600) + self.centralwidget = QtGui.QWidget(MainWindow) + self.centralwidget.setObjectName("centralwidget") + self.gridLayoutWidget = QtGui.QWidget(self.centralwidget) + self.gridLayoutWidget.setGeometry(QtCore.QRect(10, 10, 781, 541)) + self.gridLayoutWidget.setObjectName("gridLayoutWidget") + self.gridLayout = QtGui.QGridLayout(self.gridLayoutWidget) + self.gridLayout.setSizeConstraint(QtGui.QLayout.SetMaximumSize) + self.gridLayout.setObjectName("gridLayout") + self.list_songs = QtGui.QListWidget(self.gridLayoutWidget) + sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Expanding) + sizePolicy.setHorizontalStretch(0) + sizePolicy.setVerticalStretch(0) + sizePolicy.setHeightForWidth(self.list_songs.sizePolicy().hasHeightForWidth()) + self.list_songs.setSizePolicy(sizePolicy) + self.list_songs.setObjectName("list_songs") + self.gridLayout.addWidget(self.list_songs, 1, 0, 1, 1) + self.horizontalLayout = QtGui.QHBoxLayout() + self.horizontalLayout.setObjectName("horizontalLayout") + self.btn_new_song = QtGui.QPushButton(self.gridLayoutWidget) + self.btn_new_song.setObjectName("btn_new_song") + self.horizontalLayout.addWidget(self.btn_new_song) + self.btn_delete_song = QtGui.QPushButton(self.gridLayoutWidget) + self.btn_delete_song.setObjectName("btn_delete_song") + self.horizontalLayout.addWidget(self.btn_delete_song) + self.gridLayout.addLayout(self.horizontalLayout, 2, 0, 2, 1) + self.verticalLayout = QtGui.QVBoxLayout() + self.verticalLayout.setObjectName("verticalLayout") + self.gridLayout_2 = QtGui.QGridLayout() + self.gridLayout_2.setObjectName("gridLayout_2") + self.le_title = QtGui.QLineEdit(self.gridLayoutWidget) + self.le_title.setObjectName("le_title") + self.gridLayout_2.addWidget(self.le_title, 0, 1, 1, 1) + self.le_tauthor = QtGui.QLineEdit(self.gridLayoutWidget) + self.le_tauthor.setObjectName("le_tauthor") + self.gridLayout_2.addWidget(self.le_tauthor, 1, 1, 1, 1) + self.label = QtGui.QLabel(self.gridLayoutWidget) + self.label.setObjectName("label") + self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1) + self.label_2 = QtGui.QLabel(self.gridLayoutWidget) + self.label_2.setObjectName("label_2") + self.gridLayout_2.addWidget(self.label_2, 1, 0, 1, 1) + self.le_mauthor = QtGui.QLineEdit(self.gridLayoutWidget) + self.le_mauthor.setObjectName("le_mauthor") + self.gridLayout_2.addWidget(self.le_mauthor, 2, 1, 1, 1) + self.label_3 = QtGui.QLabel(self.gridLayoutWidget) + self.label_3.setObjectName("label_3") + self.gridLayout_2.addWidget(self.label_3, 2, 0, 1, 1) + self.le_year = QtGui.QLineEdit(self.gridLayoutWidget) + self.le_year.setObjectName("le_year") + self.gridLayout_2.addWidget(self.le_year, 3, 1, 1, 1) + self.le_tone = QtGui.QLineEdit(self.gridLayoutWidget) + self.le_tone.setObjectName("le_tone") + self.gridLayout_2.addWidget(self.le_tone, 4, 1, 1, 1) + self.label_4 = QtGui.QLabel(self.gridLayoutWidget) + self.label_4.setObjectName("label_4") + self.gridLayout_2.addWidget(self.label_4, 3, 0, 1, 1) + self.label_5 = QtGui.QLabel(self.gridLayoutWidget) + self.label_5.setObjectName("label_5") + self.gridLayout_2.addWidget(self.label_5, 4, 0, 1, 1) + self.verticalLayout.addLayout(self.gridLayout_2) + self.te_body = QtGui.QTextEdit(self.gridLayoutWidget) + self.te_body.setAcceptRichText(False) + self.te_body.setObjectName("te_body") + self.verticalLayout.addWidget(self.te_body) + self.gridLayout.addLayout(self.verticalLayout, 1, 1, 1, 1) + self.horizontalLayout_2 = QtGui.QHBoxLayout() + self.horizontalLayout_2.setObjectName("horizontalLayout_2") + self.btn_savesong = QtGui.QPushButton(self.gridLayoutWidget) + self.btn_savesong.setObjectName("btn_savesong") + self.horizontalLayout_2.addWidget(self.btn_savesong) + self.btn_create_latex_song = QtGui.QPushButton(self.gridLayoutWidget) + self.btn_create_latex_song.setObjectName("btn_create_latex_song") + self.horizontalLayout_2.addWidget(self.btn_create_latex_song) + self.gridLayout.addLayout(self.horizontalLayout_2, 2, 1, 2, 1) + self.label_6 = QtGui.QLabel(self.gridLayoutWidget) + self.label_6.setTextFormat(QtCore.Qt.RichText) + self.label_6.setAlignment(QtCore.Qt.AlignCenter) + self.label_6.setObjectName("label_6") + self.gridLayout.addWidget(self.label_6, 0, 0, 1, 1) + self.label_7 = QtGui.QLabel(self.gridLayoutWidget) + self.label_7.setObjectName("label_7") + self.gridLayout.addWidget(self.label_7, 0, 1, 1, 1) + MainWindow.setCentralWidget(self.centralwidget) + self.menubar = QtGui.QMenuBar(MainWindow) + self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 23)) + self.menubar.setObjectName("menubar") + self.menuFile = QtGui.QMenu(self.menubar) + self.menuFile.setObjectName("menuFile") + self.menuCanzoniere = QtGui.QMenu(self.menubar) + self.menuCanzoniere.setObjectName("menuCanzoniere") + self.menuCanzone = QtGui.QMenu(self.menubar) + self.menuCanzone.setObjectName("menuCanzone") + MainWindow.setMenuBar(self.menubar) + self.statusbar = QtGui.QStatusBar(MainWindow) + self.statusbar.setObjectName("statusbar") + MainWindow.setStatusBar(self.statusbar) + self.actionApri = QtGui.QAction(MainWindow) + self.actionApri.setObjectName("actionApri") + self.actionEsci = QtGui.QAction(MainWindow) + self.actionEsci.setObjectName("actionEsci") + self.actionSalva = QtGui.QAction(MainWindow) + self.actionSalva.setObjectName("actionSalva") + self.actionEsci_2 = QtGui.QAction(MainWindow) + self.actionEsci_2.setObjectName("actionEsci_2") + self.actionSalva_canzone = QtGui.QAction(MainWindow) + self.actionSalva_canzone.setObjectName("actionSalva_canzone") + self.actionImporta_canzone = QtGui.QAction(MainWindow) + 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()) + self.menubar.addAction(self.menuCanzoniere.menuAction()) + self.menubar.addAction(self.menuCanzone.menuAction()) + + self.retranslateUi(MainWindow) + QtCore.QObject.connect(self.actionEsci_2, QtCore.SIGNAL("activated()"), MainWindow.close) + QtCore.QMetaObject.connectSlotsByName(MainWindow) + + def retranslateUi(self, MainWindow): + 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)) + self.label_2.setText(QtGui.QApplication.translate("MainWindow", "Autore", None, QtGui.QApplication.UnicodeUTF8)) + self.label_3.setText(QtGui.QApplication.translate("MainWindow", "Copyright", None, QtGui.QApplication.UnicodeUTF8)) + self.label_4.setText(QtGui.QApplication.translate("MainWindow", "Anno", None, QtGui.QApplication.UnicodeUTF8)) + self.label_5.setText(QtGui.QApplication.translate("MainWindow", "Tonalità", None, QtGui.QApplication.UnicodeUTF8)) + self.btn_savesong.setText(QtGui.QApplication.translate("MainWindow", "Aggiungi al canzoniere", None, QtGui.QApplication.UnicodeUTF8)) + self.btn_create_latex_song.setText(QtGui.QApplication.translate("MainWindow", "Esporta canzone in LaTeX", None, QtGui.QApplication.UnicodeUTF8)) + self.label_6.setText(QtGui.QApplication.translate("MainWindow", "\n" +"\n" +"

Lista Canzoni

", None, QtGui.QApplication.UnicodeUTF8)) + self.label_7.setText(QtGui.QApplication.translate("MainWindow", "\n" +"\n" +"

Canzone selezionata

", None, QtGui.QApplication.UnicodeUTF8)) + self.menuFile.setTitle(QtGui.QApplication.translate("MainWindow", "File", None, QtGui.QApplication.UnicodeUTF8)) + self.menuCanzoniere.setTitle(QtGui.QApplication.translate("MainWindow", "Canzoniere", None, QtGui.QApplication.UnicodeUTF8)) + self.menuCanzone.setTitle(QtGui.QApplication.translate("MainWindow", "Canzone", None, QtGui.QApplication.UnicodeUTF8)) + self.actionApri.setText(QtGui.QApplication.translate("MainWindow", "Apri", None, QtGui.QApplication.UnicodeUTF8)) + self.actionEsci.setText(QtGui.QApplication.translate("MainWindow", "Esci", None, QtGui.QApplication.UnicodeUTF8)) + self.actionSalva.setText(QtGui.QApplication.translate("MainWindow", "Salva", None, QtGui.QApplication.UnicodeUTF8)) + self.actionEsci_2.setText(QtGui.QApplication.translate("MainWindow", "Esci", None, QtGui.QApplication.UnicodeUTF8)) + 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/ui/interface.ui b/ui/interface.ui new file mode 100644 index 0000000..0c602c2 --- /dev/null +++ b/ui/interface.ui @@ -0,0 +1,269 @@ + + + MainWindow + + + + 0 + 0 + 800 + 600 + + + + SongBook Editor 0.2 + + + + + + 10 + 10 + 781 + 541 + + + + + QLayout::SetMaximumSize + + + + + + 0 + 0 + + + + + + + + + + Nuova Canzone + + + + + + + Elimina Canzone + + + + + + + + + + + + + + + + + + + Titolo + + + + + + + Autore + + + + + + + + + + Copyright + + + + + + + + + + + + + Anno + + + + + + + Tonalità + + + + + + + + + false + + + + + + + + + + + Aggiungi al canzoniere + + + + + + + Esporta canzone in LaTeX + + + + + + + + + <!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;">Lista Canzoni</span></p></body></html> + + + Qt::RichText + + + Qt::AlignCenter + + + + + + + <!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 align="center" 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;">Canzone selezionata</span></p></body></html> + + + + + + + + + + 0 + 0 + 800 + 23 + + + + + File + + + + + + + + + Canzoniere + + + + + + + Canzone + + + + + + + + + + + + Apri + + + + + Esci + + + + + Salva + + + + + Esci + + + + + Salva canzone + + + + + Importa canzone + + + + + Esporta in LaTeX + + + + + Opzioni LaTeX + + + + + + + actionEsci_2 + activated() + MainWindow + close() + + + -1 + -1 + + + 399 + 299 + + + + + diff --git a/ui/options.py b/ui/options.py new file mode 100644 index 0000000..df65a12 --- /dev/null +++ b/ui/options.py @@ -0,0 +1,78 @@ +# -*- coding: utf-8 -*- + +# Form implementation generated from reading ui file 'options.ui' +# +# Created: Fri May 15 17:06:57 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.paper_size = QtGui.QComboBox(self.gridLayoutWidget) + self.paper_size.setObjectName("paper_size") + self.paper_size.addItem(QtCore.QString()) + self.paper_size.addItem(QtCore.QString()) + self.gridLayout.addWidget(self.paper_size, 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.type = QtGui.QComboBox(self.gridLayoutWidget) + self.type.setObjectName("type") + self.type.addItem(QtCore.QString()) + self.type.addItem(QtCore.QString()) + self.type.addItem(QtCore.QString()) + self.gridLayout.addWidget(self.type, 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.title = QtGui.QLineEdit(self.gridLayoutWidget) + self.title.setObjectName("title") + self.gridLayout.addWidget(self.title, 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.subtitle = QtGui.QLineEdit(self.gridLayoutWidget) + self.subtitle.setObjectName("subtitle") + self.gridLayout.addWidget(self.subtitle, 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.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.paper_size.setItemText(0, QtGui.QApplication.translate("options", "A4 (290mm x 210mm)", None, QtGui.QApplication.UnicodeUTF8)) + self.paper_size.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.type.setItemText(0, QtGui.QApplication.translate("options", "Testo e accordi", None, QtGui.QApplication.UnicodeUTF8)) + self.type.setItemText(1, QtGui.QApplication.translate("options", "Solo Testo", None, QtGui.QApplication.UnicodeUTF8)) + self.type.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/ui/options.ui b/ui/options.ui new file mode 100644 index 0000000..39816c4 --- /dev/null +++ b/ui/options.ui @@ -0,0 +1,131 @@ + + + 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> + + + + + + -- 2.1.4