~alisonken1/openlp/pjlink2-i

« back to all changes in this revision

Viewing changes to openlp/core/ui/themeform.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:
28
28
from PyQt5 import QtCore, QtGui, QtWidgets
29
29
 
30
30
from openlp.core.common import Registry, RegistryProperties, UiStrings, translate, get_images_filter, is_not_image_file
 
31
from openlp.core.common.path import path_to_str, str_to_path
31
32
from openlp.core.lib.theme import BackgroundType, BackgroundGradientType
32
33
from openlp.core.lib.ui import critical_error_message_box
33
34
from openlp.core.ui import ThemeLayoutForm
316
317
            self.setField('background_type', 1)
317
318
        elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Image):
318
319
            self.image_color_button.color = self.theme.background_border_color
319
 
            self.image_path_edit.path = self.theme.background_filename
 
320
            self.image_path_edit.path = str_to_path(self.theme.background_filename)
320
321
            self.setField('background_type', 2)
321
322
        elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Video):
322
323
            self.video_color_button.color = self.theme.background_border_color
323
 
            self.video_path_edit.path = self.theme.background_filename
 
324
            self.video_path_edit.path = str_to_path(self.theme.background_filename)
324
325
            self.setField('background_type', 4)
325
326
        elif self.theme.background_type == BackgroundType.to_string(BackgroundType.Transparent):
326
327
            self.setField('background_type', 3)
448
449
        """
449
450
        self.theme.background_end_color = color
450
451
 
451
 
    def on_image_path_edit_path_changed(self, filename):
 
452
    def on_image_path_edit_path_changed(self, file_path):
452
453
        """
453
454
        Background Image button pushed.
454
455
        """
455
 
        self.theme.background_filename = filename
 
456
        self.theme.background_filename = path_to_str(file_path)
456
457
        self.set_background_page_values()
457
458
 
458
 
    def on_video_path_edit_path_changed(self, filename):
 
459
    def on_video_path_edit_path_changed(self, file_path):
459
460
        """
460
461
        Background video button pushed.
461
462
        """
462
 
        self.theme.background_filename = filename
 
463
        self.theme.background_filename = path_to_str(file_path)
463
464
        self.set_background_page_values()
464
465
 
465
466
    def on_main_color_changed(self, color):