renamed IgnoreUsersPage to IgnoresPage

This commit is contained in:
fourtf 2018-07-05 16:22:25 +02:00
parent d925704aa9
commit 1da23e5e91
5 changed files with 40 additions and 40 deletions

View file

@ -199,7 +199,6 @@ SOURCES += \
src/widgets/settingspages/EmotesPage.cpp \
src/widgets/settingspages/ExternalToolsPage.cpp \
src/widgets/settingspages/HighlightingPage.cpp \
src/widgets/settingspages/IgnoreusersPage.cpp \
src/widgets/settingspages/KeyboardSettingsPage.cpp \
src/widgets/settingspages/LogsPage.cpp \
src/widgets/settingspages/ModerationPage.cpp \
@ -228,7 +227,8 @@ SOURCES += \
src/widgets/settingspages/LookPage.cpp \
src/widgets/settingspages/FeelPage.cpp \
src/util/InitUpdateButton.cpp \
src/widgets/dialogs/UpdateDialog.cpp
src/widgets/dialogs/UpdateDialog.cpp \
src/widgets/settingspages/IgnoresPage.cpp
HEADERS += \
src/Application.hpp \
@ -370,7 +370,6 @@ HEADERS += \
src/widgets/settingspages/EmotesPage.hpp \
src/widgets/settingspages/ExternalToolsPage.hpp \
src/widgets/settingspages/HighlightingPage.hpp \
src/widgets/settingspages/IgnoreusersPage.hpp \
src/widgets/settingspages/KeyboardSettingsPage.hpp \
src/widgets/settingspages/LogsPage.hpp \
src/widgets/settingspages/ModerationPage.hpp \
@ -404,7 +403,8 @@ HEADERS += \
src/widgets/settingspages/LookPage.hpp \
src/widgets/settingspages/FeelPage.hpp \
src/util/InitUpdateButton.hpp \
src/widgets/dialogs/UpdateDialog.hpp
src/widgets/dialogs/UpdateDialog.hpp \
src/widgets/settingspages/IgnorePage.hpp
RESOURCES += \
resources/resources.qrc \

View file

@ -11,7 +11,7 @@
#include "widgets/settingspages/ExternalToolsPage.hpp"
#include "widgets/settingspages/FeelPage.hpp"
#include "widgets/settingspages/HighlightingPage.hpp"
#include "widgets/settingspages/IgnoreusersPage.hpp"
#include "widgets/settingspages/IgnorePage.hpp"
#include "widgets/settingspages/KeyboardSettingsPage.hpp"
#include "widgets/settingspages/LogsPage.hpp"
#include "widgets/settingspages/LookPage.hpp"
@ -90,7 +90,7 @@ void SettingsDialog::addTabs()
this->addTab(new CommandPage);
// this->addTab(new EmotesPage);
this->addTab(new HighlightingPage);
this->addTab(new IgnoreUsersPage);
this->addTab(new IgnoresPage);
this->ui_.tabContainer->addSpacing(16);

View file

@ -43,13 +43,13 @@ HighlightingPage::HighlightingPage()
auto tabs = layout.emplace<QTabWidget>();
{
// HIGHLIGHTS
auto highlights = tabs.appendTab(new QVBoxLayout, "Highlights");
auto highlights = tabs.appendTab(new QVBoxLayout, "Phrases");
{
EditableModelView *view =
highlights.emplace<EditableModelView>(app->highlights->createModel(nullptr))
.getElement();
view->setTitles({"Pattern", "Flash taskbar", "Play sound", "Regex"});
view->setTitles({"Pattern", "Flash\ntaskbar", "Play\nsound", "Enable\nregex"});
view->getTableView()->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
view->getTableView()->horizontalHeader()->setSectionResizeMode(
0, QHeaderView::Stretch);
@ -66,37 +66,13 @@ HighlightingPage::HighlightingPage()
});
}
auto disabledUsers = tabs.appendTab(new QVBoxLayout, "Disabled Users");
{
EditableModelView *view =
disabledUsers
.emplace<EditableModelView>(app->highlights->createBlacklistModel(nullptr))
.getElement();
view->setTitles({"Pattern", "Regex"});
view->getTableView()->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
view->getTableView()->horizontalHeader()->setSectionResizeMode(
0, QHeaderView::Stretch);
// fourtf: make class extrend BaseWidget and add this to dpiChanged
QTimer::singleShot(1, [view] {
view->getTableView()->resizeColumnsToContents();
view->getTableView()->setColumnWidth(0, 200);
});
view->addButtonPressed.connect([] {
getApp()->highlights->blacklistedUsers.appendItem(
HighlightBlacklistUser{"blacklisted user", false});
});
}
auto pingUsers = tabs.appendTab(new QVBoxLayout, "Highlight on message");
auto pingUsers = tabs.appendTab(new QVBoxLayout, "Users");
{
EditableModelView *view =
pingUsers.emplace<EditableModelView>(app->highlights->createUserModel(nullptr))
.getElement();
view->setTitles({"Username", "Flash taskbar", "Play sound", "Regex"});
view->setTitles({"Username", "Flash\ntaskbar", "Play\nsound", "Enable\nregex"});
view->getTableView()->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
view->getTableView()->horizontalHeader()->setSectionResizeMode(
0, QHeaderView::Stretch);
@ -112,6 +88,30 @@ HighlightingPage::HighlightingPage()
HighlightPhrase{"highlighted user", true, false, false});
});
}
auto disabledUsers = tabs.appendTab(new QVBoxLayout, "Excluded Users");
{
EditableModelView *view =
disabledUsers
.emplace<EditableModelView>(app->highlights->createBlacklistModel(nullptr))
.getElement();
view->setTitles({"Pattern", "Enable\nregex"});
view->getTableView()->horizontalHeader()->setSectionResizeMode(QHeaderView::Fixed);
view->getTableView()->horizontalHeader()->setSectionResizeMode(
0, QHeaderView::Stretch);
// fourtf: make class extrend BaseWidget and add this to dpiChanged
QTimer::singleShot(1, [view] {
view->getTableView()->resizeColumnsToContents();
view->getTableView()->setColumnWidth(0, 200);
});
view->addButtonPressed.connect([] {
getApp()->highlights->blacklistedUsers.appendItem(
HighlightBlacklistUser{"blacklisted user", false});
});
}
}
// MISC

View file

@ -6,10 +6,10 @@
namespace chatterino {
class IgnoreUsersPage : public SettingsPage
class IgnoresPage : public SettingsPage
{
public:
IgnoreUsersPage();
IgnoresPage();
void onShow() final;

View file

@ -1,4 +1,4 @@
#include "IgnoreusersPage.hpp"
#include "IgnorePage.hpp"
#include "Application.hpp"
#include "controllers/accounts/AccountController.hpp"
@ -23,12 +23,12 @@
namespace chatterino {
IgnoreUsersPage::IgnoreUsersPage()
IgnoresPage::IgnoresPage()
: SettingsPage("Ignores", "")
{
auto app = getApp();
LayoutCreator<IgnoreUsersPage> layoutCreator(this);
LayoutCreator<IgnoresPage> layoutCreator(this);
auto layout = layoutCreator.setLayoutType<QVBoxLayout>();
// auto group = layout.emplace<QGroupBox>("Ignored users").setLayoutType<QVBoxLayout>();
@ -85,7 +85,7 @@ IgnoreUsersPage::IgnoreUsersPage()
label->setStyleSheet("color: #BBB");
}
void IgnoreUsersPage::onShow()
void IgnoresPage::onShow()
{
auto app = getApp();