add /clear command to frontend chat (clears chat window)
authorsheepluva
Wed, 27 Apr 2016 01:06:29 +0200
changeset 11738 90ea2156b809
parent 11737 571d06a86bb6
child 11739 eee922f69d1b
add /clear command to frontend chat (clears chat window)
QTfrontend/ui/widget/chatwidget.cpp
--- a/QTfrontend/ui/widget/chatwidget.cpp	Wed Apr 27 00:14:06 2016 +0200
+++ b/QTfrontend/ui/widget/chatwidget.cpp	Wed Apr 27 01:06:29 2016 +0200
@@ -538,7 +538,9 @@
 
     // add default commands
     QStringList cmds;
-    cmds << "/me" << "/discardStyleSheet" << "/saveStyleSheet";
+    // /saveStyleSheet is(/was?) broken because of Physfs or something
+    // cmds << "/me" << "/discardStyleSheet" << "/saveStyleSheet";
+    cmds << "/me" << "/info" << "/quit" << "/clear" << "/discardStyleSheet";
     chatEditLine->addCommands(cmds);
 
     chatText->clear();
@@ -828,7 +830,10 @@
         QString tline = line.trimmed();
         if (tline.startsWith("/me"))
             return false; // not a real command
-
+        else if (tline == "/clear") {
+            chatStrings.clear();
+            chatText->clear();
+        }
         else if (tline == "/discardStyleSheet")
             discardStyleSheet();
         else if (tline == "/saveStyleSheet")