Open settings when clicking moderation button and no moderation actions are found
This commit is contained in:
@@ -84,6 +84,7 @@ ModerationPage::ModerationPage()
|
||||
LayoutCreator<ModerationPage> layoutCreator(this);
|
||||
|
||||
auto tabs = layoutCreator.emplace<QTabWidget>();
|
||||
this->tabWidget_ = tabs.getElement();
|
||||
|
||||
auto logs = tabs.appendTab(new QVBoxLayout, "Logs");
|
||||
{
|
||||
@@ -109,7 +110,7 @@ ModerationPage::ModerationPage()
|
||||
}
|
||||
|
||||
QString pathShortened =
|
||||
"Logs saved at <a href=\"file:///" + pathOriginal +
|
||||
"Logs are saved at <a href=\"file:///" + pathOriginal +
|
||||
"\"><span style=\"color: white;\">" +
|
||||
shortenString(pathOriginal, 50) + "</span></a>";
|
||||
|
||||
@@ -158,7 +159,9 @@ ModerationPage::ModerationPage()
|
||||
auto modMode = tabs.appendTab(new QVBoxLayout, "Moderation buttons");
|
||||
{
|
||||
// clang-format off
|
||||
auto label = modMode.emplace<QLabel>("Click the moderation mod button (<img width='18' height='18' src=':/buttons/modModeDisabled.png'>) in a channel that you moderate to enable moderator mode.<br>");
|
||||
auto label = modMode.emplace<QLabel>(
|
||||
"Moderation mode is enabled by clicking <img width='18' height='18' src=':/buttons/modModeDisabled.png'> in a channel that you moderate.<br><br>"
|
||||
"Moderation buttons can be bound to chat commands such as \"/ban {user}\", \"/timeout {user} 1000\" or any other custom text commands.<br>");
|
||||
label->setWordWrap(true);
|
||||
label->setStyleSheet("color: #bbb");
|
||||
// clang-format on
|
||||
@@ -207,4 +210,9 @@ ModerationPage::ModerationPage()
|
||||
this->itemsChangedTimer_.setSingleShot(true);
|
||||
}
|
||||
|
||||
void ModerationPage::selectModerationActions()
|
||||
{
|
||||
this->tabWidget_->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "widgets/settingspages/SettingsPage.hpp"
|
||||
|
||||
class QTabWidget;
|
||||
class QPushButton;
|
||||
|
||||
namespace chatterino {
|
||||
@@ -13,8 +14,11 @@ class ModerationPage : public SettingsPage
|
||||
public:
|
||||
ModerationPage();
|
||||
|
||||
void selectModerationActions();
|
||||
|
||||
private:
|
||||
QTimer itemsChangedTimer_;
|
||||
QTabWidget *tabWidget_{};
|
||||
};
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
@@ -21,6 +21,16 @@ const QString &SettingsPage::getIconResource()
|
||||
return this->iconResource_;
|
||||
}
|
||||
|
||||
SettingsDialogTab *SettingsPage::tab() const
|
||||
{
|
||||
return this->tab_;
|
||||
}
|
||||
|
||||
void SettingsPage::setTab(SettingsDialogTab *tab)
|
||||
{
|
||||
this->tab_ = tab;
|
||||
}
|
||||
|
||||
void SettingsPage::cancel()
|
||||
{
|
||||
this->onCancel_.invoke();
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
class SettingsDialogTab;
|
||||
|
||||
class SettingsPage : public QWidget
|
||||
{
|
||||
public:
|
||||
@@ -18,6 +20,9 @@ public:
|
||||
const QString &getName();
|
||||
const QString &getIconResource();
|
||||
|
||||
SettingsDialogTab *tab() const;
|
||||
void setTab(SettingsDialogTab *tab);
|
||||
|
||||
void cancel();
|
||||
|
||||
QCheckBox *createCheckBox(const QString &text,
|
||||
@@ -36,6 +41,8 @@ protected:
|
||||
QString name_;
|
||||
QString iconResource_;
|
||||
|
||||
SettingsDialogTab *tab_;
|
||||
|
||||
pajlada::Signals::NoArgSignal onCancel_;
|
||||
std::vector<pajlada::Signals::ScopedConnection> managedConnections_;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user