Refresh GUI

This commit is contained in:
Aurélie Delhaie
2022-09-28 21:14:10 +02:00
parent 877fde22e0
commit a6593a0151
6 changed files with 1074 additions and 1333 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
*.pro.*

View File

@@ -3,8 +3,8 @@ greaterThan(QT_MAJOR_VERSION, 5): QT += widgets
CONFIG += c++17 CONFIG += c++17
win32:VERSION = 2.2.1.0 # major.minor.patch.build win32:VERSION = 2.3.0.0 # major.minor.patch.build
else:VERSION = 2.2.1 # major.minor.patch else:VERSION = 2.3.0 # major.minor.patch
DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\" DEFINES += APP_VERSION=\"\\\"$${VERSION}\\\"\"
@@ -48,21 +48,23 @@ macx {
} }
} }
linux-g++* { linux-* {
message("Build for Linux") message("Build for Linux")
DEFINES += APP_OS=\"\\\"$$system(cat /etc/issue | cut -d\' \' -f1)\\\"\" DEFINES += APP_OS=\"\\\"$$system(cat /etc/issue | cut -d\' \' -f1)\\\"\"
DEFINES += APP_OS_VERSION=\"\\\"$$system(uname -r)\\\"\" DEFINES += APP_OS_VERSION=\"\\\"$$system(uname -r)\\\"\"
DEFINES += APP_ARCH=\"\\\"amd64\\\"\" DEFINES += APP_ARCH=\"\\\"$$system(uname -m)\\\"\"
QMAKE_CXXFLAGS_RELEASE *= -O3 ARCH = $$system(uname -m)
equals(ARCH, aarch64) {
message("CPU Architecture : aarch64")
QMAKE_CXXFLAGS_RELEASE += -mtune=cortex-a72
}
equals(ARCH, amd64) {
message("CPU Architecture : amd64")
QMAKE_CXXFLAGS_RELEASE += -march=skylake QMAKE_CXXFLAGS_RELEASE += -march=skylake
VERSION = 1.1.0 }
QMAKE_CXXFLAGS_RELEASE *= -O3
} }
# add the desired -O3 if not present, MinGW only
# QMAKE_CXXFLAGS_RELEASE *= -O3
# The following define makes your compiler emit warnings if you use # The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings # any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the # depend on your compiler). Please consult the documentation of the

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 6.0.2, 2022-04-09T20:00:14. --> <!-- Written by QtCreator 8.0.1, 2022-09-28T21:10:13. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
<value type="QByteArray">{23c6a5b6-2840-4c04-84d4-91387dc9bb9f}</value> <value type="QByteArray">{0573a7c9-abc6-4015-92f3-a282f03c4c02}</value>
</data> </data>
<data> <data>
<variable>ProjectExplorer.Project.ActiveTarget</variable> <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -70,14 +70,11 @@
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/> <valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
<value type="int" key="AutoTest.RunAfterBuild">0</value> <value type="int" key="AutoTest.RunAfterBuild">0</value>
<value type="bool" key="AutoTest.UseGlobal">true</value> <value type="bool" key="AutoTest.UseGlobal">true</value>
<valuelist type="QVariantList" key="ClangCodeModel.CustomCommandLineKey"/>
<value type="bool" key="ClangCodeModel.UseGlobalConfig">true</value>
<value type="QString" key="ClangCodeModel.WarningConfigId">Builtin.BuildSystem</value>
<valuemap type="QVariantMap" key="ClangTools"> <valuemap type="QVariantMap" key="ClangTools">
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value> <value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value> <value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value> <value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">8</value> <value type="int" key="ClangTools.ParallelJobs">3</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/> <valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/> <valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/> <valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
@@ -89,16 +86,16 @@
<variable>ProjectExplorer.Project.Target.0</variable> <variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value type="QString" key="DeviceType">Desktop</value> <value type="QString" key="DeviceType">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.2.3 GCC 64bit</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.2.3 GCC 64bit</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.623.gcc_64_kit</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{2ec0b4a4-ede9-4dae-8af2-a01a18376181}</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> <value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> <value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> <value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="int" key="EnableQmlDebugging">0</value> <value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Debug</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/aurelie/Documents/build-Chronos-Desktop-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Debug</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/home/aurelie/Documents/build-Chronos-Desktop-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -136,8 +133,8 @@
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Release</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/aurelie/Documents/build-Chronos-Desktop-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Release</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/home/aurelie/Documents/build-Chronos-Desktop-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -177,8 +174,8 @@
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="int" key="EnableQmlDebugging">0</value> <value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Profile</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/aurelie/Documents/build-Chronos-Desktop-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Profile</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">/home/aurelie/Documents/build-Chronos-Desktop-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@@ -238,14 +235,14 @@
<valuelist type="QVariantList" key="CustomOutputParsers"/> <valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value> <value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/aurelie/src/Chronos/Chronos.pro</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/aurelie/Documents/Chronos/Chronos.pro</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/aurelie/src/Chronos/Chronos.pro</value> <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/aurelie/Documents/Chronos/Chronos.pro</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value> <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value> <value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/aurelie/src/build-Chronos-Desktop_Qt_6_2_3_GCC_64bit-Debug</value> <value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/aurelie/Documents/build-Chronos-Desktop-Debug</value>
</valuemap> </valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value> <value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap> </valuemap>

View File

@@ -76,23 +76,23 @@ void MainWindow::highlightDayOfWeek() {
ui->today_button->setDisabled(true); ui->today_button->setDisabled(true);
switch (dayOfWeek) { switch (dayOfWeek) {
case 1: { case 1: {
ui->monLabel->setText(QString("> %1 <").arg(ui->monLabel->text())); ui->monLabel->setText(QString("%1 <").arg(ui->monLabel->text()));
break; break;
} }
case 2: { case 2: {
ui->tueLabel->setText(QString("> %1 <").arg(ui->tueLabel->text())); ui->tueLabel->setText(QString("%1 <").arg(ui->tueLabel->text()));
break; break;
} }
case 3: { case 3: {
ui->wedLabel->setText(QString("> %1 <").arg(ui->wedLabel->text())); ui->wedLabel->setText(QString("%1 <").arg(ui->wedLabel->text()));
break; break;
} }
case 4: { case 4: {
ui->thuLabel->setText(QString("> %1 <").arg(ui->thuLabel->text())); ui->thuLabel->setText(QString("%1 <").arg(ui->thuLabel->text()));
break; break;
} }
case 5: { case 5: {
ui->friLabel->setText(QString("> %1 <").arg(ui->friLabel->text())); ui->friLabel->setText(QString("%1 <").arg(ui->friLabel->text()));
break; break;
} }
default: break; default: break;

View File

@@ -2,12 +2,12 @@
QString Tools::double_to_string_time(double value) { QString Tools::double_to_string_time(double value) {
const int h = floor(value); const int h = floor(value);
value = round((value - h) * 60); int m = round((value - h) * 60);
if (value == 0.0) { if (m == 0) {
return QString("%1h").arg(QString::number(h)); return QString("%1h").arg(QString::number(h));
} else if (value < 10.0) { } else if (m < 10) {
return QString("%1h0%2").arg(QString::number(h), QString::number(value)); return QString("%1h0%2").arg(QString::number(h), QString::number(m));
} }
return QString("%1h%2").arg(QString::number(h), QString::number(value)); return QString("%1h%2").arg(QString::number(h), QString::number(m));
} }

File diff suppressed because it is too large Load Diff