Exemplo n.º 1
0
 def __init__(self, mainwindow):
     self.actionCollection = ac = SessionActions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.session_new.triggered.connect(self.newSession)
     ac.session_save.triggered.connect(self.saveSession)
     ac.session_manage.triggered.connect(self.manageSessions)
     ac.session_none.triggered.connect(self.noSession)
Exemplo n.º 2
0
 def __init__(self, mainwindow):
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.import_all.triggered.connect(self.importAll)
     ac.import_musicxml.triggered.connect(self.importMusicXML)
     ac.import_midi.triggered.connect(self.importMidi)
     ac.import_abc.triggered.connect(self.importAbc)
Exemplo n.º 3
0
    def __init__(self, mainwindow):
        super(MusicViewPanel, self).__init__(mainwindow)
        self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+M"))
        mainwindow.addDockWidget(Qt.RightDockWidgetArea, self)

        ac = self.actionCollection = Actions(self)
        actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
        ac.music_print.triggered.connect(self.printMusic)
        ac.music_save_settings.triggered.connect(self.writeSettings)
        ac.music_maximize.triggered.connect(self.maximize)
        ac.music_jump_to_cursor.triggered.connect(self.jumpToCursor)
        ac.music_sync_cursor.triggered.connect(self.toggleSyncCursor)
        ac.music_copy_image.triggered.connect(self.copyImage)
        ac.music_copy_text.triggered.connect(self.copyText)
        ac.music_document_select.documentsChanged.connect(self.updateActions)
        ac.music_copy_image.setEnabled(False)
        ac.music_copy_text.setEnabled(False)
        ac.music_reload.triggered.connect(self.reloadView)

        # load the state of the actions from the preferences
        s = QSettings()
        s.beginGroup("musicview")
        ac.music_sync_cursor.setChecked(s.value("sync_cursor", False, bool))
        props = pagedview.PagedView.properties().setdefaults().load(s)
        ac._viewActions.updateFromProperties(props)
        ac._viewActions.viewRequested.connect(self.widget)  # force creation
Exemplo n.º 4
0
 def __init__(self, mainwindow):
     super(MusicViewPanel, self).__init__(mainwindow)
     self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+M"))
     mainwindow.addDockWidget(Qt.RightDockWidgetArea, self)
     
     ac = self.actionCollection = Actions(self)
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.music_print.triggered.connect(self.printMusic)
     ac.music_zoom_in.triggered.connect(self.zoomIn)
     ac.music_zoom_out.triggered.connect(self.zoomOut)
     ac.music_zoom_original.triggered.connect(self.zoomOriginal)
     ac.music_zoom_combo.zoomChanged.connect(self.slotZoomChanged)
     ac.music_fit_width.triggered.connect(self.fitWidth)
     ac.music_fit_height.triggered.connect(self.fitHeight)
     ac.music_fit_both.triggered.connect(self.fitBoth)
     ac.music_maximize.triggered.connect(self.maximize)
     ac.music_jump_to_cursor.triggered.connect(self.jumpToCursor)
     ac.music_sync_cursor.triggered.connect(self.toggleSyncCursor)
     ac.music_copy_image.triggered.connect(self.copyImage)
     ac.music_document_select.documentsChanged.connect(self.updateActions)
     ac.music_copy_image.setEnabled(False)
     ac.music_next_page.triggered.connect(self.slotNextPage)
     ac.music_prev_page.triggered.connect(self.slotPreviousPage)
     self.slotPageCountChanged(0)
     ac.music_next_page.setEnabled(False)
     ac.music_prev_page.setEnabled(False)
     self.actionCollection.music_sync_cursor.setChecked(
         QSettings().value("musicview/sync_cursor", False) in (True, "true"))
Exemplo n.º 5
0
 def __init__(self, mainwindow):
     super(AbstractViewPanel, self).__init__(mainwindow)
     self.hide()
     ac = self.actionCollection = self._createConcreteActions(self)
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     self.configureActions()
     self.connectActions()
Exemplo n.º 6
0
    def __init__(self, mainwindow):
        ac = self.actionCollection = Actions()
        actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
        ac.view_goto_file_or_definition.triggered.connect(self.gotoFileOrDefinition)
        ac.edit_cut_assign.triggered.connect(self.cutAssign)
        ac.edit_move_to_include_file.triggered.connect(self.moveToIncludeFile)
        ac.view_highlighting.triggered.connect(self.toggleHighlighting)
        ac.tools_indent_auto.triggered.connect(self.toggleAuto_indent)
        ac.tools_indent_indent.triggered.connect(self.re_indent)
        ac.tools_reformat.triggered.connect(self.reFormat)
        ac.tools_remove_trailing_whitespace.triggered.connect(self.removeTrailingWhitespace)
        ac.tools_convert_ly.triggered.connect(self.convertLy)
        ac.tools_quick_remove_comments.triggered.connect(self.quickRemoveComments)
        ac.tools_quick_remove_articulations.triggered.connect(self.quickRemoveArticulations)
        ac.tools_quick_remove_ornaments.triggered.connect(self.quickRemoveOrnaments)
        ac.tools_quick_remove_instrument_scripts.triggered.connect(self.quickRemoveInstrumentScripts)
        ac.tools_quick_remove_slurs.triggered.connect(self.quickRemoveSlurs)
        ac.tools_quick_remove_beams.triggered.connect(self.quickRemoveBeams)
        ac.tools_quick_remove_ligatures.triggered.connect(self.quickRemoveLigatures)
        ac.tools_quick_remove_dynamics.triggered.connect(self.quickRemoveDynamics)
        ac.tools_quick_remove_fingerings.triggered.connect(self.quickRemoveFingerings)
        ac.tools_quick_remove_markup.triggered.connect(self.quickRemoveMarkup)

        mainwindow.currentDocumentChanged.connect(self.updateDocActions)
        mainwindow.selectionStateChanged.connect(self.updateSelectionActions)
