|
|
@ -47,17 +47,19 @@ namespace ICSharpCode.AddInManager |
|
|
|
ICSharpCode.SharpDevelop.Gui.FormLocationHelper.Apply(this, "AddInManager.WindowBounds", true); |
|
|
|
ICSharpCode.SharpDevelop.Gui.FormLocationHelper.Apply(this, "AddInManager.WindowBounds", true); |
|
|
|
|
|
|
|
|
|
|
|
CreateAddInList(); |
|
|
|
CreateAddInList(); |
|
|
|
splitContainer.Panel1.Paint += delegate(object sender, PaintEventArgs e) { |
|
|
|
} |
|
|
|
if (visibleAddInCount == 0) { |
|
|
|
|
|
|
|
Rectangle rect = splitContainer.Panel1.ClientRectangle; |
|
|
|
void OnSplitContainerPanel1Paint(object sender, PaintEventArgs e) |
|
|
|
rect.Offset(16, 16); |
|
|
|
{ |
|
|
|
rect.Inflate(-32, -32); |
|
|
|
if (visibleAddInCount == 0) { |
|
|
|
e.Graphics.DrawString("You don't have any AddIns installed.\n" + |
|
|
|
Rectangle rect = splitContainer.Panel1.ClientRectangle; |
|
|
|
"Download an AddIn from the Internet, then click 'Install AddIn' and " + |
|
|
|
rect.Offset(16, 16); |
|
|
|
"choose the downloaded file to install it.", |
|
|
|
rect.Inflate(-32, -32); |
|
|
|
Font, SystemBrushes.ControlText, rect); |
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void CreateAddInList() |
|
|
|
void CreateAddInList() |
|
|
@ -189,8 +191,6 @@ namespace ICSharpCode.AddInManager |
|
|
|
splitContainer.Panel2Collapsed = selected.Count == 0; |
|
|
|
splitContainer.Panel2Collapsed = selected.Count == 0; |
|
|
|
if (selected.Count > 0) { |
|
|
|
if (selected.Count > 0) { |
|
|
|
dependencyTable.Visible = false; |
|
|
|
dependencyTable.Visible = false; |
|
|
|
uninstallButton.Enabled = false; |
|
|
|
|
|
|
|
runActionButton.Enabled = false; |
|
|
|
|
|
|
|
runActionButton.Visible = true; |
|
|
|
runActionButton.Visible = true; |
|
|
|
uninstallButton.Visible = true; |
|
|
|
uninstallButton.Visible = true; |
|
|
|
|
|
|
|
|
|
|
@ -199,9 +199,13 @@ namespace ICSharpCode.AddInManager |
|
|
|
bool allInstalling = true; |
|
|
|
bool allInstalling = true; |
|
|
|
bool allUninstalling = true; |
|
|
|
bool allUninstalling = true; |
|
|
|
bool allUninstallable = true; |
|
|
|
bool allUninstallable = true; |
|
|
|
|
|
|
|
bool hasErrors = false; |
|
|
|
foreach (AddIn addIn in selected) { |
|
|
|
foreach (AddIn addIn in selected) { |
|
|
|
allEnabled &= addIn.Action == AddInAction.Enable; |
|
|
|
allEnabled &= addIn.Action == AddInAction.Enable; |
|
|
|
allDisabled &= addIn.Action == AddInAction.Disable; |
|
|
|
if (addIn.Action == AddInAction.DependencyError || addIn.Action == AddInAction.InstalledTwice) |
|
|
|
|
|
|
|
hasErrors = true; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
allDisabled &= addIn.Action == AddInAction.Disable; |
|
|
|
allInstalling &= addIn.Action == AddInAction.Install; |
|
|
|
allInstalling &= addIn.Action == AddInAction.Install; |
|
|
|
allUninstalling &= addIn.Action == AddInAction.Uninstall; |
|
|
|
allUninstalling &= addIn.Action == AddInAction.Uninstall; |
|
|
|
if (allUninstallable) { |
|
|
|
if (allUninstallable) { |
|
|
@ -221,6 +225,8 @@ namespace ICSharpCode.AddInManager |
|
|
|
actionGroupBox.Text = runActionButton.Text = "Enable"; |
|
|
|
actionGroupBox.Text = runActionButton.Text = "Enable"; |
|
|
|
actionDescription.Text = "Enables the selected AddIns."; |
|
|
|
actionDescription.Text = "Enables the selected AddIns."; |
|
|
|
runActionButton.Enabled = ShowDependencies(selected, true); |
|
|
|
runActionButton.Enabled = ShowDependencies(selected, true); |
|
|
|
|
|
|
|
if (hasErrors) |
|
|
|
|
|
|
|
runActionButton.Enabled = false; |
|
|
|
uninstallButton.Enabled = allUninstallable; |
|
|
|
uninstallButton.Enabled = allUninstallable; |
|
|
|
} else if (allInstalling) { |
|
|
|
} else if (allInstalling) { |
|
|
|
selectedAction = AddInAction.Uninstall; |
|
|
|
selectedAction = AddInAction.Uninstall; |
|
|
@ -443,7 +449,7 @@ namespace ICSharpCode.AddInManager |
|
|
|
void UninstallButtonClick(object sender, EventArgs e) |
|
|
|
void UninstallButtonClick(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ICSharpCode.Core.AddInManager.RemoveExternalAddIns(selected); |
|
|
|
ICSharpCode.Core.AddInManager.RemoveExternalAddIns(selected); |
|
|
|
// TODO: delete user addins
|
|
|
|
InstallableAddIn.Uninstall(selected); |
|
|
|
RefreshAddInList(); |
|
|
|
RefreshAddInList(); |
|
|
|
} |
|
|
|
} |
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
@ -461,21 +467,25 @@ namespace ICSharpCode.AddInManager |
|
|
|
|
|
|
|
|
|
|
|
void RunActionButtonClick(object sender, EventArgs e) |
|
|
|
void RunActionButtonClick(object sender, EventArgs e) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (selectedAction == AddInAction.Disable) { |
|
|
|
switch (selectedAction) { |
|
|
|
ICSharpCode.Core.AddInManager.Disable(selected); |
|
|
|
case AddInAction.Disable: |
|
|
|
} else if (selectedAction == AddInAction.Enable) { |
|
|
|
ICSharpCode.Core.AddInManager.Disable(selected); |
|
|
|
ICSharpCode.Core.AddInManager.Enable(selected); |
|
|
|
break; |
|
|
|
} else if (selectedAction == AddInAction.Install) { |
|
|
|
case AddInAction.Enable: |
|
|
|
// install new AddIns
|
|
|
|
ICSharpCode.Core.AddInManager.Enable(selected); |
|
|
|
foreach (InstallableAddIn addInPackage in shownAddInPackages) { |
|
|
|
break; |
|
|
|
addInPackage.Install(); |
|
|
|
case AddInAction.Install: |
|
|
|
} |
|
|
|
// install new AddIns
|
|
|
|
RefreshAddInList(); |
|
|
|
foreach (InstallableAddIn addInPackage in shownAddInPackages) { |
|
|
|
} else if (selectedAction == AddInAction.Uninstall) { |
|
|
|
addInPackage.Install(); |
|
|
|
UninstallButtonClick(sender, e); |
|
|
|
} |
|
|
|
return; |
|
|
|
RefreshAddInList(); |
|
|
|
} else { |
|
|
|
return; |
|
|
|
throw new NotImplementedException(); |
|
|
|
case AddInAction.Uninstall: |
|
|
|
|
|
|
|
UninstallButtonClick(sender, e); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
throw new NotImplementedException(); |
|
|
|
} |
|
|
|
} |
|
|
|
foreach (AddInControl ctl in splitContainer.Panel1.Controls) { |
|
|
|
foreach (AddInControl ctl in splitContainer.Panel1.Controls) { |
|
|
|
ctl.Invalidate(); |
|
|
|
ctl.Invalidate(); |
|
|
@ -579,6 +589,7 @@ namespace ICSharpCode.AddInManager |
|
|
|
//
|
|
|
|
//
|
|
|
|
this.splitContainer.Panel1.AutoScroll = true; |
|
|
|
this.splitContainer.Panel1.AutoScroll = true; |
|
|
|
this.splitContainer.Panel1.BackColor = System.Drawing.SystemColors.Window; |
|
|
|
this.splitContainer.Panel1.BackColor = System.Drawing.SystemColors.Window; |
|
|
|
|
|
|
|
this.splitContainer.Panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.OnSplitContainerPanel1Paint); |
|
|
|
this.splitContainer.Panel1MinSize = 100; |
|
|
|
this.splitContainer.Panel1MinSize = 100; |
|
|
|
//
|
|
|
|
//
|
|
|
|
// splitContainer.Panel2
|
|
|
|
// splitContainer.Panel2
|
|
|
|