From 3a5611e331839a3903bf0d492cbb2db5c9db5741 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Gl=C3=BCpker?= Date: Fri, 18 Mar 2016 16:38:04 +0100 Subject: Show a warning if the API_KEY is not set --- 9kwpyqt.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to '9kwpyqt.py') diff --git a/9kwpyqt.py b/9kwpyqt.py index 9acf9eb..1539032 100755 --- a/9kwpyqt.py +++ b/9kwpyqt.py @@ -104,6 +104,11 @@ class CaptchaGUI(QWidget): self.setLayout(mainLayout) self.setWindowTitle("Captcha 9kw PyQt") + if not API_KEY: + self.captchaImage.setText("API_KEY is missing.\nPlease edit this file and enter your key at the top.") + self.startstopButton.setEnabled(False) + return + # load soundfile self.sound = QSound(soundfile) -- cgit v1.2.3