public ExportProjectPolicyDialog (IPolicyProvider policyProvider) { this.Build (); this.policyProvider = policyProvider; fileEntry.Action = FileChooserAction.Save; fileEntry.DefaultPath = DefaultFileDialogPolicyDir; if (policyProvider is SolutionItem) fileEntry.Path = ((SolutionItem)policyProvider).Name + ".mdpolicy"; else if (policyProvider is Solution) fileEntry.Path = ((Solution)policyProvider).Name + ".mdpolicy"; fileEntry.FileFilters.AddFilter (BrandingService.BrandApplicationName (GettextCatalog.GetString ("MonoDevelop policy files")), "*.mdpolicy"); fileEntry.FileFilters.AddAllFilesFilter (); fileEntry.PathChanged += delegate { UpdateWidgets (); }; entryName.Changed += delegate { UpdateWidgets (); }; tree = new PoliciesListSummaryTree (); policiesScroll.Add (tree); tree.Show (); tree.SetPolicies (policyProvider.Policies); if (!tree.HasPolicies) { tree.Message = GettextCatalog.GetString ("No policies"); buttonOk.Sensitive = false; } UpdateWidgets (); }
void UpdateContentLabels() { PolicySet pset = GetPolicySet(false); tree.SetPolicies(pset); if (tree.HasPolicies) { buttonOk.Sensitive = true; return; } if (pset != null) { tree.Message = GettextCatalog.GetString("The selected policy is empty"); } else if (radioFile.Active) { if (string.IsNullOrEmpty(fileEntry.Path) || !System.IO.File.Exists(fileEntry.Path)) { tree.Message = GettextCatalog.GetString("Please select a valid policy file"); } else { tree.Message = GettextCatalog.GetString("The selected file is not a valid policies file"); } } else { tree.Message = GettextCatalog.GetString("Please select a policy"); } buttonOk.Sensitive = false; }
public ExportProjectPolicyDialog(IPolicyProvider policyProvider) { this.Build(); this.policyProvider = policyProvider; fileEntry.DefaultPath = DefaultFileDialogPolicyDir; if (policyProvider is SolutionItem) { fileEntry.Path = ((SolutionItem)policyProvider).Name + ".mdpolicy"; } else if (policyProvider is Solution) { fileEntry.Path = ((Solution)policyProvider).Name + ".mdpolicy"; } fileEntry.FileFilters.AddFilter(GettextCatalog.GetString("MonoDevelop policy files"), "*.mdpolicy"); fileEntry.FileFilters.AddAllFilesFilter(); fileEntry.PathChanged += delegate { UpdateWidgets(); }; entryName.Changed += delegate { UpdateWidgets(); }; tree = new PoliciesListSummaryTree(); policiesScroll.Add(tree); tree.Show(); tree.SetPolicies(policyProvider.Policies); if (!tree.HasPolicies) { tree.Message = GettextCatalog.GetString("No policies"); buttonOk.Sensitive = false; } UpdateWidgets(); }