Пример #1
0
        public ServerListView(Gtk.Window parent, Glade.XML gladeXml)
        {
            Trace.Call(parent, gladeXml);

            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }

            _Parent     = parent;
            _Controller = new ServerListController(Frontend.UserConfig);

            gladeXml.BindFields(this);

            _AddButton.Clicked    += new EventHandler(OnAddButtonClicked);
            _EditButton.Clicked   += new EventHandler(OnEditButtonClicked);
            _RemoveButton.Clicked += new EventHandler(OnRemoveButtonClicked);

            _TreeView.AppendColumn(_("Protocol"), new Gtk.CellRendererText(), "text", 1);
            _TreeView.AppendColumn(_("Hostname"), new Gtk.CellRendererText(), "text", 2);

            _TreeStore = new Gtk.TreeStore(typeof(ServerModel),
                                           typeof(string), // protocol
                                           typeof(string)  // hostname
                                           );
            _TreeView.RowActivated      += OnTreeViewRowActivated;
            _TreeView.Selection.Changed += OnTreeViewSelectionChanged;
            _TreeView.Model              = _TreeStore;
        }
Пример #2
0
        public SettingsScreen()
        {
            try
            {
                m_xXML = new Glade.XML(null, MediaNET.GladeCommonFilename, "SettingsScreenWindow", null);
                m_xXML.BindFields(this);
                m_xXML.Autoconnect(this);

                /** Init handlers **/
                pluginStore               = new TreeStore(typeof(string), typeof(string), typeof(string), typeof(string));
                pluginList.Model          = pluginStore;
                pluginList.HeadersVisible = true;
                pluginList.AppendColumn(new TreeViewColumn("Type", new CellRendererText(), "text", 0));
                pluginList.AppendColumn(new TreeViewColumn("Identifier", new CellRendererText(), "text", 1));
                pluginList.AppendColumn(new TreeViewColumn("Player", new CellRendererText(), "text", 2));

                // Hidden column
                TreeViewColumn col          = new TreeViewColumn();
                CellRenderer   NameRenderer = new CellRendererText();
                col.Title   = "Path";
                col.Visible = false;
                col.PackStart(NameRenderer, true);
                col.AddAttribute(NameRenderer, "text", 3);
                pluginList.AppendColumn(col);

                PopulatePluginList();
                pluginList.Show();

                /** Bindings from the UI **/
                ((Gtk.Entry)m_xXML["pathEntry"]).Changed         += new EventHandler(OnChanged);
                ((Gtk.Entry)m_xXML["pathDbLocation"]).Changed    += new EventHandler(OnChanged);
                ((Gtk.Entry)m_xXML["pluginFile"]).Changed        += new EventHandler(OnChanged);
                ((Gtk.Entry)m_xXML["announcerSentence"]).Changed += new EventHandler(OnChanged);
                pluginList.RowActivated += new RowActivatedHandler(OnPluginSelectedChanged);
                buffer = pluginInfo.Buffer;

                /** Populate GUI **/
                string   list  = (string)MediaNET.Config["Interface/currentLang"];
                Menu     m     = new Menu();
                MenuItem miOne = new MenuItem(list);
                m.Append(miOne);
                langBox.Menu = m;
                LoadSettings();
            }
            catch (Exception e)
            {
                throw new Exception("SettingsScreen raised an error: " + e.Message);
            }
        }
Пример #3
0
    public CrashScreen(string err)
    {
        Glade.XML  glade = new Glade.XML(null, MediaNET.MediaNET.GladeCommonFilename, "CrashScreenWindow", null);
        TextBuffer tb    = new TextBuffer(new TextTagTable());

        tb.SetText(err);
        ((Gtk.TextView)glade["text"]).Buffer = tb;
        glade.BindFields(this);
        glade.Autoconnect(this);
        m_cWindow.Show();
        while (Gtk.Application.EventsPending())
        {
            Gtk.Application.RunIteration();
        }
        System.Threading.Thread.Sleep(2000);
    }
Пример #4
0
    public AboutScreen()
    {
        Glade.XML glade = new Glade.XML(null, MediaNET.MediaNET.GladeCommonFilename, "AboutScreenWindow", null);
        glade.BindFields(this);
        glade.Autoconnect(this);
        Gdk.Pixbuf pb = Gdk.Pixbuf.LoadFromResource("Franck.jpg");
        int        DimensionsY = pb.Height;
        int        DimensionsX = pb.Width;
        int        W = 200, H = 200;

        ((Gtk.Image)glade["image"]).Pixbuf = pb.ScaleSimple(W * DimensionsX / DimensionsY, H, Gdk.InterpType.Bilinear);
        m_cWindow.Show();
        while (Gtk.Application.EventsPending())
        {
            Gtk.Application.RunIteration();
        }
    }