From 08f46dd8c7e3da108709a21b05eaff1972a4bd7c Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sun, 31 Dec 2023 12:11:42 -0500 Subject: [PATCH] Add branding and icons to all GUI applications --- armoury/CMakeLists.txt | 2 + armoury/src/main.cpp | 5 +- armoury/zone.xiv.armoury.desktop | 10 + armoury/zone.xiv.armoury.svg | 129 +++++++++++ common/include/aboutdata.h | 2 +- common/src/aboutdata.cpp | 5 +- karuku/CMakeLists.txt | 2 + karuku/src/main.cpp | 5 +- karuku/zone.xiv.karaku.desktop | 10 + karuku/zone.xiv.karaku.svg | 177 +++++++++++++++ launcher/CMakeLists.txt | 4 + launcher/src/main.cpp | 3 +- launcher/src/mainwindow.cpp | 49 ++++- launcher/zone.xiv.novus.desktop | 9 + launcher/zone.xiv.novus.svg | 151 +++++++++++++ mdlviewer/CMakeLists.txt | 2 + mdlviewer/src/main.cpp | 5 +- mdlviewer/zone.xiv.mdlviewer.desktop | 10 + mdlviewer/zone.xiv.mdlviewer.svg | 312 +++++++++++++++++++++++++++ sagasu/CMakeLists.txt | 2 + sagasu/src/main.cpp | 5 +- sagasu/zone.xiv.sagasu.desktop | 10 + sagasu/zone.xiv.sagasu.svg | 171 +++++++++++++++ 23 files changed, 1063 insertions(+), 17 deletions(-) create mode 100644 armoury/zone.xiv.armoury.desktop create mode 100644 armoury/zone.xiv.armoury.svg create mode 100644 karuku/zone.xiv.karaku.desktop create mode 100644 karuku/zone.xiv.karaku.svg create mode 100644 launcher/zone.xiv.novus.desktop create mode 100644 launcher/zone.xiv.novus.svg create mode 100644 mdlviewer/zone.xiv.mdlviewer.desktop create mode 100644 mdlviewer/zone.xiv.mdlviewer.svg create mode 100644 sagasu/zone.xiv.sagasu.desktop create mode 100644 sagasu/zone.xiv.sagasu.svg diff --git a/armoury/CMakeLists.txt b/armoury/CMakeLists.txt index 48d76fb..3ae9fcd 100644 --- a/armoury/CMakeLists.txt +++ b/armoury/CMakeLists.txt @@ -45,4 +45,6 @@ target_link_libraries(novus-armoury Qt6::Concurrent Qt6::Network) +install(FILES zone.xiv.armoury.desktop DESTINATION ${KDE_INSTALL_APPDIR}) +install(FILES zone.xiv.armoury.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps) install(TARGETS novus-armoury ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/armoury/src/main.cpp b/armoury/src/main.cpp index d98288d..504b173 100644 --- a/armoury/src/main.cpp +++ b/armoury/src/main.cpp @@ -13,7 +13,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - customizeAboutData(QStringLiteral("armoury"), QStringLiteral("Armoury"), QStringLiteral("Program to view FFXIV gear.")); + customizeAboutData(QStringLiteral("armoury"), + QStringLiteral("zone.xiv.armoury"), + QStringLiteral("Gear Editor"), + QStringLiteral("Program to view FFXIV gear.")); // Default to a sensible message pattern if (qEnvironmentVariableIsEmpty("QT_MESSAGE_PATTERN")) { diff --git a/armoury/zone.xiv.armoury.desktop b/armoury/zone.xiv.armoury.desktop new file mode 100644 index 0000000..051278d --- /dev/null +++ b/armoury/zone.xiv.armoury.desktop @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: CC0-1.0 +# SPDX-FileCopyrightText: 2023 Joshua Goins +[Desktop Entry] +Name=Novus SDK +Comment=FFXIV Gear Editor +Exec=novus-armoury %u +Terminal=false +Icon=zone.xiv.armoury +Type=Application +NoDisplay=true \ No newline at end of file diff --git a/armoury/zone.xiv.armoury.svg b/armoury/zone.xiv.armoury.svg new file mode 100644 index 0000000..d7482c2 --- /dev/null +++ b/armoury/zone.xiv.armoury.svg @@ -0,0 +1,129 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/include/aboutdata.h b/common/include/aboutdata.h index b932155..32e87d1 100644 --- a/common/include/aboutdata.h +++ b/common/include/aboutdata.h @@ -6,4 +6,4 @@ #include #include -void customizeAboutData(const QString &componentName, const QString &applicationTitle, const QString &applicationDescription); \ No newline at end of file +void customizeAboutData(const QString &componentName, const QString &desktopFilename, const QString &applicationTitle, const QString &applicationDescription); \ No newline at end of file diff --git a/common/src/aboutdata.cpp b/common/src/aboutdata.cpp index 1be5fe7..c0307d4 100644 --- a/common/src/aboutdata.cpp +++ b/common/src/aboutdata.cpp @@ -7,7 +7,7 @@ #include "novus-version.h" -void customizeAboutData(const QString &componentName, const QString &applicationTitle, const QString &applicationDescription) +void customizeAboutData(const QString &componentName, const QString &desktopFilename, const QString &applicationTitle, const QString &applicationDescription) { KAboutData about(componentName, applicationTitle, @@ -33,6 +33,9 @@ void customizeAboutData(const QString &componentName, const QString &application KAboutLicense::GPL_V3); about.setBugAddress(QByteArrayLiteral("https://lists.sr.ht/~redstrate/public-inbox")); about.setComponentName(componentName); + about.setProgramLogo(desktopFilename); + about.setDesktopFileName(desktopFilename); + about.setOrganizationDomain(QByteArrayLiteral("xiv.zone")); KAboutData::setApplicationData(about); } \ No newline at end of file diff --git a/karuku/CMakeLists.txt b/karuku/CMakeLists.txt index 856eef8..3029bda 100644 --- a/karuku/CMakeLists.txt +++ b/karuku/CMakeLists.txt @@ -20,4 +20,6 @@ target_link_libraries(novus-karuku Qt6::Core Qt6::Widgets) +install(FILES zone.xiv.karaku.desktop DESTINATION ${KDE_INSTALL_APPDIR}) +install(FILES zone.xiv.karaku.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps) install(TARGETS novus-karuku ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/karuku/src/main.cpp b/karuku/src/main.cpp index 6d93146..602e4a2 100644 --- a/karuku/src/main.cpp +++ b/karuku/src/main.cpp @@ -13,7 +13,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - customizeAboutData(QStringLiteral("karuku"), QStringLiteral("Karuku"), QStringLiteral("Program to view FFXIV Excel files.")); + customizeAboutData(QStringLiteral("karuku"), + QStringLiteral("zone.xiv.karaku"), + QStringLiteral("Excel Editor"), + QStringLiteral("Program to view FFXIV Excel files.")); // Default to a sensible message pattern if (qEnvironmentVariableIsEmpty("QT_MESSAGE_PATTERN")) { diff --git a/karuku/zone.xiv.karaku.desktop b/karuku/zone.xiv.karaku.desktop new file mode 100644 index 0000000..7df9808 --- /dev/null +++ b/karuku/zone.xiv.karaku.desktop @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: CC0-1.0 +# SPDX-FileCopyrightText: 2023 Joshua Goins +[Desktop Entry] +Name=Novus SDK +Comment=FFXIV Data Editor +Exec=novus-karaku %u +Terminal=false +Icon=zone.xiv.karaku +Type=Application +NoDisplay=true \ No newline at end of file diff --git a/karuku/zone.xiv.karaku.svg b/karuku/zone.xiv.karaku.svg new file mode 100644 index 0000000..c3be0e7 --- /dev/null +++ b/karuku/zone.xiv.karaku.svg @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt index 4170fc6..451dd8c 100644 --- a/launcher/CMakeLists.txt +++ b/launcher/CMakeLists.txt @@ -15,3 +15,7 @@ target_link_libraries(novus-launcher KF6::ConfigCore Qt6::Widgets) target_include_directories(novus-launcher PUBLIC include) + +install(FILES zone.xiv.novus.desktop DESTINATION ${KDE_INSTALL_APPDIR}) +install(FILES zone.xiv.novus.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps) +install(TARGETS novus-launcher ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS}) \ No newline at end of file diff --git a/launcher/src/main.cpp b/launcher/src/main.cpp index 79dc43f..7958379 100644 --- a/launcher/src/main.cpp +++ b/launcher/src/main.cpp @@ -16,7 +16,8 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); customizeAboutData(QStringLiteral("launcher"), - QStringLiteral("SDK Launcher"), + QStringLiteral("zone.xiv.novus"), + QStringLiteral("Novus SDK"), QStringLiteral("Handles setting up and launching various Novus SDK components.")); // Default to a sensible message pattern diff --git a/launcher/src/mainwindow.cpp b/launcher/src/mainwindow.cpp index cb736e8..be6a342 100644 --- a/launcher/src/mainwindow.cpp +++ b/launcher/src/mainwindow.cpp @@ -7,15 +7,21 @@ #include #include #include +#include #include #include #include +#include #include -static QMap applications = {{QStringLiteral("Armoury - View and export gear"), QStringLiteral("novus-armoury")}, - {QStringLiteral("Karuku - Read Excel sheets"), QStringLiteral("novus-karuku")}, - {QStringLiteral("Sagasu - Explore data archives"), QStringLiteral("novus-sagasu")}, - {QStringLiteral("Model Viewer - Preview MDL files"), QStringLiteral("novus-mdlviewer")}}; +static QMap> applications = { + {QStringLiteral("Gear Editor"), {QStringLiteral("zone.xiv.armoury"), QStringLiteral("novus-armoury")}}, + {QStringLiteral("Excel Editor"), {QStringLiteral("zone.xiv.karaku"), QStringLiteral("novus-karuku")}}, + {QStringLiteral("Data Explorer"), {QStringLiteral("zone.xiv.sagasu"), QStringLiteral("novus-sagasu")}}, + {QStringLiteral("Model Viewer"), {QStringLiteral("zone.xiv.mdlviewer"), QStringLiteral("novus-mdlviewer")}}}; + +static QMap links = {{QStringLiteral("XIV Dev Wiki"), QStringLiteral("https://xiv.dev")}, + {QStringLiteral("XIV Docs"), QStringLiteral("https://docs.xiv.zone")}}; MainWindow::MainWindow() : NovusMainWindow() @@ -30,16 +36,38 @@ MainWindow::MainWindow() appList->addItem(applicationHeader); - for (const auto &name : applications.keys()) { - appList->addItem(name); + for (const auto &key : applications.keys()) { + auto application = new QListWidgetItem(); + application->setText(key); + application->setIcon(QIcon::fromTheme(applications[key].first)); + + appList->addItem(application); + } + + auto linksHeader = new QListWidgetItem(); + linksHeader->setText(QStringLiteral("Links")); + linksHeader->setFlags(Qt::NoItemFlags); + + appList->addItem(linksHeader); + + for (const auto &key : links.keys()) { + auto application = new QListWidgetItem(); + application->setText(key); + application->setIcon(QIcon::fromTheme(QStringLiteral("internet-web-browser"))); + + appList->addItem(application); } connect(appList, &QListWidget::itemClicked, [this](QListWidgetItem *item) { - const QString exec = QStringLiteral("./") + applications[item->text()]; + if (applications.contains(item->text())) { + const QString exec = QStringLiteral("./") + applications[item->text()].second; - qDebug() << "Launching" << exec; + qDebug() << "Launching" << exec; - QProcess::startDetached(exec, QStringList()); + QProcess::startDetached(exec, QStringList()); + } else if (links.contains(item->text())) { + QDesktopServices::openUrl(QUrl::fromUserInput(links[item->text()])); + } }); auto appListLayout = new QVBoxLayout(); @@ -54,8 +82,9 @@ MainWindow::MainWindow() KConfigGroup game = config.group(QStringLiteral("Game")); auto gameCombo = new QComboBox(); + gameCombo->setMaximumWidth(175); formLayout->addRow(QStringLiteral("Current Game"), gameCombo); - formLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); + formLayout->setFieldGrowthPolicy(QFormLayout::FieldsStayAtSizeHint); gameCombo->addItem(game.readEntry("GameDir")); auto mainLayout = new QVBoxLayout(); diff --git a/launcher/zone.xiv.novus.desktop b/launcher/zone.xiv.novus.desktop new file mode 100644 index 0000000..ab7af37 --- /dev/null +++ b/launcher/zone.xiv.novus.desktop @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: CC0-1.0 +# SPDX-FileCopyrightText: 2023 Joshua Goins +[Desktop Entry] +Name=Novus SDK +Comment=Unofficial FFXIV SDK +Exec=novus-launcher %u +Terminal=false +Icon=zone.xiv.novus +Type=Application diff --git a/launcher/zone.xiv.novus.svg b/launcher/zone.xiv.novus.svg new file mode 100644 index 0000000..4498cdf --- /dev/null +++ b/launcher/zone.xiv.novus.svg @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mdlviewer/CMakeLists.txt b/mdlviewer/CMakeLists.txt index b7cace9..97b7664 100644 --- a/mdlviewer/CMakeLists.txt +++ b/mdlviewer/CMakeLists.txt @@ -21,4 +21,6 @@ target_link_libraries(novus-mdlviewer Qt6::Core Qt6::Widgets) +install(FILES zone.xiv.mdlviewer.desktop DESTINATION ${KDE_INSTALL_APPDIR}) +install(FILES zone.xiv.mdlviewer.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps) install(TARGETS novus-mdlviewer ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/mdlviewer/src/main.cpp b/mdlviewer/src/main.cpp index 85c8f71..bca63ef 100644 --- a/mdlviewer/src/main.cpp +++ b/mdlviewer/src/main.cpp @@ -13,7 +13,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - customizeAboutData(QStringLiteral("mdlviewer"), QStringLiteral("MDLViewer"), QStringLiteral("Program to view FFXIV MDL files.")); + customizeAboutData(QStringLiteral("mdlviewer"), + QStringLiteral("zone.xiv.mdlviewer"), + QStringLiteral("MDLViewer"), + QStringLiteral("Program to view FFXIV MDL files.")); // Default to a sensible message pattern if (qEnvironmentVariableIsEmpty("QT_MESSAGE_PATTERN")) { diff --git a/mdlviewer/zone.xiv.mdlviewer.desktop b/mdlviewer/zone.xiv.mdlviewer.desktop new file mode 100644 index 0000000..8eba5a5 --- /dev/null +++ b/mdlviewer/zone.xiv.mdlviewer.desktop @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: CC0-1.0 +# SPDX-FileCopyrightText: 2023 Joshua Goins +[Desktop Entry] +Name=Novus SDK +Comment=FFXIV Model Viewer +Exec=novus-mdlviewer %u +Terminal=false +Icon=zone.xiv.mdlviewer +Type=Application +NoDisplay=true \ No newline at end of file diff --git a/mdlviewer/zone.xiv.mdlviewer.svg b/mdlviewer/zone.xiv.mdlviewer.svg new file mode 100644 index 0000000..c05e82f --- /dev/null +++ b/mdlviewer/zone.xiv.mdlviewer.svg @@ -0,0 +1,312 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sagasu/CMakeLists.txt b/sagasu/CMakeLists.txt index 012f3e3..24f41a5 100644 --- a/sagasu/CMakeLists.txt +++ b/sagasu/CMakeLists.txt @@ -45,4 +45,6 @@ target_link_libraries(novus-sagasu Physis::Logger Qt6::Concurrent) +install(FILES zone.xiv.sagasu.desktop DESTINATION ${KDE_INSTALL_APPDIR}) +install(FILES zone.xiv.sagasu.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps) install(TARGETS novus-sagasu ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS}) diff --git a/sagasu/src/main.cpp b/sagasu/src/main.cpp index 086c361..6afbbe4 100644 --- a/sagasu/src/main.cpp +++ b/sagasu/src/main.cpp @@ -14,7 +14,10 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); - customizeAboutData(QStringLiteral("sagasu"), QStringLiteral("Sagasu"), QStringLiteral("Program to explore FFXIV data archives.")); + customizeAboutData(QStringLiteral("sagasu"), + QStringLiteral("zone.xiv.sagasu"), + QStringLiteral("Data Explorer"), + QStringLiteral("Program to explore FFXIV data archives.")); // Default to a sensible message pattern if (qEnvironmentVariableIsEmpty("QT_MESSAGE_PATTERN")) { diff --git a/sagasu/zone.xiv.sagasu.desktop b/sagasu/zone.xiv.sagasu.desktop new file mode 100644 index 0000000..d871e23 --- /dev/null +++ b/sagasu/zone.xiv.sagasu.desktop @@ -0,0 +1,10 @@ +# SPDX-License-Identifier: CC0-1.0 +# SPDX-FileCopyrightText: 2023 Joshua Goins +[Desktop Entry] +Name=Novus SDK +Comment=FFXIV Data Explorer +Exec=novus-sagasu %u +Terminal=false +Icon=zone.xiv.sagasu +Type=Application +NoDisplay=true \ No newline at end of file diff --git a/sagasu/zone.xiv.sagasu.svg b/sagasu/zone.xiv.sagasu.svg new file mode 100644 index 0000000..513883b --- /dev/null +++ b/sagasu/zone.xiv.sagasu.svg @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +