* Shop + Plugin is now functionnal, sample Plugin provided to connect to the default...
[circ.git] / Circ.Frontend.GtkSharp / GtkFrontend.cs
blob7fc939956520c71547b3a97458114da2e8481f79
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 Gtk;
12 using Circ.Frontend;
13 using Circ.Controller;
15 namespace Circ.Frontend.GtkSharp
17 [Mono.Addins.Extension("/Circ/Frontends", Id="Gtk")]
18 public class GtkFrontend: IFrontend
20 static IFactory facto = new Factory();
21 MainWindow mainWindow;
22 bool inited = false;
24 public void StartPresentation(IMainControl ctrl)
26 Mono.Unix.Catalog.Init("circ", "/usr/share/locale");
27 Gtk.Application.Init();
28 mainWindow = new MainWindow(ctrl);
29 inited = true;
30 Gtk.Application.Run();
33 public void StopPresentation()
35 Gtk.Application.Invoke(delegate(object sender, EventArgs e) {
36 Gtk.Application.Quit();
37 });
40 public void AddDiscussion(IDiscussionPanel panel)
42 Gtk.Application.Invoke( delegate (object s, EventArgs e) {
43 ChannelPanel temp = (ChannelPanel)panel;
44 temp.ServerPanel.AddChildDiscussion(temp);
45 temp.ServerPanel.CurrentPage = temp.ServerPanel.NPages - 1;
46 });
49 public void AddServer(IServerPanel panel)
51 Gtk.Application.Invoke( delegate {
52 ServerPanel temp = (ServerPanel)panel;
53 Label lbl = new Label(temp.ServerName);
54 mainWindow.ServerContainer.AppendPage(temp, lbl);
55 temp.ShowAll();
56 lbl.Show();
57 });
60 public IFactory ToolkitFactory {
61 get {
62 return facto;
66 public string Name {
67 get {
68 return "Gtk";
72 public bool IsInitialized {
73 get {
74 return inited;