Exemplo n.º 7
0
 def __init__(self, mainwindow):
     self.actionCollection = ac = SessionActions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.session_new.triggered.connect(self.newSession)
     ac.session_save.triggered.connect(self.saveSession)
     ac.session_manage.triggered.connect(self.manageSessions)
     ac.session_none.triggered.connect(self.noSession)
Exemplo n.º 8
0
    def __init__(self, mainwindow):
        ac = self.actionCollection = Actions()
        actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
        ac.view_goto_file_or_definition.triggered.connect(
            self.gotoFileOrDefinition)
        ac.edit_cut_assign.triggered.connect(self.cutAssign)
        ac.edit_move_to_include_file.triggered.connect(self.moveToIncludeFile)
        ac.view_highlighting.triggered.connect(self.toggleHighlighting)
        ac.tools_indent_auto.triggered.connect(self.toggleAuto_indent)
        ac.tools_indent_indent.triggered.connect(self.re_indent)
        ac.tools_reformat.triggered.connect(self.reFormat)
        ac.tools_remove_trailing_whitespace.triggered.connect(
            self.removeTrailingWhitespace)
        ac.tools_convert_ly.triggered.connect(self.convertLy)
        ac.tools_quick_remove_comments.triggered.connect(
            self.quickRemoveComments)
        ac.tools_quick_remove_articulations.triggered.connect(
            self.quickRemoveArticulations)
        ac.tools_quick_remove_ornaments.triggered.connect(
            self.quickRemoveOrnaments)
        ac.tools_quick_remove_instrument_scripts.triggered.connect(
            self.quickRemoveInstrumentScripts)
        ac.tools_quick_remove_slurs.triggered.connect(self.quickRemoveSlurs)
        ac.tools_quick_remove_dynamics.triggered.connect(
            self.quickRemoveDynamics)
        ac.tools_quick_remove_fingerings.triggered.connect(
            self.quickRemoveFingerings)
        ac.tools_quick_remove_markup.triggered.connect(self.quickRemoveMarkup)

        mainwindow.currentDocumentChanged.connect(self.updateDocActions)
        mainwindow.selectionStateChanged.connect(self.updateSelectionActions)
Exemplo n.º 9
0
 def __init__(self, mainwindow):
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.import_all.triggered.connect(self.importAll)
     ac.import_musicxml.triggered.connect(self.importMusicXML)
     ac.import_midi.triggered.connect(self.importMidi)
     ac.import_abc.triggered.connect(self.importAbc)
Exemplo n.º 10
0
 def __init__(self, mainwindow):
     self._currentStickyDocument = None
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.engrave_sticky.triggered.connect(self.stickyToggled)
     ac.engrave_runner.triggered.connect(self.engraveRunner)
     ac.engrave_preview.triggered.connect(self.engravePreview)
     ac.engrave_publish.triggered.connect(self.engravePublish)
     ac.engrave_debug.triggered.connect(self.engraveLayoutControl)
     ac.engrave_custom.triggered.connect(self.engraveCustom)
     ac.engrave_abort.triggered.connect(self.engraveAbort)
     ac.engrave_autocompile.toggled.connect(self.engraveAutoCompileToggled)
     ac.engrave_open_lilypond_datadir.triggered.connect(self.openLilyPondDatadir)
     ac.engrave_show_available_fonts.triggered.connect(self.showAvailableFonts)
     mainwindow.currentDocumentChanged.connect(self.updateActions)
     app.jobStarted.connect(self.updateActions)
     app.jobFinished.connect(self.updateActions)
     app.jobFinished.connect(self.checkLilyPondInstalled)
     app.jobFinished.connect(self.openDefaultView)
     app.sessionChanged.connect(self.slotSessionChanged)
     app.saveSessionData.connect(self.slotSaveSessionData)
     app.documentClosed.connect(self.slotDocumentClosed)
     mainwindow.aboutToClose.connect(self.saveSettings)
     self.loadSettings()
     app.languageChanged.connect(self.updateStickyActionText)
     self.updateStickyActionText()
Exemplo n.º 11
0
 def __init__(self, mainwindow):
     self._currentStickyDocument = None
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.engrave_sticky.triggered.connect(self.stickyToggled)
     ac.engrave_runner.triggered.connect(self.engraveRunner)
     ac.engrave_preview.triggered.connect(self.engravePreview)
     ac.engrave_publish.triggered.connect(self.engravePublish)
     ac.engrave_debug.triggered.connect(self.engraveLayoutControl)
     ac.engrave_custom.triggered.connect(self.engraveCustom)
     ac.engrave_abort.triggered.connect(self.engraveAbort)
     ac.engrave_autocompile.toggled.connect(self.engraveAutoCompileToggled)
     ac.engrave_open_lilypond_datadir.triggered.connect(
         self.openLilyPondDatadir)
     ac.engrave_show_available_fonts.triggered.connect(
         self.showAvailableFonts)
     mainwindow.currentDocumentChanged.connect(self.updateActions)
     app.jobStarted.connect(self.updateActions)
     app.jobFinished.connect(self.updateActions)
     app.jobFinished.connect(self.checkLilyPondInstalled)
     app.jobFinished.connect(self.openDefaultView)
     app.sessionChanged.connect(self.slotSessionChanged)
     app.saveSessionData.connect(self.slotSaveSessionData)
     app.documentClosed.connect(self.slotDocumentClosed)
     mainwindow.aboutToClose.connect(self.saveSettings)
     self.loadSettings()
     app.languageChanged.connect(self.updateStickyActionText)
     self.updateStickyActionText()
