chore: bump deprecated cutoff to Qt 6.4.3 (#6169)

This commit is contained in:
nerix
2025-04-26 13:36:09 +02:00
committed by GitHub
parent 6fe6843cbd
commit 01e7050ffc
15 changed files with 134 additions and 118 deletions
+1
View File
@@ -30,6 +30,7 @@
- Dev: Fixed `<build-tool> clean` not working correctly with generated sources. (#6154) - Dev: Fixed `<build-tool> clean` not working correctly with generated sources. (#6154)
- Dev: Removed authenticated PubSub implementation. (#6158) - Dev: Removed authenticated PubSub implementation. (#6158)
- Dev: Save settings in `aboutToQuit`. (#6159) - Dev: Save settings in `aboutToQuit`. (#6159)
- Dev: Bumped deprecation cutoff to Qt 6.4.3. (#6169)
- Dev: Simplified string literals to be a re-export of Qt functions. (#6175) - Dev: Simplified string literals to be a re-export of Qt functions. (#6175)
## 2.5.3 ## 2.5.3
+2 -2
View File
@@ -1,8 +1,8 @@
set(LIBRARY_PROJECT "${PROJECT_NAME}-lib") set(LIBRARY_PROJECT "${PROJECT_NAME}-lib")
set(VERSION_PROJECT "${LIBRARY_PROJECT}-version") set(VERSION_PROJECT "${LIBRARY_PROJECT}-version")
set(EXECUTABLE_PROJECT "${PROJECT_NAME}") set(EXECUTABLE_PROJECT "${PROJECT_NAME}")
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050F00) add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x060403)
add_compile_definitions(QT_WARN_DEPRECATED_UP_TO=0x050F00) add_compile_definitions(QT_WARN_DEPRECATED_UP_TO=0x060403)
add_compile_definitions(QT_NO_KEYWORDS) add_compile_definitions(QT_NO_KEYWORDS)
# registers the native messageing host # registers the native messageing host
+5 -4
View File
@@ -594,9 +594,9 @@ void BaseWindow::mousePressEvent(QMouseEvent *event)
#ifndef Q_OS_WIN #ifndef Q_OS_WIN
if (this->flags_.has(FramelessDraggable)) if (this->flags_.has(FramelessDraggable))
{ {
this->movingRelativePos = event->localPos(); this->movingRelativePos = event->position();
if (auto *widget = auto pos = event->position().toPoint();
this->childAt(event->localPos().x(), event->localPos().y())) if (auto *widget = this->childAt(pos.x(), pos.y()))
{ {
std::function<bool(QWidget *)> recursiveCheckMouseTracking; std::function<bool(QWidget *)> recursiveCheckMouseTracking;
recursiveCheckMouseTracking = [&](QWidget *widget) { recursiveCheckMouseTracking = [&](QWidget *widget) {
@@ -646,7 +646,8 @@ void BaseWindow::mouseMoveEvent(QMouseEvent *event)
{ {
if (this->moving) if (this->moving)
{ {
const auto &newPos = event->screenPos() - this->movingRelativePos; auto newPos =
(event->globalPosition() - this->movingRelativePos).toPoint();
this->move(newPos.x(), newPos.y()); this->move(newPos.x(), newPos.y());
} }
} }
+2 -2
View File
@@ -78,7 +78,7 @@ void DraggablePopup::mousePressEvent(QMouseEvent *event)
{ {
this->dragTimer_.start(std::chrono::milliseconds(17)); this->dragTimer_.start(std::chrono::milliseconds(17));
this->startPosDrag_ = event->pos(); this->startPosDrag_ = event->pos();
this->movingRelativePos = event->localPos(); this->movingRelativePos = event->position();
} }
} }
@@ -98,7 +98,7 @@ void DraggablePopup::mouseMoveEvent(QMouseEvent *event)
if (this->isMoving_ || movePos.manhattanLength() > 10.0) if (this->isMoving_ || movePos.manhattanLength() > 10.0)
{ {
this->requestedDragPos_ = this->requestedDragPos_ =
(event->screenPos() - this->movingRelativePos).toPoint(); (event->globalPosition() - this->movingRelativePos).toPoint();
this->isMoving_ = true; this->isMoving_ = true;
} }
} }
+2 -1
View File
@@ -1165,7 +1165,8 @@ void Notebook::mousePressEvent(QMouseEvent *event)
this->menu_ = new QMenu(this); this->menu_ = new QMenu(this);
this->addNotebookActionsToMenu(this->menu_); this->addNotebookActionsToMenu(this->menu_);
} }
this->menu_->popup(event->globalPos() + QPoint(0, 8)); this->menu_->popup(event->globalPosition().toPoint() +
QPoint(0, 8));
} }
break; break;
default:; default:;
+4 -3
View File
@@ -232,7 +232,7 @@ bool OverlayWindow::eventFilter(QObject * /*object*/, QEvent *event)
case QEvent::MouseButtonPress: { case QEvent::MouseButtonPress: {
auto *evt = dynamic_cast<QMouseEvent *>(event); auto *evt = dynamic_cast<QMouseEvent *>(event);
this->moving_ = true; this->moving_ = true;
this->moveOrigin_ = evt->globalPos(); this->moveOrigin_ = evt->globalPosition().toPoint();
return true; return true;
} }
break; break;
@@ -249,9 +249,10 @@ bool OverlayWindow::eventFilter(QObject * /*object*/, QEvent *event)
auto *evt = dynamic_cast<QMouseEvent *>(event); auto *evt = dynamic_cast<QMouseEvent *>(event);
if (this->moving_) if (this->moving_)
{ {
auto newPos = evt->globalPos() - this->moveOrigin_; auto newPos =
(evt->globalPosition() - this->moveOrigin_).toPoint();
this->move(newPos + this->pos()); this->move(newPos + this->pos());
this->moveOrigin_ = evt->globalPos(); this->moveOrigin_ = evt->globalPosition().toPoint();
return true; return true;
} }
if (this->interaction_.isInteracting()) if (this->interaction_.isInteracting())
+5 -6
View File
@@ -197,12 +197,11 @@ void EditHotkeyDialog::afterEdit()
} }
auto firstKeyInt = this->ui_->keyComboEdit->keySequence()[0]; auto firstKeyInt = this->ui_->keyComboEdit->keySequence()[0];
bool hasModifier = ((firstKeyInt & Qt::CTRL) == Qt::CTRL) || bool hasModifier = firstKeyInt.keyboardModifiers().testAnyFlags(
((firstKeyInt & Qt::ALT) == Qt::ALT) || Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier);
((firstKeyInt & Qt::META) == Qt::META); bool isKeyExcempt = firstKeyInt.key() == Qt::Key_Escape ||
bool isKeyExcempt = ((firstKeyInt & Qt::Key_Escape) == Qt::Key_Escape) || firstKeyInt.key() == Qt::Key_Enter ||
((firstKeyInt & Qt::Key_Enter) == Qt::Key_Enter) || firstKeyInt.key() == Qt::Key_Return;
((firstKeyInt & Qt::Key_Return) == Qt::Key_Return);
if (!isKeyExcempt && !hasModifier && !this->shownSingleKeyWarning) if (!isKeyExcempt && !hasModifier && !this->shownSingleKeyWarning)
{ {
+15 -13
View File
@@ -1956,7 +1956,7 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
if (this->isScrolling_) if (this->isScrolling_)
{ {
this->currentMousePosition_ = event->screenPos(); this->currentMousePosition_ = event->globalPosition();
} }
// check for word underneath cursor // check for word underneath cursor
@@ -2114,8 +2114,9 @@ void ChannelView::mouseMoveEvent(QMouseEvent *event)
} }
} }
this->tooltipWidget_->moveTo(event->globalPos() + QPoint(16, 16), this->tooltipWidget_->moveTo(
widgets::BoundsChecking::CursorPosition); event->globalPosition().toPoint() + QPoint(16, 16),
widgets::BoundsChecking::CursorPosition);
this->tooltipWidget_->setWordWrap(isLinkValid); this->tooltipWidget_->setWordWrap(isLinkValid);
this->tooltipWidget_->show(); this->tooltipWidget_->show();
} }
@@ -2170,7 +2171,7 @@ void ChannelView::mousePressEvent(QMouseEvent *event)
this->disableScrolling(); this->disableScrolling();
} }
this->lastLeftPressPosition_ = event->screenPos(); this->lastLeftPressPosition_ = event->globalPosition();
this->isLeftMouseDown_ = true; this->isLeftMouseDown_ = true;
if (layout->flags.has(MessageLayoutFlag::Collapsed)) if (layout->flags.has(MessageLayoutFlag::Collapsed))
@@ -2195,7 +2196,7 @@ void ChannelView::mousePressEvent(QMouseEvent *event)
this->disableScrolling(); this->disableScrolling();
} }
this->lastRightPressPosition_ = event->screenPos(); this->lastRightPressPosition_ = event->globalPosition();
this->isRightMouseDown_ = true; this->isRightMouseDown_ = true;
} }
break; break;
@@ -2224,7 +2225,7 @@ void ChannelView::mousePressEvent(QMouseEvent *event)
} }
else if (this->scrollBar_->isVisible()) else if (this->scrollBar_->isVisible())
{ {
this->enableScrolling(event->screenPos()); this->enableScrolling(event->globalPosition());
} }
} }
} }
@@ -2256,7 +2257,7 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
this->isDoubleClick_ = false; this->isDoubleClick_ = false;
// Was actually not a wanted triple-click // Was actually not a wanted triple-click
if (std::abs(distanceBetweenPoints(this->lastDoubleClickPosition_, if (std::abs(distanceBetweenPoints(this->lastDoubleClickPosition_,
event->screenPos())) > 10.F) event->globalPosition())) > 10.F)
{ {
this->clickTimer_.stop(); this->clickTimer_.stop();
return; return;
@@ -2267,7 +2268,7 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
this->isLeftMouseDown_ = false; this->isLeftMouseDown_ = false;
if (std::abs(distanceBetweenPoints(this->lastLeftPressPosition_, if (std::abs(distanceBetweenPoints(this->lastLeftPressPosition_,
event->screenPos())) > 15.F) event->globalPosition())) > 15.F)
{ {
return; return;
} }
@@ -2275,7 +2276,8 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
// Triple-clicking a message selects the whole message // Triple-clicking a message selects the whole message
if (foundElement && this->clickTimer_.isActive() && if (foundElement && this->clickTimer_.isActive() &&
(std::abs(distanceBetweenPoints(this->lastDoubleClickPosition_, (std::abs(distanceBetweenPoints(this->lastDoubleClickPosition_,
event->screenPos())) < 10.F)) event->globalPosition())) <
10.F))
{ {
this->selectWholeMessage(layout.get(), messageIndex); this->selectWholeMessage(layout.get(), messageIndex);
return; return;
@@ -2293,7 +2295,7 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
this->isRightMouseDown_ = false; this->isRightMouseDown_ = false;
if (std::abs(distanceBetweenPoints(this->lastRightPressPosition_, if (std::abs(distanceBetweenPoints(this->lastRightPressPosition_,
event->screenPos())) > 15.F) event->globalPosition())) > 15.F)
{ {
return; return;
} }
@@ -2307,9 +2309,9 @@ void ChannelView::mouseReleaseEvent(QMouseEvent *event)
{ {
if (this->isScrolling_ && this->scrollBar_->isVisible()) if (this->isScrolling_ && this->scrollBar_->isVisible())
{ {
if (event->screenPos() == this->lastMiddlePressPosition_) if (event->globalPosition() == this->lastMiddlePressPosition_)
{ {
this->enableScrolling(event->screenPos()); this->enableScrolling(event->globalPosition());
} }
else else
{ {
@@ -2807,7 +2809,7 @@ void ChannelView::mouseDoubleClickEvent(QMouseEvent *event)
} }
this->isDoubleClick_ = true; this->isDoubleClick_ = true;
this->lastDoubleClickPosition_ = event->screenPos(); this->lastDoubleClickPosition_ = event->globalPosition();
this->clickTimer_.start(); this->clickTimer_.start();
// message under cursor is collapsed // message under cursor is collapsed
+1 -1
View File
@@ -19,7 +19,7 @@ QWidget *ComboBoxItemDelegate::createEditor(QWidget *parent,
{ {
QVariant data = index.data(Qt::UserRole + 1); QVariant data = index.data(Qt::UserRole + 1);
if (data.type() != QVariant::StringList) if (data.metaType() != QMetaType::fromType<QStringList>())
{ {
return QStyledItemDelegate::createEditor(parent, option, index); return QStyledItemDelegate::createEditor(parent, option, index);
} }
+1 -1
View File
@@ -15,7 +15,7 @@ void IconDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
{ {
auto data = index.data(Qt::DecorationRole); auto data = index.data(Qt::DecorationRole);
if (data.type() != QVariant::Pixmap) if (data.metaType() != QMetaType::fromType<QPixmap>())
{ {
return QStyledItemDelegate::paint(painter, option, index); return QStyledItemDelegate::paint(painter, option, index);
} }
+8 -6
View File
@@ -162,9 +162,10 @@ void NotebookButton::dragEnterEvent(QDragEnterEvent *event)
event->acceptProposedAction(); event->acceptProposedAction();
auto *e = new QMouseEvent(QMouseEvent::MouseButtonPress, auto *e =
QPointF(this->width() / 2, this->height() / 2), new QMouseEvent(QMouseEvent::MouseButtonPress,
Qt::LeftButton, Qt::LeftButton, {}); QPointF(this->width() / 2, this->height() / 2),
QCursor::pos(), Qt::LeftButton, Qt::LeftButton, {});
Button::mousePressEvent(e); Button::mousePressEvent(e);
delete e; delete e;
} }
@@ -174,9 +175,10 @@ void NotebookButton::dragLeaveEvent(QDragLeaveEvent *)
this->mouseDown_ = true; this->mouseDown_ = true;
this->update(); this->update();
auto *e = new QMouseEvent(QMouseEvent::MouseButtonRelease, auto *e =
QPointF(this->width() / 2, this->height() / 2), new QMouseEvent(QMouseEvent::MouseButtonRelease,
Qt::LeftButton, Qt::LeftButton, {}); QPointF(this->width() / 2, this->height() / 2),
QCursor::pos(), Qt::LeftButton, Qt::LeftButton, {});
Button::mouseReleaseEvent(e); Button::mouseReleaseEvent(e);
delete e; delete e;
} }
+11 -11
View File
@@ -116,24 +116,23 @@ NotebookTab::NotebookTab(Notebook *notebook)
// XXX: this doesn't update after changing hotkeys // XXX: this doesn't update after changing hotkeys
this->menu_.addAction( this->menu_.addAction("Close Tab",
"Close Tab", getApp()->getHotkeys()->getDisplaySequence(
[this]() { HotkeyCategory::Window, "removeTab"),
this->notebook_->removePage(this->page); [this]() {
}, this->notebook_->removePage(this->page);
getApp()->getHotkeys()->getDisplaySequence(HotkeyCategory::Window, });
"removeTab"));
this->menu_.addAction( this->menu_.addAction(
"Popup Tab", "Popup Tab",
getApp()->getHotkeys()->getDisplaySequence(HotkeyCategory::Window,
"popup", {{"window"}}),
[this]() { [this]() {
if (auto *container = dynamic_cast<SplitContainer *>(this->page)) if (auto *container = dynamic_cast<SplitContainer *>(this->page))
{ {
container->popup(); container->popup();
} }
}, });
getApp()->getHotkeys()->getDisplaySequence(HotkeyCategory::Window,
"popup", {{"window"}}));
this->menu_.addAction("Duplicate Tab", [this]() { this->menu_.addAction("Duplicate Tab", [this]() {
this->notebook_->duplicatePage(this->page); this->notebook_->duplicatePage(this->page);
@@ -908,7 +907,8 @@ void NotebookTab::mousePressEvent(QMouseEvent *event)
switch (event->button()) switch (event->button())
{ {
case Qt::RightButton: { case Qt::RightButton: {
this->menu_.popup(event->globalPos() + QPoint(0, 8)); this->menu_.popup(event->globalPosition().toPoint() +
QPoint(0, 8));
} }
break; break;
default:; default:;
+6 -6
View File
@@ -138,23 +138,23 @@ void TitleBarButton::ncLeave()
void TitleBarButton::ncMove(QPoint at) void TitleBarButton::ncMove(QPoint at)
{ {
QMouseEvent evt(QMouseEvent::MouseMove, at, Qt::NoButton, Qt::NoButton, QMouseEvent evt(QMouseEvent::MouseMove, at, QCursor::pos(), Qt::NoButton,
Qt::NoModifier); Qt::NoButton, Qt::NoModifier);
this->mouseMoveEvent(&evt); this->mouseMoveEvent(&evt);
} }
void TitleBarButton::ncMousePress(QPoint at) void TitleBarButton::ncMousePress(QPoint at)
{ {
QMouseEvent evt(QMouseEvent::MouseButtonPress, at, Qt::LeftButton, QMouseEvent evt(QMouseEvent::MouseButtonPress, at, QCursor::pos(),
Qt::NoButton, Qt::NoModifier); Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
this->mousePressEvent(&evt); this->mousePressEvent(&evt);
this->update(); this->update();
} }
void TitleBarButton::ncMouseRelease(QPoint at) void TitleBarButton::ncMouseRelease(QPoint at)
{ {
QMouseEvent evt(QMouseEvent::MouseButtonRelease, at, Qt::LeftButton, QMouseEvent evt(QMouseEvent::MouseButtonRelease, at, QCursor::pos(),
Qt::NoButton, Qt::NoModifier); Qt::LeftButton, Qt::NoButton, Qt::NoModifier);
this->mouseReleaseEvent(&evt); this->mouseReleaseEvent(&evt);
this->update(); this->update();
} }
+8 -7
View File
@@ -1551,7 +1551,7 @@ void SplitContainer::DropOverlay::dragMoveEvent(QDragMoveEvent *event)
{ {
event->acceptProposedAction(); event->acceptProposedAction();
this->mouseOverPoint_ = event->pos(); this->mouseOverPoint_ = event->position().toPoint();
this->update(); this->update();
} }
@@ -1673,14 +1673,15 @@ void SplitContainer::ResizeHandle::mouseMoveEvent(QMouseEvent *event)
QPoint bottomRight = this->parent->mapToGlobal( QPoint bottomRight = this->parent->mapToGlobal(
this->node->geometry_.bottomRight().toPoint()); this->node->geometry_.bottomRight().toPoint());
int globalX = topLeft.x() > event->globalX() auto globalPos = event->globalPosition().toPoint();
int globalX = topLeft.x() > globalPos.x()
? topLeft.x() ? topLeft.x()
: (bottomRight.x() < event->globalX() ? bottomRight.x() : (bottomRight.x() < globalPos.x() ? bottomRight.x()
: event->globalX()); : globalPos.x());
int globalY = topLeft.y() > event->globalY() int globalY = topLeft.y() > globalPos.y()
? topLeft.y() ? topLeft.y()
: (bottomRight.y() < event->globalY() ? bottomRight.y() : (bottomRight.y() < globalPos.y() ? bottomRight.y()
: event->globalY()); : globalPos.y());
QPoint mousePoint(globalX, globalY); QPoint mousePoint(globalX, globalY);
+63 -55
View File
@@ -382,26 +382,29 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
const auto &h = getApp()->getHotkeys(); const auto &h = getApp()->getHotkeys();
auto menu = std::make_unique<QMenu>(); auto menu = std::make_unique<QMenu>();
menu->addAction( menu->addAction(
"Change channel", this->split_, &Split::changeChannel, "Change channel",
h->getDisplaySequence(HotkeyCategory::Split, "changeChannel")); h->getDisplaySequence(HotkeyCategory::Split, "changeChannel"),
menu->addAction("Close", this->split_, &Split::deleteFromContainer, this->split_, &Split::changeChannel);
h->getDisplaySequence(HotkeyCategory::Split, "delete")); menu->addAction("Close",
h->getDisplaySequence(HotkeyCategory::Split, "delete"),
this->split_, &Split::deleteFromContainer);
menu->addSeparator(); menu->addSeparator();
menu->addAction( menu->addAction(
"Popup", this->split_, &Split::popup, "Popup",
h->getDisplaySequence(HotkeyCategory::Window, "popup", {{"split"}})); h->getDisplaySequence(HotkeyCategory::Window, "popup", {{"split"}}),
this->split_, &Split::popup);
menu->addAction( menu->addAction(
"Popup overlay", this->split_, &Split::showOverlayWindow, "Popup overlay",
h->getDisplaySequence(HotkeyCategory::Split, "popupOverlay")); h->getDisplaySequence(HotkeyCategory::Split, "popupOverlay"),
menu->addAction( this->split_, &Split::showOverlayWindow);
"Search", this->split_, menu->addAction("Search",
[this] { h->getDisplaySequence(HotkeyCategory::Split, "showSearch"),
this->split_->showSearch(true); this->split_, [this] {
}, this->split_->showSearch(true);
h->getDisplaySequence(HotkeyCategory::Split, "showSearch")); });
menu->addAction( menu->addAction("Set filters",
"Set filters", this->split_, &Split::setFiltersDialog, h->getDisplaySequence(HotkeyCategory::Split, "pickFilters"),
h->getDisplaySequence(HotkeyCategory::Split, "pickFilters")); this->split_, &Split::setFiltersDialog);
menu->addSeparator(); menu->addSeparator();
auto *twitchChannel = auto *twitchChannel =
@@ -410,38 +413,41 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
if (twitchChannel) if (twitchChannel)
{ {
menu->addAction( menu->addAction(
OPEN_IN_BROWSER, this->split_, &Split::openInBrowser, OPEN_IN_BROWSER,
h->getDisplaySequence(HotkeyCategory::Split, "openInBrowser")); h->getDisplaySequence(HotkeyCategory::Split, "openInBrowser"),
menu->addAction(OPEN_PLAYER_IN_BROWSER, this->split_, this->split_, &Split::openInBrowser);
&Split::openBrowserPlayer,
h->getDisplaySequence(HotkeyCategory::Split,
"openPlayerInBrowser"));
menu->addAction( menu->addAction(
OPEN_IN_STREAMLINK, this->split_, &Split::openInStreamlink, OPEN_PLAYER_IN_BROWSER,
h->getDisplaySequence(HotkeyCategory::Split, "openInStreamlink")); h->getDisplaySequence(HotkeyCategory::Split, "openPlayerInBrowser"),
this->split_, &Split::openBrowserPlayer);
menu->addAction(
OPEN_IN_STREAMLINK,
h->getDisplaySequence(HotkeyCategory::Split, "openInStreamlink"),
this->split_, &Split::openInStreamlink);
if (!getSettings()->customURIScheme.getValue().isEmpty()) if (!getSettings()->customURIScheme.getValue().isEmpty())
{ {
menu->addAction("Open in custom player", this->split_, menu->addAction("Open in custom player",
&Split::openWithCustomScheme,
h->getDisplaySequence(HotkeyCategory::Split, h->getDisplaySequence(HotkeyCategory::Split,
"openInCustomPlayer")); "openInCustomPlayer"),
this->split_, &Split::openWithCustomScheme);
} }
if (this->split_->getChannel()->hasModRights()) if (this->split_->getChannel()->hasModRights())
{ {
menu->addAction( menu->addAction(
OPEN_MOD_VIEW_IN_BROWSER, this->split_, OPEN_MOD_VIEW_IN_BROWSER,
&Split::openModViewInBrowser, h->getDisplaySequence(HotkeyCategory::Split, "openModView"),
h->getDisplaySequence(HotkeyCategory::Split, "openModView")); this->split_, &Split::openModViewInBrowser);
} }
menu->addAction( menu->addAction(
"Create a clip", this->split_, "Create a clip",
h->getDisplaySequence(HotkeyCategory::Split, "createClip"),
this->split_,
[twitchChannel] { [twitchChannel] {
twitchChannel->createClip(); twitchChannel->createClip();
}, })
h->getDisplaySequence(HotkeyCategory::Split, "createClip"))
->setVisible(twitchChannel->isLive()); ->setVisible(twitchChannel->isLive());
menu->addSeparator(); menu->addSeparator();
@@ -450,9 +456,9 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
if (this->split_->getChannel()->getType() == Channel::Type::TwitchWhispers) if (this->split_->getChannel()->getType() == Channel::Type::TwitchWhispers)
{ {
menu->addAction( menu->addAction(
OPEN_WHISPERS_IN_BROWSER, this->split_, OPEN_WHISPERS_IN_BROWSER,
&Split::openWhispersInBrowser, h->getDisplaySequence(HotkeyCategory::Split, "openInBrowser"),
h->getDisplaySequence(HotkeyCategory::Split, "openInBrowser")); this->split_, &Split::openWhispersInBrowser);
menu->addSeparator(); menu->addSeparator();
} }
@@ -460,8 +466,9 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
if (this->split_->getChannel()->canReconnect()) if (this->split_->getChannel()->canReconnect())
{ {
menu->addAction( menu->addAction(
"Reconnect", this, SLOT(reconnect()), "Reconnect",
h->getDisplaySequence(HotkeyCategory::Split, "reconnect")); h->getDisplaySequence(HotkeyCategory::Split, "reconnect"), this,
&SplitHeader::reconnect);
} }
if (twitchChannel) if (twitchChannel)
@@ -472,12 +479,12 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
"reloadEmotes", {{"channel"}}); "reloadEmotes", {{"channel"}});
auto subSeq = h->getDisplaySequence(HotkeyCategory::Split, auto subSeq = h->getDisplaySequence(HotkeyCategory::Split,
"reloadEmotes", {{"subscriber"}}); "reloadEmotes", {{"subscriber"}});
menu->addAction("Reload channel emotes", this, menu->addAction("Reload channel emotes",
SLOT(reloadChannelEmotes()), channelSeq.isEmpty() ? bothSeq : channelSeq, this,
channelSeq.isEmpty() ? bothSeq : channelSeq); &SplitHeader::reloadChannelEmotes);
menu->addAction("Reload subscriber emotes", this, menu->addAction("Reload subscriber emotes",
SLOT(reloadSubscriberEmotes()), subSeq.isEmpty() ? bothSeq : subSeq, this,
subSeq.isEmpty() ? bothSeq : subSeq); &SplitHeader::reloadSubscriberEmotes);
} }
menu->addSeparator(); menu->addSeparator();
@@ -505,11 +512,9 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
// this makes a full std::optional<> with an empty vector inside // this makes a full std::optional<> with an empty vector inside
} }
moreMenu->addAction( moreMenu->addAction(
"Toggle moderation mode", this->split_, "Toggle moderation mode", modModeSeq, this->split_, [this]() {
[this]() {
this->split_->setModerationMode(!this->split_->getModerationMode()); this->split_->setModerationMode(!this->split_->getModerationMode());
}, });
modModeSeq);
if (this->split_->getChannel()->getType() == Channel::Type::TwitchMentions) if (this->split_->getChannel()->getType() == Channel::Type::TwitchMentions)
{ {
@@ -533,13 +538,15 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
if (twitchChannel->hasModRights()) if (twitchChannel->hasModRights())
{ {
moreMenu->addAction( moreMenu->addAction(
"Show chatter list", this->split_, &Split::showChatterList, "Show chatter list",
h->getDisplaySequence(HotkeyCategory::Split, "openViewerList")); h->getDisplaySequence(HotkeyCategory::Split, "openViewerList"),
this->split_, &Split::showChatterList);
} }
moreMenu->addAction("Subscribe", this->split_, &Split::openSubPage, moreMenu->addAction("Subscribe",
h->getDisplaySequence(HotkeyCategory::Split, h->getDisplaySequence(HotkeyCategory::Split,
"openSubscriptionPage")); "openSubscriptionPage"),
this->split_, &Split::openSubPage);
{ {
auto *action = new QAction(this); auto *action = new QAction(this);
@@ -603,8 +610,9 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
moreMenu->addSeparator(); moreMenu->addSeparator();
moreMenu->addAction( moreMenu->addAction(
"Clear messages", this->split_, &Split::clear, "Clear messages",
h->getDisplaySequence(HotkeyCategory::Split, "clearMessages")); h->getDisplaySequence(HotkeyCategory::Split, "clearMessages"),
this->split_, &Split::clear);
// moreMenu->addSeparator(); // moreMenu->addSeparator();
// moreMenu->addAction("Show changelog", this, // moreMenu->addAction("Show changelog", this,
// SLOT(moreMenuShowChangelog())); // SLOT(moreMenuShowChangelog()));