summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Glüpker <git@wgmd.de>2016-04-06 15:31:28 +0200
committerAndré Glüpker <git@wgmd.de>2016-04-06 15:31:28 +0200
commit1a19a6e89ff1e3efe856a5184af89f96e736b38b (patch)
tree1f064e75a12d0a779c0614aed7e38f29810fbb48
parent2c7cfb0b177ed5763937451641d3a23e094339e5 (diff)
download9kwpyqt-1a19a6e89ff1e3efe856a5184af89f96e736b38b.tar.gz
9kwpyqt-1a19a6e89ff1e3efe856a5184af89f96e736b38b.tar.bz2
9kwpyqt-1a19a6e89ff1e3efe856a5184af89f96e736b38b.zip
Remove Submit/Skip Button
Use enter/return to submit. Use escape or submit an empty message to skip.
-rwxr-xr-x9kwpyqt.py34
1 files changed, 6 insertions, 28 deletions
diff --git a/9kwpyqt.py b/9kwpyqt.py
index 51da3b0..ed796de 100755
--- a/9kwpyqt.py
+++ b/9kwpyqt.py
@@ -71,12 +71,8 @@ class CaptchaGUI(QWidget):
self.statsLabel = QLabel("online stats")
self.statsLabel.setAlignment(Qt.AlignRight)
- # self.timerLabel.setStyleSheet("QLabel { color: darkred; }")
-
self.LayoutStats = QHBoxLayout()
self.LayoutStats.addWidget(self.accountLabel)
- # self.LayoutStats.addWidget(self.timerLabel)
- # self.LayoutStats.addWidget(self.timerProgress)
self.LayoutStats.addWidget(self.statsLabel)
self.LayoutStats.sizeConstraint = QLayout.SetMinimumSize
@@ -93,30 +89,18 @@ class CaptchaGUI(QWidget):
self.captchaBox = QHBoxLayout()
self.captchaBox.addWidget(self.captchaImage)
- # Bottom: Input + Submit/Skip-Buttons
+ # Bottom: StartStop/Sound-Button
self.captchaInputLine = QLineEdit()
self.startstopButton = QPushButton("Start")
self.startstopButton.setCheckable(True)
- # self.saveImageButton = QPushButton("Sa&ve Image")
- self.submitButton = QPushButton("&Submit")
- self.skipButton = QPushButton("S&kip")
self.startstopButton.clicked.connect(self.toggleRunning)
- # self.saveImageButton.clicked.connect(self.saveImage)
- self.submitButton.clicked.connect(self.submitCaptcha)
- self.skipButton.clicked.connect(self.skipCaptcha)
-
- self.LayoutSubmitLine = QHBoxLayout()
- self.LayoutSubmitLine.addWidget(self.startstopButton)
- self.LayoutSubmitLine.addWidget(self.captchaInputLine)
- # self.LayoutSubmitLine.addWidget(self.saveImageButton)
- self.LayoutSubmitButtons = QHBoxLayout()
- self.LayoutSubmitButtons.addWidget(self.submitButton)
- self.LayoutSubmitButtons.addWidget(self.skipButton)
+ self.LayoutSettings = QHBoxLayout()
+ self.LayoutSettings.addWidget(self.startstopButton)
self.LayoutSubmit = QVBoxLayout()
- self.LayoutSubmit.addLayout(self.LayoutSubmitLine)
- self.LayoutSubmit.addLayout(self.LayoutSubmitButtons)
+ self.LayoutSubmit.addWidget(self.captchaInputLine)
+ self.LayoutSubmit.addLayout(self.LayoutSettings)
# Compile layout
mainLayout = QVBoxLayout()
@@ -170,9 +154,7 @@ class CaptchaGUI(QWidget):
if key == Qt.Key_Escape:
self.skipCaptcha()
elif key == Qt.Key_Enter or key == Qt.Key_Return:
- if self.skipButton.hasFocus():
- self.skipCaptcha()
- elif self.startstopButton.hasFocus():
+ if self.startstopButton.hasFocus():
self.toggleRunning()
else:
self.submitCaptcha()
@@ -200,10 +182,6 @@ class CaptchaGUI(QWidget):
self.startstopButton.setText(self.running and "Stop" or "Start")
self.startstopButton.setChecked(self.running)
- def saveImage(self):
- if self.captchaImage.image:
- self.captchaImage.image.save("captcha-"+str(time.time())+".jpg")
-
##################################################
# Handle network
##################################################