Skip to content

Commit

Permalink
fix:homescreen app
Browse files Browse the repository at this point in the history
use the new decorator to ensure app drawer is populated
  • Loading branch information
JarbasAl committed Nov 14, 2024
1 parent 41687b1 commit 3aa4d11
Show file tree
Hide file tree
Showing 86 changed files with 8 additions and 33 deletions.
21 changes: 7 additions & 14 deletions ovos_plugin_common_play/ocp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
import time
from os.path import join, dirname, isfile
from threading import Event, Lock
from os.path import join, dirname
from typing import Optional, List
from ovos_config import Configuration
from ovos_plugin_common_play.ocp.gui import OCPMediaPlayerGUI
from ovos_plugin_common_play.ocp.player import OCPMediaPlayer
from ovos_utils.gui import can_use_gui

from ovos_plugin_manager.ocp import load_stream_extractors
from ovos_utils.log import LOG
from ovos_utils.messagebus import Message

from padacioso import IntentContainer

from ovos_workshop.app import OVOSAbstractApplication
from ovos_workshop.decorators.ocp import *
from ovos_plugin_manager.ocp import load_stream_extractors
from ovos_workshop.decorators import homescreen_app

from ovos_plugin_common_play.ocp.constants import OCP_ID
from ovos_plugin_common_play.ocp.gui import OCPMediaPlayerGUI
from ovos_plugin_common_play.ocp.player import OCPMediaPlayer


class OCP(OVOSAbstractApplication):
Expand Down Expand Up @@ -79,14 +73,13 @@ def handle_get_SEIs(self, message):
xtract = load_stream_extractors() # @lru_cache, its a lazy loaded singleton
self.bus.emit(message.response({"SEI": xtract.supported_seis}))

@homescreen_app(icon="OCP.png", name="OCP")
def handle_home(self, message=None):
"""
Handle ovos.common_play.home Messages and show the homescreen
@param message: message associated with request
"""
# homescreen / launch from .desktop
self.gui.show_home(app_mode=True)

def default_shutdown(self):
self.player.shutdown()

2 changes: 1 addition & 1 deletion ovos_plugin_common_play/ocp/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, bus=None):
# the skill_id is chosen so the namespace matches the regular bus api
# ie, the gui event "XXX" is sent in the bus as "ovos.common_play.XXX"
gui_config = Configuration().get("gui") or {}
ui_dirs = {"qt5": f"{dirname(__file__)}/res/ui"}
ui_dirs = {"qt5": f"{dirname(__file__)}/res/gui/qt5"}
super(OCPMediaPlayerGUI, self).__init__(bus=bus,
skill_id=OCP_ID,
ui_directories=ui_dirs,
Expand Down
18 changes: 0 additions & 18 deletions ovos_plugin_common_play/ocp/res/desktop/OCP.desktop

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3aa4d11

Please sign in to comment.