From c1516088e4e7f76dddd68ef71f58c6413862e31c Mon Sep 17 00:00:00 2001 From: mkaay Date: Wed, 30 Dec 2009 12:35:03 +0100 Subject: show captchas in gui, SerienjunkiesOrg plugin --- pyLoadGui.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'pyLoadGui.py') diff --git a/pyLoadGui.py b/pyLoadGui.py index dab3ef18b..8fff8e8c9 100755 --- a/pyLoadGui.py +++ b/pyLoadGui.py @@ -62,6 +62,7 @@ class main(QObject): self.checkClipboard = False default = self.refreshConnections() self.connData = None + self.captchaProcessing = False if not first: self.connWindow.show() else: @@ -131,6 +132,7 @@ class main(QObject): self.connect(self.mainWindow, SIGNAL("setClipboardStatus"), self.slotSetClipboardStatus) self.connect(self.mainWindow, SIGNAL("changePackageName"), self.slotChangePackageName) self.connect(self.mainWindow, SIGNAL("pullOutPackage"), self.slotPullOutPackage) + self.connect(self.mainWindow.captchaDock, SIGNAL("done"), self.slotCaptchaDone) def slotShowConnector(self): """ @@ -503,6 +505,7 @@ class main(QObject): geo = str(nodes["geometry"].text()) self.mainWindow.restoreWindow(state, geo) + self.mainWindow.captchaDock.hide() def slotPushPackageToQueue(self, id): """ @@ -566,7 +569,15 @@ class main(QObject): pull package out of the queue """ if isPack: - self.connector.slotPullOutPackage(pid) + self.connector.pullOutPackage(pid) + + def checkCaptcha(self): + if self.connector.captchaWaiting() and self.mainWindow.captchaDock.isFree(): + cid, img, imgType = self.connector.getCaptcha() + self.mainWindow.captchaDock.setTask(cid, str(img), imgType) + + def slotCaptchaDone(self, cid, result): + print self.connector.setCaptchaResult(str(cid), str(result)) class Loop(QThread): """ @@ -590,6 +601,7 @@ class main(QObject): self.parent.refreshServerStatus() self.parent.refreshLog() self.parent.updateAvailable() + self.parent.checkCaptcha() def stop(self): self.running = False -- cgit v1.2.3