mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Fixes #232 opening streams in browser
This commit is contained in:
parent
db41044daf
commit
776a975624
2 changed files with 15 additions and 5 deletions
|
@ -92,7 +92,7 @@ void SplitHeader::addDropdownItems(RippleEffectLabel *label)
|
||||||
this->dropdownMenu.addAction("Change channel", this->split, &Split::doChangeChannel, QKeySequence(tr("Ctrl+R")));
|
this->dropdownMenu.addAction("Change channel", this->split, &Split::doChangeChannel, QKeySequence(tr("Ctrl+R")));
|
||||||
this->dropdownMenu.addAction("Clear chat", this->split, &Split::doClearChat);
|
this->dropdownMenu.addAction("Clear chat", this->split, &Split::doClearChat);
|
||||||
this->dropdownMenu.addAction("Open in web browser", this->split, &Split::doOpenChannel);
|
this->dropdownMenu.addAction("Open in web browser", this->split, &Split::doOpenChannel);
|
||||||
this->dropdownMenu.addAction("Open web popup player", this->split, &Split::doOpenPopupPlayer);
|
this->dropdownMenu.addAction("Open web player", this->split, &Split::doOpenPopupPlayer);
|
||||||
this->dropdownMenu.addAction("Open in Streamlink", this->split, &Split::doOpenStreamlink);
|
this->dropdownMenu.addAction("Open in Streamlink", this->split, &Split::doOpenStreamlink);
|
||||||
this->dropdownMenu.addSeparator();
|
this->dropdownMenu.addSeparator();
|
||||||
this->dropdownMenu.addAction("Reload channel emotes", this, SLOT(menuReloadChannelEmotes()));
|
this->dropdownMenu.addAction("Reload channel emotes", this, SLOT(menuReloadChannelEmotes()));
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "singletons/settingsmanager.hpp"
|
#include "singletons/settingsmanager.hpp"
|
||||||
#include "singletons/thememanager.hpp"
|
#include "singletons/thememanager.hpp"
|
||||||
#include "singletons/windowmanager.hpp"
|
#include "singletons/windowmanager.hpp"
|
||||||
|
#include "twitch/twitchchannel.hpp"
|
||||||
#include "twitch/twitchmessagebuilder.hpp"
|
#include "twitch/twitchmessagebuilder.hpp"
|
||||||
#include "util/urlfetch.hpp"
|
#include "util/urlfetch.hpp"
|
||||||
#include "widgets/helper/searchpopup.hpp"
|
#include "widgets/helper/searchpopup.hpp"
|
||||||
|
@ -15,6 +16,7 @@
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QClipboard>
|
#include <QClipboard>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QDesktopServices>
|
||||||
#include <QDockWidget>
|
#include <QDockWidget>
|
||||||
#include <QDrag>
|
#include <QDrag>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
@ -317,14 +319,22 @@ void Split::doClearChat()
|
||||||
|
|
||||||
void Split::doOpenChannel()
|
void Split::doOpenChannel()
|
||||||
{
|
{
|
||||||
qDebug() << "[UNIMPLEMENTED] Open twitch.tv/"
|
SharedChannel _channel = this->channel;
|
||||||
<< QString::fromStdString(this->channelName.getValue());
|
twitch::TwitchChannel *tc = dynamic_cast<twitch::TwitchChannel *>(_channel.get());
|
||||||
|
|
||||||
|
if (tc != nullptr) {
|
||||||
|
QDesktopServices::openUrl("https://twitch.tv/" + tc->name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Split::doOpenPopupPlayer()
|
void Split::doOpenPopupPlayer()
|
||||||
{
|
{
|
||||||
qDebug() << "[UNIMPLEMENTED] Open twitch.tv/"
|
SharedChannel _channel = this->channel;
|
||||||
<< QString::fromStdString(this->channelName.getValue()) << "/popout";
|
twitch::TwitchChannel *tc = dynamic_cast<twitch::TwitchChannel *>(_channel.get());
|
||||||
|
|
||||||
|
if (tc != nullptr) {
|
||||||
|
QDesktopServices::openUrl("https://player.twitch.tv/?channel=" + tc->name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Split::doOpenStreamlink()
|
void Split::doOpenStreamlink()
|
||||||
|
|
Loading…
Reference in a new issue