diff --git a/ui/page/root/home_page.go b/ui/page/root/home_page.go index bf3ca7e38..32726340f 100644 --- a/ui/page/root/home_page.go +++ b/ui/page/root/home_page.go @@ -221,7 +221,7 @@ func (hp *HomePage) HandleUserInteractions() { } } if !isSendAvailable { - hp.showWarningNoWallet() + hp.showWarningNoSpendableWallet() return } hp.ParentWindow().ShowModal(send.NewSendPage(hp.Load, nil)) @@ -288,12 +288,12 @@ func (hp *HomePage) HandleUserInteractions() { } } -func (hp *HomePage) showWarningNoWallet() { +func (hp *HomePage) showWarningNoSpendableWallet() { go func() { info := modal.NewCustomModal(hp.Load). PositiveButtonStyle(hp.Theme.Color.Primary, hp.Theme.Color.Surface). SetContentAlignment(layout.W, layout.W, layout.Center). - Body(values.String(values.StrNoWalletsAvailable)) + Body(values.String(values.StrCannotSpendWatchOnlyWallet)) hp.ParentWindow().ShowModal(info) }() } diff --git a/ui/page/settings/settings_page.go b/ui/page/settings/settings_page.go index 9ff5657d4..c25ce6e6b 100644 --- a/ui/page/settings/settings_page.go +++ b/ui/page/settings/settings_page.go @@ -408,7 +408,7 @@ func (pg *SettingPage) subSectionLabel(title string) layout.Widget { func (pg *SettingPage) HandleUserInteractions() { for pg.language.Clicked() { langSelectorModal := preference.NewListPreference(pg.Load, - sharedW.LanguagePreferenceKey, values.DefaultLangauge, preference.LangOptions). + sharedW.LanguagePreferenceKey, values.DefaultLanguage, preference.LangOptions). Title(values.StrLanguage). UpdateValues(func(_ string) { values.SetUserLanguage(pg.AssetsManager.GetLanguagePreference()) @@ -641,9 +641,9 @@ func (pg *SettingPage) updatePrivacySettings() { // Part of the load.Page interface. func (pg *SettingPage) OnNavigatedFrom() {} -func (pg *SettingPage) setInitialSwitchStatus(switchComponent *cryptomaterial.Switch, ischecked bool) { +func (pg *SettingPage) setInitialSwitchStatus(switchComponent *cryptomaterial.Switch, isChecked bool) { switchComponent.SetChecked(false) - if ischecked { - switchComponent.SetChecked(ischecked) + if isChecked { + switchComponent.SetChecked(isChecked) } } diff --git a/ui/page/start_page.go b/ui/page/start_page.go index f818a7c28..86ae300a7 100644 --- a/ui/page/start_page.go +++ b/ui/page/start_page.go @@ -19,28 +19,33 @@ import ( "github.com/crypto-power/cryptopower/ui/values" ) -const StartPageID = "start_page" +const ( + StartPageID = "start_page" + // startupSettingsPageIndex is the index of the settings setup page. + startupSettingsPageIndex = 3 +) + +// settingsOptionPageWidth is an arbitrary width for the settings setup +// page. +var settingsOptionPageWidth = values.MarginPadding570 type ( C = layout.Context D = layout.Dimensions ) -type setupAction struct { +type settingsOption struct { title string - subTitle string + message string clickable *cryptomaterial.Clickable - border cryptomaterial.Border - width unit.Dp } type onBoardingScreen struct { title string subTitle string - image *cryptomaterial.Image - indicatorBtn *cryptomaterial.Clickable - languageDropdown *cryptomaterial.DropDown + image *cryptomaterial.Image // optional + indicatorBtn *cryptomaterial.Clickable // optional } type startPage struct { @@ -53,18 +58,18 @@ type startPage struct { addWalletButton cryptomaterial.Button nextButton cryptomaterial.Button - skipButton cryptomaterial.Button backButton cryptomaterial.Clickable - setupActions []*setupAction + settingsOptions []*settingsOption onBoardingScreens []onBoardingScreen + languageDropdown *cryptomaterial.DropDown loading bool isQuitting bool displayStartPage bool - currentPage int + currentPageIndex int selectedSetupAction int } @@ -77,16 +82,16 @@ func NewStartPage(l *load.Load, isShuttingDown ...bool) app.Page { addWalletButton: l.Theme.Button(values.String(values.StrAddWallet)), nextButton: l.Theme.Button(values.String(values.StrNext)), - skipButton: l.Theme.OutlineButton(values.String(values.StrSkip)), backButton: *l.Theme.NewClickable(true), selectedSetupAction: -1, } + sp.nextButton.Inset = layout.UniformInset(values.MarginPadding15) if len(isShuttingDown) > 0 { sp.isQuitting = isShuttingDown[0] } - sp.initPages() + sp.initPage() return sp } @@ -104,7 +109,7 @@ func (sp *startPage) OnNavigatedTo() { } if sp.AssetsManager.LoadedWalletsCount() > 0 { - sp.currentPage = -1 + sp.currentPageIndex = -1 sp.setLanguageSetting() // Set the log levels. sp.AssetsManager.GetLogLevels() @@ -118,42 +123,23 @@ func (sp *startPage) OnNavigatedTo() { } } -func (sp *startPage) initSetupItems() { - radius := cryptomaterial.CornerRadius{ - TopRight: 8, - TopLeft: 8, - BottomRight: 8, - BottomLeft: 8, - } +func (sp *startPage) initPage() { + sp.languageDropdown = sp.Theme.DropDown([]cryptomaterial.DropDownItem{ + {Text: values.String(values.StrEnglish)}, + {Text: values.String(values.StrSpanish)}, + {Text: values.String(values.StrFrench)}, + }, values.StartPageDropdownGroup, true) - setupActions := []*setupAction{ - { - title: values.String(values.StrRecommended), - subTitle: values.String(values.StrRecommendedContent), - clickable: sp.Theme.NewClickable(false), - border: cryptomaterial.Border{ - Radius: radius, - Color: sp.Theme.Color.DefaultThemeColors().White, - Width: values.MarginPadding2, - }, - width: values.MarginPadding110, - }, - { - title: values.String(values.StrAdvanced), - subTitle: values.String(values.StrAdvancedContent), - clickable: sp.Theme.NewClickable(false), - border: cryptomaterial.Border{ - Radius: radius, - Color: sp.Theme.Color.DefaultThemeColors().White, - Width: values.MarginPadding2, - }, - width: values.MarginPadding110, - }, - } - sp.setupActions = setupActions -} + sp.languageDropdown.MakeCollapsedLayoutVisibleWhenExpanded = true + sp.languageDropdown.Background = &sp.Theme.Color.Surface + sp.languageDropdown.FontWeight = font.SemiBold + sp.languageDropdown.SelectedItemIconColor = &sp.Theme.Color.Primary + sp.languageDropdown.BorderWidth = 2 + + sp.languageDropdown.Width = values.MarginPadding120 + sp.languageDropdown.ExpandedLayoutInset = layout.Inset{Top: values.MarginPadding50} + sp.languageDropdown.MakeCollapsedLayoutVisibleWhenExpanded = true -func (sp *startPage) initPages() { sp.onBoardingScreens = []onBoardingScreen{ { title: values.String(values.StrMultiWalletSupport), @@ -176,11 +162,19 @@ func (sp *startPage) initPages() { { title: values.String(values.StrChooseSetupType), subTitle: values.String(values.StrLanguage), - languageDropdown: sp.Theme.DropDown([]cryptomaterial.DropDownItem{ - {Text: values.String(values.StrEnglish)}, - {Text: values.String(values.StrSpanish)}, - {Text: values.String(values.StrFrench)}, - }, values.StartPageDropdownGroup, false), + }, + } + + sp.settingsOptions = []*settingsOption{ + { + title: values.String(values.StrRecommended), + message: values.String(values.StrRecommendedSettingsMsg), + clickable: sp.Theme.NewClickable(false), + }, + { + title: values.String(values.StrAdvanced), + message: values.String(values.StrAdvancedSettingsMsg), + clickable: sp.Theme.NewClickable(false), }, } } @@ -237,38 +231,30 @@ func (sp *startPage) HandleUserInteractions() { sp.ParentNavigator().Display(createWalletPage) } - if sp.skipButton.Clicked() { - sp.currentPage = -1 - } - for sp.nextButton.Clicked() { - // if sp.selectedSetupAction == 0 { - // sp.recommendedSettings() - // } else if sp.selectedSetupAction == 1 { - // sp.ParentNavigator().Display(settings.NewSettingsPage(sp.Load)) - // } - //Requires refactor of settings page - if sp.currentPage == len(sp.onBoardingScreens)-1 { // index starts at 0 - sp.currentPage = -1 // we have reached the last screen. + // TODO: Handle Selected settings option (language and advanced or + // recommended settings). Might requires refactor of settings page. + if sp.currentPageIndex == len(sp.onBoardingScreens)-1 { // index starts at 0 + sp.currentPageIndex = -1 // we have reached the last screen. } else { - sp.currentPage++ + sp.currentPageIndex++ } } - for i, item := range sp.setupActions { + for i, item := range sp.settingsOptions { for item.clickable.Clicked() { sp.selectedSetupAction = i } } for sp.backButton.Clicked() { - sp.currentPage-- + sp.currentPageIndex-- } for i, onBoardingScreen := range sp.onBoardingScreens { - if i < 3 { + if i < startupSettingsPageIndex { if onBoardingScreen.indicatorBtn.Clicked() { - sp.currentPage = i + sp.currentPageIndex = i } } } @@ -303,7 +289,7 @@ func (sp *startPage) Layout(gtx C) D { // Desktop layout func (sp *startPage) layoutDesktop(gtx C) D { - if sp.currentPage < 0 || sp.isQuitting { + if sp.currentPageIndex < 0 || sp.isQuitting { return sp.loadingSection(gtx) } @@ -385,7 +371,6 @@ func (sp *startPage) loadingSection(gtx C) D { Left: values.MarginPadding24, Right: values.MarginPadding24, }.Layout(gtx, sp.addWalletButton.Layout) - }), ) }) @@ -393,7 +378,7 @@ func (sp *startPage) loadingSection(gtx C) D { // Mobile layout func (sp *startPage) layoutMobile(gtx C) D { - if sp.currentPage < 0 { + if sp.currentPageIndex < 0 { return sp.loadingSection(gtx) } @@ -411,30 +396,61 @@ func (sp *startPage) layoutMobile(gtx C) D { func (sp *startPage) onBoardingScreensLayout(gtx C) D { return layout.Flex{Axis: layout.Vertical}.Layout(gtx, layout.Rigid(func(gtx C) D { - if sp.currentPage == 3 { + if sp.currentPageIndex == startupSettingsPageIndex { return layout.Inset{Bottom: values.MarginPaddingMinus145, Left: values.MarginPadding20, Top: values.MarginPadding20}.Layout(gtx, sp.pageHeaderLayout) } return D{} }), layout.Rigid(func(gtx C) D { return sp.pageLayout(gtx, func(gtx C) D { - if sp.currentPage > 2 { + if sp.currentPageIndex > startupSettingsPageIndex-1 { return layout.Flex{ Alignment: layout.Middle, Axis: layout.Vertical, }.Layout(gtx, layout.Rigid(func(gtx C) D { - lblTitle := sp.Theme.Label(values.TextSize16, sp.onBoardingScreens[sp.currentPage].title) - lblTitle.Font.Weight = font.Bold - return layout.Inset{Bottom: values.MarginPadding80}.Layout(gtx, lblTitle.Layout) + return layout.Inset{Bottom: values.MarginPaddingMinus195, Left: values.MarginPadding20, Top: values.MarginPadding20}.Layout(gtx, sp.pageHeaderLayout) }), layout.Rigid(func(gtx C) D { - return layout.Inset{Bottom: values.MarginPadding20}.Layout(gtx, sp.languageLayout) - }), - layout.Rigid(sp.setupButton), - layout.Rigid(func(gtx C) D { - gtx.Constraints.Min.X = gtx.Dp(values.MarginPadding570) - return layout.Inset{Top: values.MarginPadding20}.Layout(gtx, sp.nextButton.Layout) + return sp.pageLayout(gtx, func(gtx C) D { + return layout.Stack{Alignment: layout.Center}.Layout(gtx, + layout.Expanded(func(gtx C) D { + return layout.Inset{Top: values.MarginPadding200}.Layout(gtx, func(gtx C) D { + return layout.Flex{Axis: layout.Vertical}.Layout(gtx, + layout.Rigid(sp.settingsOptionsLayout), + layout.Rigid(func(gtx C) D { + gtx.Constraints.Min.X = gtx.Dp(settingsOptionPageWidth) + return layout.Inset{Top: values.MarginPadding20}.Layout(gtx, sp.nextButton.Layout) + }), + ) + }) + }), + layout.Stacked(func(gtx C) D { + return layout.Inset{Top: values.MarginPaddingMinus200}.Layout(gtx, func(gtx C) D { + return layout.Flex{Axis: layout.Vertical, Alignment: layout.Middle}.Layout(gtx, + layout.Rigid(func(gtx C) D { + titleLabel := sp.Theme.Label(values.TextSize16, sp.onBoardingScreens[sp.currentPageIndex].title) + titleLabel.Font.Weight = font.Bold + return layout.Inset{Bottom: values.MarginPadding40}.Layout(gtx, titleLabel.Layout) + }), + layout.Rigid(func(gtc C) D { + gtx.Constraints.Max.Y = gtx.Dp(values.MarginPadding48) + return layout.Flex{Alignment: layout.Middle}.Layout(gtx, + layout.Rigid(func(gtx C) D { + langTitle := sp.Theme.Label(values.TextSize16, values.String(values.StrLanguage)) + langTitle.Font.Weight = font.Bold + return layout.Inset{Top: values.MarginPadding5}.Layout(gtx, langTitle.Layout) + }), + layout.Rigid(func(gtx C) D { + return layout.Inset{Top: values.MarginPadding8}.Layout(gtx, sp.languageDropdown.Layout) + }), + ) + }), + ) + }) + }), + ) + }) }), ) } @@ -442,132 +458,75 @@ func (sp *startPage) onBoardingScreensLayout(gtx C) D { Alignment: layout.Middle, Axis: layout.Vertical, }.Layout(gtx, - layout.Rigid(func(gtx C) D { - list := &layout.List{Axis: layout.Horizontal} - return list.Layout(gtx, len(sp.onBoardingScreens), func(gtx C, i int) D { - if i == sp.currentPage { - return sp.pageSections(gtx, sp.onBoardingScreens[i]) - } - return D{} - }) - }), + layout.Rigid(sp.onBoardingScreenLayout), layout.Rigid(func(gtx C) D { return layout.Inset{ - Top: values.MarginPadding35, - Bottom: values.MarginPadding35, + Top: values.MarginPadding30, + Bottom: values.MarginPadding30, }.Layout(gtx, sp.currentPageIndicatorLayout) }), layout.Rigid(func(gtx C) D { - gtx.Constraints.Min.X = gtx.Dp(values.MarginPadding350) + gtx.Constraints.Min.X = gtx.Dp(values.MarginPadding420) return sp.nextButton.Layout(gtx) }), - layout.Rigid(func(gtx C) D { - return layout.Inset{Top: values.MarginPadding10}.Layout(gtx, func(gtx C) D { - gtx.Constraints.Min.X = gtx.Dp(values.MarginPadding350) - return sp.skipButton.Layout(gtx) - }) - }), ) }) }), ) - } -func (sp *startPage) languageLayout(gtx C) D { - // return layout.Flex{Axis: layout.Horizontal, Alignment: layout.Middle}.Layout(gtx, - return cryptomaterial.LinearLayout{ - Width: cryptomaterial.WrapContent, - Height: cryptomaterial.WrapContent, - Orientation: layout.Horizontal, - Direction: layout.Center, - Alignment: layout.Middle, - }.Layout(gtx, - layout.Rigid(func(gtx C) D { - langTitle := sp.Theme.Label(values.TextSize16, values.String(values.StrLanguage)) - langTitle.Font.Weight = font.Bold - return layout.Inset{Top: values.MarginPadding5}.Layout(gtx, langTitle.Layout) - }), - layout.Rigid(func(gtx C) D { - return layout.Inset{Top: values.MarginPadding5}.Layout(gtx, func(gtx C) D { - return layout.Stack{}.Layout(gtx, - layout.Expanded(func(gtx C) D { - return sp.onBoardingScreens[sp.currentPage].languageDropdown.Layout(gtx) - }), - ) - }) - }), - ) +func (sp *startPage) onBoardingScreenLayout(gtx C) D { + list := layout.List{Axis: layout.Horizontal} + return list.Layout(gtx, len(sp.onBoardingScreens), func(gtx C, i int) D { + if i != sp.currentPageIndex { + return D{} + } + return sp.pageSections(gtx, sp.onBoardingScreens[sp.currentPageIndex]) + }) } -func (sp *startPage) setupButton(gtx C) D { - return layout.Flex{Axis: layout.Vertical, Spacing: layout.SpaceEnd}.Layout(gtx, +func (sp *startPage) settingsOptionsLayout(gtx C) D { + padding := values.MarginPadding16 + optionWidth := (settingsOptionPageWidth - padding) / unit.Dp(len(sp.settingsOptions)) + return layout.Flex{Axis: layout.Vertical, Spacing: layout.SpaceBetween}.Layout(gtx, layout.Rigid(func(gtx C) D { list := layout.List{} - return list.Layout(gtx, len(sp.setupActions), func(gtx C, i int) D { - item := sp.setupActions[i] - - col := sp.Theme.Color.White + return list.Layout(gtx, len(sp.settingsOptions), func(gtx C, i int) D { + item := sp.settingsOptions[i] btnTitle := sp.Theme.Label(values.TextSize20, item.title) btnTitle.Font.Weight = font.Bold - content := sp.Theme.Label(values.TextSize16, item.subTitle) + content := sp.Theme.Label(values.TextSize16, item.message) content.Alignment = text.Alignment(layout.Middle) - radius := cryptomaterial.CornerRadius{ - TopLeft: 8, - TopRight: 8, - BottomRight: 8, - BottomLeft: 8, + borderWidth := values.MarginPadding2 + if sp.selectedSetupAction != i && !item.clickable.IsHovered() { + borderWidth = 0 } - border := sp.Theme.Color.White - item.border = cryptomaterial.Border{ - Radius: radius, - Color: border, - Width: values.MarginPadding2, + inset := layout.Inset{} + if i == 0 { + inset.Right = padding } - - if sp.selectedSetupAction == i { - - col = sp.Theme.Color.White - - item.border = cryptomaterial.Border{ - Radius: radius, - Color: sp.Theme.Color.Primary, - Width: values.MarginPadding2, - } - } - - if item.clickable.IsHovered() { - item.border = cryptomaterial.Border{ - Radius: radius, - Color: sp.Theme.Color.Primary, - Width: values.MarginPadding2, - } - } - - return layout.Inset{ - Right: values.MarginPadding8, - }.Layout(gtx, func(gtx C) D { + return inset.Layout(gtx, func(gtx C) D { return cryptomaterial.LinearLayout{ - Width: gtx.Dp(270), + Width: gtx.Dp(optionWidth), Height: gtx.Dp(180), Orientation: layout.Vertical, Direction: layout.Center, Alignment: layout.Middle, Clickable: item.clickable, - Border: item.border, - Background: col, - Padding: layout.Inset{ - Top: values.MarginPadding20, - Left: values.MarginPadding20, - Right: values.MarginPadding20, + Background: sp.Theme.Color.DefaultThemeColors().White, + Border: cryptomaterial.Border{ + Radius: cryptomaterial.Radius(8), + Color: sp.Theme.Color.Primary, + Width: borderWidth, }, - Margin: layout.Inset{Bottom: values.MarginPadding15}, + Padding: layout.UniformInset(values.MarginPadding20), + Margin: layout.Inset{Bottom: values.MarginPadding15}, }.Layout(gtx, layout.Rigid(btnTitle.Layout), layout.Rigid(func(gtx C) D { - return layout.Inset{Top: values.MarginPadding5, Bottom: values.MarginPadding10}.Layout(gtx, content.Layout) + return layout.Inset{Top: values.MarginPadding8}.Layout(gtx, content.Layout) }), ) }) @@ -613,16 +572,20 @@ func (sp *startPage) pageSections(gtx C, onBoardingScreen onBoardingScreen) D { } func (sp *startPage) currentPageIndicatorLayout(gtx C) D { - if sp.currentPage < 0 { + if sp.currentPageIndex < 0 { return D{} } list := &layout.List{Axis: layout.Horizontal} return list.Layout(gtx, len(sp.onBoardingScreens), func(gtx C, i int) D { - if i < 3 { + return layout.Inset{Top: values.MarginPadding35, Bottom: values.MarginPadding35}.Layout(gtx, func(gtx C) D { + if i > startupSettingsPageIndex-1 { + return D{} + } + ic := cryptomaterial.NewIcon(sp.Theme.Icons.ImageBrightness1) ic.Color = values.TransparentColor(values.TransparentBlack, 0.2) - if i == sp.currentPage { + if i == sp.currentPageIndex { ic.Color = sp.Theme.Color.Primary } return layout.Inset{ @@ -633,15 +596,14 @@ func (sp *startPage) currentPageIndicatorLayout(gtx C) D { return ic.Layout(gtx, values.MarginPadding12) }) }) - } - return D{} + }) }) } func (sp *startPage) setLanguageSetting() { langPre := sp.AssetsManager.GetLanguagePreference() if langPre == "" { - sp.AssetsManager.SetLanguagePreference(values.DefaultLangauge) + sp.AssetsManager.SetLanguagePreference(values.DefaultLanguage) } values.SetUserLanguage(langPre) } diff --git a/ui/values/dimensions.go b/ui/values/dimensions.go index 1c004b5d7..56dae48a1 100644 --- a/ui/values/dimensions.go +++ b/ui/values/dimensions.go @@ -83,6 +83,7 @@ var ( MarginPadding200 = unit.Dp(200) MarginPadding218 = unit.Dp(218) MarginPadding221 = unit.Dp(221) + MarginPaddingMinus200 = unit.Dp(-200) MarginPadding250 = unit.Dp(250) MarginPaddingMinus230 = unit.Dp(-230) MarginPadding280 = unit.Dp(280) @@ -92,6 +93,7 @@ var ( MarginPadding372 = unit.Dp(372) MarginPadding377 = unit.Dp(377) MarginPadding390 = unit.Dp(390) + MarginPadding420 = unit.Dp(420) MarginPadding450 = unit.Dp(450) MarginPadding500 = unit.Dp(500) DP515 = unit.Dp(515) diff --git a/ui/values/localizable/en.go b/ui/values/localizable/en.go index d056b2e5c..9b96aa78b 100644 --- a/ui/values/localizable/en.go +++ b/ui/values/localizable/en.go @@ -31,7 +31,7 @@ const EN = ` "addWallet" = "Add wallet" "adminToTriggerVoting" = "Waiting for admin to trigger the start of voting" "advanced" = "Advanced" -"advancedContent" = "Allow to customize all settings. Recommended for advanced users." +"advancedSettingsMsg" = "Allow to customize all settings. Recommended for advanced users." "agendas" = "Agendas" "ago" = "ago" "all" = "All" @@ -465,7 +465,7 @@ const EN = ` "recentTransactions" = "Recent Transactions" "reconnect" = "Reconnect" "recommended" = "Recommended" -"recommendedContent" = " Use the most common settings. Recommended for most users." +"recommendedSettingsMsg" = " Use the most common settings. Recommended for most users." "refresh" = "Refresh" "rejected" = "Rejected" "remove" = "Remove" @@ -802,7 +802,6 @@ const EN = ` "bondStrengthErrMsg" = "Bond Strength must be a valid number" "minimumBondStrength" = "Minimum Bond Strength is %d" "assets" = "Assets" -"noWalletsAvailable" = "You cannot spend from a watch only wallet, try creating another wallet." "createAssetWalletToSwapMsg" = "You need to create a %s wallet to swap." "accounts" = "Accounts" "amountSpendable" = "Amount Spendable" @@ -843,4 +842,6 @@ const EN = ` "assetAmount" = "Amount (%s)" "booked" = "Booked" "executed" = "Executed" +"cannotSpendWatchOnlyWallet" = "You cannot spend from a watch only wallet, try creating another wallet." + ` diff --git a/ui/values/strings.go b/ui/values/strings.go index fa55636c4..28aa7169c 100644 --- a/ui/values/strings.go +++ b/ui/values/strings.go @@ -10,14 +10,14 @@ import ( ) const ( - DefaultLangauge = localizable.ENGLISH + DefaultLanguage = localizable.ENGLISH commentPrefix = "/" ) var ( rex = regexp.MustCompile(`(?m)("(?:\\.|[^"\\])*")\s*=\s*("(?:\\.|[^"\\])*")`) // "key"="value" Languages = []string{localizable.ENGLISH, localizable.CHINESE, localizable.FRENCH, localizable.SPANISH} - UserLanguages = []string{DefaultLangauge} // order of preference + UserLanguages = []string{DefaultLanguage} // order of preference ) var languageStrings map[string]map[string]string @@ -77,8 +77,8 @@ func hasLanguage(language string) bool { func SetUserLanguage(lang string) { if hasLanguage(lang) { languages := []string{lang} - if lang != DefaultLangauge { - languages = append(languages, DefaultLangauge) + if lang != DefaultLanguage { + languages = append(languages, DefaultLanguage) } UserLanguages = languages @@ -140,7 +140,7 @@ const ( StrAddWallet = "addWallet" StrAdminToTriggerVoting = "adminToTriggerVoting" StrAdvanced = "advanced" - StrAdvancedContent = "advancedContent" + StrAdvancedSettingsMsg = "advancedSettingsMsg" StrAgendas = "agendas" StrAgo = "ago" StrAll = "all" @@ -574,7 +574,7 @@ const ( StrRecentProposals = "recentProposals" StrRecentTransactions = "recentTransactions" StrRecommended = "recommended" - StrRecommendedContent = "recommendedContent" + StrRecommendedSettingsMsg = "recommendedSettingsMsg" StrReconnect = "reconnect" StrRefresh = "refresh" StrRejected = "rejected" @@ -912,7 +912,6 @@ const ( StrBondStrengthErrMsg = "bondStrengthErrMsg" StrMinimumBondStrength = "minimumBondStrength" StrAssets = "assets" - StrNoWalletsAvailable = "noWalletsAvailable" StrCreateAssetWalletToSwapMsg = "createAssetWalletToSwapMsg" StrAccounts = "accounts" StrAmountSpendable = "amountSpendable" @@ -952,4 +951,5 @@ const ( StrAssetAmount = "assetAmount" StrBooked = "booked" StrExecuted = "executed" + StrCannotSpendWatchOnlyWallet = "cannotSpendWatchOnlyWallet" )