Browse Source

restore lilypond file export

master
Nils 6 years ago
parent
commit
d79f878ecb
  1. 19
      qtgui/menu.py

19
qtgui/menu.py

@ -20,8 +20,16 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from PyQt5 import QtCore, QtGui, QtWidgets
#Standard Library Modules
import os.path
from pathlib import Path
#Third Party Modules
from PyQt5 import QtCore, QtGui, QtWidgets
#Template Modules
#Our modules
import engine.api as api
from midiinput.stepmidiinput import stepMidiInput #singleton instance
from .constantsAndConfigs import constantsAndConfigs
@ -460,16 +468,15 @@ class MenuActionDatabase(object):
self.mainWindow.ui.actionRedo.setText("Redo")
self.mainWindow.ui.actionRedo.setEnabled(False)
def exportLy(self):
filename = QtWidgets.QFileDialog.getSaveFileName(self.mainWindow, "Export Lilypond Source File", self.mainWindow.settings.value("last_export_dir"), "Lilypond Source (*.ly)")
def exportLy(self):
lastExportDirectory = api.session.guiSharedDataToSave["lastExportDirectory"] if "lastExportDirectory" in api.session.guiSharedDataToSave else str(Path.home())
filename = QtWidgets.QFileDialog.getSaveFileName(self.mainWindow, "Export Lilypond Source File", lastExportDirectory, "Lilypond Source (*.ly)")
filename = filename[0] #(path, filter)
if filename:
if not os.path.splitext(filename)[1]: #no file extension given?
filename = filename + ".ly"
self.mainWindow.settings.setValue("last_export_dir", os.path.dirname(filename))
api.session.guiSharedDataToSave["lastExportDirectory"] = os.path.dirname(filename)
api.exportLilypond(filename)
hier weiter machen. settings gibts nicht mehr. im backend speichern.
class ToolBarCCType(QtWidgets.QSpinBox):
def __init__(self, mainWindow):

Loading…
Cancel
Save