[gnome-music/wip/mschraal/suspend-in-application: 1/2] application: Move suspend functionality
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/mschraal/suspend-in-application: 1/2] application: Move suspend functionality
- Date: Fri, 12 Apr 2019 19:15:43 +0000 (UTC)
commit a7f5824c51f834908ac01dbe2769a8cff4a23cf2
Author: Marinus Schraal <mschraal gnome org>
Date: Fri Apr 12 21:03:11 2019 +0200
application: Move suspend functionality
InhibitSuspend and PauseOnSuspend were instantiated by Player.
Following the move of Player instantion to Application, move InhibitSuspend
and PauseOnSuspend to Application as well.
gnomemusic/application.py | 5 +++++
gnomemusic/player.py | 5 -----
2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gnomemusic/application.py b/gnomemusic/application.py
index 6a92b4ed..fd8c6734 100644
--- a/gnomemusic/application.py
+++ b/gnomemusic/application.py
@@ -36,7 +36,9 @@ import logging
from gi.repository import Gtk, Gio, GLib, Gdk, GObject
from gnomemusic import log
+from gnomemusic.inhibitsuspend import InhibitSuspend
from gnomemusic.mpris import MediaPlayer2Service
+from gnomemusic.pauseonsuspend import PauseOnSuspend
from gnomemusic.player import Player
from gnomemusic.widgets.aboutdialog import AboutDialog
from gnomemusic.window import Window
@@ -63,6 +65,9 @@ class Application(Gtk.Application):
self._settings = Gio.Settings.new('org.gnome.Music')
self._player = Player(self)
+ InhibitSuspend(self, self._player)
+ PauseOnSuspend(self._player)
+
def _init_style(self):
css_provider = Gtk.CssProvider()
css_provider.load_from_resource('/org/gnome/Music/org.gnome.Music.css')
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 4f64f967..1f7714cc 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -38,8 +38,6 @@ from gi.repository import GLib, GObject, Grl, GstPbutils
from gnomemusic import log
from gnomemusic.gstplayer import GstPlayer, Playback
from gnomemusic.grilo import grilo
-from gnomemusic.inhibitsuspend import InhibitSuspend
-from gnomemusic.pauseonsuspend import PauseOnSuspend
from gnomemusic.playlists import Playlists
from gnomemusic.scrobbler import LastFmScrobbler
@@ -598,9 +596,6 @@ class Player(GObject.GObject):
self._gst_player.bind_property(
'state', self, 'state', GObject.BindingFlags.SYNC_CREATE)
- self._inhibit_suspend = InhibitSuspend(application, self)
- self._pause_on_suspend = PauseOnSuspend(self)
-
self._lastfm = LastFmScrobbler()
@GObject.Property(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]