summaryrefslogtreecommitdiff
path: root/src/cprquerydialog.cc
diff options
context:
space:
mode:
authordeva <deva>2006-01-10 10:03:41 +0000
committerdeva <deva>2006-01-10 10:03:41 +0000
commit495330ce3cfb6b168d2fb9b56aa125bbc7ff6e7d (patch)
tree45cb7dc618e05a21657790e17b617a664652dae1 /src/cprquerydialog.cc
parentcaa558e59c248521d1d4ad483fe669828277664e (diff)
*** empty log message ***
Diffstat (limited to 'src/cprquerydialog.cc')
-rw-r--r--src/cprquerydialog.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/cprquerydialog.cc b/src/cprquerydialog.cc
index 4506e42..552aeb6 100644
--- a/src/cprquerydialog.cc
+++ b/src/cprquerydialog.cc
@@ -114,11 +114,40 @@ CPRQueryDialog::CPRQueryDialog(QLabel *lcpr,
connect(bca,SIGNAL(clicked()), SLOT(b_c_clicked()));
this->move(175,150);
+
+ listen = new CPRListen(config->readInt("cprlisten_port"));
+ listen_timer = new QTimer(this);
+ connect(listen_timer, SIGNAL(timeout()), SLOT(listen_timeout()));
+ listen->run();
+ listen_timer->start(500); // Check every 500 ms
+
show();
}
CPRQueryDialog::~CPRQueryDialog()
{
+ // Cleanup
+ // delete timer;
+ // delete cprSocket
+
+ // Cleanup after cpr listen
+ listen->stop();
+ // listen->wait_stop();
+ delete listen;
+ // delete listen_timer;
+}
+
+void CPRQueryDialog::listen_timeout()
+{
+ string newcpr;
+ if(listen->cprChanged()) {
+ char newcpr_buf[32];
+ newcpr = listen->getCpr();
+ sprintf(newcpr_buf, "%s-%s", newcpr.substr(0,6).c_str(), newcpr.substr(6,4).c_str());
+ // printf("cprbuf[%s]\n", newcpr_buf);
+ lbl_cpr->setText(newcpr_buf);
+ verifycpr(newcpr_buf);
+ }
}
/**