Merge remote-tracking branch 'main_repo/master' into git_is_pepega
This commit is contained in:
@@ -541,6 +541,23 @@ void Split::openInStreamlink()
|
||||
}
|
||||
}
|
||||
|
||||
void Split::openWithCustomScheme()
|
||||
{
|
||||
const auto scheme = getSettings()->customURIScheme.getValue();
|
||||
if (scheme.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
const auto channel = this->getChannel().get();
|
||||
|
||||
if (const auto twitchChannel = dynamic_cast<TwitchChannel *>(channel))
|
||||
{
|
||||
QDesktopServices::openUrl(QString("%1https://twitch.tv/%2")
|
||||
.arg(scheme)
|
||||
.arg(twitchChannel->getName()));
|
||||
}
|
||||
}
|
||||
|
||||
void Split::showViewerList()
|
||||
{
|
||||
auto viewerDock = new QDockWidget("Viewer List", this);
|
||||
|
||||
@@ -129,6 +129,7 @@ public slots:
|
||||
void openInBrowser();
|
||||
void openBrowserPlayer();
|
||||
void openInStreamlink();
|
||||
void openWithCustomScheme();
|
||||
void copyToClipboard();
|
||||
void showSearch();
|
||||
void showViewerList();
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
|
||||
#include "Application.hpp"
|
||||
#include "controllers/accounts/AccountController.hpp"
|
||||
#include "controllers/moderationactions/ModerationActions.hpp"
|
||||
#include "controllers/notifications/NotificationController.hpp"
|
||||
#include "controllers/pings/PingController.hpp"
|
||||
#include "providers/twitch/TwitchChannel.hpp"
|
||||
#include "providers/twitch/TwitchIrcServer.hpp"
|
||||
#include "singletons/Resources.hpp"
|
||||
@@ -96,8 +94,11 @@ namespace {
|
||||
.arg(s.game.toHtmlEscaped())
|
||||
.arg(s.game.isEmpty() ? QString() : "<br>")
|
||||
.arg(s.rerun ? "Vod-casting" : "Live")
|
||||
.arg(s.uptime)
|
||||
.arg(QString::number(s.viewerCount));
|
||||
.arg(getSettings()->hideViewerCountAndDuration ? "<Hidden>"
|
||||
: s.uptime)
|
||||
.arg(getSettings()->hideViewerCountAndDuration
|
||||
? "<Hidden>"
|
||||
: QString::number(s.viewerCount));
|
||||
}
|
||||
auto formatOfflineTooltip(const TwitchChannel::StreamStatus &s)
|
||||
{
|
||||
@@ -189,7 +190,7 @@ void SplitHeader::initializeLayout()
|
||||
switch (button)
|
||||
{
|
||||
case Qt::LeftButton:
|
||||
if (getApp()->moderationActions->items.empty())
|
||||
if (getSettings()->moderationActions.empty())
|
||||
{
|
||||
getApp()->windows->showSettingsDialog(
|
||||
SettingsDialogPreference::
|
||||
@@ -233,9 +234,9 @@ void SplitHeader::initializeLayout()
|
||||
});
|
||||
|
||||
// update moderation button when items changed
|
||||
this->managedConnect(getApp()->moderationActions->items.delayedItemsChanged,
|
||||
this->managedConnect(getSettings()->moderationActions.delayedItemsChanged,
|
||||
[this] {
|
||||
if (getApp()->moderationActions->items.empty())
|
||||
if (getSettings()->moderationActions.empty())
|
||||
{
|
||||
if (this->split_->getModerationMode())
|
||||
this->split_->setModerationMode(true);
|
||||
@@ -247,6 +248,13 @@ void SplitHeader::initializeLayout()
|
||||
}
|
||||
});
|
||||
|
||||
getSettings()->customURIScheme.connect([this] {
|
||||
if (const auto drop = this->dropdownButton_)
|
||||
{
|
||||
drop->setMenu(this->createMainMenu());
|
||||
}
|
||||
});
|
||||
|
||||
layout->setMargin(0);
|
||||
layout->setSpacing(0);
|
||||
this->setLayout(layout);
|
||||
@@ -291,6 +299,12 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
|
||||
#endif
|
||||
menu->addAction(OPEN_IN_STREAMLINK, this->split_,
|
||||
&Split::openInStreamlink);
|
||||
|
||||
if (!getSettings()->customURIScheme.getValue().isEmpty())
|
||||
{
|
||||
menu->addAction("Open with URI Scheme", this->split_,
|
||||
&Split::openWithCustomScheme);
|
||||
}
|
||||
menu->addSeparator();
|
||||
}
|
||||
|
||||
@@ -339,11 +353,11 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
|
||||
action->setCheckable(true);
|
||||
|
||||
QObject::connect(moreMenu, &QMenu::aboutToShow, this, [action, this]() {
|
||||
action->setChecked(getApp()->pings->isMuted(
|
||||
action->setChecked(getSettings()->isMutedChannel(
|
||||
this->split_->getChannel()->getName()));
|
||||
});
|
||||
action->connect(action, &QAction::triggered, this, [this]() {
|
||||
getApp()->pings->toggleMuteChannel(
|
||||
getSettings()->toggleMutedChannel(
|
||||
this->split_->getChannel()->getName());
|
||||
});
|
||||
|
||||
@@ -568,7 +582,7 @@ void SplitHeader::updateChannelText()
|
||||
void SplitHeader::updateModerationModeIcon()
|
||||
{
|
||||
auto moderationMode = this->split_->getModerationMode() &&
|
||||
!getApp()->moderationActions->items.empty();
|
||||
!getSettings()->moderationActions.empty();
|
||||
|
||||
this->moderationButton_->setPixmap(
|
||||
moderationMode ? getResources().buttons.modModeEnabled
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "singletons/Theme.hpp"
|
||||
#include "util/LayoutCreator.hpp"
|
||||
#include "widgets/Notebook.hpp"
|
||||
#include "widgets/Scrollbar.hpp"
|
||||
#include "widgets/dialogs/EmotePopup.hpp"
|
||||
#include "widgets/helper/ChannelView.hpp"
|
||||
#include "widgets/helper/EffectLabel.hpp"
|
||||
@@ -267,14 +268,21 @@ void SplitInput::installKeyPressedEvent()
|
||||
}
|
||||
else if (event->key() == Qt::Key_End)
|
||||
{
|
||||
QTextCursor cursor = this->ui_.textEdit->textCursor();
|
||||
cursor.movePosition(
|
||||
QTextCursor::End,
|
||||
event->modifiers() & Qt::KeyboardModifier::ShiftModifier
|
||||
? QTextCursor::MoveMode::KeepAnchor
|
||||
: QTextCursor::MoveMode::MoveAnchor);
|
||||
this->ui_.textEdit->setTextCursor(cursor);
|
||||
|
||||
if (event->modifiers() == Qt::ControlModifier)
|
||||
{
|
||||
this->split_->getChannelView().getScrollBar().scrollToBottom(
|
||||
getSettings()->enableSmoothScrollingNewMessages.getValue());
|
||||
}
|
||||
else
|
||||
{
|
||||
QTextCursor cursor = this->ui_.textEdit->textCursor();
|
||||
cursor.movePosition(
|
||||
QTextCursor::End,
|
||||
event->modifiers() & Qt::KeyboardModifier::ShiftModifier
|
||||
? QTextCursor::MoveMode::KeepAnchor
|
||||
: QTextCursor::MoveMode::MoveAnchor);
|
||||
this->ui_.textEdit->setTextCursor(cursor);
|
||||
}
|
||||
event->accept();
|
||||
}
|
||||
else if (event->key() == Qt::Key_H &&
|
||||
|
||||
@@ -158,8 +158,6 @@ void SplitOverlay::mouseMoveEvent(QMouseEvent *event)
|
||||
{
|
||||
BaseWidget::mouseMoveEvent(event);
|
||||
|
||||
// qDebug() << QGuiApplication::queryKeyboardModifiers();
|
||||
|
||||
// if ((QGuiApplication::queryKeyboardModifiers() & Qt::AltModifier) ==
|
||||
// Qt::AltModifier) {
|
||||
// this->hide();
|
||||
|
||||
Reference in New Issue
Block a user