diff --git a/.CI/chatterino-installer.iss b/.CI/chatterino-installer.iss index 2876c429..3c663bf4 100644 --- a/.CI/chatterino-installer.iss +++ b/.CI/chatterino-installer.iss @@ -77,8 +77,8 @@ Source: "{#WORKING_DIR}vc_redist.x64.exe"; DestDir: "{tmp}"; Tasks: vcredist; ; NOTE: Don't use "Flags: ignoreversion" on any shared system files [Icons] -Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" -Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon +Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; AppUserModelID: "ChatterinoTeam.Chatterino" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; AppUserModelID: "ChatterinoTeam.Chatterino"; Tasks: desktopicon [Run] ; VC++ redistributable diff --git a/CHANGELOG.md b/CHANGELOG.md index e19df122..7efc2553 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,7 @@ - Bugfix: Fixed search in emote popup not always working correctly. (#5946) - Bugfix: Fixed channel point redemptions with messages not showing up if PubSub is disconnected. (#5948) - Bugfix: Fixed the input font not immediately updating when zooming in/out. (#5960) +- Bugfix: Fixed missing special shortcut for Windows live notifications. (#5975) - Bugfix: Fixed color input thinking blue is also red. (#5982) - Bugfix: Fixed an issue where commands would sometimes reset if Chatterino was improperly shut down. (#6011) - Bugfix: Fixed a thick border on Windows 11. (#5836) @@ -46,6 +47,7 @@ - Dev: Highlight checks now use non-capturing groups for the boundaries. (#5784) - Dev: Removed unused PubSub whisper code. (#5898) - Dev: Updated Conan dependencies. (#5776) +- Dev: Added the `externally-packaged` mode. (#5975) - Dev: Disable QT keywords (i.e. `emit`, `slots`, and `signals`). (#5882) - Dev: Replaced usage of `parseTime` with `serverReceivedTime` for clearchat messages. (#5824, #5855) - Dev: Support Boost 1.87. (#5832) diff --git a/src/common/Modes.cpp b/src/common/Modes.cpp index 588a304f..a445a77c 100644 --- a/src/common/Modes.cpp +++ b/src/common/Modes.cpp @@ -24,6 +24,10 @@ Modes::Modes() { this->isPortable = true; } + else if (line == "externally-packaged") + { + this->isExternallyPackaged = true; + } } } diff --git a/src/common/Modes.hpp b/src/common/Modes.hpp index 87bef41a..64c79d0c 100644 --- a/src/common/Modes.hpp +++ b/src/common/Modes.hpp @@ -11,6 +11,12 @@ public: bool isNightly{}; bool isPortable{}; + + /// Marked by the line `externally-packaged` + /// + /// The externally packaged mode comes with the following changes: + /// - No shortcuts are created by default + bool isExternallyPackaged{}; }; } // namespace chatterino diff --git a/src/main.cpp b/src/main.cpp index 3f90de45..697eb596 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -24,6 +24,9 @@ #include #include #include +#ifdef Q_OS_WIN +# include +#endif #include @@ -36,6 +39,9 @@ int main(int argc, char **argv) QCoreApplication::setApplicationName("chatterino"); QCoreApplication::setApplicationVersion(CHATTERINO_VERSION); QCoreApplication::setOrganizationDomain("chatterino.com"); +#ifdef Q_OS_WIN + SetCurrentProcessExplicitAppUserModelID(L"ChatterinoTeam.Chatterino"); +#endif std::unique_ptr paths; diff --git a/src/singletons/Settings.hpp b/src/singletons/Settings.hpp index 5f3a23b7..9b7b76d3 100644 --- a/src/singletons/Settings.hpp +++ b/src/singletons/Settings.hpp @@ -3,6 +3,7 @@ #include "common/Channel.hpp" #include "common/ChatterinoSetting.hpp" #include "common/enums/MessageOverflow.hpp" +#include "common/Modes.hpp" #include "common/SignalVector.hpp" #include "controllers/filters/FilterRecord.hpp" #include "controllers/highlights/HighlightBadge.hpp" @@ -553,6 +554,12 @@ public: "/notifications/suppressInitialLive", false}; BoolSetting notificationToast = {"/notifications/enableToast", false}; + BoolSetting createShortcutForToasts = { + "/notifications/createShortcutForToasts", + (Modes::instance().isPortable || Modes::instance().isExternallyPackaged) + ? false + : true, + }; IntSetting openFromToast = {"/notifications/openFromToast", static_cast(ToastReaction::OpenInBrowser)}; diff --git a/src/singletons/Toasts.cpp b/src/singletons/Toasts.cpp index e6c88d9b..4772682e 100644 --- a/src/singletons/Toasts.cpp +++ b/src/singletons/Toasts.cpp @@ -284,11 +284,13 @@ void Toasts::ensureInitialized() this->initialized_ = true; auto *instance = WinToast::instance(); - instance->setAppName(L"Chatterino2"); + instance->setAppName(L"Chatterino"); instance->setAppUserModelId( - WinToast::configureAUMI(L"", L"Chatterino 2", L"", - Version::instance().version().toStdWString())); - instance->setShortcutPolicy(WinToast::SHORTCUT_POLICY_IGNORE); + WinToast::configureAUMI(L"ChatterinoTeam", L"Chatterino", L"", L"")); + if (!getSettings()->createShortcutForToasts) + { + instance->setShortcutPolicy(WinToast::SHORTCUT_POLICY_IGNORE); + } WinToast::WinToastError error{}; instance->initialize(&error); diff --git a/src/widgets/settingspages/NotificationPage.cpp b/src/widgets/settingspages/NotificationPage.cpp index e8e33a85..c49a4959 100644 --- a/src/widgets/settingspages/NotificationPage.cpp +++ b/src/widgets/settingspages/NotificationPage.cpp @@ -49,6 +49,16 @@ NotificationPage::NotificationPage() #if defined(Q_OS_WIN) || defined(CHATTERINO_WITH_LIBNOTIFY) settings.append(this->createCheckBox( "Show notification", getSettings()->notificationToast)); +#endif +#ifdef Q_OS_WIN + settings.append(this->createCheckBox( + "Create start menu shortcut (requires " + "restart)", + getSettings()->createShortcutForToasts, + "When enabled, a shortcut will be created inside your " + "start menu folder if needed by live notifications." + "\n(On portable mode, this is disabled by " + "default)")); auto openIn = settings.emplace().withoutMargin(); { diff --git a/src/widgets/settingspages/SettingsPage.cpp b/src/widgets/settingspages/SettingsPage.cpp index e3cc0c40..e814a6ea 100644 --- a/src/widgets/settingspages/SettingsPage.cpp +++ b/src/widgets/settingspages/SettingsPage.cpp @@ -88,9 +88,11 @@ void SettingsPage::setTab(SettingsDialogTab *tab) } QCheckBox *SettingsPage::createCheckBox( - const QString &text, pajlada::Settings::Setting &setting) + const QString &text, pajlada::Settings::Setting &setting, + const QString &toolTipText) { QCheckBox *checkbox = new SCheckBox(text); + checkbox->setToolTip(toolTipText); // update when setting changes setting.connect( diff --git a/src/widgets/settingspages/SettingsPage.hpp b/src/widgets/settingspages/SettingsPage.hpp index 213836fb..f9bf2082 100644 --- a/src/widgets/settingspages/SettingsPage.hpp +++ b/src/widgets/settingspages/SettingsPage.hpp @@ -57,7 +57,8 @@ public: void setTab(SettingsDialogTab *tab); QCheckBox *createCheckBox(const QString &text, - pajlada::Settings::Setting &setting); + pajlada::Settings::Setting &setting, + const QString &toolTipText = {}); QComboBox *createComboBox(const QStringList &items, pajlada::Settings::Setting &setting); QLineEdit *createLineEdit(pajlada::Settings::Setting &setting);