Exemplo n.º 12
0
    def __init__(self, mainwindow):
        super(MusicViewPanel, self).__init__(mainwindow)
        self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+M"))
        mainwindow.addDockWidget(Qt.RightDockWidgetArea, self)

        ac = self.actionCollection = Actions(self)
        actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
        ac.music_print.triggered.connect(self.printMusic)
        ac.music_zoom_in.triggered.connect(self.zoomIn)
        ac.music_zoom_out.triggered.connect(self.zoomOut)
        ac.music_zoom_original.triggered.connect(self.zoomOriginal)
        ac.music_zoom_combo.zoomChanged.connect(self.slotZoomChanged)
        ac.music_fit_width.triggered.connect(self.fitWidth)
        ac.music_fit_height.triggered.connect(self.fitHeight)
        ac.music_fit_both.triggered.connect(self.fitBoth)
        ac.music_maximize.triggered.connect(self.maximize)
        ac.music_jump_to_cursor.triggered.connect(self.jumpToCursor)
        ac.music_sync_cursor.triggered.connect(self.toggleSyncCursor)
        ac.music_copy_image.triggered.connect(self.copyImage)
        ac.music_document_select.documentsChanged.connect(self.updateActions)
        ac.music_copy_image.setEnabled(False)
        ac.music_next_page.triggered.connect(self.slotNextPage)
        ac.music_prev_page.triggered.connect(self.slotPreviousPage)
        self.slotPageCountChanged(0)
        ac.music_next_page.setEnabled(False)
        ac.music_prev_page.setEnabled(False)
        ac.music_reload.triggered.connect(self.reloadView)
        self.actionCollection.music_sync_cursor.setChecked(QSettings().value(
            "musicview/sync_cursor", False, bool))
Exemplo n.º 13
0
 def __init__(self, mainwindow):
     super(HelpBrowser, self).__init__(mainwindow)
     self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+D"))
     self.hide()
     mainwindow.addDockWidget(Qt.RightDockWidgetArea, self)
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.help_lilypond_doc.triggered.connect(self.activate)
Exemplo n.º 14
0
 def __init__(self, mainwindow):
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.lyrics_hyphenate.triggered.connect(self.hyphenate)
     ac.lyrics_dehyphenate.triggered.connect(self.dehyphenate)
     ac.lyrics_copy_dehyphenated.triggered.connect(self.copy_dehyphenated)
     mainwindow.selectionStateChanged.connect(self.updateSelection)
     self.updateSelection(mainwindow.hasSelection())
Exemplo n.º 15
0
 def __init__(self, mainwindow):
     super(AbstractViewPanel, self).__init__(mainwindow)
     self.hide()
     ac = self.actionCollection = self._createConcreteActions(self)
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     self.slotPageCountChanged(0)
     self.configureActions()
     self.connectActions()
Exemplo n.º 16
0
 def __init__(self, mainwindow):
     super(QuickInsertPanel, self).__init__(mainwindow)
     self.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)
     self.hide()
     self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+I"))
     mainwindow.addDockWidget(Qt.LeftDockWidgetArea, self)
     self.actionCollection = QuickInsertActions(self)
     actioncollectionmanager.manager(mainwindow).addActionCollection(self.actionCollection)
Exemplo n.º 17
0
 def __init__(self, mainwindow):
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.lyrics_hyphenate.triggered.connect(self.hyphenate)
     ac.lyrics_dehyphenate.triggered.connect(self.dehyphenate)
     ac.lyrics_copy_dehyphenated.triggered.connect(self.copy_dehyphenated)
     mainwindow.selectionStateChanged.connect(self.updateSelection)
     self.updateSelection(mainwindow.hasSelection())
Exemplo n.º 18
0
 def __init__(self, mainwindow):
     super(QuickInsertPanel, self).__init__(mainwindow)
     self.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)
     self.hide()
     self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+I"))
     mainwindow.addDockWidget(Qt.LeftDockWidgetArea, self)
     self.actionCollection = QuickInsertActions(self)
     actioncollectionmanager.manager(mainwindow).addActionCollection(self.actionCollection)
Exemplo n.º 19
0
 def __init__(self, mainwindow):
     super(MidiInputTool, self).__init__(mainwindow)
     self.hide()
     self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+R"))
     ac = self.actionCollection = Actions()
     ac.capture_start.triggered.connect(self.slotStartCapturing)
     ac.capture_stop.triggered.connect(self.slotStopCapturing)
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     mainwindow.addDockWidget(Qt.BottomDockWidgetArea, self)
Exemplo n.º 20
0
 def __init__(self, mainwindow):
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.go_back.triggered.connect(self.goBack)
     ac.go_forward.triggered.connect(self.goForward)
     app.documentClosed.connect(self._documentClosed)
     self._history = [Position()]
     self._index = 0    # the index points to the current position
     self.updateActions()
Exemplo n.º 21
0
 def __init__(self, mainwindow):
     self.actionCollection = ac = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.view_linenumbers.triggered.connect(self.toggleLineNumbers)
     mainwindow.viewManager.activeViewSpaceChanged.connect(self.updateActions)
     app.viewSpaceCreated.connect(self.newViewSpace)
     # there is always one ViewSpace, initialize it
     self.manager().loadSettings()
     self.updateActions()
