Exemple #1
0
        private void BuildInterface()
        {
            box = new VBox();

            model                   = new StationModel(plugin);
            view                    = new StationView(model);
            view.RowActivated      += OnViewRowActivated;
            view.Popup             += OnViewPopup;
            view.Selection.Changed += OnViewSelectionChanged;

            ScrolledWindow view_scroll = new ScrolledWindow();

            view_scroll.HscrollbarPolicy = PolicyType.Never;
            view_scroll.VscrollbarPolicy = PolicyType.Automatic;
            view_scroll.ShadowType       = ShadowType.In;

            view_scroll.Add(view);

            status_bar             = new HighlightMessageArea();
            status_bar.BorderWidth = 5;
            status_bar.LeftPadding = 15;

            box.PackStart(view_scroll, true, true, 0);
            box.PackStart(status_bar, false, false, 0);

            view_scroll.ShowAll();
            box.Show();
            status_bar.Hide();
        }
Exemple #2
0
        public RadioSource(RadioPlugin plugin) : base(Catalog.GetString("Radio"), 150)
        {
            this.plugin = plugin;

            PlayerEngineCore.EventChanged += OnPlayerEventChanged;
            PlayerEngineCore.StateChanged += OnPlayerStateChanged;

            plugin.StationManager.StationsLoaded += delegate {
                if (status_bar != null)
                {
                    status_bar.Hide();
                }

                OnUpdated();
            };

            plugin.StationManager.StationsRefreshing += delegate {
                if (status_bar != null)
                {
                    status_bar.Message = String.Format("<big>{0}</big>", GLib.Markup.EscapeText(Catalog.GetString(
                                                                                                    "Refreshing radio stations from the Banshee Radio Web Service")));
                    status_bar.Pixbuf          = refresh_pixbuf;
                    status_bar.ShowCloseButton = false;
                    status_bar.Show();
                }
            };

            plugin.StationManager.StationsLoadFailed += delegate(object o, StationManager.StationsLoadFailedArgs args) {
                if (status_bar != null)
                {
                    status_bar.Message = String.Format("<big>{0}</big>", GLib.Markup.EscapeText(Catalog.GetString(
                                                                                                    "Failed to load radio stations: " + args.Message)));
                    status_bar.Pixbuf          = error_pixbuf;
                    status_bar.ShowCloseButton = true;
                    status_bar.Show();
                }
            };

            plugin.Actions.GetAction("CopyUriAction").Activated += OnCopyUri;

            BuildInterface();
        }
        private void BuildInterface()
        {
            box = new VBox();

            model = new StationModel(plugin);
            view = new StationView(model);
            view.RowActivated += OnViewRowActivated;
            view.Popup += OnViewPopup;
            view.Selection.Changed += OnViewSelectionChanged;

            ScrolledWindow view_scroll = new ScrolledWindow();
            view_scroll.HscrollbarPolicy = PolicyType.Never;
            view_scroll.VscrollbarPolicy = PolicyType.Automatic;
            view_scroll.ShadowType = ShadowType.In;

            view_scroll.Add(view);

            status_bar = new HighlightMessageArea();
            status_bar.BorderWidth = 5;
            status_bar.LeftPadding = 15;

            box.PackStart(view_scroll, true, true, 0);
            box.PackStart(status_bar, false, false, 0);

            view_scroll.ShowAll();
            box.Show();
            status_bar.Hide();
        }