feat: Add Open in custom player to twitch.tv/<channel> link context menus (#6403)
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
## Unversioned
|
## Unversioned
|
||||||
|
|
||||||
|
- Minor: Added `Open in custom player` to `twitch.tv/<channel>` link context menus. (#6403)
|
||||||
- Minor: Added user notes to the user info dialog (when clicking a username). (#6122, #6318)
|
- Minor: Added user notes to the user info dialog (when clicking a username). (#6122, #6318)
|
||||||
- Minor: Added cached emotes fallback when fetching from a provider fails. (#6125, #6229)
|
- Minor: Added cached emotes fallback when fetching from a provider fails. (#6125, #6229)
|
||||||
- Minor: Add an option for the reduced opacity of message history. (#6121)
|
- Minor: Add an option for the reduced opacity of message history. (#6121)
|
||||||
|
|||||||
@@ -2816,6 +2816,14 @@ void ChannelView::addTwitchLinkContextMenuItems(
|
|||||||
this->openChannelIn.invoke(twitchUsername,
|
this->openChannelIn.invoke(twitchUsername,
|
||||||
FromTwitchLinkOpenChannelIn::Streamlink);
|
FromTwitchLinkOpenChannelIn::Streamlink);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!getSettings()->customURIScheme.getValue().isEmpty())
|
||||||
|
{
|
||||||
|
menu->addAction("Open in custom &player", [twitchUsername, this] {
|
||||||
|
this->openChannelIn.invoke(
|
||||||
|
twitchUsername, FromTwitchLinkOpenChannelIn::CustomPlayer);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ enum class FromTwitchLinkOpenChannelIn {
|
|||||||
Tab,
|
Tab,
|
||||||
BrowserPlayer,
|
BrowserPlayer,
|
||||||
Streamlink,
|
Streamlink,
|
||||||
|
CustomPlayer,
|
||||||
};
|
};
|
||||||
|
|
||||||
using SteadyClock = std::chrono::steady_clock;
|
using SteadyClock = std::chrono::steady_clock;
|
||||||
|
|||||||
@@ -151,6 +151,8 @@ Split::Split(QWidget *parent)
|
|||||||
case FromTwitchLinkOpenChannelIn::Streamlink:
|
case FromTwitchLinkOpenChannelIn::Streamlink:
|
||||||
this->openChannelInStreamlink(twitchChannel);
|
this->openChannelInStreamlink(twitchChannel);
|
||||||
break;
|
break;
|
||||||
|
case FromTwitchLinkOpenChannelIn::CustomPlayer:
|
||||||
|
this->openChannelInCustomPlayer(twitchChannel);
|
||||||
default:
|
default:
|
||||||
qCWarning(chatterinoWidget)
|
qCWarning(chatterinoWidget)
|
||||||
<< "Unhandled \"FromTwitchLinkOpenChannelIn\" enum "
|
<< "Unhandled \"FromTwitchLinkOpenChannelIn\" enum "
|
||||||
@@ -804,6 +806,11 @@ void Split::openChannelInStreamlink(const QString channelName)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Split::openChannelInCustomPlayer(const QString channelName)
|
||||||
|
{
|
||||||
|
openInCustomPlayer(channelName);
|
||||||
|
}
|
||||||
|
|
||||||
IndirectChannel Split::getIndirectChannel()
|
IndirectChannel Split::getIndirectChannel()
|
||||||
{
|
{
|
||||||
return this->channel_;
|
return this->channel_;
|
||||||
@@ -1137,10 +1144,9 @@ void Split::openInStreamlink()
|
|||||||
void Split::openWithCustomScheme()
|
void Split::openWithCustomScheme()
|
||||||
{
|
{
|
||||||
auto *const channel = this->getChannel().get();
|
auto *const channel = this->getChannel().get();
|
||||||
|
|
||||||
if (auto *const twitchChannel = dynamic_cast<TwitchChannel *>(channel))
|
if (auto *const twitchChannel = dynamic_cast<TwitchChannel *>(channel))
|
||||||
{
|
{
|
||||||
openInCustomPlayer(twitchChannel->getName());
|
this->openChannelInCustomPlayer(twitchChannel->getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -123,15 +123,19 @@ private:
|
|||||||
void addShortcuts() override;
|
void addShortcuts() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Opens Twitch channel stream in a browser player (opens a formatted link)
|
* @brief Opens a Twitch channel's stream in your default browser's player (opens a formatted link)
|
||||||
*/
|
*/
|
||||||
void openChannelInBrowserPlayer(ChannelPtr channel);
|
void openChannelInBrowserPlayer(ChannelPtr channel);
|
||||||
/**
|
/**
|
||||||
* @brief Opens Twitch channel stream in streamlink app (if stream is live and streamlink is installed)
|
* @brief Opens a Twitch channel's stream in streamlink (if the stream's live, and streamlink's installed)
|
||||||
*/
|
*/
|
||||||
void openChannelInStreamlink(const QString channelName);
|
void openChannelInStreamlink(const QString channelName);
|
||||||
/**
|
/**
|
||||||
* @brief Opens Twitch channel chat in a new Chatterino tab
|
* @brief Opens a Twitch channel's stream in your custom player (if the stream's live, and the custom player protocol's set)
|
||||||
|
*/
|
||||||
|
void openChannelInCustomPlayer(QString channelName);
|
||||||
|
/**
|
||||||
|
* @brief Opens a Twitch channel's chat in a new tab
|
||||||
*/
|
*/
|
||||||
void joinChannelInNewTab(const ChannelPtr &channel);
|
void joinChannelInNewTab(const ChannelPtr &channel);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user