Skip to content

Commit 2aea3ec

Browse files
committed
Initial Code Load
1 parent 10f8a94 commit 2aea3ec

40 files changed

Lines changed: 6959 additions & 0 deletions

CMakeLists.txt

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
cmake_minimum_required(VERSION 3.5)
2+
3+
project(TaskGuard VERSION 1.1.0 LANGUAGES CXX)
4+
5+
set(CMAKE_AUTOUIC ON)
6+
set(CMAKE_AUTOMOC ON)
7+
set(CMAKE_AUTORCC ON)
8+
9+
set(CMAKE_CXX_STANDARD 17)
10+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
11+
12+
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets LinguistTools Sql)
13+
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets LinguistTools Sql)
14+
15+
find_package(OpenSSL REQUIRED)
16+
include_directories(${OPENSSL_INCLUDE_DIR})
17+
18+
set(TS_FILES TaskGuard_en_US.ts)
19+
20+
set(PROJECT_SOURCES
21+
main.cpp
22+
loginwindow.h loginwindow.cpp loginwindow.ui
23+
mainwindow.cpp mainwindow.h mainwindow.ui
24+
textindentdelegate.h textindentdelegate.cpp
25+
about_author.h about_author.cpp about_author.ui
26+
about_qt_window.h about_qt_window.cpp about_qt_window.ui
27+
encryption.h encryption.cpp encryption.ui
28+
version.h
29+
string_encryption.h string_encryption.cpp
30+
${TS_FILES}
31+
)
32+
33+
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
34+
qt_add_executable(TaskGuard
35+
MANUAL_FINALIZATION
36+
application.qrc
37+
recources.rc
38+
${PROJECT_SOURCES}
39+
)
40+
# Define target properties for Android with Qt 6 as:
41+
# set_property(TARGET TaskGuard APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
42+
# ${CMAKE_CURRENT_SOURCE_DIR}/android)
43+
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
44+
45+
qt_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
46+
else()
47+
if(ANDROID)
48+
add_library(TaskGuard SHARED
49+
${PROJECT_SOURCES}
50+
)
51+
# Define properties for Android with Qt 5 after find_package() calls as:
52+
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
53+
else()
54+
add_executable(TaskGuard
55+
${PROJECT_SOURCES}
56+
)
57+
endif()
58+
59+
qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})
60+
endif()
61+
62+
target_link_libraries(TaskGuard PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Sql ${OPENSSL_LIBRARIES})
63+
64+
set_target_properties(TaskGuard PROPERTIES
65+
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
66+
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
67+
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
68+
MACOSX_BUNDLE TRUE
69+
WIN32_EXECUTABLE TRUE
70+
)
71+
72+
install(TARGETS TaskGuard
73+
BUNDLE DESTINATION .
74+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
75+
76+
if(QT_VERSION_MAJOR EQUAL 6)
77+
qt_finalize_executable(TaskGuard)
78+
endif()

TaskGuard_en_US.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!DOCTYPE TS>
3+
<TS version="2.1" language="en_US"></TS>

about_author.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include "about_author.h"
2+
#include "ui_about_author.h"
3+
4+
about_author::about_author(QWidget *parent) :
5+
QDialog(parent),
6+
ui(new Ui::about_author)
7+
{
8+
ui->setupUi(this);
9+
}
10+
11+
about_author::~about_author()
12+
{
13+
delete ui;
14+
}
15+
16+
void about_author::on_pushButton_clicked()
17+
{
18+
this->hide();
19+
}
20+
21+
void about_author::closeEvent(QCloseEvent *event)
22+
{
23+
event->ignore();
24+
hide();
25+
}

about_author.h

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#ifndef ABOUT_AUTHOR_H
2+
#define ABOUT_AUTHOR_H
3+
4+
#include "version.h"
5+
6+
#include <QDialog>
7+
#include <QCloseEvent>
8+
9+
namespace Ui {
10+
class about_author;
11+
}
12+
13+
class about_author : public QDialog
14+
{
15+
Q_OBJECT
16+
17+
public:
18+
explicit about_author(QWidget *parent = nullptr);
19+
~about_author();
20+
21+
protected:
22+
void closeEvent(QCloseEvent *event) override;
23+
24+
private slots:
25+
void on_pushButton_clicked();
26+
27+
private:
28+
Ui::about_author *ui;
29+
};
30+
31+
#endif // ABOUT_AUTHOR_H

about_author.ui

Lines changed: 375 additions & 0 deletions
Large diffs are not rendered by default.

about_qt_window.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include "about_qt_window.h"
2+
#include "ui_about_qt_window.h"
3+
4+
about_qt_window::about_qt_window(QWidget *parent) :
5+
QDialog(parent),
6+
ui(new Ui::about_qt_window)
7+
{
8+
ui->setupUi(this);
9+
}
10+
11+
about_qt_window::~about_qt_window()
12+
{
13+
delete ui;
14+
}
15+
16+
void about_qt_window::on_pushButton_clicked()
17+
{
18+
this->hide();
19+
}
20+
21+
void about_qt_window::closeEvent(QCloseEvent *event)
22+
{
23+
event->ignore();
24+
hide();
25+
}

about_qt_window.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#ifndef ABOUT_QT_WINDOW_H
2+
#define ABOUT_QT_WINDOW_H
3+
4+
#include <QDialog>
5+
#include <QCloseEvent>
6+
7+
namespace Ui {
8+
class about_qt_window;
9+
}
10+
11+
class about_qt_window : public QDialog
12+
{
13+
Q_OBJECT
14+
15+
public:
16+
explicit about_qt_window(QWidget *parent = nullptr);
17+
~about_qt_window();
18+
19+
protected:
20+
void closeEvent(QCloseEvent *event) override;
21+
22+
private slots:
23+
void on_pushButton_clicked();
24+
25+
private:
26+
Ui::about_qt_window *ui;
27+
};
28+
29+
#endif // ABOUT_QT_WINDOW_H

about_qt_window.ui

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>about_qt_window</class>
4+
<widget class="QDialog" name="about_qt_window">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>571</width>
10+
<height>455</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>About Qt</string>
15+
</property>
16+
<property name="windowIcon">
17+
<iconset resource="application.qrc">
18+
<normaloff>:/img/logo-dark.svg</normaloff>:/img/logo-dark.svg</iconset>
19+
</property>
20+
<layout class="QVBoxLayout" name="verticalLayout">
21+
<item>
22+
<widget class="QTextBrowser" name="textBrowser">
23+
<property name="html">
24+
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
25+
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;meta charset=&quot;utf-8&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
26+
p, li { white-space: pre-wrap; }
27+
hr { height: 1px; border-width: 0; }
28+
li.unchecked::marker { content: &quot;\2610&quot;; }
29+
li.checked::marker { content: &quot;\2612&quot;; }
30+
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Segoe UI'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
31+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:10pt; font-weight:700;&quot;&gt;About Qt&lt;/span&gt;&lt;/p&gt;
32+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
33+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;This program uses Qt version 6.5.&lt;/p&gt;
34+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
35+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Qt is a C++ toolkit for cross-platform application development.&lt;/p&gt;
36+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
37+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Qt provides single-source portability across all major desktop operating systems. It is also&lt;/p&gt;
38+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;available for embedded Linux and other embedded and mobile operating systems.&lt;/p&gt;
39+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
40+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Qt is available under multiple licensing options designed to accommodate the needs of&lt;/p&gt;
41+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;our various users.&lt;/p&gt;
42+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
43+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Qt licensed under our commercial license agreement is appropriate for development of&lt;/p&gt;
44+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;proprietary/commercial software where you do not want to share any source code with&lt;/p&gt;
45+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;third parties or otherwise cannot comply with the terms of GNU (L)GPL.&lt;/p&gt;
46+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
47+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Qt licensed under GNU (L)GPL is appropriate for the development of Qt applications&lt;/p&gt;
48+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;provided you can comply with the terms and conditions of the respective licenses.&lt;/p&gt;
49+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
50+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Please see &lt;a href=&quot;qt.io/licensing&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#007af4;&quot;&gt;qt.io/licensing&lt;/span&gt;&lt;/a&gt; for an overview of Qt licensing.&lt;/p&gt;
51+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
52+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Copyright (C) 2023 The Qt Company Ltd and other contributors.&lt;/p&gt;
53+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
54+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Qt and the Qt logo are trademarks of The Qt Company Ltd.&lt;/p&gt;
55+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
56+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Qt is The Qt Company Ltd product developed as an open source project. See &lt;a href=&quot;qt.io&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#007af4;&quot;&gt;qt.io&lt;/span&gt;&lt;/a&gt; for more information.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
57+
</property>
58+
<property name="openExternalLinks">
59+
<bool>true</bool>
60+
</property>
61+
</widget>
62+
</item>
63+
<item>
64+
<layout class="QHBoxLayout" name="horizontalLayout">
65+
<item>
66+
<spacer name="horizontalSpacer">
67+
<property name="orientation">
68+
<enum>Qt::Horizontal</enum>
69+
</property>
70+
<property name="sizeHint" stdset="0">
71+
<size>
72+
<width>40</width>
73+
<height>20</height>
74+
</size>
75+
</property>
76+
</spacer>
77+
</item>
78+
<item>
79+
<widget class="QPushButton" name="pushButton">
80+
<property name="text">
81+
<string>OK</string>
82+
</property>
83+
</widget>
84+
</item>
85+
</layout>
86+
</item>
87+
</layout>
88+
</widget>
89+
<resources>
90+
<include location="application.qrc"/>
91+
</resources>
92+
<connections/>
93+
</ui>

application.qrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<RCC>
2+
<qresource prefix="/">
3+
<file>img/logo.ico</file>
4+
<file>img/logo-light.svg</file>
5+
<file>img/logo-v2.svg</file>
6+
<file>img/alarm.svg</file>
7+
<file>img/plus-circle.svg</file>
8+
<file>img/plus.svg</file>
9+
<file>img/logo-dark.svg</file>
10+
<file>img/search.svg</file>
11+
<file>img/eye.svg</file>
12+
<file>img/eye-white.svg</file>
13+
<file>img/encrypt.svg</file>
14+
</qresource>
15+
</RCC>

0 commit comments

Comments
 (0)