Example #1
0
 def set_active_song(self, newsong):
     self.ui.le_title.setText(newsong.title)
     self.ui.le_mauthor.setText(newsong.mauthor)
     self.ui.le_tauthor.setText(newsong.tauthor)
     self.ui.le_year.setText(newsong.year)
     self.ui.le_tone.setText(newsong.tone)
     output = unicode()
     for paragraph in newsong.body:
         if(paragraph.is_chorus()):
             output += "R:"
         output += paragraph.content()
         output += "\n\n"
     self.ui.te_body.setDocument(QtGui.QTextDocument(output, self.ui.te_body))
     self.sh = syntax_highlighter.syntax_highlighter(self.ui.te_body.document())
Example #2
0
    def __init__(self, lm, parent=None):
        super(interface, self).__init__(parent)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)

        # options Database
        self.opt = {}
        self.set_default_options()

        # Create an empty database of songs... 
        self.song_db = []

        # Our format separator
        self.sep = ":::"
        self.sep_song = "***"

        # Song edit part
        self.connect(self.ui.btn_create_pdf, QtCore.SIGNAL("clicked()"), self.export_to_PDF)
        self.connect(self.ui.btn_savesong, QtCore.SIGNAL("clicked()"), self.savesong)

        # About the list
        self.connect(self.ui.list_songs, QtCore.SIGNAL("currentTextChanged ( QString )"), self.item_selected)
        self.connect(self.ui.btn_new_song, QtCore.SIGNAL("clicked()"), self.new_song)
        self.connect(self.ui.btn_delete_song, QtCore.SIGNAL("clicked()"), self.delete_item_from_list)
        self.connect(self.ui.btn_list_move_down, QtCore.SIGNAL("clicked()"), self.list_move_down)
        self.connect(self.ui.btn_list_move_up, QtCore.SIGNAL("clicked()"), self.list_move_up)

        # Menu File
        self.connect(self.ui.actionSalva, QtCore.SIGNAL("activated()"), self.save_songbook)
        self.connect(self.ui.actionApri, QtCore.SIGNAL("activated()"), self.load_songbook)

        # Menu Canzone
        self.connect(self.ui.actionSalva_canzone, QtCore.SIGNAL("activated()"), self.save_song_to_file)
        self.connect(self.ui.actionImporta_canzone, QtCore.SIGNAL("activated()"), self.import_song_from_file)
        self.connect(self.ui.actionEsporta_in_DVI, QtCore.SIGNAL("activated()"), self.export_to_DVI)
        self.connect(self.ui.actionEsporta_in_PDF, QtCore.SIGNAL("activated()"), self.export_to_PDF)

        # Menu Canzoniere
        self.connect(self.ui.actionEsporta_in_LaTeX, QtCore.SIGNAL("activated()"), self.export_songbook)
        self.connect(self.ui.actionOpzioni_LaTeX, QtCore.SIGNAL("activated()"), self.options)
        self.connect(self.ui.actionOrdina_Canzoni, QtCore.SIGNAL("activated()"), self.sort_list)

        self.sh = syntax_highlighter.syntax_highlighter(self.ui.te_body.document())