[smuxi: 3/10] Frontend-STFL: Implement /window list.



commit 6e26045415085d842b9fbd93a5de9aa52625372b
Author: Ondřej Hošek <ondra hosek gmail com>
Date:   Fri Aug 21 23:43:41 2015 +0200

    Frontend-STFL: Implement /window list.
    
    On small terminals, e.g. SSH clients on mobile phones, the screen may not
    be wide enough to display more than a few tabs. /window list outputs a list
    of all windows and their numbers (for selection via /window number) into
    the current chat window.

 src/Frontend-STFL/Entry.cs |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/src/Frontend-STFL/Entry.cs b/src/Frontend-STFL/Entry.cs
index 5729b19..5db00f1 100644
--- a/src/Frontend-STFL/Entry.cs
+++ b/src/Frontend-STFL/Entry.cs
@@ -256,7 +256,7 @@ namespace Smuxi.Frontend.Stfl
             chatView.AddMessage(builder.ToMessage());
 
             string[] help = {
-                "window (number|close)",
+                "window (number|list|close)",
                 "exit",
             };
 
@@ -273,6 +273,21 @@ namespace Smuxi.Frontend.Stfl
             if (cmd.Parameter == "close") {
                 f_ChatViewManager.CurrentChat.Close();
                 return;
+            } else if (cmd.Parameter == "list") {
+                var thisChatView = f_MainWindow.ChatViewManager.GetChat(cmd.Chat);
+
+                for (int i = 0;; ++i) {
+                    ChatView availableChatView = f_MainWindow.ChatViewManager.GetChat(i);
+                    if (availableChatView == null) {
+                        break;
+                    }
+
+                    var builder = new MessageBuilder();
+                    builder.AppendEventPrefix();
+                    builder.AppendFormat("{0} - {1}", i + 1, availableChatView.Name ?? "");
+                    thisChatView.AddMessage(builder.ToMessage());
+                }
+                return;
             }
 
             int window;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]