Exemplo n.º 22
0
 def __init__(self, mainwindow):
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.go_back.triggered.connect(self.goBack)
     ac.go_forward.triggered.connect(self.goForward)
     app.documentClosed.connect(self._documentClosed)
     self._history = [Position()]
     self._index = 0  # the index points to the current position
     self.updateActions()
Exemplo n.º 23
0
 def __init__(self, mainwindow):
     super(MidiInputTool, self).__init__(mainwindow)
     self.hide()
     self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+R"))
     ac = self.actionCollection = Actions()
     ac.capture_start.triggered.connect(self.slotStartCapturing)
     ac.capture_stop.triggered.connect(self.slotStopCapturing)
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     mainwindow.addDockWidget(Qt.BottomDockWidgetArea, self)
Exemplo n.º 24
0
 def __init__(self, mainwindow):
     super(Matcher, self).__init__()
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.view_matching_pair.triggered.connect(self.moveto_match)
     ac.view_matching_pair_select.triggered.connect(self.select_match)
     mainwindow.currentViewChanged.connect(self.setView)
     view = mainwindow.currentView()
     if view:
         self.setView(view)
Exemplo n.º 25
0
 def __init__(self, mainwindow):
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.autocomplete.toggled.connect(self.setAutoComplete)
     ac.popup_completions.triggered.connect(self.showCompletions)
     mainwindow.currentViewChanged.connect(self.setView)
     if mainwindow.currentView():
         self.setView(mainwindow.currentView())
     complete = QSettings().value("autocomplete", True, bool)
     ac.autocomplete.setChecked(complete)
Exemplo n.º 26
0
 def __init__(self, mainwindow):
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.autocomplete.toggled.connect(self.setAutoComplete)
     ac.popup_completions.triggered.connect(self.showCompletions)
     mainwindow.currentViewChanged.connect(self.setView)
     if mainwindow.currentView():
         self.setView(mainwindow.currentView())
     complete = QSettings().value("autocomplete", True, bool)
     ac.autocomplete.setChecked(complete)
Exemplo n.º 27
0
    def __init__(self, mainwindow):
        super(SvgViewPanel, self).__init__(mainwindow)
        self.hide()
        self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+G"))
        mainwindow.addDockWidget(Qt.RightDockWidgetArea, self)

        ac = self.actionCollection = Actions(self)
        actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
        ac.svg_zoom_in.triggered.connect(self.zoomIn)
        ac.svg_zoom_out.triggered.connect(self.zoomOut)
        ac.svg_zoom_original.triggered.connect(self.zoomOriginal)
Exemplo n.º 28
0
 def __init__(self, mainwindow):
     super(LogTool, self).__init__(mainwindow)
     self.hide()
     self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+L"))
     ac = self.actionCollection = Actions()
     ac.log_next_error.triggered.connect(self.slotNextError)
     ac.log_previous_error.triggered.connect(self.slotPreviousError)
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     mainwindow.addDockWidget(Qt.BottomDockWidgetArea, self)
     app.jobStarted.connect(self.slotJobStarted)
     app.jobFinished.connect(self.slotJobFinished)
Exemplo n.º 29
0
    def __init__(self, mainwindow):
        super(Matcher, self).__init__()
        ac = self.actionCollection = Actions()
        actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
        ac.view_matching_pair.triggered.connect(self.moveto_match)
        ac.view_matching_pair_select.triggered.connect(self.select_match)
        mainwindow.currentViewChanged.connect(self.setView)

        view = mainwindow.currentView()
        if view:
            self.setView(view)
Exemplo n.º 30
0
 def __init__(self, mainwindow):
     super(MidiTool, self).__init__(mainwindow)
     self.hide()
     self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+P"))
     ac = self.actionCollection = Actions()
     ac.midi_play.triggered.connect(self.slotPlay)
     ac.midi_pause.triggered.connect(self.slotPause)
     ac.midi_stop.triggered.connect(self.slotStop)
     ac.midi_restart.triggered.connect(self.slotRestart)
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     mainwindow.addDockWidget(Qt.TopDockWidgetArea, self)
Exemplo n.º 31
0
    def __init__(self, mainwindow):
        super(SvgViewPanel, self).__init__(mainwindow)
        self.hide()
        self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+G"))
        mainwindow.addDockWidget(Qt.RightDockWidgetArea, self)

        ac = self.actionCollection = Actions(self)
        actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
        ac.svg_zoom_in.triggered.connect(self.zoomIn)
        ac.svg_zoom_out.triggered.connect(self.zoomOut)
        ac.svg_zoom_original.triggered.connect(self.zoomOriginal)
Exemplo n.º 32
0
 def __init__(self, mainwindow):
     super(MidiTool, self).__init__(mainwindow)
     self.hide()
     self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+P"))
     ac = self.actionCollection = Actions()
     ac.midi_play.triggered.connect(self.slotPlay)
     ac.midi_pause.triggered.connect(self.slotPause)
     ac.midi_stop.triggered.connect(self.slotStop)
     ac.midi_restart.triggered.connect(self.slotRestart)
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     mainwindow.addDockWidget(Qt.TopDockWidgetArea, self)
Exemplo n.º 33
0
 def __init__(self, mainwindow):
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.edit_cut_assign.triggered.connect(self.cutAssign)
     ac.view_highlighting.triggered.connect(self.toggleHighlighting)
     ac.tools_indent_auto.triggered.connect(self.toggleAuto_indent)
     ac.tools_indent_indent.triggered.connect(self.re_indent)
     ac.tools_reformat.triggered.connect(self.reFormat)
     ac.tools_convert_ly.triggered.connect(self.convertLy)
     mainwindow.currentDocumentChanged.connect(self.updateDocActions)
     mainwindow.selectionStateChanged.connect(self.updateSelectionActions)
