diff --git a/GitUI/CommandsDialogs/FormCommit.Designer.cs b/GitUI/CommandsDialogs/FormCommit.Designer.cs index a6fecfc4c7f..c7f4915f2b4 100644 --- a/GitUI/CommandsDialogs/FormCommit.Designer.cs +++ b/GitUI/CommandsDialogs/FormCommit.Designer.cs @@ -1147,7 +1147,6 @@ private void InitializeComponent() this.CommitAndPush.Size = new System.Drawing.Size(171, 26); this.CommitAndPush.TabIndex = 9; this.CommitAndPush.TabStop = false; - this.CommitAndPush.Text = "Commit && &push"; this.CommitAndPush.UseVisualStyleBackColor = true; this.CommitAndPush.Click += new System.EventHandler(this.CommitAndPush_Click); // diff --git a/GitUI/CommandsDialogs/FormCommit.cs b/GitUI/CommandsDialogs/FormCommit.cs index 7eee93932f0..03c8b262a1f 100644 --- a/GitUI/CommandsDialogs/FormCommit.cs +++ b/GitUI/CommandsDialogs/FormCommit.cs @@ -28,7 +28,6 @@ using GitUI.Properties; using GitUI.Script; using GitUI.SpellChecker; -using GitUI.Theming; using GitUI.UserControls; using GitUIPluginInterfaces; using Microsoft; @@ -52,6 +51,8 @@ public sealed partial class FormCommit : GitModuleForm private readonly TranslationString _amendCommitCaption = new("Amend commit"); + private readonly TranslationString _commitAndPush = new("Commit && &push"); + private readonly TranslationString _deleteFailed = new("Delete file failed"); private readonly TranslationString _deleteSelectedFiles = @@ -213,6 +214,8 @@ public FormCommit(GitUICommands commands, CommitKind commitKind = CommitKind.Nor InitializeComponent(); + CommitAndPush.Text = _commitAndPush.Text; + splitRight.Panel2MinSize = DpiUtil.Scale(100); _commitMessageManager = new CommitMessageManager(Module.WorkingDirGitDir, Module.CommitEncoding, commitMessage); @@ -1028,6 +1031,7 @@ private void LoadUnstagedOutput(IReadOnlyList allChangedFiles) LoadingStaged.Visible = false; Commit.Enabled = true; CommitAndPush.Enabled = true; + CommitAndPush.Text = doChangesExist ? _commitAndPush.Text : TranslatedStrings.ButtonPush; Amend.Enabled = true; Reset.Enabled = doChangesExist; @@ -2703,6 +2707,12 @@ private void editFileToolStripMenuItem_Click(object sender, EventArgs e) private void CommitAndPush_Click(object sender, EventArgs e) { + if (CommitAndPush.Text == TranslatedStrings.ButtonPush) + { + UICommands.StartPushDialog(this, pushOnShow: true); + return; + } + CheckForStagedAndCommit(Amend.Checked, push: true); } diff --git a/GitUI/CommandsDialogs/FormPush.Designer.cs b/GitUI/CommandsDialogs/FormPush.Designer.cs index 2d482b5606b..435feb82881 100644 --- a/GitUI/CommandsDialogs/FormPush.Designer.cs +++ b/GitUI/CommandsDialogs/FormPush.Designer.cs @@ -143,7 +143,6 @@ private void InitializeComponent() this.Push.Name = "Push"; this.Push.Size = new System.Drawing.Size(101, 25); this.Push.TabIndex = 4; - this.Push.Text = "&Push"; this.Push.UseVisualStyleBackColor = true; this.Push.Click += new System.EventHandler(this.PushClick); // diff --git a/GitUI/CommandsDialogs/FormPush.cs b/GitUI/CommandsDialogs/FormPush.cs index 7b8869acc8b..8837888aecb 100644 --- a/GitUI/CommandsDialogs/FormPush.cs +++ b/GitUI/CommandsDialogs/FormPush.cs @@ -105,6 +105,8 @@ public FormPush(GitUICommands commands) { InitializeComponent(); + Push.Text = TranslatedStrings.ButtonPush; + NewColumn.Width = DpiUtil.Scale(97); PushColumn.Width = DpiUtil.Scale(36); ForceColumn.Width = DpiUtil.Scale(101); diff --git a/GitUI/TranslatedStrings.cs b/GitUI/TranslatedStrings.cs index adc1378d8f9..518e9dff7ec 100644 --- a/GitUI/TranslatedStrings.cs +++ b/GitUI/TranslatedStrings.cs @@ -18,6 +18,7 @@ internal sealed class TranslatedStrings : Translate private readonly TranslationString _buttonCloseApp = new("Close application"); private readonly TranslationString _buttonCreateBranch = new("Create branch"); private readonly TranslationString _buttonIgnore = new("Ignore"); + private readonly TranslationString _buttonPush = new("&Push"); private readonly TranslationString _buttonReportBug = new("Report bug!"); private readonly TranslationString _captionFailedExecute = new("Failed to execute"); @@ -109,13 +110,13 @@ public TranslatedStrings() Translator.Translate(this, AppSettings.CurrentTranslation); } - private static Lazy _instance = new Lazy(); + private static Lazy _instance = new(); public static void Reinitialize() { if (_instance.IsValueCreated) { - _instance = new Lazy(); + _instance = new(); } } @@ -131,6 +132,7 @@ public static void Reinitialize() public static string ButtonCloseApp => _instance.Value._buttonCloseApp.Text; public static string ButtonCreateBranch => _instance.Value._buttonCreateBranch.Text; public static string ButtonIgnore => _instance.Value._buttonIgnore.Text; + public static string ButtonPush => _instance.Value._buttonPush.Text; public static string ButtonReportBug => _instance.Value._buttonReportBug.Text; public static string CaptionFailedExecute => _instance.Value._captionFailedExecute.Text; diff --git a/GitUI/Translation/English.xlf b/GitUI/Translation/English.xlf index d08174402cd..f2391454f49 100644 --- a/GitUI/Translation/English.xlf +++ b/GitUI/Translation/English.xlf @@ -3213,10 +3213,6 @@ gitex.cmd / gitex (located in the same folder as GitExtensions.exe): &Commit - - Commit && &push - - Commit @@ -3263,6 +3259,10 @@ Use this feature when a file is big and never change. Git will never check if the file has changed that will improve status check performance. + + Commit && &push + + Author @@ -5425,10 +5425,6 @@ This will initialize and update all submodules recursive. Pull - - &Push - - Push @@ -9573,6 +9569,10 @@ Select this commit to populate the full message. Ignore + + &Push + + Report bug! diff --git a/ResourceManager/TranslatedStrings.cs b/ResourceManager/TranslatedStrings.cs index 602808d0f2e..99062e7204b 100644 --- a/ResourceManager/TranslatedStrings.cs +++ b/ResourceManager/TranslatedStrings.cs @@ -27,8 +27,7 @@ public sealed class TranslatedStrings : Translate private readonly TranslationString _installGitInstructions = new("Install git..."); private readonly TranslationString _findGitExecutable = new("Find git..."); - private readonly TranslationString _gitExecutableNotFoundText = - new TranslationString("The Git executable could not be located on your system."); + private readonly TranslationString _gitExecutableNotFoundText = new("The Git executable could not be located on your system."); private readonly TranslationString _authorDateText = new("{0:Author date|Author dates}"); private readonly TranslationString _committerText = new("Committer"); private readonly TranslationString _commitDateText = new("{0:Commit date|Commit dates}"); @@ -46,7 +45,7 @@ public sealed class TranslatedStrings : Translate private readonly TranslationString _generalGitConfigExceptionMessage = new("Failed to read \"{0}\" due to the following error:{1}{1}{2}{1}{1}Due to the nature of this problem, the behavior of the application cannot be guaranteed and it must be closed.{1}{1}Please correct this issue and re-open Git Extensions."); private readonly TranslationString _generalGitConfigExceptionCaption = new("Repository Configuration Error"); - private readonly TranslationString _disableMenuItem = new TranslationString("Disable this dropdown"); + private readonly TranslationString _disableMenuItem = new("Disable this dropdown"); // public only because of FormTranslate public TranslatedStrings() @@ -54,13 +53,13 @@ public TranslatedStrings() Translator.Translate(this, AppSettings.CurrentTranslation); } - private static Lazy _instance = new Lazy(); + private static Lazy _instance = new(); public static void Reinitialize() { if (_instance.IsValueCreated) { - _instance = new Lazy(); + _instance = new(); } }