summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swift/QtUI/QtHighlightEditor.cpp38
1 files changed, 18 insertions, 20 deletions
diff --git a/Swift/QtUI/QtHighlightEditor.cpp b/Swift/QtUI/QtHighlightEditor.cpp
index e636b57..f933e3f 100644
--- a/Swift/QtUI/QtHighlightEditor.cpp
+++ b/Swift/QtUI/QtHighlightEditor.cpp
@@ -29,26 +29,6 @@ QtHighlightEditor::QtHighlightEditor(QtSettingsProvider* settings, QWidget* pare
{
ui_.setupUi(this);
- //itemModel_ = new QtHighlightRulesItemModel(this);
- //ui_.treeView->setModel(itemModel_);
- //ui_.ruleWidget->setModel(itemModel_);
-//
- //for (int i = 0; i < QtHighlightRulesItemModel::NumberOfColumns; ++i) {
- //switch (i) {
- //case QtHighlightRulesItemModel::ApplyTo:
- //case QtHighlightRulesItemModel::Sender:
- //case QtHighlightRulesItemModel::Keyword:
- //case QtHighlightRulesItemModel::Action:
- //ui_.treeView->showColumn(i);
- //break;
- //default:
- //ui_.treeView->hideColumn(i);
- //break;
- //}
- //}
-//
- //setHighlightManager(NULL); // setup buttons for empty rules list
-//
connect(ui_.listWidget, SIGNAL(currentRowChanged(int)), SLOT(onCurrentRowChanged(int)));
connect(ui_.newButton, SIGNAL(clicked()), SLOT(onNewButtonClicked()));
@@ -68,10 +48,28 @@ QtHighlightEditor::QtHighlightEditor(QtSettingsProvider* settings, QWidget* pare
connect(ui_.defaultSoundRadio, SIGNAL(clicked()), SLOT(soundOtherSelect()));
connect(ui_.customSoundRadio, SIGNAL(clicked()), SLOT(soundCustomSelect()));
+ /* replace the static lineedit control with the roster autocompleter */
ui_.dummySenderName->setVisible(false);
jid_ = new QtSuggestingJIDInput(this, settings);
ui_.senderName->addWidget(jid_);
+ /* we need to be notified if any of the state changes so that we can update our textual rule description */
+ connect(ui_.chatCheck, SIGNAL(clicked()), SLOT(updateRuleDescription()));
+ connect(ui_.roomCheck, SIGNAL(clicked()), SLOT(updateRuleDescription()));
+ connect(ui_.senderCheck, SIGNAL(clicked()), SLOT(updateRuleDescription()));
+ connect(jid_, SIGNAL(textChanged(const QString&)), SLOT(updateRuleDescription()));
+ connect(ui_.keywordCheck, SIGNAL(clicked()), SLOT(updateRuleDescription()));
+ connect(ui_.keyword, SIGNAL(textChanged(const QString&)), SLOT(updateRuleDescription()));
+ connect(ui_.nickIsKeyword, SIGNAL(clicked()), SLOT(updateRuleDescription()));
+ connect(ui_.matchWholeWords, SIGNAL(clicked()), SLOT(updateRuleDescription()));
+ connect(ui_.matchCase, SIGNAL(clicked()), SLOT(updateRuleDescription()));
+ connect(ui_.noColorRadio, SIGNAL(clicked()), SLOT(updateRuleDescription()));
+ connect(ui_.defaultColorRadio, SIGNAL(clicked()), SLOT(updateRuleDescription()));
+ connect(ui_.customColorRadio, SIGNAL(clicked()), SLOT(updateRuleDescription()));
+ connect(ui_.noSoundRadio, SIGNAL(clicked()), SLOT(updateRuleDescription()));
+ connect(ui_.defaultSoundRadio, SIGNAL(clicked()), SLOT(updateRuleDescription()));
+ connect(ui_.customSoundRadio, SIGNAL(clicked()), SLOT(updateRuleDescription()));
+
setWindowTitle(tr("Highlight Rules"));
}