}
}
+
void CoreHighlightSettingsPage::coreConnectionStateChanged(bool state)
{
updateCoreSupportStatus(state);
}
}
+
void CoreHighlightSettingsPage::setupRuleTable(QTableWidget *table) const
{
table->verticalHeader()->hide();
#endif
}
+
void CoreHighlightSettingsPage::updateCoreSupportStatus(bool state)
{
// Assume connected state as enforced by the settings page UI
}
}
+
void CoreHighlightSettingsPage::clientConnected()
{
connect(Client::highlightRuleManager(), SIGNAL(updated()), SLOT(revert()));
}
+
void CoreHighlightSettingsPage::revert()
{
if (!hasChanged())
load();
}
+
bool CoreHighlightSettingsPage::hasDefaults() const
{
return true;
}
+
void CoreHighlightSettingsPage::defaults()
{
int highlightNickType = HighlightRuleManager::HighlightNickType::CurrentNick;
widgetHasChanged();
}
+
void CoreHighlightSettingsPage::addNewHighlightRow(bool enable, int id, const QString &name, bool regex, bool cs,
const QString &sender, const QString &chanName, bool self)
{
highlightList << HighlightRuleManager::HighlightRule(id, name, regex, cs, enable, false, sender, chanName);
}
+
void CoreHighlightSettingsPage::addNewIgnoredRow(bool enable, int id, const QString &name, bool regex, bool cs,
const QString &sender, const QString &chanName, bool self)
{
ignoredList << HighlightRuleManager::HighlightRule(id, name, regex, cs, enable, true, sender, chanName);
}
+
void CoreHighlightSettingsPage::removeSelectedHighlightRows()
{
QList<int> selectedRows;
}
}
+
void CoreHighlightSettingsPage::removeSelectedIgnoredRows()
{
QList<int> selectedRows;
}
}
-void CoreHighlightSettingsPage::highlightNicksChanged(const int index) {
+
+void CoreHighlightSettingsPage::highlightNicksChanged(const int index)
+{
// Only allow toggling "Case sensitive" when a nickname will be highlighted
auto highlightNickType = ui.highlightNicksComboBox->itemData(index).value<int>();
ui.nicksCaseSensitive->setEnabled(highlightNickType != HighlightRuleManager::NoNick);
}
+
void CoreHighlightSettingsPage::selectHighlightRow(QTableWidgetItem *item)
{
int row = item->row();
selected);
}
+
void CoreHighlightSettingsPage::selectIgnoredRow(QTableWidgetItem *item)
{
int row = item->row();
selected);
}
+
void CoreHighlightSettingsPage::emptyHighlightTable()
{
// ui.highlight and highlightList should have the same size, but just to make sure.
highlightList.clear();
}
+
void CoreHighlightSettingsPage::emptyIgnoredTable()
{
// ui.highlight and highlightList should have the same size, but just to make sure.
ignoredList.clear();
}
+
void CoreHighlightSettingsPage::highlightTableChanged(QTableWidgetItem *item)
{
if (item->row() + 1 > highlightList.size())
emit widgetHasChanged();
}
+
void CoreHighlightSettingsPage::ignoredTableChanged(QTableWidgetItem *item)
{
if (item->row() + 1 > ignoredList.size())
emit widgetHasChanged();
}
+
void CoreHighlightSettingsPage::load()
{
emptyHighlightTable();
}
}
+
void CoreHighlightSettingsPage::save()
{
if (!hasChanged())
load();
}
-int CoreHighlightSettingsPage::nextId() {
+
+int CoreHighlightSettingsPage::nextId()
+{
int max = 0;
for (int i = 0; i < highlightList.count(); i++) {
int id = highlightList[i].id;
max = id;
}
}
- return max+1;
+ return max + 1;
}
+
void CoreHighlightSettingsPage::widgetHasChanged()
{
setChangedState(true);
}
+
void CoreHighlightSettingsPage::on_coreUnsupportedDetails_clicked()
{
// Re-use translations of "Local Highlights" as this is a word-for-word reference, forcing all
remoteHighlightsMsgText);
}
-void CoreHighlightSettingsPage::importRules() {
+
+void CoreHighlightSettingsPage::importRules()
+{
NotificationSettings notificationSettings;
const auto localHighlightList = notificationSettings.highlightList();
).arg(QString::number(localHighlightList.count())));
}
-bool CoreHighlightSettingsPage::isSelectable() const {
+
+bool CoreHighlightSettingsPage::isSelectable() const
+{
return Client::isConnected();
// We check for Quassel::Feature::CoreSideHighlights when loading this page, allowing us to show
// a friendly error message.