This commit is contained in:
Your Name
2024-04-03 21:39:39 +02:00
parent 923e47afb5
commit 3d00580d38
53 changed files with 9612 additions and 0 deletions

68
ProjektManager.pro Normal file
View File

@@ -0,0 +1,68 @@
QT += core gui charts network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++17
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
#INCLUDEPATH += src/
#DEPENDPATH += src/
SOURCES += \
src/createupdaterdialog.cpp \
src/main.cpp \
src/mainsettingsdialog.cpp \
src/mainwindow.cpp \
src/newprojektdialog.cpp \
src/projektdata.cpp \
src/projektlistelementform.cpp \
src/statisticsdialog.cpp \
src/taskmanager.cpp
HEADERS += \
src/createupdaterdialog.h \
src/mainsettingsdialog.h \
src/mainwindow.h \
src/newprojektdialog.h \
src/projektdata.h \
src/projektlistelementform.h \
src/statisticsdialog.h \
statusdialog.h \
src/taskmanager.h
FORMS += \
src/createupdaterdialog.ui \
src/mainsettingsdialog.ui \
src/mainwindow.ui \
src/newprojektdialog.ui \
src/projektlistelementform.ui \
src/statisticsdialog.ui \
src/taskmanager.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
RESOURCES += \
ressources.qrc
# MUpdaterLib:
win32:CONFIG(release, debug|release): LIBS += -LC:/Users/Markus/Nextcloud/CPP-Projekte/Bibliotheken/MUpdater/release/ -lMUpdater
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Bibliotheken/MUpdater/debug/ -lMUpdater
INCLUDEPATH += C:/Users/Markus/Nextcloud/CPP-Projekte/Bibliotheken/MUpdater/
DEPENDPATH += C:/Users/Markus/Nextcloud/CPP-Projekte/Bibliotheken/MUpdater/
win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += C:/Users/Markus/Nextcloud/CPP-Projekte/Bibliotheken/MUpdater/release/libMUpdater.a
else:win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../Bibliotheken/MUpdater/debug/libMUpdater.a
else:win32:!win32-g++:CONFIG(release, debug|release): PRE_TARGETDEPS += C:/Users/Markus/Nextcloud/CPP-Projekte/Bibliotheken/MUpdater/release/MUpdater.lib
else:win32:!win32-g++:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../Bibliotheken/MUpdater/debug/MUpdater.lib
# Application Icon
win32:RC_ICONS += icons/appicon.ico

View File

@@ -0,0 +1,40 @@
#include <windows.h>
IDI_ICON1 ICON "C:\\Users\\Markus\\Nextcloud\\CPP-Projekte\\AutoTools\\ProjektManager\\icons\\appicon.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,0,0
PRODUCTVERSION 0,0,0,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
#else
FILEFLAGS 0x0L
#endif
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "CompanyName", "\0"
VALUE "FileDescription", "\0"
VALUE "FileVersion", "0.0.0.0\0"
VALUE "LegalCopyright", "\0"
VALUE "OriginalFilename", "ProjektManager.exe\0"
VALUE "ProductName", "ProjektManager\0"
VALUE "ProductVersion", "0.0.0.0\0"
VALUE "InternalName", "\0"
VALUE "Comments", "\0"
VALUE "LegalTrademarks", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1200
END
END
/* End of Version info */

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
icons/File-Explorer64.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
icons/Gitea_Logo.svg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

BIN
icons/Gitea_Logo64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

BIN
icons/Start2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
icons/appSymbol - Kopie.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
icons/appSymbol.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
icons/appSymbol64.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
icons/appicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
icons/gwindows_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 234 KiB

BIN
icons/qt-creator.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

BIN
icons/qt-creator64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
icons/settings.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
icons/settings64.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
icons/upgrade.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
icons/upgrade.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<Installer>
<Name>ProjektManager</Name>
<Version>1.15.0</Version>
<Title><Name>ProjektManager</Name> Installer</Title>
<InstallerApplicationIcon>installerIcon1</InstallerApplicationIcon>
<InstallerWindowIcon>installerIcon2</InstallerWindowIcon>
<Publisher>Markus</Publisher>
<StartMenuDir>ProjektManager</StartMenuDir>
<TargetDir>@ApplicationsDir@/ProjektManager/</TargetDir>
<WizardDefaultWidth>800</WizardDefaultWidth>
<WizardDefaultHeight>500</WizardDefaultHeight>
<MaintenanceToolName>ProjektManagerMaintenanceTool</MaintenanceToolName>
<RemoteRepositories>
<Repository>
<Url>https://code.obermui.de/Markus/ProjektManagerC/media/branch/main/installer/repository</Url>
<Enabled>1</Enabled>
<DisplayName>Main-Repo</DisplayName>
</Repository>
</RemoteRepositories>
</Installer>

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@@ -0,0 +1,39 @@
function Component() { // default constructor
installer.installationFinished.connect(this, Component.prototype.installationFinished);
}
Component.prototype.createOperations = function() {
component.createOperations();
if(systemInfo.productType === "windows") {
component.addOperation("CreateShortcut", "@TargetDir@/bin/ProjektManager.exe", "@StartMenuDir@/ProjektManager.lnk", "description=A Program to manage my Qt Projects");
component.addOperation("CreateShortcut", "@TargetDir@/bin/ProjektManager.exe", "@HomeDir@/Desktop/ProjektManager.lnk", "description=A Program to manage my Qt Projects");
}
}
Component.prototype.installationFinished = function() {
try {
if (installer.isInstaller()) {
if (installer.status == QInstaller.Success) {
if (systemInfo.productType === "windows") {
// Execute ProjektManager after installation
if(installer.executeDetached("@TargetDir@/bin/ProjektManager.exe", ["show"]) !== 0) {
print("Failed to start the application!");
} else {
print("Application started successfully.");
}
} else {
print("Not on Windows. Skipping application execution.");
}
} else {
print("Installation was not successful. Application will not be started.");
}
} else {
print("Not in installer mode. Application will not be started.");
}
} catch(e) {
console.log(e);
}
}

View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) 2018 6543@obermui.de
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
remaster Copyright (C) 2018 6543@obermui.de
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<Package>
<DisplayName>ProjektManager 1.15.0</DisplayName>
<Description>A Program to manage my Qt Projects</Description>
<Version>1.15.0</Version>
<Default>true</Default>
<ReleaseDate>2024-04-03</ReleaseDate>
<Licenses>
<License name="GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007" file="license.txt" />
</Licenses>
<Operations>
<Operation name="Extract">
<Argument>@TargetDir@/bin/</Argument>
</Operation>
</Operations>
<Script>installscript.qs</Script>
</Package>

16
ressources.qrc Normal file
View File

@@ -0,0 +1,16 @@
<RCC>
<qresource prefix="/">
<file>icons/Start2.png</file>
<file>icons/File-Explorer64.ico</file>
<file>icons/upgrade.ico</file>
<file>icons/settings64.ico</file>
<file>icons/gwindows_logo.png</file>
<file>icons/qt-creator64.png</file>
<file>ressources/gitignoreTemplate.txt</file>
<file>icons/appSymbol.png</file>
<file>icons/appSymbol64.ico</file>
<file>ressources/license.txt</file>
<file>icons/appicon.ico</file>
<file>icons/Gitea_Logo64.png</file>
</qresource>
</RCC>

View File

@@ -0,0 +1,67 @@
# C++ objects and libs
*.slo
*.lo
*.o
*.a
*.la
*.lai
*.so
*.so.*
*.dll
*.dylib
# Qt-es
object_script.*.Release
object_script.*.Debug
*_plugin_import.cpp
/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.qbs.user
*.qbs.user.*
*.moc
moc_*.cpp
moc_*.h
qrc_*.cpp
ui_*.h
*.qmlc
*.jsc
Makefile*
*build-*
*.qm
*.prl
# Qt unit tests
target_wrapper.*
# QtCreator
*.autosave
# QtCreator Qml
*.qmlproject.user
*.qmlproject.user.*
# QtCreator CMake
CMakeLists.txt.user*
# QtCreator 4.8< compilation database
compile_commands.json
# QtCreator local machine specific files for imported projects
*creator.user*
*_qmlcache.qrc
*.qtc_clangd/*
Makefile
Makefile.Release
Makefile.Debug
Fraktalgenerator_resource.rc
debug/
release/
release*/
builds/
installer/*.exe
installer/packages/*/data/*

674
ressources/license.txt Normal file
View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) 2018 6543@obermui.de
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
remaster Copyright (C) 2018 6543@obermui.de
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

179
src/createupdaterdialog.cpp Normal file
View File

@@ -0,0 +1,179 @@
#include "createupdaterdialog.h"
#include "mainsettingsdialog.h"
#include "ui_createupdaterdialog.h"
CreateUpdaterDialog::CreateUpdaterDialog(ProjektData *data, QWidget *parent)
: QDialog(parent)
, ui(new Ui::CreateUpdaterDialog)
, data(data)
{
qDebug() << " CreateUpdaterDialog()";
ui->setupUi(this);
ui->lineEditVersion->setText(data->getAppVersion());
ui->checkBox_githochladen->setChecked(data->shouldSetRemoteRepo());
ui->checkBox_githochladen->setEnabled(data->shouldSetRemoteRepo());
ui->checkBox_CommitAndPushUpdaterRepo->setChecked(data->shouldSetRemoteRepo());
ui->checkBox_CommitAndPushUpdaterRepo->setEnabled(data->shouldSetRemoteRepo());
ui->lineEditCommitMessage->setText("v" + data->getAppVersion());
}
CreateUpdaterDialog::~CreateUpdaterDialog()
{
delete ui;
qDebug() << " ~CreateUpdaterDialog()";
}
ThreadData CreateUpdaterDialog::values()
{
QString newVersion = ui->lineEditVersion->text();
bool copyRelease = ui->checkBoxCopyRelease->isChecked();
bool cleanUpProject = ui->checkBox_cleanprojekt->isChecked();
bool offline_installer = ui->checkBox->isChecked();
bool online_installer = ui->checkBox_2->isChecked();
bool add_git_tag = ui->checkBoxAddGitTag->isChecked();
bool update_updater_repo = ui->checkBox_6->isChecked();
bool commit_nad_push_u_repo = ui->checkBox_CommitAndPushUpdaterRepo->isChecked();
bool groupBoxGit = ui->groupBox_GIT->isChecked();
bool gitAddAll = ui->checkBox_addAll->isChecked();
bool gitHochladen = ui->checkBox_githochladen->isChecked();
QString commitMessage = ui->lineEditCommitMessage->text();
bool repoUpdate = ui->groupBoxRepoUpdate->isChecked();
bool updateVersionInFile = ui->checkBox_UpdateVersionInFile->isChecked();
bool updater = this->ui->updater->isChecked();
if(!updater) {
offline_installer = false;
online_installer = false;
copyRelease = false;
}
if(!repoUpdate) {
update_updater_repo = false;
commit_nad_push_u_repo = false;
}
return ThreadData(newVersion, copyRelease, cleanUpProject, offline_installer,
online_installer, add_git_tag, update_updater_repo,
commit_nad_push_u_repo, updater, groupBoxGit, gitAddAll,
gitHochladen, commitMessage, repoUpdate, updateVersionInFile);
}
ThreadData::ThreadData()
{
}
ThreadData::ThreadData(QString newVersion, bool copyRelease,
bool cleanUpProject, bool offline_installer,
bool online_installer, bool add_git_tag,
bool update_updater_repo, bool commit_nad_push_u_repo, bool updater, bool groupBoxGit, bool gitAddAll,
bool gitHochladen, QString commitMessage, bool repoUpdate, bool updateVersionInFile)
: newVersion(std::move(newVersion)), commitMessage(commitMessage),
copyRelease(copyRelease), cleanUpProject(cleanUpProject),
offline_installer(offline_installer), online_installer(online_installer),
add_git_tag(add_git_tag),
update_updater_repo(update_updater_repo),
commit_nad_push_u_repo(commit_nad_push_u_repo),
updater(updater),
groupBoxGit(groupBoxGit),
gitAddAll(gitAddAll),
gitHochladen(gitHochladen),
repoUpdate(repoUpdate),
updateVersionInFile(updateVersionInFile)
{
}
void ThreadData::appendToStoredTimes(int time)
{
QString path = MainSettingsDialog::appDataLocal() + "tasktimeslist.qt" ;
this->elapsedtime = time;
QList<ThreadData> keysToStore = getThreadDataListHistory();
keysToStore.append(*this);
// Store the list of structs to a file
QFile file(path);
if (file.open(QIODevice::WriteOnly)) {
QDataStream out(&file);
out << keysToStore;
file.close();
qDebug() << "List of structs stored successfully.";
} else {
qWarning() << "Failed to open file for writing.";
}
}
QList<ThreadData> ThreadData::getThreadDataListHistory()
{
QString path = MainSettingsDialog::appDataLocal() + "tasktimeslist.qt" ;
// Load the list of structs from the file
QList<ThreadData> loadedKeys;
QFile file(path);
if (file.open(QIODevice::ReadOnly)) {
QDataStream in(&file);
in >> loadedKeys;
file.close();
} else {
qWarning() << "Failed to open file for reading.";
}
return loadedKeys;
}
unsigned ThreadData::getAvgElapsedTimePrediction()
{
QString path = MainSettingsDialog::appDataLocal() + "tasktimeslist.qt" ;
QList<ThreadData> keysToStore = getThreadDataListHistory();
int time = 0;
int count = 0;
for(const auto & key : keysToStore) {
if(this->sameKey(key)) {
time += key.elapsedtime;
count++;
}
}
if(count) {
qDebug() << " summed time: " << time << " entries: " << count << " avg: " << time / count;
return time / count;
} else {
qDebug() << " no saved time for this task!";
}
/*create or update task ? -> fast! : slow*/
return this->newVersion.isEmpty() ? 10 : 400;
}
bool ThreadData::sameKey(const ThreadData &other) const
{
// Compare all values except for key.elapsedtime
bool same = (copyRelease == other.copyRelease &&
cleanUpProject == other.cleanUpProject &&
offline_installer == other.offline_installer &&
online_installer == other.online_installer &&
add_git_tag == other.add_git_tag &&
update_updater_repo == other.update_updater_repo &&
updateVersionInFile == other.updateVersionInFile &&
commit_nad_push_u_repo == other.commit_nad_push_u_repo &&
gitAddAll == other.gitAddAll &&
gitHochladen == other.gitHochladen);
// qDebug() << "Keys are" << (same ? "the same." : "different: copyRelease:" + QString::number(copyRelease) + "-" + QString::number(other.copyRelease) + " cleanUpProject:" + QString::number(cleanUpProject) + "-" + QString::number(other.cleanUpProject) + " offline_installer:" + QString::number(offline_installer) + "-" + QString::number(other.offline_installer) + " online_installer:" + QString::number(online_installer) + "-" + QString::number(other.online_installer) + " add_git_tag:" + QString::number(add_git_tag) + "-" + QString::number(other.add_git_tag) + " update_updater_repo:" + QString::number(update_updater_repo) + "-" + QString::number(other.update_updater_repo) + " updateVersionInFile:" + QString::number(updateVersionInFile) + "-" + QString::number(other.updateVersionInFile) + " commit_nad_push_u_repo:" + QString::number(commit_nad_push_u_repo) + "-" + QString::number(other.commit_nad_push_u_repo) + " gitAddAll:" + QString::number(gitAddAll) + "-" + QString::number(other.gitAddAll) + " gitHochladen:" + QString::number(gitHochladen) + "-" + QString::number(other.gitHochladen));
return same;
}
void CreateUpdaterDialog::on_lineEditVersion_textChanged(const QString &arg1)
{
ui->lineEditCommitMessage->setText("v" + arg1);
}

73
src/createupdaterdialog.h Normal file
View File

