openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #30578
Re: [Merge] lp:~suutari-olli/openlp/bug-fixes-2-4-3 into lp:openlp
Review: Needs Fixing
Looks good, but just a little text fix...
Diff comments:
> === modified file 'openlp/core/__init__.py'
> --- openlp/core/__init__.py 2016-04-27 12:49:55 +0000
> +++ openlp/core/__init__.py 2016-10-17 04:44:46 +0000
> @@ -177,6 +177,40 @@
> self.shared_memory.create(1)
> return False
>
> + def is_data_path_missing(self):
> + """
> + Check if the data folder path exists.
> + """
> + data_folder_path = AppLocation.get_data_path()
> + if not os.path.exists(data_folder_path):
> + log.critical('Database was not found in: {path}'.format(path=data_folder_path))
> + status = QtWidgets.QMessageBox.critical(None, translate('OpenLP', 'Data Directory Error'),
> + translate('OpenLP', 'OpenLP data folder was not found in:\n\n{path}'
> + '\n\nThe location of the data folder was '
> + 'previously changed from the OpenLP\'s\n'
> + 'default location. If the data was stored on '
> + 'removable device, that device\nneeds to be '
> + 'made available.\n\n You may reset the data '
> + 'location back to the default settings, '
> + 'or you can try to make the current location '
> + 'available.\n\n Do you want to reset the '
> + 'default data location?\n\n Click "No" to close'
> + 'OpenLP so you can try to fix the the problem.'
> + '\n Click "Yes" to reset the default data '
You should insert the actual text from the qt-yes-button to avoid the button and text using differnt words.
> + 'location and start OpenLP.')
> + .format(path=data_folder_path),
> + QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes |
> + QtWidgets.QMessageBox.No),
> + QtWidgets.QMessageBox.No)
> + if status == QtWidgets.QMessageBox.No:
> + # If answer was "No", return "True", it will shutdown OpenLP in def main
> + log.info('User requested termination')
> + return True
> + # If answer was "Yes", remove the custom data path thus resetting the default location.
> + Settings().remove('advanced/data path')
> + log.info('Database location has been reset to the default settings.')
> + return False
> +
> def hook_exception(self, exc_type, value, traceback):
> """
> Add an exception hook so that any uncaught exceptions are displayed in this window rather than somewhere where
--
https://code.launchpad.net/~suutari-olli/openlp/bug-fixes-2-4-3/+merge/308596
Your team OpenLP Core is subscribed to branch lp:openlp.
References