feat: add "Open in custom player" to toast options (#5880)
This commit is contained in:
@@ -10,6 +10,8 @@ inline const QString OPEN_PLAYER_IN_BROWSER =
|
||||
inline const QString OPEN_MOD_VIEW_IN_BROWSER =
|
||||
QStringLiteral("Open mod view in browser");
|
||||
inline const QString OPEN_IN_STREAMLINK = QStringLiteral("Open in streamlink");
|
||||
inline const QString OPEN_IN_CUSTOM_PLAYER =
|
||||
QStringLiteral("Open in custom player");
|
||||
inline const QString DONT_OPEN = QStringLiteral("Don't open");
|
||||
inline const QString OPEN_WHISPERS_IN_BROWSER =
|
||||
QStringLiteral("Open whispers in browser");
|
||||
|
||||
@@ -127,7 +127,8 @@ QComboBox *NotificationPage::createToastReactionComboBox()
|
||||
{
|
||||
QComboBox *toastReactionOptions = new QComboBox();
|
||||
|
||||
for (int i = 0; i <= static_cast<int>(ToastReaction::DontOpen); i++)
|
||||
for (int i = 0; i <= static_cast<int>(ToastReaction::OpenInCustomPlayer);
|
||||
i++)
|
||||
{
|
||||
toastReactionOptions->insertItem(
|
||||
i, Toasts::findStringFromReaction(static_cast<ToastReaction>(i)));
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "singletons/WindowManager.hpp"
|
||||
#include "util/Clipboard.hpp"
|
||||
#include "util/CustomPlayer.hpp"
|
||||
#include "util/Helpers.hpp"
|
||||
#include "util/StreamLink.hpp"
|
||||
#include "widgets/dialogs/QualityPopup.hpp"
|
||||
@@ -1252,19 +1253,11 @@ void Split::openInStreamlink()
|
||||
|
||||
void Split::openWithCustomScheme()
|
||||
{
|
||||
QString scheme = getSettings()->customURIScheme.getValue();
|
||||
if (scheme.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto *const channel = this->getChannel().get();
|
||||
|
||||
if (auto *const twitchChannel = dynamic_cast<TwitchChannel *>(channel))
|
||||
{
|
||||
QDesktopServices::openUrl(QString("%1https://twitch.tv/%2")
|
||||
.arg(scheme)
|
||||
.arg(twitchChannel->getName()));
|
||||
openInCustomPlayer(twitchChannel->getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user