Project

General

Profile

0003-Make-Highlight-table-select-newly-added-rule.patch

salnx, 06/09/2009 11:13 PM

View differences:

src/qtui/settingspages/highlightsettingspage.cpp
73 73
  widgetHasChanged();
74 74
}
75 75

  
76
void HighlightSettingsPage::addNewRow(QString name, bool regex, bool cs, bool enable, QString chanName) {
76
void HighlightSettingsPage::addNewRow(QString name, bool regex, bool cs, bool enable, QString chanName, bool self) {
77 77
  ui.highlightTable->setRowCount(ui.highlightTable->rowCount()+1);
78 78

  
79 79
  QTableWidgetItem *nameItem = new QTableWidgetItem(name);
......
108 108
  ui.highlightTable->setItem(lastRow, HighlightSettingsPage::EnableColumn, enableItem);
109 109
  ui.highlightTable->setItem(lastRow, HighlightSettingsPage::ChanColumn, chanNameItem);
110 110

  
111
  if(!self)
112
    ui.highlightTable->setCurrentItem(nameItem);
113

  
111 114
  QVariantMap highlightRule;
112 115
  highlightRule["Name"] = name;
113 116
  highlightRule["RegEx"] = regex;
......
199 202
    bool enable = highlightRule["Enable"].toBool();
200 203
    QString chanName = highlightRule["Chan"].toString();
201 204

  
202
    addNewRow(name, regex, cs, enable, chanName);
205
    addNewRow(name, regex, cs, enable, chanName, true);
203 206
  }
204 207

  
205 208
  switch(notificationSettings.highlightNick())
src/qtui/settingspages/highlightsettingspage.h
42 42

  
43 43
  private slots:
44 44
    void widgetHasChanged();
45
    void addNewRow(QString name = tr("highlight rule"), bool regex = false, bool cs = true, bool enable = true, QString chanName = "");
45
    void addNewRow(QString name = tr("highlight rule"), bool regex = false, bool cs = true, bool enable = true, QString chanName = "", bool self = false);
46 46
    void removeSelectedRows();
47 47
    void selectRow(QTableWidgetItem *item);
48 48
    void tableChanged(QTableWidgetItem *item);
49
-