From 3392d8657f6f6ebc341709d5f500040ed4f559ef Mon Sep 17 00:00:00 2001 From: deva Date: Sun, 27 Mar 2005 13:53:41 +0000 Subject: Added more error detection to cprdatabase connection. (Timeout) --- src/cprquerydialog.h | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'src/cprquerydialog.h') diff --git a/src/cprquerydialog.h b/src/cprquerydialog.h index 992e66a..2f492f1 100644 --- a/src/cprquerydialog.h +++ b/src/cprquerydialog.h @@ -26,13 +26,17 @@ #ifndef __MIAV_CPRQUERYDIALOG_H__ #define __MIAV_CPRQUERYDIALOG_H__ -#define CPR_EDIT 8 -#define CPR_CLEAR 9 -#define NAME_NOT_AVAILABLE "Kunne ikke slå navn op i cpr-database" - #include #ifdef USE_GUI +// Text +#define NAME_NOT_AVAILABLE_TITLE "Databasefejl" +#define NAME_NOT_AVAILABLE "Kunne ikke slå navn op i cpr-database." + +#define CONFIRM_INVALID_CPR_TITLE "Bekræft" +#define CONFIRM_INVALID_CPR "Ugyldigt CPR nummer, brug det alligevel?" + + #include #include #include @@ -64,11 +68,10 @@ using namespace std; #include #include #include +#include #include "messagebox.h" - - class CPRQueryDialog : public QDialog { Q_OBJECT public: @@ -86,7 +89,9 @@ public slots: void insert_digit(int value); void cprSocket_readyRead(); void cprSocket_connected(); - + void cprSocket_error(int errnum); + void cprSocket_timeout(); + private: QLabel *lbl_cpr; QLabel *lbl_name; @@ -96,12 +101,13 @@ private: char internalCpr[11]; void verifycpr(char *cpr); - void run(int pos); + // void run(int pos); int test_cpr(const char *s); /*Configuration*/ string *CPR_HOST; int CPR_PORT; + int CPR_TIMEOUT; signals: void bbs_clicked(); @@ -126,6 +132,8 @@ private: void b_clicked(int value); QPushButton *createButton(QWidget *parent, const char *text, int value); int digits; + + QTimer *timer; }; #endif/*__MIAV_CPRQUERYDIALOG_H__*/ -- cgit v1.2.3