Exemplo n.º 1
0
def slot_session_action(action):
    name = action.objectName()
    import sessions

    doc = sessions.loadSession(name) or app.openUrl(QUrl())
    w = mainwindow()
    w.setCurrentDocument(doc)
Exemplo n.º 2
0
def main():
    app = QApplication(sys.argv)
    mw = mainwindow()
    mw.show()

    # adw = addWindow()
    # adw.show()
    sys.exit(app.exec_())
Exemplo n.º 3
0
def edit_preferences():
    import preferences
    # TODO: make it possible to run Preferences without a Main Window.
    # Currently the Keyboard Shortcuts section needs the mainwindow to get
    # the current shortcuts.
    w = mainwindow()
    w.newDocument()
    preferences.PreferencesDialog(w).exec_()
Exemplo n.º 4
0
def file_open():
    filetypes = app.filetypes('.ly')
    caption = app.caption(_("dialog title", "Open File"))
    directory = app.basedir()
    files = QFileDialog.getOpenFileNames(None, caption, directory, filetypes)[0]
    if files:
        w = mainwindow()
        w.openUrls([QUrl.fromLocalFile(f) for f in files])
        if not app.documents:
            w.cleanStart()
Exemplo n.º 5
0
def file_open():
    filetypes = app.filetypes('.ly')
    caption = app.caption(_("dialog title", "Open File"))
    directory = app.basedir()
    files = QFileDialog.getOpenFileNames(None, caption, directory, filetypes)
    if files:
        w = mainwindow()
        docs = [w.openUrl(QUrl.fromLocalFile(f)) for f in files]
        if docs:
            w.setCurrentDocument(docs[-1])
Exemplo n.º 6
0
def file_open():
    filetypes = app.filetypes(".ly")
    caption = app.caption(_("dialog title", "Open File"))
    directory = app.basedir()
    files = QFileDialog.getOpenFileNames(None, caption, directory, filetypes)
    if files:
        w = mainwindow()
        docs = [w.openUrl(QUrl.fromLocalFile(f)) for f in files]
        if docs:
            w.setCurrentDocument(docs[-1])
Exemplo n.º 7
0
def slot_file_new_from_template_action(action):
    name = action.objectName()
    d = app.openUrl(QUrl())
    win = mainwindow()
    win.setCurrentDocument(d)
    from snippet import insert, snippets
    view = win.currentView()
    view.setFocus()
    insert.insert(name, view)
    d.setUndoRedoEnabled(False)
    d.setUndoRedoEnabled(True) # d.clearUndoRedoStacks() only in Qt >= 4.7
    d.setModified(False)
    if 'template-run' in snippets.get(name).variables:
        import engrave
        engrave.engraver(win).engrave('preview', d)
Exemplo n.º 8
0
def file_import_musicxml():
    w = mainwindow()
    w.newDocument()
    import file_import
    file_import.FileImport.instance(w).importMusicXML()
Exemplo n.º 9
0
def slot_file_open_recent_action(action):
    w = mainwindow()
    d = w.openUrl(action.url)
    if d:
        w.setCurrentDocument(d)
Exemplo n.º 10
0
def file_new_with_wizard():
    w = mainwindow()
    w.newDocument()
    import scorewiz
    scorewiz.ScoreWizard.instance(w).showDialog()
Exemplo n.º 11
0
def file_new():
    mainwindow().newDocument()
Exemplo n.º 12
0
def start_window():
    app = QtWidgets.QApplication(sys.argv)
    window = mainwindow()
    window.show()
    sys.exit(app.exec_())
Exemplo n.º 13
0
 def __init__(self):
     QtWidgets.QMainWindow.__init__(self)
     self.setupUi(self)
     self.openFileLogin.clicked.connect(self.loginOpenFile)
     self.mainWindow = mainwindow()
     self.newFileLogin.clicked.connect(self.loginNewFile)
Exemplo n.º 14
0
def slot_file_open_recent_action(action):
    url = action.url
    w = mainwindow()
    w.setCurrentDocument(w.openUrl(url))
Exemplo n.º 15
0
        self.saveData(data)
        self.textEdit.append(data)
        self.saveData(data)

    def saveFile(self):
        fileName = QFileDialog.getSaveFileName(self, self, "Save Data", "./",
                                               "Text(*.txt);;All(*.*)")
        file = open(fileName, 'w')
        file.write(self.textEdit_new.toPlainText())
        file.close()

    def formatData(self, getDepth=True):
        text = self.textEdit.toPlainText()
        dataList = text.split("<DateTime/>")
        for data in dataList:
            result = data[0, 32]
            elementList = data.split(",")
            if len(elementList) > 0:
                if getDepth == True:
                    posM = elementList.index("M")
                    if posM > 1:
                        depth = elementList[posM - 1]
                        result = result + "\n Depth : " + depth
            self.textEdit_new.append(result)


if __name__ == '__main__':
    app = QApplication(sys.argv)
    form = mainwindow()
    form.show()
    app.exec_()
Exemplo n.º 16
0
def slot_file_open_recent_action(action):
    url = action.url
    w = mainwindow()
    w.setCurrentDocument(w.openUrl(url))
Exemplo n.º 17
0
def slot_session_action(action):
    name = action.objectName()
    import sessions
    doc = sessions.loadSession(name) or app.openUrl(QUrl())
    w = mainwindow()
    w.setCurrentDocument(doc)
Exemplo n.º 18
0
#!/usr/bin/python3

import sys
from mainwindow import *

argCount = len(sys.argv)
mainwindow = MainWindow

if argCount != 2:
    print("Please provide a filename: 'vymthon filename.ext'")
elif argCount == 2:
    filepath = str(sys.argv[1])
    mainwindow = mainwindow(filepath)