diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..bd784f0 Binary files /dev/null and b/.DS_Store differ diff --git a/Chronos.pro b/Chronos.pro index 25b44f6..545f10e 100644 --- a/Chronos.pro +++ b/Chronos.pro @@ -26,24 +26,31 @@ DEFINES += QT_DEPRECATED_WARNINGS SOURCES += \ sources/aboutbox.cpp \ + sources/breakdialog.cpp \ + sources/breakpoint.cpp \ sources/day.cpp \ sources/main.cpp \ sources/mainwindow.cpp \ sources/setdaydialog.cpp \ sources/tools.cpp \ sources/week.cpp \ - sources/welcome.cpp + sources/welcome.cpp \ + sources/year.cpp HEADERS += \ sources/aboutbox.h \ + sources/breakdialog.h \ + sources/breakpoint.h \ sources/day.h \ sources/mainwindow.h \ sources/setdaydialog.h \ sources/tools.h \ sources/week.h \ - sources/welcome.h + sources/welcome.h \ + sources/year.h FORMS += \ + ui/breakdialog.ui \ ui/aboutbox.ui \ ui/mainwindow.ui \ ui/setdaydialog.ui \ diff --git a/Chronos.pro.user b/Chronos.pro.user index f9e5651..efec190 100644 --- a/Chronos.pro.user +++ b/Chronos.pro.user @@ -1,10 +1,10 @@ - + EnvironmentId - {39b4df9e-fc10-428a-bc34-924198bd0973} + {f1407b1e-b4d5-4aac-ba0d-b38072a0dfb8} ProjectExplorer.Project.ActiveTarget @@ -37,6 +37,7 @@ true true 1 + false true false 0 @@ -45,22 +46,35 @@ 0 8 true + false 1 true true true + *.md, *.MD, Makefile false + true ProjectExplorer.Project.PluginSettings - - -fno-delayed-template-parsing - + + true + false + true + true + true + true + + + 0 + true + true - Builtin.Questionable + Builtin.BuildSystem + true true Builtin.DefaultTidyAndClazy 4 @@ -74,33 +88,29 @@ ProjectExplorer.Project.Target.0 - Desktop Qt 5.15.0 MSVC2019 64bit - Desktop Qt 5.15.0 MSVC2019 64bit - qt.qt5.5150.win64_msvc2019_64_kit - 1 + Desktop + Qt 6.2.0 for macOS + Qt 6.2.0 for macOS + qt.qt6.620.clang_64_kit + 0 0 0 - true 0 - C:\Users\robof\OneDrive\Documents\build-Chronos-Desktop_Qt_5_15_0_MSVC2019_64bit-Debug - C:/Users/robof/OneDrive/Documents/build-Chronos-Desktop_Qt_5_15_0_MSVC2019_64bit-Debug + /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Debug + /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Debug true QtProjectManager.QMakeBuildStep - false - + + arm-darwin-generic-mach_o-64bit + true Qt4ProjectManager.MakeStep - - false - - - false 2 Build @@ -111,11 +121,7 @@ true Qt4ProjectManager.MakeStep - - true clean - - false 1 Clean @@ -124,34 +130,25 @@ 2 false + Debug Qt4ProjectManager.Qt4BuildConfiguration 2 - 2 - 2 - true - 2 - C:\Users\robof\OneDrive\Documents\build-Chronos-Desktop_Qt_5_15_0_MSVC2019_64bit-Release - C:/Users/robof/OneDrive/Documents/build-Chronos-Desktop_Qt_5_15_0_MSVC2019_64bit-Release + /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Release + /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Release true QtProjectManager.QMakeBuildStep - false true Qt4ProjectManager.MakeStep - - false - - - false 2 Build @@ -162,11 +159,7 @@ true Qt4ProjectManager.MakeStep - - true clean - - false 1 Clean @@ -175,34 +168,27 @@ 2 false + Release Qt4ProjectManager.Qt4BuildConfiguration 0 0 - 2 - true 0 - C:\Users\robof\OneDrive\Documents\build-Chronos-Desktop_Qt_5_15_0_MSVC2019_64bit-Profile - C:/Users/robof/OneDrive/Documents/build-Chronos-Desktop_Qt_5_15_0_MSVC2019_64bit-Profile + /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Profile + /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Profile true QtProjectManager.QMakeBuildStep - false true Qt4ProjectManager.MakeStep - - false - - - false 2 Build @@ -213,11 +199,7 @@ true Qt4ProjectManager.MakeStep - - true clean - - false 1 Clean @@ -226,6 +208,7 @@ 2 false + Profile Qt4ProjectManager.Qt4BuildConfiguration @@ -247,80 +230,21 @@ ProjectExplorer.DefaultDeployConfiguration 1 - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F true - 4096 - false - false - 1000 - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - + 2 - Qt4ProjectManager.Qt4RunConfiguration:C:/Users/robof/OneDrive/Documents/Chronos/Chronos.pro - C:/Users/robof/OneDrive/Documents/Chronos/Chronos.pro - - false - + Qt4ProjectManager.Qt4RunConfiguration:/Volumes/Macintosh SSD/sources/Qt/Chronos/Chronos.pro + /Volumes/Macintosh SSD/sources/Qt/Chronos/Chronos.pro false true true - false false true - - C:/Users/robof/OneDrive/Documents/build-Chronos-Desktop_Qt_5_15_0_MSVC2019_64bit-Release + /Volumes/Macintosh SSD/sources/Qt/build-Chronos-Qt_6_2_0_for_macOS-Debug/Chronos.app/Contents/MacOS 1 diff --git a/Chronos.pro.user.39b4df9 b/Chronos.pro.user.39b4df9 new file mode 100644 index 0000000..f9e5651 --- /dev/null +++ b/Chronos.pro.user.39b4df9 @@ -0,0 +1,340 @@ + + + + + + EnvironmentId + {39b4df9e-fc10-428a-bc34-924198bd0973} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + -fno-delayed-template-parsing + + true + Builtin.Questionable + + true + Builtin.DefaultTidyAndClazy + 4 + + + + true + + + + + ProjectExplorer.Project.Target.0 + + Desktop Qt 5.15.0 MSVC2019 64bit + Desktop Qt 5.15.0 MSVC2019 64bit + qt.qt5.5150.win64_msvc2019_64_kit + 1 + 0 + 0 + + true + 0 + C:\Users\robof\OneDrive\Documents\build-Chronos-Desktop_Qt_5_15_0_MSVC2019_64bit-Debug + C:/Users/robof/OneDrive/Documents/build-Chronos-Desktop_Qt_5_15_0_MSVC2019_64bit-Debug + + + true + QtProjectManager.QMakeBuildStep + + false + + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + 2 + 2 + + + true + 2 + C:\Users\robof\OneDrive\Documents\build-Chronos-Desktop_Qt_5_15_0_MSVC2019_64bit-Release + C:/Users/robof/OneDrive/Documents/build-Chronos-Desktop_Qt_5_15_0_MSVC2019_64bit-Release + + + true + QtProjectManager.QMakeBuildStep + + false + + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + 2 + + + true + 0 + C:\Users\robof\OneDrive\Documents\build-Chronos-Desktop_Qt_5_15_0_MSVC2019_64bit-Profile + C:/Users/robof/OneDrive/Documents/build-Chronos-Desktop_Qt_5_15_0_MSVC2019_64bit-Profile + + + true + QtProjectManager.QMakeBuildStep + + false + + + + true + Qt4ProjectManager.MakeStep + + false + + + false + + 2 + Build + Build + ProjectExplorer.BuildSteps.Build + + + + true + Qt4ProjectManager.MakeStep + + true + clean + + false + + 1 + Clean + Clean + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Profile + Qt4ProjectManager.Qt4BuildConfiguration + 0 + 0 + 0 + + 3 + + + 0 + Deploy + Deploy + ProjectExplorer.BuildSteps.Deploy + + 1 + + false + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + dwarf + + cpu-cycles + + + 250 + + -e + cpu-cycles + --call-graph + dwarf,4096 + -F + 250 + + -F + true + 4096 + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + kcachegrind + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + Qt4ProjectManager.Qt4RunConfiguration:C:/Users/robof/OneDrive/Documents/Chronos/Chronos.pro + C:/Users/robof/OneDrive/Documents/Chronos/Chronos.pro + + false + + false + true + true + false + false + true + + C:/Users/robof/OneDrive/Documents/build-Chronos-Desktop_Qt_5_15_0_MSVC2019_64bit-Release + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/sources/.DS_Store b/sources/.DS_Store new file mode 100644 index 0000000..36e69c2 Binary files /dev/null and b/sources/.DS_Store differ diff --git a/sources/aboutbox.cpp b/sources/aboutbox.cpp index 3cf3f73..9b68d69 100644 --- a/sources/aboutbox.cpp +++ b/sources/aboutbox.cpp @@ -19,14 +19,14 @@ AboutBox::~AboutBox() } void AboutBox::mousePressEvent(QMouseEvent *event) { - m_nMouseClick_X_Coordinate = event->x(); - m_nMouseClick_Y_Coordinate = event->y(); + m_nMouseClick_X_Coordinate = event->position().rx(); + m_nMouseClick_Y_Coordinate = event->position().ry(); } void AboutBox::mouseMoveEvent(QMouseEvent *event) { if (isWidgetIsTitleBar()) { - move(event->globalX() - m_nMouseClick_X_Coordinate , - event->globalY() - m_nMouseClick_Y_Coordinate); + move(event->globalPosition().rx() - m_nMouseClick_X_Coordinate , + event->globalPosition().ry() - m_nMouseClick_Y_Coordinate); } } diff --git a/sources/breakdialog.cpp b/sources/breakdialog.cpp new file mode 100644 index 0000000..22832b0 --- /dev/null +++ b/sources/breakdialog.cpp @@ -0,0 +1,32 @@ +#include "breakdialog.h" +#include "ui_breakdialog.h" + +BreakDialog::BreakDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::BreakDialog) +{ + ui->setupUi(this); + connect(ui->startTime, &QTimeEdit::timeChanged, this, &BreakDialog::compute); + connect(ui->endTime, &QTimeEdit::timeChanged, this, &BreakDialog::compute); +} + +BreakDialog::~BreakDialog() +{ + delete ui; +} + +BreakPoint BreakDialog::get_result() +{ + return bp; +} + +void BreakDialog::compute() +{ + if (ui->endTime->time() < ui->startTime->time()) { + ui->endTime->setTime(ui->startTime->time()); + } + bp.setStart(ui->startTime->time()); + bp.setEnd(ui->endTime->time()); + float minutes = bp.getDuration(); + ui->totalTime->setText(QString("%1 minutes").arg(QString::number(minutes, 'g', 2))); +} diff --git a/sources/breakdialog.h b/sources/breakdialog.h new file mode 100644 index 0000000..8c33568 --- /dev/null +++ b/sources/breakdialog.h @@ -0,0 +1,29 @@ +#ifndef BREAKDIALOG_H +#define BREAKDIALOG_H + +#include + +#include "breakpoint.h" + +namespace Ui { +class BreakDialog; +} + +class BreakDialog : public QDialog +{ + Q_OBJECT + +public: + explicit BreakDialog(QWidget *parent = nullptr); + ~BreakDialog(); + BreakPoint get_result(); + +private slots: + void compute(); + +private: + Ui::BreakDialog *ui; + BreakPoint bp; +}; + +#endif // BREAKDIALOG_H diff --git a/sources/breakpoint.cpp b/sources/breakpoint.cpp new file mode 100644 index 0000000..e84a133 --- /dev/null +++ b/sources/breakpoint.cpp @@ -0,0 +1,56 @@ +#include "breakpoint.h" + +BreakPoint::BreakPoint() +{ + +} + +BreakPoint::BreakPoint(QTime start, QTime end) +{ + this->start = start; + this->end = end; +} + +QTime BreakPoint::getStart() +{ + return start; +} + +QTime BreakPoint::getEnd() +{ + return end; +} + +float BreakPoint::getDuration() +{ + return start.secsTo(end) / 60; +} + +void BreakPoint::setStart(QTime start) +{ + this->start = start; +} + +void BreakPoint::setEnd(QTime end) +{ + this->end = end; +} + +QJsonObject BreakPoint::to_json() +{ + QJsonObject obj{ + {"start", start.toString(Qt::DateFormat::ISODate)}, + {"end", end.toString(Qt::DateFormat::ISODate)} + }; + return obj; +} + +BreakPoint BreakPoint::from_json(QJsonObject obj) +{ + BreakPoint result; + + result.start = QTime::fromString(obj["start"].toString(), Qt::DateFormat::ISODate); + result.end = QTime::fromString(obj["end"].toString(), Qt::DateFormat::ISODate); + + return result; +} diff --git a/sources/breakpoint.h b/sources/breakpoint.h new file mode 100644 index 0000000..942e879 --- /dev/null +++ b/sources/breakpoint.h @@ -0,0 +1,29 @@ +#ifndef BREAKPOINT_H +#define BREAKPOINT_H + +#include +#include +#include + +class BreakPoint +{ +private: + QTime start; + QTime end; + +public: + BreakPoint(); + BreakPoint(QTime, QTime); + + QTime getStart(); + QTime getEnd(); + float getDuration(); + + void setStart(QTime); + void setEnd(QTime); + + QJsonObject to_json(); + static BreakPoint from_json(QJsonObject); +}; + +#endif // BREAKPOINT_H diff --git a/sources/day.cpp b/sources/day.cpp index 813e71b..e062b79 100644 --- a/sources/day.cpp +++ b/sources/day.cpp @@ -4,13 +4,16 @@ Day::Day() { start = QTime(9, 0, 0, 0); end = QTime(17, 15, 0, 0); - time_break = 45.0; + BreakPoint lunch(QTime(12, 0, 0, 0), QTime(12, 45, 0, 0)); + breaks.append(lunch); + validate = false; } -double Day::get_total() { +float Day::get_total() { int sec = start.secsTo(end); int minutes = sec / 60; - return (minutes - time_break) / 60; + float breakTime = get_time_break(); + return (minutes - breakTime) / 60; } void Day::set_start(QTime value) @@ -23,15 +26,15 @@ void Day::set_end(QTime value) end = value; } -void Day::set_time_break(double value) -{ - time_break = value; -} - void Day::set_validate(bool value) { validate = value; } +void Day::setBreaks(QVector breaks) +{ + this->breaks = breaks; +} + QTime Day::get_start() { return start; @@ -42,17 +45,21 @@ QTime Day::get_end() return end; } -double Day::get_time_break() +QVector Day::getBreaks() { - return time_break; + return breaks; } QJsonObject Day::to_json() { + QJsonArray arr; + foreach (BreakPoint bp, breaks) { + arr.append(bp.to_json()); + } QJsonObject obj{ {KEY_START, start.toString(Qt::DateFormat::ISODate)}, {KEY_END, end.toString(Qt::DateFormat::ISODate)}, - {KEY_BREAK, time_break}, + {KEY_BREAKS, arr}, {KEY_VALIDATE, validate} }; @@ -65,12 +72,26 @@ Day Day::from_json(QJsonObject obj) result.start = QTime::fromString(obj[KEY_START].toString(), Qt::DateFormat::ISODate); result.end = QTime::fromString(obj[KEY_END].toString(), Qt::DateFormat::ISODate); - result.time_break = obj[KEY_BREAK].toDouble(); result.validate = obj[KEY_VALIDATE].toBool(); + result.breaks.clear(); + QJsonArray arr = obj[KEY_BREAKS].toArray(); + foreach (QJsonValue val, arr) { + result.breaks.append(BreakPoint::from_json(val.toObject())); + } + return result; } bool Day::get_validate() { return validate; } + +float Day::get_time_break() +{ + float result = 0; + foreach (BreakPoint bp, breaks) { + result += bp.getDuration(); + } + return result; +} diff --git a/sources/day.h b/sources/day.h index 789080d..dd66522 100644 --- a/sources/day.h +++ b/sources/day.h @@ -3,20 +3,23 @@ #define KEY_START "start" #define KEY_END "end" -#define KEY_BREAK "break" +#define KEY_BREAKS "breaks" #define KEY_VALIDATE "validate" #include #include +#include #include +#include "breakpoint.h" + class Day { private: QTime start; QTime end; - double time_break; + QVector breaks; bool validate; public: @@ -24,16 +27,17 @@ public: void set_start(QTime value); void set_end(QTime value); - void set_time_break(double value); void set_validate(bool); + void setBreaks(QVector); QTime get_start(); QTime get_end(); - double get_time_break(); + QVector getBreaks(); bool get_validate(); + float get_time_break(); QJsonObject to_json(); - double get_total(); + float get_total(); static Day from_json(QJsonObject); }; diff --git a/sources/mainwindow.cpp b/sources/mainwindow.cpp index aafa25d..400e623 100644 --- a/sources/mainwindow.cpp +++ b/sources/mainwindow.cpp @@ -6,31 +6,9 @@ MainWindow::MainWindow(QWidget *parent) , ui(new Ui::MainWindow) { ui->setupUi(this); - ui->window_title->setText(this->windowTitle()); - this->setWindowFlags(Qt::FramelessWindowHint); init(); } -void MainWindow::mousePressEvent(QMouseEvent *event) { - m_nMouseClick_X_Coordinate = event->x(); - m_nMouseClick_Y_Coordinate = event->y(); -} - -void MainWindow::mouseMoveEvent(QMouseEvent *event) { - if (isWidgetIsTitleBar()) { - move(event->globalX() - m_nMouseClick_X_Coordinate , - event->globalY() - m_nMouseClick_Y_Coordinate); - } - -} - -bool MainWindow::isWidgetIsTitleBar() { - return (m_nMouseClick_X_Coordinate >= xmin && - m_nMouseClick_X_Coordinate < xmax && - m_nMouseClick_Y_Coordinate >= ymin && - m_nMouseClick_Y_Coordinate < ymax); -} - MainWindow::~MainWindow() { delete ui; @@ -55,10 +33,6 @@ void MainWindow::init() { objectId.insert(ui->wed_button->objectName(), Identifier::wed); objectId.insert(ui->thu_button->objectName(), Identifier::thu); objectId.insert(ui->fri_button->objectName(), Identifier::fri); - xmax = ui->titleBar->x() + ui->titleBar->width(); - xmin = ui->titleBar->x(); - ymax = ui->titleBar->x() + ui->titleBar->height(); - ymin = ui->titleBar->y(); connect(ui->aboutButton, &QPushButton::clicked, this, &MainWindow::open_about); connect(ui->template_settings_button, &QPushButton::clicked, this, &MainWindow::edit_template); connect(ui->dateEdit, &QDateEdit::dateTimeChanged, this, &MainWindow::compute_week_number); @@ -130,28 +104,13 @@ void MainWindow::open_save() { delete file; QJsonObject obj = QJsonDocument::fromJson(json.toUtf8()).object(); - if (obj[KEY_SAVE_FILE_VERSION].toInt() == SAVE_FILE_VERSION) { - week_template = Week::from_json(obj[KEY_TEMPLATE].toObject()); - QJsonArray arr = obj[KEY_WEEKS].toArray(); - for (QJsonValue val : arr) { - weeks[val.toObject()["weekNumber"].toInt()] = Week::from_json(val.toObject()); - } - saveLoaded = true; - } else if (obj[KEY_SAVE_FILE_VERSION].toInt() < SAVE_FILE_VERSION) { - QString updater = QCoreApplication::applicationDirPath() + "/save-updater.exe"; - if (QFile::exists(updater)) { - QProcess* process = new QProcess(this); - process->execute(updater, QStringList({"update"})); - delete process; - open_save(); - } else { - panic_dialog("Cette application n'a pas pu démarrer car save-updater.exe est introuvable.\n" - "La réinstallation de cette application peut corriger ce problème"); - } - } else { - panic_dialog("Votre fichier de sauvegarde a été enregistré depuis une version plus récente de Chronos\n" - "Mettez à jour Chronos pour pouvoir utiliser ce fichier"); + week_template = Week::from_json(obj[KEY_TEMPLATE].toObject()); + QJsonArray arr = obj[KEY_YEARS].toArray(); + foreach (QJsonValue val, arr) { + Year y = Year::from_json(val.toObject()); + years[y.getNumber()] = y; } + saveLoaded = true; } void MainWindow::panic_dialog(QString text) { @@ -162,12 +121,12 @@ void MainWindow::panic_dialog(QString text) { void MainWindow::save_to_file() { QJsonArray arr; - for (Week w : weeks) { - arr.append(w.to_json()); + foreach (Year y, years) { + arr.append(y.to_json()); } QJsonObject obj { {KEY_TEMPLATE, week_template.to_json()}, - {KEY_WEEKS, arr}, + {KEY_YEARS, arr}, {KEY_SAVE_FILE_VERSION, SAVE_FILE_VERSION} }; QJsonDocument doc(obj); @@ -180,22 +139,24 @@ void MainWindow::save_to_file() { void MainWindow::compute_week_number(const QDateTime &dt) { int n = dt.date().weekNumber(); + int y = dt.date().year(); ui->label_semaine->setText(QString("Semaine : %1").arg(QString::number(n))); - QMapIterator it(weeks); - bool working = true; - bool found = false; - while (it.hasNext() && working) { - Week w = it.next().value(); - if (w.getWeekNumber() == n) { - current_week = w; - working = false; - found = true; - } + if (years.contains(y)) { + current_year = years[y]; + } else { + Year nYear(y); + years[y] = nYear; + current_year = nYear; + save_to_file(); } - if (!found) { + + if (current_year.getWeeks().contains(n)) { + auto weeks = current_year.getWeeks(); + current_week = weeks[n]; + } else { current_week = Week(week_template); current_week.setWeekNumber(n); - weeks.insert(n, current_week); + current_year.addWeek(current_week); save_to_file(); } compute_time(); @@ -217,13 +178,12 @@ void MainWindow::compute_time() { double late = 0.0; double overtime = 0.0; int todayWeekNumber = QDate::currentDate().weekNumber(); - for (Week w : weeks) { + foreach (Week w, current_year.getWeeks()) { if (w.getWeekNumber() <= todayWeekNumber) { late += (week_template.total() - w.total()); overtime += (w.total() - week_template.total()); } } - ui->late_time_label->setText(Tools::double_to_string_time((late > 0.0) ? late : 0.0)); ui->overtime_time_label->setText(Tools::double_to_string_time((overtime > 0.0) ? overtime : 0.0)); } @@ -279,7 +239,10 @@ void MainWindow::edit() { current_week.setFri(modify_value(current_week.getFri())); break; } + auto weeks = current_year.getWeeks(); weeks[current_week.getWeekNumber()] = current_week; + current_year.setWeeks(weeks); + years[current_year.getNumber()] = current_year; save_to_file(); compute_time(); } diff --git a/sources/mainwindow.h b/sources/mainwindow.h index 81631e4..382f668 100644 --- a/sources/mainwindow.h +++ b/sources/mainwindow.h @@ -2,9 +2,9 @@ #define MAINWINDOW_H #define KEY_TEMPLATE "template" -#define KEY_WEEKS "weeks" +#define KEY_YEARS "years" #define SAVE_FILENAME "data.json" -#define SAVE_FILE_VERSION 2 +#define SAVE_FILE_VERSION 3 #define KEY_SAVE_FILE_VERSION "version" #include @@ -21,9 +21,9 @@ #include #include #include -#include #include "week.h" +#include "year.h" #include "welcome.h" #include "tools.h" #include "aboutbox.h" @@ -63,22 +63,13 @@ private: Week week_template; Week current_week; - QMap weeks; + Year current_year; + QMap years; QMap objectId; int todayWeekNumber; int dayOfWeek; bool saveLoaded; - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - int m_nMouseClick_X_Coordinate; - int m_nMouseClick_Y_Coordinate; - int xmax; - int xmin; - int ymax; - int ymin; - inline bool isWidgetIsTitleBar(); - public slots: void compute_week_number(const QDateTime &dt); void compute_time(); diff --git a/sources/setdaydialog.cpp b/sources/setdaydialog.cpp index c338570..2f99b7a 100644 --- a/sources/setdaydialog.cpp +++ b/sources/setdaydialog.cpp @@ -6,9 +6,8 @@ SetDayDialog::SetDayDialog(Day d, bool isNotValidable, QWidget *parent) : ui(new Ui::SetDayDialog) { ui->setupUi(this); - ui->window_title->setText(this->windowTitle()); - this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint); ui->validateButton->setEnabled(!isNotValidable); + ui->validateButton->setVisible(!isNotValidable); this->d = d; init(); } @@ -18,45 +17,31 @@ SetDayDialog::~SetDayDialog() delete ui; } -void SetDayDialog::mousePressEvent(QMouseEvent *event) { - m_nMouseClick_X_Coordinate = event->x(); - m_nMouseClick_Y_Coordinate = event->y(); -} - -void SetDayDialog::mouseMoveEvent(QMouseEvent *event) { - if (isWidgetIsTitleBar()) { - move(event->globalX() - m_nMouseClick_X_Coordinate , - event->globalY() - m_nMouseClick_Y_Coordinate); - } - -} - -bool SetDayDialog::isWidgetIsTitleBar() { - return (m_nMouseClick_X_Coordinate >= xmin && - m_nMouseClick_X_Coordinate < xmax && - m_nMouseClick_Y_Coordinate >= ymin && - m_nMouseClick_Y_Coordinate < ymax); -} - void SetDayDialog::init() { ui->start_edit->setTime(d.get_start()); ui->end_edit->setTime(d.get_end()); - ui->break_edit->setValue(d.get_time_break()); - xmax = ui->titleBar->x() + ui->titleBar->width(); - xmin = ui->titleBar->x(); - ymax = ui->titleBar->x() + ui->titleBar->height(); - ymin = ui->titleBar->y(); + updateBreakList(); connect(ui->start_edit, &QTimeEdit::timeChanged, this, &SetDayDialog::compute_time); connect(ui->end_edit, &QTimeEdit::timeChanged, this, &SetDayDialog::compute_time); connect(ui->validateButton, &QPushButton::clicked, this, &SetDayDialog::validate); - connect(ui->break_edit, static_cast(&QDoubleSpinBox::valueChanged), this, &SetDayDialog::compute_time); + connect(ui->addBreakButton, &QPushButton::clicked, this, &SetDayDialog::add_break_point); + connect(ui->removeBreakButton, &QPushButton::clicked, this, &SetDayDialog::remove_break_point); + connect(ui->breakList, &QListWidget::currentRowChanged, this, &SetDayDialog::break_selected); ui->total_label->setText(Tools::double_to_string_time(d.get_total())); } +void SetDayDialog::updateBreakList() +{ + ui->breakList->clear(); + foreach (BreakPoint bp, d.getBreaks()) { + ui->breakList->addItem(QString("%1 -> %2").arg(bp.getStart().toString("hh:mm"), bp.getEnd().toString("hh:mm"))); + } +} + void SetDayDialog::compute_time() { + d.set_validate(false); d.set_start(ui->start_edit->time()); d.set_end(ui->end_edit->time()); - d.set_time_break(ui->break_edit->value()); ui->total_label->setText(Tools::double_to_string_time(d.get_total())); } @@ -68,3 +53,34 @@ void SetDayDialog::validate() { d.set_validate(true); accept(); } + +void SetDayDialog::add_break_point() +{ + BreakDialog bd(this); + int result = bd.exec(); + if (result == QDialog::Accepted) { + BreakPoint bp = bd.get_result(); + auto breaks = d.getBreaks(); + breaks.append(bp); + d.setBreaks(breaks); + updateBreakList(); + compute_time(); + } +} + +void SetDayDialog::remove_break_point() +{ + int i = ui->breakList->currentRow(); + if (i > -1) { + auto breaks = d.getBreaks(); + breaks.removeAt(i); + d.setBreaks(breaks); + updateBreakList(); + compute_time(); + } +} + +void SetDayDialog::break_selected(int i) +{ + ui->removeBreakButton->setEnabled(i > -1); +} diff --git a/sources/setdaydialog.h b/sources/setdaydialog.h index 45491e7..cd75d08 100644 --- a/sources/setdaydialog.h +++ b/sources/setdaydialog.h @@ -6,6 +6,8 @@ #include "day.h" #include "tools.h" +#include "breakdialog.h" +#include "breakpoint.h" namespace Ui { class SetDayDialog; @@ -21,9 +23,12 @@ public: Day get_result(); -public slots: +private slots: void compute_time(); void validate(); + void add_break_point(); + void remove_break_point(); + void break_selected(int); private: Ui::SetDayDialog *ui; @@ -31,16 +36,7 @@ private: Day d; void init(); - - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - int m_nMouseClick_X_Coordinate; - int m_nMouseClick_Y_Coordinate; - int xmax; - int xmin; - int ymax; - int ymin; - inline bool isWidgetIsTitleBar(); + void updateBreakList(); }; #endif // SETDAYDIALOG_H diff --git a/sources/welcome.cpp b/sources/welcome.cpp index e211bb2..05ff99f 100644 --- a/sources/welcome.cpp +++ b/sources/welcome.cpp @@ -6,8 +6,6 @@ Welcome::Welcome(Week wtemplate, QWidget *parent) : ui(new Ui::Welcome) { ui->setupUi(this); - ui->window_title->setText(this->windowTitle()); - this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint); w = wtemplate; init(); } @@ -17,26 +15,6 @@ Welcome::~Welcome() delete ui; } -void Welcome::mousePressEvent(QMouseEvent *event) { - m_nMouseClick_X_Coordinate = event->x(); - m_nMouseClick_Y_Coordinate = event->y(); -} - -void Welcome::mouseMoveEvent(QMouseEvent *event) { - if (isWidgetIsTitleBar()) { - move(event->globalX() - m_nMouseClick_X_Coordinate , - event->globalY() - m_nMouseClick_Y_Coordinate); - } - -} - -bool Welcome::isWidgetIsTitleBar() { - return (m_nMouseClick_X_Coordinate >= xmin && - m_nMouseClick_X_Coordinate < xmax && - m_nMouseClick_Y_Coordinate >= ymin && - m_nMouseClick_Y_Coordinate < ymax); -} - void Welcome::init() { set_value_to_widget(); objectId.insert(ui->mon_button->objectName(), Identifier::mon); @@ -44,10 +22,6 @@ void Welcome::init() { objectId.insert(ui->wed_button->objectName(), Identifier::wed); objectId.insert(ui->thu_button->objectName(), Identifier::thu); objectId.insert(ui->fri_button->objectName(), Identifier::fri); - xmax = ui->titleBar->x() + ui->titleBar->width(); - xmin = ui->titleBar->x(); - ymax = ui->titleBar->x() + ui->titleBar->height(); - ymin = ui->titleBar->y(); connect(ui->mon_button, &QPushButton::clicked, this, &Welcome::edit); connect(ui->tue_button, &QPushButton::clicked, this, &Welcome::edit); connect(ui->wed_button, &QPushButton::clicked, this, &Welcome::edit); diff --git a/sources/welcome.h b/sources/welcome.h index 49a51b3..3ebb6fa 100644 --- a/sources/welcome.h +++ b/sources/welcome.h @@ -44,16 +44,6 @@ private: Identifier get_identifier(QString objectName); Day modify_value(Day); - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - int m_nMouseClick_X_Coordinate; - int m_nMouseClick_Y_Coordinate; - int xmax; - int xmin; - int ymax; - int ymin; - inline bool isWidgetIsTitleBar(); - public slots: void edit(); }; diff --git a/sources/year.cpp b/sources/year.cpp new file mode 100644 index 0000000..46264d2 --- /dev/null +++ b/sources/year.cpp @@ -0,0 +1,55 @@ +#include "year.h" + +Year::Year() +{ + +} + +Year::Year(int number) +{ + this->number = number; +} + +Year Year::from_json(QJsonObject obj) +{ + Year result; + result.number = obj[KEY_NUMBER].toInt(); + QJsonArray arr = obj[KEY_WEEKS].toArray(); + foreach (QJsonValue val, arr) { + Week w = Week::from_json(val.toObject()); + result.weeks[w.getWeekNumber()] = w; + } + return result; +} + +QJsonObject Year::to_json() +{ + QJsonObject obj; + QJsonArray arr; + foreach (Week w, weeks) { + arr.append(w.to_json()); + } + obj[KEY_NUMBER] = number; + obj[KEY_WEEKS] = arr; + return obj; +} + +QMap Year::getWeeks() +{ + return weeks; +} + +int Year::getNumber() +{ + return number; +} + +void Year::addWeek(Week w) +{ + weeks[w.getWeekNumber()] = w; +} + +void Year::setWeeks(QMap weeks) +{ + this->weeks = weeks; +} diff --git a/sources/year.h b/sources/year.h new file mode 100644 index 0000000..ce65d94 --- /dev/null +++ b/sources/year.h @@ -0,0 +1,32 @@ +#ifndef YEAR_H +#define YEAR_H + +#define KEY_NUMBER "number" +#define KEY_WEEKS "weeks" + +#include +#include + +#include "week.h" + +class Year +{ +private: + int number; + QMap weeks; + +public: + Year(); + Year(int number); + + static Year from_json(QJsonObject); + QJsonObject to_json(); + + QMap getWeeks(); + int getNumber(); + + void addWeek(Week w); + void setWeeks(QMap weeks); +}; + +#endif // YEAR_H diff --git a/ui/.DS_Store b/ui/.DS_Store new file mode 100644 index 0000000..8603ed3 Binary files /dev/null and b/ui/.DS_Store differ diff --git a/ui/aboutbox.ui b/ui/aboutbox.ui index 708b4cb..7838975 100644 --- a/ui/aboutbox.ui +++ b/ui/aboutbox.ui @@ -71,13 +71,8 @@ 21 - - - Segoe MDL2 Assets - - - + X true @@ -150,7 +145,7 @@ background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgb Information - + 10 @@ -166,7 +161,7 @@ background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgb font-size: 12px; - Author: Alexis Delhaie + Author: Aurélie Delhaie @@ -176,7 +171,7 @@ background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgb font-size: 12px; - Version: 1.0.0 (Beta 5) + Version: 2.0.0 @@ -186,7 +181,7 @@ background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgb font-size: 12px; - <html><head/><body><p>Software: Qt 5.15.0 MSVC2019 64bit (C++17) (<a href="https://github.com/alexlegarnd/Chronos"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/alexlegarnd/Chronos</span></a>)</p></body></html> + <html><head/><body><p>Made with Qt</p></body></html> @@ -196,27 +191,7 @@ background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgb font-size: 12px; - <html><head/><body><p>Save Updater: Rust (<a href="https://github.com/alexlegarnd/chronos-save-updater"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/alexlegarnd/chronos-save-updater</span></a>)</p></body></html> - - - - - - - font-size: 12px; - - - <html><head/><body><p>Installer: Delphi 10.3.3 Community (<a href="https://github.com/alexlegarnd/chronos-installer"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/alexlegarnd/chronos-installer</span></a>)</p></body></html> - - - - - - - font-size: 12px; - - - <html><head/><body><p>Installer Bootstrap: Python 3.8.5 [MSC v.1924 (AMD64)] (<a href="https://github.com/alexlegarnd/chronos-installer-bootstrap"><span style=" text-decoration: underline; color:#0000ff;">https://github.com/alexlegarnd/chronos-installer-bootstrap</span></a>)</p></body></html> + <html><head/><body><p>Save Updater: Rust (<a href="https://github.com/mojitaurelie/chronos-save-updater"><span style=" text-decoration: underline; color:#0068da;">https://github.com/mojitaurelie/chronos-save-updater</span></a>)</p></body></html> @@ -252,16 +227,16 @@ background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgb <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:12px; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Application icon: Alexis Delhaie (me)</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">About box banner: Alexis Delhaie (me)</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Clock image: iconsdb, Iconic (MIT License)</span></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Running image: Icons made by </span><a href="https://www.flaticon.com/authors/freepik"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">Freepik</span></a><span style=" font-size:10pt;"> from </span><a href="https://www.flaticon.com/"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">www.flaticon.com</span></a></p> -<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt; text-decoration: underline; color:#0000ff;"><br /></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Calendar image: Icons made by </span><a href="https://www.flaticon.com/authors/freepik"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">Freepik</span></a><span style=" font-size:10pt;"> from </span><a href="https://www.flaticon.com/"><span style=" font-size:10pt; text-decoration: underline; color:#0000ff;">www.flaticon.com</span></a></p></body></html> +</style></head><body style=" font-family:'.AppleSystemUIFont'; font-size:12px; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Application icon: Alexis Delhaie (me)</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:10pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">About box banner: Alexis Delhaie (me)</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:10pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Clock image: iconsdb, Iconic (MIT License)</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:10pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Running image: Icons made by </span><a href="https://www.flaticon.com/authors/freepik"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">Freepik</span></a><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;"> from </span><a href="https://www.flaticon.com/"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">www.flaticon.com</span></a></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Calendar image: Icons made by </span><a href="https://www.flaticon.com/authors/freepik"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">Freepik</span></a><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;"> from </span><a href="https://www.flaticon.com/"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; text-decoration: underline; color:#0000ff;">www.flaticon.com</span></a></p></body></html> diff --git a/ui/breakdialog.ui b/ui/breakdialog.ui new file mode 100644 index 0000000..581d06e --- /dev/null +++ b/ui/breakdialog.ui @@ -0,0 +1,208 @@ + + + BreakDialog + + + + 0 + 0 + 319 + 187 + + + + + 319 + 187 + + + + + 319 + 187 + + + + Dialog + + + + + 190 + 128 + 113 + 21 + + + + Ajouter + + + false + + + true + + + + + + 180 + 16 + 118 + 31 + + + + true + + + Qt::AlignCenter + + + QAbstractSpinBox::NoButtons + + + QAbstractSpinBox::CorrectToNearestValue + + + + + + 180 + 66 + 118 + 31 + + + + Qt::AlignCenter + + + QAbstractSpinBox::NoButtons + + + QAbstractSpinBox::CorrectToNearestValue + + + + + + 31 + 21 + 141 + 21 + + + + Début de la pause + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 31 + 70 + 141 + 21 + + + + Fin de la pause + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + 20 + 127 + 60 + 16 + + + + + 10 + + + + Temps + + + + + + 22 + 143 + 151 + 31 + + + + + 24 + + + + 0 minutes + + + + + + 190 + 156 + 113 + 21 + + + + Annuler + + + false + + + + + + + validateButton + clicked() + BreakDialog + accept() + + + 246 + 160 + + + 159 + 93 + + + + + cancelButton + clicked() + BreakDialog + reject() + + + 246 + 166 + + + 159 + 93 + + + + + diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui index f2b4935..2c1671a 100644 --- a/ui/mainwindow.ui +++ b/ui/mainwindow.ui @@ -41,8 +41,8 @@ - 165 - 29 + 190 + 9 20 81 @@ -55,9 +55,9 @@ 209 - 39 + 19 151 - 61 + 62 @@ -117,9 +117,9 @@ color: white; 13 - 39 + 19 161 - 61 + 62 @@ -179,9 +179,9 @@ color: white; 400 - 40 + 20 161 - 61 + 62 @@ -240,8 +240,8 @@ color: white; - 351 - 30 + 380 + 10 20 81 @@ -267,9 +267,9 @@ color: white; 44 - 140 + 120 861 - 351 + 388 @@ -1536,7 +1536,7 @@ font-size: 22px; - 20 + 30 530 24 24 @@ -1567,146 +1567,13 @@ font-size: 22px; true - - - - 0 - 0 - 946 - 21 - - - - background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgba(204, 22, 0, 255), stop:1 rgba(217, 0, 112, 255)); - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - 10 - -1 - 121 - 21 - - - - color: rgb(255, 255, 255); -font-size: 11px; -background: none; - - - TextLabel - - - - - - - 0 - 0 - 2 - 573 - - - - border: none; -background-color: rgba(204, 22, 0, 255); - - - Qt::Vertical - - - - - - 944 - 0 - 2 - 573 - - - - border: none; -background-color: rgba(217, 0, 112, 255); - - - Qt::Vertical - - - - - - 0 - 571 - 946 - 2 - - - - border: none; -background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgba(204, 22, 0, 255), stop:1 rgba(217, 0, 112, 255)); - - - Qt::Horizontal - - - - - - 904 - 0 - 41 - 21 - - - - - Segoe MDL2 Assets - - - - - - - true - - - - - - 862 - 0 - 41 - 21 - - - - - Segoe MDL2 Assets - - - - - - - - - - true - - - + 790 - 40 + 20 111 - 54 + 60 @@ -1768,7 +1635,20 @@ background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgb - titleBar + + + + 0 + 100 + 951 + 16 + + + + Qt::Horizontal + + + layoutWidget line layoutWidget layoutWidget @@ -1777,48 +1657,9 @@ background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgb template_settings_button layoutWidget aboutButton - window_border_left - window_border_right - window_border_bottom - closeButton - minimizeButton - dateEdit - label_semaine + line_27 - - - closeButton - clicked() - MainWindow - close() - - - 1186 - 10 - - - 602 - 330 - - - - - minimizeButton - clicked() - MainWindow - showMinimized() - - - 1126 - 15 - - - 602 - 330 - - - - + diff --git a/ui/setdaydialog.ui b/ui/setdaydialog.ui index 51b3f46..5292c8e 100644 --- a/ui/setdaydialog.ui +++ b/ui/setdaydialog.ui @@ -10,19 +10,19 @@ 0 0 419 - 192 + 447 419 - 192 + 447 419 - 192 + 447 @@ -34,9 +34,9 @@ - 210 - 130 - 181 + 200 + 373 + 201 23 @@ -44,15 +44,21 @@ font-size: 12px - Enregistrer la modification + Valider + + + false + + + true - 36 - 69 - 91 + 210 + 16 + 191 31 @@ -62,6 +68,9 @@ QAbstractSpinBox::NoButtons + + QAbstractSpinBox::CorrectToNearestValue + - Définir l'horaire comme valide + Approuver + + + false - + - 0 - 0 - 419 - 21 + 10 + 150 + 181 + 31 - - background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgba(204, 22, 0, 255), stop:1 rgba(217, 0, 112, 255)); + + Pause - - QFrame::StyledPanel + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - QFrame::Raised - - - - - 10 - -1 - 281 - 21 - - - - color: rgb(255, 255, 255); -font-size: 11px; -background: none; - - - TextLabel - - - + - 377 - 0 + 360 + 270 41 21 - - - Segoe MDL2 Assets - + + + + + + false + + + + + false + + + + 320 + 270 + 41 + 20 + - + - - - true + + false - + 0 - 0 - 2 - 192 + 350 + 421 + 20 - - border: none; -background-color: rgba(204, 22, 0, 255); - - - Qt::Vertical - - - - - - 0 - 190 - 419 - 2 - - - - border: none; -background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgba(204, 22, 0, 255), stop:1 rgba(217, 0, 112, 255)); - Qt::Horizontal - + - 417 - 0 - 2 - 192 + 210 + 60 + 191 + 201 - border: none; -background-color: rgba(217, 0, 112, 255); + background-color: rgba(0, 0, 0, 0); +color: rgb(255, 255, 255); - - Qt::Vertical + + QFrame::Panel + + + QFrame::Plain + + + false + + + QAbstractItemView::NoEditTriggers + + + false + + + Qt::IgnoreAction @@ -366,21 +333,5 @@ background-color: rgba(217, 0, 112, 255); - - closeButton - clicked() - SetDayDialog - close() - - - 397 - 10 - - - 209 - 95 - - - diff --git a/ui/welcome.ui b/ui/welcome.ui index c51400e..9ded1e3 100644 --- a/ui/welcome.ui +++ b/ui/welcome.ui @@ -45,7 +45,7 @@ 25 37 261 - 201 + 202 @@ -347,115 +347,6 @@ color: white; - - - - 0 - 0 - 516 - 21 - - - - background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgba(204, 22, 0, 255), stop:1 rgba(217, 0, 112, 255)); - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - 10 - -1 - 371 - 21 - - - - color: rgb(255, 255, 255); -font-size: 11px; -background: none; - - - TextLabel - - - - - - - 514 - 0 - 2 - 276 - - - - border: none; -background-color: rgba(217, 0, 112, 255); - - - Qt::Vertical - - - - - - 0 - 0 - 2 - 276 - - - - border: none; -background-color: rgba(204, 22, 0, 255); - - - Qt::Vertical - - - - - - 0 - 274 - 516 - 2 - - - - border: none; -background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgba(204, 22, 0, 255), stop:1 rgba(217, 0, 112, 255)); - - - Qt::Horizontal - - - - - - 473 - 0 - 41 - 21 - - - - - Segoe MDL2 Assets - - - - - - - true - - @@ -475,21 +366,5 @@ background-color: qlineargradient(spread:pad, x1:0, y1:1, x2:1, y2:1, stop:0 rgb - - closeButton - clicked() - Welcome - close() - - - 493 - 10 - - - 257 - 137 - - -