Beispiel #1
0
        public void ShowGlobalPreferencesDialog(Window parentWindow, string panelId, Action <OptionsDialog> configurationAction = null)
        {
            if (parentWindow == null && IdeApp.Workbench.RootWindow.Visible)
            {
                parentWindow = IdeApp.Workbench.RootWindow;
            }

            OptionsDialog ops = new OptionsDialog(
                parentWindow,
                properties,
                "/MonoDevelop/Ide/GlobalOptionsDialog");

            ops.Title = Platform.IsWindows
                                ? GettextCatalog.GetString("Options")
                                : GettextCatalog.GetString("Preferences");

            try {
                if (panelId != null)
                {
                    ops.SelectPanel(panelId);
                }
                if (configurationAction != null)
                {
                    configurationAction(ops);
                }
                if (MessageService.RunCustomDialog(ops, parentWindow) == (int)Gtk.ResponseType.Ok)
                {
                    PropertyService.SaveProperties();
                    MonoDevelop.Projects.Policies.PolicyService.SavePolicies();
                }
            } finally {
                ops.Destroy();
                ops.Dispose();
            }
        }
Beispiel #2
0
        /// <summary>
        /// Handles the Click event of the Options menu item
        /// </summary>
        /// <param name="tabIndex">The index of the options dialog tab </param>
        protected void OnOptionsClicked(OptionsDialog.OptionsTabIndex tabIndex)
        {
            OptionsDialog dlg = new OptionsDialog(this, tabIndex);

            try
            {
                dlg.ApplyChanges += new OptionsDialog.ApplyChangesHandler(OnApplyChanges);
                DialogResult result = dlg.ShowDialog();
                if (result == DialogResult.OK)
                {
                    OnOptionsChanged();
                }
            }
            finally
            {
                dlg.Close();
                dlg.Dispose();
            }
        }
Beispiel #3
0
        protected void OnOptionsClicked(OptionsDialog.OptionsTabIndex tabIndex)
        {
            if (mainform == null)
            {
                mainform = new MainForm();
            }
            OptionsDialog dlg = new OptionsDialog(mainform, tabIndex);

            try
            {
                dlg.ApplyChanges += new OptionsDialog.ApplyChangesHandler(OnApplyChanges);
                System.Windows.Forms.DialogResult result = dlg.ShowDialog();
                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    OnOptionsChanged();
                }
            }
            finally
            {
                dlg.Close();
                dlg.Dispose();
            }
        }