diff --git a/AddIns/ICSharpCode.SharpDevelop.addin b/AddIns/ICSharpCode.SharpDevelop.addin index be37193b20..1ef91d239d 100644 --- a/AddIns/ICSharpCode.SharpDevelop.addin +++ b/AddIns/ICSharpCode.SharpDevelop.addin @@ -1906,6 +1906,10 @@ extensions = ".asp,.aspx" resource = "Icons.16x16.ASPFileIcon"/> + + diff --git a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin index 5a0e8bc4bf..1aeb1e5bdb 100644 --- a/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin +++ b/src/AddIns/BackendBindings/CSharpBinding/Project/CSharpBinding.addin @@ -1,7 +1,6 @@ diff --git a/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmBinding.addin b/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmBinding.addin index dd57bc6392..f4ab5ba7a5 100644 --- a/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmBinding.addin +++ b/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmBinding.addin @@ -1,7 +1,6 @@ diff --git a/src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.addin b/src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.addin index 36b92c5159..9266202d93 100644 --- a/src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.addin +++ b/src/AddIns/BackendBindings/VBNetBinding/Project/VBNetBinding.addin @@ -1,7 +1,6 @@ diff --git a/src/AddIns/DisplayBindings/FormDesigner/Project/FormDesigner.addin b/src/AddIns/DisplayBindings/FormDesigner/Project/FormDesigner.addin index 2f0cb9bcf8..2f81219466 100644 --- a/src/AddIns/DisplayBindings/FormDesigner/Project/FormDesigner.addin +++ b/src/AddIns/DisplayBindings/FormDesigner/Project/FormDesigner.addin @@ -1,7 +1,6 @@ diff --git a/src/AddIns/DisplayBindings/ResourceEditor/Project/ResourceEditor.addin b/src/AddIns/DisplayBindings/ResourceEditor/Project/ResourceEditor.addin index cf0928ff96..1e463fd1b2 100644 --- a/src/AddIns/DisplayBindings/ResourceEditor/Project/ResourceEditor.addin +++ b/src/AddIns/DisplayBindings/ResourceEditor/Project/ResourceEditor.addin @@ -1,9 +1,7 @@  + description = "A Display binding for *.resources and *.resx files."> diff --git a/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin b/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin index f716184304..9dd294afca 100644 --- a/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin +++ b/src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin @@ -1,7 +1,6 @@ diff --git a/src/AddIns/Misc/AddInManager/Project/AddInManager.addin b/src/AddIns/Misc/AddInManager/Project/AddInManager.addin index ab33702213..aa7dfabedc 100644 --- a/src/AddIns/Misc/AddInManager/Project/AddInManager.addin +++ b/src/AddIns/Misc/AddInManager/Project/AddInManager.addin @@ -1,7 +1,6 @@  @@ -9,7 +8,9 @@ - + + + @@ -18,4 +19,57 @@ label = "AddIn Manager" class = "ICSharpCode.AddInManager.ShowCommand"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/AddIns/Misc/AddInManager/Project/AddInManager.csproj b/src/AddIns/Misc/AddInManager/Project/AddInManager.csproj index ecff8d7654..dfceeebb12 100644 --- a/src/AddIns/Misc/AddInManager/Project/AddInManager.csproj +++ b/src/AddIns/Misc/AddInManager/Project/AddInManager.csproj @@ -55,6 +55,11 @@ + + + AboutForm.cs + + diff --git a/src/AddIns/Misc/AddInManager/Project/Src/AboutForm.cs b/src/AddIns/Misc/AddInManager/Project/Src/AboutForm.cs new file mode 100644 index 0000000000..1673ca88d9 --- /dev/null +++ b/src/AddIns/Misc/AddInManager/Project/Src/AboutForm.cs @@ -0,0 +1,210 @@ +// +// 2002-2005 AlphaSierraPapa +// GNU General Public License +// +// $Revision$ +// + +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; +using ICSharpCode.Core; + +namespace ICSharpCode.AddInManager +{ + public class AboutForm : System.Windows.Forms.Form + { + Font boldFont; + + public AboutForm(AddIn addIn) + { + // + // The InitializeComponent() call is required for Windows Forms designer support. + // + InitializeComponent(); + + boldFont = new Font(Font, FontStyle.Bold); + + List titles = new List(); + List values = new List(); + + this.Text = addIn.Name; + closeButton.Text = ResourceService.GetString("Global.CloseButtonText"); + + titles.Add("AddIn name"); + values.Add(addIn.Name); + + if (addIn.Manifest.PrimaryVersion != null && addIn.Manifest.PrimaryVersion.ToString() != "0.0.0.0") { + titles.Add("Version"); + values.Add(addIn.Manifest.PrimaryVersion.ToString()); + } + + if (addIn.Properties["author"].Length > 0) { + titles.Add("Author"); + values.Add(addIn.Properties["author"]); + } + + if (addIn.Properties["copyright"].Length > 0) { + titles.Add("Copyright"); + values.Add(addIn.Properties["copyright"]); + } + + if (addIn.Properties["url"].Length > 0) { + titles.Add("Website"); + values.Add(addIn.Properties["url"]); + } + + if (addIn.Properties["description"].Length > 0) { + titles.Add("Description"); + values.Add(addIn.Properties["description"]); + } + + titles.Add("AddIn file"); + values.Add(System.IO.Path.GetFullPath(addIn.FileName)); + + titles.Add("Internal name"); + values.Add(addIn.Manifest.PrimaryIdentity); + + table.RowCount = titles.Count + 1; + table.RowStyles.Clear(); + for (int i = 0; i < titles.Count; i++) { + table.RowStyles.Add(new RowStyle(SizeType.AutoSize)); + AddRow(titles[i], values[i], i); + } + } + + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + if (disposing) { + if (boldFont != null) + boldFont.Dispose(); + } + } + + void AddRow(string desc, string val, int rowIndex) + { + Label descLabel = new Label(); + descLabel.AutoSize = true; + descLabel.Anchor = AnchorStyles.Top | AnchorStyles.Right; + descLabel.Font = boldFont; + descLabel.Text = StringParser.Parse(desc) + ":"; + table.Controls.Add(descLabel, 0, rowIndex); + + Label valLabel; + string link = GetLink(val); + if (link != null) { + LinkLabel linkLabel = new LinkLabel(); + linkLabel.LinkClicked += delegate { + try { + System.Diagnostics.Process.Start(link); + } catch (Exception ex) { + MessageService.ShowMessage(ex.ToString()); + } + }; + valLabel = linkLabel; + } else { + valLabel = new Label(); + } + valLabel.AutoSize = true; + valLabel.Text = val; + table.Controls.Add(valLabel, 1, rowIndex); + } + + string GetLink(string text) + { + switch (text) { + case "GNU General Public License": + case "GPL": + return "http://www.gnu.org/licenses/gpl.html"; + case "LGPL": + case "GNU Lesser General Public License": + return "http://www.gnu.org/licenses/lgpl.html"; + default: + if (text.StartsWith("http://")) + return text; + if (text.StartsWith("www.")) + return "http://" + text; + return null; + } + } + + #region Windows Forms Designer generated code + /// + /// This method is required for Windows Forms designer support. + /// Do not change the method contents inside the source code editor. The Forms designer might + /// not be able to load this method if it was changed manually. + /// + private void InitializeComponent() + { + System.Windows.Forms.Panel bottomPanel; + this.closeButton = new System.Windows.Forms.Button(); + this.table = new System.Windows.Forms.TableLayoutPanel(); + bottomPanel = new System.Windows.Forms.Panel(); + bottomPanel.SuspendLayout(); + this.SuspendLayout(); + // + // bottomPanel + // + bottomPanel.Controls.Add(this.closeButton); + bottomPanel.Dock = System.Windows.Forms.DockStyle.Bottom; + bottomPanel.Location = new System.Drawing.Point(0, 233); + bottomPanel.Name = "bottomPanel"; + bottomPanel.Size = new System.Drawing.Size(351, 35); + bottomPanel.TabIndex = 0; + // + // closeButton + // + this.closeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.closeButton.Location = new System.Drawing.Point(264, 6); + this.closeButton.Name = "closeButton"; + this.closeButton.Size = new System.Drawing.Size(75, 23); + this.closeButton.TabIndex = 0; + this.closeButton.Text = "Close"; + this.closeButton.UseCompatibleTextRendering = true; + this.closeButton.UseVisualStyleBackColor = true; + this.closeButton.Click += new System.EventHandler(this.CloseButtonClick); + // + // table + // + this.table.ColumnCount = 2; + this.table.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); + this.table.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.table.Dock = System.Windows.Forms.DockStyle.Fill; + this.table.Location = new System.Drawing.Point(0, 8); + this.table.Name = "table"; + this.table.RowCount = 2; + this.table.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.table.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.table.Size = new System.Drawing.Size(351, 225); + this.table.TabIndex = 1; + // + // AboutForm + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.SystemColors.Info; + this.ClientSize = new System.Drawing.Size(351, 268); + this.Controls.Add(this.table); + this.Controls.Add(bottomPanel); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "AboutForm"; + this.Padding = new System.Windows.Forms.Padding(0, 8, 0, 0); + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "AboutForm"; + bottomPanel.ResumeLayout(false); + this.ResumeLayout(false); + } + private System.Windows.Forms.Button closeButton; + private System.Windows.Forms.TableLayoutPanel table; + #endregion + + void CloseButtonClick(object sender, EventArgs e) + { + Close(); + } + } +} diff --git a/src/AddIns/Misc/AddInManager/Project/Src/AboutForm.resx b/src/AddIns/Misc/AddInManager/Project/Src/AboutForm.resx new file mode 100644 index 0000000000..168a2f36bd --- /dev/null +++ b/src/AddIns/Misc/AddInManager/Project/Src/AboutForm.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + \ No newline at end of file diff --git a/src/AddIns/Misc/AddInManager/Project/Src/AddInControl.cs b/src/AddIns/Misc/AddInManager/Project/Src/AddInControl.cs index 117a4d7498..62f89477ed 100644 --- a/src/AddIns/Misc/AddInManager/Project/Src/AddInControl.cs +++ b/src/AddIns/Misc/AddInManager/Project/Src/AddInControl.cs @@ -29,6 +29,7 @@ namespace ICSharpCode.AddInManager { this.addIn = addIn; this.BackColor = SystemColors.Window; + this.ContextMenuStrip = MenuService.CreateContextMenu(this, "/AddIns/AddInManager/ContextMenu"); isExternal = !FileUtility.IsBaseDirectory(FileUtility.ApplicationRootPath, addIn.FileName) && !FileUtility.IsBaseDirectory(PropertyService.ConfigDirectory, addIn.FileName); @@ -158,29 +159,29 @@ namespace ICSharpCode.AddInManager return addIn.Properties["description"]; } else { textBrush = SystemBrushes.ActiveCaption; - return "AddIn will be enabled after restarting SharpDevelop"; + return ResourceService.GetString("AddInManager.AddInEnabled"); } case AddInAction.Disable: textBrush = SystemBrushes.GrayText; if (addIn.Enabled) - return "AddIn will be disabled after restarting SharpDevelop"; + return ResourceService.GetString("AddInManager.AddInWillBeDisabled"); else - return "Disabled"; // TODO: Test if it was disabled because of conflict + return ResourceService.GetString("AddInManager.AddInDisabled"); case AddInAction.Install: textBrush = SystemBrushes.ActiveCaption; - return "AddIn will be installed after restarting SharpDevelop"; + return ResourceService.GetString("AddInManager.AddInInstalled"); case AddInAction.Uninstall: textBrush = SystemBrushes.GrayText; - return "AddIn will be removed after restarting SharpDevelop"; + return ResourceService.GetString("AddInManager.AddInRemoved"); case AddInAction.Update: textBrush = SystemBrushes.ActiveCaption; - return "AddIn will be updated after restarting SharpDevelop"; + return ResourceService.GetString("AddInManager.AddInUpdated"); case AddInAction.InstalledTwice: textBrush = Brushes.Red; - return "Duplicate installation"; + return ResourceService.GetString("AddInManager.AddInInstalledTwice"); case AddInAction.DependencyError: textBrush = Brushes.Red; - return "Dependency failed"; + return ResourceService.GetString("AddInManager.AddInDependencyFailed"); default: textBrush = Brushes.Yellow; return addIn.Action.ToString(); diff --git a/src/AddIns/Misc/AddInManager/Project/Src/AddInInstallBinding.cs b/src/AddIns/Misc/AddInManager/Project/Src/AddInInstallBinding.cs new file mode 100644 index 0000000000..ff59752538 --- /dev/null +++ b/src/AddIns/Misc/AddInManager/Project/Src/AddInInstallBinding.cs @@ -0,0 +1,37 @@ +// +// 2002-2005 AlphaSierraPapa +// GNU General Public License +// +// $Revision$ +// + +using System; +using ICSharpCode.Core; + +namespace ICSharpCode.AddInManager +{ + public class AddInInstallBinding : IDisplayBinding + { + public bool CanCreateContentForFile(string fileName) + { + return true; + } + + public ICSharpCode.SharpDevelop.Gui.IViewContent CreateContentForFile(string fileName) + { + ManagerForm.ShowForm(); + ManagerForm.Instance.ShowInstallableAddIns(new string[] { fileName }); + return null; + } + + public bool CanCreateContentForLanguage(string languageName) + { + return false; + } + + public ICSharpCode.SharpDevelop.Gui.IViewContent CreateContentForLanguage(string languageName, string content) + { + throw new NotImplementedException(); + } + } +} diff --git a/src/AddIns/Misc/AddInManager/Project/Src/Commands.cs b/src/AddIns/Misc/AddInManager/Project/Src/Commands.cs index f77e8f9986..eddb1debdd 100644 --- a/src/AddIns/Misc/AddInManager/Project/Src/Commands.cs +++ b/src/AddIns/Misc/AddInManager/Project/Src/Commands.cs @@ -6,6 +6,9 @@ // using System; +using System.Collections.Generic; +using System.Drawing; +using System.Windows.Forms; using ICSharpCode.Core; namespace ICSharpCode.AddInManager @@ -17,4 +20,113 @@ namespace ICSharpCode.AddInManager ManagerForm.ShowForm(); } } + + public class AddInManagerAddInStateConditionEvaluator : IConditionEvaluator + { + public bool IsValid(object caller, Condition condition) + { + string states = condition.Properties["states"]; + string action = ((AddInControl)caller).AddIn.Action.ToString(); + foreach (string state in states.Split(',')) { + if (state == action) + return true; + } + return false; + } + } + + public class DisableCommand : AbstractMenuCommand + { + public override void Run() + { + ManagerForm.Instance.TryRunAction(((AddInControl)Owner).AddIn, AddInAction.Disable); + } + } + + public class EnableCommand : AbstractMenuCommand + { + public override void Run() + { + ManagerForm.Instance.TryRunAction(((AddInControl)Owner).AddIn, AddInAction.Enable); + } + } + + public class AbortInstallCommand : AbstractMenuCommand + { + public override void Run() + { + ManagerForm.Instance.TryRunAction(((AddInControl)Owner).AddIn, AddInAction.Uninstall); + } + } + + public class AbortUpdateCommand : AbstractMenuCommand + { + public override void Run() + { + ManagerForm.Instance.TryRunAction(((AddInControl)Owner).AddIn, AddInAction.InstalledTwice); + } + } + + public class UninstallCommand : AbstractMenuCommand + { + public override void Run() + { + ManagerForm.Instance.TryUninstall(((AddInControl)Owner).AddIn); + } + } + + public class OpenHomepageCommand : AbstractMenuCommand + { + public override bool IsEnabled { + get { + return ((AddInControl)Owner).AddIn.Properties["url"].Length > 0; + } + } + + public override void Run() + { + FileService.OpenFile(((AddInControl)Owner).AddIn.Properties["url"]); + ManagerForm.Instance.Close(); + } + } + + public class AboutCommand : AbstractMenuCommand + { + public override void Run() + { + using (AboutForm form = new AboutForm(((AddInControl)Owner).AddIn)) { + form.ShowDialog(ManagerForm.Instance); + } + } + } + + public class OptionsCommand : AbstractMenuCommand + { + public override bool IsEnabled { + get { + AddIn addIn = ((AddInControl)Owner).AddIn; + if (addIn.Enabled) { + foreach (KeyValuePair pair in addIn.Paths) { + if (pair.Key.StartsWith("/SharpDevelop/Dialogs/OptionsDialog")) { + return true; + } + } + } + return false; + } + } + + public override void Run() + { + AddIn addIn = ((AddInControl)Owner).AddIn; + AddInTreeNode dummyNode = new AddInTreeNode(); + foreach (KeyValuePair pair in addIn.Paths) { + if (pair.Key.StartsWith("/SharpDevelop/Dialogs/OptionsDialog")) { + dummyNode.Codons.AddRange(pair.Value.Codons); + } + } + ICSharpCode.SharpDevelop.Commands.OptionsCommand.ShowTabbedOptions(addIn.Name + " " + ResourceService.GetString("AddInManager.Options"), + dummyNode); + } + } } diff --git a/src/AddIns/Misc/AddInManager/Project/Src/ManagerForm.cs b/src/AddIns/Misc/AddInManager/Project/Src/ManagerForm.cs index d466fba2c0..e6b7c9a603 100644 --- a/src/AddIns/Misc/AddInManager/Project/Src/ManagerForm.cs +++ b/src/AddIns/Misc/AddInManager/Project/Src/ManagerForm.cs @@ -50,6 +50,10 @@ namespace ICSharpCode.AddInManager ICSharpCode.SharpDevelop.Gui.FormLocationHelper.Apply(this, "AddInManager.WindowBounds", true); #endif + actionFlowLayoutPanel.BackgroundImage = ResourceService.GetBitmap("GeneralWizardBackground"); + installButton.Text = ResourceService.GetString("AddInManager.InstallButton"); + uninstallButton.Text = ResourceService.GetString("AddInManager.ActionUninstall"); + closeButton.Text = ResourceService.GetString("Global.CloseButtonText"); CreateAddInList(); } @@ -59,10 +63,8 @@ namespace ICSharpCode.AddInManager Rectangle rect = splitContainer.Panel1.ClientRectangle; rect.Offset(16, 16); rect.Inflate(-32, -32); - e.Graphics.DrawString("You don't have any AddIns installed.\n" + - "Download an AddIn from the Internet, then click 'Install AddIn' and " + - "choose the downloaded file to install it.", - Font, SystemBrushes.ControlText, rect); + e.Graphics.DrawString(ResourceService.GetString("AddInManager.NoAddInsInstalled"), + Font, SystemBrushes.WindowText, rect); } } @@ -222,39 +224,39 @@ namespace ICSharpCode.AddInManager } if (allEnabled) { selectedAction = AddInAction.Disable; - actionGroupBox.Text = runActionButton.Text = "Disable"; - actionDescription.Text = "Disables the selected AddIns."; + actionGroupBox.Text = runActionButton.Text = ResourceService.GetString("AddInManager.ActionDisable"); + actionDescription.Text = ResourceService.GetString("AddInManager.DescriptionDisable"); runActionButton.Enabled = ShowDependencies(selected, ShowDependencyMode.Disable); uninstallButton.Enabled = allUninstallable && runActionButton.Enabled; } else if (allDisabled) { selectedAction = AddInAction.Enable; - actionGroupBox.Text = runActionButton.Text = "Enable"; - actionDescription.Text = "Enables the selected AddIns."; + actionGroupBox.Text = runActionButton.Text = ResourceService.GetString("AddInManager.ActionEnable"); + actionDescription.Text = ResourceService.GetString("AddInManager.DescriptionEnable"); runActionButton.Enabled = ShowDependencies(selected, ShowDependencyMode.Enable); if (hasErrors) runActionButton.Enabled = false; uninstallButton.Enabled = allUninstallable; } else if (allInstalling) { selectedAction = AddInAction.Uninstall; - actionGroupBox.Text = runActionButton.Text = "Cancel installation"; - actionDescription.Text = "Aborts the installation of the selected AddIns."; + actionGroupBox.Text = runActionButton.Text = ResourceService.GetString("AddInManager.ActionCancelInstallation"); + actionDescription.Text = ResourceService.GetString("AddInManager.DescriptionCancelInstall"); runActionButton.Enabled = ShowDependencies(selected, ShowDependencyMode.Disable); uninstallButton.Visible = false; } else if (allUninstalling) { selectedAction = AddInAction.Enable; - actionGroupBox.Text = runActionButton.Text = "Cancel deinstallation"; - actionDescription.Text = "Aborts the deinstallation of the selected AddIns."; + actionGroupBox.Text = runActionButton.Text = ResourceService.GetString("AddInManager.ActionCancelDeinstallation"); + actionDescription.Text = ResourceService.GetString("AddInManager.DescriptionCancelDeinstallation"); runActionButton.Enabled = ShowDependencies(selected, ShowDependencyMode.Enable); uninstallButton.Visible = false; } else if (allUpdating) { selectedAction = AddInAction.InstalledTwice; - actionGroupBox.Text = runActionButton.Text = "Cancel update"; - actionDescription.Text = "Aborts the update of the selected AddIns."; + actionGroupBox.Text = runActionButton.Text = ResourceService.GetString("AddInManager.ActionCancelUpdate"); + actionDescription.Text = ResourceService.GetString("AddInManager.DescriptionCancelUpdate"); runActionButton.Enabled = ShowDependencies(selected, ShowDependencyMode.CancelUpdate); uninstallButton.Visible = false; } else { actionGroupBox.Text = ""; - actionDescription.Text = "AddIns with multiple states are selected"; + actionDescription.Text = ResourceService.GetString("AddInManager.DescriptionInconsistentSelection"); runActionButton.Visible = false; uninstallButton.Visible = false; } @@ -340,14 +342,14 @@ namespace ICSharpCode.AddInManager } int rowIndex = 0; if (dependencies.Count > 0) { - AddLabelRow(rowIndex++, "Required dependencies:"); + AddLabelRow(rowIndex++, ResourceService.GetString("AddInManager.RequiredDependencies")); foreach (AddInReference dep in dependencies) { if (!AddDependencyRow(addInDict, dep, rowIndex++, null)) allDepenciesOK = false; } } if (dependenciesToSel.Count > 0) { - AddLabelRow(rowIndex++, "AddIns are required by:"); + AddLabelRow(rowIndex++, ResourceService.GetString("AddInManager.RequiredBy")); foreach (KeyValuePair pair in dependenciesToSel) { if (!AddDependencyRow(addInDict, pair.Value, rowIndex++, pair.Key.Name)) allDepenciesOK = false; @@ -399,7 +401,7 @@ namespace ICSharpCode.AddInManager void InstallButtonClick(object sender, EventArgs e) { using (OpenFileDialog dlg = new OpenFileDialog()) { - dlg.Filter = "SharpDevelop AddIns|*.addin;*.sdaddin|All files|*.*"; + dlg.Filter = ResourceService.GetString("AddInManager.FileFilter"); dlg.Multiselect = true; if (dlg.ShowDialog() == DialogResult.OK) { if (ShowInstallableAddIns(dlg.FileNames)) { @@ -410,7 +412,7 @@ namespace ICSharpCode.AddInManager } } - bool ShowInstallableAddIns(IEnumerable fileNames) + public bool ShowInstallableAddIns(IEnumerable fileNames) { foreach (AddInControl ctl in splitContainer.Panel1.Controls) { ctl.Selected = false; @@ -478,12 +480,16 @@ namespace ICSharpCode.AddInManager } } - if (updateAddIns.Count == 0) - actionGroupBox.Text = runActionButton.Text = "Install"; - else if (installAddIns.Count == 0) - actionGroupBox.Text = runActionButton.Text = "Update"; - else - actionGroupBox.Text = runActionButton.Text = "Install + Update"; + if (updateAddIns.Count == 0) { + actionGroupBox.Text = runActionButton.Text = ResourceService.GetString("AddInManager.ActionInstall"); + } else if (installAddIns.Count == 0) { + actionGroupBox.Text = runActionButton.Text = ResourceService.GetString("AddInManager.ActionUpdate"); + } else { + actionGroupBox.Text = runActionButton.Text = + ResourceService.GetString("AddInManager.ActionInstall") + + " + " + + ResourceService.GetString("AddInManager.ActionUpdate"); + } List addInList = new List(); StringBuilder b = new StringBuilder(); if (installAddIns.Count == 1) { @@ -591,6 +597,26 @@ namespace ICSharpCode.AddInManager instance = null; } + public void TryRunAction(AddIn addIn, AddInAction action) + { + foreach (AddInControl ctl in splitContainer.Panel1.Controls) { + ctl.Selected = ctl.AddIn == addIn; + } + UpdateActionBox(); + if (selectedAction == action && runActionButton.Visible && runActionButton.Enabled) + runActionButton.PerformClick(); + } + + public void TryUninstall(AddIn addIn) + { + foreach (AddInControl ctl in splitContainer.Panel1.Controls) { + ctl.Selected = ctl.AddIn == addIn; + } + UpdateActionBox(); + if (uninstallButton.Visible && uninstallButton.Enabled) + uninstallButton.PerformClick(); + } + void RunActionButtonClick(object sender, EventArgs e) { switch (selectedAction) { @@ -708,6 +734,7 @@ namespace ICSharpCode.AddInManager // // splitContainer // + this.splitContainer.BackColor = System.Drawing.SystemColors.Window; this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2; this.splitContainer.Location = new System.Drawing.Point(0, 33); @@ -717,7 +744,6 @@ namespace ICSharpCode.AddInManager // this.splitContainer.Panel1.AllowDrop = true; this.splitContainer.Panel1.AutoScroll = true; - this.splitContainer.Panel1.BackColor = System.Drawing.SystemColors.Window; this.splitContainer.Panel1.DragDrop += new System.Windows.Forms.DragEventHandler(this.Panel1DragDrop); this.splitContainer.Panel1.DragEnter += new System.Windows.Forms.DragEventHandler(this.Panel1DragEnter); this.splitContainer.Panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.OnSplitContainerPanel1Paint); @@ -752,6 +778,7 @@ namespace ICSharpCode.AddInManager this.actionFlowLayoutPanel.Controls.Add(this.uninstallButton); this.actionFlowLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; this.actionFlowLayoutPanel.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; + this.actionFlowLayoutPanel.ForeColor = System.Drawing.SystemColors.WindowText; this.actionFlowLayoutPanel.Location = new System.Drawing.Point(3, 17); this.actionFlowLayoutPanel.Name = "actionFlowLayoutPanel"; this.actionFlowLayoutPanel.Size = new System.Drawing.Size(202, 302); @@ -870,7 +897,5 @@ namespace ICSharpCode.AddInManager private System.Windows.Forms.Panel bottomPanel; private System.Windows.Forms.Panel topPanel; #endregion - - } } diff --git a/src/AddIns/Misc/FiletypeRegisterer/Project/FiletypeRegisterer.addin b/src/AddIns/Misc/FiletypeRegisterer/Project/FiletypeRegisterer.addin index 0de8e79e81..117ba7604c 100644 --- a/src/AddIns/Misc/FiletypeRegisterer/Project/FiletypeRegisterer.addin +++ b/src/AddIns/Misc/FiletypeRegisterer/Project/FiletypeRegisterer.addin @@ -1,7 +1,6 @@ diff --git a/src/AddIns/Misc/FiletypeRegisterer/Project/FiletypeRegisterer.csproj b/src/AddIns/Misc/FiletypeRegisterer/Project/FiletypeRegisterer.csproj index 150447767d..5e481257f7 100644 --- a/src/AddIns/Misc/FiletypeRegisterer/Project/FiletypeRegisterer.csproj +++ b/src/AddIns/Misc/FiletypeRegisterer/Project/FiletypeRegisterer.csproj @@ -80,6 +80,9 @@ False + + Always + \ No newline at end of file diff --git a/src/AddIns/Misc/FiletypeRegisterer/Project/filetypes/Filetypes.xml b/src/AddIns/Misc/FiletypeRegisterer/Project/filetypes/Filetypes.xml index 53b6652ee7..8861655dbb 100644 --- a/src/AddIns/Misc/FiletypeRegisterer/Project/filetypes/Filetypes.xml +++ b/src/AddIns/Misc/FiletypeRegisterer/Project/filetypes/Filetypes.xml @@ -6,6 +6,7 @@ C# ${res:ICSharpCode.FiletypeRegisterer.Project} VB ${res:ICSharpCode.FiletypeRegisterer.Project} Boo ${res:ICSharpCode.FiletypeRegisterer.Project} + SharpDevelop ${res:AddInManager.FileAssociation} ${res:ICSharpCode.FiletypeRegisterer.CSharpSourceFileAssozisation} ${res:ICSharpCode.FiletypeRegisterer.VBNetSourceFileAssozisation} diff --git a/src/AddIns/Misc/FiletypeRegisterer/Project/filetypes/addin.ico b/src/AddIns/Misc/FiletypeRegisterer/Project/filetypes/addin.ico new file mode 100644 index 0000000000..083a0987b4 Binary files /dev/null and b/src/AddIns/Misc/FiletypeRegisterer/Project/filetypes/addin.ico differ diff --git a/src/AddIns/Misc/HighlightingEditor/Project/HighlightingEditor.addin b/src/AddIns/Misc/HighlightingEditor/Project/HighlightingEditor.addin index 2e600f3072..bbf705e381 100644 --- a/src/AddIns/Misc/HighlightingEditor/Project/HighlightingEditor.addin +++ b/src/AddIns/Misc/HighlightingEditor/Project/HighlightingEditor.addin @@ -1,7 +1,6 @@ diff --git a/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.addin b/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.addin index d53628b5c3..53f95229d9 100644 --- a/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.addin +++ b/src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.addin @@ -1,7 +1,6 @@ diff --git a/src/AddIns/Misc/MbUnitPad/Project/MbUnitPad.addin b/src/AddIns/Misc/MbUnitPad/Project/MbUnitPad.addin index c20f99ce04..799960d7c4 100644 --- a/src/AddIns/Misc/MbUnitPad/Project/MbUnitPad.addin +++ b/src/AddIns/Misc/MbUnitPad/Project/MbUnitPad.addin @@ -1,7 +1,6 @@ diff --git a/src/AddIns/Misc/NAntAddIn/Project/NAnt.addin b/src/AddIns/Misc/NAntAddIn/Project/NAnt.addin index 688a197b3b..d39d3d2b28 100644 --- a/src/AddIns/Misc/NAntAddIn/Project/NAnt.addin +++ b/src/AddIns/Misc/NAntAddIn/Project/NAnt.addin @@ -1,7 +1,6 @@ diff --git a/src/AddIns/Misc/RegExpTk/Project/RegExpTk.addin b/src/AddIns/Misc/RegExpTk/Project/RegExpTk.addin index e9282174bb..370d478752 100644 --- a/src/AddIns/Misc/RegExpTk/Project/RegExpTk.addin +++ b/src/AddIns/Misc/RegExpTk/Project/RegExpTk.addin @@ -1,9 +1,7 @@ + description = "Testing toolkit for regular expressions"> diff --git a/src/AddIns/Misc/StartPage/Project/StartPage.addin b/src/AddIns/Misc/StartPage/Project/StartPage.addin index 08035b5368..4ed7c62725 100644 --- a/src/AddIns/Misc/StartPage/Project/StartPage.addin +++ b/src/AddIns/Misc/StartPage/Project/StartPage.addin @@ -1,7 +1,6 @@ diff --git a/src/AddIns/Misc/SubversionAddIn/Project/ICSharpCode.Svn.addin b/src/AddIns/Misc/SubversionAddIn/Project/ICSharpCode.Svn.addin index 8fe98a926c..625bef7483 100644 --- a/src/AddIns/Misc/SubversionAddIn/Project/ICSharpCode.Svn.addin +++ b/src/AddIns/Misc/SubversionAddIn/Project/ICSharpCode.Svn.addin @@ -1,7 +1,6 @@ diff --git a/src/Main/Base/Project/Src/Commands/ToolsCommands.cs b/src/Main/Base/Project/Src/Commands/ToolsCommands.cs index cb293a8174..ef6927edfe 100644 --- a/src/Main/Base/Project/Src/Commands/ToolsCommands.cs +++ b/src/Main/Base/Project/Src/Commands/ToolsCommands.cs @@ -17,6 +17,18 @@ namespace ICSharpCode.SharpDevelop.Commands { public class OptionsCommand : AbstractMenuCommand { + public static void ShowTabbedOptions(string dialogTitle, AddInTreeNode node) + { + TabbedOptions o = new TabbedOptions(dialogTitle, + ((Properties)PropertyService.Get("ICSharpCode.TextEditor.Document.Document.DefaultDocumentAggregatorProperties", new Properties())), + node); + o.Width = 450; + o.Height = 425; + o.FormBorderStyle = FormBorderStyle.FixedDialog; + o.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm); + o.Dispose(); + } + public override void Run() { using (TreeViewOptions optionsDialog = new TreeViewOptions((Properties)PropertyService.Get("ICSharpCode.TextEditor.Document.Document.DefaultDocumentAggregatorProperties", new Properties()), diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/Wizard/CurrentPanelPanel.cs b/src/Main/Base/Project/Src/Gui/Dialogs/Wizard/CurrentPanelPanel.cs index afe2667ea2..2fadeb40f5 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/Wizard/CurrentPanelPanel.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/Wizard/CurrentPanelPanel.cs @@ -21,7 +21,6 @@ namespace ICSharpCode.SharpDevelop.Gui public class CurrentPanelPanel : UserControl { WizardDialog wizard; - Bitmap backGround = null; Font normalFont; @@ -31,7 +30,6 @@ namespace ICSharpCode.SharpDevelop.Gui normalFont = ResourceService.LoadFont("SansSerif", 18, GraphicsUnit.World); this.wizard = wizard; - backGround = ResourceService.GetBitmap("GeneralWizardBackground"); Size = new Size(wizard.Width - 220, 30); ResizeRedraw = false; diff --git a/src/Main/Base/Project/Src/Gui/Dialogs/Wizard/StatusPanel.cs b/src/Main/Base/Project/Src/Gui/Dialogs/Wizard/StatusPanel.cs index e23560fe5e..18717cfc3c 100644 --- a/src/Main/Base/Project/Src/Gui/Dialogs/Wizard/StatusPanel.cs +++ b/src/Main/Base/Project/Src/Gui/Dialogs/Wizard/StatusPanel.cs @@ -21,13 +21,11 @@ namespace ICSharpCode.SharpDevelop.Gui public class StatusPanel : UserControl { WizardDialog wizard; - Bitmap backGround = null; Font smallFont; Font normalFont; Font boldFont; - public StatusPanel(WizardDialog wizard) { smallFont = ResourceService.LoadFont("Tahoma", 14, GraphicsUnit.World); @@ -35,24 +33,15 @@ namespace ICSharpCode.SharpDevelop.Gui boldFont = ResourceService.LoadFont("Tahoma", 14, FontStyle.Bold, GraphicsUnit.World); this.wizard = wizard; - backGround = ResourceService.GetBitmap("GeneralWizardBackground"); + this.BackgroundImage = ResourceService.GetBitmap("GeneralWizardBackground"); Size = new Size(198, 400); ResizeRedraw = false; - // SetStyle(ControlStyles.UserPaint, true); + SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.OptimizedDoubleBuffer, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); } - protected override void OnPaintBackground(PaintEventArgs pe) - { - // base.OnPaintBackground(pe); - if (backGround != null) { - Graphics g = pe.Graphics; - g.DrawImage(backGround, 0, 0, Width, Height); - } - } - protected override void OnPaint(PaintEventArgs pe) { // base.OnPaint(pe); @@ -60,17 +49,17 @@ namespace ICSharpCode.SharpDevelop.Gui g.DrawString(ResourceService.GetString("SharpDevelop.Gui.Dialogs.WizardDialog.StepsLabel"), smallFont, - Brushes.Black, + SystemBrushes.WindowText, 10, 24 - smallFont.Height); - g.DrawLine(Pens.Black, 10, 24, Width - 10, 24); + g.DrawLine(SystemPens.WindowText, 10, 24, Width - 10, 24); int curNumber = 0; for (int i = 0; i < wizard.WizardPanels.Count; i = wizard.GetSuccessorNumber(i)) { Font curFont = wizard.ActivePanelNumber == i ? boldFont : normalFont; IDialogPanelDescriptor descriptor = ((IDialogPanelDescriptor)wizard.WizardPanels[i]); - g.DrawString((1 + curNumber) + ". " + descriptor.Label, curFont, Brushes.Black, 10, 40 + curNumber * curFont.Height); + g.DrawString((1 + curNumber) + ". " + descriptor.Label, curFont, SystemBrushes.WindowText, 10, 40 + curNumber * curFont.Height); ++curNumber; } } diff --git a/src/Main/Base/Project/Src/TextEditor/Commands/TextAreaContextmenuCommands.cs b/src/Main/Base/Project/Src/TextEditor/Commands/TextAreaContextmenuCommands.cs index e6eda56085..b4d784ccfb 100644 --- a/src/Main/Base/Project/Src/TextEditor/Commands/TextAreaContextmenuCommands.cs +++ b/src/Main/Base/Project/Src/TextEditor/Commands/TextAreaContextmenuCommands.cs @@ -21,6 +21,7 @@ using ICSharpCode.TextEditor.Document; using ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor; using ICSharpCode.TextEditor; using ICSharpCode.Core; +using ICSharpCode.SharpDevelop.Commands; namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands { @@ -28,16 +29,8 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands { public override void Run() { - - - TabbedOptions o = new TabbedOptions(ResourceService.GetString("Dialog.Options.BufferOptions"), - ((Properties)PropertyService.Get("ICSharpCode.TextEditor.Document.Document.DefaultDocumentAggregatorProperties", new Properties())), - AddInTree.GetTreeNode("/SharpDevelop/ViewContent/DefaultTextEditor/OptionsDialog")); - o.Width = 450; - o.Height = 425; - o.FormBorderStyle = FormBorderStyle.FixedDialog; - o.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm); - o.Dispose(); + OptionsCommand.ShowTabbedOptions("ShowTabbedOptions", + AddInTree.GetTreeNode("/SharpDevelop/ViewContent/DefaultTextEditor/OptionsDialog")); } } @@ -79,5 +72,5 @@ namespace ICSharpCode.SharpDevelop.DefaultEditor.Commands control.Refresh(); } } - } + } } diff --git a/src/Main/StartUp/Project/Resources/BitmapResources.resources b/src/Main/StartUp/Project/Resources/BitmapResources.resources index a32666715d..cc0c242252 100644 Binary files a/src/Main/StartUp/Project/Resources/BitmapResources.resources and b/src/Main/StartUp/Project/Resources/BitmapResources.resources differ diff --git a/src/Main/StartUp/Project/Resources/StringResources.resources b/src/Main/StartUp/Project/Resources/StringResources.resources index 2cb67dc38b..244737abeb 100644 Binary files a/src/Main/StartUp/Project/Resources/StringResources.resources and b/src/Main/StartUp/Project/Resources/StringResources.resources differ