diff options
author | mjarkk <mkopenga@gmail.com> | 2018-12-06 08:26:05 +0100 |
---|---|---|
committer | mjarkk <mkopenga@gmail.com> | 2018-12-06 08:26:05 +0100 |
commit | f6e83cdbdff57e8f3403c6b7f7acd22b88ca8613 (patch) | |
tree | c603822ed7f120cbe86ccefa0ccfe47f090b88d0 | |
parent | c269ad137090479be68b5353a05f2ed036b3dfc0 (diff) |
Started working on the popup
-rw-r--r-- | pkg/gui/branches_panel.go | 11 | ||||
-rw-r--r-- | pkg/gui/gui.go | 5 | ||||
-rw-r--r-- | pkg/i18n/dutch.go | 6 | ||||
-rw-r--r-- | pkg/i18n/english.go | 6 | ||||
-rw-r--r-- | pkg/i18n/polish.go | 6 |
5 files changed, 26 insertions, 8 deletions
diff --git a/pkg/gui/branches_panel.go b/pkg/gui/branches_panel.go index 13267f29d..43c585730 100644 --- a/pkg/gui/branches_panel.go +++ b/pkg/gui/branches_panel.go @@ -97,14 +97,14 @@ func (gui *Gui) deleteBranch(g *gocui.Gui, v *gocui.View, force bool) error { func (gui *Gui) deleteNamedBranch(g *gocui.Gui, v *gocui.View, selectedBranch *commands.Branch, force bool) error { title := gui.Tr.SLocalize("DeleteBranch") - var messageId string + var messageID string if force { - messageId = "ForceDeleteBranchMessage" + messageID = "ForceDeleteBranchMessage" } else { - messageId = "DeleteBranchMessage" + messageID = "DeleteBranchMessage" } message := gui.Tr.TemplateLocalize( - messageId, + messageID, Teml{ "selectedBranchName": selectedBranch.Name, }, @@ -114,9 +114,8 @@ func (gui *Gui) deleteNamedBranch(g *gocui.Gui, v *gocui.View, selectedBranch *c errMessage := err.Error() if !force && strings.Contains(errMessage, "is not fully merged") { return gui.deleteNamedBranch(g, v, selectedBranch, true) - } else { - return gui.createErrorPanel(g, errMessage) } + return gui.createErrorPanel(g, errMessage) } return gui.refreshSidePanels(g) }, nil) diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 872a00c37..b443d008d 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -421,9 +421,10 @@ func (gui *Gui) Run() error { } go func() { - time.Sleep(time.Second * 60) err := gui.fetch(g, false) - if err == nil || !strings.Contains(err.Error(), "exit status 128") { + if err != nil && strings.Contains(err.Error(), "exit status 128") { + gui.createConfirmationPanel(g, g.CurrentView(), gui.Tr.SLocalize("NoAutomaticGitFetchTitle"), gui.Tr.SLocalize("NoAutomaticGitFetchBody"), nil, nil) + } else { gui.goEvery(g, time.Second*60, func(g *gocui.Gui) error { return gui.fetch(g, false) }) diff --git a/pkg/i18n/dutch.go b/pkg/i18n/dutch.go index 5f9e4bf34..2f5a3a404 100644 --- a/pkg/i18n/dutch.go +++ b/pkg/i18n/dutch.go @@ -415,6 +415,12 @@ func addDutch(i18nObject *i18n.Bundle) error { }, &i18n.Message{ ID: "fetch", Other: `fetch`, + }, &i18n.Message{ + ID: "NoAutomaticGitFetchTitle", + Other: `No automatic git fetch`, + }, &i18n.Message{ + ID: "NoAutomaticGitFetchBody", + Other: `Lazygit can't use "git fetch" in a private repo use f in the branch panel to run git fetch manually`, }, ) } diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index 929e8834d..2ef1d8597 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -423,6 +423,12 @@ func addEnglish(i18nObject *i18n.Bundle) error { }, &i18n.Message{ ID: "fetch", Other: `fetch`, + }, &i18n.Message{ + ID: "NoAutomaticGitFetchTitle", + Other: `No automatic git fetch`, + }, &i18n.Message{ + ID: "NoAutomaticGitFetchBody", + Other: `Lazygit can't use "git fetch" in a private repo use f in the branch panel to run git fetch manually`, }, ) } diff --git a/pkg/i18n/polish.go b/pkg/i18n/polish.go index ec59288fa..d2b4a84ed 100644 --- a/pkg/i18n/polish.go +++ b/pkg/i18n/polish.go @@ -398,6 +398,12 @@ func addPolish(i18nObject *i18n.Bundle) error { }, &i18n.Message{ ID: "fetch", Other: `fetch`, + }, &i18n.Message{ + ID: "NoAutomaticGitFetchTitle", + Other: `No automatic git fetch`, + }, &i18n.Message{ + ID: "NoAutomaticGitFetchBody", + Other: `Lazygit can't use "git fetch" in a private repo use f in the branch panel to run git fetch manually`, }, ) } |