commit 68f44834deeba5e063cb4eb4245653bf9a824f41 Author: Alexis Delhaie Date: Sun Aug 2 22:17:09 2020 +0200 beta 2 diff --git a/Chronos.pro b/Chronos.pro new file mode 100644 index 0000000..3f2a2de --- /dev/null +++ b/Chronos.pro @@ -0,0 +1,62 @@ +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++17 + +# remove possible other optimization flags +QMAKE_CXXFLAGS_RELEASE -= -O +QMAKE_CXXFLAGS_RELEASE -= -O1 +QMAKE_CXXFLAGS_RELEASE -= -O2 + +# add the desired -O3 if not present +QMAKE_CXXFLAGS_RELEASE *= -O3 + +RC_ICONS = icon.ico + +# The following define makes your compiler emit warnings if you use +# any Qt feature that has been marked deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +SOURCES += \ + sources/aboutbox.cpp \ + sources/day.cpp \ + sources/main.cpp \ + sources/mainwindow.cpp \ + sources/setdaydialog.cpp \ + sources/tools.cpp \ + sources/week.cpp \ + sources/welcome.cpp + +HEADERS += \ + sources/aboutbox.h \ + sources/day.h \ + sources/mainwindow.h \ + sources/setdaydialog.h \ + sources/tools.h \ + sources/week.h \ + sources/welcome.h + +FORMS += \ + ui/aboutbox.ui \ + ui/mainwindow.ui \ + ui/setdaydialog.ui \ + ui/welcome.ui + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target + +DISTFILES += + +RESOURCES += \ + pictures.qrc \ + stylesheets.qrc diff --git a/Chronos.pro.user b/Chronos.pro.user new file mode 100644 index 0000000..278c4e0 --- /dev/null +++ b/Chronos.pro.user @@ -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 MinGW 64-bit + Desktop Qt 5.15.0 MinGW 64-bit + qt.qt5.5150.win64_mingw81_kit + 1 + 0 + 0 + + true + 0 + C:\Users\robof\OneDrive\Documents\build-Chronos-Desktop_Qt_5_15_0_MinGW_64_bit-Debug + C:/Users/robof/OneDrive/Documents/build-Chronos-Desktop_Qt_5_15_0_MinGW_64_bit-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_MinGW_64_bit-Release + C:/Users/robof/OneDrive/Documents/build-Chronos-Desktop_Qt_5_15_0_MinGW_64_bit-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_MinGW_64_bit-Profile + C:/Users/robof/OneDrive/Documents/build-Chronos-Desktop_Qt_5_15_0_MinGW_64_bit-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_MinGW_64_bit-Release + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 22 + + + Version + 22 + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..e36186c Binary files /dev/null and b/README.md differ diff --git a/icon.ico b/icon.ico new file mode 100644 index 0000000..d0018ec Binary files /dev/null and b/icon.ico differ diff --git a/pictures.qrc b/pictures.qrc new file mode 100644 index 0000000..cf84f37 --- /dev/null +++ b/pictures.qrc @@ -0,0 +1,9 @@ + + + pictures/clock-8-128.png + pictures/sport.png + pictures/calendar.png + pictures/about.png + pictures/banner.png + + diff --git a/pictures/about.png b/pictures/about.png new file mode 100644 index 0000000..512ce80 Binary files /dev/null and b/pictures/about.png differ diff --git a/pictures/banner.png b/pictures/banner.png new file mode 100644 index 0000000..44377b8 Binary files /dev/null and b/pictures/banner.png differ diff --git a/pictures/calendar.png b/pictures/calendar.png new file mode 100644 index 0000000..f139a22 Binary files /dev/null and b/pictures/calendar.png differ diff --git a/pictures/clock-8-128.png b/pictures/clock-8-128.png new file mode 100644 index 0000000..fd45a67 Binary files /dev/null and b/pictures/clock-8-128.png differ diff --git a/pictures/sport.png b/pictures/sport.png new file mode 100644 index 0000000..b44e066 Binary files /dev/null and b/pictures/sport.png differ diff --git a/sources/aboutbox.cpp b/sources/aboutbox.cpp new file mode 100644 index 0000000..0688698 --- /dev/null +++ b/sources/aboutbox.cpp @@ -0,0 +1,14 @@ +#include "aboutbox.h" +#include "ui_aboutbox.h" + +AboutBox::AboutBox(QWidget *parent) : + QDialog(parent), + ui(new Ui::AboutBox) +{ + ui->setupUi(this); +} + +AboutBox::~AboutBox() +{ + delete ui; +} diff --git a/sources/aboutbox.h b/sources/aboutbox.h new file mode 100644 index 0000000..58c51bc --- /dev/null +++ b/sources/aboutbox.h @@ -0,0 +1,23 @@ +#ifndef ABOUTBOX_H +#define ABOUTBOX_H + +#include +#include + +namespace Ui { +class AboutBox; +} + +class AboutBox : public QDialog +{ + Q_OBJECT + +public: + explicit AboutBox(QWidget *parent = nullptr); + ~AboutBox(); + +private: + Ui::AboutBox *ui; +}; + +#endif // ABOUTBOX_H diff --git a/sources/day.cpp b/sources/day.cpp new file mode 100644 index 0000000..7d85d38 --- /dev/null +++ b/sources/day.cpp @@ -0,0 +1,66 @@ +#include "day.h" + +Day::Day() +{ + start = QTime(9, 0, 0, 0); + end = QTime(17, 15, 0, 0); + time_break = 45.0; +} + +double Day::get_total() { + int sec = start.secsTo(end); + int minutes = sec / 60; + return (minutes - time_break) / 60; +} + +void Day::set_start(QTime value) +{ + start = value; +} + +void Day::set_end(QTime value) +{ + end = value; +} + +void Day::set_time_break(double value) +{ + time_break = value; +} + +QTime Day::get_start() +{ + return start; +} + +QTime Day::get_end() +{ + return end; +} + +double Day::get_time_break() +{ + return time_break; +} + +QJsonObject Day::to_json() +{ + QJsonObject obj{ + {KEY_START, start.toString(Qt::DateFormat::ISODate)}, + {KEY_END, end.toString(Qt::DateFormat::ISODate)}, + {KEY_BREAK, time_break} + }; + + return obj; +} + +Day Day::from_json(QJsonObject obj) +{ + Day result; + + 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(); + + return result; +} diff --git a/sources/day.h b/sources/day.h new file mode 100644 index 0000000..8b7622c --- /dev/null +++ b/sources/day.h @@ -0,0 +1,37 @@ +#ifndef DAY_H +#define DAY_H + +#define KEY_START "start" +#define KEY_END "end" +#define KEY_BREAK "break" + +#include +#include +#include + +class Day +{ + +private: + QTime start; + QTime end; + double time_break; + +public: + Day(); + + void set_start(QTime value); + void set_end(QTime value); + void set_time_break(double value); + + QTime get_start(); + QTime get_end(); + double get_time_break(); + QJsonObject to_json(); + + double get_total(); + + static Day from_json(QJsonObject); +}; + +#endif // DAY_H diff --git a/sources/main.cpp b/sources/main.cpp new file mode 100644 index 0000000..efe9508 --- /dev/null +++ b/sources/main.cpp @@ -0,0 +1,17 @@ +#include "mainwindow.h" + +#include + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + + QFile styleFile(":/stylesheets/stylesheets/style.qss"); + styleFile.open(QFile::ReadOnly); + QString style(styleFile.readAll()); + a.setStyleSheet(style); + + MainWindow w; + w.show(); + return a.exec(); +} diff --git a/sources/mainwindow.cpp b/sources/mainwindow.cpp new file mode 100644 index 0000000..cf25164 --- /dev/null +++ b/sources/mainwindow.cpp @@ -0,0 +1,199 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +MainWindow::MainWindow(QWidget *parent) + : QMainWindow(parent) + , ui(new Ui::MainWindow) +{ + ui->setupUi(this); + init(); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + +QString MainWindow::get_save_file_path() { + QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation); + if (!QDir(path).exists()) { + QDir().mkpath(path); + } + path += "/data/"; + if (!QDir(path).exists()) { + QDir().mkpath(path); + } + path += SAVE_FILENAME; + return path; +} + +void MainWindow::init() { + objectId.insert(ui->mon_button->objectName(), Identifier::mon); + objectId.insert(ui->tue_button->objectName(), Identifier::tue); + objectId.insert(ui->wed_button->objectName(), Identifier::wed); + objectId.insert(ui->thu_button->objectName(), Identifier::thu); + objectId.insert(ui->fri_button->objectName(), Identifier::fri); + 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); + connect(ui->mon_button, &QPushButton::clicked, this, &MainWindow::edit); + connect(ui->tue_button, &QPushButton::clicked, this, &MainWindow::edit); + connect(ui->wed_button, &QPushButton::clicked, this, &MainWindow::edit); + connect(ui->thu_button, &QPushButton::clicked, this, &MainWindow::edit); + connect(ui->fri_button, &QPushButton::clicked, this, &MainWindow::edit); + if (QFile::exists(get_save_file_path())) { + open_save(); + } else { + Welcome w(week_template); + w.exec(); + week_template = w.get_result(); + } + set_date_to_now(); + compute_time(); +} + +void MainWindow::set_date_to_now() { + auto date = QDate::currentDate(); + ui->dateEdit->setDate(date); +} + +void MainWindow::open_save() { + QFile* file = new QFile(get_save_file_path()); + file->open(QIODevice::ReadOnly); + auto json = QString(file->readAll()); + file->close(); + 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()); + } + } else { + QMessageBox msgBox; + msgBox.setText("Le fichier de sauvegarde n'est pas à jour, " + "des changements ont été apporté a la structure du fichier lors de la dernière mise à jour"); + msgBox.setInformativeText("Mettez à jour votre fichier de sauvegarde puis relancez l'application"); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.setDefaultButton(QMessageBox::Ok); + msgBox.exec(); + QTimer::singleShot(0, this, &MainWindow::close); + } +} + +void MainWindow::save_to_file() { + QJsonArray arr; + for (Week w : weeks) { + arr.append(w.to_json()); + } + QJsonObject obj { + {KEY_TEMPLATE, week_template.to_json()}, + {KEY_WEEKS, arr}, + {KEY_SAVE_FILE_VERSION, SAVE_FILE_VERSION} + }; + QJsonDocument doc(obj); + QFile *f = new QFile(get_save_file_path()); + if (f->open(QIODevice::WriteOnly)) { + f->write(doc.toJson()); + f->close(); + } +} + +void MainWindow::compute_week_number(const QDateTime &dt) { + int n = dt.date().weekNumber(); + 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 (!found) { + current_week = Week(week_template); + current_week.setWeekNumber(n); + weeks.insert(n, current_week); + save_to_file(); + } + compute_time(); +} + +void MainWindow::compute_time() { + ui->mon_time_label->setText(Tools::double_to_string_time(current_week.getMon().get_total())); + ui->tue_time_label->setText(Tools::double_to_string_time(current_week.getTue().get_total())); + ui->wed_time_label->setText(Tools::double_to_string_time(current_week.getWed().get_total())); + ui->thu_time_label->setText(Tools::double_to_string_time(current_week.getThu().get_total())); + ui->fri_time_label->setText(Tools::double_to_string_time(current_week.getFri().get_total())); + ui->total_time_label->setText(Tools::double_to_string_time(current_week.total())); + + double late = 0.0; + double overtime = 0.0; + int todayWeekNumber = QDate::currentDate().weekNumber(); + for (Week w : weeks) { + 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)); +} + +void MainWindow::edit() { + QString name = QObject::sender()->objectName(); + switch (get_identifier(name)) { + case mon: + current_week.setMon(modify_value(current_week.getMon())); + break; + case tue: + current_week.setTue(modify_value(current_week.getTue())); + break; + case wed: + current_week.setWed(modify_value(current_week.getWed())); + break; + case thu: + current_week.setThu(modify_value(current_week.getThu())); + break; + case fri: + current_week.setFri(modify_value(current_week.getFri())); + break; + } + weeks[current_week.getWeekNumber()] = current_week; + save_to_file(); + compute_time(); +} + +Day MainWindow::modify_value(Day d) { + SetDayDialog sdd(d, this); + int result = sdd.exec(); + if (result == QDialog::Accepted) { + return sdd.get_result(); + } + return d; +} + +Identifier MainWindow::get_identifier(QString objectName) { + return objectId[objectName]; +} + +void MainWindow::edit_template() { + Welcome w(week_template); + int res = w.exec(); + if (res == QDialog::Accepted) { + week_template = w.get_result(); + save_to_file(); + compute_time(); + } +} + +void MainWindow::open_about() { + AboutBox a(this); + a.exec(); +} diff --git a/sources/mainwindow.h b/sources/mainwindow.h new file mode 100644 index 0000000..1a0efe9 --- /dev/null +++ b/sources/mainwindow.h @@ -0,0 +1,63 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#define KEY_TEMPLATE "template" +#define KEY_WEEKS "weeks" +#define SAVE_FILENAME "data.json" +#define SAVE_FILE_VERSION 1 +#define KEY_SAVE_FILE_VERSION "version" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "week.h" +#include "welcome.h" +#include "tools.h" +#include "aboutbox.h" + +QT_BEGIN_NAMESPACE +namespace Ui { class MainWindow; } +QT_END_NAMESPACE + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + MainWindow(QWidget *parent = nullptr); + ~MainWindow(); + +signals: + void correctly_started(); + +private: + Ui::MainWindow *ui; + void init(); + void open_save(); + void save_to_file(); + QString get_save_file_path(); + Identifier get_identifier(QString objectName); + Day modify_value(Day); + + Week week_template; + Week current_week; + QMap weeks; + QMap objectId; + +public slots: + void compute_week_number(const QDateTime &dt); + void compute_time(); + void set_date_to_now(); + void edit(); + void edit_template(); + void open_about(); +}; +#endif // MAINWINDOW_H diff --git a/sources/setdaydialog.cpp b/sources/setdaydialog.cpp new file mode 100644 index 0000000..7e486bb --- /dev/null +++ b/sources/setdaydialog.cpp @@ -0,0 +1,37 @@ +#include "setdaydialog.h" +#include "ui_setdaydialog.h" + +SetDayDialog::SetDayDialog(Day d, QWidget *parent) : + QDialog(parent), + ui(new Ui::SetDayDialog) +{ + ui->setupUi(this); + this->d = d; + init(); +} + +SetDayDialog::~SetDayDialog() +{ + delete ui; +} + +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()); + connect(ui->start_edit, &QTimeEdit::timeChanged, this, &SetDayDialog::compute_time); + connect(ui->end_edit, &QTimeEdit::timeChanged, this, &SetDayDialog::compute_time); + connect(ui->break_edit, static_cast(&QDoubleSpinBox::valueChanged), this, &SetDayDialog::compute_time); + ui->total_label->setText(Tools::double_to_string_time(d.get_total())); +} + +void SetDayDialog::compute_time() { + 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())); +} + +Day SetDayDialog::get_result() { + return d; +} diff --git a/sources/setdaydialog.h b/sources/setdaydialog.h new file mode 100644 index 0000000..53fb0a3 --- /dev/null +++ b/sources/setdaydialog.h @@ -0,0 +1,34 @@ +#ifndef SETDAYDIALOG_H +#define SETDAYDIALOG_H + +#include + +#include "day.h" +#include "tools.h" + +namespace Ui { +class SetDayDialog; +} + +class SetDayDialog : public QDialog +{ + Q_OBJECT + +public: + explicit SetDayDialog(Day d, QWidget *parent = nullptr); + ~SetDayDialog(); + + Day get_result(); + +public slots: + void compute_time(); + +private: + Ui::SetDayDialog *ui; + + Day d; + + void init(); +}; + +#endif // SETDAYDIALOG_H diff --git a/sources/tools.cpp b/sources/tools.cpp new file mode 100644 index 0000000..9b73339 --- /dev/null +++ b/sources/tools.cpp @@ -0,0 +1,14 @@ +#include "tools.h" + +QString Tools::double_to_string_time(double value) { + const int h = floor(value); + value -= h; + value = value * 60; + if (value == 0.0) { + return QString("%1h").arg(QString::number(h)); + } else if (value < 10.0) { + return QString("%1h0%2").arg(QString::number(h), QString::number(round(value))); + } + + return QString("%1h%2").arg(QString::number(h), QString::number(round(value))); +} diff --git a/sources/tools.h b/sources/tools.h new file mode 100644 index 0000000..f317151 --- /dev/null +++ b/sources/tools.h @@ -0,0 +1,13 @@ +#ifndef TOOLS_H +#define TOOLS_H + +#include +#include + +class Tools +{ +public: + static QString double_to_string_time(double value); +}; + +#endif // TOOLS_H diff --git a/sources/week.cpp b/sources/week.cpp new file mode 100644 index 0000000..88e8de8 --- /dev/null +++ b/sources/week.cpp @@ -0,0 +1,86 @@ +#include "week.h" + +Week::Week() +{ + mon = Day(); + tue = Day(); + wed = Day(); + thu = Day(); + fri = Day(); + week_number = 0; +} + +Week Week::from_json(QJsonObject obj) { + Week w; + w.mon = Day::from_json(obj[MONDAY].toObject()); + w.tue = Day::from_json(obj[TUESDAY].toObject()); + w.wed = Day::from_json(obj[WEDNESDAY].toObject()); + w.thu = Day::from_json(obj[THURDAY].toObject()); + w.fri = Day::from_json(obj[FRIDAY].toObject()); + w.week_number = obj[WEEK_NUMBER].toInt(); + return w; +} + +QJsonObject Week::to_json() { + QJsonObject obj { + {MONDAY, mon.to_json()}, + {TUESDAY, tue.to_json()}, + {WEDNESDAY, wed.to_json()}, + {THURDAY, thu.to_json()}, + {FRIDAY, fri.to_json()}, + {WEEK_NUMBER, week_number} + }; + return obj; +} + +double Week::total() { + return mon.get_total() + tue.get_total() + wed.get_total() + thu.get_total() + fri.get_total(); +} + +Day Week::getMon() { + return mon; +} + +Day Week::getTue() { + return tue; +} + +Day Week::getWed() { + return wed; +} + +Day Week::getThu() { + return thu; +} + +Day Week::getFri() { + return fri; +} + +int Week::getWeekNumber() { + return week_number; +} + +void Week::setMon(Day value) { + mon = value; +} + +void Week::setTue(Day value) { + tue = value; +} + +void Week::setWed(Day value) { + wed = value; +} + +void Week::setThu(Day value) { + thu = value; +} + +void Week::setFri(Day value) { + fri = value; +} + +void Week::setWeekNumber(int value) { + week_number = value; +} diff --git a/sources/week.h b/sources/week.h new file mode 100644 index 0000000..ae8d817 --- /dev/null +++ b/sources/week.h @@ -0,0 +1,46 @@ +#ifndef WEEK_H +#define WEEK_H + +#define MONDAY "monday" +#define TUESDAY "tuesday" +#define WEDNESDAY "wednesday" +#define THURDAY "thurday" +#define FRIDAY "friday" +#define WEEK_NUMBER "weekNumber" + +#include +#include "day.h" + +class Week +{ +public: + Week(); + double total(); + + void setMon(Day); + void setTue(Day); + void setWed(Day); + void setThu(Day); + void setFri(Day); + void setWeekNumber(int); + + Day getMon(); + Day getTue(); + Day getWed(); + Day getThu(); + Day getFri(); + int getWeekNumber(); + + static Week from_json(QJsonObject); + QJsonObject to_json(); + +private: + Day mon; + Day tue; + Day wed; + Day thu; + Day fri; + int week_number; +}; + +#endif // WEEK_H diff --git a/sources/welcome.cpp b/sources/welcome.cpp new file mode 100644 index 0000000..1e4488d --- /dev/null +++ b/sources/welcome.cpp @@ -0,0 +1,79 @@ +#include "welcome.h" +#include "ui_welcome.h" + +Welcome::Welcome(Week wtemplate, QWidget *parent) : + QDialog(parent), + ui(new Ui::Welcome) +{ + ui->setupUi(this); + w = wtemplate; + init(); +} + +Welcome::~Welcome() +{ + delete ui; +} + +void Welcome::init() { + set_value_to_widget(); + objectId.insert(ui->mon_button->objectName(), Identifier::mon); + objectId.insert(ui->tue_button->objectName(), Identifier::tue); + objectId.insert(ui->wed_button->objectName(), Identifier::wed); + objectId.insert(ui->thu_button->objectName(), Identifier::thu); + objectId.insert(ui->fri_button->objectName(), Identifier::fri); + 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); + connect(ui->thu_button, &QPushButton::clicked, this, &Welcome::edit); + connect(ui->fri_button, &QPushButton::clicked, this, &Welcome::edit); +} + +Week Welcome::get_result() { + return w; +} + +void Welcome::set_value_to_widget() { + ui->mon_time_label->setText(Tools::double_to_string_time(w.getMon().get_total())); + ui->tue_time_label->setText(Tools::double_to_string_time(w.getTue().get_total())); + ui->wed_time_label->setText(Tools::double_to_string_time(w.getWed().get_total())); + ui->thu_time_label->setText(Tools::double_to_string_time(w.getThu().get_total())); + ui->fri_time_label->setText(Tools::double_to_string_time(w.getFri().get_total())); + ui->total->setText(Tools::double_to_string_time(w.total())); +} + +void Welcome::edit() { + QString name = QObject::sender()->objectName(); + switch (get_identifier(name)) { + case mon: + w.setMon(modify_value(w.getMon())); + break; + case tue: + w.setTue(modify_value(w.getTue())); + break; + case wed: + w.setWed(modify_value(w.getWed())); + break; + case thu: + w.setThu(modify_value(w.getThu())); + break; + case fri: + w.setFri(modify_value(w.getFri())); + break; + } + set_value_to_widget(); +} + +Day Welcome::modify_value(Day d) { + SetDayDialog sdd(d, this); + int result = sdd.exec(); + if (result == QDialog::Accepted) { + return sdd.get_result(); + } + return d; +} + +Identifier Welcome::get_identifier(QString objectName) { + return objectId[objectName]; +} + diff --git a/sources/welcome.h b/sources/welcome.h new file mode 100644 index 0000000..c310d01 --- /dev/null +++ b/sources/welcome.h @@ -0,0 +1,50 @@ +#ifndef WELCOME_H +#define WELCOME_H + +#include +#include +#include + +#include "week.h" +#include "day.h" +#include "tools.h" +#include "setdaydialog.h" + +enum Identifier { + mon = 1, + tue = 2, + wed = 3, + thu = 4, + fri = 5 +}; + +namespace Ui { +class Welcome; +} + +class Welcome : public QDialog +{ + Q_OBJECT + +public: + explicit Welcome(Week tpl, QWidget *parent = nullptr); + ~Welcome(); + + Week get_result(); + +private: + Ui::Welcome *ui; + + Week w; + QMap objectId; + + void init(); + void set_value_to_widget(); + Identifier get_identifier(QString objectName); + Day modify_value(Day); + +public slots: + void edit(); +}; + +#endif // WELCOME_H diff --git a/stylesheets.qrc b/stylesheets.qrc new file mode 100644 index 0000000..feeffec --- /dev/null +++ b/stylesheets.qrc @@ -0,0 +1,5 @@ + + + stylesheets/style.qss + + diff --git a/stylesheets/style.qss b/stylesheets/style.qss new file mode 100644 index 0000000..a33f0ee --- /dev/null +++ b/stylesheets/style.qss @@ -0,0 +1,395 @@ +/* +Material Dark Style Sheet for QT Applications +Author: Jaime A. Quiroga P. +Inspired on https://github.com/jxfwinter/qt-material-stylesheet +Company: GTRONICK +Last updated: 04/12/2018, 15:00. +Available at: https://github.com/GTRONICK/QSS/blob/master/MaterialDark.qss +*/ + +* { + font-size: 16px; +} + +QMainWindow { + background-color:#1e1d23; +} +QDialog { + background-color:#1e1d23; +} +QColorDialog { + background-color:#1e1d23; +} +QTextEdit { + background-color:#1e1d23; + color: #a9b7c6; +} +QPlainTextEdit { + selection-background-color:#007b50; + background-color:#1e1d23; + border-style: solid; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: transparent; + border-bottom-color: transparent; + border-width: 1px; + color: #a9b7c6; +} +QPushButton{ + border-style: solid; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: transparent; + border-bottom-color: transparent; + border-width: 1px; + border-style: solid; + color: #a9b7c6; + padding: 2px; + background-color: #1e1d23; +} +QPushButton::default{ + border-style: inset; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: transparent; + border-bottom-color: #04b97f; + border-width: 1px; + color: #a9b7c6; + padding: 2px; + background-color: #1e1d23; +} +QToolButton { + border-style: solid; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: transparent; + border-bottom-color: #04b97f; + border-bottom-width: 1px; + border-style: solid; + color: #a9b7c6; + padding: 2px; + background-color: #1e1d23; +} +QToolButton:hover{ + border-style: solid; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: transparent; + border-bottom-color: #37efba; + border-bottom-width: 2px; + border-style: solid; + color: #FFFFFF; + padding-bottom: 1px; + background-color: #1e1d23; +} +QPushButton:hover{ + border-style: solid; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: transparent; + border-bottom-color: #37efba; + border-bottom-width: 1px; + border-style: solid; + color: #FFFFFF; + padding-bottom: 2px; + background-color: #1e1d23; +} +QPushButton:pressed{ + border-style: solid; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: transparent; + border-bottom-color: #37efba; + border-bottom-width: 2px; + border-style: solid; + color: #37efba; + padding-bottom: 1px; + background-color: #1e1d23; +} +QPushButton:disabled{ + border-style: solid; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: transparent; + border-bottom-color: #808086; + border-bottom-width: 2px; + border-style: solid; + color: #808086; + padding-bottom: 1px; + background-color: #1e1d23; +} +QLineEdit { + border-width: 1px; border-radius: 4px; + border-color: rgb(58, 58, 58); + border-style: inset; + padding: 0 8px; + color: #a9b7c6; + background:#1e1d23; + selection-background-color:#007b50; + selection-color: #FFFFFF; +} +QLabel { + color: #a9b7c6; +} +QLCDNumber { + color: #37e6b4; +} +QProgressBar { + text-align: center; + color: rgb(240, 240, 240); + border-width: 1px; + border-radius: 10px; + border-color: rgb(58, 58, 58); + border-style: inset; + background-color:#1e1d23; +} +QProgressBar::chunk { + background-color: #04b97f; + border-radius: 5px; +} +QMenuBar { + background-color: #1e1d23; +} +QMenuBar::item { + color: #a9b7c6; + spacing: 3px; + padding: 1px 4px; + background: #1e1d23; +} + +QMenuBar::item:selected { + background:#1e1d23; + color: #FFFFFF; +} +QMenu::item:selected { + border-style: solid; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: #04b97f; + border-bottom-color: transparent; + border-left-width: 2px; + color: #FFFFFF; + padding-left:15px; + padding-top:4px; + padding-bottom:4px; + padding-right:7px; + background-color: #1e1d23; +} +QMenu::item { + border-style: solid; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: transparent; + border-bottom-color: transparent; + border-bottom-width: 1px; + border-style: solid; + color: #a9b7c6; + padding-left:17px; + padding-top:4px; + padding-bottom:4px; + padding-right:7px; + background-color: #1e1d23; +} +QMenu{ + background-color:#1e1d23; +} +QTabWidget { + color:rgb(0,0,0); + background-color:#1e1d23; +} +QTabWidget::pane { + border-color: rgb(77,77,77); + background-color:#1e1d23; + border-style: solid; + border-width: 1px; + border-radius: 6px; +} +QTabBar::tab { + border-style: solid; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: transparent; + border-bottom-color: transparent; + border-bottom-width: 1px; + border-style: solid; + color: #808086; + padding: 3px; + margin-left:3px; + background-color: #1e1d23; +} +QTabBar::tab:selected, QTabBar::tab:last:selected, QTabBar::tab:hover { + border-style: solid; + border-top-color: transparent; + border-right-color: transparent; + border-left-color: transparent; + border-bottom-color: #04b97f; + border-bottom-width: 2px; + border-style: solid; + color: #FFFFFF; + padding-left: 3px; + padding-bottom: 2px; + margin-left:3px; + background-color: #1e1d23; +} + +QCheckBox { + color: #a9b7c6; + padding: 2px; +} +QCheckBox:disabled { + color: #808086; + padding: 2px; +} + +QCheckBox:hover { + border-radius:4px; + border-style:solid; + padding-left: 1px; + padding-right: 1px; + padding-bottom: 1px; + padding-top: 1px; + border-width:1px; + border-color: rgb(87, 97, 106); + background-color:#1e1d23; +} +QCheckBox::indicator:checked { + + height: 10px; + width: 10px; + border-style:solid; + border-width: 1px; + border-color: #04b97f; + color: #a9b7c6; + background-color: #04b97f; +} +QCheckBox::indicator:unchecked { + + height: 10px; + width: 10px; + border-style:solid; + border-width: 1px; + border-color: #04b97f; + color: #a9b7c6; + background-color: transparent; +} +QRadioButton { + color: #a9b7c6; + background-color: #1e1d23; + padding: 1px; +} +QRadioButton::indicator:checked { + height: 10px; + width: 10px; + border-style:solid; + border-radius:5px; + border-width: 1px; + border-color: #04b97f; + color: #a9b7c6; + background-color: #04b97f; +} +QRadioButton::indicator:!checked { + height: 10px; + width: 10px; + border-style:solid; + border-radius:5px; + border-width: 1px; + border-color: #04b97f; + color: #a9b7c6; + background-color: transparent; +} +QStatusBar { + color:#027f7f; +} +QSpinBox { + color: #a9b7c6; + background-color: #1e1d23; +} +QDoubleSpinBox { + color: #a9b7c6; + background-color: #1e1d23; +} +QTimeEdit { + color: #a9b7c6; + background-color: #1e1d23; +} +QDateTimeEdit { + color: #a9b7c6; + background-color: #1e1d23; +} +QDateEdit { + color: #a9b7c6; + background-color: #1e1d23; +} +QComboBox { + color: #a9b7c6; + background: #1e1d23; +} +QComboBox:editable { + background: #1e1d23; + color: #a9b7c6; + selection-background-color: #1e1d23; +} +QComboBox QAbstractItemView { + color: #a9b7c6; + background: #1e1d23; + selection-color: #FFFFFF; + selection-background-color: #1e1d23; +} +QComboBox:!editable:on, QComboBox::drop-down:editable:on { + color: #a9b7c6; + background: #1e1d23; +} +QFontComboBox { + color: #a9b7c6; + background-color: #1e1d23; +} +QToolBox { + color: #a9b7c6; + background-color: #1e1d23; +} +QToolBox::tab { + color: #a9b7c6; + background-color: #1e1d23; +} +QToolBox::tab:selected { + color: #FFFFFF; + background-color: #1e1d23; +} +QScrollArea { + color: #FFFFFF; + background-color: #1e1d23; +} +QSlider::groove:horizontal { + height: 5px; + background: #04b97f; +} +QSlider::groove:vertical { + width: 5px; + background: #04b97f; +} +QSlider::handle:horizontal { + background: qlineargradient(x1:0, y1:0, x2:1, y2:1, stop:0 #b4b4b4, stop:1 #8f8f8f); + border: 1px solid #5c5c5c; + width: 14px; + margin: -5px 0; + border-radius: 7px; +} +QSlider::handle:vertical { + background: qlineargradient(x1:1, y1:1, x2:0, y2:0, stop:0 #b4b4b4, stop:1 #8f8f8f); + border: 1px solid #5c5c5c; + height: 14px; + margin: 0 -5px; + border-radius: 7px; +} +QSlider::add-page:horizontal { + background: white; +} +QSlider::add-page:vertical { + background: white; +} +QSlider::sub-page:horizontal { + background: #04b97f; +} +QSlider::sub-page:vertical { + background: #04b97f; +} \ No newline at end of file diff --git a/ui/aboutbox.ui b/ui/aboutbox.ui new file mode 100644 index 0000000..15073ad --- /dev/null +++ b/ui/aboutbox.ui @@ -0,0 +1,182 @@ + + + AboutBox + + + Qt::ApplicationModal + + + + 0 + 0 + 707 + 363 + + + + + 707 + 363 + + + + + 707 + 363 + + + + À propos de Chronos + + + true + + + + + 0 + 0 + 707 + 111 + + + + + 707 + 111 + + + + + 707 + 111 + + + + border-image: url(:/clock/pictures/banner.png); + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + 30 + 150 + 551 + 21 + + + + font-size: 12px; + + + Author: Alexis Delhaie + + + + + + 30 + 190 + 551 + 21 + + + + font-size: 12px; + + + Version: 1.0.0 (Beta 2) + + + + + + 30 + 230 + 541 + 21 + + + + font-size: 12px; + + + Made with Qt 5.15.0 MinGW 64bit (C++17) + + + + + + 390 + 160 + 301 + 181 + + + + + + + false + + + true + + + <!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:7.5pt; 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> + + + + + + 393 + 130 + 211 + 21 + + + + font-size: 12px; + + + Third party: + + + + + + 30 + 270 + 541 + 21 + + + + font-size: 12px; + + + Installer/Updater made with Delphi 10.3 Community + + + + + + diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui new file mode 100644 index 0000000..14833d5 --- /dev/null +++ b/ui/mainwindow.ui @@ -0,0 +1,705 @@ + + + MainWindow + + + + 0 + 0 + 1206 + 649 + + + + + 1206 + 649 + + + + + 1206 + 649 + + + + + + + Chronos + + + + + + + + + 192 + 19 + 20 + 81 + + + + Qt::Vertical + + + + + + 240 + 29 + 141 + 61 + + + + + + + + 59 + 59 + + + + + 59 + 59 + + + + border-image: url(:/clock/pictures/sport.png) 0 0 0 0 stretch stretch; + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + font-size: 14px; + + + Retard + + + + + + + font-size: 28px; +color: white; + + + 0h + + + + + + + + + + + 40 + 29 + 141 + 61 + + + + + + + + 59 + 59 + + + + + 59 + 59 + + + + border-image: url(:/clock/pictures/clock-8-128.png) 0 0 0 0 stretch stretch; + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + font-size: 14px; + + + Temps total + + + + + + + font-size: 28px; +color: white; + + + 0h + + + + + + + + + + + 1022 + 23 + 153 + 61 + + + + + + + + + + + + Date : + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 100 + 32 + + + + + 100 + 32 + + + + + + + border: 1px solid white + + + false + + + false + + + QAbstractSpinBox::NoButtons + + + QAbstractSpinBox::CorrectToNearestValue + + + true + + + + + + + + + + + + Semaine : 0 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + 427 + 30 + 141 + 61 + + + + + + + + 59 + 59 + + + + + 59 + 59 + + + + border-image: url(:/clock/pictures/calendar.png) 0 0 0 0 stretch stretch; + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + font-size: 14px; + + + Avance + + + + + + + font-size: 28px; +color: white; + + + 0h + + + + + + + + + + + 378 + 20 + 20 + 81 + + + + Qt::Vertical + + + + + + 930 + 600 + 261 + 31 + + + + Modifier la semaine de référence + + + + + + 129 + 247 + 911 + 191 + + + + + 45 + + + + + + + + 0 + 42 + + + + color: white; +font-size: 22px; + + + Lundi + + + Qt::AlignCenter + + + + + + + + 0 + 42 + + + + font-size: 28px; +color: white; + + + 0h + + + Qt::AlignCenter + + + + + + + + 0 + 31 + + + + Modifier + + + + + + + + + Qt::Vertical + + + + + + + + + + 0 + 42 + + + + color: white; +font-size: 22px; + + + Mardi + + + Qt::AlignCenter + + + + + + + + 0 + 42 + + + + font-size: 28px; +color: white; + + + 0h + + + Qt::AlignCenter + + + + + + + + 0 + 31 + + + + Modifier + + + + + + + + + Qt::Vertical + + + + + + + + + + 0 + 42 + + + + color: white; +font-size: 22px; + + + Mercredi + + + Qt::AlignCenter + + + + + + + + 0 + 42 + + + + font-size: 28px; +color: white; + + + 0h + + + Qt::AlignCenter + + + + + + + + 0 + 31 + + + + Modifier + + + + + + + + + Qt::Vertical + + + + + + + + + + 0 + 42 + + + + color: white; +font-size: 22px; + + + Jeudi + + + Qt::AlignCenter + + + + + + + + 0 + 42 + + + + font-size: 28px; +color: white; + + + 0h + + + Qt::AlignCenter + + + + + + + + 0 + 31 + + + + Modifier + + + + + + + + + Qt::Vertical + + + + + + + + + + 0 + 42 + + + + color: white; +font-size: 22px; + + + Vendredi + + + Qt::AlignCenter + + + + + + + + 0 + 42 + + + + font-size: 28px; +color: white; + + + 0h + + + Qt::AlignCenter + + + + + + + + 0 + 31 + + + + Modifier + + + + + + + + + + + 20 + 588 + 44 + 44 + + + + + 44 + 44 + + + + + 44 + 44 + + + + false + + + border-image: url(:/clock/pictures/about.png) 0 0 0 0 stretch stretch; + + + + + + true + + + + + + + diff --git a/ui/setdaydialog.ui b/ui/setdaydialog.ui new file mode 100644 index 0000000..faaf658 --- /dev/null +++ b/ui/setdaydialog.ui @@ -0,0 +1,242 @@ + + + SetDayDialog + + + Qt::WindowModal + + + + 0 + 0 + 419 + 177 + + + + + 419 + 177 + + + + + 419 + 177 + + + + Modifier un jour + + + true + + + + + 320 + 140 + 75 + 23 + + + + Valider + + + + + + 40 + 49 + 91 + 31 + + + + Qt::AlignCenter + + + QAbstractSpinBox::NoButtons + + + + + + + + + 300 + 49 + 91 + 31 + + + + Qt::AlignCenter + + + QAbstractSpinBox::NoButtons + + + + + + + + + 170 + 49 + 91 + 31 + + + + Qt::AlignCenter + + + QAbstractSpinBox::NoButtons + + + 0.450000000000000 + + + + + + 40 + 9 + 91 + 31 + + + + Arrivé + + + Qt::AlignCenter + + + + + + 170 + 9 + 91 + 31 + + + + Pause + + + Qt::AlignCenter + + + + + + 300 + 9 + 91 + 31 + + + + Départ + + + Qt::AlignCenter + + + + + + 40 + 103 + 141 + 61 + + + + + + + + 59 + 59 + + + + + 59 + 59 + + + + border-image: url(:/clock/pictures/clock-8-128.png) 0 0 0 0 stretch stretch; + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + font-size: 14px; + + + Temps total + + + + + + + font-size: 28px; +color: white; + + + 0h + + + + + + + + + + + + pushButton + clicked() + SetDayDialog + accept() + + + 357 + 151 + + + 209 + 88 + + + + + diff --git a/ui/welcome.ui b/ui/welcome.ui new file mode 100644 index 0000000..8fc5c2e --- /dev/null +++ b/ui/welcome.ui @@ -0,0 +1,370 @@ + + + Welcome + + + Qt::ApplicationModal + + + + 0 + 0 + 516 + 276 + + + + + 516 + 276 + + + + + 516 + 276 + + + + + 11 + + + + Définir le temps de travail + + + + + + true + + + + + 30 + 20 + 261 + 201 + + + + + 11 + + + + + + + + + + 11 + + + + Lundi + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Qt::Vertical + + + + + + + 0h + + + + + + + Modifier + + + false + + + + + + + + + + + + 11 + + + + Mardi + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Qt::Vertical + + + + + + + 0h + + + + + + + Modifier + + + false + + + + + + + + + + + + 11 + + + + Mercredi + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Qt::Vertical + + + + + + + 0h + + + + + + + Modifier + + + false + + + + + + + + + + + + 11 + + + + Jeudi + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Qt::Vertical + + + + + + + 0h + + + + + + + Modifier + + + false + + + + + + + + + + + + 11 + + + + Vendredi + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Qt::Vertical + + + + + + + 0h + + + + + + + Modifier + + + false + + + + + + + + + + + 400 + 230 + 93 + 28 + + + + + 11 + + + + + + + &Valider + + + false + + + true + + + false + + + + + + 300 + 60 + 201 + 103 + + + + + + + + 11 + + + + Temps total + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + -1 + + + + font-size: 28px; +color: white; + + + 0h + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + + + pushButton + clicked() + Welcome + accept() + + + 446 + 243 + + + 257 + 137 + + + + +