From b6c94f23de928e5c9a8eef651e41f0283df437c8 Mon Sep 17 00:00:00 2001 From: Jeena Paradies Date: Sun, 18 Nov 2012 02:38:47 +0100 Subject: [PATCH] removed all alerts --- Linux/QtTest.py | 68 --------------------------- WebKit/scripts/controller/Oauth.js | 2 +- WebKit/scripts/controller/Timeline.js | 3 +- WebKit/scripts/helper/Core.js | 4 +- WebKit/scripts/main.js | 4 +- 5 files changed, 6 insertions(+), 75 deletions(-) delete mode 100644 Linux/QtTest.py diff --git a/Linux/QtTest.py b/Linux/QtTest.py deleted file mode 100644 index 2800e47..0000000 --- a/Linux/QtTest.py +++ /dev/null @@ -1,68 +0,0 @@ -import sys, urllib -from PyQt4 import QtCore, QtGui, QtWebKit - -"""Html snippet.""" -html = """ - -
- - -
- -""" - -class StupidClass(QtCore.QObject): - """Simple class with one slot and one read-only property.""" - - @QtCore.pyqtSlot(str) - def showMessage(self, msg): - """Open a message box and display the specified message.""" - QtGui.QMessageBox.information(None, "Info", msg) - - def _pyVersion(self): - """Return the Python version.""" - return sys.version - - """Python interpreter version property.""" - pyVersion = QtCore.pyqtProperty(str, fget=_pyVersion) - -def isBasicAuth(url): - url_opener = urllib.URLopener() - - try: - url_opener.open(url) - except IOError, error_code: - if error_code[0] == "http error" : - if error_code[1] == 401: - return True - else: - return False - - return False - -def main(): - app = QtGui.QApplication(sys.argv) - - myObj = StupidClass() - - webView = QtWebKit.QWebView() - # Make myObj exposed as JavaScript object named 'pyObj' - webView.page().mainFrame().addToJavaScriptWindowObject("pyObj", myObj) - - url = "http://lala.home.jeena.net:3002/admin" - if isBasicAuth(url): - print "Basic Auth" - else: - webView.load(QtCore.QUrl(url)) - #webView.setHtml(html) - - window = QtGui.QMainWindow() - window.setCentralWidget(webView) - window.show() - - sys.exit(app.exec_()) - -if __name__ == "__main__": - main() diff --git a/WebKit/scripts/controller/Oauth.js b/WebKit/scripts/controller/Oauth.js index 6160085..ef89871 100644 --- a/WebKit/scripts/controller/Oauth.js +++ b/WebKit/scripts/controller/Oauth.js @@ -130,7 +130,7 @@ function(HostApp, Paths, Hmac) { Paths.getURL(url, http_method, callback, requestBody, auth_header); } else { - alert("State is not the same: {" + this.state + "} vs {" + urlVars["state"] + "}") + console.error("State is not the same: {" + this.state + "} vs {" + urlVars["state"] + "}") } this.state = null; // reset the state diff --git a/WebKit/scripts/controller/Timeline.js b/WebKit/scripts/controller/Timeline.js index b681b00..c806ef1 100644 --- a/WebKit/scripts/controller/Timeline.js +++ b/WebKit/scripts/controller/Timeline.js @@ -81,8 +81,7 @@ function(Core, Paths, HostApp, URI) { those.newStatus(json); } catch (e) { - //alert(resp.responseText); - alert(url + " JSON parse error"); + console.error(url + " JSON parse error"); throw e; } } diff --git a/WebKit/scripts/helper/Core.js b/WebKit/scripts/helper/Core.js index 1451e5f..2cecf04 100644 --- a/WebKit/scripts/helper/Core.js +++ b/WebKit/scripts/helper/Core.js @@ -284,8 +284,8 @@ function(jQuery, Paths, URI, HostApp, Followings) { } }, error:function (xhr, ajaxOptions, thrownError) { - alert(xhr.status); - alert(thrownError); + console.error(xhr.status); + console.error(thrownError); } }); } diff --git a/WebKit/scripts/main.js b/WebKit/scripts/main.js index 0505dc5..d74ab60 100644 --- a/WebKit/scripts/main.js +++ b/WebKit/scripts/main.js @@ -70,13 +70,13 @@ var console = { __console.error(s); } }, - warning: function (s) { + warn: function (s) { if (OS_TYPE == "mac") { alert("WARNING: " + s); } else { __console.warning(s); } - } + }, notice: function(s) { if (OS_TYPE == "mac") { alert("NOTICE: " + s);