aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRael <rael.gc@gmail.com>2015-10-09 08:15:00 -0300
committerRael <rael.gc@gmail.com>2015-10-09 08:15:00 -0300
commitd3986fd3fc0082f5926ff8bc8e6d26edf2bfb8d6 (patch)
treeb506dc8567c2d57c1008e77b3f250aaf4b0b22af
parentb5de8d134b3c0f4857b2ef387e3af7e9c01e34f0 (diff)
downloadscudcloud-d3986fd3fc0082f5926ff8bc8e6d26edf2bfb8d6.zip
scudcloud-d3986fd3fc0082f5926ff8bc8e6d26edf2bfb8d6.tar.gz
scudcloud-d3986fd3fc0082f5926ff8bc8e6d26edf2bfb8d6.tar.bz2
Removing suspend scripts (#250)
-rw-r--r--scudcloud-1.0/lib/leftpane.py7
-rwxr-xr-xscudcloud-1.0/lib/scudcloud.py24
-rw-r--r--scudcloud-1.0/lib/wrapper.py3
3 files changed, 12 insertions, 22 deletions
diff --git a/scudcloud-1.0/lib/leftpane.py b/scudcloud-1.0/lib/leftpane.py
index 0f05ede..b2986c8 100644
--- a/scudcloud-1.0/lib/leftpane.py
+++ b/scudcloud-1.0/lib/leftpane.py
@@ -10,10 +10,13 @@ class LeftPane(QWebView):
self.window = window
with open(Resources.get_path("leftpane.js"), "r") as f:
self.js = f.read()
- self.setFixedWidth(0)
- self.setVisible(False)
# We don't want plugins for this simple pane
self.settings().setAttribute(QWebSettings.PluginsEnabled, False)
+ self.reset()
+
+ def reset(self):
+ self.setFixedWidth(0)
+ self.setVisible(False)
self.setUrl(QUrl.fromLocalFile(Resources.get_path("leftpane.html")))
self.page().currentFrame().addToJavaScriptWindowObject("leftPane", self)
self.page().currentFrame().evaluateJavaScript(self.js)
diff --git a/scudcloud-1.0/lib/scudcloud.py b/scudcloud-1.0/lib/scudcloud.py
index 799a92c..b85de4d 100755
--- a/scudcloud-1.0/lib/scudcloud.py
+++ b/scudcloud-1.0/lib/scudcloud.py
@@ -59,10 +59,10 @@ class ScudCloud(QtGui.QMainWindow):
layout.addWidget(self.stackedWidget)
centralWidget.setLayout(layout)
self.setCentralWidget(centralWidget)
- startURL = Resources.SIGNIN_URL
+ self.startURL = Resources.SIGNIN_URL
if self.identifier is not None:
- startURL = self.domain()
- self.addWrapper(startURL)
+ self.startURL = self.domain()
+ self.addWrapper(self.startURL)
self.addMenu()
self.tray = Systray(self)
self.systray(ScudCloud.minimized)
@@ -70,16 +70,6 @@ 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).overrideNotifications()
def addWrapper(self, url):
webView = Wrapper(self)
@@ -91,10 +81,10 @@ class ScudCloud(QtGui.QMainWindow):
self.stackedWidget.setCurrentWidget(webView)
def setupTimer(self):
- timer = QTimer(self)
- timer.timeout.connect(self.count)
- timer.setInterval(2000)
- timer.start()
+ self.timer = QTimer(self)
+ self.timer.timeout.connect(self.count)
+ self.timer.setInterval(2000)
+ self.timer.start()
def webSettings(self):
self.cookiesjar = PersistentCookieJar(self)
diff --git a/scudcloud-1.0/lib/wrapper.py b/scudcloud-1.0/lib/wrapper.py
index 57b2dc7..e91d8e7 100644
--- a/scudcloud-1.0/lib/wrapper.py
+++ b/scudcloud-1.0/lib/wrapper.py
@@ -134,9 +134,6 @@ class Wrapper(QWebView):
def help(self):
self.call("help")
- def overrideNotifications(self):
- self.call("overrideNotifications")
-
def helpCenter(self):
subprocess.call(('xdg-open', "https://slack.zendesk.com/hc/en-us"))