Skip to content

Commit

Permalink
fixes merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
ThunderFrame committed Jun 3, 2016
2 parents a08aaa9 + 9aa4d9b commit 44eb5af
Show file tree
Hide file tree
Showing 38 changed files with 3,945 additions and 3,397 deletions.
27 changes: 11 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,31 @@
[nextBuildStatus]:https://ci.appveyor.com/api/projects/status/we3pdnkeebo4nlck/branch/next?svg=true
[masterBuildStatus]:https://ci.appveyor.com/api/projects/status/we3pdnkeebo4nlck/branch/master?svg=true

Rubberduck is a COM Add-In for the VBA IDE that makes VBA development even more enjoyable, by extending the Visual Basic Editor (VBE) with menus, toolbars and toolwindows that enable things we didn't even think were possible when we first started this project.
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/rubberduck-vba/rubberduck.svg)](http://isitmaintained.com/project/rubberduck-vba/rubberduck "Average time to resolve an issue") [![Percentage of issues still open](http://isitmaintained.com/badge/open/rubberduck-vba/rubberduck.svg)](http://isitmaintained.com/project/rubberduck-vba/rubberduck "Percentage of issues still open")

If you're learning VBA, Rubberduck can help you avoid a few common beginner mistakes, and can probably show you a trick or two - even if you're only ever writing *macros*. If you're a more advanced programmer, you will appreciate the richness of [Rubberduck's feature set](https://github.com/retailcoder/Rubberduck/wiki/Features).

[**Follow us on Twitter!**](https://twitter.com/rubberduckvba)

[**Rubberduck Wiki**](https://github.com/retailcoder/Rubberduck/wiki)
> **[rubberduckvba.com](http://rubberduckvba.com)** [Wiki](https://github.com/retailcoder/Rubberduck/wiki) [Rubberduck News](https://rubberduckvba.wordpress.com/)
> contact@rubberduckvba.com
> Follow [@rubberduckvba](https://twitter.com/rubberduckvba) on Twitter
---

#[Contributing](https://github.com/rubberduck-vba/Rubberduck/wiki/Contributing)
##What is Rubberduck?

If you're a C# developer looking for a fun project to contribute to, feel free to fork the project and
[come meet the devs in Code Review's "VBA Rubberducking" chatroom][chat] - we'll be happy to answer your questions and help you help us!
It's an add-in for the VBA IDE, the glorious *Visual Basic Editor* (VBE) - which hasn't seen an update in this century, but that's still in use everywhere around the world. Rubberduck wants to give its users access to features you would find in the VBE if it had kept up with the features of Visual Studio and other IDE's in the past, oh, *decade* or so.

We follow a [development branch workflow][branch], so please submit any Pull Requests to the `next` branch.
Rubberduck wants to help its users write better, cleaner, maintainable code. The many **code inspections** and **refactoring tools** help harmlessly making changes to the code, and **unit testing** helps writing a *safety net* that makes it easy to know exactly what broke when you made that *small little harmless modification*.

[chat]:http://chat.stackexchange.com/rooms/14929
[helpwanted]:https://github.com/rubberduck-vba/Rubberduck/labels/help-wanted
[branch]:https://github.com/rubberduck-vba/Rubberduck/issues/288
Rubberduck wants to bring VBA into the 21st century, and wants to see more open-source VBA repositories on [GitHub](https://github.com/) - VBA code and **source control** don't traditionally exactly work hand in hand; unless you've automated it, exporting each module one by one to your local repository, fetching the remote changes, re-importing every module one by one back into the project, ...is *a little bit* tedious. Rubberduck integrates Git into the IDE, and handles all the file handling behind the scenes - a bit like Visual Studio's *Team Explorer*.

---

#[Installing](https://github.com/rubberduck-vba/Rubberduck/wiki/Installing)
If you're learning VBA, Rubberduck can help you avoid a few common beginner mistakes, and can probably show you a trick or two - even if you're only ever writing *macros*. If you're a more advanced programmer, you will appreciate the richness of [Rubberduck's feature set](https://github.com/retailcoder/Rubberduck/wiki/Features). See the [Installing](https://github.com/rubberduck-vba/Rubberduck/wiki/Installing) wiki page.

This section was moved to a dedicated wiki page.
If you're a C# developer looking for a fun project to contribute to, see the [Contributing](https://github.com/rubberduck-vba/Rubberduck/wiki/Contributing) wiki page.

---

#License
##License

Rubberduck is a COM add-in for the VBA IDE (VBE).

Expand Down
5 changes: 3 additions & 2 deletions RetailCoder.VBE/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
using System.Runtime.InteropServices.ComTypes;
using System.Threading.Tasks;
using System.Windows.Forms;
using Rubberduck.Common.Hotkeys;

namespace Rubberduck
{
Expand Down Expand Up @@ -132,9 +133,9 @@ private bool ShouldEvaluateCanExecute(Declaration selectedDeclaration, ParserSta
private void _configService_SettingsChanged(object sender, EventArgs e)
{
_config = _configService.LoadConfiguration();
_hooks.HookHotkeys();
// also updates the ShortcutKey text
_appMenus.Localize();
_hooks.HookHotkeys();
UpdateLoggingLevel();
}

Expand All @@ -147,9 +148,9 @@ public void Startup()
{
CleanReloadConfig();
_appMenus.Initialize();
_hooks.HookHotkeys(); // need to hook hotkeys before we localize menus, to correctly display ShortcutTexts
_appMenus.Localize();
Task.Delay(1000).ContinueWith(t => UiDispatcher.Invoke(() => _parser.State.OnParseRequested(this))).ConfigureAwait(false);
_hooks.HookHotkeys();
UpdateLoggingLevel();
}

Expand Down
23 changes: 23 additions & 0 deletions RetailCoder.VBE/Common/Hotkeys/Hotkey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Windows.Input;
using Rubberduck.Common.WinAPI;
using NLog;
using Rubberduck.UI.Command;

namespace Rubberduck.Common.Hotkeys
{
Expand Down Expand Up @@ -58,6 +59,7 @@ public void Attach()
}

HookKey(key, shift);
SetCommandShortcutText();
}

public void Detach()
Expand All @@ -71,6 +73,7 @@ public void Detach()
Kernel32.GlobalDeleteAtom(HotkeyInfo.HookId);

IsAttached = false;
ClearCommandShortcutText();
}

private void HookKey(Keys key, uint shift)
Expand All @@ -90,9 +93,29 @@ private void HookKey(Keys key, uint shift)

HotkeyInfo = new HotkeyInfo(hookId, Combo);
IsAttached = true;

_logger.Debug("Hotkey '{0}' hooked successfully to command '{1}'", Key, Command.GetType()); //no translation needed for Debug.Writeline
}

private void SetCommandShortcutText()
{
var command = Command as CommandBase;
if (command != null)
{
command.ShortcutText = HotkeyInfo.ToString();
}
}

private void ClearCommandShortcutText()
{
var command = Command as CommandBase;
if (command != null)
{
command.ShortcutText = string.Empty;
}
}


private static readonly IDictionary<char,uint> Modifiers = new Dictionary<char, uint>
{
{ '+', (uint)KeyModifier.SHIFT },
Expand Down
6 changes: 3 additions & 3 deletions RetailCoder.VBE/Common/Hotkeys/HotkeyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ public override string ToString()
var builder = new StringBuilder();
if (_keys.HasFlag(Keys.Alt))
{
builder.Append("Alt");
builder.Append(Rubberduck.UI.RubberduckUI.GeneralSettings_HotkeyAlt);
builder.Append('+');
}
if (_keys.HasFlag(Keys.Control))
{
builder.Append("Ctrl");
builder.Append(Rubberduck.UI.RubberduckUI.GeneralSettings_HotkeyCtrl);
builder.Append('+');
}
if (_keys.HasFlag(Keys.Shift))
{
builder.Append("Shift");
builder.Append(Rubberduck.UI.RubberduckUI.GeneralSettings_HotkeyShift);
builder.Append('+');
}
builder.Append(_keys & ~Modifiers);
Expand Down
4 changes: 2 additions & 2 deletions RetailCoder.VBE/Inspections/InspectionsUI.de.resx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<root>
<!--
Microsoft ResX Schema
Expand Down Expand Up @@ -59,7 +59,7 @@
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
Expand Down

0 comments on commit 44eb5af

Please sign in to comment.