diff options
-rw-r--r-- | module/gui/connector.py | 12 | ||||
-rwxr-xr-x | pyLoadGui.py | 6 |
2 files changed, 18 insertions, 0 deletions
diff --git a/module/gui/connector.py b/module/gui/connector.py index b3855fa77..fba133cc5 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -428,6 +428,18 @@ class connector(QThread): finally: self.mutex.unlock() + def getCaptchaStatus(self, cid): + """ + get captcha status + """ + self.mutex.lock() + try: + return self.proxy.get_task_status(cid) + except Exception, e: + self.emit(SIGNAL("proxy_error"), "getCaptchaStatus", e) + finally: + self.mutex.unlock() + def getEvents(self): """ get events diff --git a/pyLoadGui.py b/pyLoadGui.py index 782c778e5..1ceb9f1a7 100755 --- a/pyLoadGui.py +++ b/pyLoadGui.py @@ -576,6 +576,12 @@ class main(QObject): if self.connector.captchaWaiting() and self.mainWindow.captchaDock.isFree(): cid, img, imgType = self.connector.getCaptcha() self.mainWindow.captchaDock.emit(SIGNAL("setTask"), cid, str(img), imgType) + elif not self.mainWindow.captchaDock.isFree(): + status = self.connector.getCaptchaStatus(self.mainWindow.captchaDock.currentID) + if not (status == "user" or status == "shared-user"): + self.mainWindow.captchaDock.hide() + self.mainWindow.captchaDock.processing = False + self.mainWindow.captchaDock.currentID = None def slotCaptchaDone(self, cid, result): self.connector.setCaptchaResult(str(cid), str(result)) |