Skip to content

Commit

Permalink
Revert "docking UI for source control."
Browse files Browse the repository at this point in the history
This reverts commit f71cb70.
  • Loading branch information
rubberduck203 committed Mar 4, 2015
1 parent 3fe0070 commit b373794
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 54 deletions.
1 change: 0 additions & 1 deletion RetailCoder.VBE/Rubberduck.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@
<DependentUpon>ExtractMethodDialog.cs</DependentUpon>
</Compile>
<Compile Include="UI\Refactorings\ExtractMethod\ValueChangedEventArgs.cs" />
<Compile Include="UI\SourceControl\GitHubSourceControlDockablePresenter.cs" />
<Compile Include="UI\SourceControl\SourceControlPanel.cs">
<SubType>UserControl</SubType>
</Compile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class CodeInspectionsDockablePresenter : DockablePresenterBase
private CodeInspectionsWindow Control { get { return UserControl as CodeInspectionsWindow; } }

private IList<ICodeInspectionResult> _results;
private readonly IInspector _inspector;
private IInspector _inspector;

public CodeInspectionsDockablePresenter(IInspector inspector, VBE vbe, AddIn addin, CodeInspectionsWindow window)
:base(vbe, addin, window)
Expand Down
9 changes: 6 additions & 3 deletions RetailCoder.VBE/UI/CodeInspections/CodeInspectionsMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ namespace Rubberduck.UI.CodeInspections
{
public class CodeInspectionsMenu : Menu
{
private readonly CodeInspectionsDockablePresenter _presenter; //if presenter goes out of scope, so does its toolwindow Issue #169
private CommandBarButton _codeInspectionsButton;
private readonly CodeInspectionsWindow _window;
private readonly CodeInspectionsDockablePresenter _presenter; //if presenter goes out of scope, so does it's toolwindow Issue #169

public CodeInspectionsMenu(VBE vbe, AddIn addIn, CodeInspectionsDockablePresenter presenter)
public CodeInspectionsMenu(VBE vbe, AddIn addIn, CodeInspectionsWindow view, CodeInspectionsDockablePresenter presenter)
:base(vbe, addIn)
{
_window = view;
_presenter = presenter;
}

public void Initialize(CommandBarPopup parentMenu)
{
AddButton(parentMenu, "Code &Inspections", false, new CommandBarButtonClickEvent(OnCodeInspectionsButtonClick));
_codeInspectionsButton = AddButton(parentMenu, "Code &Inspections", false, new CommandBarButtonClickEvent(OnCodeInspectionsButtonClick));
}

private void OnCodeInspectionsButtonClick(CommandBarButton ctrl, ref bool canceldefault)
Expand Down
6 changes: 3 additions & 3 deletions RetailCoder.VBE/UI/DockablePresenterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ public abstract class DockablePresenterBase : IDisposable
private Window _window;
protected readonly UserControl UserControl;

protected DockablePresenterBase(VBE vbe, AddIn addin, IDockableUserControl window)
protected DockablePresenterBase(VBE vbe, AddIn addin, IDockableUserControl control)
{
_vbe = vbe;
_addin = addin;
UserControl = window as UserControl;
_window = CreateToolWindow(window);
UserControl = control as UserControl;
_window = CreateToolWindow(control);
}

private readonly VBE _vbe;
Expand Down
18 changes: 6 additions & 12 deletions RetailCoder.VBE/UI/RubberduckMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ public class RubberduckMenu : Menu
private readonly RefactorMenu _refactorMenu;
private readonly IConfigurationService _configService;

private DockablePresenterBase _sourceControlPresenter;

public RubberduckMenu(VBE vbe, AddIn addIn, IConfigurationService configService, IRubberduckParser parser, IInspector inspector)
: base(vbe, addIn)
{
Expand All @@ -47,10 +45,7 @@ public RubberduckMenu(VBE vbe, AddIn addIn, IConfigurationService configService,

var inspectionExplorer = new CodeInspectionsWindow();
var inspectionPresenter = new CodeInspectionsDockablePresenter(inspector, vbe, addIn, inspectionExplorer);
_codeInspectionsMenu = new CodeInspectionsMenu(vbe, addIn, inspectionPresenter);

var sourceControlPanel = new SourceControlPanel();
_sourceControlPresenter = new GitHubSourceControlDockablePresenter(vbe, addIn, sourceControlPanel);
_codeInspectionsMenu = new CodeInspectionsMenu(vbe, addIn, inspectionExplorer, inspectionPresenter);

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

//note: disabled for 1.2 release
//_sourceControl = AddButton(menu, "Source Control", false, OnSourceControlClick);
//_sourceControl = AddButton(menu, "Source Control", false, new CommandBarButtonClickEvent(OnSourceControlClick));

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

private void OnSourceControlClick(CommandBarButton Ctrl, ref bool CancelDefault)
{
_sourceControlPresenter.Show();
using (var window = new DummyGitView(IDE.ActiveVBProject))
{
window.ShowDialog();
}
}

private void OnOptionsClick(CommandBarButton Ctrl, ref bool CancelDefault)
Expand Down Expand Up @@ -132,10 +130,6 @@ protected override void Dispose(bool disposing)
{
_testMenu.Dispose();
}
if (_sourceControlPresenter != null)
{
_sourceControlPresenter.Dispose();
}
}

_disposed = true;
Expand Down

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 2 additions & 11 deletions RetailCoder.VBE/UI/SourceControl/SourceControlPanel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
Expand All @@ -8,21 +9,11 @@

namespace Rubberduck.UI.SourceControl
{
public partial class SourceControlPanel : UserControl, IDockableUserControl
public partial class SourceControlPanel : UserControl
{
public SourceControlPanel()
{
InitializeComponent();
}

public string ClassId
{
get { return "19A32FC9-4902-4385-9FE7-829D4F9C441D"; }
}

public string Caption
{
get { return "Source Control"; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public class TestExplorerDockablePresenter : DockablePresenterBase
private TestExplorerWindow Control { get { return UserControl as TestExplorerWindow; } }
private readonly ITestEngine _testEngine;

public TestExplorerDockablePresenter(VBE vbe, AddIn addin, IDockableUserControl window, ITestEngine testEngine)
: base(vbe, addin, window)
public TestExplorerDockablePresenter(VBE vbe, AddIn addin, IDockableUserControl control, ITestEngine testEngine)
: base(vbe, addin, control)
{
_testEngine = testEngine;
RegisterTestExplorerEvents();
Expand Down
1 change: 1 addition & 0 deletions RetailCoder.VBE/UI/UnitTesting/TestExplorerWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using Rubberduck.UnitTesting;

Expand Down

0 comments on commit b373794

Please sign in to comment.