summaryrefslogtreecommitdiff
path: root/src/cprquerydialog.h
diff options
context:
space:
mode:
authordeva <deva>2005-03-27 13:53:41 +0000
committerdeva <deva>2005-03-27 13:53:41 +0000
commit3392d8657f6f6ebc341709d5f500040ed4f559ef (patch)
tree8049cb88fe84266189b622b8f1565145905346cc /src/cprquerydialog.h
parentc61ab7c4232eb80b7cc3c2f37ba2715e16b4ee73 (diff)
Added more error detection to cprdatabase connection. (Timeout)
Diffstat (limited to 'src/cprquerydialog.h')
-rw-r--r--src/cprquerydialog.h24
1 files changed, 16 insertions, 8 deletions
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 <config.h>
#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 <qdialog.h>
#include <qpushbutton.h>
#include <qlayout.h>
@@ -64,11 +68,10 @@ using namespace std;
#include <qdialog.h>
#include <qlabel.h>
#include <qsocket.h>
+#include <qtimer.h>
#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__*/