~tomasgroth/openlp/portable-path

« back to all changes in this revision

Viewing changes to openlp/plugins/images/imageplugin.py

  • Committer: Tomas Groth
  • Date: 2019-04-30 19:02:42 UTC
  • mfrom: (2829.2.32 openlp)
  • Revision ID: tomasgroth@yahoo.dk-20190430190242-6zwjk8724tyux70m
trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
###############################################################################
5
5
# OpenLP - Open Source Lyrics Projection                                      #
6
6
# --------------------------------------------------------------------------- #
7
 
# Copyright (c) 2008-2018 OpenLP Developers                                   #
 
7
# Copyright (c) 2008-2019 OpenLP Developers                                   #
8
8
# --------------------------------------------------------------------------- #
9
9
# This program is free software; you can redistribute it and/or modify it     #
10
10
# under the terms of the GNU General Public License as published by the Free  #
24
24
 
25
25
from PyQt5 import QtGui
26
26
 
 
27
from openlp.core.state import State
27
28
from openlp.core.api.http import register_endpoint
28
29
from openlp.core.common.i18n import translate
29
 
from openlp.core.ui.icons import UiIcons
30
30
from openlp.core.common.settings import Settings
31
 
from openlp.core.lib import Plugin, StringContent, ImageSource, build_icon
 
31
from openlp.core.lib import ImageSource, build_icon
32
32
from openlp.core.lib.db import Manager
 
33
from openlp.core.lib.plugin import Plugin, StringContent
 
34
from openlp.core.ui.icons import UiIcons
33
35
from openlp.plugins.images.endpoint import api_images_endpoint, images_endpoint
34
 
from openlp.plugins.images.lib import ImageMediaItem, ImageTab, upgrade
 
36
from openlp.plugins.images.lib import upgrade
 
37
from openlp.plugins.images.lib.mediaitem import ImageMediaItem
 
38
from openlp.plugins.images.lib.imagetab import ImageTab
35
39
from openlp.plugins.images.lib.db import init_schema
36
40
 
 
41
 
37
42
log = logging.getLogger(__name__)
38
43
 
39
44
__default_settings__ = {
58
63
        self.icon = build_icon(self.icon_path)
59
64
        register_endpoint(images_endpoint)
60
65
        register_endpoint(api_images_endpoint)
 
66
        State().add_service('image', self.weight, is_plugin=True)
 
67
        State().update_pre_conditions('image', self.check_pre_conditions())
61
68
 
62
69
    @staticmethod
63
70
    def about():