From e9bfd43ff73a482433e725aec715012c3c6c2a2c Mon Sep 17 00:00:00 2001 From: Tayou Date: Thu, 3 Nov 2022 04:54:57 +0100 Subject: [PATCH] added requested changes Signed-off-by: Tayou --- launcher/Application.cpp | 2 +- launcher/Application.h | 2 +- launcher/ui/pages/global/LauncherPage.cpp | 3 ++- launcher/ui/themes/CustomTheme.cpp | 22 +++++++--------------- launcher/ui/themes/CustomTheme.h | 6 +----- launcher/ui/themes/SystemTheme.cpp | 6 +----- launcher/ui/themes/ThemeManager.cpp | 2 +- launcher/ui/themes/ThemeManager.h | 2 +- 8 files changed, 15 insertions(+), 30 deletions(-) diff --git a/launcher/Application.cpp b/launcher/Application.cpp index fa202312..d27176c5 100644 --- a/launcher/Application.cpp +++ b/launcher/Application.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-only /* - * Prism Launcher + * Prism Launcher - Minecraft Launcher * Copyright (C) 2022 Sefa Eyeoglu * Copyright (C) 2022 Lenny McLennington * Copyright (C) 2022 Tayou diff --git a/launcher/Application.h b/launcher/Application.h index ec434c6c..78ab8fbd 100644 --- a/launcher/Application.h +++ b/launcher/Application.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-only /* - * Prism Launcher + * Prism Launcher - Minecraft Launcher * Copyright (C) 2022 Sefa Eyeoglu * Copyright (C) 2022 Tayou * diff --git a/launcher/ui/pages/global/LauncherPage.cpp b/launcher/ui/pages/global/LauncherPage.cpp index a1cbbc33..7c7aaf4e 100644 --- a/launcher/ui/pages/global/LauncherPage.cpp +++ b/launcher/ui/pages/global/LauncherPage.cpp @@ -1,8 +1,9 @@ // SPDX-License-Identifier: GPL-3.0-only /* - * PolyMC - Minecraft Launcher + * Prism Launcher - Minecraft Launcher * Copyright (c) 2022 Jamie Mansfield * Copyright (c) 2022 dada513 + * Copyright (C) 2022 Tayou * * 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 diff --git a/launcher/ui/themes/CustomTheme.cpp b/launcher/ui/themes/CustomTheme.cpp index c346d42f..a61bdbaf 100644 --- a/launcher/ui/themes/CustomTheme.cpp +++ b/launcher/ui/themes/CustomTheme.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-only /* - * Prism Launcher + * Prism Launcher - Minecraft Launcher * Copyright (C) 2022 Tayou * * This program is free software: you can redistribute it and/or modify @@ -20,10 +20,6 @@ * * Copyright 2013-2021 MultiMC Contributors * - * Authors: Andrew Okin - * Peterix - * Orochimarufan - * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -56,7 +52,6 @@ static bool readThemeJson(const QString &path, QPalette &palette, double &fadeAm name = Json::requireString(root, "name", "Theme name"); widgets = Json::requireString(root, "widgets", "Qt widget theme"); qssFilePath = Json::ensureString(root, "qssFilePath", "themeStyle.css"); - //auto colorFileList = Json::ensureArray(root, "colorFiles"); auto colorsRoot = Json::requireObject(root, "colors", "colors object"); auto readColor = [&](QString colorName) -> QColor { @@ -165,7 +160,6 @@ static bool writeThemeJson(const QString &path, const QPalette &palette, double } } -/// @brief /// @param baseTheme Base Theme /// @param fileInfo FileInfo object for file to load /// @param isManifest whether to load a theme manifest or a qss file @@ -199,8 +193,6 @@ CustomTheme::CustomTheme(ITheme* baseTheme, QFileInfo& fileInfo, bool isManifest m_fadeAmount = baseTheme->fadeAmount(); m_widgets = baseTheme->qtTheme(); m_qssFilePath = "themeStyle.css"; - - QFileInfo info(themeFilePath); } else { @@ -212,18 +204,18 @@ CustomTheme::CustomTheme(ITheme* baseTheme, QFileInfo& fileInfo, bool isManifest writeThemeJson(fileInfo.absoluteFilePath(), m_palette, m_fadeAmount, m_fadeColor, m_name, m_widgets, m_qssFilePath); } - auto cssFilePath = FS::PathCombine(path, m_qssFilePath); - QFileInfo info (cssFilePath); + auto qssFilePath = FS::PathCombine(path, m_qssFilePath); + QFileInfo info (qssFilePath); if(info.isFile()) { try { // TODO: validate css? - m_styleSheet = QString::fromUtf8(FS::read(cssFilePath)); + m_styleSheet = QString::fromUtf8(FS::read(qssFilePath)); } catch (const Exception &e) { - themeWarningLog() << "Couldn't load css:" << e.cause() << "from" << cssFilePath; + themeWarningLog() << "Couldn't load css:" << e.cause() << "from" << qssFilePath; m_styleSheet = baseTheme->appStyleSheet(); } } @@ -233,11 +225,11 @@ CustomTheme::CustomTheme(ITheme* baseTheme, QFileInfo& fileInfo, bool isManifest m_styleSheet = baseTheme->appStyleSheet(); try { - FS::write(cssFilePath, m_styleSheet.toUtf8()); + FS::write(qssFilePath, m_styleSheet.toUtf8()); } catch (const Exception &e) { - themeWarningLog() << "Couldn't write css:" << e.cause() << "to" << cssFilePath; + themeWarningLog() << "Couldn't write css:" << e.cause() << "to" << qssFilePath; } } } else { diff --git a/launcher/ui/themes/CustomTheme.h b/launcher/ui/themes/CustomTheme.h index 6d1f46b4..e845d23d 100644 --- a/launcher/ui/themes/CustomTheme.h +++ b/launcher/ui/themes/CustomTheme.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-only /* - * Prism Launcher + * Prism Launcher - Minecraft Launcher * Copyright (C) 2022 Tayou * * This program is free software: you can redistribute it and/or modify @@ -20,10 +20,6 @@ * * Copyright 2013-2021 MultiMC Contributors * - * Authors: Andrew Okin - * Peterix - * Orochimarufan - * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/launcher/ui/themes/SystemTheme.cpp b/launcher/ui/themes/SystemTheme.cpp index ec24c6d7..a63d1741 100644 --- a/launcher/ui/themes/SystemTheme.cpp +++ b/launcher/ui/themes/SystemTheme.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-only /* - * Prism Launcher + * Prism Launcher - Minecraft Launcher * Copyright (C) 2022 Tayou * * This program is free software: you can redistribute it and/or modify @@ -20,10 +20,6 @@ * * Copyright 2013-2021 MultiMC Contributors * - * Authors: Andrew Okin - * Peterix - * Orochimarufan - * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/launcher/ui/themes/ThemeManager.cpp b/launcher/ui/themes/ThemeManager.cpp index 3c338fd6..4b7cd46d 100644 --- a/launcher/ui/themes/ThemeManager.cpp +++ b/launcher/ui/themes/ThemeManager.cpp @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-only /* - * Prism Launcher + * Prism Launcher - Minecraft Launcher * Copyright (C) 2022 Tayou * * This program is free software: you can redistribute it and/or modify diff --git a/launcher/ui/themes/ThemeManager.h b/launcher/ui/themes/ThemeManager.h index 871e6fe2..96088d82 100644 --- a/launcher/ui/themes/ThemeManager.h +++ b/launcher/ui/themes/ThemeManager.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-only /* - * Prism Launcher + * Prism Launcher - Minecraft Launcher * Copyright (C) 2022 Tayou * * This program is free software: you can redistribute it and/or modify