Inheritance: Pixane.Widgets.ZoomableCairoArea
        private NetworkOverviewPage()
        {
            /* Build the UI */

            CreateUserList ();

            /* Create mainbar */

            Widget mapWidget = null;
            try {
                map = new ZoomableNetworkMap ();
                map.SelectedNodeChanged += map_SelectedNodeChanged;
                map.NodeDoubleClicked += map_NodeDoubleClicked;
                mapWidget = map;
            } catch (Exception ex) {
                LoggingService.LogError("Failed to load map !!!", ex);
                mapWidget = new Label("Error loading map.");
            }

            this.Pack1 (mapWidget, true, true);

            /* Create sidebar */
            sidebar = new EventBox();
            sidebar.WidthRequest = 190;

            var sidebarBox = new Gtk.VBox();
            sidebar.Add(sidebarBox);

            var headerAlign = new Banshee.Widgets.FadingAlignment();
            sidebarBox.PackStart(headerAlign, false, false, 0);

            var headerLabel = new Gtk.Label();
            headerLabel.Markup = "<b>Users</b>";
            headerLabel.Xalign = 0;
            headerLabel.Ypad = 6;
            headerLabel.Xpad = 6;
            headerAlign.Add(headerLabel);

            sidebarBox.PackStart(AddScrolledWindow(userList), true, true, 0);

            this.Pack2(sidebar, false, true);

            sidebar.ShowAll();

            foreach (Network network in Core.Networks) {
                Core_NetworkAdded (network);
            }

            Core.TransportManager.TransportError +=
                (TransportErrorEventHandler)DispatchService.GuiDispatch(
                    new TransportErrorEventHandler(Core_TransportError)
                );

            Core.NetworkAdded +=
                (NetworkEventHandler)DispatchService.GuiDispatch(
                    new NetworkEventHandler(Core_NetworkAdded)
                );

            Core.NetworkRemoved +=
                (NetworkEventHandler)DispatchService.GuiDispatch(
                    new NetworkEventHandler(Core_NetworkRemoved)
                );

            Core.AvatarManager.AvatarsChanged +=
                (EventHandler)DispatchService.GuiDispatch(
                    new EventHandler(AvatarManager_AvatarsChanged)
                );

            this.ShowAll();
        }
示例#2
0
        private NetworkOverviewPage()
        {
            /* Build the UI */

            CreateUserList();

            /* Create mainbar */

            Widget mapWidget = null;

            try {
                map = new ZoomableNetworkMap();
                map.SelectedNodeChanged += map_SelectedNodeChanged;
                map.NodeDoubleClicked   += map_NodeDoubleClicked;
                mapWidget = map;
            } catch (Exception ex) {
                Core.LoggingService.LogError("Failed to load map !!!", ex);
                mapWidget = new Label("Error loading map.");
            }

            this.Pack1(mapWidget, true, true);

            /* Create sidebar */
            sidebar = new EventBox();
            sidebar.WidthRequest = 190;

            var sidebarBox = new Gtk.VBox();

            sidebar.Add(sidebarBox);

            var headerAlign = new Banshee.Widgets.FadingAlignment();

            sidebarBox.PackStart(headerAlign, false, false, 0);

            var headerLabel = new Gtk.Label();

            headerLabel.Markup = "<b>Users</b>";
            headerLabel.Xalign = 0;
            headerLabel.Ypad   = 6;
            headerLabel.Xpad   = 6;
            headerAlign.Add(headerLabel);

            sidebarBox.PackStart(AddScrolledWindow(userList), true, true, 0);

            this.Pack2(sidebar, false, true);

            sidebar.ShowAll();

            foreach (Network network in Core.Networks)
            {
                Core_NetworkAdded(network);
            }

            Core.TransportManager.TransportError +=
                (EventHandler <ErrorEventArgs>)DispatchService.GuiDispatch(
                    new EventHandler <ErrorEventArgs>(Core_TransportError)
                    );

            Core.NetworkAdded +=
                (NetworkEventHandler)DispatchService.GuiDispatch(
                    new NetworkEventHandler(Core_NetworkAdded)
                    );

            Core.NetworkRemoved +=
                (NetworkEventHandler)DispatchService.GuiDispatch(
                    new NetworkEventHandler(Core_NetworkRemoved)
                    );

            Core.AvatarManager.AvatarsChanged +=
                (EventHandler)DispatchService.GuiDispatch(
                    new EventHandler(AvatarManager_AvatarsChanged)
                    );

            this.ShowAll();
        }