* Shop + Plugin is now functionnal, sample Plugin provided to connect to the default...
[circ.git] / Circ.Frontend.GtkSharp / UsersPanel.cs
blob7ff4f1899b7dfb7dad9c72407209b71ae0991b7e
1 #region License
2 /* Circ.Frontend.GtkSharp : GTK# frontend for Circ
3 * Copyright (C) 2007 LAVAL Jérémie
5 * This file is licensed under the terms of the LGPL.
7 * For the complete licence see the file COPYING.
8 */
9 #endregion
10 using System;
11 using System.Collections.Generic;
12 using Gtk;
13 using Circ.Frontend;
15 namespace Circ.Frontend.GtkSharp
17 public class UsersPanel: TreeView
19 List<string> usersList = new List<string>();
20 bool usersChanged = false;
22 public UsersPanel(): base()
24 ListStore list = new ListStore(typeof(string));
25 this.HeadersVisible = false;
26 this.Model = list;
27 this.AppendColumn("Users", new CellRendererText(), "text", 0);
30 public void AddUser(string user)
32 this.usersList.Add(user);
33 Gtk.Application.Invoke( delegate(object s, EventArgs e) {
34 ((ListStore)this.Model).AppendValues(user);
35 });
36 usersChanged = true;
39 public void AddUser(string[] users)
41 Gtk.Application.Invoke( delegate(object ss, EventArgs e) {
42 foreach (string s in users) {
43 this.usersList.Add(s);
44 ((ListStore)this.Model).AppendValues(s);
46 });
47 usersChanged = true;
50 public void RemoveUser(string user)
52 this.usersList.Remove(user);
54 Gtk.Application.Invoke( delegate(object ss, EventArgs e) {
55 ((ListStore)this.Model).Clear();
56 foreach (string s in usersList)
57 ((ListStore)this.Model).AppendValues(s);
58 });
59 usersChanged = true;
62 /*public string FindNickFromIncomplete(string partialNick)
64 if (usersChanged) {
65 BuildTree();
66 usersChanged = false;
69 }*/
71 public string[] Users {
72 get {
73 return usersList.ToArray();