Skip to content

Commit b373794

Browse files
committed
Revert "docking UI for source control."
This reverts commit f71cb70.
1 parent 3fe0070 commit b373794

10 files changed

+22
-54
lines changed

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@
204204
<DependentUpon>ExtractMethodDialog.cs</DependentUpon>
205205
</Compile>
206206
<Compile Include="UI\Refactorings\ExtractMethod\ValueChangedEventArgs.cs" />
207-
<Compile Include="UI\SourceControl\GitHubSourceControlDockablePresenter.cs" />
208207
<Compile Include="UI\SourceControl\SourceControlPanel.cs">
209208
<SubType>UserControl</SubType>
210209
</Compile>

RetailCoder.VBE/UI/CodeInspections/CodeInspectionsDockablePresenter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class CodeInspectionsDockablePresenter : DockablePresenterBase
1313
private CodeInspectionsWindow Control { get { return UserControl as CodeInspectionsWindow; } }
1414

1515
private IList<ICodeInspectionResult> _results;
16-
private readonly IInspector _inspector;
16+
private IInspector _inspector;
1717

1818
public CodeInspectionsDockablePresenter(IInspector inspector, VBE vbe, AddIn addin, CodeInspectionsWindow window)
1919
:base(vbe, addin, window)

RetailCoder.VBE/UI/CodeInspections/CodeInspectionsMenu.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,20 @@ namespace Rubberduck.UI.CodeInspections
1111
{
1212
public class CodeInspectionsMenu : Menu
1313
{
14-
private readonly CodeInspectionsDockablePresenter _presenter; //if presenter goes out of scope, so does its toolwindow Issue #169
14+
private CommandBarButton _codeInspectionsButton;
15+
private readonly CodeInspectionsWindow _window;
16+
private readonly CodeInspectionsDockablePresenter _presenter; //if presenter goes out of scope, so does it's toolwindow Issue #169
1517

16-
public CodeInspectionsMenu(VBE vbe, AddIn addIn, CodeInspectionsDockablePresenter presenter)
18+
public CodeInspectionsMenu(VBE vbe, AddIn addIn, CodeInspectionsWindow view, CodeInspectionsDockablePresenter presenter)
1719
:base(vbe, addIn)
1820
{
21+
_window = view;
1922
_presenter = presenter;
2023
}
2124

2225
public void Initialize(CommandBarPopup parentMenu)
2326
{
24-
AddButton(parentMenu, "Code &Inspections", false, new CommandBarButtonClickEvent(OnCodeInspectionsButtonClick));
27+
_codeInspectionsButton = AddButton(parentMenu, "Code &Inspections", false, new CommandBarButtonClickEvent(OnCodeInspectionsButtonClick));
2528
}
2629

2730
private void OnCodeInspectionsButtonClick(CommandBarButton ctrl, ref bool canceldefault)

RetailCoder.VBE/UI/DockablePresenterBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ public abstract class DockablePresenterBase : IDisposable
1111
private Window _window;
1212
protected readonly UserControl UserControl;
1313

14-
protected DockablePresenterBase(VBE vbe, AddIn addin, IDockableUserControl window)
14+
protected DockablePresenterBase(VBE vbe, AddIn addin, IDockableUserControl control)
1515
{
1616
_vbe = vbe;
1717
_addin = addin;
18-
UserControl = window as UserControl;
19-
_window = CreateToolWindow(window);
18+
UserControl = control as UserControl;
19+
_window = CreateToolWindow(control);
2020
}
2121

2222
private readonly VBE _vbe;

RetailCoder.VBE/UI/RubberduckMenu.cs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ public class RubberduckMenu : Menu
2424
private readonly RefactorMenu _refactorMenu;
2525
private readonly IConfigurationService _configService;
2626

27-
private DockablePresenterBase _sourceControlPresenter;
28-
2927
public RubberduckMenu(VBE vbe, AddIn addIn, IConfigurationService configService, IRubberduckParser parser, IInspector inspector)
3028
: base(vbe, addIn)
3129
{
@@ -47,10 +45,7 @@ public RubberduckMenu(VBE vbe, AddIn addIn, IConfigurationService configService,
4745

4846
var inspectionExplorer = new CodeInspectionsWindow();
4947
var inspectionPresenter = new CodeInspectionsDockablePresenter(inspector, vbe, addIn, inspectionExplorer);
50-
_codeInspectionsMenu = new CodeInspectionsMenu(vbe, addIn, inspectionPresenter);
51-
52-
var sourceControlPanel = new SourceControlPanel();
53-
_sourceControlPresenter = new GitHubSourceControlDockablePresenter(vbe, addIn, sourceControlPanel);
48+
_codeInspectionsMenu = new CodeInspectionsMenu(vbe, addIn, inspectionExplorer, inspectionPresenter);
5449

5550
_refactorMenu = new RefactorMenu(IDE, addInInstance, parser);
5651
}
@@ -76,7 +71,7 @@ public void Initialize()
7671
_codeInspectionsMenu.Initialize(menu);
7772

7873
//note: disabled for 1.2 release
79-
//_sourceControl = AddButton(menu, "Source Control", false, OnSourceControlClick);
74+
//_sourceControl = AddButton(menu, "Source Control", false, new CommandBarButtonClickEvent(OnSourceControlClick));
8075

8176
_settings = AddButton(menu, "&Options", true, OnOptionsClick);
8277
_about = AddButton(menu, "&About...", true, OnAboutClick);
@@ -85,7 +80,10 @@ public void Initialize()
8580

8681
private void OnSourceControlClick(CommandBarButton Ctrl, ref bool CancelDefault)
8782
{
88-
_sourceControlPresenter.Show();
83+
using (var window = new DummyGitView(IDE.ActiveVBProject))
84+
{
85+
window.ShowDialog();
86+
}
8987
}
9088

9189
private void OnOptionsClick(CommandBarButton Ctrl, ref bool CancelDefault)
@@ -132,10 +130,6 @@ protected override void Dispose(bool disposing)
132130
{
133131
_testMenu.Dispose();
134132
}
135-
if (_sourceControlPresenter != null)
136-
{
137-
_sourceControlPresenter.Dispose();
138-
}
139133
}
140134

141135
_disposed = true;

RetailCoder.VBE/UI/SourceControl/GitHubSourceControlDockablePresenter.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

RetailCoder.VBE/UI/SourceControl/SourceControlPanel.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Collections.Generic;
2+
using System.ComponentModel;
23
using System.Drawing;
34
using System.Data;
45
using System.Linq;
@@ -8,21 +9,11 @@
89

910
namespace Rubberduck.UI.SourceControl
1011
{
11-
public partial class SourceControlPanel : UserControl, IDockableUserControl
12+
public partial class SourceControlPanel : UserControl
1213
{
1314
public SourceControlPanel()
1415
{
1516
InitializeComponent();
1617
}
17-
18-
public string ClassId
19-
{
20-
get { return "19A32FC9-4902-4385-9FE7-829D4F9C441D"; }
21-
}
22-
23-
public string Caption
24-
{
25-
get { return "Source Control"; }
26-
}
2718
}
2819
}

RetailCoder.VBE/UI/UnitTesting/TestExplorerDockablePresenter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ public class TestExplorerDockablePresenter : DockablePresenterBase
1212
private TestExplorerWindow Control { get { return UserControl as TestExplorerWindow; } }
1313
private readonly ITestEngine _testEngine;
1414

15-
public TestExplorerDockablePresenter(VBE vbe, AddIn addin, IDockableUserControl window, ITestEngine testEngine)
16-
: base(vbe, addin, window)
15+
public TestExplorerDockablePresenter(VBE vbe, AddIn addin, IDockableUserControl control, ITestEngine testEngine)
16+
: base(vbe, addin, control)
1717
{
1818
_testEngine = testEngine;
1919
RegisterTestExplorerEvents();

RetailCoder.VBE/UI/UnitTesting/TestExplorerWindow.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.ComponentModel;
44
using System.Linq;
5+
using System.Runtime.InteropServices;
56
using System.Windows.Forms;
67
using Rubberduck.UnitTesting;
78

0 commit comments

Comments
 (0)