@@ -0,0 +1,73 @@
#ifndef CREATEUPDATERDIALOG_H
#define CREATEUPDATERDIALOG_H
#include <QDialog>
#include "projektdata.h"
namespace Ui {
class CreateUpdaterDialog;
}
struct ThreadData {
ThreadData();
ThreadData(QString newVersion, bool copyRelease, bool cleanUpProject,
bool offline_installer, bool online_installer, bool add_git_tag,
bool update_updater_repo, bool commit_nad_push_u_repo, bool updater, bool groupBoxGit, bool gitAddAll ,
bool gitHochladen, QString commitMessage, bool repoUpdate, bool updateVersionInFile
);
QString newVersion;
QString commitMessage;
bool copyRelease;
bool cleanUpProject;
bool offline_installer;
bool online_installer;
bool add_git_tag;
bool update_updater_repo;
bool commit_nad_push_u_repo;
bool updater;
bool groupBoxGit;
bool gitAddAll;
bool gitHochladen;
bool repoUpdate;
bool updateVersionInFile;
int elapsedtime;
// Overload << and >> operators for serialization
friend QDataStream& operator<<(QDataStream& out, const ThreadData& key) {
return out << key.copyRelease << key.cleanUpProject << key.offline_installer << key.online_installer << key.add_git_tag << key.update_updater_repo << key.updateVersionInFile
<< key.commit_nad_push_u_repo << key.gitAddAll << key.gitHochladen << key.elapsedtime;
}
friend QDataStream& operator>>(QDataStream& in, ThreadData& key) {
return in >> key.copyRelease >> key.cleanUpProject >> key.offline_installer >> key.online_installer >> key.add_git_tag >> key.update_updater_repo >> key.updateVersionInFile
>> key.commit_nad_push_u_repo >> key.gitAddAll >> key.gitHochladen >> key.elapsedtime;
}
void appendToStoredTimes(int time);
QList<ThreadData> getThreadDataListHistory();
unsigned getAvgElapsedTimePrediction();
bool sameKey(const ThreadData &other) const;
};
class CreateUpdaterDialog : public QDialog
{
Q_OBJECT
public:
explicit CreateUpdaterDialog(ProjektData *data, QWidget *parent = nullptr);
~CreateUpdaterDialog();
ThreadData values();
private slots:
void on_lineEditVersion_textChanged(const QString &arg1);
private:
Ui::CreateUpdaterDialog *ui;
ProjektData *data;
};
#endif // CREATEUPDATERDIALOG_H

429
src/createupdaterdialog.ui Normal file
View File

@@ -0,0 +1,429 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CreateUpdaterDialog</class>
<widget class="QDialog" name="CreateUpdaterDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>621</width>
<height>648</height>
</rect>
</property>
<property name="windowTitle">
<string>Operationen auf dem Projekt ausführen</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Neue Version</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditVersion">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
<bold>true</bold>
</font>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>IDE &amp; Qt &amp; Git</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_cleanprojekt">
<property name="text">
<string>Projekt aufräumen</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_UpdateVersionInFile">
<property name="text">
<string>App Version in Datei mit dieser Version überschreiben</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_GIT">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="title">
<string>Git</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QCheckBox" name="checkBox_addAll">
<property name="font">
<font>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Git alle Änderungen commiten</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditCommitMessage">
<property name="font">
<font>
<bold>false</bold>
</font>
</property>
<property name="placeholderText">
<string>Message</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="checkBoxAddGitTag">
<property name="font">
<font>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Git Versionstag hinzufügen</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_githochladen">
<property name="font">
<font>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Git Änderungen hochladen</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Qt Installer Framework</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="updater">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="title">
<string>Updater</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QCheckBox" name="checkBoxCopyRelease">
<property name="font">
<font>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Nur Executable austauschen ! [release] &gt; [debug] !</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox">
<property name="font">
<font>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Offline Installer</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_2">
<property name="font">
<font>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Online Installer</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBoxRepoUpdate">
<property name="font">
<font>
<bold>true</bold>
</font>
</property>
<property name="title">
<string>Updater Repository</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="checkBox_6">
<property name="font">
<font>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Repository aktualisieren</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_CommitAndPushUpdaterRepo">
<property name="font">
<font>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Push Updater Repository</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>CreateUpdaterDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>CreateUpdaterDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

14
src/main.cpp Normal file
View File

@@ -0,0 +1,14 @@
#include "mainwindow.h"
#include <QApplication>
#include "wakeuplistener.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
WakeUpListener s(&w, "ProjektManager");
if(!a.arguments().contains("/minimized"))
w.show();
return a.exec();
}

306
src/mainsettingsdialog.cpp Normal file
View File

@@ -0,0 +1,306 @@
#include "mainsettingsdialog.h"
#include "ui_mainsettingsdialog.h"
#include "stylehandler.h"
QString MainSettingsDialog::installerFrameworkDir = "";
QString MainSettingsDialog::company = "M$RKUS";
QString MainSettingsDialog::appName = "ProjektManager";;
MainSettingsDialog::MainSettingsDialog(StyleHandler *styleHandeler, QWidget *parent)
: QDialog(parent)
, ui(new Ui::MainSettingsDialog)
, styleHandeler(styleHandeler)
{
qDebug() << " MainSettingsDialog()";
ui->setupUi(this);
switchAutostart = new Switch(this, ui->label_einausautostart);
connect(switchAutostart, SIGNAL(toggled(bool)), this, SLOT(autostartBtnToggeld(bool)));
ui->horizontalLayout_autostart->addWidget(switchAutostart);
ui->horizontalLayout_theme->addWidget(styleHandeler->getCombobox());
loadDefaults();
}
MainSettingsDialog::~MainSettingsDialog()
{
///remove combobox so that it does'nt get destroyed !! // soll nur noch 1 Object erzeugt werden
ui->horizontalLayout_theme->removeWidget(styleHandeler->getCombobox());
styleHandeler->getCombobox()->setParent(nullptr);
delete ui;
delete switchAutostart;
qDebug() << " ~MainSettingsDialog()";
}
bool MainSettingsDialog::checkDefPaths() {
bool ok = true;
for(const bool &val : correctPaths.values()) {
if(!val)
ok = false;
}
return ok;
}
QString MainSettingsDialog::appDataLocal()
{
// Retrieve the configuration location for the current platform
QCoreApplication::setApplicationName(appName);
QString configLocation = QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
// Create the directory if it doesn't exist
QDir dir(configLocation);
if (!dir.exists()) {
if (!dir.mkpath(".")) {
qWarning() << "Failed to create directory:" << configLocation;
exit(1);
}
}
return configLocation + QDir::separator();
}
void MainSettingsDialog::loadDefaults()
{
//load settings
QSettings settings(company, appName);
this->ui->lineEditGitExe->setText(settings.value("GitExePath", "git.exe").toString());
this->ui->lineEditQTDir->setText(settings.value("QtKitDirPath", "").toString());
this->ui->lineEditMUpdaterLib->setText(settings.value("MUpdaterLibPath", "").toString());
this->ui->lineEditMinGW->setText(settings.value("QtMinGWDirPath", "").toString());
this->ui->lineEditDleteBuildDirs->setText(settings.value("QtAutoRemoveBuildDirsDir", "").toString());
this->switchAutostart->setChecked(settings.value("AppAutostart", false).toBool());
this->ui->radioButtonGitBash->setChecked(settings.value("AppGitGui", true).toBool());
this->ui->radioButtonGitGUI->setChecked(!settings.value("AppGitGui", false).toBool());
}
QString MainSettingsDialog::getQtDir()
{
if(getQtKitDirPath().contains("Qt/"))
return getQtKitDirPath().left(getQtKitDirPath().indexOf("Qt/") + 3);
return "";
}
QString MainSettingsDialog::getQtKitDirPath()
{
QSettings settings(company, appName);
if(settings.value("QtKitDirPath").toString().isEmpty()) {
qDebug() << "QtKitDirPath wurde nicht festgelegt!";
}
return settings.value("QtKitDirPath", "").toString(); //"C:/Qt/6.6.2/mingw_64/bin/";
}
QString MainSettingsDialog::getQtMinGWDirPath()
{
QSettings settings(company, appName);
if(settings.value("QtMinGWDirPath").toString().isEmpty()) {
qDebug() << "QtMinGWDirPath wurde nicht festgelegt!";
}
return settings.value("QtMinGWDirPath", "").toString(); //return "C:/Qt/Tools/mingw1120_64/bin/";
}
QString MainSettingsDialog::getMUpdaterLibPath()
{
QSettings settings(company, appName);
if(!settings.value("MUpdaterLibPath").toString().isEmpty()) {
qDebug() << "MUpdaterLibPath wurde nicht festgelegt!";
}
return settings.value("MUpdaterLibPath", "").toString(); //return "C:/Users/Markus/Nextcloud/CPP-Projekte/Bibliotheken/MUpdater/";
}
QString MainSettingsDialog::getGitExe()
{
QSettings settings(company, appName);
if(settings.value("GitExePath").toString().isEmpty()) {
qDebug() << "GitExePath wurde nicht festgelegt!";
}
return settings.value("GitExePath", "git.exe").toString(); //return "git.exe";
}
QString MainSettingsDialog::getBinaryCreator()
{
setupInstallerFramworkDir();
return installerFrameworkDir + "binarycreator.exe";
}
QString MainSettingsDialog::getBinaryRepogen()
{
setupInstallerFramworkDir();
return installerFrameworkDir + "repogen.exe";
}
QString MainSettingsDialog::getAutoRemoveDir()
{
QSettings settings(company, appName);
if(settings.value("QtAutoRemoveBuildDirsDir").toString().isEmpty()) {
qDebug() << "AutoRemoveDir wurde nicht festgelegt!";
}
return settings.value("QtAutoRemoveBuildDirsDir", "").toString();
}
bool MainSettingsDialog::useGitGui()
{
QSettings settings(company, appName);
return settings.value("AppGitGui", true).toBool();
}
void MainSettingsDialog::on_buttonBox_accepted()
{
//save settings
}
void MainSettingsDialog::setupInstallerFramworkDir()
{
if(installerFrameworkDir.isEmpty()) {
QDir insfrmwork(getQtDir() + "Tools/QtInstallerFramework/");
insfrmwork.setFilter(QDir::Dirs | QDir::NoDotAndDotDot);
QStringList dirs = insfrmwork.entryList();
dirs.sort();
if(dirs.size() >= 0)
installerFrameworkDir = getQtDir() + "Tools/QtInstallerFramework/" + dirs.at(0) + "/bin/";
}
}
void MainSettingsDialog::lineEditPathEdited(QLineEdit * edit, QString checkFileOrDir, QString settingsKey)
{
QString arg1 = edit->text();
QString path = arg1 + ((!arg1.isEmpty() && !arg1.endsWith("/") && !arg1.endsWith(".exe")) ? "/" : "");
QSettings settings(company, appName);
settings.setValue(settingsKey, path);
bool ok = QFile(path + checkFileOrDir).exists() || !QStandardPaths::findExecutable(path + checkFileOrDir).isEmpty();
edit->setStyleSheet("QLineEdit { border: 1px solid " + QString(ok? "darkGreen" : "red") + "; }");
correctPaths[settingsKey] = ok;
}
void MainSettingsDialog::on_lineEditDleteBuildDirs_textChanged(const QString &arg1)
{
QSettings settings(company, appName);
settings.setValue("QtAutoRemoveBuildDirsDir", arg1);
if(arg1.isEmpty()) {
ui->lineEditDleteBuildDirs->setStyleSheet("");
} else {
bool ok = QDir(arg1).exists() && QDir(arg1).absolutePath().startsWith(QDir(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)).absolutePath());
ui->lineEditDleteBuildDirs->setStyleSheet("QLineEdit { border: 1px solid " + QString(ok? "darkGreen" : "red") + "; }");
}
}
void MainSettingsDialog::on_lineEditDleteBuildDirs_editingFinished()
{
ui->lineEditDleteBuildDirs->setText(QDir(ui->lineEditDleteBuildDirs->text()).absolutePath());
}
void MainSettingsDialog::on_lineEditQTDir_textChanged(const QString &)
{
lineEditPathEdited(ui->lineEditQTDir, "windeployqt.exe", "QtKitDirPath");
}
void MainSettingsDialog::on_lineEditGitExe_textChanged(const QString &)
{
lineEditPathEdited(ui->lineEditGitExe, "", "GitExePath");
}
void MainSettingsDialog::on_lineEditMUpdaterLib_textChanged(const QString &)
{
lineEditPathEdited(ui->lineEditMUpdaterLib, "MUpdater.pro", "MUpdaterLibPath");
}
void MainSettingsDialog::on_lineEditMinGW_textChanged(const QString &)
{
lineEditPathEdited(ui->lineEditMinGW, "mingw32-make.exe", "QtMinGWDirPath");
}
void MainSettingsDialog::on_radioButtonGitBash_clicked()
{
QSettings settings(company, appName);
settings.setValue("AppGitGui", true);
}
void MainSettingsDialog::on_radioButtonGitGUI_clicked()
{
QSettings settings(company, appName);
settings.setValue("AppGitGui", false);
}
void MainSettingsDialog::on_pushButtonBrowseQTDir_clicked()
{
QUrl path = QFileDialog::getExistingDirectoryUrl(this, "Open QTDir, e.g. C:/Qt/6.6.2/mingw_64/bin/");
if (!path.isEmpty())
ui->lineEditQTDir->setText(path.toLocalFile());
}
void MainSettingsDialog::on_pushButtonBrowseGitExe_clicked()
{
QUrl path = QFileDialog::getOpenFileUrl(this, "Open Git Executable");
if (!path.isEmpty())
ui->lineEditGitExe->setText(path.toLocalFile());
}
void MainSettingsDialog::on_pushButtonMUpdaterLibPath_clicked()
{
QUrl path = QFileDialog::getExistingDirectoryUrl(this, "Open MUpdater Library, ../MUpdater/");
if (!path.isEmpty())
ui->lineEditMUpdaterLib->setText(path.toLocalFile());
}
void MainSettingsDialog::on_pushButtonMinGW_clicked()
{
QUrl path = QFileDialog::getExistingDirectoryUrl(this, "Open MinGW Directory, e.g. C:/Qt/Tools/mingw1120_64/bin/");
if (!path.isEmpty())
ui->lineEditMinGW->setText(path.toLocalFile());
}
void MainSettingsDialog::on_pushButtonAutoDelBuildDirsbrowse_clicked()
{
QUrl path = QFileDialog::getExistingDirectoryUrl(this, "Open remove Build-Dirs Directory");
if (!path.isEmpty())
ui->lineEditDleteBuildDirs->setText(path.toLocalFile());
}
void MainSettingsDialog::autostartBtnToggeld(bool status)
{
QSettings settings(company, appName);
settings.setValue("AppAutostart", status);
this->styleHandeler->setAutoStart(status);
//toTo
}

84
src/mainsettingsdialog.h Normal file
View File

@@ -0,0 +1,84 @@
#ifndef MAINSETTINGSDIALOG_H
#define MAINSETTINGSDIALOG_H
#include <QDialog>
#include "stylehandler.h"
#include "switch.h"
namespace Ui {
class MainSettingsDialog;
}
class MainSettingsDialog : public QDialog
{
Q_OBJECT
public:
explicit MainSettingsDialog(StyleHandler * styleHandeler, QWidget *parent = nullptr);
~MainSettingsDialog();
void loadDefaults();
static QString getQtDir();
static QString getQtKitDirPath();
static QString getQtMinGWDirPath();
static QString getMUpdaterLibPath();
static QString getGitExe();
static QString getBinaryCreator();
static QString getBinaryRepogen();
static QString getAutoRemoveDir();
static bool useGitGui();
bool checkDefPaths();
static QString appDataLocal();
private slots:
void on_buttonBox_accepted();
void on_lineEditQTDir_textChanged(const QString &arg1);
void on_lineEditGitExe_textChanged(const QString &arg1);
void on_lineEditMUpdaterLib_textChanged(const QString &arg1);
void on_lineEditMinGW_textChanged(const QString &arg1);
void on_radioButtonGitBash_clicked();
void on_radioButtonGitGUI_clicked();
void on_pushButtonBrowseQTDir_clicked();
void on_pushButtonBrowseGitExe_clicked();
void on_pushButtonMUpdaterLibPath_clicked();
void on_pushButtonMinGW_clicked();
void on_pushButtonAutoDelBuildDirsbrowse_clicked();
void autostartBtnToggeld(bool status);
void on_lineEditDleteBuildDirs_textChanged(const QString &arg1);
void on_lineEditDleteBuildDirs_editingFinished();
private:
Ui::MainSettingsDialog *ui;
Switch * switchAutostart;
StyleHandler * styleHandeler;
QMap<QString, bool> correctPaths;
static QString installerFrameworkDir;
static void setupInstallerFramworkDir();
void lineEditPathEdited(QLineEdit * edit, QString checkFileOrDir, QString settingsKey);
static QString company, appName;
};
#endif // MAINSETTINGSDIALOG_H

