Commit 8b131940 authored by SVN-Git Migration's avatar SVN-Git Migration

Imported Upstream version 2.17.2+ds1

parent 56e5df21
......@@ -2,6 +2,14 @@ ChangeLog of Frescobaldi, http://www.frescobaldi.org/
=====================================================
Changes in 2.17.2 -- January 16th, 2015
* Bugfixes:
- fix AttributeError: 'unicode' object has no attribute 'insert' (issue #543)
* Translations:
- updated: nl, fr, it
Changes in 2.17.1 -- December 26th, 2014
* Bugfixes:
......
......@@ -27,6 +27,9 @@ import weakref
from PyQt4.QtCore import QSettings, QTimer
from PyQt4.QtGui import QCompleter, QStringListModel
import qsettings # for safely retrieving list of strings
_models = {}
......@@ -106,10 +109,7 @@ class Model(QStringListModel):
self.load()
def load(self):
try:
strings = QSettings().value(self.key, [], type(""))
except TypeError:
strings = []
strings = qsettings.get_string_list(QSettings(), self.key)
self.setStringList(sorted(strings))
self._changed = False
......
......@@ -31,6 +31,7 @@ import weakref
from PyQt4.QtCore import QSettings, QUrl
import qsettings
import ly.lex
import lydocinfo
import lydocument
......@@ -158,20 +159,14 @@ class DocumentInfo(plugin.DocumentPlugin):
"""
# get the global include path
try:
include_path = QSettings().value("lilypond_settings/include_path", [], type(""))
except TypeError:
include_path = []
include_path = qsettings.get_string_list(
QSettings(), "lilypond_settings/include_path")
# get the session specific include path
import sessions
session_settings = sessions.currentSessionGroup()
if session_settings and session_settings.value("set-paths", False, bool):
try:
sess_path = session_settings.value("include-path", [], type(""))
except TypeError:
sess_path = []
sess_path = qsettings.get_string_list(session_settings, "include-path")
if session_settings.value("repl-paths", False, bool):
include_path = sess_path
else:
......
......@@ -79,7 +79,11 @@ class FileExport(plugin.MainWindowPlugin):
if not filename:
return False # cancelled
file = os.path.splitext(orgname)[0]
os.system('timidity "%s.midi" -Ow -o "%s.wav"' % (file, file))
if os.path.exists(file + '.midi'):
os.system('timidity "%s.midi" -Ow -o "%s.wav"' % (file, file))
else:
QMessageBox.critical(None, _("Error"),
_("The audio file couldn't be created. Please create midi file first"))
class Actions(actioncollection.ActionCollection):
......
......@@ -26,7 +26,7 @@ from __future__ import unicode_literals
# these variables are also used by the distutils setup
name = "frescobaldi"
version = "2.17.1"
version = "2.17.2"
description = "LilyPond Music Editor"
long_description = \
"Frescobaldi is an advanced text editor to edit LilyPond sheet music files. " \
......
......@@ -30,6 +30,7 @@ from PyQt4.QtCore import QSettings, QUrl
import app
import util
import signals
import qsettings
from . import documentation
......@@ -117,10 +118,7 @@ def urls():
are scanned.
"""
try:
user_paths = QSettings().value("documentation/paths", [], type(""))
except TypeError:
user_paths = []
user_paths = qsettings.get_string_list(QSettings(), "documentation/paths")
system_prefixes = [p for p in (
'/usr',
'/usr/local',
......
......@@ -131,7 +131,7 @@ class ParseSource():
so this need only cover other types of assignments.
"""
if isinstance(a.value(), ly.music.items.Markup):
pass
val = a.value().plaintext()
elif isinstance(a.value(), ly.music.items.String):
val = a.value().value()
elif isinstance(a.value(), ly.music.items.Scheme):
......
......@@ -46,7 +46,9 @@ def filenames_at_cursor(cursor, existing=True):
i = dinfo.lydocinfo().range(start, end)
fnames = i.include_args() or i.scheme_load_args()
if not fnames and cursor.hasSelection():
fnames = [cursor.selection().toPlainText()]
text = cursor.selection().toPlainText()
if '\n' not in text.strip():
fnames = [text]
# determine search path: doc dir and other include path names
filename = cursor.document().url().toLocalFile()
......
No preview for this file type
This diff is collapsed.
No preview for this file type
This diff is collapsed.
No preview for this file type
This diff is collapsed.
No preview for this file type
This diff is collapsed.
This diff is collapsed.
No preview for this file type
This diff is collapsed.
No preview for this file type
This diff is collapsed.
No preview for this file type
This diff is collapsed.
No preview for this file type
This diff is collapsed.
This diff is collapsed.
No preview for this file type
This diff is collapsed.
No preview for this file type
This diff is collapsed.
No preview for this file type
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -36,6 +36,7 @@ import widgets.dialog
import lilydoc
import userguide
import language_names
import qsettings
class Documentation(preferences.GroupsPage):
......@@ -70,10 +71,7 @@ class Paths(preferences.Group):
self.paths.setWhatsThis(userguide.html("prefs_lilydoc"))
def loadSettings(self):
try:
paths = QSettings().value("documentation/paths", [], type(""))
except TypeError:
paths = []
paths = qsettings.get_string_list(QSettings(), "documentation/paths")
self.paths.setValue(paths)
def saveSettings(self):
......
......@@ -35,6 +35,7 @@ import util
import icons
import preferences
import lilypondinfo
import qsettings
import widgets.listedit
import widgets.urlrequester
......@@ -303,10 +304,7 @@ class Running(preferences.Group):
self.saveDocument.setChecked(s.value("save_on_run", False, bool))
self.deleteFiles.setChecked(s.value("delete_intermediate_files", True, bool))
self.noTranslation.setChecked(s.value("no_translation", False, bool))
try:
include_path = s.value("include_path", [], type(""))
except TypeError:
include_path = []
include_path = qsettings.get_string_list(s, "include_path")
self.include.setValue(include_path)
def saveSettings(self):
......
......@@ -29,6 +29,7 @@ from PyQt4.QtGui import *
import app
import widgets.listedit
import preferences
import qsettings
class Paths(preferences.GroupsPage):
......@@ -61,10 +62,7 @@ class HyphenPaths(preferences.Group):
def loadSettings(self):
s = QSettings()
s.beginGroup("hyphenation")
try:
paths = s.value("paths", [], type(""))
except TypeError:
paths = []
paths = qsettings.get_string_list(s, "paths")
self.listedit.setValue(paths)
def saveSettings(self):
......
# qsettings.py -- utility functions related to QSettings
#
# Copyright (c) 2014 - 2014 by Wilbert Berendsen
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# See http://www.gnu.org/licenses/ for more information.
"""
Generic helper functions regarding QSettings
"""
from __future__ import unicode_literals
def get_string_list(settings, key):
"""Makes sure a list of strings is returned for the key.
You can write the value with settings.setValue(key, ['bla', 'bla',]), but
when you need to read the value with settings.value(key, [], str), things
go wrong when an empty list was stored. So please use this function when
reading a list of strings from QSettings.
"""
try:
value = settings.value(key, [], type(""))
except TypeError:
value = []
else:
if not isinstance(value, list):
if not value:
value = []
else:
value = [value]
return value
......@@ -36,6 +36,7 @@ import app
import widgets.listedit
import widgets.urlrequester
import sessions.manager
import qsettings
import userguide
......@@ -272,11 +273,7 @@ class SessionEditor(QDialog):
settings = sessions.sessionGroup(name)
self.autosave.setChecked(settings.value("autosave", True, bool))
self.basedir.setPath(settings.value("basedir", "", type("")))
try:
paths = settings.value("include-path", [], type(""))
except TypeError:
paths = []
self.include.setValue(paths)
self.include.setValue(qsettings.get_string_list(settings, "include-path"))
self.inclPaths.setChecked(settings.value("set-paths", False, bool))
self.replPaths.setChecked(settings.value("repl-paths", False, bool))
if not self.replPaths.isChecked():
......@@ -286,12 +283,8 @@ class SessionEditor(QDialog):
def fetchGenPaths(self):
"""Fetch paths from general preferences."""
s = QSettings()
s.beginGroup("lilypond_settings")
try:
return s.value("include_path", [], type(""))
except TypeError:
return []
return qsettings.get_string_list(QSettings(),
"lilypond_settings/include_path")
def addDisabledGenPaths(self):
"""Add global paths, but set as disabled."""
......
=== Experimental Features ===
Some features of Frescobaldi are in development for quite some time before
they are considered ready for general use. To be able to take advantage of
those features, knowing their limitations, you can select the option *Enable
Experimental Features*, in the {prefs_general}.
In most cases you need to restart Frescobaldi or create a new window
(via {menu_window_new}) to see the new menu options.
This is the list of experimental features in Frescobaldi:
* {export_audio} Export audio (converts MIDI to WAV)
* {export_musicxml} Convert LilyPond source to MusicXML (without using LilyPond)
* {object_editor} Edit properties of objects in LilyPond output
* Editing items in the SVG view
#VARS
export_audio menu file -> submenu title|&Export -> Export Audio...
export_musicxml menu file -> submenu title|&Export -> Export Music&XML...
object_editor menu tools -> Object Editor
prefs_general help prefs_general
menu_window_new menu window -> New &Window
=== Exporting files ===
#SUBDOCS
musicxml_export
=== Modal transpose ===
Use the modal transpose if you want the notes to be kept within a given scale or key.
Enter the number of steps you want to transpose followed by the given scale.
E.g. when transposing a major second upwards in the key of C major, you would enter:
```lilypond
1 C
```
Note that if some of the original pitches are outside the given key the relation
will be kept and the pitches will not be adjusted to the key. Hence you can't
use this functionality to shift between different keys.
But a special trick would be to use modal transpose and (chromatic) transpose in combination:
You would then make use of the fact that different modes have the same set of pitches.
If we take the example above which moves the music upwards a major second in the key of C major,
and then use the regular non-modal transpose `d c` to move the music downwards to its
original position; we have in effect shifted the music from C major to C dorian.
=== Export Music XML ===
Convert LilyPond source to MusicXML (without using LilyPond).
You can use the MusicXML-file to export to other applications.
This feature is currently experimental, see {experimental}.
#SEEALSO
musicxml_import
#VARS
experimental help experimental_features
......@@ -3,6 +3,9 @@
In the Preferences Dialog (under {menu_edit_preferences}) you can configure
many aspects of Frescobaldi and LilyPond.
#VARS
menu_edit_preferences menu edit -> Pr&eferences...
#SUBDOCS
prefs_general
prefs_lilypond
......@@ -15,3 +18,5 @@ prefs_editor
prefs_fontscolors
prefs_tools
#SEEALSO
experimental_features
......@@ -26,6 +26,10 @@ Under *Creating new documents*, you can choose what to do when a new document
is created. It can be left empty (the default), the current LilyPond version
can be set to it, or you can choose any of the templates you defined.
Under *Experimental Features*, you can choose whether to enable features that
are in development and are not yet considered complete.
See {experimental}.
#VARS
sessions help sessions
experimental help experimental_features
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment