From 971d1fdf8599dccdc604ed9374373af16af8354f Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 27 Oct 2005 14:08:28 +0000 Subject: *** empty log message *** --- src/mainwindow.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/mainwindow.cc') diff --git a/src/mainwindow.cc b/src/mainwindow.cc index 87088b2..9ea5285 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -121,6 +121,7 @@ MainWindow::~MainWindow() { info->log("MIaV is shutting down."); + delete img_history; delete camera; delete btn_cpr; @@ -262,7 +263,11 @@ void MainWindow::createGui() int w = (int)((float)BUTTON_WIDTH * unit); int h = (int)(576.0f / (720.0f / ((float)BUTTON_WIDTH * unit))); - for(int i = 0; i < NUM_HISTORY; i++) { + int window_height = config->readInt("pixel_height"); + this->num_history = (window_height - ((int)unit * BUTTON_HEIGHT)) / h; + img_history = new (HistoryWidget*)[this->num_history]; + + for(unsigned int i = 0; i < num_history; i++) { img_history[i] = new HistoryWidget(gb); img_history[i]->set_image(img_dummy); img_history[i]->setFixedSize(w, h); @@ -390,7 +395,7 @@ void MainWindow::clear() // History widgets - for(int i = 0; i < NUM_HISTORY; i++) { + for(unsigned int i = 0; i < num_history; i++) { img_history[i]->set_image(img_dummy); } @@ -518,7 +523,7 @@ void MainWindow::shoot_clicked() camera->snapshot(screenshot.bits()); QImage *image; - for(int cnt = (NUM_HISTORY-1); cnt > 0; cnt--) { + for(int cnt = (num_history-1); cnt > 0; cnt--) { image = img_history[cnt-1]->get_image(); img_history[cnt]->set_image(image); } -- cgit v1.2.3