Exemplo n.º 1
0
Arquivo: Window.cs Projeto: MrJoe/lat
        void OnViewSelected(object o, ViewSelectedEventArgs args)
        {
            ViewPlugin vp   = Global.Plugins.GetViewPlugin(args.Name, args.ConnectionName);
            Connection conn = null;

            if (vp == null)
            {
                if (viewDataTreeView != null)
                {
                    viewDataTreeView.Destroy();
                    viewDataTreeView = null;
                }

                if (serverInfoView != null)
                {
                    serverInfoView.Destroy();
                    serverInfoView = null;
                }

                conn = Global.Connections [args.ConnectionName];

                serverInfoView = new ServerInfoView(conn);
                valuesScrolledWindow.AddWithViewport(serverInfoView);
                valuesScrolledWindow.ShowAll();

                ToggleButtons(false);
                UpdateStatusBar();

                return;
            }

            CleanupView();

            if (viewDataTreeView == null)
            {
                if (serverInfoView != null)
                {
                    serverInfoView.Destroy();
                    serverInfoView = null;
                }

                conn = Global.Connections [args.ConnectionName];

                viewDataTreeView = new ViewDataTreeView(conn, mainWindow);
                valuesScrolledWindow.AddWithViewport(viewDataTreeView);
                valuesScrolledWindow.ShowAll();
            }

            viewDataTreeView.ConfigureView(vp);
            viewDataTreeView.Populate();
            SetupToolbar(vp);

            GenerateNewMenu(conn);

            UpdateStatusBar();
        }
Exemplo n.º 2
0
Arquivo: Window.cs Projeto: MrJoe/lat
        void OnLdapDNSelected(object o, dnSelectedEventArgs args)
        {
            if (args.Server == null)
            {
                return;
            }

            Connection conn = Global.Connections [args.Server];

            if (args.IsHost)
            {
                if (attributeEditor != null)
                {
                    attributeEditor.Destroy();
                }

                serverInfoView = new ServerInfoView(conn);
                valuesScrolledWindow.AddWithViewport(serverInfoView);
                valuesScrolledWindow.ShowAll();

                return;
            }

            if (serverInfoView != null)
            {
                serverInfoView.Destroy();
                serverInfoView = null;

                attributeEditor = new AttributeEditorWidget();
                valuesScrolledWindow.AddWithViewport(attributeEditor);
                valuesScrolledWindow.ShowAll();
            }

            LdapEntry entry = conn.Data.GetEntry(args.DN);

            if (entry != null)
            {
                attributeEditor.Show(conn, entry, showAllAttributes.Active);
            }
        }
Exemplo n.º 3
0
Arquivo: Window.cs Projeto: MrJoe/lat
        void OnNotebookViewChanged(object o, SwitchPageArgs args)
        {
            WriteStatusMessage("");

            if (args.PageNum == 0)
            {
                ldapTreeView.removeToolbarHandlers();
                ToggleButtons(false);
                ToggleInfoNotebook(false);
                viewsView.Active = true;

                if (serverInfoView != null)
                {
                    serverInfoView.Destroy();
                    serverInfoView = null;
                }

                if (attributeEditor != null)
                {
                    attributeEditor.Destroy();
                    attributeEditor = null;
                }

                templateToolButton.Hide();
            }
            else if (args.PageNum == 1)
            {
                CleanupView();

                ToggleButtons(true);
                ToggleInfoNotebook(false);
                browserView.Active = true;

                newMenuItem.Submenu    = null;
                newMenuToolButton.Menu = null;

                templateToolButton.Show();
                propertiesToolButton.Hide();
                refreshToolButton.Hide();

                if (serverInfoView != null)
                {
                    serverInfoView.Destroy();
                    serverInfoView = null;
                }

                if (viewDataTreeView != null)
                {
                    viewDataTreeView.Destroy();
                    viewDataTreeView = null;
                }

                if (attributeEditor == null)
                {
                    attributeEditor = new AttributeEditorWidget();
                    valuesScrolledWindow.AddWithViewport(attributeEditor);
                    valuesScrolledWindow.Show();
                }

                ldapTreeView.setToolbarHandlers(newMenuToolButton, deleteToolButton);
                SetBrowserTooltips();
            }
            else if (args.PageNum == 2)
            {
                CleanupView();

                ldapTreeView.removeToolbarHandlers();
                searchView.Active = true;

                newMenuItem.Submenu    = null;
                newMenuToolButton.Menu = null;

                if (serverInfoView != null)
                {
                    serverInfoView.Destroy();
                    serverInfoView = null;
                }

                if (viewDataTreeView != null)
                {
                    viewDataTreeView.Destroy();
                    viewDataTreeView = null;
                }

                if (attributeEditor == null)
                {
                    attributeEditor = new AttributeEditorWidget();
                    valuesScrolledWindow.AddWithViewport(attributeEditor);
                    valuesScrolledWindow.Show();
                }

                ToggleButtons(false);
                ToggleInfoNotebook(false);

                templateToolButton.Hide();

                if (serverComboBox != null)
                {
                    serverComboBox.Destroy();
                    serverComboBox = null;
                }

                CreateServerCombo();
            }
            else if (args.PageNum == 3)
            {
                CleanupView();

                ToggleButtons(false);
                schemaView.Active = true;

                newMenuItem.Submenu    = null;
                newMenuToolButton.Menu = null;

                ToggleInfoNotebook(true);

                SetInfoNotePage(-1);

                templateToolButton.Hide();
            }
        }