aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scudcloud-1.0/debian/control1
-rwxr-xr-xscudcloud-1.0/lib/scudcloud.py17
-rwxr-xr-xscudcloud-1.0/scudcloud2
3 files changed, 19 insertions, 1 deletions
diff --git a/scudcloud-1.0/debian/control b/scudcloud-1.0/debian/control
index d25cae5..b4ed8f9 100644
--- a/scudcloud-1.0/debian/control
+++ b/scudcloud-1.0/debian/control
@@ -11,6 +11,7 @@ Architecture: all
Depends: libqtwebkit4 (>= 2.3.2),
python3,
python3-dbus,
+ python3-dbus.mainloop.qt,
python3-pyqt4,
xdg-utils,
${misc:Depends}
diff --git a/scudcloud-1.0/lib/scudcloud.py b/scudcloud-1.0/lib/scudcloud.py
index debc808..3385035 100755
--- a/scudcloud-1.0/lib/scudcloud.py
+++ b/scudcloud-1.0/lib/scudcloud.py
@@ -14,6 +14,13 @@ from PyQt4.QtCore import QUrl, QSettings
from PyQt4.QtWebKit import QWebSettings
from PyQt4.QtNetwork import QNetworkDiskCache
+# Auto-detection of dbus and dbus.mainloop.qt
+try:
+ import dbus
+ from dbus.mainloop.qt import DBusQtMainLoop
+except ImportError:
+ DBusQtMainLoop = None
+
# Auto-detection of Unity and Dbusmenu in gi repository
try:
from gi.repository import Unity, Dbusmenu
@@ -63,6 +70,16 @@ class ScudCloud(QtGui.QMainWindow):
self.statusBar().showMessage('Loading Slack...')
# Starting unread msgs counter
self.setupTimer()
+ # Watch for suspend/resume events
+ if DBusQtMainLoop is not None:
+ DBusQtMainLoop(set_as_default=True)
+ dbus.SystemBus().add_signal_receiver(self.sleep, 'PrepareForSleep', 'org.freedesktop.login1.Manager', 'org.freedesktop.login1')
+
+ def sleep(self, suspended):
+ # We want the Resume event
+ if not suspended:
+ for i in range(0, self.stackedWidget.count()):
+ self.stackedWidget.widget(i).loadFinished()
def addWrapper(self, url):
webView = Wrapper(self)
diff --git a/scudcloud-1.0/scudcloud b/scudcloud-1.0/scudcloud
index 15bf087..7fe14b7 100755
--- a/scudcloud-1.0/scudcloud
+++ b/scudcloud-1.0/scudcloud
@@ -14,7 +14,7 @@ from qsingleapplication import QSingleApplication
# The ScudCloud QMainWindow
win = None
-VERSION = '1.0.71'
+VERSION = '1.0.72'
def main():
global win;