feat: add "Open in custom player" to toast options (#5880)

This commit is contained in:
nerix
2025-03-05 16:29:28 +01:00
committed by GitHub
parent 54793f1496
commit 72369b1611
9 changed files with 67 additions and 11 deletions
+28
View File
@@ -0,0 +1,28 @@
#include "util/CustomPlayer.hpp"
#include "common/QLogging.hpp"
#include "singletons/Settings.hpp"
#include <QDesktopServices>
#include <QStringBuilder>
#include <QStringView>
#include <QUrl>
namespace chatterino {
void openInCustomPlayer(QStringView channelName)
{
QString scheme = getSettings()->customURIScheme.getValue();
if (scheme.isEmpty())
{
qCWarning(chatterinoApp)
<< "Can't open" << channelName
<< "in custom player because no URI scheme is set";
return;
}
QDesktopServices::openUrl(
QUrl{scheme % u"https://twitch.tv/" % channelName});
}
} // namespace chatterino