summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
dd8d82a)
This also slightly improves usability if table contains many rows so user don't have to scroll down manually when adding rule.
Signed-off-by: Bas Pape <baspape@gmail.com>
-void HighlightSettingsPage::addNewRow(QString name, bool regex, bool cs, bool enable, QString chanName) {
+void HighlightSettingsPage::addNewRow(QString name, bool regex, bool cs, bool enable, QString chanName, bool self) {
ui.highlightTable->setRowCount(ui.highlightTable->rowCount()+1);
QTableWidgetItem *nameItem = new QTableWidgetItem(name);
ui.highlightTable->setRowCount(ui.highlightTable->rowCount()+1);
QTableWidgetItem *nameItem = new QTableWidgetItem(name);
ui.highlightTable->setItem(lastRow, HighlightSettingsPage::EnableColumn, enableItem);
ui.highlightTable->setItem(lastRow, HighlightSettingsPage::ChanColumn, chanNameItem);
ui.highlightTable->setItem(lastRow, HighlightSettingsPage::EnableColumn, enableItem);
ui.highlightTable->setItem(lastRow, HighlightSettingsPage::ChanColumn, chanNameItem);
+ if(!self)
+ ui.highlightTable->setCurrentItem(nameItem);
+
QVariantMap highlightRule;
highlightRule["Name"] = name;
highlightRule["RegEx"] = regex;
QVariantMap highlightRule;
highlightRule["Name"] = name;
highlightRule["RegEx"] = regex;
bool enable = highlightRule["Enable"].toBool();
QString chanName = highlightRule["Chan"].toString();
bool enable = highlightRule["Enable"].toBool();
QString chanName = highlightRule["Chan"].toString();
- addNewRow(name, regex, cs, enable, chanName);
+ addNewRow(name, regex, cs, enable, chanName, true);
}
switch(notificationSettings.highlightNick())
}
switch(notificationSettings.highlightNick())
private slots:
void widgetHasChanged();
private slots:
void widgetHasChanged();
- void addNewRow(QString name = tr("highlight rule"), bool regex = false, bool cs = true, bool enable = true, QString chanName = "");
+ void addNewRow(QString name = tr("highlight rule"), bool regex = false, bool cs = true, bool enable = true, QString chanName = "", bool self = false);
void removeSelectedRows();
void selectRow(QTableWidgetItem *item);
void tableChanged(QTableWidgetItem *item);
void removeSelectedRows();
void selectRow(QTableWidgetItem *item);
void tableChanged(QTableWidgetItem *item);