From 1b98be00f63857c29c5fab2c830ffac30d59b7d0 Mon Sep 17 00:00:00 2001 From: Evan Goode Date: Sun, 23 Jun 2024 23:14:40 -0400 Subject: [PATCH 1/2] Disable updater, users should use package managers --- .github/workflows/build.yml | 2 +- CMakeLists.txt | 2 +- program_info/win_install.nsi.in | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c3714d2ab..03c5b5658 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -454,7 +454,7 @@ jobs: if (Get-Content ./codesign.pfx){ cd ${{ env.INSTALL_DIR }} # We ship the exact same executable for portable and non-portable editions, so signing just once is fine - SignTool sign /fd sha256 /td sha256 /f ../codesign.pfx /p '${{ secrets.WINDOWS_CODESIGN_PASSWORD }}' /tr http://timestamp.digicert.com fjordlauncher.exe fjordlauncher_updater.exe fjordlauncher_filelink.exe + SignTool sign /fd sha256 /td sha256 /f ../codesign.pfx /p '${{ secrets.WINDOWS_CODESIGN_PASSWORD }}' /tr http://timestamp.digicert.com fjordlauncher.exe fjordlauncher_filelink.exe } else { ":warning: Skipped code signing for Windows, as certificate was not present." >> $env:GITHUB_STEP_SUMMARY } diff --git a/CMakeLists.txt b/CMakeLists.txt index 33d281772..cf8e4df08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,7 +189,7 @@ set(Launcher_VERSION_NAME4_COMMA "${Launcher_VERSION_MAJOR},${Launcher_VERSION_M set(Launcher_BUILD_PLATFORM "unknown" CACHE STRING "A short string identifying the platform that this build was built for. Only used to display in the about dialog.") # Github repo URL with releases for updater -set(Launcher_UPDATER_GITHUB_REPO "https://github.com/unmojang/FjordLauncher" CACHE STRING "Base github URL for the updater.") +set(Launcher_UPDATER_GITHUB_REPO "" CACHE STRING "Base github URL for the updater.") # Name to help updater identify valid artifacts set(Launcher_BUILD_ARTIFACT "" CACHE STRING "Artifact name to help the updater identify valid artifacts.") diff --git a/program_info/win_install.nsi.in b/program_info/win_install.nsi.in index eda85821b..8fe916fb9 100644 --- a/program_info/win_install.nsi.in +++ b/program_info/win_install.nsi.in @@ -350,7 +350,6 @@ Section "@Launcher_DisplayName@" File "@Launcher_APP_BINARY_NAME@.exe" File "@Launcher_APP_BINARY_NAME@_filelink.exe" - File "@Launcher_APP_BINARY_NAME@_updater.exe" File "qt.conf" File "qtlogging.ini" File *.dll @@ -436,7 +435,6 @@ Section "Uninstall" Delete $INSTDIR\@Launcher_APP_BINARY_NAME@.exe Delete $INSTDIR\@Launcher_APP_BINARY_NAME@_filelink.exe - Delete $INSTDIR\@Launcher_APP_BINARY_NAME@_updater.exe Delete $INSTDIR\qt.conf Delete $INSTDIR\*.dll From b8f9d18e262b3545414bcbb6f8331d3d1bc70c42 Mon Sep 17 00:00:00 2001 From: Evan Goode Date: Sun, 23 Jun 2024 23:38:38 -0400 Subject: [PATCH 2/2] Remove news toolbar --- CMakeLists.txt | 2 +- launcher/ui/MainWindow.cpp | 63 -------------------------------------- launcher/ui/MainWindow.h | 10 ------ launcher/ui/MainWindow.ui | 27 ---------------- 4 files changed, 1 insertion(+), 101 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf8e4df08..18ca28d11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,7 +173,7 @@ endif() ##################################### Set Application options ##################################### ######## Set URLs ######## -set(Launcher_NEWS_RSS_URL "https://prismlauncher.org/feed/feed.xml" CACHE STRING "URL to fetch Prism Launcher's news RSS feed from.") +set(Launcher_NEWS_RSS_URL "" CACHE STRING "URL to fetch Prism Launcher's news RSS feed from.") set(Launcher_NEWS_OPEN_URL "https://prismlauncher.org/news" CACHE STRING "URL that gets opened when the user clicks 'More News'") set(Launcher_HELP_URL "https://prismlauncher.org/wiki/help-pages/%1" CACHE STRING "URL (with arg %1 to be substituted with page-id) that gets opened when the user requests help") diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp index 5748a788c..6610e197b 100644 --- a/launcher/ui/MainWindow.cpp +++ b/launcher/ui/MainWindow.cpp @@ -86,7 +86,6 @@ #include #include #include -#include #include #include #include "InstanceWindow.h" @@ -100,7 +99,6 @@ #include "ui/dialogs/IconPickerDialog.h" #include "ui/dialogs/ImportResourceDialog.h" #include "ui/dialogs/NewInstanceDialog.h" -#include "ui/dialogs/NewsDialog.h" #include "ui/dialogs/ProgressDialog.h" #include "ui/instanceview/InstanceDelegate.h" #include "ui/instanceview/InstanceProxyModel.h" @@ -184,7 +182,6 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi ui->instanceToolBar->setVisibilityState(instanceToolbarSetting->get().toByteArray()); - ui->instanceToolBar->addContextMenuAction(ui->newsToolBar->toggleViewAction()); ui->instanceToolBar->addContextMenuAction(ui->instanceToolBar->toggleViewAction()); ui->instanceToolBar->addContextMenuAction(ui->actionLockToolbars); } @@ -238,7 +235,6 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi // add the toolbar toggles to the view menu ui->viewMenu->addAction(ui->instanceToolBar->toggleViewAction()); - ui->viewMenu->addAction(ui->newsToolBar->toggleViewAction()); updateThemeMenu(); updateMainToolBar(); @@ -266,21 +262,6 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi connect(secretEventFilter, &KonamiCode::triggered, this, &MainWindow::konamiTriggered); } - // Add the news label to the news toolbar. - { - m_newsChecker.reset(new NewsChecker(APPLICATION->network(), BuildConfig.NEWS_RSS_URL)); - newsLabel = new QToolButton(); - newsLabel->setIcon(APPLICATION->getThemedIcon("news")); - newsLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); - newsLabel->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - newsLabel->setFocusPolicy(Qt::NoFocus); - ui->newsToolBar->insertWidget(ui->actionMoreNews, newsLabel); - - QObject::connect(newsLabel, &QAbstractButton::clicked, this, &MainWindow::newsButtonClicked); - QObject::connect(m_newsChecker.get(), &NewsChecker::newsLoaded, this, &MainWindow::updateNewsLabel); - updateNewsLabel(); - } - // Create the instance list widget { view = new InstanceView(ui->centralWidget); @@ -371,12 +352,6 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent), ui(new Ui::MainWi // TODO: refresh accounts here? // auto accounts = APPLICATION->accounts(); - // load the news - { - m_newsChecker->reloadNews(); - updateNewsLabel(); - } - if (APPLICATION->updaterEnabled()) { bool updatesAllowed = APPLICATION->updatesAreAllowed(); updatesAllowedChanged(updatesAllowed); @@ -459,7 +434,6 @@ void MainWindow::lockToolbars(bool state) { ui->mainToolBar->setMovable(!state); ui->instanceToolBar->setMovable(!state); - ui->newsToolBar->setMovable(!state); APPLICATION->settings()->set("ToolbarsLocked", state); } @@ -473,14 +447,12 @@ void MainWindow::konamiTriggered() ui->mainToolBar->setStyleSheet(""); ui->instanceToolBar->setStyleSheet(""); ui->centralWidget->setStyleSheet(""); - ui->newsToolBar->setStyleSheet(""); ui->statusBar->setStyleSheet(""); qDebug() << "Super Secret Mode DEACTIVATED!"; } else { ui->mainToolBar->setStyleSheet(stylesheet); ui->instanceToolBar->setStyleSheet("background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:0, y2:1," + gradient); ui->centralWidget->setStyleSheet("background-color: qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:1," + gradient); - ui->newsToolBar->setStyleSheet(stylesheet); ui->statusBar->setStyleSheet(stylesheet); qDebug() << "Super Secret Mode ACTIVATED!"; } @@ -759,26 +731,6 @@ bool MainWindow::eventFilter(QObject* obj, QEvent* ev) return QMainWindow::eventFilter(obj, ev); } -void MainWindow::updateNewsLabel() -{ - if (m_newsChecker->isLoadingNews()) { - newsLabel->setText(tr("Loading news...")); - newsLabel->setEnabled(false); - ui->actionMoreNews->setVisible(false); - } else { - QList entries = m_newsChecker->getNewsEntries(); - if (entries.length() > 0) { - newsLabel->setText(entries[0]->title); - newsLabel->setEnabled(true); - ui->actionMoreNews->setVisible(true); - } else { - newsLabel->setText(tr("No news available.")); - newsLabel->setEnabled(false); - ui->actionMoreNews->setVisible(false); - } - } -} - QList stringToIntList(const QString& string) { #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) @@ -1315,21 +1267,6 @@ void MainWindow::on_actionOpenWiki_triggered() DesktopServices::openUrl(QUrl(BuildConfig.HELP_URL.arg(""))); } -void MainWindow::on_actionMoreNews_triggered() -{ - auto entries = m_newsChecker->getNewsEntries(); - NewsDialog news_dialog(entries, this); - news_dialog.exec(); -} - -void MainWindow::newsButtonClicked() -{ - auto entries = m_newsChecker->getNewsEntries(); - NewsDialog news_dialog(entries, this); - news_dialog.toggleArticleList(); - news_dialog.exec(); -} - void MainWindow::onCatChanged(int) { setCatBackground(APPLICATION->settings()->get("TheCat").toBool()); diff --git a/launcher/ui/MainWindow.h b/launcher/ui/MainWindow.h index d2e154643..21c16a74b 100644 --- a/launcher/ui/MainWindow.h +++ b/launcher/ui/MainWindow.h @@ -51,7 +51,6 @@ #include "net/NetJob.h" class LaunchController; -class NewsChecker; class QToolButton; class InstanceProxyModel; class LabeledToolButton; @@ -140,10 +139,6 @@ class MainWindow : public QMainWindow { void on_actionOpenWiki_triggered(); - void on_actionMoreNews_triggered(); - - void newsButtonClicked(); - void on_actionLaunchInstance_triggered(); void on_actionKillInstance_triggered(); @@ -199,8 +194,6 @@ class MainWindow : public QMainWindow { void repopulateAccountsMenu(); - void updateNewsLabel(); - void konamiTriggered(); void globalSettingsClosed(); @@ -233,7 +226,6 @@ class MainWindow : public QMainWindow { // these are managed by Qt's memory management model! InstanceView* view = nullptr; InstanceProxyModel* proxymodel = nullptr; - QToolButton* newsLabel = nullptr; QLabel* m_statusLeft = nullptr; QLabel* m_statusCenter = nullptr; LabeledToolButton* changeIconButton = nullptr; @@ -243,8 +235,6 @@ class MainWindow : public QMainWindow { std::shared_ptr instanceToolbarSetting = nullptr; - unique_qobject_ptr m_newsChecker; - InstancePtr m_selectedInstance; QString m_currentInstIcon; diff --git a/launcher/ui/MainWindow.ui b/launcher/ui/MainWindow.ui index 1ee3a5632..722befb9e 100644 --- a/launcher/ui/MainWindow.ui +++ b/launcher/ui/MainWindow.ui @@ -59,33 +59,6 @@ - - - News Toolbar - - - Qt::BottomToolBarArea|Qt::TopToolBarArea - - - - 16 - 16 - - - - Qt::ToolButtonTextBesideIcon - - - false - - - BottomToolBarArea - - - false - - - Instance Toolbar