Exemplo n.º 34
0
 def __init__(self, mainwindow):
     super(LogTool, self).__init__(mainwindow)
     self.hide()
     self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+L"))
     ac = self.actionCollection = Actions()
     ac.log_next_error.triggered.connect(self.slotNextError)
     ac.log_previous_error.triggered.connect(self.slotPreviousError)
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     mainwindow.addDockWidget(Qt.BottomDockWidgetArea, self)
     app.jobStarted.connect(self.slotJobStarted)
     app.jobFinished.connect(self.slotJobFinished)
Exemplo n.º 35
0
 def __init__(self, mainwindow):
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.view_next_mark.triggered.connect(self.nextMark)
     ac.view_previous_mark.triggered.connect(self.previousMark)
     ac.view_bookmark.triggered.connect(self.markCurrentLine)
     ac.view_clear_error_marks.triggered.connect(self.clearErrorMarks)
     ac.view_clear_all_marks.triggered.connect(self.clearAllMarks)
     mainwindow.currentViewChanged.connect(self.slotViewChanged)
     mainwindow.currentDocumentChanged.connect(self.slotDocumentChanged)
     if mainwindow.currentView():
         self.slotViewChanged(mainwindow.currentView())
         self.slotDocumentChanged(mainwindow.currentDocument())
Exemplo n.º 36
0
 def __init__(self, mainwindow):
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.view_next_mark.triggered.connect(self.nextMark)
     ac.view_previous_mark.triggered.connect(self.previousMark)
     ac.view_bookmark.triggered.connect(self.markCurrentLine)
     ac.view_clear_error_marks.triggered.connect(self.clearErrorMarks)
     ac.view_clear_all_marks.triggered.connect(self.clearAllMarks)
     mainwindow.currentViewChanged.connect(self.slotViewChanged)
     mainwindow.currentDocumentChanged.connect(self.slotDocumentChanged)
     if mainwindow.currentView():
         self.slotViewChanged(mainwindow.currentView())
         self.slotDocumentChanged(mainwindow.currentDocument())
Exemplo n.º 37
0
 def __init__(self, mainwindow):
     super(SnippetTool, self).__init__(mainwindow)
     self.hide()
     self.snippetActions = SnippetActions(self)
     actioncollectionmanager.manager(mainwindow).addActionCollection(self.snippetActions)
     self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+S"))
     ac = self.actionCollection = Actions()
     mainwindow.addAction(ac.snippettool_activate)
     ac.snippettool_activate.triggered.connect(self.activate)
     ac.file_save_as_template.triggered.connect(self.saveAsTemplate)
     ac.templates_manage.triggered.connect(self.manageTemplates)
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     mainwindow.addDockWidget(Qt.BottomDockWidgetArea, self)
Exemplo n.º 38
0
 def __init__(self, mainwindow):
     self._currentStickyDocument = None
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.engrave_sticky.triggered.connect(self.stickyToggled)
     ac.engrave_runner.triggered.connect(self.engraveRunner)
     ac.engrave_preview.triggered.connect(self.engravePreview)
     ac.engrave_publish.triggered.connect(self.engravePublish)
     ac.engrave_custom.triggered.connect(self.engraveCustom)
     ac.engrave_abort.triggered.connect(self.engraveAbort)
     mainwindow.currentDocumentChanged.connect(self.updateActions)
     app.jobStarted.connect(self.updateActions)
     app.jobFinished.connect(self.updateActions)
     app.languageChanged.connect(self.updateStickyActionText)
     self.updateStickyActionText()
Exemplo n.º 39
0
 def __init__(self, mainwindow):
     self.actionCollection = ac = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.view_linenumbers.triggered.connect(self.toggleLineNumbers)
     ac.folding_enable.triggered.connect(self.toggleFolding)
     ac.folding_fold_current.triggered.connect(self.foldCurrent)
     ac.folding_fold_top.triggered.connect(self.foldTop)
     ac.folding_unfold_current.triggered.connect(self.unfoldCurrent)
     ac.folding_fold_all.triggered.connect(self.foldAll)
     ac.folding_unfold_all.triggered.connect(self.unfoldAll)
     mainwindow.viewManager.activeViewSpaceChanged.connect(self.updateActions)
     app.viewSpaceCreated.connect(self.newViewSpace)
     # there is always one ViewSpace, initialize it
     self.manager().loadSettings()
     self.updateActions()
Exemplo n.º 40
0
def insert_macro(text, view):
    """The macro snippet is a sequence of commands which are either 
    Frescobaldi actions or other snippets.
    """
    import re
    import actioncollectionmanager
    from . import model

    avail_snippets = {}
    for n in model.model().names():
        varname = snippets.get(n).variables.get('name')
        if varname:
            avail_snippets[varname] = n

    avail_actions = {}
    win = view.window()
    for collection in actioncollectionmanager.manager(win).actionCollections():
        for name, action in collection.actions().items():
            avail_actions[name] = action

    commands = [x.strip() for x in text.split('\n') if x]
    for c in commands:
        if c in avail_snippets:
            insert(avail_snippets[c], view)
        elif c in avail_actions:
            avail_actions[c].trigger()
