public GeneralProjectOptionsWidget (Project project, OptionsDialog dialog) { Build (); this.project = project; this.dialog = dialog; nameLabel.UseUnderline = true; descriptionLabel.UseUnderline = true; projectNameEntry.Text = project.Name; projectDescriptionTextView.Buffer.Text = project.Description; if (project is DotNetProject) { projectDefaultNamespaceEntry.Text = ((DotNetProject)project).DefaultNamespace; } else if (project is SharedAssetsProject) { projectDefaultNamespaceEntry.Text = ((SharedAssetsProject)project).DefaultNamespace; } else { defaultNamespaceLabel.Visible = false; projectDefaultNamespaceEntry.Visible = false; } entryVersion.Text = project.Version; checkSolutionVersion.Active = project.SyncVersionWithSolution; entryVersion.Sensitive = !project.SyncVersionWithSolution; }
void IOptionsPanel.Initialize (OptionsDialog dialog, object dataObject) { this.ExpandHorizontal = true; this.ExpandVertical = true; this.HeightRequest = 400; list = new ListView (); store = new ListStore (language, completeOnSpace, completeOnChars); var languageColumn = list.Columns.Add (GettextCatalog.GetString ("Language"), language); languageColumn.CanResize = true; var checkBoxCellView = new CheckBoxCellView (completeOnSpace); checkBoxCellView.Editable = true; var completeOnSpaceColumn = list.Columns.Add (GettextCatalog.GetString ("Complete on space"), checkBoxCellView); completeOnSpaceColumn.CanResize = true; var textCellView = new TextCellView (completeOnChars); textCellView.Editable = true; var doNotCompleteOnColumn = list.Columns.Add (GettextCatalog.GetString ("Do complete on"), textCellView); doNotCompleteOnColumn.CanResize = true; list.DataSource = store; PackStart (list, true, true); var hbox = new HBox (); var button = new Button ("Reset to default"); button.Clicked += delegate { FillStore (CompletionCharacters.GetDefaultCompletionCharacters ()); }; hbox.PackEnd (button, false, false); PackEnd (hbox, false, true); FillStore (CompletionCharacters.GetCompletionCharacters ()); }
public override void Initialize(MonoDevelop.Ide.Gui.Dialogs.OptionsDialog dialog, object dataObject) { base.Initialize(dialog, dataObject); foreach (MimeTypeOptionsPanelNode node in AddinManager.GetExtensionNodes("/MonoDevelop/ProjectModel/Gui/MimeTypePolicyPanels")) { mimeTypesWithPolicies.Add(node.MimeType); } var provider = dataObject as IPolicyProvider; if (provider == null) { provider = PolicyService.GetUserDefaultPolicySet(); // When editing the global user preferences, the default values for policies are the IDE default values. defaultPolicyContainer = PolicyService.SystemDefaultPolicies; } policyContainer = provider.Policies; if (!(dataObject is SolutionFolderItem) && !(dataObject is Solution)) { globalMimeTypes = new List <string> (); string userTypes = PropertyService.Get <string> ("MonoDevelop.Projects.GlobalPolicyMimeTypes", ""); globalMimeTypes.AddRange(userTypes.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)); } foreach (string mt in GetItemMimeTypes()) { AddPanel(mt); } policyContainer.PolicyChanged += HandlePolicyContainerPolicyChanged; }
public override void Initialize (OptionsDialog dialog, object dataObject) { base.Initialize (dialog, dataObject); config = (SolutionRunConfigInfo)dataObject; store = new ListStore (selectedField, projectNameField, projectField, runConfigField, projectRunConfigsField); listView = new ListView (store); var col1 = new ListViewColumn (GettextCatalog.GetString ("Solution Item")); var cb = new CheckBoxCellView (selectedField); cb.Toggled += SelectionChanged; cb.Editable = true; col1.Views.Add (cb); col1.Views.Add (new TextCellView (projectNameField)); listView.Columns.Add (col1); var configSelView = new ComboBoxCellView (runConfigField); configSelView.Editable = true; configSelView.ItemsField = projectRunConfigsField; var col2 = new ListViewColumn (GettextCatalog.GetString ("Run Configuration"), configSelView); listView.Columns.Add (col2); foreach (var it in config.Solution.GetAllSolutionItems ().Where (si => si.SupportsExecute ()).OrderBy (si => si.Name)) { var row = store.AddRow (); var si = config.EditedConfig.Items.FirstOrDefault (i => i.SolutionItem == it); var sc = si?.RunConfiguration?.Name ?? it.GetDefaultRunConfiguration ()?.Name; var configs = new ItemCollection (); foreach (var pc in it.GetRunConfigurations ()) configs.Add (pc.Name); store.SetValues (row, selectedField, si != null, projectNameField, it.Name, projectField, it, runConfigField, sc, projectRunConfigsField, configs); } }
public override void Initialize(MonoDevelop.Ide.Gui.Dialogs.OptionsDialog dialog, object dataObject) { base.Initialize(dialog, dataObject); foreach (MimeTypeOptionsPanelNode node in AddinManager.GetExtensionNodes("/MonoDevelop/ProjectModel/Gui/MimeTypePolicyPanels")) { mimeTypesWithPolicies.Add(node.MimeType); } if (dataObject is SolutionItem) { policyContainer = ((SolutionItem)dataObject).Policies; } else if (dataObject is Solution) { policyContainer = ((Solution)dataObject).Policies; } else if (dataObject is PolicySet) { policyContainer = ((PolicySet)dataObject); globalMimeTypes = new List <string> (); string userTypes = PropertyService.Get <string> ("MonoDevelop.Projects.GlobalPolicyMimeTypes", ""); globalMimeTypes.AddRange(userTypes.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries)); } foreach (string mt in GetItemMimeTypes()) { AddPanel(mt); } }
public override void Initialize (OptionsDialog dialog, object dataObject) { project = dataObject as DotNetProject; propertyGroup = project.MSBuildProject.GetNuGetMetadataPropertyGroup (); packOnBuild = propertyGroup.GetValue ("PackOnBuild", false); base.Initialize (dialog, dataObject); }
public override void Initialize (OptionsDialog dialog, object dataObject) { base.Initialize (dialog, dataObject); this.dialog = dialog as MultiConfigItemOptionsDialog; if (this.dialog == null) throw new System.InvalidOperationException ("MultiConfigItemOptionsPanel can only be used in options dialogs of type MultiConfigItemOptionsDialog. Panel type: " + GetType ()); this.dialog.ConfigurationData.ConfigurationsChanged += OnConfigurationsChanged; }
public override void Initialize (OptionsDialog dialog, object dataObject) { base.Initialize (dialog, dataObject); solutionItem = dataObject as SolutionEntityItem; if (solutionItem != null) workspaceItem = solutionItem.ParentSolution; else workspaceItem = dataObject as WorkspaceItem; }
public override void Initialize (OptionsDialog dialog, object dataObject) { base.Initialize (dialog, dataObject); Solution = (Solution)dataObject; foreach (var rc in Solution.MultiStartupRunConfigurations) configs.Add (new SolutionRunConfigInfo { ProjectConfig = rc, EditedConfig = new MultiItemSolutionRunConfiguration (rc) }); foreach (var c in configs) AddPanel (c); ParentDialog.ExpandChildren (this); }
public override void Initialize (OptionsDialog dialog, object dataObject) { base.Initialize (dialog, dataObject); Project = (Project)dataObject; if (!Project.SupportsRunConfigurations ()) return; foreach (var rc in Project.RunConfigurations) configs.Add (new RunConfigInfo { ProjectConfig = rc, EditedConfig = Project.CloneRunConfiguration (rc, rc.Name) }); foreach (var c in configs) AddPanel (c); ParentDialog.ExpandChildren (this); }
public override void Initialize(MonoDevelop.Ide.Gui.Dialogs.OptionsDialog dialog, object dataObject) { base.Initialize(dialog, dataObject); if (dataObject is SolutionItem) { policyContainer = bag = ((SolutionItem)dataObject).Policies; } else if (dataObject is Solution) { policyContainer = bag = ((Solution)dataObject).Policies; } else if (dataObject is PolicySet) { policyContainer = polSet = ((PolicySet)dataObject); } }
public override void Initialize(MonoDevelop.Ide.Gui.Dialogs.OptionsDialog dialog, object dataObject) { base.Initialize(dialog, dataObject); IPolicyProvider provider = dataObject as IPolicyProvider; if (provider == null) { provider = PolicyService.GetUserDefaultPolicySet(); isGlobalPolicy = true; } policyContainer = provider.Policies; bag = policyContainer as PolicyBag; polSet = policyContainer as PolicySet; policyContainer.PolicyChanged += HandlePolicyContainerPolicyChanged; }
public CodeTemplatePanelWidget (OptionsDialog parent) { this.parent = parent; this.Build(); scrolledwindow1.Child = textEditor; textEditor.ShowAll (); templateStore = new TreeStore (typeof (CodeTemplate), typeof (string), typeof (string)); TreeViewColumn column = new TreeViewColumn (); column.Title = GettextCatalog.GetString ("Key"); pixbufCellRenderer = new CellRendererPixbuf (); column.PackStart (pixbufCellRenderer, false); column.SetCellDataFunc (pixbufCellRenderer, new Gtk.TreeCellDataFunc (RenderIcon)); templateCellRenderer = new CellRendererText (); column.PackStart (templateCellRenderer, true); column.SetCellDataFunc (templateCellRenderer, new Gtk.TreeCellDataFunc (RenderTemplateName)); treeviewCodeTemplates.AppendColumn (column); treeviewCodeTemplates.Model = templateStore; templates = new List<CodeTemplate> (CodeTemplateService.Templates); templates.ForEach (t => InsertTemplate (t)); treeviewCodeTemplates.ExpandAll (); treeviewCodeTemplates.Selection.Changed += HandleChanged; options = new Mono.TextEditor.TextEditorOptions (); options.ShowLineNumberMargin = false; options.ShowFoldMargin = false; options.ShowIconMargin = false; options.ShowInvalidLines = false; options.ShowSpaces = options.ShowTabs = options.ShowEolMarkers = false; options.ColorScheme = PropertyService.Get ("ColorScheme", "Default"); textEditor.Options = options; textEditor.Document.ReadOnly = true; this.buttonAdd.Clicked += ButtonAddClicked; this.buttonEdit.Clicked += ButtonEditClicked; this.buttonRemove.Clicked += ButtonRemoveClicked; checkbuttonWhiteSpaces.Toggled += CheckbuttonWhiteSpacesToggled; this.treeviewCodeTemplates.Selection.Changed += SelectionChanged; SelectionChanged (null, null); }
public GeneralProjectOptionsWidget (Project project, OptionsDialog dialog) { Build (); this.project = project; this.dialog = dialog; nameLabel.UseUnderline = true; descriptionLabel.UseUnderline = true; projectNameEntry.Text = project.Name; projectDescriptionTextView.Buffer.Text = project.Description; // TODO msbuild Move to build panel? if (project is DotNetProject) { projectDefaultNamespaceEntry.Text = ((DotNetProject)project).DefaultNamespace; } else { defaultNamespaceLabel.Visible = false; projectDefaultNamespaceEntry.Visible = false; } switch (project.NewFileSearch) { case NewFileSearch.None: newFilesOnLoadCheckButton.Active = false; autoInsertNewFilesCheckButton.Active = false; break; case NewFileSearch.OnLoad: newFilesOnLoadCheckButton.Active = true; autoInsertNewFilesCheckButton.Active = false; break; default: newFilesOnLoadCheckButton.Active = true; autoInsertNewFilesCheckButton.Active = true; break; } entryVersion.Text = project.Version; checkSolutionVersion.Active = project.SyncVersionWithSolution; entryVersion.Sensitive = !project.SyncVersionWithSolution; newFilesOnLoadCheckButton.Clicked += new EventHandler(AutoLoadCheckBoxCheckedChangeEvent); AutoLoadCheckBoxCheckedChangeEvent(null, null); }
public override void Initialize(MonoDevelop.Ide.Gui.Dialogs.OptionsDialog dialog, object dataObject) { base.Initialize(dialog, dataObject); IPolicyProvider provider = dataObject as IPolicyProvider; if (provider == null) { provider = PolicyService.GetUserDefaultPolicySet(); // When editing the global user preferences, the default values for policies are the IDE default values. defaultPolicyContainer = PolicyService.SystemDefaultPolicies; isGlobalPolicy = true; } policyContainer = provider.Policies; bag = policyContainer as PolicyBag; polSet = policyContainer as PolicySet; policyContainer.PolicyChanged += HandlePolicyContainerPolicyChanged; }
public CodeTemplatePanelWidget (OptionsDialog parent) { this.Build(); scrolledwindow1.Add (textEditor); textEditor.ShowAll (); templateStore = new TreeStore (typeof (CodeTemplate), typeof (string), typeof (string)); TreeViewColumn column = new TreeViewColumn (); column.Title = GettextCatalog.GetString ("Key"); pixbufCellRenderer = new CellRendererImage (); column.PackStart (pixbufCellRenderer, false); column.SetCellDataFunc (pixbufCellRenderer, new Gtk.TreeCellDataFunc (RenderIcon)); templateCellRenderer = new CellRendererText (); column.PackStart (templateCellRenderer, true); column.SetCellDataFunc (templateCellRenderer, new Gtk.TreeCellDataFunc (RenderTemplateName)); treeviewCodeTemplates.AppendColumn (column); treeviewCodeTemplates.Model = templateStore; templates = new List<CodeTemplate> (CodeTemplateService.Templates); templates.ForEach (t => InsertTemplate (t)); treeviewCodeTemplates.ExpandAll (); treeviewCodeTemplates.Selection.Changed += HandleChanged; options = new MonoDevelop.Ide.Gui.CommonTextEditorOptions (); options.ShowLineNumberMargin = false; options.ShowFoldMargin = false; options.ShowIconMargin = false; textEditor.Options = options; textEditor.Document.ReadOnly = true; this.buttonAdd.Clicked += ButtonAddClicked; this.buttonEdit.Clicked += ButtonEditClicked; this.buttonRemove.Clicked += ButtonRemoveClicked; this.treeviewCodeTemplates.Selection.Changed += SelectionChanged; SelectionChanged (null, null); checkbuttonWhiteSpaces.Hide (); }
public CodeTemplatePanelWidget (OptionsDialog parent) { this.Build(); Gtk.Widget control = textEditor; scrolledwindow1.Add (control); control.ShowAll (); templateStore = new TreeStore (typeof (CodeTemplate), typeof (string), typeof (string)); TreeViewColumn column = new TreeViewColumn (); column.Title = GettextCatalog.GetString ("Key"); pixbufCellRenderer = new CellRendererImage (); column.PackStart (pixbufCellRenderer, false); column.SetCellDataFunc (pixbufCellRenderer, new Gtk.TreeCellDataFunc (RenderIcon)); templateCellRenderer = new CellRendererText (); column.PackStart (templateCellRenderer, true); column.SetCellDataFunc (templateCellRenderer, new Gtk.TreeCellDataFunc (RenderTemplateName)); treeviewCodeTemplates.AppendColumn (column); treeviewCodeTemplates.Model = templateStore; treeviewCodeTemplates.SearchColumn = -1; // disable the interactive search templates = new List<CodeTemplate> (CodeTemplateService.Templates); templates.ForEach (t => InsertTemplate (t)); treeviewCodeTemplates.ExpandAll (); treeviewCodeTemplates.Selection.Changed += HandleChanged; textEditor.Options = DefaultSourceEditorOptions.PlainEditor; textEditor.IsReadOnly = true; this.buttonAdd.Clicked += ButtonAddClicked; this.buttonEdit.Clicked += ButtonEditClicked; this.buttonRemove.Clicked += ButtonRemoveClicked; this.treeviewCodeTemplates.Selection.Changed += SelectionChanged; SelectionChanged (null, null); checkbuttonWhiteSpaces.Hide (); }
public override void Initialize(MonoDevelop.Ide.Gui.Dialogs.OptionsDialog dialog, object dataObject) { base.Initialize(dialog, dataObject); panelData = (MimeTypePanelData)dataObject; if (panelData.DataObject is SolutionItem) { bag = ((SolutionItem)panelData.DataObject).Policies; } else if (panelData.DataObject is Solution) { bag = ((Solution)panelData.DataObject).Policies; } else if (panelData.DataObject is PolicySet) { polSet = ((PolicySet)panelData.DataObject); } mimeType = panelData.MimeType; panelData.SectionPanel = this; isRoot = polSet != null || bag.IsRoot; }
public override void Initialize(MonoDevelop.Ide.Gui.Dialogs.OptionsDialog dialog, object dataObject) { base.Initialize(dialog, dataObject); panelData = (MimeTypePanelData)dataObject; IPolicyProvider provider = panelData.DataObject as IPolicyProvider; if (provider == null) { provider = PolicyService.GetUserDefaultPolicySet(); isGlobalPolicy = true; } bag = provider.Policies as PolicyBag; polSet = provider.Policies as PolicySet; mimeType = panelData.MimeType; panelData.SectionPanel = this; isRoot = polSet != null || bag.IsRoot; if (IsCustomUserPolicy) { isRoot = false; } }
public void Initialize (OptionsDialog dialog, object dataObject) { this.dialog = dialog; }
public GeneralProjectOptionsWidget (Project project, OptionsDialog dialog) { Build (); this.project = project; this.dialog = dialog; nameLabel.UseUnderline = true; descriptionLabel.UseUnderline = true; projectNameEntry.Text = project.Name; projectDescriptionTextView.Buffer.Text = project.Description; // TODO msbuild Move to build panel? if (project is DotNetProject) { projectDefaultNamespaceEntry.Text = ((DotNetProject)project).DefaultNamespace; bool byDefault, require; MSBuildProjectService.CheckHandlerUsesMSBuildEngine (project, out byDefault, out require); if (require) { this.msbuildOptionsSection.Visible = false; this.msbuildHeaderLabel.Visible = false; } else { this.msbuildCheck.Active = project.UseMSBuildEngine ?? byDefault; if (byDefault) { msbuildCheck.Label = GettextCatalog.GetString ("Use MSBuild build engine (recommended for this project type)"); } else { msbuildCheck.Label = GettextCatalog.GetString ("Use MSBuild build engine (unsupported for this project type)"); } } } else { defaultNamespaceLabel.Visible = false; projectDefaultNamespaceEntry.Visible = false; this.msbuildOptionsSection.Visible = false; this.msbuildHeaderLabel.Visible = false; } switch (project.NewFileSearch) { case NewFileSearch.None: newFilesOnLoadCheckButton.Active = false; autoInsertNewFilesCheckButton.Active = false; break; case NewFileSearch.OnLoad: newFilesOnLoadCheckButton.Active = true; autoInsertNewFilesCheckButton.Active = false; break; default: newFilesOnLoadCheckButton.Active = true; autoInsertNewFilesCheckButton.Active = true; break; } entryVersion.Text = project.Version; checkSolutionVersion.Active = project.SyncVersionWithSolution; entryVersion.Sensitive = !project.SyncVersionWithSolution; newFilesOnLoadCheckButton.Clicked += new EventHandler(AutoLoadCheckBoxCheckedChangeEvent); AutoLoadCheckBoxCheckedChangeEvent(null, null); }
void IOptionsPanel.Initialize (OptionsDialog dialog, object dataObject) { }
public override void Initialize (OptionsDialog dialog, object dataObject) { base.Initialize (dialog, dataObject); }
public SolutionRunConfigurationsPanelWidget (SolutionRunConfigurationsPanel panel, OptionsDialog dialog) { this.panel = panel; Margin = 6; Spacing = 6; list = new RunConfigurationsList (); PackStart (list, true); var box = new Xwt.HBox (); box.Spacing = 6; var btn = new Xwt.Button (GettextCatalog.GetString ("New")); btn.Clicked += OnAddConfiguration; box.PackStart (btn, false); copyButton = new Xwt.Button (GettextCatalog.GetString ("Duplicate")); copyButton.Clicked += OnCopyConfiguration; box.PackStart (copyButton, false); renameButton = new Xwt.Button (GettextCatalog.GetString ("Rename")); renameButton.Clicked += OnRenameConfiguration; box.PackStart (renameButton, false); removeButton = new Xwt.Button (GettextCatalog.GetString ("Remove")); removeButton.Clicked += OnRemoveConfiguration; box.PackEnd (removeButton, false); Fill (); PackStart (box, false); list.SelectionChanged += (sender, e) => UpdateButtons (); list.RowActivated += (sender, e) => panel.ShowConfiguration ((MultiItemSolutionRunConfiguration)list.SelectedConfiguration); UpdateButtons (); }
public void Initialize (OptionsDialog dialog, object dataObject) { obj = dataObject as WorkspaceObject; }
public override void Initialize(MonoDevelop.Ide.Gui.Dialogs.OptionsDialog dialog, object dataObject) { solution = dataObject as Solution; base.Initialize(dialog, dataObject); }
/// <summary> /// Initializes the OptionsPanel. /// </summary> /// <param name="dialog">Parent dialog.</param> /// <param name="dataObject">Data object (should be the project in our case).</param> public void Initialize(OptionsDialog dialog, object dataObject) { this.optionsPanelVisible = false; this.parentProject = dataObject as Project; // If for some reason the dataObject isn't our project get it over the selection in case that isn't null. if (this.parentProject == null && IdeApp.ProjectOperations.CurrentSelectedProject != null) { this.parentProject = IdeApp.ProjectOperations.CurrentSelectedProject; } this.optionsPanelVisible = ProjectUtilities.Instance.IsKnownProjectType(this.parentProject); if (this.optionsPanelVisible) { string localSettingsFileFolder = this.parentProject.BaseDirectory; string settingsFilePath = System.IO.Path.Combine(localSettingsFileFolder, global::StyleCop.Settings.DefaultFileName); if (!System.IO.File.Exists(settingsFilePath)) { string deprecatedSettingsFile = System.IO.Path.Combine(localSettingsFileFolder, global::StyleCop.Settings.AlternateFileName); if (System.IO.File.Exists(deprecatedSettingsFile)) { settingsFilePath = deprecatedSettingsFile; } else { deprecatedSettingsFile = System.IO.Path.Combine(localSettingsFileFolder, V101Settings.DefaultFileName); if (System.IO.File.Exists(deprecatedSettingsFile)) { settingsFilePath = deprecatedSettingsFile; } } } if (settingsHandler == null) { try { settingsHandler = new StyleCopSettingsHandler(settingsFilePath, ProjectUtilities.Instance.Core); } catch { this.optionsPanelVisible = false; } } } }
public CodeFormattingPanelWidget (CodeFormattingPanel panel, OptionsDialog dialog) { this.Build(); this.panel = panel; this.dialog = dialog; store = new Gtk.ListStore (typeof(MimeTypePanelData), typeof(Gdk.Pixbuf), typeof(string)); tree.Model = store; boxButtons.Visible = panel.DataObject is PolicySet; Gtk.CellRendererText crt = new Gtk.CellRendererText (); Gtk.CellRendererPixbuf crp = new Gtk.CellRendererPixbuf (); Gtk.TreeViewColumn col = new Gtk.TreeViewColumn (); col.Title = GettextCatalog.GetString ("File Type"); col.PackStart (crp, false); col.PackStart (crt, true); col.AddAttribute (crp, "pixbuf", 1); col.AddAttribute (crt, "text", 2); tree.AppendColumn (col); store.SetSortColumnId (2, Gtk.SortType.Ascending); CellRendererComboBox comboCell = new CellRendererComboBox (); comboCell.Changed += OnPolicySelectionChanged; Gtk.TreeViewColumn polCol = tree.AppendColumn (GettextCatalog.GetString ("Policy"), comboCell, new Gtk.TreeCellDataFunc (OnSetPolicyData)); tree.Selection.Changed += delegate { Gtk.TreeIter it; tree.Selection.GetSelected (out it); Gtk.TreeViewColumn ccol; Gtk.TreePath path; tree.GetCursor (out path, out ccol); if (ccol == polCol) tree.SetCursor (path, ccol, true); }; Fill (); UpdateButtons (); tree.Selection.Changed += delegate { UpdateButtons (); }; }
public virtual void Initialize(OptionsDialog dialog, object dataObject) { dlg = dialog; this.dataObject = dataObject; }
public override void Initialize (OptionsDialog dialog, object dataObject) { project = dataObject as PackagingProject; base.Initialize (dialog, dataObject); }
public void Initialize (OptionsDialog dialog, object dataObject) { }
public virtual void Initialize (OptionsDialog dialog, object dataObject) { dlg = dialog; this.dataObject = dataObject; }