forked from openlp/openlp
Head r1304
This commit is contained in:
commit
a42f71aad5
@ -405,8 +405,8 @@ class ThemeManager(QtGui.QWidget):
|
|||||||
files = QtGui.QFileDialog.getOpenFileNames(self,
|
files = QtGui.QFileDialog.getOpenFileNames(self,
|
||||||
translate('OpenLP.ThemeManager', 'Select Theme Import File'),
|
translate('OpenLP.ThemeManager', 'Select Theme Import File'),
|
||||||
SettingsManager.get_last_dir(self.settingsSection),
|
SettingsManager.get_last_dir(self.settingsSection),
|
||||||
unicode(translate('OpenLP.ThemeManager', 'Theme v1 (*.theme);;'
|
unicode(translate('OpenLP.ThemeManager',
|
||||||
'Theme v2 (*.otz);;%s (*.*)')) % UiStrings.AllFiles)
|
'OpenLP Themes (*.theme *.otz)')))
|
||||||
log.info(u'New Themes %s', unicode(files))
|
log.info(u'New Themes %s', unicode(files))
|
||||||
if files:
|
if files:
|
||||||
for file in files:
|
for file in files:
|
||||||
|
@ -164,27 +164,34 @@ def _get_os_dir_path(dir_type):
|
|||||||
"""
|
"""
|
||||||
Return a path based on which OS and environment we are running in.
|
Return a path based on which OS and environment we are running in.
|
||||||
"""
|
"""
|
||||||
|
encoding = sys.getfilesystemencoding()
|
||||||
if sys.platform == u'win32':
|
if sys.platform == u'win32':
|
||||||
if dir_type == AppLocation.DataDir:
|
if dir_type == AppLocation.DataDir:
|
||||||
return os.path.join(os.getenv(u'APPDATA'), u'openlp', u'data')
|
return os.path.join(unicode(os.getenv(u'APPDATA'), encoding),
|
||||||
return os.path.join(os.getenv(u'APPDATA'), u'openlp')
|
u'openlp', u'data')
|
||||||
|
return os.path.join(unicode(os.getenv(u'APPDATA'), encoding),
|
||||||
|
u'openlp')
|
||||||
elif sys.platform == u'darwin':
|
elif sys.platform == u'darwin':
|
||||||
if dir_type == AppLocation.DataDir:
|
if dir_type == AppLocation.DataDir:
|
||||||
return os.path.join(os.getenv(u'HOME'), u'Library',
|
return os.path.join(unicode(os.getenv(u'HOME'), encoding),
|
||||||
u'Application Support', u'openlp', u'Data')
|
u'Library', u'Application Support', u'openlp', u'Data')
|
||||||
return os.path.join(os.getenv(u'HOME'), u'Library',
|
return os.path.join(unicode(os.getenv(u'HOME'), encoding),
|
||||||
u'Application Support', u'openlp')
|
u'Library', u'Application Support', u'openlp')
|
||||||
else:
|
else:
|
||||||
if XDG_BASE_AVAILABLE:
|
if XDG_BASE_AVAILABLE:
|
||||||
if dir_type == AppLocation.ConfigDir:
|
if dir_type == AppLocation.ConfigDir:
|
||||||
return os.path.join(BaseDirectory.xdg_config_home, u'openlp')
|
return os.path.join(unicode(BaseDirectory.xdg_config_home,
|
||||||
|
encoding), u'openlp')
|
||||||
elif dir_type == AppLocation.DataDir:
|
elif dir_type == AppLocation.DataDir:
|
||||||
return os.path.join(BaseDirectory.xdg_data_home, u'openlp')
|
return os.path.join(
|
||||||
|
unicode(BaseDirectory.xdg_data_home, encoding), u'openlp')
|
||||||
elif dir_type == AppLocation.CacheDir:
|
elif dir_type == AppLocation.CacheDir:
|
||||||
return os.path.join(BaseDirectory.xdg_cache_home, u'openlp')
|
return os.path.join(unicode(BaseDirectory.xdg_cache_home,
|
||||||
|
encoding), u'openlp')
|
||||||
if dir_type == AppLocation.DataDir:
|
if dir_type == AppLocation.DataDir:
|
||||||
return os.path.join(os.getenv(u'HOME'), u'.openlp', u'data')
|
return os.path.join(unicode(os.getenv(u'HOME'), encoding),
|
||||||
return os.path.join(os.getenv(u'HOME'), u'.openlp')
|
u'.openlp', u'data')
|
||||||
|
return os.path.join(unicode(os.getenv(u'HOME'), encoding), u'.openlp')
|
||||||
|
|
||||||
def _get_frozen_path(frozen_option, non_frozen_option):
|
def _get_frozen_path(frozen_option, non_frozen_option):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user