Skip to content

Instantly share code, notes, and snippets.

/.py Secret
Created Oct 11, 2016

Embed
What would you like to do?
This code fixes the issue, but I can't make it work with
QtWidgets.QMessageBox.No/Yes.
\openlp\core\common\applocation.py
@staticmethod
def get_data_path():
"""
Return the path OpenLP stores all its data under.
"""
from openlp.core.lib.ui import critical_error_message_box
from openlp.core.common import AppLocation, Settings, translate
# Check if we have a different data location.
if Settings().contains('advanced/data path'):
path = Settings().value('advanced/data path')
if not os.path.exists(path):
critical_error_message_box(translate('OpenLP.Manager', 'Database Error'),
translate('OpenLP.Manager',
'OpenLP cannot load your database.\n\nDatabase:'))
Settings().remove('advanced/data path')
path = AppLocation.get_directory(AppLocation.DataDir)
check_directory_exists(path)
else:
path = AppLocation.get_directory(AppLocation.DataDir)
check_directory_exists(path)
return os.path.normpath(path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.