From 791bdcc5af2249673e2255ee5551f6b508869068 Mon Sep 17 00:00:00 2001 From: Sagi Dayan Date: Tue, 7 Oct 2014 23:58:09 +0300 Subject: [PATCH] Tweaked the progress bar and added debuging msgs ProgressBar will be visible only if the value is NOT 0 or NOT 100. that means, if there is no progress going on, there is no progress bar visible. --- main/CourseTab/coursestablemanager.cpp | 1 + main/mainscreen.cpp | 16 ++++++++ main/mainscreen.h | 2 + main/mainscreen.ui | 2 +- src/jceData/Calendar/calendarDialog.cpp | 2 +- src/jceData/Grades/graph/gradegraph.cpp | 6 +++ src/jceData/Grades/graph/gradegraph.h | 3 ++ src/jceData/Grades/graph/gradegraph.ui | 51 +++++++++++++++++++------ 8 files changed, 69 insertions(+), 14 deletions(-) diff --git a/main/CourseTab/coursestablemanager.cpp b/main/CourseTab/coursestablemanager.cpp index de8e6dc..265a359 100644 --- a/main/CourseTab/coursestablemanager.cpp +++ b/main/CourseTab/coursestablemanager.cpp @@ -232,6 +232,7 @@ void coursesTableManager::showGraph() { if (gp != NULL) { + qDebug() << "Graph Dialog Opened. gp != NULL"; this->graph->showGraph(gp); } } diff --git a/main/mainscreen.cpp b/main/mainscreen.cpp index eb94e3d..e32ddc3 100644 --- a/main/mainscreen.cpp +++ b/main/mainscreen.cpp @@ -49,6 +49,9 @@ MainScreen::MainScreen(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainSc ui->statusBar->repaint(); qDebug() << Q_FUNC_INFO << "Ready."; + //set the progress bar to be invisible (It will show only if value !=0 or !=100) + ui->progressBar->setVisible(false); + } MainScreen::~MainScreen() { @@ -238,6 +241,7 @@ void MainScreen::on_clearTableButton_clicked() void MainScreen::on_graphButton_clicked() { + qDebug() << "Show Graph button clicked"; courseTableMgr->showGraph(); } @@ -388,3 +392,15 @@ void MainScreen::on_labelMadeBy_linkActivated(const QString &link) } + +/** + * @brief Every time the value changes this method will be called + * @param value = the value of the progress Bar + */ +void MainScreen::on_progressBar_valueChanged(int value) +{ + if(value == 0 || value == 100) + ui->progressBar->setVisible(false); + else + ui->progressBar->setVisible(true); +} diff --git a/main/mainscreen.h b/main/mainscreen.h index b04691c..62da771 100644 --- a/main/mainscreen.h +++ b/main/mainscreen.h @@ -69,6 +69,8 @@ private slots: void on_graphButton_clicked(); + void on_progressBar_valueChanged(int value); + private: void checkLocale(); diff --git a/main/mainscreen.ui b/main/mainscreen.ui index 52c6a1a..4f6482c 100644 --- a/main/mainscreen.ui +++ b/main/mainscreen.ui @@ -690,7 +690,7 @@ background: qlineargradient(x1: 0, y1: 0.5, x2: 1, y2: 0.5, stop: 0 green, stop: 0 0 1133 - 21 + 23 diff --git a/src/jceData/Calendar/calendarDialog.cpp b/src/jceData/Calendar/calendarDialog.cpp index f3bd71c..7a29c13 100644 --- a/src/jceData/Calendar/calendarDialog.cpp +++ b/src/jceData/Calendar/calendarDialog.cpp @@ -1,5 +1,5 @@ #include "calendarDialog.h" -#include "ui_calendardialog.h" +#include "ui_calendarDialog.h" CalendarDialog::CalendarDialog(QWidget *parent) : diff --git a/src/jceData/Grades/graph/gradegraph.cpp b/src/jceData/Grades/graph/gradegraph.cpp index b0d114b..ad37b57 100644 --- a/src/jceData/Grades/graph/gradegraph.cpp +++ b/src/jceData/Grades/graph/gradegraph.cpp @@ -147,3 +147,9 @@ void gradegraph::setVisualization() ui->graphwidget->legend->setVisible(true); //show graph name on top right } + +void gradegraph::on_pushButton_clicked() +{ + qDebug() << "Closed Graph Dialog"; + this->done(0); +} diff --git a/src/jceData/Grades/graph/gradegraph.h b/src/jceData/Grades/graph/gradegraph.h index 97195ad..3cde01c 100644 --- a/src/jceData/Grades/graph/gradegraph.h +++ b/src/jceData/Grades/graph/gradegraph.h @@ -18,6 +18,9 @@ public: void showGraph(GradePage *gpPTR); ~gradegraph(); +private slots: + void on_pushButton_clicked(); + private: GradePage *gp; diff --git a/src/jceData/Grades/graph/gradegraph.ui b/src/jceData/Grades/graph/gradegraph.ui index 99691cc..78fab3f 100644 --- a/src/jceData/Grades/graph/gradegraph.ui +++ b/src/jceData/Grades/graph/gradegraph.ui @@ -7,13 +7,13 @@ 0 0 624 - 527 + 531 Dialog - + @@ -34,16 +34,43 @@ - - - - 0 - 0 - - - - - + + + + + + 0 + 0 + + + + + + + + + + + Qt::Horizontal + + + + 88 + 20 + + + + + + + + Close + + + + + +