Skip to content

Commit

Permalink
Merge pull request #147 from Yutsuten/fix-profile-selection
Browse files Browse the repository at this point in the history
Fix regression when opening the profile selection
  • Loading branch information
Yutsuten authored Aug 30, 2022
2 parents 0b0e53e + 44ba0c5 commit 82b40b7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def must_be_enabled(func):
def _wrapper(self, *args, **kwargs):
try:
config = self.config.get()
self.deck_config.get()
except AttributeError:
return None

Expand Down
14 changes: 10 additions & 4 deletions src/lifedrain.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Lifedrain:
"""

config = None
deck_config = None
deck_manager = None
status = {
'action': None, # Flag for bury, suspend, delete
Expand All @@ -34,7 +35,6 @@ class Lifedrain:

_qt = None
_mw = None
_dconfig = None
_timer = None

def __init__(self, make_timer, mw, qt):
Expand All @@ -48,9 +48,9 @@ def __init__(self, make_timer, mw, qt):
self._qt = qt
self._mw = mw
self.config = GlobalConf(mw)
self._dconfig = DeckConf(mw)
self.deck_config = DeckConf(mw)

self.deck_manager = DeckManager(mw, qt, self.config, self._dconfig)
self.deck_manager = DeckManager(mw, qt, self.config, self.deck_config)
self._timer = make_timer(
100, lambda: self.deck_manager.recover_life(False, 0.1), True)
self._timer.stop()
Expand Down Expand Up @@ -80,7 +80,12 @@ def deck_settings(self):
drain_enabled = self._timer.isActive()
self.toggle_drain(False)
settings.deck_settings(
self._qt, self._mw, self._dconfig, self.config, self.deck_manager)
self._qt,
self._mw,
self.deck_config,
self.config,
self.deck_manager,
)
self.toggle_drain(drain_enabled)
self.deck_manager.update()

Expand Down Expand Up @@ -150,6 +155,7 @@ def screen_change(self, state):

try:
config = self.config.get()
self.deck_config.get()
except AttributeError:
return
if not config['enable']:
Expand Down
2 changes: 1 addition & 1 deletion src/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
See the LICENCE file in the repository root for full licence text.
"""

VERSION = '2.6.0'
VERSION = '2.6.1'

0 comments on commit 82b40b7

Please sign in to comment.