예제 #1
0
        public SelectContainerDialog(Connection connection, Gtk.Window parent)
        {
            ui = new Glade.XML(null, "lat.glade", "selectContainerDialog", null);
            ui.Autoconnect(this);

            _ldapTreeview                        = new LdapTreeView(parent, connection);
            _ldapTreeview.dnSelected            += new dnSelectedHandler(ldapDNSelected);
            _ldapTreeview.BrowserSelectionMethod = (int)Preferences.Get(Preferences.BROWSER_SELECTION);

            browserScrolledWindow.AddWithViewport(_ldapTreeview);
            browserScrolledWindow.Show();

            selectContainerDialog.Resize(350, 400);
            selectContainerDialog.Icon = Global.latIcon;
        }
예제 #2
0
        public SelectContainerDialog(Connection connection, Gtk.Window parent)
        {
            ui = new Glade.XML (null, "lat.glade", "selectContainerDialog", null);
            ui.Autoconnect (this);

            _ldapTreeview = new LdapTreeView (parent, connection);
            _ldapTreeview.dnSelected += new dnSelectedHandler (ldapDNSelected);
            _ldapTreeview.BrowserSelectionMethod = (int)Preferences.Get (Preferences.BROWSER_SELECTION);

            browserScrolledWindow.AddWithViewport (_ldapTreeview);
            browserScrolledWindow.Show ();

            selectContainerDialog.Resize (350, 400);
            selectContainerDialog.Icon = Global.latIcon;
        }
예제 #3
0
파일: Window.cs 프로젝트: MrJoe/lat
        public MainWindow(Gnome.Program mainProgram)
        {
            program = mainProgram;

            ui = new Glade.XML(null, "lat.glade", "mainWindow", null);
            ui.Autoconnect(this);

            // set window icon
            Global.latIcon = Gdk.Pixbuf.LoadFromResource("lat.png");
            Gdk.Pixbuf dirIcon = Gdk.Pixbuf.LoadFromResource("x-directory-remote-server.png");
            mainWindow.Icon = dirIcon;

            // Restore window positions
            LoadPreference(Preferences.MAIN_WINDOW_WIDTH);
            LoadPreference(Preferences.MAIN_WINDOW_X);
            LoadPreference(Preferences.MAIN_WINDOW_MAXIMIZED);
            LoadPreference(Preferences.MAIN_WINDOW_HPANED);

            // Watch for any changes
            Preferences.SettingChanged += OnPreferencesChanged;

            // Setup views
            viewsTreeView = new ViewsTreeView();
            viewsTreeView.ViewSelected += new ViewSelectedHandler(OnViewSelected);
            viewScrolledWindow.AddWithViewport(viewsTreeView);
            viewScrolledWindow.Show();

            // Setup browser
            ldapTreeView             = new LdapTreeView(mainWindow);
            ldapTreeView.dnSelected += new dnSelectedHandler(OnLdapDNSelected);
            browserScrolledWindow.AddWithViewport(ldapTreeView);
            browserScrolledWindow.Show();

            LoadPreference(Preferences.BROWSER_SELECTION);

            // Setup schema browser
            schemaTreeview = new SchemaTreeView(mainWindow);
            schemaTreeview.schemaSelected += new schemaSelectedHandler(OnSchemaDNSelected);
            schemaScrolledWindow.AddWithViewport(schemaTreeview);
            schemaScrolledWindow.Show();

            // Setup search
            searchTreeView = new SearchResultsTreeView();
            searchTreeView.SearchResultSelected += new SearchResultSelectedHandler(OnSearchSelected);
            searchTreeView.Export += OnSearchExport;

            resultsScrolledWindow.AddWithViewport(searchTreeView);
            resultsScrolledWindow.Show();

            // setup schema
            objRequiredStore          = new ListStore(typeof(string));
            objRequiredTreeview.Model = objRequiredStore;

            objOptionalStore          = new ListStore(typeof(string));
            objOptionalTreeview.Model = objOptionalStore;

            objRequiredTreeview.AppendColumn("Required Attributes", new CellRendererText(), "text", 0);
            objOptionalTreeview.AppendColumn("Optional Attributes", new CellRendererText(), "text", 0);

            infoVpaned1.Position = 150;

            ToggleButtons(false);
            ToggleInfoNotebook(false);

            templateToolButton.Hide();

            // setup menu
            newAccelGroup = new AccelGroup();
            mainWindow.AddAccelGroup(newAccelGroup);

            // status bar
            UpdateStatusBar();

#if ENABLE_NETWORKMANAGER
            Global.Network = NetworkDetect.Instance;
            Global.Network.StateChanged += OnNetworkStateChanged;
#endif

#if ENABLE_AVAHI
            // FIXME: causes delay/crashes on exit for some reason
            finder          = new ServiceFinder();
            finder.Found   += new FoundServiceEventHandler(OnServerFound);
            finder.Removed += new RemovedServiceEventHandler(OnServerRemoved);
            finder.Start();
#endif

            viewNotebook.SwitchPage += new SwitchPageHandler(OnNotebookViewChanged);

            if (Global.Connections.ConnectionNames.Length == 0)
            {
                new ConnectDialog();

                viewsTreeView.Refresh();
                ldapTreeView.Refresh();
                schemaTreeview.Refresh();
            }
        }