Using get_default method instead of getting the App from the graph

parent 915fa12e
......@@ -36,7 +36,7 @@ from gwe.presenter.edit_fan_profile import EditFanProfilePresenter
from gwe.presenter.edit_overclock_profile import EditOverclockProfilePresenter
from gwe.presenter.historical_data import HistoricalDataPresenter
from gwe.presenter.preferences import PreferencesPresenter
from gwe.util.view import show_notification, open_uri
from gwe.util.view import show_notification, open_uri, get_default_application
LOG = logging.getLogger(__name__)
_ADD_NEW_PROFILE_INDEX = -10
......@@ -206,9 +206,7 @@ class MainPresenter:
@staticmethod
def on_quit_clicked(*_: Any) -> None:
from gwe.app import Application
application: Application = INJECTOR.get(Application)
application.quit()
get_default_application().quit()
def on_toggle_app_window_clicked(self, *_: Any) -> None:
self.main_view.toggle_window_visibility()
......
......@@ -113,9 +113,12 @@ def is_dazzle_version_supported() -> bool:
return False
def get_default_application() -> Gtk.Application:
return Gtk.Application.get_default()
def show_notification(summary: str, body: str, iconname: str) -> None:
from gwe.app import Application
application: Application = INJECTOR.get(Application)
application = get_default_application()
notification = Gio.Notification.new(title=summary)
notification.set_body(body)
iconname = Gio.ThemedIcon.new(iconname=iconname)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment