Example #1
0
        public StationDialog(Stations stations, Station station)
        {
            glade = new Glade.XML(null, "radio.glade", "StationDialog", "banshee");
            glade.Autoconnect(this);
            dialog = (Dialog)glade.GetWidget("StationDialog");
            Banshee.Base.IconThemeUtils.SetWindowIcon(dialog);

            if (station == null)
            {
                is_new  = true;
                station = new Station();
            }

            this.stations = stations;
            this.station  = station;

            link_store          = new LinkStore(station);
            view                = new NodeView(link_store);
            view.HeadersVisible = true;

            CellRendererToggle active_renderer = new CellRendererToggle();

            active_renderer.Activatable = true;
            active_renderer.Radio       = true;
            active_renderer.Toggled    += OnLinkToggled;

            view.AppendColumn(Catalog.GetString("Active"), active_renderer, ActiveDataFunc);
            view.AppendColumn(Catalog.GetString("Type"), new CellRendererText(), TypeDataFunc);
            view.AppendColumn(Catalog.GetString("Title"), EditTextRenderer(), "text", 1);
            view.AppendColumn(Catalog.GetString("URI"), EditTextRenderer(), "text", 2);
            view.Show();

            (glade["link_view_container"] as ScrolledWindow).Add(view);

            group_combo = ComboBoxEntry.NewText();
            group_combo.Show();
            (glade["group_combo_container"] as Box).PackStart(group_combo, true, true, 0);

            title_entry.Text       = station.Title == null ? String.Empty : station.Title;
            description_entry.Text = station.Description == null ? String.Empty : station.Description;
            group_combo.Entry.Text = station.Group == null ? String.Empty : station.Group;

            foreach (string group in stations.Groups)
            {
                group_combo.AppendText(group);
            }
        }
        public StationDialog(Stations stations, Station station)
        {
            glade = new Glade.XML(null, "radio.glade", "StationDialog", "banshee");
            glade.Autoconnect(this);
            dialog = (Dialog)glade.GetWidget("StationDialog");
            Banshee.Base.IconThemeUtils.SetWindowIcon(dialog);

            if(station == null) {
                is_new = true;
                station = new Station();
            }

            this.stations = stations;
            this.station = station;

            link_store = new LinkStore(station);
            view = new NodeView(link_store);
            view.HeadersVisible = true;

            CellRendererToggle active_renderer = new CellRendererToggle();
            active_renderer.Activatable = true;
            active_renderer.Radio = true;
            active_renderer.Toggled += OnLinkToggled;

            view.AppendColumn(Catalog.GetString("Active"), active_renderer, ActiveDataFunc);
            view.AppendColumn(Catalog.GetString("Type"), new CellRendererText(), TypeDataFunc);
            view.AppendColumn(Catalog.GetString("Title"), EditTextRenderer(), "text", 1);
            view.AppendColumn(Catalog.GetString("URI"), EditTextRenderer(), "text", 2);
            view.Show();

            (glade["link_view_container"] as ScrolledWindow).Add(view);

            group_combo = ComboBoxEntry.NewText();
            group_combo.Show();
            (glade["group_combo_container"] as Box).PackStart(group_combo, true, true, 0);

            title_entry.Text = station.Title == null ? String.Empty : station.Title;
            description_entry.Text = station.Description == null ? String.Empty : station.Description;
            group_combo.Entry.Text = station.Group == null ? String.Empty : station.Group;

            foreach(string group in stations.Groups) {
                group_combo.AppendText(group);
            }
        }