From 24332e40c6190f62f027960cb5ee956394626040 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Tue, 17 Jan 2012 21:36:57 +0100 Subject: [PATCH] Handle minimum and maximum spin boxes. --- frontend/maingui.cpp | 25 +++++++++++++++++++++++++ frontend/maingui.h | 2 ++ 2 files changed, 27 insertions(+) diff --git a/frontend/maingui.cpp b/frontend/maingui.cpp index b558a5d..a80b039 100644 --- a/frontend/maingui.cpp +++ b/frontend/maingui.cpp @@ -84,6 +84,26 @@ Main_GUI::browse_output() void +Main_GUI::check_min() +{ + int min = min_box->value(); + int max = max_box->value(); + if (min > max) + max_box->setValue(min); +} + + +void +Main_GUI::check_max() +{ + int min = min_box->value(); + int max = max_box->value(); + if (max < min) + min_box->setValue(max); +} + + +void Main_GUI::check_run() { if (input_line->text().isEmpty() || output_line->text().isEmpty()) @@ -202,6 +222,11 @@ Main_GUI::create_connections() connect(output_line, SIGNAL(textChanged(QString)), this, SLOT(check_run())); + connect(min_box, SIGNAL(valueChanged(int)), this, + SLOT(check_min())); + connect(max_box, SIGNAL(valueChanged(int)), this, + SLOT(check_max())); + connect(run_button, SIGNAL(clicked()), this, SLOT(run())); } diff --git a/frontend/maingui.h b/frontend/maingui.h index 10080bd..f91a0bd 100644 --- a/frontend/maingui.h +++ b/frontend/maingui.h @@ -40,6 +40,8 @@ private slots: void about(); void browse_input(); void browse_output(); + void check_min(); + void check_max(); void check_run(); void run(); -- 2.11.4.GIT