Makes it possible to hide one man spam (#1496)

This commit is contained in:
hemirt
2020-02-02 14:31:37 +01:00
committed by GitHub
parent 497ce2d2f2
commit 1fd64be7f5
9 changed files with 164 additions and 1 deletions
+5
View File
@@ -351,6 +351,11 @@ void Window::addShortcuts()
getApp()->twitch.server->getOrAddChannel(si.channelName));
splitContainer->appendSplit(split);
});
createWindowShortcut(this, "CTRL+H", [this] {
getSettings()->hideSimilar.setValue(!getSettings()->hideSimilar);
getApp()->windows->forceLayoutChannelViews();
});
}
void Window::addMenuBar()
+27
View File
@@ -547,6 +547,33 @@ void GeneralPage::initLayout(SettingsLayout &layout)
QDesktopServices::openUrl(getPaths()->rootAppDataDirectory);
});
layout.addTitle("Similarity");
layout.addDescription(
"Hides or grays out similar messages from the same user");
layout.addCheckbox("Similarity enabled", s.similarityEnabled);
layout.addCheckbox("Gray out similar messages", s.colorSimilarDisabled);
layout.addCheckbox("Hide similar messages (Ctrl + H)", s.hideSimilar);
layout.addCheckbox("Hide or gray out my own similar messages",
s.hideSimilarMyself);
layout.addCheckbox("Shown similar messages trigger highlights",
s.shownSimilarTriggerHighlights);
layout.addDropdown<float>(
"Similarity percentage", {"0.5", "0.75", "0.9"}, s.similarityPercentage,
[](auto val) { return QString::number(val); },
[](auto args) { return fuzzyToFloat(args.value, 0.9f); });
s.hideSimilar.connect(
[]() { getApp()->windows->forceLayoutChannelViews(); }, false);
layout.addDropdown<int>(
"Similar messages max delay in seconds",
{"5", "10", "15", "30", "60", "120"}, s.hideSimilarMaxDelay,
[](auto val) { return QString::number(val); },
[](auto args) { return fuzzyToInt(args.value, 5); });
layout.addDropdown<int>(
"Similar messages max previous messages to check",
{"1", "2", "3", "4", "5"}, s.hideSimilarMaxMessagesToCheck,
[](auto val) { return QString::number(val); },
[](auto args) { return fuzzyToInt(args.value, 3); });
// invisible element for width
auto inv = new BaseWidget(this);
inv->setScaleIndependantWidth(500);
@@ -26,6 +26,10 @@ KeyboardSettingsPage::KeyboardSettingsPage()
form->addRow(new QLabel("Ctrl + Shift + T"), new QLabel("Create new tab"));
form->addRow(new QLabel("Ctrl + Shift + W"),
new QLabel("Close current tab"));
form->addRow(
new QLabel("Ctrl + H"),
new QLabel(
"Hide/Show similar messages (Enable in General under Similarity)"));
form->addItem(new QSpacerItem(16, 16));
form->addRow(new QLabel("Ctrl + 1/2/3/..."),