diff --git a/Chronos.pro b/Chronos.pro index 236f988..639e8c8 100644 --- a/Chronos.pro +++ b/Chronos.pro @@ -3,8 +3,8 @@ greaterThan(QT_MAJOR_VERSION, 5): QT += widgets CONFIG += c++17 -win32:VERSION = 2.2.0.0 # major.minor.patch.build -else:VERSION = 2.2.0 # major.minor.patch +win32:VERSION = 2.2.1.0 # major.minor.patch.build +else:VERSION = 2.2.1 # major.minor.patch DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\" diff --git a/Chronos.pro.user b/Chronos.pro.user index c0c610c..d8e6d99 100644 --- a/Chronos.pro.user +++ b/Chronos.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {dbe9fba1-e5a9-4d98-85bf-f46da0900eba} + {23c6a5b6-2840-4c04-84d4-91387dc9bb9f} ProjectExplorer.Project.ActiveTarget diff --git a/Chronos.pro.user.dbe9fba b/Chronos.pro.user.dbe9fba new file mode 100644 index 0000000..c0c610c --- /dev/null +++ b/Chronos.pro.user.dbe9fba @@ -0,0 +1,265 @@ + + + + + + EnvironmentId + {dbe9fba1-e5a9-4d98-85bf-f46da0900eba} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + false + true + false + 0 + true + true + 0 + 8 + true + false + 1 + true + true + true + *.md, *.MD, Makefile + false + true + + + + ProjectExplorer.Project.PluginSettings + + + true + false + true + true + true + true + + + 0 + true + + true + Builtin.BuildSystem + + true + true + Builtin.DefaultTidyAndClazy + 8 + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop Qt 6.2.3 GCC 64bit + Desktop Qt 6.2.3 GCC 64bit + qt.qt6.623.gcc_64_kit + 0 + 0 + 0 + + 0 + /home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Debug + /home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Debug + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + + + /home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Release + /home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Release + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + + + 0 + /home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Profile + /home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Profile + + + true + QtProjectManager.QMakeBuildStep + false + + + + true + Qt4ProjectManager.MakeStep + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + clean + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + true + true + true + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:/home/aurelie/src/Chronos/Chronos.pro + /home/aurelie/src/Chronos/Chronos.pro + false + true + true + false + true + /home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Debug + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/pictures.qrc b/pictures.qrc index 0d62e85..b533b81 100644 --- a/pictures.qrc +++ b/pictures.qrc @@ -6,5 +6,6 @@ pictures/about.png pictures/banner.png pictures/validate.png + pictures/warning.png diff --git a/pictures/warning.png b/pictures/warning.png new file mode 100644 index 0000000..d112a09 Binary files /dev/null and b/pictures/warning.png differ diff --git a/sources/mainwindow.cpp b/sources/mainwindow.cpp index 7e9df4f..a6ecd5e 100644 --- a/sources/mainwindow.cpp +++ b/sources/mainwindow.cpp @@ -189,6 +189,7 @@ void MainWindow::compute_time() { updateBreakLabel(); updateEndLabel(); updateValidIcon(); + updateWarningIcon(); double late = 0.0; double overtime = 0.0; @@ -213,6 +214,14 @@ void MainWindow::updateValidIcon() { ui->fridayValidate->setVisible(current_week->getFri()->get_validate()); } +void MainWindow::updateWarningIcon() { + ui->mondayWarning->setVisible(current_week->getMon()->has_warning()); + ui->tuesdayWarning->setVisible(current_week->getTue()->has_warning()); + ui->wednesdayWarning->setVisible(current_week->getWed()->has_warning()); + ui->thurdayWarning->setVisible(current_week->getThu()->has_warning()); + ui->fridayWarning->setVisible(current_week->getFri()->has_warning()); +} + void MainWindow::updateStartLabel() { ui->monStartLabel->setText(current_week->getMon()->get_start().toString("HH:mm")); ui->tueStartLabel->setText(current_week->getTue()->get_start().toString("HH:mm")); diff --git a/sources/mainwindow.h b/sources/mainwindow.h index feab318..fb07a4e 100644 --- a/sources/mainwindow.h +++ b/sources/mainwindow.h @@ -57,6 +57,7 @@ private: void updateEndLabel(); void highlightDayOfWeek(); void updateValidIcon(); + void updateWarningIcon(); QString get_save_file_path(); Identifier get_identifier(QString objectName); diff --git a/sources/models/day.cpp b/sources/models/day.cpp index 2a7f0ac..0ce8f47 100644 --- a/sources/models/day.cpp +++ b/sources/models/day.cpp @@ -84,6 +84,20 @@ QJsonObject Day::to_json() return obj; } +bool Day::has_warning() +{ + bool warning = false; + foreach (BreakPoint val, breaks) { + if (val.getStart() < start) { + warning = true; + } + if (val.getEnd() > end) { + warning = true; + } + } + return warning; +} + Day* Day::from_json(QJsonObject obj) { Day *result = new Day(); diff --git a/sources/models/day.h b/sources/models/day.h index 77719c0..8585da2 100644 --- a/sources/models/day.h +++ b/sources/models/day.h @@ -39,6 +39,7 @@ public: float get_time_break(); void update(Day *); QJsonObject to_json(); + bool has_warning(); float get_total(); diff --git a/sources/setdaydialog.cpp b/sources/setdaydialog.cpp index ff06690..528f6fb 100644 --- a/sources/setdaydialog.cpp +++ b/sources/setdaydialog.cpp @@ -55,8 +55,8 @@ void SetDayDialog::accept() } void SetDayDialog::validate_and_accept() { - d->set_validate(true); - accept(); + copy->set_validate(true); + this->accept(); } void SetDayDialog::add_break_point() diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui index 93d7875..8360806 100644 --- a/ui/mainwindow.ui +++ b/ui/mainwindow.ui @@ -56,7 +56,7 @@ 249 19 - 155 + 164 62 @@ -118,7 +118,7 @@ color: white; 13 19 - 210 + 227 62 @@ -180,7 +180,7 @@ color: white; 440 20 - 161 + 168 62 @@ -355,6 +355,31 @@ color: white; + + + + + 16 + 16 + + + + + 16 + 16 + + + + border-image: url(:/clock/pictures/warning.png) 0 0 0 0 stretch stretch; + + + QFrame::StyledPanel + + + QFrame::Raised + + + @@ -608,6 +633,31 @@ color: white; + + + + + 16 + 16 + + + + + 16 + 16 + + + + border-image: url(:/clock/pictures/warning.png) 0 0 0 0 stretch stretch; + + + QFrame::StyledPanel + + + QFrame::Raised + + + @@ -861,6 +911,31 @@ color: white; + + + + + 16 + 16 + + + + + 16 + 16 + + + + border-image: url(:/clock/pictures/warning.png) 0 0 0 0 stretch stretch; + + + QFrame::StyledPanel + + + QFrame::Raised + + + @@ -1114,6 +1189,31 @@ color: white; + + + + + 16 + 16 + + + + + 16 + 16 + + + + border-image: url(:/clock/pictures/warning.png) 0 0 0 0 stretch stretch; + + + QFrame::StyledPanel + + + QFrame::Raised + + + @@ -1367,6 +1467,31 @@ color: white; + + + + + 16 + 16 + + + + + 16 + 16 + + + + border-image: url(:/clock/pictures/warning.png) 0 0 0 0 stretch stretch; + + + QFrame::StyledPanel + + + QFrame::Raised + + +