summaryrefslogtreecommitdiffstats
path: root/Swift
diff options
context:
space:
mode:
Diffstat (limited to 'Swift')
-rw-r--r--Swift/QtUI/QtHighlightEditor.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/Swift/QtUI/QtHighlightEditor.cpp b/Swift/QtUI/QtHighlightEditor.cpp
index 75756b2..18101d5 100644
--- a/Swift/QtUI/QtHighlightEditor.cpp
+++ b/Swift/QtUI/QtHighlightEditor.cpp
@@ -89,7 +89,22 @@ void QtHighlightEditor::show()
std::string formatNaturalDescription(const HighlightRule& rule)
{
- return "(null)";
+ //This rule will match messages either in chats or in rooms if the sender
+ // is called 'Admin', and the message contains 'Urgent' (not case sensitive)
+ // as a part of any word.
+
+ std::string text = "This rule will match messages ";
+ if (rule.getMatchChat() && rule.getMatchMUC()) {
+ text += "either in chats or in rooms";
+ } else if (rule.getMatchChat()) {
+ text += "in chats only";
+ } else if (rule.getMatchMUC()) {
+ text += "in rooms only";
+ } else {
+ return "This rule has not been marked as a chat or room rule!";
+ }
+
+ return text;
}
void QtHighlightEditor::setHighlightManager(HighlightManager* highlightManager)
@@ -188,7 +203,8 @@ void QtHighlightEditor::onCurrentRowChanged(int currentRow)
void QtHighlightEditor::onApplyButtonClick()
{
- close();
+ ui_.textEdit_2->setText(P2QSTRING(formatNaturalDescription(ruleFromDialog())));
+// close();
}
void QtHighlightEditor::onCancelButtonClick()