summaryrefslogtreecommitdiff
path: root/src/mainwindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cc')
-rw-r--r--src/mainwindow.cc39
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()