UI: Add channels widget to Restream.io integration

This commit is contained in:
SoftArch 2019-07-16 15:14:22 +03:00 committed by jp9000
parent 168ae0af8e
commit 484c57181c
3 changed files with 29 additions and 3 deletions

View file

@ -172,19 +172,40 @@ void RestreamAuth::LoadUI()
browser = cef->create_widget(nullptr, url, panel_cookies);
info->setWidget(browser);
main->addDockWidget(Qt::RightDockWidgetArea, info.data());
main->addDockWidget(Qt::LeftDockWidgetArea, info.data());
infoMenu.reset(main->AddDockWidget(info.data()));
/* ----------------------------------- */
url = "https://restream.io/channel/embed";
channels.reset(new RestreamWidget());
channels->setObjectName("restreamChannel");
channels->resize(410, 600);
channels->setMinimumSize(410, 300);
channels->setWindowTitle(QTStr("RestreamAuth.Channels"));
channels->setAllowedAreas(Qt::AllDockWidgetAreas);
browser = cef->create_widget(nullptr, url, panel_cookies);
channels->setWidget(browser);
main->addDockWidget(Qt::LeftDockWidgetArea, channels.data());
channelMenu.reset(main->AddDockWidget(channels.data()));
/* ----------------------------------- */
chat->setFloating(true);
info->setFloating(true);
chat->move(pos.x() + size.width() - chat->width() - 50, pos.y() + 50);
info->move(pos.x() + 40, pos.y() + 50);
channels->setFloating(true);
chat->move(pos.x() + size.width() - chat->width() - 30, pos.y() + 60);
info->move(pos.x() + 20, pos.y() + 60);
channels->move(pos.x() + 20 + info->width() + 10, pos.y() + 60);
if (firstLoad) {
chat->setVisible(true);
info->setVisible(true);
channels->setVisible(true);
} else {
const char *dockStateStr = config_get_string(
main->Config(), service(), "DockState");

View file

@ -9,8 +9,12 @@ class RestreamAuth : public OAuthStreamKey {
QSharedPointer<RestreamWidget> chat;
QSharedPointer<RestreamWidget> info;
QSharedPointer<RestreamWidget> channels;
QSharedPointer<QAction> chatMenu;
QSharedPointer<QAction> infoMenu;
QSharedPointer<QAction> channelMenu;
bool uiLoaded = false;
virtual bool RetryLogin() override;

View file

@ -115,6 +115,7 @@ TwitchAuth.Stats="Twitch Stats"
TwitchAuth.Feed="Twitch Activity Feed"
TwitchAuth.TwoFactorFail.Title="Could not query stream key"
TwitchAuth.TwoFactorFail.Text="OBS was unable to connect to your Twitch account. Please make sure two-factor authentication is set up in your <a href='https://www.twitch.tv/settings/security'>Twitch security settings</a> as this is required to stream."
RestreamAuth.Channels="Restream Channels"
# copy filters
Copy.Filters="Copy Filters"