forked from openlp/openlp
fixed setting import
This commit is contained in:
parent
cbd22b7141
commit
0a57bed2f7
|
@ -136,7 +136,9 @@ class Settings(QtCore.QSettings):
|
||||||
**Note**, this method only converts a few types and might need to be
|
**Note**, this method only converts a few types and might need to be
|
||||||
extended if a certain type is missing!
|
extended if a certain type is missing!
|
||||||
"""
|
"""
|
||||||
# Check for none as u'' is passed as default and is valid!
|
# Check for none as u'' is passed as default and is valid! This is
|
||||||
|
# needed because the settings export does not know the default values,
|
||||||
|
# thus just passes None.
|
||||||
if defaultValue is None and not super(Settings, self).contains(key):
|
if defaultValue is None and not super(Settings, self).contains(key):
|
||||||
return None
|
return None
|
||||||
setting = super(Settings, self).value(key, defaultValue)
|
setting = super(Settings, self).value(key, defaultValue)
|
||||||
|
|
|
@ -1000,8 +1000,9 @@ class MainWindow(QtGui.QMainWindow, Ui_MainWindow):
|
||||||
return
|
return
|
||||||
# We have a good file, import it.
|
# We have a good file, import it.
|
||||||
for section_key in import_keys:
|
for section_key in import_keys:
|
||||||
value = import_settings.value(section_key)
|
value = import_settings.value(section_key, None)
|
||||||
settings.setValue(u'%s' % (section_key), value)
|
if value is not None:
|
||||||
|
settings.setValue(u'%s' % (section_key), value)
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
settings.beginGroup(self.headerSection)
|
settings.beginGroup(self.headerSection)
|
||||||
settings.setValue(u'file_imported', import_file_name)
|
settings.setValue(u'file_imported', import_file_name)
|
||||||
|
|
|
@ -497,10 +497,8 @@ def locale_compare(string1, string2):
|
||||||
is equal to it. Comparison is case insensitive.
|
is equal to it. Comparison is case insensitive.
|
||||||
"""
|
"""
|
||||||
# Function locale.strcoll() from standard Python library does not work
|
# Function locale.strcoll() from standard Python library does not work
|
||||||
# properly on Windows and probably somewhere else.
|
# properly on Windows.
|
||||||
return locale.strcoll(string1.lower(), string2.lower())
|
return locale.strcoll(string1.lower(), string2.lower())
|
||||||
# TODO: check code
|
|
||||||
#return QtCore.QString.localeAwareCompare(string1.lower(), string2.lower())
|
|
||||||
|
|
||||||
|
|
||||||
# For performance reasons provide direct reference to compare function
|
# For performance reasons provide direct reference to compare function
|
||||||
|
|
|
@ -213,11 +213,11 @@ class ActionList(object):
|
||||||
empty ``objectName``.
|
empty ``objectName``.
|
||||||
|
|
||||||
``category``
|
``category``
|
||||||
The category this action belongs to. The category can be a QString
|
The category this action belongs to. The category has to be a python
|
||||||
or python unicode string. **Note**, if the category is ``None``, the
|
string. . **Note**, if the category is ``None``, the category and
|
||||||
category and its actions are being hidden in the shortcut dialog.
|
its actions are being hidden in the shortcut dialog. However, if
|
||||||
However, if they are added, it is possible to avoid assigning
|
they are added, it is possible to avoid assigning shortcuts twice,
|
||||||
shortcuts twice, which is important.
|
which is important.
|
||||||
|
|
||||||
``weight``
|
``weight``
|
||||||
The weight specifies how important a category is. However, this only
|
The weight specifies how important a category is. However, this only
|
||||||
|
|
Loading…
Reference in New Issue