391
src/mainsettingsdialog.ui Normal file
View File

@@ -0,0 +1,391 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainSettingsDialog</class>
<widget class="QDialog" name="MainSettingsDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>479</width>
<height>397</height>
</rect>
</property>
<property name="windowTitle">
<string>Einstellungen</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item row="9" column="0" rowspan="3">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0" rowspan="4">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="9" column="1" rowspan="3" colspan="2">
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>Autostart</string>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_autostart">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_einausautostart">
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Ein</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>AutoDeleteBuildDirsIn</string>
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLineEdit" name="lineEditDleteBuildDirs">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonAutoDelBuildDirsbrowse">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Git</string>
</property>
</widget>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QRadioButton" name="radioButtonGitGUI">
<property name="text">
<string>GUI</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButtonGitBash">
<property name="text">
<string>Bash</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Theme</string>
</property>
</widget>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_theme"/>
</item>
</layout>
</item>
</layout>
</item>
<item row="8" column="0" colspan="3">
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QLabel" name="label_8">
<property name="font">
<font>
<pointsize>11</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Programmpfade:</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="7" column="0" colspan="3">
<widget class="QLabel" name="label_9">
<property name="font">
<font>
<pointsize>11</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>ProjektManager:</string>
</property>
</widget>
</item>
<item row="13" column="0" colspan="3">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="3" column="2" rowspan="4">
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>QT Kit Dir</string>
</property>
</widget>
</item>
<item row="0" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="lineEditQTDir">
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonBrowseQTDir">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Git Exe</string>
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="lineEditGitExe">
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonBrowseGitExe">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>MUpdaterLibPath</string>
</property>
</widget>
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLineEdit" name="lineEditMUpdaterLib">
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonMUpdaterLibPath">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>MinGW Ordner</string>
</property>
</widget>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QLineEdit" name="lineEditMinGW">
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonMinGW">
<property name="text">
<string>Browse</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="12" column="0" colspan="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>15</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>MainSettingsDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>MainSettingsDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

288
src/mainwindow.cpp Normal file
View File

@@ -0,0 +1,288 @@
#include "mainwindow.h"
#include "mainsettingsdialog.h"
#include "projektlistelementform.h"
#include "ui_mainwindow.h"
#include "newprojektdialog.h"
#include "mainsettingsdialog.h"
#include <QList>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
qDebug() << "MainWindow()";
ui->setupUi(this);
ui->pushButton->hide();
ui->pushButton_rm->hide();
trayIconMenue = new QMenu(this);
QAction *action1 = trayIconMenue->addAction("Anzeigen");
connect(action1, &QAction::triggered, this, [&](bool){
this->show();
this->activateWindow();
qDebug() << "show...";
});
trayIconMenue->addSeparator();
QAction *action2 = trayIconMenue->addAction("Beenden");
connect(action2, &QAction::triggered, [&](bool){
QApplication::exit(0);
qDebug() << "exit...";
});
trayIcon = new QSystemTrayIcon(QIcon(":/icons/appSymbol64.ico"), this);
trayIcon->show();
trayIcon->setContextMenu(trayIconMenue);
// Connect activated signal to open the context menu
QObject::connect(trayIcon, &QSystemTrayIcon::activated, this, [&](QSystemTrayIcon::ActivationReason reason){
if (reason == QSystemTrayIcon::Trigger) {
// Open context menu on left click
/// trayIconMenue->popup(QCursor::pos());
//show this on left click
this->show();
this->activateWindow();
}
});
settingsPath = (MainSettingsDialog::appDataLocal() + "projectsList.settings");
ueberdialog = new DialogUeber(( "C:\\Program Files\\" + appName + "\\ProjektManagerMaintenanceTool.exe" ), "M$RKUS", appName, this->version, Qt::darkGreen, this,
true, false, false, {"WindowsVista", "Fusion", "Fusion_OWN_dark_blue2", "Fusion_OWN_dark_gray"});
ueberdialog->setDescription("https://code.obermui.de/markus/ProjektManager", "ProjektManager ist eine Anwendung um Qt Projekte zu verwalten,\n"
"launchen und updaten!", "Gitea/ProjektManager");
ueberdialog->setLicence(QFile(":/ressources/license.txt"));
ueberdialog->setPixmap("://icons/appicon.ico");
updater = ueberdialog->updater();
mainsettingsDialog = new MainSettingsDialog(ueberdialog->styleHandler());
projects = new ProjektDataList(settingsPath);
projects->load();
reloadEntryList();
statDialog = new StatisticsDialog(projects);
//START cleanup...
QString autoremdir = MainSettingsDialog::getAutoRemoveDir();
if(!autoremdir.isEmpty() && QDir(autoremdir).exists()) {
(new TaskManager(nullptr, nullptr, true))->startTask(S_TASK::REMOVE_BUILD_DIRS);
}
}
MainWindow::~MainWindow()
{
//delete ProjektListElementForms()
// ui->listWidget->clear(); //Clear
delete trayIconMenue;
delete trayIcon;
delete ui;
//vor ueberdialog, da mainsettingsDialog pointer auf ueberdialog besitzt
delete mainsettingsDialog;
// delete m_updater & m_stylehandler
delete ueberdialog;
// als letztes, da ggf. änderungen gespeichert werden sollen
delete projects;
qDebug() << "~MainWindow()";
}
void MainWindow::createNewProjektEntry()
{
if(!mainsettingsDialog->checkDefPaths()) {
QMessageBox::critical(this, "Pfadeinstellungen ungültig oder nicht gesetzt!", "Pfadeinstellungen ungültig oder nicht gesetzt!");
return;
}
NewProjektDialog * npd = new NewProjektDialog();
if(npd->exec() == QDialog::Accepted) {
auto data = npd->getProjektStruct(projects);
createNewtask(CREATE_NEW_PROJECT, data);
projects->append(data);
projects->store();
addProjectToListWidget(data);
}
}
void MainWindow::reloadEntryList()
{
ui->listWidget->clear(); //Clear
for (ProjektData *e : *projects) //Load
addProjectToListWidget(e);
}
void MainWindow::addProjectToListWidget(ProjektData *data)
{
QListWidgetItem * item = new QListWidgetItem();
item->setData(187, data->getId());
item->setSizeHint(QSize(100, 90)); // a->setSizeHint(b->sizeHint());
ui->listWidget->addItem(item);
ProjektListElementForm * widget = new ProjektListElementForm(data, QPixmap(data->hasQtAppIcon() ? data->getQtAppIconPath() : "://icons/appSymbol64.ico" ).scaled(64, 64), this);
ui->listWidget->setItemWidget(item, widget);
connect(widget, SIGNAL(settingsClicked(unsigned long long)), this, SLOT(projectSettings_clicked(unsigned long long)));
}
void MainWindow::createNewtask(S_TASK task, ProjektData *data)
{
TaskManager * sm = new TaskManager(data, this);
sm->startTask(task);
}
void MainWindow::on_pushButton_clicked()
{
//Create-Dialog & reload
createNewProjektEntry();
}
void MainWindow::on_listWidget_itemDoubleClicked(QListWidgetItem *item)
{
projectSettings_clicked(item->data(187).toULongLong());
}
void MainWindow::on_pushButton_rm_clicked()
{
qDebug() << "ui->listWidget->currentRow(): " << ui->listWidget->currentRow() << "\nui->listWidget->selectedItems()" << ui->listWidget->selectedItems();
if (ui->listWidget->currentRow() != -1) {
// Löschen des ausgewählten Elements
auto item = ui->listWidget->takeItem(ui->listWidget->currentRow());
size_t id = item->data(187).toULongLong();
for(int i = 0; i < projects->size(); i++) {
if(projects->at(i)->getId() == id) {
projects->removeAt(i);
projects->store();
break;
}
}
delete item;
}
}
void MainWindow::on_action_ber_triggered()
{
ueberdialog->exec();
}
void MainWindow::on_actionEinstellungen_triggered()
{
mainsettingsDialog->loadDefaults();
mainsettingsDialog->exec();
}
void MainWindow::projectSettings_clicked(unsigned long long id)
{
if(!mainsettingsDialog->checkDefPaths()) {
QMessageBox::critical(this, "Pfadeinstellungen ungültig oder nicht gesetzt!", "Pfadeinstellungen ungültig oder nicht gesetzt!");
return;
}
for(int i = 0; i < projects->size(); i++) {
if(projects->at(i)->getId() == id) {
NewProjektDialog * npd = new NewProjektDialog(projects->at(i));
connect(npd, SIGNAL(removeClicked(unsigned long long)), this, SLOT(projectSettings_remove_clicked(unsigned long long)));
if(npd->exec() == QDialog::Accepted) {
auto data = npd->getProjektStruct(projects);
projects->replace(i, data);
projects->store();
reloadEntryList();
createNewtask(S_TASK::UPDATE_PROJECT_DATA, data);
}
break;
}
}
}
void MainWindow::projectSettings_remove_clicked(unsigned long long id)
{
for(int i = 0; i < ui->listWidget->count(); i++) {
if(ui->listWidget->item(i)->data(187).toULongLong() == id) {
delete ui->listWidget->takeItem(i);
break;
}
}
for(int i = 0; i < projects->size(); i++) {
if(projects->at(i)->getId() == id) {
projects->removeAt(i);
projects->store();
break;
}
}
}
void MainWindow::on_actionAuf_Updates_pr_fen_triggered()
{
this->ueberdialog->updater()->checkForUpdates(true, false);
}
void MainWindow::closeEvent(QCloseEvent *event)
{
QMessageBox msgBox(QMessageBox::Question, "Bestätigung", "Was möchten Sie tun?", QMessageBox::NoButton, this);
QPushButton* aboardButton = msgBox.addButton("Abbrechen", QMessageBox::ActionRole);
QPushButton* exitButton = msgBox.addButton("Programm beenden", QMessageBox::RejectRole);
QPushButton* hideButton = msgBox.addButton("Fenster verstecken", QMessageBox::ActionRole);
msgBox.setWindowFlags(Qt::Dialog | Qt::WindowTitleHint | Qt::CustomizeWindowHint);
msgBox.exec();
if (msgBox.clickedButton() == hideButton)
{
// QApplication::setQuitOnLastWindowClosed(true);
event->ignore(); // Das Schließen des Fensters ignorieren
hide(); // Das Fenster verstecken
}
else if (msgBox.clickedButton() == exitButton) {
event->accept(); // Das Programm beenden
QApplication::quit();
} else if(msgBox.clickedButton() == aboardButton || msgBox.clickedButton() == nullptr) {
event->ignore(); // Das Schließen des Fensters ignorieren
}
}
void MainWindow::on_actionNeues_Projekt_hinzuf_gen_triggered()
{
//Create-Dialog & reload
createNewProjektEntry();
}
void MainWindow::on_actionStatistiken_triggered()
{
statDialog->open();
}
void MainWindow::on_actionListe_Aktualiseren_triggered()
{
reloadEntryList();
}

79
src/mainwindow.h Normal file
View File

@@ -0,0 +1,79 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "mainsettingsdialog.h"
#include "projektdata.h"
#include <QSystemTrayIcon>
#include <QListWidget>
#include <QMainWindow>
#include "mupdater.h"
#include "dialogueber.h"
#include "src/statisticsdialog.h"
#include "taskmanager.h"
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
void createNewProjektEntry();
void reloadEntryList();
void addProjectToListWidget( ProjektData *data);
void createNewtask(S_TASK task, ProjektData *data);
private slots:
void on_pushButton_clicked();
void on_listWidget_itemDoubleClicked(QListWidgetItem *item);
void on_pushButton_rm_clicked();
void on_action_ber_triggered();
void on_actionEinstellungen_triggered();
void projectSettings_clicked(unsigned long long id);
void projectSettings_remove_clicked(unsigned long long id);
void on_actionAuf_Updates_pr_fen_triggered();
void on_actionNeues_Projekt_hinzuf_gen_triggered();
void on_actionStatistiken_triggered();
void on_actionListe_Aktualiseren_triggered();
private:
Ui::MainWindow *ui;
ProjektDataList * projects;
QString settingsPath;
MUpdater * updater;
DialogUeber * ueberdialog;
MainSettingsDialog * mainsettingsDialog;
QSystemTrayIcon *trayIcon;
QMenu * trayIconMenue;
StatisticsDialog * statDialog;
QString version = "1.15.0";
QString appName = "ProjektManager";
// QWidget interface
protected:
void closeEvent(QCloseEvent *event);
};
#endif // MAINWINDOW_H

234
src/mainwindow.ui Normal file
View File

@@ -0,0 +1,234 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>600</height>
</rect>
</property>
<property name="windowTitle">
<string>ProjektManager</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QPushButton" name="pushButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>28</height>
</size>
</property>
<property name="text">
<string>+ New Projekt</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="pushButton_rm">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="QListWidget" name="listWidget">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="tabKeyNavigation">
<bool>false</bool>
</property>
<property name="showDropIndicator" stdset="0">
<bool>false</bool>
</property>
<property name="dragEnabled">
<bool>false</bool>
</property>
<property name="dragDropOverwriteMode">
<bool>false</bool>
</property>
<property name="alternatingRowColors">
<bool>false</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::NoSelection</enum>
</property>
<property name="iconSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="resizeMode">
<enum>QListView::Fixed</enum>
</property>
<property name="gridSize">
<size>
<width>0</width>
<height>100</height>
</size>
</property>
<property name="viewMode">
<enum>QListView::ListMode</enum>
</property>
<property name="uniformItemSizes">
<bool>true</bool>
</property>
<property name="selectionRectVisible">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>qafef</string>
</property>
</item>
<item>
<property name="text">
<string>dafadfgg</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<height>25</height>
</rect>
</property>
<property name="font">
<font>
<pointsize>11</pointsize>
<bold>false</bold>
</font>
</property>
<widget class="QMenu" name="menuHilfe">
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>false</bold>
</font>
</property>
<property name="title">
<string>Hilfe</string>
</property>
<addaction name="actionAuf_Updates_pr_fen"/>
<addaction name="action_ber"/>
</widget>
<widget class="QMenu" name="menuDatei">
<property name="font">
<font>
<pointsize>10</pointsize>
<bold>false</bold>
</font>
</property>
<property name="title">
<string>Datei</string>
</property>
<addaction name="actionNeues_Projekt_hinzuf_gen"/>
<addaction name="actionListe_Aktualiseren"/>
<addaction name="actionEinstellungen"/>
</widget>
<widget class="QMenu" name="menuAnalyse">
<property name="title">
<string>Analyse</string>
</property>
<addaction name="actionStatistiken"/>
</widget>
<addaction name="menuDatei"/>
<addaction name="menuAnalyse"/>
<addaction name="menuHilfe"/>
</widget>
<widget class="QStatusBar" name="statusBar">
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
</widget>
<action name="actioniktzikl">
<property name="text">
<string>iktzikl</string>
</property>
<property name="font">
<font/>
</property>
</action>
<action name="action_ber">
<property name="text">
<string>Über ProjektManager</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
</action>
<action name="actionEinstellungen">
<property name="text">
<string>Einstellungen</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
</action>
<action name="actionAuf_Updates_pr_fen">
<property name="text">
<string>Auf Updates prüfen</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
</action>
<action name="actionNeues_Projekt_hinzuf_gen">
<property name="text">
<string>Neues Projekt hinzufügen</string>
</property>
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
</action>
<action name="actionStatistiken">
<property name="text">
<string>Statistiken</string>
</property>
</action>
<action name="actionListe_Aktualiseren">
<property name="text">
<string>Liste Aktualiseren</string>
</property>
</action>
</widget>
<resources/>
<connections/>
</ui>

