Skip to content

Instantly share code, notes, and snippets.

/.py Secret

Created October 11, 2016 00:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/10c11792c0b37ec3693bf9494017a3aa to your computer and use it in GitHub Desktop.
Save anonymous/10c11792c0b37ec3693bf9494017a3aa to your computer and use it in GitHub Desktop.
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