~alisonken1/openlp/pjlink2-i

« back to all changes in this revision

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

  • Committer: Tim Bentley
  • Author(s): Phill
  • Date: 2017-08-11 20:31:09 UTC
  • mfrom: (2754.1.11 pathlib2)
  • Revision ID: tim.bentley@gmail.com-20170811203109-0idjanfltutf8n38
Definitely ready for merging, unless, of course you guys find some more issues!

Part 2

Changed the pathedit widget over to using pathlib
Added a 'patched' file dialog
Added a few utility methods

lp:~phill-ridout/openlp/pathlib2 (revision 2763)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/2125/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/2033/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1938/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Code_Analysis...

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
The general tab of the configuration dialog.
24
24
"""
25
25
import logging
 
26
from pathlib import Path
26
27
 
27
28
from PyQt5 import QtCore, QtGui, QtWidgets
28
29
 
29
30
from openlp.core.common import Registry, Settings, UiStrings, translate, get_images_filter
 
31
from openlp.core.common.path import path_to_str, str_to_path
30
32
from openlp.core.lib import SettingsTab, ScreenList
31
33
from openlp.core.ui.lib import ColorButton, PathEdit
32
34
 
172
174
        self.logo_layout.setObjectName('logo_layout')
173
175
        self.logo_file_label = QtWidgets.QLabel(self.logo_group_box)
174
176
        self.logo_file_label.setObjectName('logo_file_label')
175
 
        self.logo_file_path_edit = PathEdit(self.logo_group_box, default_path=':/graphics/openlp-splash-screen.png')
 
177
        self.logo_file_path_edit = PathEdit(self.logo_group_box,
 
178
                                            default_path=Path(':/graphics/openlp-splash-screen.png'))
176
179
        self.logo_layout.addRow(self.logo_file_label, self.logo_file_path_edit)
177
180
        self.logo_color_label = QtWidgets.QLabel(self.logo_group_box)
178
181
        self.logo_color_label.setObjectName('logo_color_label')
266
269
        self.audio_group_box.setTitle(translate('OpenLP.GeneralTab', 'Background Audio'))
267
270
        self.start_paused_check_box.setText(translate('OpenLP.GeneralTab', 'Start background audio paused'))
268
271
        self.repeat_list_check_box.setText(translate('OpenLP.GeneralTab', 'Repeat track list'))
269
 
        self.logo_file_path_edit.dialog_caption = dialog_caption = translate('OpenLP.AdvancedTab', 'Select Logo File')
 
272
        self.logo_file_path_edit.dialog_caption = translate('OpenLP.AdvancedTab', 'Select Logo File')
270
273
        self.logo_file_path_edit.filters = '{text};;{names} (*)'.format(
271
274
            text=get_images_filter(), names=UiStrings().AllFiles)
272
275
 
291
294
        self.auto_open_check_box.setChecked(settings.value('auto open'))
292
295
        self.show_splash_check_box.setChecked(settings.value('show splash'))
293
296
        self.logo_background_color = settings.value('logo background color')
294
 
        self.logo_file_path_edit.path = settings.value('logo file')
 
297
        self.logo_file_path_edit.path = str_to_path(settings.value('logo file'))
295
298
        self.logo_hide_on_startup_check_box.setChecked(settings.value('logo hide on startup'))
296
299
        self.logo_color_button.color = self.logo_background_color
297
300
        self.check_for_updates_check_box.setChecked(settings.value('update check'))
325
328
        settings.setValue('auto open', self.auto_open_check_box.isChecked())
326
329
        settings.setValue('show splash', self.show_splash_check_box.isChecked())
327
330
        settings.setValue('logo background color', self.logo_background_color)
328
 
        settings.setValue('logo file', self.logo_file_path_edit.path)
 
331
        settings.setValue('logo file', path_to_str(self.logo_file_path_edit.path))
329
332
        settings.setValue('logo hide on startup', self.logo_hide_on_startup_check_box.isChecked())
330
333
        settings.setValue('update check', self.check_for_updates_check_box.isChecked())
331
334
        settings.setValue('save prompt', self.save_check_service_check_box.isChecked())