Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,15 @@ if (BUILD_TESTING)
add_subdirectory(autotests)
endif()

if (NOT WIN32)
install(FILES zone.xiv.astra.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES zone.xiv.astra.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES zone.xiv.astra.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)

ecm_qt_install_logging_categories(
EXPORT ASTRA
FILE astra.categories
SORT DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)
endif()
install(FILES zone.xiv.astra.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
install(FILES zone.xiv.astra.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES zone.xiv.astra.svg DESTINATION ${KDE_INSTALL_FULL_ICONDIR}/hicolor/scalable/apps)

ecm_qt_install_logging_categories(
EXPORT ASTRA
FILE astra.categories
SORT DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)

Expand Down
13 changes: 3 additions & 10 deletions launcher/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ target_link_libraries(astra_static PUBLIC
QCoro::Core
QCoro::Network
QCoro::Qml)
get_target_property(LIBCOTP_VERSION cotp VERSION)
target_compile_definitions(astra_static PUBLIC LIBCOTP_VERSION_STRING="${LIBCOTP_VERSION}")
if (LINUX)
target_link_libraries(astra_static PUBLIC KF6::FileMetaData)
endif()
Expand Down Expand Up @@ -134,6 +136,7 @@ qt_target_qml_sources(astra_static
ui/Settings/ProfileSettings.qml
ui/Settings/ProfilesPage.qml
ui/Settings/SettingsPage.qml
ui/Settings/TroubleshootingPage.qml
ui/Setup/AccountSetup.qml
ui/Setup/AddSquareEnix.qml
ui/Setup/BenchmarkInstallProgress.qml
Expand All @@ -145,16 +148,6 @@ qt_target_qml_sources(astra_static
ui/Main.qml
)

set_source_files_properties(../zone.xiv.astra.svg PROPERTIES
QT_RESOURCE_ALIAS /zone.xiv.astra.svg
)

qt_target_qml_sources(astra_static
PREFIX /
RESOURCES
../zone.xiv.astra.svg
)

target_link_libraries(astra PRIVATE
astra_static
astra_staticplugin
Expand Down
3 changes: 3 additions & 0 deletions launcher/config.kcfg
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ SPDX-License-Identifier: CC0-1.0
<entry name="ScreenshotDir" type="String">
<default code="true">QDir(QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)).absoluteFilePath(QStringLiteral("FFXIV"))</default>
</entry>
<entry name="VerboseLogging" type="bool">
<default>false</default>
</entry>
</group>
<group name="Developer">
<entry name="KeepPatches" type="bool">
Expand Down
4 changes: 4 additions & 0 deletions launcher/src/launchercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ LauncherCore::LauncherCore()
: QObject()
{
m_config = new Config(KSharedConfig::openConfig(QStringLiteral("astrarc"), KConfig::SimpleConfig, QStandardPaths::AppConfigLocation), this);
if (config()->verboseLogging()) {
QLoggingCategory::setFilterRules(QStringLiteral("zone.xiv.astra*=true"));
}

m_mgr = new QNetworkAccessManager(this);
m_squareEnixLogin = new SquareEnixLogin(*this, this);
m_profileManager = new ProfileManager(this);
Expand Down
31 changes: 15 additions & 16 deletions launcher/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
#include <KLocalizedString>
#include <KirigamiApp>
#include <QApplication> // NOTE: do not remove this, if your IDE suggests to do so
#include <QIcon>
#include <QQuickStyle>
#include <kdsingleapplication.h>
#include <kdsingleapplication_version.h>
#include <qcoroqml.h>

#ifdef Q_OS_WINDOWS
Expand Down Expand Up @@ -46,13 +48,16 @@ int main(int argc, char *argv[])
}

KLocalizedString::setApplicationDomain("astra");
// This needs to be set before fromAppStreamForApplication can be used, so don't remove this!
QGuiApplication::setDesktopFileName(u"zone.xiv.astra"_s);

KAboutData about(QStringLiteral("astra"),
i18n("Astra"),
QStringLiteral(ASTRA_VERSION_STRING),
i18n("Play FFXIV"),
KAboutLicense::GPL_V3,
i18n("© 2021-2026 Joshua Goins"));
auto about = KAboutData::fromAppStreamForApplication();
about.setVersion(QByteArrayLiteral(ASTRA_VERSION_STRING));
// Works around bug fixed with https://invent.kde.org/frameworks/kcoreaddons/-/merge_requests/582
#if KCOREADDONS_VERSION < QT_VERSION_CHECK(6, 28, 0)
about.setComponentName(QStringLiteral("astra"));
#endif
about.setCopyrightStatement(i18n("© 2021-2026 Joshua Goins"));
about.setOtherText(
i18n("This software requires that you have legitimate access to FINAL FANTASY XIV. By using this software, you may be in violation "
"of your User Agreement.\n\nFINAL FANTASY, FINAL FANTASY XIV, FFXIV, SQUARE ENIX, and the SQUARE ENIX logo are registered trademarks or "
Expand All @@ -62,7 +67,6 @@ int main(int argc, char *argv[])
QStringLiteral("josh@redstrate.com"),
QStringLiteral("https://redstrate.com/"),
QUrl(QStringLiteral("https://redstrate.com/rss-image.png")));
about.setHomepage(QStringLiteral("https://xiv.zone/astra"));
about.addComponent(QStringLiteral("physis"),
i18n("Library for reading and writing FFXIV data."),
QString::fromLatin1(physis_get_physis_version()),
Expand All @@ -75,22 +79,17 @@ int main(int argc, char *argv[])
KAboutLicense::GPL_V3);
about.addComponent(QStringLiteral("KDSingleApplication"),
i18n("Helper class for single-instance policy applications."),
QStringLiteral("1.2.0"),
QString::fromLatin1(KDSINGLEAPPLICATION_VERSION_STRING),
QStringLiteral("https://github.com/KDAB/KDSingleApplication"),
KAboutLicense::MIT);
about.addComponent(QStringLiteral("libcotp"),
i18n(" C library that generates TOTP and HOTP."),
QStringLiteral("3.1.1"),
i18n("C library that generates TOTP and HOTP."),
QString::fromLatin1(LIBCOTP_VERSION_STRING),
QStringLiteral("https://github.com/paolostivanin/libcotp"),
KAboutLicense::Unknown);
about.setDesktopFileName(QStringLiteral("zone.xiv.astra"));
about.setBugAddress(QByteArrayLiteral("https://github.com/redstrate/astra/issues"));
about.setComponentName(QStringLiteral("astra"));
about.setProgramLogo(QStringLiteral("zone.xiv.astra"));
about.setOrganizationDomain(QByteArrayLiteral("xiv.zone"));

KAboutData::setApplicationData(about);

QGuiApplication::setWindowIcon(QIcon::fromTheme(u"zone.xiv.astra"_s));
initializeLogging();

QCommandLineParser parser;
Expand Down
10 changes: 6 additions & 4 deletions launcher/src/squareenixlogin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,13 @@ QCoro::Task<std::optional<SquareEnixLogin::StoredInfo>> SquareEnixLogin::getStor
const QRegularExpressionMatch match = re.match(str);
if (match.hasMatch()) {
co_return StoredInfo{match.captured(1), url};
} else {
Q_EMIT m_launcher.loginError(
i18n("Square Enix servers refused to confirm session information. The game may be under maintenance, try the official launcher."));
co_return {};
}

qCDebug(ASTRA_LOG) << "Failed to find _STORED_ in" << str;
Q_EMIT m_launcher.loginError(
i18n("Square Enix servers refused to confirm session information. The game may be under maintenance, try the official launcher."));

co_return {};
}

QCoro::Task<bool> SquareEnixLogin::loginOAuth()
Expand Down
6 changes: 6 additions & 0 deletions launcher/ui/Settings/SettingsPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ KirigamiSettings.ConfigurationView {
page: () => Qt.createComponent("zone.xiv.astra", "DeveloperSettings")
visible: LauncherCore.config.showDevTools
},
KirigamiSettings.ConfigurationModule {
moduleId: "troubleshooting"
text: i18n("Troubleshooting")
icon.name: "error-symbolic"
page: () => Qt.createComponent("zone.xiv.astra", "TroubleshootingPage")
},
KirigamiSettings.ConfigurationModule {
moduleId: "about"
text: i18n("About Astra")
Expand Down
47 changes: 47 additions & 0 deletions launcher/ui/Settings/TroubleshootingPage.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// SPDX-FileCopyrightText: 2026 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later

import QtCore
import QtQuick
import QtQuick.Layouts

import org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.formcard as FormCard

import zone.xiv.astra

import "../Components"

FormCard.FormCardPage {
id: page

title: i18nc("@title:window", "Troubleshooting")

FormCard.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing * 4

FormCard.FormCheckDelegate {
id: verboseLoggingDelegate

text: i18n("Enable Verbose Logging")
description: i18n("Requires a restart of Astra to take effect.")
checked: LauncherCore.config.verboseLogging
onCheckedChanged: {
LauncherCore.config.verboseLogging = checked;
LauncherCore.config.save();
}
}

FormCard.FormDelegateSeparator {
above: verboseLoggingDelegate
below: logsFolderDelegate
}

FormCard.FormButtonDelegate {
id: logsFolderDelegate

text: i18nc("@action:button", "Open Logs Folder")
onClicked: Qt.openUrlExternally(StandardPaths.writableLocation(StandardPaths.AppDataLocation) + "/log")
}
}
}
6 changes: 4 additions & 2 deletions launcher/ui/Setup/SetupPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ FormCard.FormCardPage {
onAccepted: page.profile.config.gamePath = decodeURI(selectedFolder.toString().replace("file://", "").substr(Qt.platform.os === "windows" ? 1 : 0))
}

Image {
source: "qrc:/zone.xiv.astra.svg"
Kirigami.Icon {
source: "zone.xiv.astra"

fillMode: Image.PreserveAspectFit
visible: !LauncherCore.profileManager.hasAnyExistingInstallations()

Layout.preferredWidth: Math.round(Kirigami.Units.iconSizes.huge * 1.5)
Layout.preferredHeight: Math.round(Kirigami.Units.iconSizes.huge * 1.5)
Layout.fillWidth: true
Layout.fillHeight: true
Layout.margins: Kirigami.Units.largeSpacing * 3
Expand Down
4 changes: 2 additions & 2 deletions zone.xiv.astra.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<keyword translate="no">ffxiv</keyword>
<keyword translate="no">ff14</keyword>
</keywords>
<url type="homepage">https://xiv.zone/astra</url>
<url type="bugtracker">https://github.com/redstrate/astra/issues</url>
<url type="homepage">https://xiv.zone/software/astra</url>
<url type="bugtracker">https://github.com/redstrate/astra/issues/new</url>
<url type="contact">https://redstrate.com/contact</url>
<url type="vcs-browser">https://github.com/redstrate/astra</url>
<launchable type="desktop-id">zone.xiv.astra.desktop</launchable>
Expand Down
Loading