Exemplo n.º 41
0
 def __init__(self, mainwindow):
     super(SnippetTool, self).__init__(mainwindow)
     self.hide()
     self.snippetActions = SnippetActions(self)
     actioncollectionmanager.manager(mainwindow).addActionCollection(self.snippetActions)
     self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+S"))
     ac = self.actionCollection = Actions()
     mainwindow.addAction(ac.snippettool_activate)
     ac.snippettool_activate.triggered.connect(self.activate)
     ac.file_save_as_template.triggered.connect(self.saveAsTemplate)
     ac.copy_to_snippet.triggered.connect(self.copyToSnippet)
     ac.templates_manage.triggered.connect(self.manageTemplates)
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     mainwindow.addDockWidget(Qt.BottomDockWidgetArea, self)
     mainwindow.selectionStateChanged.connect(self.updateActions)
     self.updateActions()
Exemplo n.º 42
0
def insert_macro(text, view):
    """The macro snippet is a sequence of commands which are either 
    Frescobaldi actions or other snippets.
    """
    import re
    import actioncollectionmanager
    from . import model
    
    avail_snippets = {}
    for n in model.model().names():
        varname = snippets.get(n).variables.get('name')
        if varname:
            avail_snippets[varname] = n

    avail_actions = {}
    win = view.window()
    for collection in actioncollectionmanager.manager(win).actionCollections():
        for name, action in collection.actions().items():
            avail_actions[name] = action

    commands = [x.strip() for x in text.split('\n') if x]
    for c in commands:
        if c in avail_snippets:
            insert(avail_snippets[c], view)
        elif c in avail_actions:
            avail_actions[c].trigger()
Exemplo n.º 43
0
 def __init__(self, mainwindow):
     self.actionCollection = ac = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     mainwindow.selectionStateChanged.connect(self.updateSelection)
     self.updateSelection(mainwindow.hasSelection())
     ac.rhythm_double.triggered.connect(self.rhythm_double)
     ac.rhythm_halve.triggered.connect(self.rhythm_halve)
     ac.rhythm_dot.triggered.connect(self.rhythm_dot)
     ac.rhythm_undot.triggered.connect(self.rhythm_undot)
     ac.rhythm_remove_scaling.triggered.connect(self.rhythm_remove_scaling)
     ac.rhythm_remove.triggered.connect(self.rhythm_remove)
     ac.rhythm_implicit.triggered.connect(self.rhythm_implicit)
     ac.rhythm_implicit_per_line.triggered.connect(self.rhythm_implicit_per_line)
     ac.rhythm_explicit.triggered.connect(self.rhythm_explicit)
     ac.rhythm_apply.triggered.connect(self.rhythm_apply)
     ac.rhythm_copy.triggered.connect(self.rhythm_copy)
     ac.rhythm_paste.triggered.connect(self.rhythm_paste)
Exemplo n.º 44
0
 def __init__(self, mainwindow):
     self.actionCollection = ac = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     m = self.language_menu = QMenu()
     g = self.language_group = QActionGroup(None)
     for name in sorted(ly.pitch.pitchInfo.keys()):
         a = m.addAction(name.title())
         a.setObjectName(name)
         a.setCheckable(True)
         g.addAction(a)
     qutil.addAccelerators(m.actions())
     ac.pitch_language.setMenu(m)
     m.aboutToShow.connect(self.setLanguageMenu)
     g.triggered.connect(self.changeLanguage)
     ac.pitch_rel2abs.triggered.connect(self.rel2abs)
     ac.pitch_abs2rel.triggered.connect(self.abs2rel)
     ac.pitch_transpose.triggered.connect(self.transpose)
Exemplo n.º 45
0
 def __init__(self, mainwindow):
     self.actionCollection = ac = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     m = self.language_menu = QMenu()
     g = self.language_group = QActionGroup(None)
     for name in sorted(ly.pitch.pitchInfo.keys()):
         a = m.addAction(name.title())
         a.setObjectName(name)
         a.setCheckable(True)
         g.addAction(a)
     qutil.addAccelerators(m.actions())
     ac.pitch_language.setMenu(m)
     m.aboutToShow.connect(self.setLanguageMenu)
     g.triggered.connect(self.changeLanguage)
     ac.pitch_rel2abs.triggered.connect(self.rel2abs)
     ac.pitch_abs2rel.triggered.connect(self.abs2rel)
     ac.pitch_transpose.triggered.connect(self.transpose)
     ac.pitch_modal_transpose.triggered.connect(self.modalTranspose)
Exemplo n.º 46
0
 def editShortcut(self):
     """Edit our shortcut."""
     mainwindow = self.parent().mainwindow()
     action = QAction(self.defaultAction().icon(), self.defaultAction().text(), None)
     action.setShortcuts(self.actionCollection().shortcuts(self.objectName()) or [])
     if actioncollectionmanager.manager(mainwindow).editAction(self, action,
             self.actionCollection().defaults().get(self.objectName()),
             self.defaultAction()):
         self.actionCollection().setShortcuts(self.objectName(), action.shortcuts())