547
src/newprojektdialog.cpp Normal file
View File

@@ -0,0 +1,547 @@
#include "newprojektdialog.h"
#include "ui_newprojektdialog.h"
#include <QFileDialog>
#include <QInputDialog>
#include <QMessageBox>
#include <QProcess>
#include <QString>
#include <QTime>
NewProjektDialog::NewProjektDialog(QWidget *parent)
: QDialog(parent)
, ui(new Ui::NewProjektDialog)
{
qDebug() << " NewProjektDialog()";
ui->setupUi(this);
this->setWindowTitle("Neues Projekt einrichten");
ui->pushButton_remove_entry->setHidden(true);
this->id = QDateTime::currentMSecsSinceEpoch();
ui->stackedWidget->setCurrentIndex(1);
ui->pushButton_zurueck->click();
checkIfNeccessaryFieldAreFilled();
}
NewProjektDialog::NewProjektDialog(ProjektData *projektData, QWidget *parent)
: NewProjektDialog(parent)
{
qDebug() << " NewProjektDialog()";
//load settings!
loadSettingsFromProjektData(projektData);
ui->label_projekt_einrichten->setText("'" + projektData->getName() + "' anpassen");
this->setWindowTitle("'" + projektData->getName() + "' anpassen");
// ui->lineEdit_path->setDisabled(true);
ui->pushButton_browse->setDisabled(true);
// ui->groupBoxInstaller->setDisabled(true);
// ui->groupBox_git_init->setDisabled(true);
ui->pushButton_remove_entry->setHidden(false);
//...
}
NewProjektDialog::~NewProjektDialog()
{
delete ui;
qDebug() << " ~NewProjektDialog()";
}
void NewProjektDialog::loadSettingsFromProjektData(ProjektData *projektData) {
// Laden der Einstellungen aus dem ProjektData Objekt
ui->groupBoxInstaller->setChecked(projektData->isQtInstaller());
ui->lineEditVersionFile->setText( QString(projektData->getQt_installer_versionFile()).replace(projektData->getProjectDirPath(), "") );
ui->lineEdit_path->setText(projektData->getPath());
ui->lineEditProjektName->setText(projektData->getName());
ui->lineEdit_qt_installer_name->setText(projektData->getQtInstallerName());
ui->lineEdit_qt_installer_version->setText(projektData->getQtInstallerVersion());
ui->lineEdit_qt_titel->setText(projektData->getQtInstallerTitle());
ui->lineEdit_qt_publisher->setText(projektData->getQtInstallerPublisher());
ui->lineEdit_startMenueDir->setText(projektData->getQtInstallerStartMenuDir());
ui->lineEdit_qt_online_repo_url->setText(projektData->getQtInstallerOnlineRepoUrl());
ui->lineEdit_qt_package_name->setText(projektData->getQtInstallerPackageName());
ui->lineEdit_qt_description->setPlainText(projektData->getQtInstallerDescription());
ui->lineEdit_qt_updater_icon_path->setText(projektData->getQtInstallerUpdaterIconPath());
ui->checkBox_qt_online_repo->setChecked(projektData->isQtInstallerOnlineRepo());
ui->checkBox_qt_add_link_to_start_menue->setChecked(projektData->isQtInstallerStartMenuLink());
ui->checkBox_add_link_to_desktop->setChecked(projektData->isQtInstallerDesktopLink());
ui->checkBox_add_gpl3licence->setChecked(projektData->isQtInstallerGpl3License());
ui->groupBox_Add_MUpdater_Lib->setChecked(projektData->isQtMUpdaterLib());
ui->checkBox_qt_remove_shadow_build->setChecked(projektData->shouldRemoveShadowBuildSetting());
ui->checkBox_qt_move_files_to_src_dir->setChecked(projektData->shouldMoveFilesToSrcSubDir());
ui->checkBox_qt_add_app_icon->setChecked(projektData->hasQtAppIcon());
ui->lineEdit_qt_app_icon_path->setText(projektData->getQtAppIconPath());
ui->groupBox_git_init->setChecked(projektData->isGitInit());
ui->checkBox_git_enable_daily_update->setChecked(projektData->shouldEnableDailyAutoCommit());
ui->checkBox_git_init_readme->setChecked(projektData->shouldInitReadme());
ui->checkBox_git_add_gitignore->setChecked(projektData->shouldAddGitIgnore());
ui->groupBox_git_add_remote->setChecked(projektData->shouldSetRemoteRepo());
ui->lineEdit_git_remote_url->setText(projektData->getRemoteRepoUrl());
ui->checkBoxstartafterInstall->setChecked(projektData->getQt_installer_start_after_install());
ui->plainTextEditInitText->setPlainText(projektData->getReadme_init_text());
ui->checkBoxOverwriteReadme->setChecked(projektData->getGit_overwriteReadmeFile());
ui->checkBoxgitlfs->setChecked(projektData->getGit_lfs());
this->id = projektData->getId();
}
ProjektData *NewProjektDialog::getProjektStruct(ProjektDataList *projektDataParent)
{
QString name = ui->lineEditProjektName->text();
QString path = ui->lineEdit_path->text();
QString qt_installer_name = ui->lineEdit_qt_installer_name->text();
QString qt_installer_version = ui->lineEdit_qt_installer_version->text();
QString qt_installer_titel = ui->lineEdit_qt_titel->text();
QString qt_installer_publisher = ui->lineEdit_qt_publisher->text();
QString qt_installer_start_menue_dir = ui->lineEdit_startMenueDir->text();
QString qt_installer_online_repo_url = ui->lineEdit_qt_online_repo_url->text();
QString qt_installer_package_name = ui->lineEdit_qt_package_name->text();
QString qt_installer_description = ui->lineEdit_qt_description->toPlainText();
QString qt_installer_updater_icon_path = ui->lineEdit_qt_updater_icon_path->text();
bool qt_installer_online_repo = ui->checkBox_qt_online_repo->isChecked();
bool qt_installer_start_menue_link = ui->checkBox_qt_add_link_to_start_menue->isChecked();
bool qt_installer_desktop_link = ui->checkBox_add_link_to_desktop->isChecked();
bool qt_installer_gpl3_licence = ui->checkBox_add_gpl3licence->isChecked();
bool qt_m_updater_lib = ui->groupBox_Add_MUpdater_Lib->isChecked();
bool qt_remove_shadow_build_setting = ui->checkBox_qt_remove_shadow_build->isChecked();
bool qt_move_files_to_src_sub_dir = ui->checkBox_qt_move_files_to_src_dir->isChecked();
bool qt_app_icon = ui->checkBox_qt_add_app_icon->isChecked();
QString qt_app_icon_path = ui->lineEdit_qt_app_icon_path->text();
bool git_init = ui->groupBox_git_init->isChecked();
bool git_enable_daily_auto_commit = ui->checkBox_git_enable_daily_update->isChecked();
bool git_init_readme = ui->checkBox_git_init_readme->isChecked();
bool git_add_git_ignore = ui->checkBox_git_add_gitignore->isChecked();
bool git_set_remote_repo = ui->groupBox_git_add_remote->isChecked();
QString remote_repo_url = ui->lineEdit_git_remote_url->text();
bool qt_installer = ui->groupBoxInstaller->isChecked();
QString readmeinittext = ui->plainTextEditInitText->toPlainText();
bool git_overwriteReadmeFile = ui->checkBoxOverwriteReadme->isChecked();
bool qt_installer_start_after_install = ui->checkBoxstartafterInstall->isChecked();
bool git_lfs = ui->checkBoxgitlfs->isChecked();
QString lineEditVersionFile = ui->lineEditVersionFile->text();
// Erstelle ein ProjektData Objekt mit den extrahierten Informationen
ProjektData *projektData = new ProjektData(name, path, id, qt_installer_name, qt_installer_version, qt_installer_titel,
qt_installer_publisher, qt_installer_start_menue_dir, qt_installer_online_repo_url,
qt_installer_package_name, qt_installer_description, qt_installer_updater_icon_path,
qt_installer_online_repo, qt_installer_start_menue_link, qt_installer_desktop_link,
qt_installer_gpl3_licence, qt_m_updater_lib, qt_remove_shadow_build_setting,
qt_move_files_to_src_sub_dir, qt_app_icon, qt_installer_start_after_install, qt_app_icon_path,
git_init, git_enable_daily_auto_commit, git_init_readme, git_add_git_ignore,
git_set_remote_repo, remote_repo_url, qt_installer, readmeinittext, git_overwriteReadmeFile, lineEditVersionFile,
git_lfs);
projektData->setParentList(projektDataParent);
return projektData;
}
void NewProjektDialog::on_pushButton_browse_clicked()
{
QString path = QFileDialog::getOpenFileName(this, "Open Qt Project File", "", "Qt Project File (*.pro)");
if(!path.isEmpty())
ui->lineEdit_path->setText(path);
}
void NewProjektDialog::on_lineEdit_path_textChanged(const QString &arg1)
{
bool ok = arg1.endsWith(".pro") && QFile(arg1).exists();
QPalette p = ui->lineEdit_path->palette();
p.setColor(QPalette::Text, ok? qApp->palette().buttonText().color() : Qt::red);
ui->lineEdit_path->setPalette(p);
checkIfNeccessaryFieldAreFilled();
}
void NewProjektDialog::on_pushButtonBrowseIcon_clicked()
{
QString path = QFileDialog::getOpenFileName(this, "Open Icon File", "", "Image (*.ico; *png; *jpg)");
//Convert png to ico
if(path.endsWith(".png") || path.endsWith(".jpg")) {
QImage pngImage(path);
if (pngImage.isNull()) {
qDebug() << "Error: Failed to load PNG image";
return;
}
// Convert QImage to QPixmap
QPixmap pixmap = QPixmap::fromImage(pngImage.scaled(256, 256, Qt::AspectRatioMode::KeepAspectRatio));
if (pixmap.isNull()) {
qDebug() << "Error: Failed to convert QImage to QPixmap";
return;
}
path += ".ico";
// Save QPixmap as ICO file
if (!pixmap.save(path)) {
qDebug() << "Error: Failed to save QPixmap as ICO file";
return;
}
}
if(!path.isEmpty())
ui->lineEdit_qt_updater_icon_path->setText(path);
}
void NewProjektDialog::on_lineEdit_qt_updater_icon_path_textChanged(const QString &arg1)
{
bool ok = arg1.endsWith(".ico") && ( QFile(QString(arg1).insert(arg1.length() - 4, '1')).exists() || QFile(arg1).exists());
QPalette p = ui->lineEdit_qt_updater_icon_path->palette();
p.setColor(QPalette::Text, ok? Qt::darkGreen : Qt::red);
ui->lineEdit_qt_updater_icon_path->setPalette(p);
}
void NewProjektDialog::checkIfNeccessaryFieldAreFilled()
{
bool ok = ui->lineEdit_path->text().endsWith(".pro") && QFile(ui->lineEdit_path->text()).exists();
ui->pushButton_anwenden->setDisabled(!ok);
ui->pushButton_weiter->setDisabled(!ok);
if(ok) {
QString name = ui->lineEdit_path->text().replace(".pro", ""); // Name
name = name.replace("\\", "/").replace("//", "/");
if(name.contains("/"))
name = name.remove(0, name.lastIndexOf("/") + 1);
if(ui->lineEditProjektName->text().isEmpty())
ui->lineEditProjektName->setText(name);
if(ui->lineEdit_qt_installer_name->text().isEmpty())
ui->lineEdit_qt_installer_name->setText(name + "Installer");
if(ui->lineEdit_qt_package_name->text().isEmpty())
ui->lineEdit_qt_package_name->setText("de." +name+ ".main");
if(ui->lineEdit_qt_titel->text().isEmpty())
ui->lineEdit_qt_titel->setText("<Name>" + name + "</Name> Installer");
if(ui->lineEdit_startMenueDir->text().isEmpty())
ui->lineEdit_startMenueDir->setText(name);
QFileInfo fileInfo(this->ui->lineEdit_path->text());
if(QFile(fileInfo.absolutePath() + "/icons/appicon.ico").exists()) {
if(ui->lineEdit_qt_app_icon_path->text().isEmpty()) {
ui->lineEdit_qt_app_icon_path->setText(fileInfo.absolutePath() + "/icons/appicon.ico");
ui->checkBox_qt_add_app_icon->setChecked(true);
}
}
QString username = qgetenv("USER");
if (username.isEmpty())
username = qgetenv("USERNAME");
if(ui->lineEdit_qt_online_repo_url->text().isEmpty())
ui->lineEdit_qt_online_repo_url->setText("https://code.obermui.de/" + username + "/" + name + "/media/branch/main/installer/repository");
if(ui->lineEdit_qt_publisher->text().isEmpty())
ui->lineEdit_qt_publisher->setText(username);
}
}
QPair<QString, QString> NewProjektDialog::searchForVersionString(bool messageBox)
{
QFileInfo fileInfo(this->ui->lineEdit_path->text());
QList<QPair<QString, QString>> list;
QList<int> zeilen;
if(fileInfo.exists()) {
QStringList projectDir = QDir(fileInfo.absolutePath()).entryList(QStringList() << "*.h" << "main.cpp", QDir::Files);
QStringList srcDir = QDir(fileInfo.absolutePath() + "/src/").entryList(QStringList() << "*.h" << "main.cpp", QDir::Files);
for(const QString &subDir : {QString(""), QString("src/")}) {
QString dirPath = fileInfo.absolutePath() + "/" + subDir;
for(const QString &filename : (subDir == "" ? projectDir : srcDir)) {
if(filename.startsWith("ui_"))
continue;
QFile file(dirPath + filename );
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
qDebug() << "Failed to open file: " << dirPath + filename;
return QPair<QString, QString>("", "");
}
QTextStream in(&file);
int zeile = 0;
while (!in.atEnd()) {
zeile++;
QString line = in.readLine();
for( const char* str : { "Program_Version =", "Program_Version \"", "ProgramVersion =", "ProgrammVersion \"", "Version \"",
"ProgramVersion \"", "ProgrammVersion =", "AppVersion =", "ApplicationVersion =", "QString version =", "Version =\"", "Version = ", "Version=\"" }) {
if(line.contains(str, Qt::CaseInsensitive) && line.count("\"") >= 2) {
QString substr = line.left(line.lastIndexOf("\""));
substr = substr.right(substr.length() - substr.lastIndexOf("\"") - 1);
if(substr.count(".") != 2)
continue;
list.push_back(QPair<QString, QString>(subDir + filename, str));
zeilen.push_back(zeile);
break;
}
}
}
file.close();
}
}
if(list.size() == 1)
return list.first();
if(list.size() == 0)
return QPair<QString, QString>("", "");
if(messageBox && list.size() > 1) {
QString message = "Geben sie die Nummer der Zeile ein, die den Programmcode anzeigt, der die Version ihres Programmes festlegt:\n\n";
for(int i = 0; i < list.size(); i++)
message += "[" + QString(i < 10 ? " " : "") + QString::number(i) + "] in '" + list.at(i).first + "' Zeile: " + QString::number(zeilen.at(i)) + ":\t *" + list.at(i).second + "*\n";
bool ok;
int num = QInputDialog::getText(nullptr, "Programm Version Identifier", message, QLineEdit::Normal, "", &ok).toInt();
if(ok && num >= 0 && num < list.size()) {
return list.at(num);
} else
return QPair<QString, QString>("", "");
}
}
return QPair<QString, QString>("", "");
}
void NewProjektDialog::on_lineEdit_git_remote_url_textChanged(const QString &)
{
checkIfNeccessaryFieldAreFilled();
}
void NewProjektDialog::on_lineEditProjektName_textChanged(const QString &)
{
checkIfNeccessaryFieldAreFilled();
}
void NewProjektDialog::on_pushButton_zurueck_clicked()
{
ui->stackedWidget->setCurrentIndex(std::max(0, ui->stackedWidget->currentIndex() - 1));
ui->pushButton_zurueck->setVisible(ui->stackedWidget->currentIndex() != 0);
ui->pushButton_weiter->setVisible(ui->stackedWidget->currentIndex() != /*ui->stackedWidget->count()*/4 - 1);
ui->pushButton_anwenden->setVisible(ui->stackedWidget->currentIndex() == /*ui->stackedWidget->count()*/4 - 1);
}
void NewProjektDialog::on_pushButton_weiter_clicked()
{
ui->stackedWidget->setCurrentIndex(std::min(/*ui->stackedWidget->count()*/4 - 1, ui->stackedWidget->currentIndex() + 1));
ui->pushButton_zurueck->setVisible(ui->stackedWidget->currentIndex() != 0);
ui->pushButton_weiter->setVisible(ui->stackedWidget->currentIndex() != /*ui->stackedWidget->count()*/4 - 1);
ui->pushButton_anwenden->setVisible(ui->stackedWidget->currentIndex() == /*ui->stackedWidget->count()*/4 - 1);
if(ui->stackedWidget->currentIndex() == 1) {
QPair<QString, QString> ret = searchForVersionString(false);
QString posFile = ret.first, identifier = ret.second;
if(!ret.first.isEmpty() && !ret.second.isEmpty() ) {
ui->lineEditVersionFile->setText(posFile);
ui->lineEdit_qt_installer_version->setText(identifier);
}
}
}
void NewProjektDialog::on_pushButton_anwenden_clicked()
{
this->accept();
}
void NewProjektDialog::on_pushButton_abbruch_clicked()
{
this->reject();
}
void NewProjektDialog::on_pushButton_browseappicon_clicked()
{
QString path = QFileDialog::getOpenFileName(this, "Open App Icon", "", "Image (*.ico; *png; *jpg)");
//Convert png to ico
if(path.endsWith(".png") || path.endsWith(".jpg")) {
QImage pngImage(path);
if (pngImage.isNull()) {
qDebug() << "Error: Failed to load PNG image";
return;
}
// Convert QImage to QPixmap
QPixmap pixmap = QPixmap::fromImage(pngImage.scaled(256, 256, Qt::AspectRatioMode::KeepAspectRatio));
if (pixmap.isNull()) {
qDebug() << "Error: Failed to convert QImage to QPixmap";
return;
}
path += ".ico";
// Save QPixmap as ICO file
if (!pixmap.save(path)) {
qDebug() << "Error: Failed to save QPixmap as ICO file";
return;
}
}
if(!path.isEmpty())
ui->lineEdit_qt_app_icon_path->setText(path);
}
void NewProjektDialog::on_lineEdit_qt_app_icon_path_textChanged(const QString &arg1)
{
bool ok = (arg1.endsWith(".ico") || arg1.endsWith(".png")) && QFile(arg1).exists();
QPalette p = ui->lineEdit_qt_app_icon_path->palette();
p.setColor(QPalette::Text, ok? Qt::darkGreen : Qt::red);
ui->lineEdit_qt_app_icon_path->setPalette(p);
ui->checkBox_qt_add_app_icon->setChecked(true);
}
void NewProjektDialog::on_pushButton_remove_entry_clicked()
{
int ret = QMessageBox::question(this, "Eintrag '" + this->ui->lineEditProjektName->text() + "' löschen?",
"Wollen sie den Eintrag '" + this->ui->lineEditProjektName->text() + "' wirklich entfernen?"
"\nDie lokalen Datein werden nicht gelöscht.");
if(ret == QMessageBox::Yes) {
emit removeClicked(this->id);
this->reject();
}
}
void NewProjektDialog::on_pushButtonVersionFIle_clicked()
{
QString path = QFileDialog::getOpenFileName(this, "Open Project File", "", "Project File (*.cpp; *.h)");
if(!path.isEmpty()) {
ui->lineEditVersionFile->setText(path);
}
}
void NewProjektDialog::on_pushButtonSearch_clicked()
{
//Search fo
QPair<QString, QString> ret = searchForVersionString();
QString posFile = ret.first, identifier = ret.second;
if(ret.first.isEmpty() || ret.second.isEmpty() ) {
if( QMessageBox::question(this, "Keine Versionsvariable gefunden. Neue erstellen?",
"Es wurde kein Versionsvariable oder Definition gefunden!\n'#define PROGRAM_VERSION = \"1.0.0\"' hinzfügen?") == QMessageBox::Yes) {
QFileInfo fileInfo(this->ui->lineEdit_path->text());
QString filePath;
if(QFile(fileInfo.absolutePath() + "/main.cpp").exists()) {
filePath = fileInfo.absolutePath() + "/main.cpp";
} else if(QFile(fileInfo.absolutePath() + "/src/main.cpp").exists()) {
filePath = fileInfo.absolutePath() + "/src/main.cpp";
} else {
QMessageBox::information(this, "main.cpp not found!", "Konnte die Datei main.cpp nicht finden!");
qDebug() << "failed Path: " << fileInfo.absoluteFilePath() + "/main.cpp";
return;
}
QFile file(filePath);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
QMessageBox::information(this, "Failed to open file for reading!", "Failed to open file for reading: " + file.errorString());
qDebug() << "Failed to open file for reading: " << filePath << ": " << file.errorString();
return;
}
QTextStream in(&file);
QString content = in.readAll();
file.close();
// Add new line at the beginning
QString newLine = "\n\n#define PROGRAM_VERSION = \"1.0.0\"\n\n";
content.prepend(newLine);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QMessageBox::information(this, "Failed to open file for writing!", "Failed to open file for writing: " + file.errorString());
qDebug() << "Failed to open file for writing";
return;
}
QTextStream out(&file);
out << content;
file.close();
qDebug() << "Line added successfully";
return;
}
} else {
ui->lineEditVersionFile->setText(posFile);
ui->lineEdit_qt_installer_version->setText(identifier);
}
}

