~raoul-snyman/openlp/fix-retvalue

« back to all changes in this revision

Viewing changes to openlp/core/ui/advancedtab.py

  • Committer: Raoul Snyman
  • Author(s): alisonken1 at gmail
  • Date: 2016-05-20 20:52:22 UTC
  • mfrom: (2665.1.2 strings-core-ui)
  • Revision ID: raoul@snyman.info-20160520205222-s3s2cts9wnaq8ri8
"- Convert strings in openlp/core/ui files
- Updated projectordb test

--------------------------------
lp:~alisonken1/openlp/strings-core-ui (revision 2667)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/1566/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/1477/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1415/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Windows_Functional_Tests/1195/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Windows_Interface_Tests/78..."

Show diffs side-by-side

added added

removed removed

Lines of Context:
308
308
        self.service_name_label.setText(translate('OpenLP.AdvancedTab', 'Name:'))
309
309
        self.service_name_edit.setToolTip(translate('OpenLP.AdvancedTab', 'Consult the OpenLP manual for usage.'))
310
310
        self.service_name_revert_button.setToolTip(
311
 
            translate('OpenLP.AdvancedTab', 'Revert to the default service name "%s".') %
312
 
            UiStrings().DefaultServiceName)
 
311
            translate('OpenLP.AdvancedTab',
 
312
                      'Revert to the default service name "{name}".').format(name=UiStrings().DefaultServiceName))
313
313
        self.service_name_example_label.setText(translate('OpenLP.AdvancedTab', 'Example:'))
314
314
        self.hide_mouse_group_box.setTitle(translate('OpenLP.AdvancedTab', 'Mouse Cursor'))
315
315
        self.hide_mouse_check_box.setText(translate('OpenLP.AdvancedTab', 'Hide mouse cursor when over display window'))
391
391
        # Since data location can be changed, make sure the path is present.
392
392
        self.current_data_path = AppLocation.get_data_path()
393
393
        if not os.path.exists(self.current_data_path):
394
 
            log.error('Data path not found %s' % self.current_data_path)
 
394
            log.error('Data path not found {path}'.format(path=self.current_data_path))
395
395
            answer = QtWidgets.QMessageBox.critical(
396
396
                self, translate('OpenLP.AdvancedTab', 'Data Directory Error'),
397
 
                translate('OpenLP.AdvancedTab', 'OpenLP data directory was not found\n\n%s\n\n'
 
397
                translate('OpenLP.AdvancedTab', 'OpenLP data directory was not found\n\n{path}\n\n'
398
398
                          'This data directory was previously changed from the OpenLP '
399
399
                          'default location.  If the new location was on removable '
400
400
                          'media, that media needs to be made available.\n\n'
401
401
                          'Click "No" to stop loading OpenLP. allowing you to fix the the problem.\n\n'
402
402
                          'Click "Yes" to reset the data directory to the default '
403
 
                          'location.').replace('%s', self.current_data_path),
 
403
                          'location.').format(path=self.current_data_path),
404
404
                QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No),
405
405
                QtWidgets.QMessageBox.No)
406
406
            if answer == QtWidgets.QMessageBox.No:
410
410
            # Set data location to default.
411
411
            settings.remove('advanced/data path')
412
412
            self.current_data_path = AppLocation.get_data_path()
413
 
            log.warning('User requested data path set to default %s' % self.current_data_path)
 
413
            log.warning('User requested data path set to default {path}'.format(path=self.current_data_path))
414
414
        self.data_directory_label.setText(os.path.abspath(self.current_data_path))
415
415
        # Don't allow data directory move if running portable.
416
416
        if settings.value('advanced/is portable'):
542
542
        # Make sure they want to change the data.
543
543
        answer = QtWidgets.QMessageBox.question(self, translate('OpenLP.AdvancedTab', 'Confirm Data Directory Change'),
544
544
                                                translate('OpenLP.AdvancedTab', 'Are you sure you want to change the '
545
 
                                                          'location of the OpenLP data directory to:\n\n%s\n\nThe data '
546
 
                                                          'directory will be changed when OpenLP is closed.').
547
 
                                                replace('%s', new_data_path),
 
545
                                                          'location of the OpenLP data directory to:\n\n{path}'
 
546
                                                          '\n\nThe data directory will be changed when OpenLP is '
 
547
                                                          'closed.').format(path=new_data_path),
548
548
                                                QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes |
549
549
                                                                                      QtWidgets.QMessageBox.No),
550
550
                                                QtWidgets.QMessageBox.No)
608
608
            answer = QtWidgets.QMessageBox.warning(self,
609
609
                                                   translate('OpenLP.AdvancedTab', 'Overwrite Existing Data'),
610
610
                                                   translate('OpenLP.AdvancedTab',
611
 
                                                             'WARNING: \n\nThe location you have selected \n\n%s\n\n'
612
 
                                                             'appears to contain OpenLP data files. Do you wish to '
613
 
                                                             'replace these files with the current data files?').
614
 
                                                   replace('%s', os.path.abspath(data_path,)),
 
611
                                                             'WARNING: \n\nThe location you have selected \n\n{path}'
 
612
                                                             '\n\nappears to contain OpenLP data files. Do you wish to '
 
613
                                                             'replace these files with the current data '
 
614
                                                             'files?').format(path=os.path.abspath(data_path,)),
615
615
                                                   QtWidgets.QMessageBox.StandardButtons(QtWidgets.QMessageBox.Yes |
616
616
                                                                                         QtWidgets.QMessageBox.No),
617
617
                                                   QtWidgets.QMessageBox.No)