Exemplo n.º 47
0
    def __init__(self, mainwindow):
        super(MusicViewPanel, self).__init__(mainwindow)
        self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+M"))
        mainwindow.addDockWidget(Qt.RightDockWidgetArea, self)

        ac = self.actionCollection = Actions(self)
        actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
        ac.music_print.triggered.connect(self.printMusic)
        ac.music_zoom_in.triggered.connect(self.zoomIn)
        ac.music_zoom_out.triggered.connect(self.zoomOut)
        ac.music_zoom_original.triggered.connect(self.zoomOriginal)
        ac.music_zoom_combo.zoomChanged.connect(self.slotZoomChanged)
        ac.music_fit_width.triggered.connect(self.fitWidth)
        ac.music_fit_height.triggered.connect(self.fitHeight)
        ac.music_fit_both.triggered.connect(self.fitBoth)
        ac.music_single_pages.triggered.connect(self.viewSinglePages)
        ac.music_two_pages_first_right.triggered.connect(
            self.viewTwoPagesFirstRight)
        ac.music_two_pages_first_left.triggered.connect(
            self.viewTwoPagesFirstLeft)
        ac.music_maximize.triggered.connect(self.maximize)
        ac.music_jump_to_cursor.triggered.connect(self.jumpToCursor)
        ac.music_sync_cursor.triggered.connect(self.toggleSyncCursor)
        ac.music_copy_image.triggered.connect(self.copyImage)
        ac.music_copy_text.triggered.connect(self.copyText)
        ac.music_document_select.documentsChanged.connect(self.updateActions)
        ac.music_copy_image.setEnabled(False)
        ac.music_next_page.triggered.connect(self.slotNextPage)
        ac.music_prev_page.triggered.connect(self.slotPreviousPage)
        self.slotPageCountChanged(0)
        ac.music_next_page.setEnabled(False)
        ac.music_prev_page.setEnabled(False)
        ac.music_single_pages.setChecked(True)  # default to single pages
        ac.music_reload.triggered.connect(self.reloadView)
        self.actionCollection.music_sync_cursor.setChecked(QSettings().value(
            "musicview/sync_cursor", False, bool))

        mode = QSettings().value("muziekview/layoutmode", "single", str)
        if mode == "double_left":
            ac.music_two_pages_first_left.setChecked(True)
        elif mode == "double_right":
            ac.music_two_pages_first_right.setChecked(True)
        else:  # mode == "single":
            ac.music_single_pages.setChecked(True)
Exemplo n.º 48
0
 def __init__(self, mainwindow):
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.file_open_file_at_cursor.triggered.connect(self.openFileAtCursor)
     ac.edit_cut_assign.triggered.connect(self.cutAssign)
     ac.view_highlighting.triggered.connect(self.toggleHighlighting)
     ac.tools_indent_auto.triggered.connect(self.toggleAuto_indent)
     ac.tools_indent_indent.triggered.connect(self.re_indent)
     ac.tools_reformat.triggered.connect(self.reFormat)
     ac.tools_convert_ly.triggered.connect(self.convertLy)
     ac.tools_quick_remove_articulations.triggered.connect(self.quickRemoveArticulations)
     ac.tools_quick_remove_ornaments.triggered.connect(self.quickRemoveOrnaments)
     ac.tools_quick_remove_instrument_scripts.triggered.connect(self.quickRemoveInstrumentScripts)
     ac.tools_quick_remove_slurs.triggered.connect(self.quickRemoveSlurs)
     ac.tools_quick_remove_dynamics.triggered.connect(self.quickRemoveDynamics)
     ac.tools_quick_remove_markup.triggered.connect(self.quickRemoveMarkup)
     
     mainwindow.currentDocumentChanged.connect(self.updateDocActions)
     mainwindow.selectionStateChanged.connect(self.updateSelectionActions)
Exemplo n.º 49
0
    def __init__(self, mainwindow):
        super(MusicViewPanel, self).__init__(mainwindow)
        self.toggleViewAction().setShortcut(QKeySequence("Meta+Alt+M"))
        mainwindow.addDockWidget(Qt.RightDockWidgetArea, self)

        ac = self.actionCollection = Actions(self)
        actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
        ac.music_print.triggered.connect(self.printMusic)
        ac.music_zoom_in.triggered.connect(self.zoomIn)
        ac.music_zoom_out.triggered.connect(self.zoomOut)
        ac.music_zoom_original.triggered.connect(self.zoomOriginal)
        ac.music_zoom_combo.zoomChanged.connect(self.slotZoomChanged)
        ac.music_fit_width.triggered.connect(self.fitWidth)
        ac.music_fit_height.triggered.connect(self.fitHeight)
        ac.music_fit_both.triggered.connect(self.fitBoth)
        ac.music_single_pages.triggered.connect(self.viewSinglePages)
        ac.music_two_pages_first_right.triggered.connect(self.viewTwoPagesFirstRight)
        ac.music_two_pages_first_left.triggered.connect(self.viewTwoPagesFirstLeft)
        ac.music_maximize.triggered.connect(self.maximize)
        ac.music_jump_to_cursor.triggered.connect(self.jumpToCursor)
        ac.music_sync_cursor.triggered.connect(self.toggleSyncCursor)
        ac.music_copy_image.triggered.connect(self.copyImage)
        ac.music_copy_text.triggered.connect(self.copyText)
        ac.music_document_select.documentsChanged.connect(self.updateActions)
        ac.music_copy_image.setEnabled(False)
        ac.music_next_page.triggered.connect(self.slotNextPage)
        ac.music_prev_page.triggered.connect(self.slotPreviousPage)
        self.slotPageCountChanged(0)
        ac.music_next_page.setEnabled(False)
        ac.music_prev_page.setEnabled(False)
        ac.music_single_pages.setChecked(True) # default to single pages
        ac.music_reload.triggered.connect(self.reloadView)
        self.actionCollection.music_sync_cursor.setChecked(
            QSettings().value("musicview/sync_cursor", False, bool))

        mode = QSettings().value("muziekview/layoutmode", "single", str)
        if mode == "double_left":
            ac.music_two_pages_first_left.setChecked(True)
        elif mode == "double_right":
            ac.music_two_pages_first_right.setChecked(True)
        else: # mode == "single":
            ac.music_single_pages.setChecked(True)