75
src/newprojektdialog.h Normal file
View File

@@ -0,0 +1,75 @@
#ifndef NEWPROJEKTDIALOG_H
#define NEWPROJEKTDIALOG_H
#include <QDialog>
#include "projektdata.h"
namespace Ui {
class NewProjektDialog;
}
class NewProjektDialog : public QDialog
{
Q_OBJECT
public:
explicit NewProjektDialog(QWidget *parent = nullptr);
explicit NewProjektDialog(ProjektData *projektData, QWidget *parent = nullptr);
~NewProjektDialog();
ProjektData * getProjektStruct(ProjektDataList *projektDataParent = nullptr);
private slots:
void on_pushButton_browse_clicked();
void on_lineEdit_path_textChanged(const QString &arg1);
void on_pushButtonBrowseIcon_clicked();
void on_lineEdit_qt_updater_icon_path_textChanged(const QString &arg1);
void on_lineEdit_git_remote_url_textChanged(const QString &arg1);
void on_lineEditProjektName_textChanged(const QString &arg1);
void on_pushButton_abbruch_clicked();
void on_pushButton_zurueck_clicked();
void on_pushButton_weiter_clicked();
void on_pushButton_anwenden_clicked();
void on_pushButton_browseappicon_clicked();
void on_lineEdit_qt_app_icon_path_textChanged(const QString &arg1);
void on_pushButton_remove_entry_clicked();
void on_pushButtonVersionFIle_clicked();
void on_pushButtonSearch_clicked();
signals:
void removeClicked(unsigned long long id);
private:
Ui::NewProjektDialog *ui;
void loadSettingsFromProjektData( ProjektData *projektData);
void checkIfNeccessaryFieldAreFilled();
QPair<QString, QString> searchForVersionString(bool messageBox = true);
size_t id;
};
#endif // NEWPROJEKTDIALOG_H

1301
src/newprojektdialog.ui Normal file

File diff suppressed because it is too large Load Diff

449
src/projektdata.cpp Normal file
View File

@@ -0,0 +1,449 @@
#include "projektdata.h"
#include "qdebug.h"
#include "qdir.h"
#include "qprocess.h"
#include <QFileInfo>
ProjektData::ProjektData(QString version)
: data_version(version),
parentList(nullptr)
{
qDebug() << " ProjektData()";
}
ProjektData::~ProjektData()
{
qDebug() << " ~ProjektData()";
}
ProjektData::ProjektData(QString name, QString path, size_t id, QString qt_installer_name, QString qt_installer_version, QString qt_installer_titel,
QString qt_installer_publisher, QString qt_installer_start_menue_dir, QString qt_installer_online_repo_url,
QString qt_installer_package_name, QString qt_installer_description, QString qt_installer_updater_icon_path,
bool qt_installer_online_repo, bool qt_installer_start_menue_link,
bool qt_installer_desktop_link, bool qt_installer_gpl3_licence, bool qt_m_updater_lib, bool qt_remove_shadow_build_setting,
bool qt_move_files_to_src_sub_dir, bool qt_app_icon, bool qt_installer_start_after_install, QString qt_app_icon_path, bool git_init,
bool git_enable_daily_auto_commit, bool git_init_readme, bool git_add_git_ignore,
bool git_set_remote_repo, QString remote_repo_url, bool qt_installer, QString readme_init_text, bool git_overwriteReadmeFile, QString qt_installer_versionFile, bool gitlfs, QString version) :
magicNumber(MAGIC_NUM),
data_version(version),
parentList(nullptr),
name(name),
path(path),
id(id),
qt_installer_name(qt_installer_name),
qt_installer_version(qt_installer_version),
qt_installer_versionFile(qt_installer_versionFile),
qt_installer_titel(qt_installer_titel),
qt_installer_publisher(qt_installer_publisher),
qt_installer_start_menue_dir(qt_installer_start_menue_dir),
qt_installer_online_repo_url(qt_installer_online_repo_url),
qt_installer_package_name(qt_installer_package_name),
qt_installer_description(qt_installer_description),
qt_installer_updater_icon_path(qt_installer_updater_icon_path),
qt_installer(qt_installer),
qt_installer_online_repo(qt_installer_online_repo),
qt_installer_start_menue_link(qt_installer_start_menue_link),
qt_installer_desktop_link(qt_installer_desktop_link),
qt_installer_gpl3_licence(qt_installer_gpl3_licence),
qt_installer_start_after_install(qt_installer_start_after_install),
qt_m_updater_lib(qt_m_updater_lib),
qt_remove_shadow_build_setting(qt_remove_shadow_build_setting),
qt_move_files_to_src_sub_dir(qt_move_files_to_src_sub_dir),
qt_app_icon(qt_app_icon),
qt_app_icon_path(qt_app_icon_path),
git_init(git_init),
git_enable_daily_auto_commit(git_enable_daily_auto_commit),
git_init_readme(git_init_readme),
git_add_git_ignore(git_add_git_ignore),
git_set_remote_repo(git_set_remote_repo),
remote_repo_url(remote_repo_url),
readme_init_text(readme_init_text),
git_overwriteReadmeFile(git_overwriteReadmeFile),
git_lfs(gitlfs)
{
qDebug() << " ProjektData()";
}
bool ProjektData::dataValid() const {
return magicNumber == MAGIC_NUM;
}
QString ProjektData::getProjectDirPath()
{
QFileInfo fileInfo(this->path);
return fileInfo.absolutePath() + "/";
}
QString ProjektData::getExePath()
{
QString release = getProjectDirPath() + "release/" + getAppName() + ".exe";
QString debug = getProjectDirPath() + "debug/" + getAppName() + ".exe";
if(QFile(release).exists())
return release;
else if(!QFile(release).exists() && !QFile(debug).exists()) {
return "";
} else
return debug;
}
QString ProjektData::getAppName()
{
QString name = QString(path).replace(".pro", ""); // Name
name = name.replace("\\", "/").replace("//", "/");
if(name.contains("/"))
name = name.remove(0, name.lastIndexOf("/") + 1);
return name;
}
QString ProjektData::getAppVersion()
{
QString file = this->qt_installer_versionFile.contains(this->getProjectDirPath()) ? qt_installer_versionFile : this->getProjectDirPath() + qt_installer_versionFile;
QFile versionFile(file);
if(versionFile.exists() && versionFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream in(&versionFile);
while (!in.atEnd()) {
QString line = in.readLine();
// Process the line as needed
if(line.contains(this->qt_installer_version, Qt::CaseInsensitive) && line.contains("\"")) {
// qDebug() << "FOUND: " << this->qt_installer_version << " IN: " << line <<" in: " << name;
line = line.left(line.lastIndexOf("\""));
if(!line.contains("\""))
break;
line = line.right(line.length() - line.lastIndexOf("\"") - 1); // sdsdsd"1.1.
if(line.count(".") == 2)
return line;
break;
}
}
versionFile.close();
}
return "0.0.0";
}
size_t ProjektData::countLinesOfCode(ProjektData *data)
{
QFileInfo fileInfo(data->getPath());
size_t zeilen = 0;
if(fileInfo.exists()) {
QStringList projectDir = QDir(fileInfo.absolutePath()).entryList(QStringList() << "*.h" << "*.cpp", QDir::Files);
QStringList srcDir = QDir(fileInfo.absolutePath() + "/src/").entryList(QStringList() << "*.h" << "*.cpp", QDir::Files);
for(const char* subDir : {"", "src/"}) {
QString dirPath = fileInfo.absolutePath() + "/" + subDir;
for(const QString &filename : (QString(subDir) == "" ? projectDir : srcDir)) {
if(filename.startsWith("ui_"))
continue;
QFile file(dirPath + filename );
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
qDebug() << "Failed to open file: " << dirPath + filename;
return 0;
}
QTextStream in(&file);
while (!in.atEnd()) {
QString line = in.readLine();
if(!line.replace(" ", "").isEmpty())
zeilen++;
}
// qDebug() << dirPath + filename << " -> " << zeilen;
file.close();
}
}
}
// qDebug() << data->getAppName() << ": Line: " << zeilen;
return zeilen;
}
#include "mainsettingsdialog.h"
size_t ProjektData::countGitCommits( ProjektData *data)
{
QProcess process;
process.setWorkingDirectory(data->getProjectDirPath());
process.start(MainSettingsDialog::getGitExe(), {"rev-list", "--count", "HEAD"});
if(process.waitForFinished(1000) && process.exitCode() != 0 ) {
qDebug() << (" failed: git rev-list --count HEAD");
return 0;
}
QString str = (process.readAllStandardOutput());
// qDebug() << "(process.readAllStandardOutput())" << str;
return str.replace("\n", "").toInt();
}
size_t ProjektData::countComments(ProjektData *data)
{
QFileInfo fileInfo(data->getPath());
size_t zeilen = 0;
if(fileInfo.exists()) {
QStringList projectDir = QDir(fileInfo.absolutePath()).entryList(QStringList() << "*.h" << "*.cpp", QDir::Files);
QStringList srcDir = QDir(fileInfo.absolutePath() + "/src/").entryList(QStringList() << "*.h" << "*.cpp", QDir::Files);
for(const char* subDir : {"", "src/"}) {
QString dirPath = fileInfo.absolutePath() + "/" + subDir;
for(const QString &filename : (QString(subDir) == "" ? projectDir : srcDir)) {
if(filename.startsWith("ui_"))
continue;
QFile file(dirPath + filename );
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
qDebug() << "Failed to open file: " << dirPath + filename;
return 0;
}
QTextStream in(&file);
while (!in.atEnd()) {
QString line = in.readLine();
if(line.contains("//"))
zeilen++;
}
file.close();
}
}
}
// qDebug() << data->getAppName() << ": Line: " << zeilen;
return zeilen;
}
QList<QPointF> ProjektData::countCommitsByDate(ProjektData *data)
{
// Set the working directory
QString projectDirPath = data->getProjectDirPath(); // Assuming you have a method to get project directory path
// qDebug() << " << projectDirPath: " << projectDirPath;
// Create a list to store data points
QList<QPointF> dataList;
// Find the date of the first commit
QDateTime firstCommitDate;
QProcess firstCommitProcess;
firstCommitProcess.setWorkingDirectory(projectDirPath);
firstCommitProcess.start(MainSettingsDialog::getGitExe(), QStringList() << "rev-list" << "--max-parents=0" << "HEAD" );
;
if (!firstCommitProcess.waitForFinished() || firstCommitProcess.exitCode() != 0) {
qDebug() << "Failed to get the first commit.";
return QList<QPointF>();
}
QString firstCommitHash = firstCommitProcess.readAllStandardOutput().trimmed();
// qDebug() << "firstCommitHash << " << firstCommitHash;
firstCommitProcess.start(MainSettingsDialog::getGitExe(), QStringList() << "log" << "--format=%aI" << firstCommitHash );
if (firstCommitProcess.waitForFinished() && firstCommitProcess.exitCode() == 0) {
QString output = firstCommitProcess.readAllStandardOutput().trimmed();
if (!output.isEmpty()) {
firstCommitDate = QDateTime::fromString(output, Qt::ISODate);
// qDebug() << "First commit date:" << firstCommitDate.toString(Qt::ISODate);
} else {
qDebug() << "No commits found in the repository.";
return QList<QPointF>();
}
} else {
qDebug() << "Failed to get the date of the first commit.";
return QList<QPointF>();
}
// 0,0 to beginn
QDateTime startOfMonth_ = firstCommitDate;
startOfMonth_.setDate(QDate(firstCommitDate.date().year(), firstCommitDate.date().month(), 1));
startOfMonth_.setTime(QTime(0, 0, 0));
startOfMonth_ = startOfMonth_.addSecs(-1);
dataList << QPointF(startOfMonth_.toMSecsSinceEpoch(), 0);
// Iterate through each month from the first commit to the current date
QDateTime currentDate = firstCommitDate;
while (currentDate.isValid() && currentDate <= QDateTime::currentDateTime()) {
// Construct the start and end of the month
QDateTime startOfMonth = currentDate;
startOfMonth.setDate(QDate(currentDate.date().year(), currentDate.date().month(), 1));
startOfMonth.setTime(QTime(0, 0, 0));
QDateTime endOfMonth = startOfMonth;
endOfMonth = endOfMonth.addMonths(1);
endOfMonth = endOfMonth.addSecs(-1);
// Count the commits for the current month using Git
QProcess process;
process.setWorkingDirectory(projectDirPath);
QStringList arguments;
arguments << "rev-list" << "--count" << "--since=" + startOfMonth.toString(Qt::ISODate)
<< "--before=" + endOfMonth.toString(Qt::ISODate) << "HEAD";
process.start(MainSettingsDialog::getGitExe(), arguments);
process.waitForFinished();
// Handle the output
if (process.exitCode() == 0) {
QString output = process.readAllStandardOutput().trimmed();
bool ok;
int commitCount = output.toInt(&ok);
if (ok) {
// qDebug() << "Commits in" << startOfMonth.toString("MMM yyyy")<< ":" << commitCount ; // << " startOfMonth: " << startOfMonth << " -> endOfMonth: " << endOfMonth << " command: " << process.program() << " << " << process.arguments() << " output: " << output;
// Add data points to the list
dataList << QPointF(startOfMonth.toMSecsSinceEpoch(), commitCount);
dataList << QPointF(endOfMonth.toMSecsSinceEpoch(), commitCount);
} else {
qDebug() << "Failed to convert output to integer:" << output;
}
} else {
qDebug() << "Failed to execute git rev-list command for" << startOfMonth.toString("MMM yyyy");
// Add data points with commit count 0
dataList << QPointF(startOfMonth.toMSecsSinceEpoch(), 0);
dataList << QPointF(endOfMonth.toMSecsSinceEpoch(), 0);
}
// Move to the next month
currentDate = startOfMonth.addMonths(1);
}
return dataList;
}
ProjektDataList *ProjektData::getParentList() const
{
return parentList;
}
void ProjektData::setParentList(ProjektDataList *newParentList)
{
parentList = newParentList;
}
void ProjektData::setQt_app_icon_path(const QString &newQt_app_icon_path)
{
qt_app_icon_path = newQt_app_icon_path;
}
size_t ProjektData::getMagicNumber() const
{
return magicNumber;
}
QString ProjektData::getReadme_init_text() const
{
return readme_init_text;
}
bool ProjektData::getGit_overwriteReadmeFile() const
{
return git_overwriteReadmeFile;
}
void ProjektData::setQt_installer_updater_icon_path(const QString &newQt_installer_updater_icon_path)
{
qt_installer_updater_icon_path = newQt_installer_updater_icon_path;
}
bool ProjektData::getQt_installer_start_after_install() const
{
return qt_installer_start_after_install;
}
QString ProjektData::getQt_installer_versionFile() const
{
return qt_installer_versionFile;
}
bool ProjektData::getGit_lfs() const
{
return git_lfs;
}
ProjektDataList::~ProjektDataList()
{
if(!this->settingsPath.isEmpty())
this->store();
while(this->size())
delete this->takeAt(0);
qDebug() << " ~ProjektDataList()";
}
ProjektDataList::ProjektDataList(QString settingsPath)
: settingsPath(settingsPath)
{
qDebug() << " ProjektDataList()";
}
bool ProjektDataList::store() {
return store(this->settingsPath);
}
bool ProjektDataList::store(QString path) {
if(path.isEmpty())
return false;
QFile file(path);
if (file.open(QIODevice::WriteOnly)) {
QDataStream out(&file);
out << *this;
file.close();
} else {
return false;
}
return true;
}
bool ProjektDataList::load() {
return load(this->settingsPath);
}
bool ProjektDataList::load(QString path) {
if(path.isEmpty())
return false;
QFile file(path);
if (file.open(QIODevice::ReadOnly)) {
QDataStream in(&file);
in >> *this;
file.close();
} else {
return false;
}
// Validate loaded data and remove invalid items
for(int i = 0; i < this->length(); i++) {
if(!this->at(i)->dataValid()) {
this->remove(i--);
}
else
this->at(i)->setParentList(this);
}
return true;
}

