public ChatViewManager(QuasselClient client, ChatView debug) : base() { Client = client; if (debug == null) { throw new ArgumentException("debug"); } Client.BufferSyncer.ActiveChanged += (obj) => { //Application.Refresh(); }; Client.BufferSyncer.Synced += delegate(Buffer[] buffers) { foreach (var buffer in buffers) { Get(buffer.Id); } }; Client.BufferSyncer.Message += (buffer, message) => { Get(buffer.Id).Add(new IrcMessageChatViewEntry(message)); }; DebugChatView = debug; DebugChatView.Add(new CenterChatViewEntry("Debug console")); }
public StatusBarTemplate(QuasselClient client) { Client = client; Client.BufferSyncer.Synced += (obj) => { Invalid = true; }; var timer = new UVTimer(); timer.Tick += () => Invalid = true; timer.Start(TimeSpan.Zero, TimeSpan.FromSeconds(1)); }
public static void Main(string[] args) { string configfile = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "/.config/quassel-irc.org/quasselclient.conf"; var settings = new Settings(configfile); QuasselTypes.Init(); var acc = settings.Accounts[settings.AutoConnectAccount]; var coreConnection = new CoreConnection(acc.HostName, acc.Port, acc.User, acc.Password, false); Application.Init(); var qc = new QuasselClient(coreConnection); ThemeManager = new ThemeManger(); MainWindow = ThemeManager.Default.CreateMainWindow(qc); AsyncWatcher<QVariant> listnotifier = new AsyncWatcher<QVariant>((packet) => qc.Handle(packet)); AsyncWatcher<Exception> excenotifier = new AsyncWatcher<Exception>((exce) => qc.Handle(exce)); var nt = new Thread((obj) => { coreConnection.ReceivePacket += (packet) => { listnotifier.Send(packet); }; coreConnection.Exception += (exception) => { excenotifier.Send(exception); }; coreConnection.Connect(); coreConnection.Loop(); }); nt.Start(); Application.End += (() => { nt.Abort(); }); Application.Run(MainWindow); }
public MainWindowTemplate(QuasselClient client, StatusBarTemplate bar, EntryTemplate entry) { Client = client; StatusBar = bar; Entry = entry; ChatViewManager = new ChatViewManager(client, new ChatView()); SetPrefix("[syncing]"); Entry.Enter += delegate { if (Entry.Text.Length == 0) { return; } string text = Entry.Text.TrimEnd(new char [] { ' ', '\t' }); if (text.StartsWith("/exit")) { Application.Exit = true; } else if (text.StartsWith("/r")) { Client.RequestBacklog(Client.BufferSyncer.Active.BufferInfo.Id); return; } Client.BufferSyncer.Active.Send(text); Entry.AddHistory(text); Entry.Text = ""; Entry.Position = 0; }; Client.BufferSyncer.Synced += (list) => { SetPrefix(Client.BufferSyncer.Active); }; Client.BufferSyncer.ActiveChanged += SetPrefix; this.Add(ChatViewManager, Box.Setting.Fill); this.Add(StatusBar, Box.Setting.Size); this.Add(Entry, Box.Setting.Size); }
public MainWindowTemplate(QuasselClient client) : this(client, new StatusBarTemplate(client) { Height = 1 }, new EntryTemplate() { Height = 1 }) { }
public MainWindowTemplate CreateMainWindow(QuasselClient client) { return new MainWindowTemplate(client); }
public NetworkCollection(QuasselClient client) { Client = client; }
public StatusBar(QuasselClient client) : base(client) { }
public MainWindow(QuasselClient client) : base(client, new StatusBar(client) { Height = 1 }, new EntryTemplate() { Height = 1 }) { }