summary refs log tree commit diff stats
path: root/widgets/account-wizard.go
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/account-wizard.go')
-rw-r--r--widgets/account-wizard.go22
1 files changed, 21 insertions, 1 deletions
diff --git a/widgets/account-wizard.go b/widgets/account-wizard.go
index 7ed9a62..aa68ed7 100644
--- a/widgets/account-wizard.go
+++ b/widgets/account-wizard.go
@@ -5,6 +5,7 @@ import (
 	"fmt"
 	"net/url"
 	"os"
+	"os/exec"
 	"path"
 	"strings"
 	"time"
@@ -451,6 +452,7 @@ func (wizard *AccountWizard) finish(tutorial bool) {
 	sec, _ = file.NewSection(wizard.accountName.String())
 	sec.NewKey("source", wizard.imapUrl.String())
 	sec.NewKey("outgoing", wizard.smtpUrl.String())
+	sec.NewKey("default", "INBOX")
 	if wizard.smtpMode == SMTP_STARTTLS {
 		sec.NewKey("smtp-starttls", "yes")
 	}
@@ -472,6 +474,7 @@ func (wizard *AccountWizard) finish(tutorial bool) {
 
 	account := config.AccountConfig{
 		Name:     sec.Name(),
+		Default:  "INBOX",
 		From:     sec.Key("from").String(),
 		Source:   sec.Key("source").String(),
 		Outgoing: sec.Key("outgoing").String(),
@@ -492,7 +495,24 @@ func (wizard *AccountWizard) finish(tutorial bool) {
 	wizard.aerc.NewTab(view, account.Name)
 
 	if tutorial {
-		// TODO: Open tutorial
+		name := "aerc-tutorial"
+		if _, err := os.Stat("./aerc-tutorial.7"); !os.IsNotExist(err) {
+			// For development
+			name = "./aerc-tutorial.7"
+		}
+		term, err := NewTerminal(exec.Command("man", name))
+		if err != nil {
+			wizard.errorFor(nil, err)
+			return
+		}
+		wizard.aerc.NewTab(term, "Tutorial")
+		term.OnClose = func(err error) {
+			wizard.aerc.RemoveTab(term)
+			if err != nil {
+				wizard.aerc.PushStatus(" "+err.Error(), 10*time.Second).
+					Color(tcell.ColorDefault, tcell.ColorRed)
+			}
+		}
 	}
 
 	wizard.aerc.RemoveTab(wizard)