272
src/projektdata.h Normal file
View File

@@ -0,0 +1,272 @@
#ifndef PROJEKTDATA_H
#define PROJEKTDATA_H
#include "qdebug.h"
#include <QDataStream>
#include <QFile>
#include <QList>
class ProjektDataList;
#define DATA_VERSION QString("1.4.0")
class ProjektData
{
public:
ProjektData(QString version = DATA_VERSION);
~ProjektData();
ProjektData(QString name, QString path, size_t id, QString qt_installer_name, QString qt_installer_version,
QString qt_installer_titel, QString qt_installer_publisher, QString qt_installer_start_menue_dir,
QString qt_installer_online_repo_url, QString qt_installer_package_name,
QString qt_installer_description, QString qt_installer_updater_icon_path,
bool qt_installer_online_repo, bool qt_installer_start_menue_link, bool qt_installer_desktop_link,
bool qt_installer_gpl3_licence, bool qt_m_updater_lib, bool qt_remove_shadow_build_setting,
bool qt_move_files_to_src_sub_dir, bool qt_app_icon, bool qt_installer_start_after_install,
QString qt_app_icon_path, bool git_init, bool git_enable_daily_auto_commit,
bool git_init_readme, bool git_add_git_ignore, bool git_set_remote_repo,
QString remote_repo_url, bool qt_installer, QString readme_init_text,
bool git_overwriteReadmeFile, QString qt_installer_versionFile, bool gitlfs,
QString version = DATA_VERSION);
friend QDataStream &operator<<(QDataStream &out, const ProjektData &obj) {
out << obj.MAGIC_NUM
<< obj.name << obj.path << obj.id;
// Hier serialisieren Sie alle zusätzlichen Datenmember
out << obj.qt_installer_name << obj.qt_installer_version << obj.qt_installer_titel
<< obj.qt_installer_publisher << obj.qt_installer_start_menue_dir << obj.qt_installer_online_repo_url
<< obj.qt_installer_package_name << obj.qt_installer_description << obj.qt_installer_updater_icon_path
<< obj.qt_installer_online_repo << obj.qt_installer_start_menue_link << obj.qt_installer_desktop_link
<< obj.qt_installer_gpl3_licence << obj.qt_m_updater_lib << obj.qt_remove_shadow_build_setting
<< obj.qt_move_files_to_src_sub_dir << obj.qt_app_icon << obj.qt_installer_start_after_install
<< obj.qt_app_icon_path << obj.git_init << obj.git_enable_daily_auto_commit << obj.git_init_readme
<< obj.git_add_git_ignore << obj.git_set_remote_repo << obj.remote_repo_url << obj.qt_installer << obj.readme_init_text
<< obj.git_overwriteReadmeFile << obj.git_lfs << obj.qt_installer_versionFile;
return out;
}
friend QDataStream &operator>>(QDataStream &in, ProjektData &obj) {
if(obj.data_version == DATA_VERSION) {
in >> obj.magicNumber;
// Hier deserialisieren Sie alle zusätzlichen Datenmember
in >> obj.name >> obj.path >> obj.id
>> obj.qt_installer_name >> obj.qt_installer_version >> obj.qt_installer_titel
>> obj.qt_installer_publisher >> obj.qt_installer_start_menue_dir >> obj.qt_installer_online_repo_url
>> obj.qt_installer_package_name >> obj.qt_installer_description >> obj.qt_installer_updater_icon_path
>> obj.qt_installer_online_repo >> obj.qt_installer_start_menue_link >> obj.qt_installer_desktop_link
>> obj.qt_installer_gpl3_licence >> obj.qt_m_updater_lib >> obj.qt_remove_shadow_build_setting
>> obj.qt_move_files_to_src_sub_dir >> obj.qt_app_icon >> obj.qt_installer_start_after_install
>> obj.qt_app_icon_path >> obj.git_init >> obj.git_enable_daily_auto_commit >> obj.git_init_readme
>> obj.git_add_git_ignore >> obj.git_set_remote_repo >> obj.remote_repo_url >> obj.qt_installer
>> obj.readme_init_text >> obj.git_overwriteReadmeFile >> obj.git_lfs >> obj.qt_installer_versionFile;
//Backwards Compatibility
} else if(obj.data_version == "1.3.0") {
qDebug() << "Convert Data from 1.3.0";
in >> obj.magicNumber;
// Hier deserialisieren Sie alle zusätzlichen Datenmember
in >> obj.name >> obj.path >> obj.id
>> obj.qt_installer_name >> obj.qt_installer_version >> obj.qt_installer_titel
>> obj.qt_installer_publisher >> obj.qt_installer_start_menue_dir >> obj.qt_installer_online_repo_url
>> obj.qt_installer_package_name >> obj.qt_installer_description >> obj.qt_installer_updater_icon_path
>> obj.qt_installer_online_repo >> obj.qt_installer_start_menue_link >> obj.qt_installer_desktop_link
>> obj.qt_installer_gpl3_licence >> obj.qt_m_updater_lib >> obj.qt_remove_shadow_build_setting
>> obj.qt_move_files_to_src_sub_dir >> obj.qt_app_icon >> obj.qt_installer_start_after_install
>> obj.qt_app_icon_path >> obj.git_init >> obj.git_enable_daily_auto_commit >> obj.git_init_readme
>> obj.git_add_git_ignore >> obj.git_set_remote_repo >> obj.remote_repo_url >> obj.qt_installer
>> obj.readme_init_text >> obj.git_overwriteReadmeFile >> obj.qt_installer_versionFile;
obj.git_overwriteReadmeFile = false; // init new values!
} else if(obj.data_version == "-1.0.0") {
} else if(obj.data_version == "-1.0.0") {
} else {
in >> obj.magicNumber;
obj.magicNumber = -1;
}
return in;
}
bool dataValid() const;
QString getProjectDirPath();
QString getExePath();
QString getAppName();
QString getAppVersion();
static size_t countLinesOfCode(ProjektData * data);
static size_t countGitCommits(ProjektData *data);
static size_t countComments(ProjektData *data);
static QList<QPointF> countCommitsByDate(ProjektData *data);
QString getName() const { return name; }
QString getPath() const { return path; }
size_t getId() const { return id; }
QString getQtInstallerName() const { return qt_installer_name; }
QString getQtInstallerVersion() const { return qt_installer_version; }
QString getQtInstallerTitle() const { return qt_installer_titel; }
QString getQtInstallerPublisher() const { return qt_installer_publisher; }
QString getQtInstallerStartMenuDir() const { return qt_installer_start_menue_dir; }
QString getQtInstallerOnlineRepoUrl() const { return qt_installer_online_repo_url; }
QString getQtInstallerPackageName() const { return qt_installer_package_name; }
QString getQtInstallerDescription() const { return qt_installer_description; }
QString getQtInstallerUpdaterIconPath() const { return qt_installer_updater_icon_path; }
bool isQtInstaller() const { return qt_installer; }
bool isQtInstallerOnlineRepo() const { return qt_installer_online_repo; }
bool isQtInstallerStartMenuLink() const { return qt_installer_start_menue_link; }
bool isQtInstallerDesktopLink() const { return qt_installer_desktop_link; }
bool isQtInstallerGpl3License() const { return qt_installer_gpl3_licence; }
bool isQtMUpdaterLib() const { return qt_m_updater_lib; }
bool shouldRemoveShadowBuildSetting() const { return qt_remove_shadow_build_setting; }
bool shouldMoveFilesToSrcSubDir() const { return qt_move_files_to_src_sub_dir; }
bool hasQtAppIcon() const { return qt_app_icon; }
QString getQtAppIconPath() const { return qt_app_icon_path; }
bool isGitInit() const { return git_init; }
bool shouldEnableDailyAutoCommit() const { return git_enable_daily_auto_commit; }
bool shouldInitReadme() const { return git_init_readme; }
bool shouldAddGitIgnore() const { return git_add_git_ignore; }
bool shouldSetRemoteRepo() const { return git_set_remote_repo; }
QString getRemoteRepoUrl() const { return remote_repo_url; }
ProjektDataList *getParentList() const;
void setParentList(ProjektDataList *newParentList);
void setQt_app_icon_path(const QString &newQt_app_icon_path);
size_t getMagicNumber() const;
QString getReadme_init_text() const;
bool getGit_overwriteReadmeFile() const;
void setQt_installer_updater_icon_path(const QString &newQt_installer_updater_icon_path);
bool getQt_installer_start_after_install() const;
QString getQt_installer_versionFile() const;
bool getGit_lfs() const;
private:
size_t magicNumber = -1;
static constexpr size_t MAGIC_NUM = 1225356987344;
QString data_version;
ProjektDataList * parentList;
private:
QString name;
QString path;
size_t id;
QString qt_installer_name;
QString qt_installer_version;
QString qt_installer_versionFile;
QString qt_installer_titel;
QString qt_installer_publisher;
QString qt_installer_start_menue_dir;
QString qt_installer_online_repo_url;
QString qt_installer_package_name;
QString qt_installer_description;
QString qt_installer_updater_icon_path;
bool qt_installer;
bool qt_installer_online_repo;
bool qt_installer_start_menue_link;
bool qt_installer_desktop_link;
bool qt_installer_gpl3_licence;
bool qt_installer_start_after_install;
bool qt_m_updater_lib;
bool qt_remove_shadow_build_setting;
bool qt_move_files_to_src_sub_dir;
bool qt_app_icon;
QString qt_app_icon_path;
bool git_init;
bool git_enable_daily_auto_commit;
bool git_init_readme;
bool git_add_git_ignore;
bool git_set_remote_repo;
QString remote_repo_url;
QString readme_init_text;
bool git_overwriteReadmeFile;
bool git_lfs;
};
class ProjektDataList : public QList<ProjektData*>
{
public:
~ProjektDataList();
friend QDataStream& operator<<(QDataStream& out, const ProjektDataList& list) {
//Version
out << DATA_VERSION;
//Data
for (const ProjektData* data : list) {
out << *data; // Serialize each ProjektData object in the list
}
return out;
}
friend QDataStream& operator>>(QDataStream& in, ProjektDataList& list) {
// Clear the list before reading new data
list.clear();
//Version
in >> list.dataVersion;
if(list.dataVersion != DATA_VERSION) {
//Create BackUp
qDebug() << "list.dataVersion != DATA_VERSION ==> Create BackUP!";
list.store(list.settingsPath + "_Backup");
}
// Read each ProjektData object and add it to the list
while (!in.atEnd()) {
ProjektData* data = new ProjektData(list.dataVersion);
in >> *data;
list.append(data);
}
return in;
}
ProjektDataList(QString settingsPath);
bool store();
bool store(QString path);
bool load();
bool load(QString path);
private:
QString settingsPath;
QString dataVersion = DATA_VERSION;
};
#endif // PROJEKTDATA_H