Exemplo n.º 50
0
 def __init__(self, mainwindow):
     self.actionCollection = ac = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     mainwindow.selectionStateChanged.connect(self.updateSelection)
     self.updateSelection(mainwindow.hasSelection())
     ac.rhythm_double.triggered.connect(self.rhythm_double)
     ac.rhythm_halve.triggered.connect(self.rhythm_halve)
     ac.rhythm_dot.triggered.connect(self.rhythm_dot)
     ac.rhythm_undot.triggered.connect(self.rhythm_undot)
     ac.rhythm_remove_scaling.triggered.connect(self.rhythm_remove_scaling)
     ac.rhythm_remove_fraction_scaling.triggered.connect(
         self.rhythm_remove_fraction_scaling)
     ac.rhythm_remove.triggered.connect(self.rhythm_remove)
     ac.rhythm_implicit.triggered.connect(self.rhythm_implicit)
     ac.rhythm_implicit_per_line.triggered.connect(
         self.rhythm_implicit_per_line)
     ac.rhythm_explicit.triggered.connect(self.rhythm_explicit)
     ac.rhythm_apply.triggered.connect(self.rhythm_apply)
     ac.rhythm_copy.triggered.connect(self.rhythm_copy)
     ac.rhythm_paste.triggered.connect(self.rhythm_paste)
Exemplo n.º 51
0
 def slotShortcut(self):
     """Called when the user selects the Configure Shortcut action."""
     name = self.currentSnippet()
     if name:
         collection = self.parent().snippetActions
         action = actions.action(name, None, collection)
         mgr = actioncollectionmanager.manager(self.parent().mainwindow())
         if mgr.editAction(self, action, collection.defaults().get(name),
                           (collection, name)):
             collection.setShortcuts(name, action.shortcuts())
             self.treeView.update()
Exemplo n.º 52
0
    def __init__(self, mainwindow):
        self._import_job = None
        self._import_dialog = None
        self._import_file = ''
        self._mxml_dialog = None
        self._midi_dlg = None
        self._abc_dlg = None
        self.targets = {
            '.xml': ('.musicxml', self._mxml_dialog),
            '.mxl': ('.musicxml', self._mxml_dialog),
            '.midi': ('.midi', self._midi_dlg),
            '.mid': ('.midi', self._midi_dlg),
            '.abc': ('.abc', self._abc_dlg)
        }

        ac = self.actionCollection = Actions()
        actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
        ac.import_any.triggered.connect(self.import_any)
        ac.import_musicxml.triggered.connect(self.import_musicxml)
        ac.import_midi.triggered.connect(self.import_midi)
        ac.import_abc.triggered.connect(self.import_abc)
Exemplo n.º 53
0
    def __init__(self, mainwindow):
        self._import_job = None
        self._import_dialog = None
        self._import_file = ''
        self._mxml_dialog = None
        self._midi_dlg = None
        self._abc_dlg = None
        self.targets = {
            '.xml': ('.musicxml', self._mxml_dialog),
            '.mxl': ('.musicxml', self._mxml_dialog),
            '.midi': ('.midi', self._midi_dlg),
            '.mid': ('.midi', self._midi_dlg),
            '.abc': ('.abc', self._abc_dlg)
        }

        ac = self.actionCollection = Actions()
        actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
        ac.import_any.triggered.connect(self.import_any)
        ac.import_musicxml.triggered.connect(self.import_musicxml)
        ac.import_midi.triggered.connect(self.import_midi)
        ac.import_abc.triggered.connect(self.import_abc)
Exemplo n.º 54
0
 def editShortcut(self):
     """Edit our shortcut."""
     from widgets import shortcuteditdialog
     mainwindow = self.parent().mainwindow()
     action = QAction(self.defaultAction().icon(), self.defaultAction().text(), None)
     action.setShortcuts(self.actionCollection().shortcuts(self.objectName()) or [])
     default = self.actionCollection().defaults().get(self.objectName())
     mgr = actioncollectionmanager.manager(mainwindow)
     skip = (self.actionCollection(), self.objectName())
     cb = mgr.findShortcutConflict
     
     dlg = shortcuteditdialog.ShortcutEditDialog(self, cb, skip)
     if dlg.editAction(action, default):
         mgr.removeShortcuts(action.shortcuts())
         self.actionCollection().setShortcuts(self.objectName(), action.shortcuts())
Exemplo n.º 55
0
 def slotShortcut(self):
     """Called when the user selects the Configure Shortcut action."""
     from widgets import shortcuteditdialog
     name = self.currentSnippet()
     if name:
         collection = self.parent().snippetActions
         action = actions.action(name, None, collection)
         default = collection.defaults().get(name)
         mgr = actioncollectionmanager.manager(self.parent().mainwindow())
         cb = mgr.findShortcutConflict
         dlg = shortcuteditdialog.ShortcutEditDialog(self, cb, (collection, name))
         
         if dlg.editAction(action, default):
             mgr.removeShortcuts(action.shortcuts())
             collection.setShortcuts(name, action.shortcuts())
             self.treeView.update()
Exemplo n.º 56
0
 def createActions(self):
     self.actionCollection = Actions(self)
     actioncollectionmanager.manager(self.mainwindow()).addActionCollection(
         self.actionCollection)
Exemplo n.º 57
0
 def __init__(self, mainwindow):
     ac = self.actionCollection = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.fonts_document_fonts.triggered.connect(self.document_fonts)
Exemplo n.º 58
0
 def __init__(self, mainwindow):
     self.actionCollection = ac = Actions()
     actioncollectionmanager.manager(mainwindow).addActionCollection(ac)
     ac.rest_fmrest2spacer.triggered.connect(self.fmrest2spacer)
     ac.rest_spacer2fmrest.triggered.connect(self.spacer2fmrest)
     ac.rest_restcomm2rest.triggered.connect(self.restcomm2rest)