Skip to content

Commit 037c73e

Browse files
committed
Merge pull request #1302 from retailcoder/next
hotkey config fixes; added hotkeys to menu items; layout changes to "refactor" menu, too
2 parents cf82f30 + 3737dc2 commit 037c73e

36 files changed

+686
-505
lines changed

RetailCoder.VBE/App.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public App(VBE vbe, IMessageBox messageBox,
6161
_hooks = hooks;
6262
_logger = LogManager.GetCurrentClassLogger();
6363

64+
_configService.SettingsChanged += _configService_SettingsChanged;
6465
_configService.LanguageChanged += ConfigServiceLanguageChanged;
6566
_parser.State.StateChanged += Parser_StateChanged;
6667
_stateBar.Refresh += _stateBar_Refresh;
@@ -80,6 +81,13 @@ public App(VBE vbe, IMessageBox messageBox,
8081
UiDispatcher.Initialize();
8182
}
8283

84+
private void _configService_SettingsChanged(object sender, EventArgs e)
85+
{
86+
// also updates the ShortcutKey text
87+
_appMenus.Localize();
88+
_hooks.HookHotkeys();
89+
}
90+
8391
public void Startup()
8492
{
8593
CleanReloadConfig();

RetailCoder.VBE/Common/RubberduckHooks.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,17 @@ public RubberduckHooks(VBE vbe, IAttachable timerHook, IGeneralConfigService con
3838

3939
public void HookHotkeys()
4040
{
41+
Detach();
42+
_hooks.Clear();
43+
4144
var config = _config.LoadConfiguration();
4245
var settings = config.UserSettings.GeneralSettings.HotkeySettings;
4346
foreach (var hotkey in settings.Where(hotkey => hotkey.IsEnabled))
4447
{
4548
AddHook(new Hotkey(_mainWindowHandle, hotkey.ToString(), hotkey.Command));
4649
}
50+
51+
Attach();
4752
}
4853

4954
public IEnumerable<IAttachable> Hooks { get { return _hooks; } }
@@ -77,7 +82,7 @@ public void Attach()
7782
{
7883
hook.Attach();
7984
hook.MessageReceived += hook_MessageReceived;
80-
}
85+
}
8186

8287
IsAttached = true;
8388
}
@@ -110,7 +115,7 @@ public void Detach()
110115
{
111116
hook.Detach();
112117
hook.MessageReceived -= hook_MessageReceived;
113-
}
118+
}
114119

115120
IsAttached = false;
116121
}

RetailCoder.VBE/Navigation/RegexSearchReplace/RegexSearchReplacePresenter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ public RegexSearchReplacePresenter(VBE vbe, IRubberduckParser parser/*, IRegexSe
2727

2828
public void Show()
2929
{
30-
_view.ShowDialog();
30+
//_view.ShowDialog();
3131
}
3232

3333
public void Hide()
3434
{
35-
_view.Close();
35+
//_view.Close();
3636
}
3737

3838
public event EventHandler<IEnumerable<RegexSearchResult>> FindButtonResults;
@@ -65,7 +65,7 @@ private void _view_ReplaceAllButtonClicked(object sender, EventArgs e)
6565

6666
private void _view_CancelButtonClicked(object sender, EventArgs e)
6767
{
68-
_view.Close();
68+
//_view.Close();
6969
}
7070
}
7171
}

RetailCoder.VBE/Properties/Resources.Designer.cs

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RetailCoder.VBE/Properties/Resources.resx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,4 +385,22 @@
385385
<data name="blue_folder_horizontal_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
386386
<value>..\Resources\blue-folder-horizontal-open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
387387
</data>
388+
<data name="AddProperty_5538_321_Mask" type="System.Resources.ResXFileRef, System.Windows.Forms">
389+
<value>..\Resources\Microsoft\Mask\AddProperty_5538_32.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
390+
</data>
391+
<data name="ExtractInterface_6778_321_Mask" type="System.Resources.ResXFileRef, System.Windows.Forms">
392+
<value>..\Resources\Microsoft\Mask\ExtractInterface_6778_32.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
393+
</data>
394+
<data name="ImplementInterface_5540_321_Mask" type="System.Resources.ResXFileRef, System.Windows.Forms">
395+
<value>..\Resources\Microsoft\Mask\ImplementInterface_5540_32.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
396+
</data>
397+
<data name="AddVariable_5541_32_Mask" type="System.Resources.ResXFileRef, System.Windows.Forms">
398+
<value>..\Resources\Microsoft\Mask\AddVariable_5541_32.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
399+
</data>
400+
<data name="PromoteLocal_6784_32" type="System.Resources.ResXFileRef, System.Windows.Forms">
401+
<value>..\Resources\Microsoft\PromoteLocal_6784_32.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
402+
</data>
403+
<data name="PromoteLocal_6784_32_Mask" type="System.Resources.ResXFileRef, System.Windows.Forms">
404+
<value>..\Resources\Microsoft\Mask\PromoteLocal_6784_32.bmp;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
405+
</data>
388406
</root>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)