View File

@@ -0,0 +1,202 @@
#include "projektlistelementform.h"
#include "createupdaterdialog.h"
#include "mainsettingsdialog.h"
#include "qprocess.h"
#include "taskmanager.h"
#include "ui_projektlistelementform.h"
ProjektListElementForm::ProjektListElementForm(ProjektData *data, QPixmap icon, QWidget *parent)
: QWidget(parent)
, ui(new Ui::ProjektListElementForm)
, data(data)
{
qDebug() << " ProjektListElementForm()";
ui->setupUi(this);
ui->labelBzeichung->setText(data->getName());
if(data->getAppVersion() != "0.0.0")
ui->labelVersion->setText(" v" + data->getAppVersion());
else {
ui->line->setHidden(true);
ui->labelVersion->setHidden(true);
}
ui->toolButton_3->setEnabled(data->isQtInstaller());
ui->toolButton->setEnabled(data->getExePath().endsWith(".exe"));
ui->toolButton_6->setEnabled(data->shouldSetRemoteRepo());
ui->labelICON->setPixmap(icon);
}
ProjektListElementForm::~ProjektListElementForm()
{
delete ui;
qDebug() << " ~ProjektListElementForm()";
}
void ProjektListElementForm::on_toolButton_triggered(QAction *)
{
}
void ProjektListElementForm::on_toolButton_clicked()
{
windeployqt();
startApp();
}
bool ProjektListElementForm::startApp()
{
QString installedExe = "C:/Program Files/" + data->getAppName() + "/bin/" + data->getAppName() + ".exe";
if(QFile(installedExe).exists())
return QProcess::startDetached(installedExe);
else
return QProcess::startDetached(data->getExePath());
}
bool ProjektListElementForm::windeployqt()
{
QString projectDir = data->getProjectDirPath();
for(const char *mode : {"release/", "debug/"}) {
if(QDir(projectDir + mode ).exists() && !QFile(projectDir + mode + "libstdc++-6.dll").exists() && QFile(projectDir + mode + data->getAppName() + ".exe").exists()) {
QString path = MainSettingsDialog::getQtKitDirPath() + "windeployqt.exe";
if(QProcess::execute(path, QStringList() << projectDir + mode + data->getAppName() + ".exe"))
return false;
} else {
qDebug() << "Skippe windeployqt() für " << mode;
}
}
return true;
}
bool ProjektListElementForm::mingwclean()
{
QString exe = MainSettingsDialog::getQtMinGWDirPath() + "mingw32-make.exe";
if(QFile(data->getProjectDirPath() + "Makefile").exists()) {
QProcess process;
process.setWorkingDirectory(data->getProjectDirPath());
process.start(exe);
if (process.waitForStarted()) {
qDebug() << "Prozess erfolgreich gestartet!";
// Weitere Aktionen ausführen, z.B. waitForFinished(), um auf das Beenden des Prozesses zu warten
} else {
qDebug() << "Fehler beim Starten des Prozesses:" << process.errorString();
return false;
}
if(process.waitForFinished() == 0 ) {
perror("error: ");
return false;
}
}
for(const QString &str : { QString("release/object_script." + data->getAppName() + ".Release"),
QString("debug/object_script." + data->getAppName() + ".Debug"),
QString(".qmake.stash"),
QString("Makefile"),
QString("Makefile.Release"),
QString("Makefile.Debug")}) {
QFile f = QFile(data->getProjectDirPath() + str );
if(f.exists())
f.remove();
}
return true;
}
bool ProjektListElementForm::openWinExplorer()
{
return QDesktopServices::openUrl( QUrl::fromLocalFile(data->getProjectDirPath()) );
}
bool ProjektListElementForm::startGitGui()
{
if(MainSettingsDialog::useGitGui()) {
return QProcess::startDetached("C:\\Program Files\\Git\\git-bash.exe", {"--cd=" + QString(data->getProjectDirPath()) + ""} );
} else {
return QProcess::startDetached("git-gui.exe", {}, data->getProjectDirPath());
}
}
bool ProjektListElementForm::startUpdaterCreationTask()
{
CreateUpdaterDialog dialog(data);
if(dialog.exec() == QDialog::Accepted) {
TaskManager * sm = new TaskManager(data, /*this*/nullptr); // Nicht this als parent, falls Liste reloaded wird, wird sonst Task gekillt!
return sm->startTask(S_TASK::CREATE_PROJECT_INSTALLER, dialog.values());
}
return false;
}
void ProjektListElementForm::resizeEvent(QResizeEvent *)
{
bool hidden = ui->labelVersion->text().isEmpty() || this->width() < 650;
this->ui->labelVersion->setHidden(hidden);
this->ui->line->setHidden(hidden);
}
void ProjektListElementForm::on_toolButton_2_clicked()
{
openWinExplorer();
}
void ProjektListElementForm::on_toolButtonsettings_clicked()
{
emit settingsClicked(data->getId());
}
void ProjektListElementForm::on_toolButton_4_clicked()
{
startGitGui();
}
void ProjektListElementForm::on_toolButton_3_clicked()
{
startUpdaterCreationTask();
}
void ProjektListElementForm::on_toolButton_5_clicked()
{
QProcess::startDetached(MainSettingsDialog::getQtDir() + "Tools/QtCreator/bin/qtcreator.exe", { data->getPath() });
}
void ProjektListElementForm::on_toolButton_6_clicked()
{
QString url = data->getRemoteRepoUrl().replace("ssh", "https");
if(url.contains("//") && url.contains("@"))
url.remove(url.indexOf("//") + 2, url.indexOf("@") - url.indexOf("//") - 2 + 1);
int firstdp = url.indexOf(":");
if(firstdp != -1) {
if (url.indexOf(":", firstdp + 1) && url.indexOf("/", url.indexOf(":", firstdp + 1)) != -1) {
int colonIndex = url.indexOf(":", firstdp + 1);
int slashIndex = url.indexOf("/", colonIndex);
url.remove(colonIndex, slashIndex - colonIndex);
}
qDebug() << data->getRemoteRepoUrl() << " --> " << url;
QDesktopServices::openUrl (QUrl(url) );
} else {
this->ui->toolButton_6->setDisabled(true);
}
}

View File

@@ -0,0 +1,58 @@
#ifndef PROJEKTLISTELEMENTFORM_H
#define PROJEKTLISTELEMENTFORM_H
#include <QWidget>
#include "projektdata.h"
namespace Ui {
class ProjektListElementForm;
}
class ProjektListElementForm : public QWidget
{
Q_OBJECT
public:
explicit ProjektListElementForm(ProjektData * data, QPixmap icon, QWidget *parent = nullptr);
~ProjektListElementForm();
private slots:
void on_toolButton_triggered(QAction *arg1);
void on_toolButton_clicked();
void on_toolButton_2_clicked();
void on_toolButtonsettings_clicked();
void on_toolButton_4_clicked();
void on_toolButton_3_clicked();
void on_toolButton_5_clicked();
void on_toolButton_6_clicked();
signals:
void settingsClicked(unsigned long long id);
private:
Ui::ProjektListElementForm *ui;
ProjektData * data;
bool startApp();
bool windeployqt();
bool mingwclean();
bool openWinExplorer();
bool startGitGui();
bool startUpdaterCreationTask();
// QWidget interface
protected:
void resizeEvent(QResizeEvent *event);
};
#endif // PROJEKTLISTELEMENTFORM_H

View File

@@ -0,0 +1,374 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ProjektListElementForm</class>
<widget class="QWidget" name="ProjektListElementForm">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>903</width>
<height>82</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="labelICON">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../ressources.qrc">:/icons/appSymbol64.ico</pixmap>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="labelBzeichung">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>180</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<pointsize>13</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>ICO vor name</string>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelVersion">
<property name="font">
<font>
<pointsize>10</pointsize>
</font>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="toolButton">
<property name="minimumSize">
<size>
<width>42</width>
<height>42</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../ressources.qrc">
<normaloff>:/icons/Start2.png</normaloff>:/icons/Start2.png</iconset>
</property>
<property name="iconSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="popupMode">
<enum>QToolButton::DelayedPopup</enum>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
<property name="arrowType">
<enum>Qt::NoArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_2">
<property name="minimumSize">
<size>
<width>42</width>
<height>42</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../ressources.qrc">
<normaloff>:/icons/File-Explorer64.ico</normaloff>:/icons/File-Explorer64.ico</iconset>
</property>
<property name="iconSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_3">
<property name="minimumSize">
<size>
<width>42</width>
<height>42</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../ressources.qrc">
<normaloff>:/icons/upgrade.ico</normaloff>:/icons/upgrade.ico</iconset>
</property>
<property name="iconSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_4">
<property name="minimumSize">
<size>
<width>42</width>
<height>42</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../ressources.qrc">
<normaloff>:/icons/gwindows_logo.png</normaloff>:/icons/gwindows_logo.png</iconset>
</property>
<property name="iconSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_5">
<property name="minimumSize">
<size>
<width>42</width>
<height>42</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../ressources.qrc">
<normaloff>:/icons/qt-creator64.png</normaloff>:/icons/qt-creator64.png</iconset>
</property>
<property name="iconSize">
<size>
<width>34</width>
<height>34</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButton_6">
<property name="minimumSize">
<size>
<width>42</width>
<height>42</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../ressources.qrc">
<normaloff>:/icons/Gitea_Logo64.png</normaloff>:/icons/Gitea_Logo64.png</iconset>
</property>
<property name="iconSize">
<size>
<width>34</width>
<height>34</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="toolButtonsettings">
<property name="minimumSize">
<size>
<width>42</width>
<height>42</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../ressources.qrc">
<normaloff>:/icons/settings64.ico</normaloff>:/icons/settings64.ico</iconset>
</property>
<property name="iconSize">
<size>
<width>28</width>
<height>28</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources>
<include location="../ressources.qrc"/>
</resources>
<connections/>
</ui>

421
src/statisticsdialog.cpp Normal file
View File

