|
|
|
@@ -72,14 +72,39 @@ SettingsDialog::SettingsDialog()
|
|
|
|
|
|
|
|
|
|
void SettingsDialog::addTabs()
|
|
|
|
|
{
|
|
|
|
|
this->addTab(this->createAccountsTab(), "Accounts", ":/images/Message_16xLG.png");
|
|
|
|
|
|
|
|
|
|
this->addTab(this->createAppearanceTab(), "Appearance",
|
|
|
|
|
":/images/AppearanceEditorPart_16x.png");
|
|
|
|
|
|
|
|
|
|
this->addTab(this->createBehaviourTab(), "Behaviour", ":/images/AppearanceEditorPart_16x.png");
|
|
|
|
|
|
|
|
|
|
this->addTab(this->createCommandsTab(), "Commands", ":/images/CustomActionEditor_16x.png");
|
|
|
|
|
|
|
|
|
|
this->addTab(this->createEmotesTab(), "Emotes", ":/images/Emoji_Color_1F60A_19.png");
|
|
|
|
|
|
|
|
|
|
this->addTab(this->createIgnoredUsersTab(), "Ignored Users",
|
|
|
|
|
":/images/StatusAnnotations_Blocked_16xLG_color.png");
|
|
|
|
|
|
|
|
|
|
this->addTab(this->createIgnoredMessagesTab(), "Ignored Messages", ":/images/Filter_16x.png");
|
|
|
|
|
|
|
|
|
|
this->addTab(this->createLinksTab(), "Links", ":/images/VSO_Link_blue_16x.png");
|
|
|
|
|
|
|
|
|
|
this->addTab(this->createLogsTab(), "Logs", ":/images/VSO_Link_blue_16x.png");
|
|
|
|
|
|
|
|
|
|
this->addTab(this->createHighlightingTab(), "Highlighting", ":/images/format_Bold_16xLG.png");
|
|
|
|
|
|
|
|
|
|
this->addTab(this->createWhispersTab(), "Whispers", ":/images/Message_16xLG.png");
|
|
|
|
|
|
|
|
|
|
// Add stretch
|
|
|
|
|
this->ui.tabs.addStretch(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QVBoxLayout *SettingsDialog::createAccountsTab()
|
|
|
|
|
{
|
|
|
|
|
auto layout = new QVBoxLayout();
|
|
|
|
|
SettingsManager &settings = SettingsManager::getInstance();
|
|
|
|
|
|
|
|
|
|
QVBoxLayout *vbox;
|
|
|
|
|
|
|
|
|
|
// Accounts
|
|
|
|
|
vbox = new QVBoxLayout();
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
// add remove buttons
|
|
|
|
|
auto buttonBox = new QDialogButtonBox(this);
|
|
|
|
|
|
|
|
|
@@ -99,7 +124,7 @@ void SettingsDialog::addTabs()
|
|
|
|
|
buttonBox->addButton(addButton, QDialogButtonBox::YesRole);
|
|
|
|
|
buttonBox->addButton(removeButton, QDialogButtonBox::NoRole);
|
|
|
|
|
|
|
|
|
|
vbox->addWidget(buttonBox);
|
|
|
|
|
layout->addWidget(buttonBox);
|
|
|
|
|
|
|
|
|
|
// listview
|
|
|
|
|
auto listWidget = new QListWidget(this);
|
|
|
|
@@ -122,19 +147,19 @@ void SettingsDialog::addTabs()
|
|
|
|
|
|
|
|
|
|
QObject::connect(listWidget, &QListWidget::clicked, this, [&, listWidget] {
|
|
|
|
|
if (!listWidget->selectedItems().isEmpty()) {
|
|
|
|
|
AccountManager::getInstance().setCurrentTwitchUser(
|
|
|
|
|
listWidget->currentItem()->text());
|
|
|
|
|
AccountManager::getInstance().setCurrentTwitchUser(listWidget->currentItem()->text());
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
vbox->addWidget(listWidget);
|
|
|
|
|
}
|
|
|
|
|
layout->addWidget(listWidget);
|
|
|
|
|
|
|
|
|
|
// vbox->addStretch(1);
|
|
|
|
|
addTab(vbox, "Accounts", ":/images/Message_16xLG.png");
|
|
|
|
|
return layout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Appearance
|
|
|
|
|
vbox = new QVBoxLayout();
|
|
|
|
|
QVBoxLayout *SettingsDialog::createAppearanceTab()
|
|
|
|
|
{
|
|
|
|
|
SettingsManager &settings = SettingsManager::getInstance();
|
|
|
|
|
auto layout = this->createTabLayout();
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
auto group = new QGroupBox("Application");
|
|
|
|
@@ -257,7 +282,7 @@ void SettingsDialog::addTabs()
|
|
|
|
|
|
|
|
|
|
group->setLayout(form);
|
|
|
|
|
|
|
|
|
|
vbox->addWidget(group);
|
|
|
|
|
layout->addWidget(group);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
@@ -287,27 +312,25 @@ void SettingsDialog::addTabs()
|
|
|
|
|
|
|
|
|
|
group->setLayout(v);
|
|
|
|
|
|
|
|
|
|
vbox->addWidget(group);
|
|
|
|
|
layout->addWidget(group);
|
|
|
|
|
}
|
|
|
|
|
return layout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vbox->addStretch(1);
|
|
|
|
|
QVBoxLayout *SettingsDialog::createBehaviourTab()
|
|
|
|
|
{
|
|
|
|
|
SettingsManager &settings = SettingsManager::getInstance();
|
|
|
|
|
auto layout = this->createTabLayout();
|
|
|
|
|
|
|
|
|
|
addTab(vbox, "Appearance", ":/images/AppearanceEditorPart_16x.png");
|
|
|
|
|
|
|
|
|
|
// Behaviour
|
|
|
|
|
vbox = new QVBoxLayout();
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
auto form = new QFormLayout();
|
|
|
|
|
|
|
|
|
|
form->addRow("Window:", createCheckbox("Window always on top", settings.windowTopMost));
|
|
|
|
|
// form->addRow("Messages:", createCheckbox("Mention users with a @ (except in
|
|
|
|
|
// commands)",
|
|
|
|
|
// settings.mentionUsersWithAt));
|
|
|
|
|
form->addRow("Messages:",
|
|
|
|
|
createCheckbox("Hide input box if empty", settings.hideEmptyInput));
|
|
|
|
|
form->addRow("", createCheckbox("Show last read message indicator",
|
|
|
|
|
settings.showLastMessageIndicator));
|
|
|
|
|
form->addRow("Messages:", createCheckbox("Hide input box if empty", settings.hideEmptyInput));
|
|
|
|
|
form->addRow(
|
|
|
|
|
"", createCheckbox("Show last read message indicator", settings.showLastMessageIndicator));
|
|
|
|
|
|
|
|
|
|
// auto v = new QVBoxLayout();
|
|
|
|
|
// v->addWidget(new QLabel("Mouse scroll speed"));
|
|
|
|
@@ -326,58 +349,67 @@ void SettingsDialog::addTabs()
|
|
|
|
|
// v->addWidget(scroll);
|
|
|
|
|
// v->addStretch(1);
|
|
|
|
|
// vbox->addLayout(v);
|
|
|
|
|
vbox->addLayout(form);
|
|
|
|
|
}
|
|
|
|
|
layout->addLayout(form);
|
|
|
|
|
|
|
|
|
|
vbox->addStretch(1);
|
|
|
|
|
return layout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addTab(vbox, "Behaviour", ":/images/AppearanceEditorPart_16x.png");
|
|
|
|
|
QVBoxLayout *SettingsDialog::createCommandsTab()
|
|
|
|
|
{
|
|
|
|
|
auto layout = this->createTabLayout();
|
|
|
|
|
|
|
|
|
|
// Commands
|
|
|
|
|
vbox = new QVBoxLayout();
|
|
|
|
|
return layout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vbox->addWidget(new QLabel());
|
|
|
|
|
QVBoxLayout *SettingsDialog::createEmotesTab()
|
|
|
|
|
{
|
|
|
|
|
SettingsManager &settings = SettingsManager::getInstance();
|
|
|
|
|
auto layout = this->createTabLayout();
|
|
|
|
|
|
|
|
|
|
vbox->addStretch(1);
|
|
|
|
|
layout->addWidget(createCheckbox("Enable Twitch Emotes", settings.enableTwitchEmotes));
|
|
|
|
|
layout->addWidget(createCheckbox("Enable BetterTTV Emotes", settings.enableBttvEmotes));
|
|
|
|
|
layout->addWidget(createCheckbox("Enable FrankerFaceZ Emotes", settings.enableFfzEmotes));
|
|
|
|
|
layout->addWidget(createCheckbox("Enable Gif Emotes", settings.enableGifs));
|
|
|
|
|
layout->addWidget(createCheckbox("Enable Emojis", settings.enableEmojis));
|
|
|
|
|
|
|
|
|
|
addTab(vbox, "Commands", ":/images/CustomActionEditor_16x.png");
|
|
|
|
|
layout->addWidget(createCheckbox("Enable Twitch Emotes", settings.enableTwitchEmotes));
|
|
|
|
|
|
|
|
|
|
// Emotes
|
|
|
|
|
vbox = new QVBoxLayout();
|
|
|
|
|
return layout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vbox->addWidget(createCheckbox("Enable Twitch Emotes", settings.enableTwitchEmotes));
|
|
|
|
|
vbox->addWidget(createCheckbox("Enable BetterTTV Emotes", settings.enableBttvEmotes));
|
|
|
|
|
vbox->addWidget(createCheckbox("Enable FrankerFaceZ Emotes", settings.enableFfzEmotes));
|
|
|
|
|
vbox->addWidget(createCheckbox("Enable Gif Emotes", settings.enableGifs));
|
|
|
|
|
vbox->addWidget(createCheckbox("Enable Emojis", settings.enableEmojis));
|
|
|
|
|
QVBoxLayout *SettingsDialog::createIgnoredUsersTab()
|
|
|
|
|
{
|
|
|
|
|
auto layout = this->createTabLayout();
|
|
|
|
|
|
|
|
|
|
vbox->addWidget(createCheckbox("Enable Twitch Emotes", settings.enableTwitchEmotes));
|
|
|
|
|
return layout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vbox->addStretch(1);
|
|
|
|
|
addTab(vbox, "Emotes", ":/images/Emoji_Color_1F60A_19.png");
|
|
|
|
|
QVBoxLayout *SettingsDialog::createIgnoredMessagesTab()
|
|
|
|
|
{
|
|
|
|
|
auto layout = this->createTabLayout();
|
|
|
|
|
|
|
|
|
|
// Ignored Users
|
|
|
|
|
vbox = new QVBoxLayout();
|
|
|
|
|
vbox->addStretch(1);
|
|
|
|
|
addTab(vbox, "Ignored Users", ":/images/StatusAnnotations_Blocked_16xLG_color.png");
|
|
|
|
|
return layout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Ignored Messages
|
|
|
|
|
vbox = new QVBoxLayout();
|
|
|
|
|
vbox->addStretch(1);
|
|
|
|
|
addTab(vbox, "Ignored Messages", ":/images/Filter_16x.png");
|
|
|
|
|
QVBoxLayout *SettingsDialog::createLinksTab()
|
|
|
|
|
{
|
|
|
|
|
auto layout = this->createTabLayout();
|
|
|
|
|
|
|
|
|
|
// Links
|
|
|
|
|
vbox = new QVBoxLayout();
|
|
|
|
|
vbox->addStretch(1);
|
|
|
|
|
addTab(vbox, "Links", ":/images/VSO_Link_blue_16x.png");
|
|
|
|
|
return layout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Logging
|
|
|
|
|
vbox = new QVBoxLayout();
|
|
|
|
|
vbox->addStretch(1);
|
|
|
|
|
addTab(vbox, "Logs", ":/images/VSO_Link_blue_16x.png");
|
|
|
|
|
QVBoxLayout *SettingsDialog::createLogsTab()
|
|
|
|
|
{
|
|
|
|
|
auto layout = this->createTabLayout();
|
|
|
|
|
|
|
|
|
|
return layout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QVBoxLayout *SettingsDialog::createHighlightingTab()
|
|
|
|
|
{
|
|
|
|
|
SettingsManager &settings = SettingsManager::getInstance();
|
|
|
|
|
auto layout = this->createTabLayout();
|
|
|
|
|
|
|
|
|
|
// Highlighting
|
|
|
|
|
vbox = new QVBoxLayout();
|
|
|
|
|
auto highlights = new QListWidget();
|
|
|
|
|
auto highlightUserBlacklist = new QTextEdit();
|
|
|
|
|
globalHighlights = highlights;
|
|
|
|
@@ -388,12 +420,12 @@ void SettingsDialog::addTabs()
|
|
|
|
|
auto customSound = new QHBoxLayout();
|
|
|
|
|
auto soundForm = new QFormLayout();
|
|
|
|
|
{
|
|
|
|
|
vbox->addWidget(createCheckbox("Enable Highlighting", settings.enableHighlights));
|
|
|
|
|
vbox->addWidget(createCheckbox("Highlight messages containing your name",
|
|
|
|
|
layout->addWidget(createCheckbox("Enable Highlighting", settings.enableHighlights));
|
|
|
|
|
layout->addWidget(createCheckbox("Highlight messages containing your name",
|
|
|
|
|
settings.enableHighlightsSelf));
|
|
|
|
|
vbox->addWidget(createCheckbox("Play sound when your name is mentioned",
|
|
|
|
|
layout->addWidget(createCheckbox("Play sound when your name is mentioned",
|
|
|
|
|
settings.enableHighlightSound));
|
|
|
|
|
vbox->addWidget(createCheckbox("Flash taskbar when your name is mentioned",
|
|
|
|
|
layout->addWidget(createCheckbox("Flash taskbar when your name is mentioned",
|
|
|
|
|
settings.enableHighlightTaskbar));
|
|
|
|
|
customSound->addWidget(createCheckbox("Custom sound", settings.customHighlightSound));
|
|
|
|
|
auto selectBtn = new QPushButton("Select");
|
|
|
|
@@ -407,7 +439,6 @@ void SettingsDialog::addTabs()
|
|
|
|
|
|
|
|
|
|
soundForm->addRow(customSound);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
auto hbox = new QHBoxLayout();
|
|
|
|
|
auto addBtn = new QPushButton("Add");
|
|
|
|
@@ -483,7 +514,10 @@ void SettingsDialog::addTabs()
|
|
|
|
|
delete highlights->selectedItems().first();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
vbox->addLayout(soundForm);
|
|
|
|
|
layout->addLayout(soundForm);
|
|
|
|
|
layout->addWidget(
|
|
|
|
|
createCheckbox("Always play highlight sound (Even if Chatterino is focused)",
|
|
|
|
|
settings.highlightAlwaysPlaySound));
|
|
|
|
|
auto layoutVbox = new QVBoxLayout();
|
|
|
|
|
auto btnHbox = new QHBoxLayout();
|
|
|
|
|
|
|
|
|
@@ -499,37 +533,37 @@ void SettingsDialog::addTabs()
|
|
|
|
|
layoutVbox->addWidget(btnWidget);
|
|
|
|
|
highlightWidget->setLayout(layoutVbox);
|
|
|
|
|
|
|
|
|
|
highlightTab->addTab(highlightWidget,"Highlights");
|
|
|
|
|
highlightTab->addTab(highlightUserBlacklist,"Disabled Users");
|
|
|
|
|
vbox->addWidget(highlightTab);
|
|
|
|
|
highlightTab->addTab(highlightWidget, "Highlights");
|
|
|
|
|
highlightTab->addTab(highlightUserBlacklist, "Disabled Users");
|
|
|
|
|
layout->addWidget(highlightTab);
|
|
|
|
|
|
|
|
|
|
vbox->addLayout(hbox);
|
|
|
|
|
layout->addLayout(hbox);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QObject::connect(&this->ui.okButton, &QPushButton::clicked, this, [=, &settings](){
|
|
|
|
|
QStringList list = highlightUserBlacklist->toPlainText().split("\n",QString::SkipEmptyParts);
|
|
|
|
|
QObject::connect(&this->ui.okButton, &QPushButton::clicked, this, [=, &settings]() {
|
|
|
|
|
QStringList list =
|
|
|
|
|
highlightUserBlacklist->toPlainText().split("\n", QString::SkipEmptyParts);
|
|
|
|
|
list.removeDuplicates();
|
|
|
|
|
settings.highlightUserBlacklist.set(list.join("\n") + "\n");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
settings.highlightUserBlacklist.valueChanged.connect([=](const QString &str){
|
|
|
|
|
highlightUserBlacklist->setPlainText(str);
|
|
|
|
|
});
|
|
|
|
|
settings.highlightUserBlacklist.valueChanged.connect(
|
|
|
|
|
[=](const QString &str) { highlightUserBlacklist->setPlainText(str); });
|
|
|
|
|
|
|
|
|
|
vbox->addStretch(1);
|
|
|
|
|
addTab(vbox, "Highlighting", ":/images/format_Bold_16xLG.png");
|
|
|
|
|
|
|
|
|
|
// Whispers
|
|
|
|
|
vbox = new QVBoxLayout();
|
|
|
|
|
vbox->addStretch(1);
|
|
|
|
|
addTab(vbox, "Whispers", ":/images/Message_16xLG.png");
|
|
|
|
|
|
|
|
|
|
// Add stretch
|
|
|
|
|
this->ui.tabs.addStretch(1);
|
|
|
|
|
return layout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SettingsDialog::addTab(QLayout *layout, QString title, QString imageRes)
|
|
|
|
|
QVBoxLayout *SettingsDialog::createWhispersTab()
|
|
|
|
|
{
|
|
|
|
|
auto layout = this->createTabLayout();
|
|
|
|
|
|
|
|
|
|
return layout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SettingsDialog::addTab(QBoxLayout *layout, QString title, QString imageRes)
|
|
|
|
|
{
|
|
|
|
|
layout->addStretch(1);
|
|
|
|
|
|
|
|
|
|
auto widget = new QWidget();
|
|
|
|
|
|
|
|
|
|
widget->setLayout(layout);
|
|
|
|
@@ -572,6 +606,13 @@ void SettingsDialog::showDialog()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Widget creation helpers
|
|
|
|
|
QVBoxLayout *SettingsDialog::createTabLayout()
|
|
|
|
|
{
|
|
|
|
|
auto layout = new QVBoxLayout();
|
|
|
|
|
|
|
|
|
|
return layout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QCheckBox *SettingsDialog::createCheckbox(const QString &title, Setting<bool> &setting)
|
|
|
|
|
{
|
|
|
|
|
auto checkbox = new QCheckBox(title);
|
|
|
|
|