Skip to content

Commit 4b042b6

Browse files
committed
(split from main repo) Settings: Prevent the multiple creation of controls
because `GetSettings()` (where controls are created) is call 3 times that ends with that the controls displayed are not the one that are the ones set in `CustomControl` property. And that can cause problems if we manipulate `CustomControl`in the setting page to get (until the setting is saved) or set a value. We **must** keep the strategy that `GetSettings()` return every time new controls because the previous instances of the controls are disposed when the settings form is closed. These changes ensure that the `GetSettings()` method is called only **1** time. The 2 other times (use of `.Any()`) has been replaced by a `HasSettings` property.
1 parent 0172210 commit 4b042b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

GerritPlugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class GerritPlugin : GitPluginBase, IGitPluginForRepository
4242
private ToolStripButton _installCommitMsgMenuItem;
4343

4444
// public only because of FormTranslate
45-
public GerritPlugin()
45+
public GerritPlugin() : base(false)
4646
{
4747
SetNameAndDescription("Gerrit Code Review");
4848
Translate();

0 commit comments

Comments
 (0)