@@ -0,0 +1,421 @@
#include "statisticsdialog.h"
#include "ui_statisticsdialog.h"
#include <QBarCategoryAxis>
#include <QBarSet>
#include <QHorizontalBarSeries>
#include <QValueAxis>
#include <unistd.h>
#include <QDateTimeAxis>
#include <QAreaSeries>
StatisticsDialog::StatisticsDialog(ProjektDataList *dataList, QWidget *parent)
: QDialog(parent)
, ui(new Ui::StatisticsDialog)
, dataList(dataList)
{
qDebug() << " StatisticsDialog()";
ui->setupUi(this);
ui->splitter->setSizes(QList<int>() << 180 << 500); // Set initial sizes for the widgets
//create statistics
charts.append(new CHART("Anzahl an Git Commits pro Monat", "Anzahl an Git Commits pro Monat", ui->verticalLayout_stats, dataList, &categories, &ProjektData::countCommitsByDate, &switches ));
charts.append(new CHART("Anzahl an Codezeilen", "Anzahl an nicht leeren Code Zeilen", ui->verticalLayout_stats, dataList, &categories, &ProjektData::countLinesOfCode, &switches ));
charts.append(new CHART("Anzahl an Git Commits", "Anzahl an Git Commits", ui->verticalLayout_stats, dataList, &categories, &ProjektData::countGitCommits, &switches ));
charts.append(new CHART("Anzahl an Kommentaren", "Anzahl an // Kommentaren", ui->verticalLayout_stats, dataList, &categories, &ProjektData::countComments, &switches ));
//connect charts
for(auto * chart : charts)
connect(chart, SIGNAL(loadStatsFinishedSig(CHART*)), this, SLOT(loadStatsFinished(CHART*)));
}
StatisticsDialog::~StatisticsDialog()
{
for(CHART * chart: charts)
delete chart;
charts.clear();
delete ui;
qDebug() << " ~StatisticsDialog()";
}
CHART::CHART(QString titel_text, QString bar_text, QLayout *parent_layout, ProjektDataList *dataList, QStringList *categories, QList<SwitchLayout *> *switches, CHARTTYPE ct)
: chartType(ct), dataList(dataList), bar_text(bar_text), titel_text(titel_text), parent_layout(parent_layout), switches(switches),
categories(categories), axisX(nullptr), max_y(0.0), min_x(QDateTime::currentMSecsSinceEpoch()), max_x(0.0), max_month_count(0)
{
this->titel = new QLabel("Lade...");
this->titel->setAlignment(Qt::AlignCenter);
//set bold
QFont f = this->titel->font();
f.setBold(true);
this->titel->setFont(f);
//create chartview
this->chartView = new QChartView();
this->chartView->setMinimumHeight(375);
this->chartView->setRenderHint(QPainter::Antialiasing);
this->chart = new QChart();
this->chart->setAnimationOptions(QChart::SeriesAnimations);
// Setze die Legende
this->chart->legend()->setVisible(true);
this->chart->legend()->setAlignment(Qt::AlignBottom);
this->parent_layout->addItem( (spacer2 = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Fixed)) );
this->parent_layout->addWidget(this->titel);
this->parent_layout->addItem( (spacer = new QSpacerItem(20, 15, QSizePolicy::Minimum, QSizePolicy::Fixed)) );
this->parent_layout->addWidget(chartView);
}
CHART::CHART(QString titel_text, QString bar_text, QLayout *parent_layout, ProjektDataList *dataList, QStringList *categories, std::function<size_t (ProjektData *)> func, QList<SwitchLayout *> * switches)
: CHART(titel_text, bar_text, parent_layout, dataList, categories, switches, CHARTTYPE::BAR)
{
evalFuncBar = func;
// Erstelle die Achsen für das Chart
axisY = new QBarCategoryAxis();
this->chart->addAxis(axisY, Qt::AlignLeft);
axisX = new QValueAxis();
this->chart->addAxis(axisX, Qt::AlignBottom);
chartView->setChart(this->chart);
}
CHART::CHART(QString titel_text, QString bar_text, QLayout *parent_layout, ProjektDataList *dataList, QStringList *categories, std::function<QList<QPointF> (ProjektData *)> func, QList<SwitchLayout *> * switches)
: CHART(titel_text, bar_text, parent_layout, dataList, categories, switches, CHARTTYPE::TIME)
{
evalFuncLine = func;
// Create a QValueAxis for the y-axis
QValueAxis * axisY = new QValueAxis();
axisY->setTitleText("Anzahl an Commits");
chart->addAxis(axisY, Qt::AlignLeft);
this->axisY = axisY;
chartView->setChart(this->chart);
}
void CHART::startCalc()
{
this->titel->setText("Lade " + this->titel_text +"...");
this->chart->removeAllSeries();
lineSeriesList.clear();
max_y = (0.0);
min_x = (QDateTime::currentMSecsSinceEpoch());
max_x = (0.0);
max_month_count = (0);
switch (this->chartType) {
case BAR:
this->series = new QHorizontalBarSeries();
this->barset = new QBarSet(this->bar_text);
break;
case TIME:
for (int i = 0; i < this->dataList->size(); ++i) {
if(isDisabled(this->dataList->at(i)))
continue;
lineSeriesList[this->dataList->at(i)] = (new QLineSeries());
lineSeriesList[this->dataList->at(i)]->setName(this->dataList->at(i)->getAppName());
}
break;
}
this->future = QtConcurrent::run([this]() { calc(); });
}
bool CHART::isDisabled(ProjektData *data)
{
for(auto *switchlayout : *switches)
if(switchlayout->data == data)
return !switchlayout->swtch->isChecked();
return false;
}
bool CHART::isCalculating()
{
return future.isRunning();
}
bool StatisticsDialog::isDisabled(ProjektData *data)
{
for(auto *switchlayout : switches)
if(switchlayout->data == data)
return !switchlayout->swtch->isChecked();
return false;
}
void CHART::calc()
{
qDebug() << " calcStatistics()";
switch (this->chartType) {
case BAR:
for (int i = this->dataList->size() - 1; i >= 0; --i) {
if(isDisabled(this->dataList->at(i)))
continue;
*this->barset << this->evalFuncBar(this->dataList->at(i));
}
break;
case TIME: {
for (int i = 0; i < this->dataList->size(); ++i) {
if(isDisabled(this->dataList->at(i)) || !lineSeriesList.contains(this->dataList->at(i)))
continue;
// qDebug() << "QLineSeries() index: " << i << " name: " << lineSeriesList[this->dataList->at(i)]->name() << " ....";
QList<QPointF> stat = this->evalFuncLine(dataList->at(i));
if(stat.empty()) {
qDebug() << " --> SKIPP is empty!";
lineSeriesList[this->dataList->at(i)]->append(QPointF(QDateTime::currentMSecsSinceEpoch(), 0));
continue;
}
for(int index = 0; index < stat.count(); index++) {
lineSeriesList[this->dataList->at(i)]->append(stat.at(index));
max_y = std::max(max_y, stat.at(index).y());
max_x = std::max(max_x, stat.at(index).x());
min_x = std::min(min_x, stat.at(index).x());
}
//maximal so viele monatslabel wie monate
max_month_count = std::max(max_month_count, (int)(stat.count() + 1) / 2);
}
break;
}
}
emit loadStatsFinishedSig(this);
}
void CHART::displayResult()
{
this->titel->setText(this->titel_text);
switch(chartType) {
case BAR:
((QHorizontalBarSeries*)this->series)->append(this->barset);
((QBarCategoryAxis *)axisY)->clear();
// qDebug() << "clear && ad:: " << *categories;
if(!categories->isEmpty()) {
this->chart->addSeries(this->series);
((QBarCategoryAxis *)axisY)->append(*categories);
this->series->attachAxis((QValueAxis *)this->axisX);
((QValueAxis *)this->axisX)->applyNiceNumbers();
((QBarCategoryAxis *)axisY)->show();
} else {
((QBarCategoryAxis *)axisY)->hide();
}
break;
case TIME:
for (int i = 0; i < this->dataList->size(); ++i) {
if(isDisabled(this->dataList->at(i)) || !lineSeriesList.contains(this->dataList->at(i)))
continue;
this->chart->addSeries(this->lineSeriesList[this->dataList->at(i)]);
}
if(!axisX) {
// Create a QDateTimeAxis for the x-axis
QDateTimeAxis * axisX = new QDateTimeAxis();
axisX->setTitleText("Month");
axisX->setFormat("dd. MMM yy"); // Display only month name (e.g., Jan, Feb)
// axisX->setTickCount(12); // Set number of ticks as the number of months
axisX->setTitleText("Date");
chart->addAxis(axisX, Qt::AlignBottom);
this->axisX = axisX;
}
for (int i = 0; i < this->dataList->size(); ++i) {
if(isDisabled(this->dataList->at(i)) || !lineSeriesList.contains(this->dataList->at(i)))
continue;
this->lineSeriesList[this->dataList->at(i)]->attachAxis(this->axisX);
this->lineSeriesList[this->dataList->at(i)]->attachAxis(this->axisY);
// Set line thickness of the series
QPen pen = this->lineSeriesList[this->dataList->at(i)]->pen(); // Get current pen
pen.setWidth(5); // Set line thickness
this->lineSeriesList[this->dataList->at(i)]->setPen(pen); // Set new pen
}
break;
}
}
void CHART::updateXTicks(const int &new_width)
{
if(this->axisX) {
switch(this->chartType) {
case BAR:
((QValueAxis *)this->axisX)->setTickCount(new_width / 80);
break;
case TIME:
//maximal so viele monatslabel wie monate, aber auch nicht immer alle, sondern wenn fenster kleinder dann weniger
((QDateTimeAxis *)this->axisX)->setTickCount(std::min(new_width / 100, max_month_count ));
((QDateTimeAxis *)this->axisX)->setRange(QDateTime::fromMSecsSinceEpoch(min_x), QDateTime::fromMSecsSinceEpoch(max_x));
((QValueAxis *)this->axisY)->setRange(0, (int)this->max_y + 1);
break;
}
}
}
void StatisticsDialog::startCalculation()
{
qDebug() << " startCalculation()";
loadCategories();
//remove not existing switches
for(auto &pair : switches) {
if(!dataList->contains(pair->data)) {
switches.removeOne(pair);
ui->buttons->removeWidget(pair->widget);
delete pair->widget;
delete pair;
}
}
//add not existing switches
for(auto * data : *dataList) {
bool exist = false;
for(auto &pair : switches) {
if(pair->data == data) {
exist = true;
}
}
if(!exist) {
auto newswitch = new SwitchLayout(data);
connect(newswitch->swtch, SIGNAL(clicked(bool)), this, SLOT(projectToglebtntoggled(bool)));
ui->buttons->insertWidget(ui->buttons->count() - 4, newswitch->widget);
switches.append(newswitch);
}
}
//wenn noch etwas nicht geladen hat brich ab und mach ggf. switch event rückgängig!
for(CHART * chart : charts) {
if(chart->isCalculating()) {
QObject * sender = QObject::sender();
Switch* sw = qobject_cast<Switch*>(sender);
for(auto *switchlayout : switches) {
if(switchlayout->swtch == sw) {
switchlayout->swtch->setChecked(!switchlayout->swtch->isChecked());
}
}
return;
}
}
//sonst starte threads...
for(CHART * chart : charts) {
chart->startCalc();
}
}
void StatisticsDialog::loadCategories()
{
qDebug() << " loadCategories()";
categories.clear();
// Iteriere über die Projektdaten und fülle die Daten für das Chart
for (int i = this->dataList->size() - 1; i >= 0; --i) {
if(isDisabled(this->dataList->at(i)))
continue;
ProjektData *data = this->dataList->at(i);
QString name = data->getAppName();
QString diff = name;
while(categories.contains(diff))
diff += "_";
if(categories.contains(name))
categories.replace(categories.indexOf(name), diff);
categories.append(name); // Umgekehrte Reihenfolge
}
}
void StatisticsDialog::loadStatsFinished(CHART *chart)
{
qDebug() << " loadStatsFinished()";
chart->displayResult();
chart->updateXTicks(this->width());
}
void StatisticsDialog::projectToglebtntoggled(bool)
{
startCalculation();
}
void StatisticsDialog::showEvent(QShowEvent *)
{
startCalculation();
}
void StatisticsDialog::on_pushButtonreload_clicked()
{
startCalculation();
}
void StatisticsDialog::resizeEvent(QResizeEvent *event)
{
for(CHART * chart : charts) {
chart->updateXTicks(event->size().width());
}
}
void StatisticsDialog::on_pushButtonclose_clicked()
{
this->accept();
}
SwitchLayout::SwitchLayout() {
}
SwitchLayout::SwitchLayout(ProjektData *data) {
this->data = data;
widget = new QWidget();
layout = new QHBoxLayout();
widget->setLayout(layout);
labelname = new QLabel(data->getAppName());
swtch = new Switch();
swtch->setChecked(true);
layout->addWidget(labelname);
layout->addSpacerItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum));
layout->addWidget(swtch);
}

134
src/statisticsdialog.h Normal file
View File

@@ -0,0 +1,134 @@
#ifndef STATISTICSDIALOG_H
#define STATISTICSDIALOG_H
#include "qbarset.h"
#include "qhorizontalbarseries.h"
#include "qlabel.h"
#include <QLineSeries>
#include <QVBoxLayout>
#include <qthread.h>
#include <qvalueaxis.h>
#include "src/projektdata.h"
#include <QChartView>
#include <QDialog>
#include <QtCharts/QChart>
#include <QSpacerItem>
#include <QtConcurrent/QtConcurrent>
#include <QAbstractSeries>
#include "switch.h"
struct SwitchLayout{
SwitchLayout();
SwitchLayout(ProjektData * data);
Switch * swtch;
ProjektData * data;
QHBoxLayout * layout;
QLabel * labelname;
QWidget * widget;
};
class CHART : public QObject
{
Q_OBJECT
public:
enum CHARTTYPE{
BAR,
TIME
};
CHART(QString titel_text, QString bar_text, QLayout * parent_layout, ProjektDataList * dataList, QStringList * categories, std::function<size_t(ProjektData *)> func, QList<SwitchLayout *> * switches);
CHART(QString titel_text, QString bar_text, QLayout * parent_layout, ProjektDataList * dataList, QStringList * categories, std::function<QList<QPointF>(ProjektData *)> func, QList<SwitchLayout *> * switches);
void startCalc();
void calc();
void displayResult();
void updateXTicks(const int &new_width);
bool isDisabled(ProjektData * data);
bool isCalculating();
private:
CHART(QString titel_text, QString bar_text, QLayout * parent_layout, ProjektDataList * dataList, QStringList *categories, QList<SwitchLayout *> * switches, CHARTTYPE ct);
CHARTTYPE chartType;
std::function<size_t(ProjektData *)> evalFuncBar;
std::function<QList<QPointF>(ProjektData *)> evalFuncLine;
QFuture<void> future;
ProjektDataList * dataList;
QString bar_text;
QString titel_text;
QLabel * titel;
QChart * chart;
QLayout * parent_layout;
QChartView *chartView;
QHorizontalBarSeries *series;
QMap<ProjektData*, QLineSeries *> lineSeriesList;
QList<SwitchLayout *> * switches;
QStringList * categories;
QBarSet *barset;
QAbstractAxis *axisY;
QAbstractAxis *axisX;
QSpacerItem *spacer, *spacer2;
double max_y;
double min_x, max_x;
int max_month_count;
signals:
void loadStatsFinishedSig(CHART * chart);
};
namespace Ui {
class StatisticsDialog;
}
class StatisticsDialog : public QDialog
{
Q_OBJECT
public:
explicit StatisticsDialog(ProjektDataList * data, QWidget *parent = nullptr);
~StatisticsDialog();
void startCalculation();
private:
Ui::StatisticsDialog *ui;
ProjektDataList * dataList;
QThread calcThread;
QList<CHART *> charts;
QList<SwitchLayout *> switches;
QStringList categories;
void loadCategories();
bool isDisabled(ProjektData * data);
public slots:
void loadStatsFinished(CHART * chart);
void projectToglebtntoggled(bool);
// QWidget interface
protected:
void showEvent(QShowEvent *event);
// QWidget interface
protected:
void resizeEvent(QResizeEvent *event);
private slots:
void on_pushButtonreload_clicked();
void on_pushButtonclose_clicked();
};
#endif // STATISTICSDIALOG_H

164
src/statisticsdialog.ui Normal file
View File

@@ -0,0 +1,164 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>StatisticsDialog</class>
<widget class="QDialog" name="StatisticsDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>791</width>
<height>663</height>
</rect>
</property>
<property name="windowTitle">
<string>Statistiken</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QWidget" name="verticalWidget_2" native="true">
<property name="minimumSize">
<size>
<width>220</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>500</width>
<height>16777215</height>
</size>
</property>
<layout class="QVBoxLayout" name="buttons">
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>120</width>
<height>60</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButtonreload">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Reload</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QPushButton" name="pushButtonclose">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Schließen</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QScrollArea" name="scrollArea">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>269</width>
<height>645</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout_stats"/>
</item>
</layout>
</widget>
</widget>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

1603
src/taskmanager.cpp Normal file

File diff suppressed because it is too large Load Diff

132
src/taskmanager.h Normal file
View File

@@ -0,0 +1,132 @@
#ifndef TASKMANAGER_H
#define TASKMANAGER_H
#include <QDialog>
#include "createupdaterdialog.h"
#include "projektdata.h"
#include "qprocess.h"
#include "qthread.h"
#include "projektdata.h"
#include "qtimer.h"
#include <QDirIterator>
#include <unistd.h>
#include "mainsettingsdialog.h"
enum S_TASK {
CREATE_NEW_PROJECT = 4,
UPDATE_PROJECT_DATA = 5,
CREATE_PROJECT_INSTALLER = 6,
REMOVE_BUILD_DIRS = 7
};
class Worker : public QThread
{
Q_OBJECT
public:
Worker(ProjektData *data, bool hiddentask);
~Worker();
bool startTask(S_TASK task);
bool stop();
bool setupInstaller(QString programmVersion);
bool createInstaller();
bool setupIDE();
bool setupGit();
bool deleteBuildDirs();
int getProcessStatus();
bool windeployqt();
bool mingwclean();
void setExtraData(ThreadData newExtraData);
void copyFolder(const QString& sourceFolder, const QString& destFolder);
bool updateVersionInFile();
bool replaceStringInLine(const QString& filePath, const QString& lineFinder, const QString &replaceThis, const QString& newString);
bool removeDirectories(const QString &path, const QString &prefix, const QString &infix, const QString &suffix, const QString &suffix_alternativ, const QString &suffix_alternativ2);
QProcess * silentProcess1, *silentProcess2, *silentProcess3;
void setHiddentask(bool newHiddentask);
private:
void run();
ProjektData *data;
S_TASK task;
ThreadData extraData;
QProcess * process;
bool hiddentask;
QElapsedTimer elapsedtimer;
QTimer * statusTimer;
QTimer * statusTimer2;
unsigned p_status;
unsigned p_status_current_max;
unsigned avg_completetime;
int getStatusTimerIntervall();
void setSMax(unsigned max);
private slots:
void readyReadStandardError();
void readyReadStandardOutput();
void p_status_update_timer_event();
void p_status_update_timerText_event();
void finsihed();
signals:
void statusChanged(int newStatusVal);
void newOutput(QString output);
void newRemTime(QString output);
};
namespace Ui {
class TaskManager;
}
class TaskManager : public QDialog
{
Q_OBJECT
public:
explicit TaskManager(ProjektData *data, QWidget *parent = nullptr, bool hiddentask = false);
~TaskManager();
bool startTask(S_TASK task, ThreadData extraData = ThreadData());
ProjektData *data;
Worker * worker;
private slots:
void finsihed();
void statusChanged(int value);
void newConsoleOutput(QString output);
void newRemTimeUpdate(QString output);
void on_pushButtonHide_clicked();
void on_pushButton_clicked();
void on_TaskManager_accepted();
void on_pushButton_close_clicked();
private:
Ui::TaskManager *ui;
bool hiddentask;
};
#endif // TASKMANAGER_H

187
src/taskmanager.ui Normal file
View File

@@ -0,0 +1,187 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TaskManager</class>
<widget class="QDialog" name="TaskManager">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>642</width>
<height>479</height>
</rect>
</property>
<property name="windowTitle">
<string>Prozesslog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSplitter" name="splitter">
<property name="font">
<font>
<pointsize>11</pointsize>
</font>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="opaqueResize">
<bool>false</bool>
</property>
<widget class="QLabel" name="label">
<property name="font">
<font>
<pointsize>11</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Aufgaben werden ausgeführt...</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
<widget class="QTextEdit" name="textEdit">
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>25</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>50</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QProgressBar" name="progressBar">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="value">
<number>24</number>
</property>
<property name="textVisible">
<bool>true</bool>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_remsec">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>50</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>Abbrechen</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButtonHide">
<property name="text">
<string>Verstecken</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_close">
<property name="text">
<string>Schließen</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>