From eb58ee10e87a18f9cdd2d32d9c2f433a0c97b610 Mon Sep 17 00:00:00 2001 From: Stevan Pettit Date: Mon, 14 May 2012 23:17:20 -0400 Subject: [PATCH] Changed name of settings INI to conform to PortableApps Standards Disabled data path change when running portable --- openlp/core/__init__.py | 3 ++- openlp/core/ui/advancedtab.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/openlp/core/__init__.py b/openlp/core/__init__.py index d5cdeb198..efbe40bab 100644 --- a/openlp/core/__init__.py +++ b/openlp/core/__init__.py @@ -264,7 +264,7 @@ def main(args=None): # Get location OpenLPPortable.ini app_path = AppLocation.get_directory(AppLocation.AppDir) portable_settings_file = os.path.abspath(os.path.join(app_path, u'..', - u'..', u'Data', u'settings', u'OpenLPPortable.ini')) + u'..', u'Data', u'settings', u'OpenLP.ini')) # Make this our settings file log.info(u'INI file: %s' % portable_settings_file) Settings.setFilename(portable_settings_file) @@ -275,6 +275,7 @@ def main(args=None): log.info(u'Data path: %s' % data_path) # Point to our data path portable_settings.setValue(u'advanced/data path',data_path) + portable_settings.setValue(u'advanced/is portable',True) portable_settings.sync() else: app.setApplicationName(u'OpenLP') diff --git a/openlp/core/ui/advancedtab.py b/openlp/core/ui/advancedtab.py index 21cb42a7e..58be29126 100644 --- a/openlp/core/ui/advancedtab.py +++ b/openlp/core/ui/advancedtab.py @@ -543,6 +543,9 @@ class AdvancedTab(SettingsTab): os.path.join(self.currentDataPath, u'..'))) self.defaultColorButton.setStyleSheet( u'background-color: %s' % self.defaultColor) + # Don't allow data directory change if running portable + if Settings().contains(u'advanced/is portable'): + self.dataDirectoryGroupBox.hide() def save(self): """