diff options
author | deva <deva> | 2005-05-16 16:00:56 +0000 |
---|---|---|
committer | deva <deva> | 2005-05-16 16:00:56 +0000 |
commit | 856ab0ece3e73e2b520d55aeab9adfbccdb6aa93 (patch) | |
tree | 3f1149e90e5a9c88c6f22a6f8e39cfc02fdf6e67 /src/mainwindow.cc | |
parent | 3b5893ffa6d4a761eff0d97c7223eecd4fc123c9 (diff) |
Lots of stuff!
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r-- | src/mainwindow.cc | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/mainwindow.cc b/src/mainwindow.cc index 577058f..496817b 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -31,6 +31,10 @@ /* * $Log$ + * Revision 1.26 2005/05/16 16:00:56 deva + * + * Lots of stuff! + * * Revision 1.25 2005/05/03 09:22:12 deva * Implemented the gui part of the info object. * @@ -146,6 +150,11 @@ MainWindow::MainWindow(QApplication *qApp, QWidget* parent, const char* name ) camera->connect(config->readString("server_addr")->c_str(), config->readInt("server_port")); + // Make sure this is created *after* the camera object! + taskbartimer = new QTimer(this); + connect(taskbartimer, SIGNAL(timeout()), SLOT(taskbar_update())); + taskbartimer->start(200); + recording = false; frozen = false; @@ -261,6 +270,36 @@ void MainWindow::createGui() status->message( TXT_READY ); } + +#include <sys/time.h> +static struct timeval starttime; +static int h = 0; +static int m = 0; +static int s = 0; + +void MainWindow::taskbar_update() +{ + struct timeval time; + + if(recording) { + gettimeofday(&time, NULL); + + s = time.tv_sec - starttime.tv_sec; + + h = s / (60 * 60); + s -= h * (60 *60); + m = s / 60; + s -= m * 60; + } else { + gettimeofday(&starttime, NULL); + } + + char msg[256]; + int l = camera->getQueueLength(); + sprintf(msg, "Recording time: %d:%d:%d - Queue length: %d", h, m, s, l); + message(msg); +} + #define GREY 160 #define SPEED 0.07f void MainWindow::redraw_edge() |