~tomasgroth/openlp/portable-path

« back to all changes in this revision

Viewing changes to openlp/plugins/songusage/songusageplugin.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  #
25
25
 
26
26
from PyQt5 import QtCore, QtWidgets
27
27
 
 
28
from openlp.core.state import State
28
29
from openlp.core.common.actions import ActionList
29
30
from openlp.core.common.i18n import translate
30
31
from openlp.core.common.registry import Registry
31
32
from openlp.core.common.settings import Settings
32
 
from openlp.core.lib import Plugin, StringContent
33
33
from openlp.core.lib.db import Manager
 
34
from openlp.core.lib.plugin import Plugin, StringContent
34
35
from openlp.core.lib.ui import create_action
35
36
from openlp.core.ui.icons import UiIcons
36
 
from openlp.plugins.songusage.forms import SongUsageDetailForm, SongUsageDeleteForm
 
37
from openlp.plugins.songusage.forms.songusagedetailform import SongUsageDetailForm
 
38
from openlp.plugins.songusage.forms.songusagedeleteform import SongUsageDeleteForm
37
39
from openlp.plugins.songusage.lib import upgrade
38
 
from openlp.plugins.songusage.lib.db import init_schema, SongUsageItem
 
40
from openlp.plugins.songusage.lib.db import SongUsageItem, init_schema
 
41
 
39
42
 
40
43
log = logging.getLogger(__name__)
41
44
 
66
69
        self.weight = -4
67
70
        self.icon = UiIcons().song_usage
68
71
        self.song_usage_active = False
 
72
        State().add_service('song_usage', self.weight, is_plugin=True)
 
73
        State().update_pre_conditions('song_usage', self.check_pre_conditions())
69
74
 
70
75
    def check_pre_conditions(self):
71
76
        """