diff options
author | Reto Brunner <reto@labrat.space> | 2020-07-30 23:22:32 +0200 |
---|---|---|
committer | Reto Brunner <reto@labrat.space> | 2020-07-30 23:22:32 +0200 |
commit | 3d784c5d8c7d037e38159fc1753773a2e81aa43e (patch) | |
tree | 2c062c9f4b4641a59e3f4f3ff3317f636bfd49cf /widgets/account-wizard.go | |
parent | 6ee7b1c3fd40b0e2f93dcaa7ffb3b0bdd56ac285 (diff) | |
download | aerc-3d784c5d8c7d037e38159fc1753773a2e81aa43e.tar.gz |
Revert "Implement style configuration."
This reverts commit 1ff687ca2b0821c2cacc1fa725abb3302d2af9da.
Diffstat (limited to 'widgets/account-wizard.go')
-rw-r--r-- | widgets/account-wizard.go | 102 |
1 files changed, 44 insertions, 58 deletions
diff --git a/widgets/account-wizard.go b/widgets/account-wizard.go index ae45bb8e..4e51926d 100644 --- a/widgets/account-wizard.go +++ b/widgets/account-wizard.go @@ -75,21 +75,21 @@ type AccountWizard struct { func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard { wizard := &AccountWizard{ - accountName: ui.NewTextInput("", conf.Ui).Prompt("> "), + accountName: ui.NewTextInput("").Prompt("> "), aerc: aerc, conf: conf, temporary: false, copySent: true, - email: ui.NewTextInput("", conf.Ui).Prompt("> "), - fullName: ui.NewTextInput("", conf.Ui).Prompt("> "), - imapPassword: ui.NewTextInput("", conf.Ui).Prompt("] ").Password(true), - imapServer: ui.NewTextInput("", conf.Ui).Prompt("> "), - imapStr: ui.NewText("imaps://", conf.Ui.GetStyle(config.STYLE_DEFAULT)), - imapUsername: ui.NewTextInput("", conf.Ui).Prompt("> "), - smtpPassword: ui.NewTextInput("", conf.Ui).Prompt("] ").Password(true), - smtpServer: ui.NewTextInput("", conf.Ui).Prompt("> "), - smtpStr: ui.NewText("smtps://", conf.Ui.GetStyle(config.STYLE_DEFAULT)), - smtpUsername: ui.NewTextInput("", conf.Ui).Prompt("> "), + email: ui.NewTextInput("").Prompt("> "), + fullName: ui.NewTextInput("").Prompt("> "), + imapPassword: ui.NewTextInput("").Prompt("] ").Password(true), + imapServer: ui.NewTextInput("").Prompt("> "), + imapStr: ui.NewText("imaps://"), + imapUsername: ui.NewTextInput("").Prompt("> "), + smtpPassword: ui.NewTextInput("").Prompt("] ").Password(true), + smtpServer: ui.NewTextInput("").Prompt("> "), + smtpStr: ui.NewText("smtps://"), + smtpUsername: ui.NewTextInput("").Prompt("> "), } // Autofill some stuff for the user @@ -150,36 +150,33 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard { {ui.SIZE_WEIGHT, ui.Const(1)}, }) basics.AddChild( - ui.NewText("\nWelcome to aerc! Let's configure your account.\n\n"+ - "This wizard supports basic IMAP & SMTP configuration.\n"+ - "For other configurations, use <Ctrl+q> to exit and read the "+ - "aerc-config(5) man page.\n"+ - "Press <Tab> and <Shift+Tab> to cycle between each field in this form, "+ - "or <Ctrl+j> and <Ctrl+k>.", - conf.Ui.GetStyle(config.STYLE_DEFAULT))) + ui.NewText("\nWelcome to aerc! Let's configure your account.\n\n" + + "This wizard supports basic IMAP & SMTP configuration.\n" + + "For other configurations, use <Ctrl+q> to exit and read the " + + "aerc-config(5) man page.\n" + + "Press <Tab> and <Shift+Tab> to cycle between each field in this form, or <Ctrl+j> and <Ctrl+k>.")) basics.AddChild( - ui.NewText("Name for this account? (e.g. 'Personal' or 'Work')", - conf.Ui.GetStyle(config.STYLE_HEADER))). + ui.NewText("Name for this account? (e.g. 'Personal' or 'Work')"). + Bold(true)). At(1, 0) basics.AddChild(wizard.accountName). At(2, 0) basics.AddChild(ui.NewFill(' ')). At(3, 0) basics.AddChild( - ui.NewText("Full name for outgoing emails? (e.g. 'John Doe')", - conf.Ui.GetStyle(config.STYLE_HEADER))). + ui.NewText("Full name for outgoing emails? (e.g. 'John Doe')"). + Bold(true)). At(4, 0) basics.AddChild(wizard.fullName). At(5, 0) basics.AddChild(ui.NewFill(' ')). At(6, 0) basics.AddChild( - ui.NewText("Your email address? (e.g. 'john@example.org')", - conf.Ui.GetStyle(config.STYLE_HEADER))). + ui.NewText("Your email address? (e.g. 'john@example.org')").Bold(true)). At(7, 0) basics.AddChild(wizard.email). At(8, 0) - selecter := NewSelecter([]string{"Next"}, 0, conf.Ui). + selecter := NewSelecter([]string{"Next"}, 0). OnChoose(func(option string) { email := wizard.email.String() if strings.ContainsRune(email, '@') { @@ -230,19 +227,16 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard { }).Columns([]ui.GridSpec{ {ui.SIZE_WEIGHT, ui.Const(1)}, }) - incoming.AddChild(ui.NewText("\nConfigure incoming mail (IMAP)", - conf.Ui.GetStyle(config.STYLE_DEFAULT))) + incoming.AddChild(ui.NewText("\nConfigure incoming mail (IMAP)")) incoming.AddChild( - ui.NewText("Username", - conf.Ui.GetStyle(config.STYLE_HEADER))). + ui.NewText("Username").Bold(true)). At(1, 0) incoming.AddChild(wizard.imapUsername). At(2, 0) incoming.AddChild(ui.NewFill(' ')). At(3, 0) incoming.AddChild( - ui.NewText("Password", - conf.Ui.GetStyle(config.STYLE_HEADER))). + ui.NewText("Password").Bold(true)). At(4, 0) incoming.AddChild(wizard.imapPassword). At(5, 0) @@ -250,22 +244,20 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard { At(6, 0) incoming.AddChild( ui.NewText("Server address "+ - "(e.g. 'mail.example.org' or 'mail.example.org:1313')", - conf.Ui.GetStyle(config.STYLE_HEADER))). + "(e.g. 'mail.example.org' or 'mail.example.org:1313')").Bold(true)). At(7, 0) incoming.AddChild(wizard.imapServer). At(8, 0) incoming.AddChild(ui.NewFill(' ')). At(9, 0) incoming.AddChild( - ui.NewText("Connection mode", - conf.Ui.GetStyle(config.STYLE_HEADER))). + ui.NewText("Connection mode").Bold(true)). At(10, 0) imapMode := NewSelecter([]string{ "IMAP over SSL/TLS", "IMAP with STARTTLS", "Insecure IMAP", - }, 0, conf.Ui).Chooser(true).OnSelect(func(option string) { + }, 0).Chooser(true).OnSelect(func(option string) { switch option { case "IMAP over SSL/TLS": wizard.imapMode = IMAP_OVER_TLS @@ -277,7 +269,7 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard { wizard.imapUri() }) incoming.AddChild(imapMode).At(11, 0) - selecter = NewSelecter([]string{"Previous", "Next"}, 1, conf.Ui). + selecter = NewSelecter([]string{"Previous", "Next"}, 1). OnChoose(wizard.advance) incoming.AddChild(ui.NewFill(' ')).At(12, 0) incoming.AddChild(wizard.imapStr).At(13, 0) @@ -312,19 +304,16 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard { }).Columns([]ui.GridSpec{ {ui.SIZE_WEIGHT, ui.Const(1)}, }) - outgoing.AddChild(ui.NewText("\nConfigure outgoing mail (SMTP)", - conf.Ui.GetStyle(config.STYLE_DEFAULT))) + outgoing.AddChild(ui.NewText("\nConfigure outgoing mail (SMTP)")) outgoing.AddChild( - ui.NewText("Username", - conf.Ui.GetStyle(config.STYLE_HEADER))). + ui.NewText("Username").Bold(true)). At(1, 0) outgoing.AddChild(wizard.smtpUsername). At(2, 0) outgoing.AddChild(ui.NewFill(' ')). At(3, 0) outgoing.AddChild( - ui.NewText("Password", - conf.Ui.GetStyle(config.STYLE_HEADER))). + ui.NewText("Password").Bold(true)). At(4, 0) outgoing.AddChild(wizard.smtpPassword). At(5, 0) @@ -332,22 +321,20 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard { At(6, 0) outgoing.AddChild( ui.NewText("Server address "+ - "(e.g. 'mail.example.org' or 'mail.example.org:1313')", - conf.Ui.GetStyle(config.STYLE_HEADER))). + "(e.g. 'mail.example.org' or 'mail.example.org:1313')").Bold(true)). At(7, 0) outgoing.AddChild(wizard.smtpServer). At(8, 0) outgoing.AddChild(ui.NewFill(' ')). At(9, 0) outgoing.AddChild( - ui.NewText("Connection mode", - conf.Ui.GetStyle(config.STYLE_HEADER))). + ui.NewText("Connection mode").Bold(true)). At(10, 0) smtpMode := NewSelecter([]string{ "SMTP over SSL/TLS", "SMTP with STARTTLS", "Insecure SMTP", - }, 0, conf.Ui).Chooser(true).OnSelect(func(option string) { + }, 0).Chooser(true).OnSelect(func(option string) { switch option { case "SMTP over SSL/TLS": wizard.smtpMode = SMTP_OVER_TLS @@ -359,15 +346,15 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard { wizard.smtpUri() }) outgoing.AddChild(smtpMode).At(11, 0) - selecter = NewSelecter([]string{"Previous", "Next"}, 1, conf.Ui). + selecter = NewSelecter([]string{"Previous", "Next"}, 1). OnChoose(wizard.advance) outgoing.AddChild(ui.NewFill(' ')).At(12, 0) outgoing.AddChild(wizard.smtpStr).At(13, 0) outgoing.AddChild(ui.NewFill(' ')).At(14, 0) outgoing.AddChild( - ui.NewText("Copy sent messages to 'Sent' folder?", - conf.Ui.GetStyle(config.STYLE_HEADER))).At(15, 0) - copySent := NewSelecter([]string{"Yes", "No"}, 0, conf.Ui). + ui.NewText("Copy sent messages to 'Sent' folder?").Bold(true)). + At(15, 0) + copySent := NewSelecter([]string{"Yes", "No"}, 0). Chooser(true).OnChoose(func(option string) { switch option { case "Yes": @@ -393,16 +380,15 @@ func NewAccountWizard(conf *config.AercConfig, aerc *Aerc) *AccountWizard { {ui.SIZE_WEIGHT, ui.Const(1)}, }) complete.AddChild(ui.NewText( - "\nConfiguration complete!\n\n"+ - "You can go back and double check your settings, or choose 'Finish' to\n"+ - "save your settings to accounts.conf.\n\n"+ - "To add another account in the future, run ':new-account'.", - conf.Ui.GetStyle(config.STYLE_DEFAULT))) + "\nConfiguration complete!\n\n" + + "You can go back and double check your settings, or choose 'Finish' to\n" + + "save your settings to accounts.conf.\n\n" + + "To add another account in the future, run ':new-account'.")) selecter = NewSelecter([]string{ "Previous", "Finish & open tutorial", "Finish", - }, 1, conf.Ui).OnChoose(func(option string) { + }, 1).OnChoose(func(option string) { switch option { case "Previous": wizard.advance("Previous") |