From f1dcdfdde912687ab8f22a28fb3d0cb88c171862 Mon Sep 17 00:00:00 2001 From: morrison Date: Tue, 5 Nov 2019 19:30:54 +0100 Subject: [PATCH 01/73] added transaction filter popup --- cli/go.sum | 24 ++++++--- fyne/pages/history.go | 113 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 128 insertions(+), 9 deletions(-) diff --git a/cli/go.sum b/cli/go.sum index db315bee2..3acbe15f1 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -14,6 +14,7 @@ github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0 github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= github.com/asdine/storm v0.0.0-20190216191021-fe89819f6282 h1:DmSVc81daQAPvXwcCZi0W6A14sTCYQ1QI21C0E37KoY= github.com/asdine/storm v0.0.0-20190216191021-fe89819f6282/go.mod h1:cMLKpjHSP4q0P133fV15ojQgwWWB2IMv+hrFsmBF/wI= +github.com/atotto/clipboard v0.1.2 h1:YZCtFu5Ie8qX2VmVTBnrqLSiU9XOWwqNRmdT3gIQzbY= github.com/atotto/clipboard v0.1.2/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= @@ -181,9 +182,10 @@ github.com/dgraph-io/badger v1.5.4/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMT github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f h1:dDxpBYafY/GYpcl+LS4Bn3ziLPuEdGRkRjYAbSlWxSA= github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= +github.com/gdamore/tcell v1.1.1 h1:U73YL+jMem2XfhvaIUfPO6MpJawaG92B2funXVb9qLs= github.com/gdamore/tcell v1.1.1/go.mod h1:K1udHkiR3cOtlpKG5tZPD5XxrF7v2y7lDq7Whcj+xkQ= -github.com/go-chi/chi v4.0.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= github.com/go-gl/gl v0.0.0-20181026044259-55b76b7df9d2/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk= github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk= github.com/go-gl/glfw v0.0.0-20181213070059-819e8ce5125f/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -214,8 +216,13 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.2/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lucasb-eyer/go-colorful v0.0.0-20181028223441-12d3b2882a08 h1:5MnxBC15uMxFv5FY/J/8vzyaBiArCOkMdFT9Jsw78iY= github.com/lucasb-eyer/go-colorful v0.0.0-20181028223441-12d3b2882a08/go.mod h1:NXg0ArsFk0Y01623LgUqoqcouGDB+PwCCQlrwrG6xJ4= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -225,13 +232,16 @@ github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/raedahgroup/dcrlibwallet v1.0.1-0.20190807181808-37b6666fe764 h1:arCUsqsYbfYPNlNjP6H0ylKJS8H31t/AfFfKd/VHzKY= -github.com/raedahgroup/dcrlibwallet v1.0.1-0.20190807181808-37b6666fe764/go.mod h1:7BxsN3VU3KWUt9R8eHgrBI88kE7/WWSfN0yl0vU1SM8= -github.com/raedahgroup/dcrlibwallet v1.1.0 h1:UeOqLi3h9oQGUlhwwmCspJlEAPD2IfrHdu5EPtph54w= -github.com/raedahgroup/dcrlibwallet v1.1.0/go.mod h1:szxgNhCQ/GRyFpmkfYi3T3ZkXPx9Hm9j0EnjaBfJK/o= -github.com/raedahgroup/godcr v0.0.0-20190904090857-0b0e4e4d418e h1:COoahDOspffo0n+E/x9dzHMu6pI9clopPa4jWQA+MLw= -github.com/raedahgroup/godcr v0.0.0-20190904090857-0b0e4e4d418e/go.mod h1:pn/6eTayjXPhIzbVYMPuwRzRcjszh9W+NL/T0VZ4VwI= +github.com/raedahgroup/dcrlibwallet v1.1.1-0.20190928085114-bcc6e6b7769a h1:BvFVstGjzuNeFsNTmAZCfPxK2u51EGQVAdFKCauqaNE= +github.com/raedahgroup/dcrlibwallet v1.1.1-0.20190928085114-bcc6e6b7769a/go.mod h1:6AGgglq9BB0twJnZnHvfH8hIQrbw6yBJSPp9QI+hBk0= +github.com/rivo/tview v0.0.0-20190113120821-e5e361b9d790 h1:yt1AZgiBi8RcCo0PoyU4gSFwKjlbkSGRFVZGz7R6oB0= github.com/rivo/tview v0.0.0-20190113120821-e5e361b9d790/go.mod h1:J4W+hErFfITUbyFAEXizpmkuxX7ZN56dopxHB4XQhMw= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9 h1:lpEzuenPuO1XNTeikEmvqYFcU37GVLl8SRNblzyvGBE= github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9/go.mod h1:PLPIyL7ikehBD1OAjmKKiOEhbvWyHGaNDjquXMcYABo= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= diff --git a/fyne/pages/history.go b/fyne/pages/history.go index d0414c6f2..d78c6b351 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -1,10 +1,119 @@ package pages import ( + "fmt" + // "image/color" + "fyne.io/fyne" "fyne.io/fyne/widget" + // "fyne.io/fyne/canvas" + + "github.com/raedahgroup/dcrlibwallet" + "github.com/raedahgroup/godcr/fyne/widgets" + "github.com/raedahgroup/godcr/fyne/assets" ) -func historyPageContent() fyne.CanvasObject { - return widget.NewLabelWithStyle("History", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) + +func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) fyne.CanvasObject { + pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) + + t := prepareTxFilterDropDown(wallet, window) + output := widget.NewVBox( + widgets.NewVSpacer(5), + widget.NewHBox(pageTitleLabel), + widgets.NewVSpacer(5), + t, + ) + + return widget.NewHBox(widgets.NewHSpacer(18), output) +} + +func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window) *widgets.ClickableBox { + var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} + var allTxFilters = map[string]int32{ + "All": dcrlibwallet.TxFilterAll, + "Sent": dcrlibwallet.TxFilterSent, + "Received": dcrlibwallet.TxFilterReceived, + "Transferred": dcrlibwallet.TxFilterTransferred, + "Coinbase": dcrlibwallet.TxFilterCoinBase, + "Staking": dcrlibwallet.TxFilterStaking, + } + + txCountForFilter, _ := wallet.CountTransactions(allTxFilters["All"]) + selectedAccountLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) + + activeFiltersWithTxCounts := make(map[int32]int) + + var accountSelectionPopup *widget.PopUp + accountListWidget := widget.NewVBox() + for _, filterName := range allTxFilterNames { + filterId := allTxFilters[filterName] + txCountForFilter, _ := wallet.CountTransactions(filterId) + // if txCountErr != nil { + // errorMessage := fmt.Sprintf("Cannot load history page. Error getting transaction count for filter %s: %s", + // filterName, txCountErr.Error()) + // displayMessage(errorMessage, MessageKindError) + // return nil + // } + + if txCountForFilter > 0 { + activeFiltersWithTxCounts[filterId] = txCountForFilter + accountsView := widget.NewHBox( + widgets.NewHSpacer(5), + widget.NewLabel(fmt.Sprintf("%s (%d)", filterName, txCountForFilter)), + widgets.NewHSpacer(5), + ) + + accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { + selectedAccountLabel.SetText(fmt.Sprintf("%s (%d)", filterName, txCountForFilter)) + accountSelectionPopup.Hide() + })) + } + } + + // if len(activeFiltersWithTxCounts) == 0 { + // displayMessage("No transactions yet", MessageKindInfo) + // return nil + // } + + // accountSelectionPopup create a popup that has account names with spendable amount + accountSelectionPopup = widget.NewPopUp( + widget.NewVBox( + accountListWidget, + ), window.Canvas(), + ) + accountSelectionPopup.Hide() + + + + // // dropDown selection change listener + // txFilterDropDown.AddDropDown("", txFilterSelectionOptions, 0, func(selectedOption string, index int) { + // selectedFilterName := strings.Split(selectedOption, " ")[0] + // selectedFilterId := allTxFilters[selectedFilterName] + // if selectedFilterId != historyPageData.currentTxFilter { + // go fetchAndDisplayTransactions(0, selectedFilterId) + // } + // }) + + // accountTab shows the selected account + icons, _ := assets.GetIcons(assets.CollapseIcon) + accountTab := widget.NewHBox( + selectedAccountLabel, + widgets.NewHSpacer(8), + widget.NewIcon(icons[assets.CollapseIcon]), + ) + + var accountDropdown *widgets.ClickableBox + accountDropdown = widgets.NewClickableBox(accountTab, func() { + accountSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( + accountDropdown).Add(fyne.NewPos(0, accountDropdown.Size().Height))) + accountSelectionPopup.Show() + }) + + return accountDropdown } + +// func errorHandler(err string, errorLabel *widget.Label) { +// errorLabel.SetText(err) +// errorLabel.Show() +// } From eae10b83f12bab7e3867b652ff86698a1c42d72b Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 6 Nov 2019 07:51:18 +0100 Subject: [PATCH 02/73] fixed dropdown selection issues --- fyne/pages/history.go | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index d78c6b351..4a0d6fcfd 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -15,20 +15,26 @@ import ( func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) fyne.CanvasObject { + // error handler + var errorLabel *widget.Label + errorLabel = widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) + errorLabel.Hide() + pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - t := prepareTxFilterDropDown(wallet, window) + t := prepareTxFilterDropDown(wallet, window, errorLabel) output := widget.NewVBox( widgets.NewVSpacer(5), widget.NewHBox(pageTitleLabel), widgets.NewVSpacer(5), t, + errorLabel, ) return widget.NewHBox(widgets.NewHSpacer(18), output) } -func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window) *widgets.ClickableBox { +func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label) *widgets.ClickableBox { var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} var allTxFilters = map[string]int32{ "All": dcrlibwallet.TxFilterAll, @@ -45,36 +51,35 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window) activeFiltersWithTxCounts := make(map[int32]int) var accountSelectionPopup *widget.PopUp + var accountsView *widget.Box accountListWidget := widget.NewVBox() for _, filterName := range allTxFilterNames { filterId := allTxFilters[filterName] - txCountForFilter, _ := wallet.CountTransactions(filterId) - // if txCountErr != nil { - // errorMessage := fmt.Sprintf("Cannot load history page. Error getting transaction count for filter %s: %s", - // filterName, txCountErr.Error()) - // displayMessage(errorMessage, MessageKindError) - // return nil - // } + txCountForFilter, txCountErr := wallet.CountTransactions(filterId) + if txCountErr != nil { + errorMessage := fmt.Sprintf("Cannot load history page. Error getting transaction count for filter %s: %s", + filterName, txCountErr.Error()) + errorHandler(errorMessage, errorLabel) + return nil + } if txCountForFilter > 0 { activeFiltersWithTxCounts[filterId] = txCountForFilter - accountsView := widget.NewHBox( + filter := fmt.Sprintf("%s (%d)", filterName, txCountForFilter) + accountsView = widget.NewHBox( widgets.NewHSpacer(5), - widget.NewLabel(fmt.Sprintf("%s (%d)", filterName, txCountForFilter)), + widget.NewLabel(filter), widgets.NewHSpacer(5), ) - accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { - selectedAccountLabel.SetText(fmt.Sprintf("%s (%d)", filterName, txCountForFilter)) - accountSelectionPopup.Hide() - })) + accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { + selectedAccountLabel.SetText(filter) + accountSelectionPopup.Hide() + })) } } - // if len(activeFiltersWithTxCounts) == 0 { - // displayMessage("No transactions yet", MessageKindInfo) - // return nil - // } + // accountSelectionPopup create a popup that has account names with spendable amount accountSelectionPopup = widget.NewPopUp( From d347c73b0118734633d29b6966e1fc2f58abf017 Mon Sep 17 00:00:00 2001 From: morrison Date: Sat, 9 Nov 2019 22:33:26 +0100 Subject: [PATCH 03/73] added table.go, and table header --- fyne/helpers/amount.go | 59 +++++++++++++++++++++++++++++ fyne/pages/history.go | 84 +++++++++++++++++++++++++++++++----------- fyne/widgets/table.go | 3 +- 3 files changed, 124 insertions(+), 22 deletions(-) create mode 100644 fyne/helpers/amount.go diff --git a/fyne/helpers/amount.go b/fyne/helpers/amount.go new file mode 100644 index 000000000..83ed14f61 --- /dev/null +++ b/fyne/helpers/amount.go @@ -0,0 +1,59 @@ +package helpers + +import ( + "fmt" + "math" + "strconv" + "strings" + + "github.com/decred/dcrd/dcrutil" +) + +func DecimalPortion(n float64) string { + decimalPlaces := fmt.Sprintf("%f", n-math.Floor(n)) // produces 0.xxxx0000 + decimalPlaces = strings.Replace(decimalPlaces, "0.", "", -1) // remove 0. + decimalPlaces = strings.TrimRight(decimalPlaces, "0") // remove trailing 0s + return decimalPlaces +} + +func SplitAmountIntoParts(amount float64) []string { + balanceParts := make([]string, 3) + + wholeNumber := int(math.Floor(amount)) + balanceParts[0] = strconv.Itoa(wholeNumber) + + decimalPortion := DecimalPortion(amount) + if len(decimalPortion) == 0 { + balanceParts[2] = " DCR" + } else if len(decimalPortion) <= 2 { + balanceParts[1] = fmt.Sprintf(".%s DCR", decimalPortion) + } else { + balanceParts[1] = fmt.Sprintf(".%s", decimalPortion[0:2]) + balanceParts[2] = fmt.Sprintf("%s DCR", decimalPortion[2:]) + } + + return balanceParts +} + +func MaxDecimalPlaces(amounts []int64) (maxDecimalPlaces int) { + for _, amount := range amounts { + decimalPortion := DecimalPortion(dcrutil.Amount(amount).ToCoin()) + nDecimalPlaces := len(decimalPortion) + if nDecimalPlaces > maxDecimalPlaces { + maxDecimalPlaces = nDecimalPlaces + } + } + return +} + +func FormatAmountDisplay(amount int64, maxDecimalPlaces int) string { + dcrAmount := dcrutil.Amount(amount).ToCoin() + wholeNumber := int(math.Floor(dcrAmount)) + decimalPortion := DecimalPortion(dcrAmount) + + if len(decimalPortion) == 0 { + return fmt.Sprintf("%2d%-*s DCR", wholeNumber, maxDecimalPlaces+1, decimalPortion) + } else { + return fmt.Sprintf("%2d.%-*s DCR", wholeNumber, maxDecimalPlaces, decimalPortion) + } +} diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 4a0d6fcfd..faeb8d21a 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -11,7 +11,9 @@ import ( "github.com/raedahgroup/dcrlibwallet" "github.com/raedahgroup/godcr/fyne/widgets" "github.com/raedahgroup/godcr/fyne/assets" + // "github.com/raedahgroup/godcr/fyne/helpers" ) +const txPerPage int32 = 25 func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) fyne.CanvasObject { @@ -22,12 +24,14 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) + tx := fetchAndDisplayTransactions(wallet, 0, dcrlibwallet.TxFilterAll) t := prepareTxFilterDropDown(wallet, window, errorLabel) output := widget.NewVBox( widgets.NewVSpacer(5), widget.NewHBox(pageTitleLabel), widgets.NewVSpacer(5), t, + tx, errorLabel, ) @@ -72,15 +76,19 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, widgets.NewHSpacer(5), ) - accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { - selectedAccountLabel.SetText(filter) - accountSelectionPopup.Hide() - })) + accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { + // selectedFilterName := strings.Split(filter, " ")[0] + // selectedFilterId := allTxFilters[selectedFilterName] + // if selectedFilterId != historyPageData.currentTxFilter { + // go fetchAndDisplayTransactions(0, selectedFilterId) + // } + + selectedAccountLabel.SetText(filter) + accountSelectionPopup.Hide() + })) } } - - // accountSelectionPopup create a popup that has account names with spendable amount accountSelectionPopup = widget.NewPopUp( widget.NewVBox( @@ -89,17 +97,6 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, ) accountSelectionPopup.Hide() - - - // // dropDown selection change listener - // txFilterDropDown.AddDropDown("", txFilterSelectionOptions, 0, func(selectedOption string, index int) { - // selectedFilterName := strings.Split(selectedOption, " ")[0] - // selectedFilterId := allTxFilters[selectedFilterName] - // if selectedFilterId != historyPageData.currentTxFilter { - // go fetchAndDisplayTransactions(0, selectedFilterId) - // } - // }) - // accountTab shows the selected account icons, _ := assets.GetIcons(assets.CollapseIcon) accountTab := widget.NewHBox( @@ -118,7 +115,52 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, return accountDropdown } -// func errorHandler(err string, errorLabel *widget.Label) { -// errorLabel.SetText(err) -// errorLabel.Show() -// } +func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txOffset int, filter int32) *widget.Box { + tableHeading := widget.NewHBox( + widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) + + + // txns, err := wallet.GetTransactionsRaw(int32(txOffset), txPerPage, dcrlibwallet.TxFilterAll) + // if err != nil { + // // displayMessage(err.Error(), MessageKindError) + // // return + // } + + // // calculate max number of digits after decimal point for all tx amounts + // inputsAndOutputsAmount := make([]int64, len(txns)) + // for i, tx := range txns { + // inputsAndOutputsAmount[i] = tx.Amount + // } + // maxDecimalPlacesForTxAmounts := helpers.MaxDecimalPlaces(inputsAndOutputsAmount) + + // var hBox []*widget.Box + // for i, tx := range txns { + // status := "Pending" + // confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 + // if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { + // status = "Confirmed" + // } + + // formattedAmount := helpers.FormatAmountDisplay(tx.Amount, maxDecimalPlacesForTxAmounts) + // trimmedHash := txns[i].Hash[:25] + "..." + // hBox = append(hBox, widget.NewHBox( + // widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.ExtractDateOrTime(tx.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), + // widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.TransactionDirectionName(tx.Direction)), fyne.TextAlignCenter, fyne.TextStyle{}), + // widget.NewLabelWithStyle(fmt.Sprintf("%12s", status), fyne.TextAlignLeading, fyne.TextStyle{}), + // widget.NewLabelWithStyle(fmt.Sprintf("%15s", formattedAmount), fyne.TextAlignTrailing, fyne.TextStyle{}), + // widget.NewLabelWithStyle(fmt.Sprintf("%-8s", tx.Type), fyne.TextAlignCenter, fyne.TextStyle{}), + // widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{}), + // )) + // } + + h := widgets.NewTable(tableHeading, nil) + // txTable.Refresh() + + return h +} diff --git a/fyne/widgets/table.go b/fyne/widgets/table.go index 7f8a56773..dff2af406 100644 --- a/fyne/widgets/table.go +++ b/fyne/widgets/table.go @@ -74,4 +74,5 @@ func (table *Table) Refresh() { table.Result.Children = container.Children table.Container.Content = widget.NewScrollContainer(table.Result).Content widget.Refresh(table.Result) -} \ No newline at end of file +} + From 6af6f3262b17b6c8a9b5a4c80087d250db10ae68 Mon Sep 17 00:00:00 2001 From: morrison Date: Mon, 11 Nov 2019 08:34:47 +0100 Subject: [PATCH 04/73] added table.go, and fetched table data into the table --- fyne/pages/history.go | 98 ++++++++++++++++++++++--------------------- fyne/widgets/table.go | 4 ++ 2 files changed, 55 insertions(+), 47 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index faeb8d21a..fe11dafee 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -6,17 +6,20 @@ import ( "fyne.io/fyne" "fyne.io/fyne/widget" + "fyne.io/fyne/layout" // "fyne.io/fyne/canvas" "github.com/raedahgroup/dcrlibwallet" "github.com/raedahgroup/godcr/fyne/widgets" "github.com/raedahgroup/godcr/fyne/assets" - // "github.com/raedahgroup/godcr/fyne/helpers" + "github.com/raedahgroup/godcr/fyne/helpers" ) const txPerPage int32 = 25 func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) fyne.CanvasObject { + var txTable widgets.Table + // error handler var errorLabel *widget.Label errorLabel = widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) @@ -24,14 +27,14 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - tx := fetchAndDisplayTransactions(wallet, 0, dcrlibwallet.TxFilterAll) + fetchAndDisplayTransactions(wallet, &txTable, 0, dcrlibwallet.TxFilterAll) t := prepareTxFilterDropDown(wallet, window, errorLabel) output := widget.NewVBox( widgets.NewVSpacer(5), widget.NewHBox(pageTitleLabel), widgets.NewVSpacer(5), t, - tx, + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txTable.Container.MinSize().Width, txTable.Container.MinSize().Height+200)), txTable.Container), errorLabel, ) @@ -115,52 +118,53 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, return accountDropdown } -func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txOffset int, filter int32) *widget.Box { +func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, txOffset int, filter int32) { tableHeading := widget.NewHBox( widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) - - - // txns, err := wallet.GetTransactionsRaw(int32(txOffset), txPerPage, dcrlibwallet.TxFilterAll) - // if err != nil { - // // displayMessage(err.Error(), MessageKindError) - // // return - // } - - // // calculate max number of digits after decimal point for all tx amounts - // inputsAndOutputsAmount := make([]int64, len(txns)) - // for i, tx := range txns { - // inputsAndOutputsAmount[i] = tx.Amount - // } - // maxDecimalPlacesForTxAmounts := helpers.MaxDecimalPlaces(inputsAndOutputsAmount) - - // var hBox []*widget.Box - // for i, tx := range txns { - // status := "Pending" - // confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 - // if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { - // status = "Confirmed" - // } - - // formattedAmount := helpers.FormatAmountDisplay(tx.Amount, maxDecimalPlacesForTxAmounts) - // trimmedHash := txns[i].Hash[:25] + "..." - // hBox = append(hBox, widget.NewHBox( - // widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.ExtractDateOrTime(tx.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), - // widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.TransactionDirectionName(tx.Direction)), fyne.TextAlignCenter, fyne.TextStyle{}), - // widget.NewLabelWithStyle(fmt.Sprintf("%12s", status), fyne.TextAlignLeading, fyne.TextStyle{}), - // widget.NewLabelWithStyle(fmt.Sprintf("%15s", formattedAmount), fyne.TextAlignTrailing, fyne.TextStyle{}), - // widget.NewLabelWithStyle(fmt.Sprintf("%-8s", tx.Type), fyne.TextAlignCenter, fyne.TextStyle{}), - // widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{}), - // )) - // } - - h := widgets.NewTable(tableHeading, nil) - // txTable.Refresh() - - return h + widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + ) + + + txns, err := wallet.GetTransactionsRaw(int32(txOffset), txPerPage, dcrlibwallet.TxFilterAll) + if err != nil { + // displayMessage(err.Error(), MessageKindError) + // return + } + + // calculate max number of digits after decimal point for all tx amounts + inputsAndOutputsAmount := make([]int64, len(txns)) + for i, tx := range txns { + inputsAndOutputsAmount[i] = tx.Amount + } + maxDecimalPlacesForTxAmounts := helpers.MaxDecimalPlaces(inputsAndOutputsAmount) + + var hBox []*widget.Box + for _, tx := range txns { + status := "Pending" + confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 + if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { + status = "Confirmed" + } + + formattedAmount := helpers.FormatAmountDisplay(tx.Amount, maxDecimalPlacesForTxAmounts) + trimmedHash := tx.Hash[:25] + "..." + + hBox = append(hBox, widget.NewHBox( + widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.ExtractDateOrTime(tx.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.TransactionDirectionName(tx.Direction)), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(fmt.Sprintf("%12s", status), fyne.TextAlignLeading, fyne.TextStyle{}), + widget.NewLabelWithStyle(fmt.Sprintf("%15s", formattedAmount), fyne.TextAlignTrailing, fyne.TextStyle{}), + widget.NewLabelWithStyle(fmt.Sprintf("%-8s", tx.Type), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{}), + )) + } + + txTable.NewTable(tableHeading, hBox...) + txTable.Refresh() + + return } diff --git a/fyne/widgets/table.go b/fyne/widgets/table.go index dff2af406..72f3bb90c 100644 --- a/fyne/widgets/table.go +++ b/fyne/widgets/table.go @@ -1,6 +1,7 @@ package widgets import ( + "fmt" "fyne.io/fyne/widget" ) @@ -17,6 +18,7 @@ func (table *Table) NewTable(heading *widget.Box, data ...*widget.Box) { table.tableData = []*widget.Box{heading} table.tableData = append(table.tableData, data...) table.Result = widget.NewHBox() + // fmt.Println(data) table.Refresh() } @@ -60,6 +62,8 @@ func (table *Table) Pop() { func (table *Table) Refresh() { var container = widget.NewHBox() + fmt.Println(container) + fmt.Println(table.heading.Children) // get horizontals apart from heading for i := 0; i < len(table.heading.Children); i++ { From a8a6c514925a05a465ede50ab61d490a7d84f917 Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 13 Nov 2019 07:00:46 +0100 Subject: [PATCH 05/73] bug fix with tablefilter --- fyne/pages/history.go | 42 +++++++++++++++++++++++++++++------------- fyne/widgets/table.go | 7 +------ 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index fe11dafee..5e55a48dc 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -2,6 +2,7 @@ package pages import ( "fmt" + "strings" // "image/color" "fyne.io/fyne" @@ -14,11 +15,12 @@ import ( "github.com/raedahgroup/godcr/fyne/assets" "github.com/raedahgroup/godcr/fyne/helpers" ) + const txPerPage int32 = 25 + var txTable widgets.Table func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) fyne.CanvasObject { - var txTable widgets.Table // error handler var errorLabel *widget.Label @@ -27,21 +29,26 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) + t := prepareTxFilterDropDown(wallet, &txTable, window, errorLabel) + fetchAndDisplayTransactions(wallet, &txTable, 0, dcrlibwallet.TxFilterAll) - t := prepareTxFilterDropDown(wallet, window, errorLabel) + txTable.Result.Children = txTable.Result.Children + widget.Refresh(txTable.Result) + fmt.Println(txTable.Result) output := widget.NewVBox( widgets.NewVSpacer(5), widget.NewHBox(pageTitleLabel), widgets.NewVSpacer(5), t, + widgets.NewVSpacer(5), fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txTable.Container.MinSize().Width, txTable.Container.MinSize().Height+200)), txTable.Container), errorLabel, - ) + ) return widget.NewHBox(widgets.NewHSpacer(18), output) } -func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label) *widgets.ClickableBox { +func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window, errorLabel *widget.Label) *widgets.ClickableBox { var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} var allTxFilters = map[string]int32{ "All": dcrlibwallet.TxFilterAll, @@ -80,11 +87,11 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, ) accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { - // selectedFilterName := strings.Split(filter, " ")[0] - // selectedFilterId := allTxFilters[selectedFilterName] + selectedFilterName := strings.Split(filter, " ")[0] + selectedFilterId := allTxFilters[selectedFilterName] + // if selectedFilterId != historyPageData.currentTxFilter { - // go fetchAndDisplayTransactions(0, selectedFilterId) - // } + fetchAndDisplayTransactions(wallet, txTable, 0, selectedFilterId) selectedAccountLabel.SetText(filter) accountSelectionPopup.Hide() @@ -104,7 +111,7 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, icons, _ := assets.GetIcons(assets.CollapseIcon) accountTab := widget.NewHBox( selectedAccountLabel, - widgets.NewHSpacer(8), + widgets.NewHSpacer(12), widget.NewIcon(icons[assets.CollapseIcon]), ) @@ -128,8 +135,7 @@ func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widget widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), ) - - txns, err := wallet.GetTransactionsRaw(int32(txOffset), txPerPage, dcrlibwallet.TxFilterAll) + txns, err := wallet.GetTransactionsRaw(int32(txOffset), txPerPage, filter) if err != nil { // displayMessage(err.Error(), MessageKindError) // return @@ -151,7 +157,7 @@ func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widget } formattedAmount := helpers.FormatAmountDisplay(tx.Amount, maxDecimalPlacesForTxAmounts) - trimmedHash := tx.Hash[:25] + "..." + // trimmedHash := tx.Hash[:25] + "..." hBox = append(hBox, widget.NewHBox( widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.ExtractDateOrTime(tx.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), @@ -159,12 +165,22 @@ func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widget widget.NewLabelWithStyle(fmt.Sprintf("%12s", status), fyne.TextAlignLeading, fyne.TextStyle{}), widget.NewLabelWithStyle(fmt.Sprintf("%15s", formattedAmount), fyne.TextAlignTrailing, fyne.TextStyle{}), widget.NewLabelWithStyle(fmt.Sprintf("%-8s", tx.Type), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{}), + widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(fmt.Sprintf("%-8s", tx.Hash), fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { + fmt.Println(tx.Hash) + }), )) } txTable.NewTable(tableHeading, hBox...) txTable.Refresh() + // fmt.Println("new line") + // fmt.Println(txTable.Result.Children) + // txTable.Result.Children = txTable.Result.Children + // widget.Refresh(txTable.Result) return } + +func fetchTxDetail() { + +} diff --git a/fyne/widgets/table.go b/fyne/widgets/table.go index 72f3bb90c..8dbf8a614 100644 --- a/fyne/widgets/table.go +++ b/fyne/widgets/table.go @@ -1,10 +1,9 @@ package widgets import ( - "fmt" + // "fmt" "fyne.io/fyne/widget" ) - type Table struct { tableData []*widget.Box heading *widget.Box @@ -18,7 +17,6 @@ func (table *Table) NewTable(heading *widget.Box, data ...*widget.Box) { table.tableData = []*widget.Box{heading} table.tableData = append(table.tableData, data...) table.Result = widget.NewHBox() - // fmt.Println(data) table.Refresh() } @@ -62,9 +60,6 @@ func (table *Table) Pop() { func (table *Table) Refresh() { var container = widget.NewHBox() - fmt.Println(container) - fmt.Println(table.heading.Children) - // get horizontals apart from heading for i := 0; i < len(table.heading.Children); i++ { // get vertical From cf1a8184cdb1eba3e7b432f38ac865708d872db6 Mon Sep 17 00:00:00 2001 From: morrison Date: Fri, 15 Nov 2019 08:05:11 +0100 Subject: [PATCH 06/73] implemented txtable filtering --- fyne/pages/history.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 5e55a48dc..cb1d35d6a 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -17,38 +17,41 @@ import ( ) const txPerPage int32 = 25 - var txTable widgets.Table +// overviewPageData contains widgets that needs to be updated realtime +type overviewPageData struct { + txTable widgets.Table +} +var overview overviewPageData func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) fyne.CanvasObject { - - // error handler + // error handler var errorLabel *widget.Label errorLabel = widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) errorLabel.Hide() pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - t := prepareTxFilterDropDown(wallet, &txTable, window, errorLabel) + t := prepareTxFilterDropDown(wallet, window, errorLabel) + + fetchAndDisplayTransactions(wallet, &overview.txTable, 0, dcrlibwallet.TxFilterAll) - fetchAndDisplayTransactions(wallet, &txTable, 0, dcrlibwallet.TxFilterAll) - txTable.Result.Children = txTable.Result.Children - widget.Refresh(txTable.Result) - fmt.Println(txTable.Result) output := widget.NewVBox( widgets.NewVSpacer(5), widget.NewHBox(pageTitleLabel), widgets.NewVSpacer(5), t, widgets.NewVSpacer(5), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txTable.Container.MinSize().Width, txTable.Container.MinSize().Height+200)), txTable.Container), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(overview.txTable.Container.MinSize().Width, overview.txTable.Container.MinSize().Height+200)), overview.txTable.Container), errorLabel, ) return widget.NewHBox(widgets.NewHSpacer(18), output) } -func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window, errorLabel *widget.Label) *widgets.ClickableBox { +func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label) *widgets.ClickableBox { + var txTable widgets.Table + var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} var allTxFilters = map[string]int32{ "All": dcrlibwallet.TxFilterAll, @@ -91,7 +94,9 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, txTable *widgets.Ta selectedFilterId := allTxFilters[selectedFilterName] // if selectedFilterId != historyPageData.currentTxFilter { - fetchAndDisplayTransactions(wallet, txTable, 0, selectedFilterId) + fetchAndDisplayTransactions(wallet, &txTable, 0, selectedFilterId) + overview.txTable.Result.Children = txTable.Result.Children + widget.Refresh(overview.txTable.Result) selectedAccountLabel.SetText(filter) accountSelectionPopup.Hide() @@ -173,11 +178,6 @@ func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widget txTable.NewTable(tableHeading, hBox...) txTable.Refresh() - // fmt.Println("new line") - // fmt.Println(txTable.Result.Children) - - // txTable.Result.Children = txTable.Result.Children - // widget.Refresh(txTable.Result) return } From 0f3fa0cff226f17106d88033ea8f22ee2eebc835 Mon Sep 17 00:00:00 2001 From: morrison Date: Sun, 17 Nov 2019 00:17:36 +0100 Subject: [PATCH 07/73] added pagination --- fyne/pages/history.go | 177 +++++++++++++++++++++++++++++------------- fyne/widgets/table.go | 6 +- 2 files changed, 127 insertions(+), 56 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index cb1d35d6a..276a88f4b 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -3,25 +3,35 @@ package pages import ( "fmt" "strings" - // "image/color" + "strconv" "fyne.io/fyne" "fyne.io/fyne/widget" "fyne.io/fyne/layout" - // "fyne.io/fyne/canvas" "github.com/raedahgroup/dcrlibwallet" + "github.com/decred/dcrd/dcrutil" + "github.com/decred/dcrd/chaincfg/chainhash" "github.com/raedahgroup/godcr/fyne/widgets" "github.com/raedahgroup/godcr/fyne/assets" - "github.com/raedahgroup/godcr/fyne/helpers" ) -const txPerPage int32 = 25 -// overviewPageData contains widgets that needs to be updated realtime -type overviewPageData struct { +const txPerPage int32 = 3 + +type historyPageData struct { txTable widgets.Table + txDetailsTable widgets.Table + currentFilter int32 + currentPage int32 + selectedFilterCount int + txCountErr error + txCountForFilter int + txns []*dcrlibwallet.Transaction + selectedFilterId int32 + txl int } -var overview overviewPageData + +var history historyPageData func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) fyne.CanvasObject { @@ -30,26 +40,41 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm errorLabel = widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) errorLabel.Hide() + history.currentPage = 1 + history.selectedFilterId = dcrlibwallet.TxFilterAll + + var prevButton *widget.Button + var nextButton *widget.Button + prevButton = widget.NewButton("Prev", func() { + loadPreviousPage(wallet , nextButton, prevButton) + }) + + nextButton = widget.NewButton("Next", func() { + loadNextPage(wallet , nextButton, prevButton) + }) + pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - t := prepareTxFilterDropDown(wallet, window, errorLabel) - - fetchAndDisplayTransactions(wallet, &overview.txTable, 0, dcrlibwallet.TxFilterAll) + filterDropdown := txFilterDropDown(wallet, window, errorLabel, nextButton, prevButton) + fetchAndDisplayTransactions(wallet, &history.txTable, nextButton, prevButton) + output := widget.NewVBox( widgets.NewVSpacer(5), widget.NewHBox(pageTitleLabel), widgets.NewVSpacer(5), - t, + filterDropdown, widgets.NewVSpacer(5), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(overview.txTable.Container.MinSize().Width, overview.txTable.Container.MinSize().Height+200)), overview.txTable.Container), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(history.txTable.Container.MinSize().Width, history.txTable.Container.MinSize().Height+200)), history.txTable.Container), + widgets.NewVSpacer(15), + widget.NewHBox(prevButton, widgets.NewHSpacer(110), nextButton), errorLabel, ) return widget.NewHBox(widgets.NewHSpacer(18), output) } -func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label) *widgets.ClickableBox { +func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, nextButton, prevButton *widget.Button) *widgets.ClickableBox { var txTable widgets.Table var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} @@ -62,28 +87,25 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, "Staking": dcrlibwallet.TxFilterStaking, } - txCountForFilter, _ := wallet.CountTransactions(allTxFilters["All"]) - selectedAccountLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) - - activeFiltersWithTxCounts := make(map[int32]int) + history.txCountForFilter, _ = wallet.CountTransactions(allTxFilters["All"]) + selectedAccountLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", history.txCountForFilter)) + history.selectedFilterCount = history.txCountForFilter var accountSelectionPopup *widget.PopUp - var accountsView *widget.Box accountListWidget := widget.NewVBox() for _, filterName := range allTxFilterNames { filterId := allTxFilters[filterName] - txCountForFilter, txCountErr := wallet.CountTransactions(filterId) - if txCountErr != nil { + history.txCountForFilter, history.txCountErr = wallet.CountTransactions(filterId) + if history.txCountErr != nil { errorMessage := fmt.Sprintf("Cannot load history page. Error getting transaction count for filter %s: %s", - filterName, txCountErr.Error()) + filterName, history.txCountErr.Error()) errorHandler(errorMessage, errorLabel) return nil } - if txCountForFilter > 0 { - activeFiltersWithTxCounts[filterId] = txCountForFilter - filter := fmt.Sprintf("%s (%d)", filterName, txCountForFilter) - accountsView = widget.NewHBox( + if history.txCountForFilter > 0 { + filter := fmt.Sprintf("%s (%d)", filterName, history.txCountForFilter) + accountsView := widget.NewHBox( widgets.NewHSpacer(5), widget.NewLabel(filter), widgets.NewHSpacer(5), @@ -91,13 +113,12 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { selectedFilterName := strings.Split(filter, " ")[0] - selectedFilterId := allTxFilters[selectedFilterName] - - // if selectedFilterId != historyPageData.currentTxFilter { - fetchAndDisplayTransactions(wallet, &txTable, 0, selectedFilterId) - overview.txTable.Result.Children = txTable.Result.Children - widget.Refresh(overview.txTable.Result) + history.selectedFilterId = allTxFilters[selectedFilterName] + history.selectedFilterCount, _ = strconv.Atoi(strings.Split(filter, " ")[1]) + fetchAndDisplayTransactions(wallet, &txTable, nextButton, prevButton) + history.txTable.Result.Children = txTable.Result.Children + widget.Refresh(history.txTable.Result) selectedAccountLabel.SetText(filter) accountSelectionPopup.Hide() })) @@ -116,7 +137,7 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, icons, _ := assets.GetIcons(assets.CollapseIcon) accountTab := widget.NewHBox( selectedAccountLabel, - widgets.NewHSpacer(12), + widgets.NewHSpacer(50), widget.NewIcon(icons[assets.CollapseIcon]), ) @@ -130,57 +151,109 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, return accountDropdown } -func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, txOffset int, filter int32) { +func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, nextButton, prevButton *widget.Button) { tableHeading := widget.NewHBox( + widget.NewLabelWithStyle("#", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), ) - txns, err := wallet.GetTransactionsRaw(int32(txOffset), txPerPage, filter) + txOffset := 0 + if history.txns != nil { + txOffset = len(history.txns) + } + + txns, err := wallet.GetTransactionsRaw(int32(txOffset), txPerPage, history.selectedFilterId) if err != nil { // displayMessage(err.Error(), MessageKindError) // return } - // calculate max number of digits after decimal point for all tx amounts - inputsAndOutputsAmount := make([]int64, len(txns)) - for i, tx := range txns { - inputsAndOutputsAmount[i] = tx.Amount - } - maxDecimalPlacesForTxAmounts := helpers.MaxDecimalPlaces(inputsAndOutputsAmount) + history.txl = len(txns) + history.txns = append(history.txns, txns...) + pageTxOffset := (history.currentPage - 1) * txPerPage + maxTxIndexForCurrentPage := pageTxOffset + txPerPage var hBox []*widget.Box - for _, tx := range txns { + for currentTxIndex, tx := range history.txns { + if currentTxIndex < int(pageTxOffset) { + continue // skip txs not belonging to this page + } + if currentTxIndex >= int(maxTxIndexForCurrentPage) { + break // max number of tx displayed for this page + } + status := "Pending" confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { status = "Confirmed" } - formattedAmount := helpers.FormatAmountDisplay(tx.Amount, maxDecimalPlacesForTxAmounts) - // trimmedHash := tx.Hash[:25] + "..." - hBox = append(hBox, widget.NewHBox( - widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.ExtractDateOrTime(tx.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.TransactionDirectionName(tx.Direction)), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(fmt.Sprintf("%12s", status), fyne.TextAlignLeading, fyne.TextStyle{}), - widget.NewLabelWithStyle(fmt.Sprintf("%15s", formattedAmount), fyne.TextAlignTrailing, fyne.TextStyle{}), - widget.NewLabelWithStyle(fmt.Sprintf("%-8s", tx.Type), fyne.TextAlignCenter, fyne.TextStyle{}), - widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(fmt.Sprintf("%-8s", tx.Hash), fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { - fmt.Println(tx.Hash) + widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(),fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), + widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(tx.Hash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { + history.txTable.Container.Hide() + history.txDetailsTable.Container.Show() + fetchTxDetail(&history.txDetailsTable, wallet, tx.Hash) }), )) } txTable.NewTable(tableHeading, hBox...) txTable.Refresh() + + if history.currentPage > 1 { + prevButton.Enable() + }else{ + prevButton.Disable() + } + + if history.selectedFilterCount > int(maxTxIndexForCurrentPage) { + nextButton.Enable() + }else{ + nextButton.Disable() + } + return } -func fetchTxDetail() { +func loadPreviousPage(wallet *dcrlibwallet.LibWallet, nextButton, prevButton *widget.Button) { + var txTable widgets.Table + history.currentPage-- + history.txns = history.txns[:len(history.txns)-(int(txPerPage) + history.txl)] + + fetchAndDisplayTransactions(wallet, &txTable, nextButton, prevButton) + history.txTable.Result.Children = txTable.Result.Children + widget.Refresh(history.txTable.Result) + return } + +func loadNextPage(wallet *dcrlibwallet.LibWallet, nextButton, prevButton *widget.Button) { + var txTable widgets.Table + + nextPage := history.currentPage + 1 + history.currentPage = nextPage + nextPageTxOffset := (nextPage - 1) * txPerPage + + if int(nextPageTxOffset) >= len(history.txns) { + // we've not loaded txs for this page + fetchAndDisplayTransactions(wallet, &txTable, nextButton, prevButton) + history.txTable.Result.Children = txTable.Result.Children + widget.Refresh(history.txTable.Result) + } + + return +} + diff --git a/fyne/widgets/table.go b/fyne/widgets/table.go index 8dbf8a614..22bc6c614 100644 --- a/fyne/widgets/table.go +++ b/fyne/widgets/table.go @@ -1,9 +1,7 @@ package widgets -import ( - // "fmt" - "fyne.io/fyne/widget" -) +import "fyne.io/fyne/widget" + type Table struct { tableData []*widget.Box heading *widget.Box From 2c1c5385105b12a4f40f38890148797762640db7 Mon Sep 17 00:00:00 2001 From: morrison Date: Tue, 19 Nov 2019 23:19:54 +0100 Subject: [PATCH 08/73] added transaction details page, improved table.go, removed pagination basedd on review, minor code clean up --- fyne/pages/history.go | 209 +++++++++++++++++++++---------- fyne/pages/transactionDetails.go | 140 +++++++++++++++++++++ fyne/widgets/table.go | 152 +++++++++++++++++----- 3 files changed, 403 insertions(+), 98 deletions(-) create mode 100644 fyne/pages/transactionDetails.go diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 276a88f4b..4d3711a17 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -16,7 +16,7 @@ import ( "github.com/raedahgroup/godcr/fyne/assets" ) -const txPerPage int32 = 3 +const txPerPage int32 = 10 type historyPageData struct { txTable widgets.Table @@ -28,6 +28,7 @@ type historyPageData struct { txCountForFilter int txns []*dcrlibwallet.Transaction selectedFilterId int32 + errorLabel *widget.Label txl int } @@ -43,21 +44,11 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm history.currentPage = 1 history.selectedFilterId = dcrlibwallet.TxFilterAll - var prevButton *widget.Button - var nextButton *widget.Button - prevButton = widget.NewButton("Prev", func() { - loadPreviousPage(wallet , nextButton, prevButton) - }) - - nextButton = widget.NewButton("Next", func() { - loadNextPage(wallet , nextButton, prevButton) - }) - pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - filterDropdown := txFilterDropDown(wallet, window, errorLabel, nextButton, prevButton) + filterDropdown := txFilterDropDown(wallet, window, errorLabel) - fetchAndDisplayTransactions(wallet, &history.txTable, nextButton, prevButton) + fetchAndDisplayTransactions(wallet, &history.txTable, window) output := widget.NewVBox( widgets.NewVSpacer(5), @@ -67,14 +58,13 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm widgets.NewVSpacer(5), fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(history.txTable.Container.MinSize().Width, history.txTable.Container.MinSize().Height+200)), history.txTable.Container), widgets.NewVSpacer(15), - widget.NewHBox(prevButton, widgets.NewHSpacer(110), nextButton), errorLabel, ) return widget.NewHBox(widgets.NewHSpacer(18), output) } -func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, nextButton, prevButton *widget.Button) *widgets.ClickableBox { +func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label) *widgets.ClickableBox { var txTable widgets.Table var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} @@ -116,9 +106,10 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorL history.selectedFilterId = allTxFilters[selectedFilterName] history.selectedFilterCount, _ = strconv.Atoi(strings.Split(filter, " ")[1]) - fetchAndDisplayTransactions(wallet, &txTable, nextButton, prevButton) + fetchAndDisplayTransactions(wallet, &txTable, window) history.txTable.Result.Children = txTable.Result.Children widget.Refresh(history.txTable.Result) + selectedAccountLabel.SetText(filter) accountSelectionPopup.Hide() })) @@ -151,7 +142,7 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorL return accountDropdown } -func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, nextButton, prevButton *widget.Button) { +func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window) { tableHeading := widget.NewHBox( widget.NewLabelWithStyle("#", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -174,26 +165,14 @@ func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widget // return } - history.txl = len(txns) - history.txns = append(history.txns, txns...) - pageTxOffset := (history.currentPage - 1) * txPerPage - maxTxIndexForCurrentPage := pageTxOffset + txPerPage - var hBox []*widget.Box - for currentTxIndex, tx := range history.txns { - if currentTxIndex < int(pageTxOffset) { - continue // skip txs not belonging to this page - } - if currentTxIndex >= int(maxTxIndexForCurrentPage) { - break // max number of tx displayed for this page - } - + for currentTxIndex, tx := range txns { status := "Pending" confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { status = "Confirmed" } - + trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] hBox = append(hBox, widget.NewHBox( widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), @@ -202,58 +181,150 @@ func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widget widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(),fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), - widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(tx.Hash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { - history.txTable.Container.Hide() - history.txDetailsTable.Container.Show() - fetchTxDetail(&history.txDetailsTable, wallet, tx.Hash) + widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { + fetchTxDetails(tx.Hash, wallet, window) }), )) } txTable.NewTable(tableHeading, hBox...) - txTable.Refresh() - if history.currentPage > 1 { - prevButton.Enable() - }else{ - prevButton.Disable() + return +} + +func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window) { + var confirmations int32 = 0 + // if txDetails.BlockHeight != -1 { + // confirmations = wallet.GetBestBlock() - txDetails.BlockHeight + 1 + // } + newHash, _ := chainhash.NewHashFromStr(hash) + txDetails, err := wallet.GetTransactionRaw(newHash[:]) + if err != nil { + } - if history.selectedFilterCount > int(maxTxIndexForCurrentPage) { - nextButton.Enable() - }else{ - nextButton.Disable() + var spendUnconfirmed = wallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey) + + var status string + // var statusColor color.RGBA + if spendUnconfirmed || confirmations > dcrlibwallet.DefaultRequiredConfirmations { + status = "Confirmed" + // statusColor = styles.DecredGreenColor + } else { + status = "Pending" + // statusColor = styles.DecredOrangeColor } - return -} + tableConfirmations := widget.NewHBox( + widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableHash := widget.NewHBox( + widget.NewLabelWithStyle("Hash:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(txDetails.Hash, fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableBlockHeight := widget.NewHBox( + widget.NewLabelWithStyle("Block Height:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(strconv.Itoa(int(txDetails.BlockHeight)), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableDirection := widget.NewHBox( + widget.NewLabelWithStyle("Direction:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(txDetails.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableType := widget.NewHBox( + widget.NewLabelWithStyle("Type:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(txDetails.Type, fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableAmount := widget.NewHBox( + widget.NewLabelWithStyle("Amount:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Amount).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableSize := widget.NewHBox( + widget.NewLabelWithStyle("Size:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(strconv.Itoa(txDetails.Size)+" Bytes", fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableFee := widget.NewHBox( + widget.NewLabelWithStyle("Fee:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableFeeRate := widget.NewHBox( + widget.NewLabelWithStyle("Fee Rate:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.FeeRate).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableStatus := widget.NewHBox( + widget.NewLabelWithStyle("Status:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(status, fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableDate := widget.NewHBox( + widget.NewLabelWithStyle("Date:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(txDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), + ) -func loadPreviousPage(wallet *dcrlibwallet.LibWallet, nextButton, prevButton *widget.Button) { - var txTable widgets.Table + tableData := widget.NewVBox( + tableConfirmations, + tableHash, + tableBlockHeight, + tableDirection, + tableType, + tableAmount, + tableSize, + tableFee, + tableFeeRate, + tableStatus, + tableDate, + ) - history.currentPage-- - history.txns = history.txns[:len(history.txns)-(int(txPerPage) + history.txl)] - - fetchAndDisplayTransactions(wallet, &txTable, nextButton, prevButton) - history.txTable.Result.Children = txTable.Result.Children - widget.Refresh(history.txTable.Result) - return -} -func loadNextPage(wallet *dcrlibwallet.LibWallet, nextButton, prevButton *widget.Button) { - var txTable widgets.Table + var txInput widgets.Table + heading := widget.NewHBox( + widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) - nextPage := history.currentPage + 1 - history.currentPage = nextPage - nextPageTxOffset := (nextPage - 1) * txPerPage - - if int(nextPageTxOffset) >= len(history.txns) { - // we've not loaded txs for this page - fetchAndDisplayTransactions(wallet, &txTable, nextButton, prevButton) - history.txTable.Result.Children = txTable.Result.Children - widget.Refresh(history.txTable.Result) + var inputBox []*widget.Box + for i := range txDetails.Inputs { + inputBox = append(inputBox, widget.NewHBox( + widget.NewLabelWithStyle(txDetails.Inputs[i].PreviousOutpoint, fyne.TextAlignLeading, fyne.TextStyle{}), + widget.NewLabelWithStyle(txDetails.Inputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + )) } - - return + txInput.NewTable(heading, inputBox...) + + var txOutput widgets.Table + heading = widget.NewHBox( + widget.NewLabelWithStyle("Address", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Value", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) + + var outputBox []*widget.Box + for i := range txDetails.Outputs { + outputBox = append(outputBox, widget.NewHBox( + widget.NewLabelWithStyle(txDetails.Outputs[i].Address, fyne.TextAlignLeading, fyne.TextStyle{}), + widget.NewLabelWithStyle(txDetails.Outputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + widget.NewLabelWithStyle(txDetails.Outputs[i].ScriptType, fyne.TextAlignCenter, fyne.TextStyle{}))) + } + txOutput.NewTable(heading, outputBox...) + + label := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) + + output := widget.NewHBox(widgets.NewHSpacer(10), widget.NewVBox( + label, + widgets.NewVSpacer(10), + tableData, + widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), + txInput.Result, + widgets.NewVSpacer(10), + widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), + txOutput.Result, + ), widgets.NewHSpacer(10)) + + scrollContainer := widget.NewScrollContainer(output) + scrollContainer.Resize(fyne.NewSize(scrollContainer.MinSize().Width, 500)) + popUp := widget.NewPopUp(widget.NewVBox(fyne.NewContainer(scrollContainer)), + window.Canvas()) + popUp.Show() } diff --git a/fyne/pages/transactionDetails.go b/fyne/pages/transactionDetails.go new file mode 100644 index 000000000..aeec2a8a2 --- /dev/null +++ b/fyne/pages/transactionDetails.go @@ -0,0 +1,140 @@ +package pages + +// import ( +// // "fmt" +// // "strings" +// // "strconv" + +// "fyne.io/fyne" +// // "fyne.io/fyne/widget" +// // "fyne.io/fyne/layout" + +// // "github.com/raedahgroup/godcr/fyne/widgets" +// ) + +func displayTransactionDetails() { + // var confirmations int32 = 0 + // if handler.selectedTxDetails.BlockHeight != -1 { + // confirmations = handler.wallet.GetBestBlock() - handler.selectedTxDetails.BlockHeight + 1 + // } + + // var spendUnconfirmed = handler.wallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey) + + // var status string + // // var statusColor color.RGBA + // if spendUnconfirmed || confirmations > dcrlibwallet.DefaultRequiredConfirmations { + // status = "Confirmed" + // // statusColor = styles.DecredGreenColor + // } else { + // status = "Pending" + // // statusColor = styles.DecredOrangeColor + // } + + // tableConfirmations := widget.NewHBox( + // widget.NewLabelWithStyle("Confirmations", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableHash := widget.NewHBox( + // widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(handler.selectedTxDetails.Hash, fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableBlockHeight := widget.NewHBox( + // widget.NewLabelWithStyle("Block Height", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(strconv.Itoa(int(handler.selectedTxDetails.BlockHeight)), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableDirection := widget.NewHBox( + // widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(handler.selectedTxDetails.Direction), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableType := widget.NewHBox( + // widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(handler.selectedTxDetails.Type, fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableAmount := widget.NewHBox( + // widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(dcrutil.Amount(handler.selectedTxDetails.Amount).String(), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableSize := widget.NewHBox( + // widget.NewLabelWithStyle("Size", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(strconv.Itoa(handler.selectedTxDetails.Size)+" Bytes", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableFee := widget.NewHBox( + // widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(dcrutil.Amount(handler.selectedTxDetails.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableFeeRate := widget.NewHBox( + // widget.NewLabelWithStyle("Fee Rate", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(dcrutil.Amount(handler.selectedTxDetails.FeeRate).String(), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableStatus := widget.NewHBox( + // widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(status, fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableDate := widget.NewHBox( + // widget.NewLabelWithStyle("Date", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(handler.selectedTxDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + + // tableData := widget.NewVBox( + // tableConfirmations, + // tableHash, + // tableBlockHeight, + // tableDirection, + // tableType, + // tableAmount, + // tableSize, + // tableFee, + // tableFeeRate, + // tableStatus, + // tableDate, + // ) + + // var txInput widgets.TableStruct + // heading := widget.NewHBox( + // widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) + + // var inputBox []*widget.Box + // for i := range txDetails.Inputs { + // inputBox = append(inputBox, widget.NewHBox( + // widget.NewLabelWithStyle(txDetails.Inputs[i].PreviousOutpoint, fyne.TextAlignLeading, fyne.TextStyle{}), + // widget.NewLabelWithStyle(txDetails.Inputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), + // widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + // )) + // } + // txInput.NewTable(heading, inputBox...) + + // var txOutput widgets.TableStruct + // heading = widget.NewHBox( + // widget.NewLabelWithStyle("Address", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle("Value", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) + + // var outputBox []*widget.Box + // for i := range txDetails.Outputs { + // outputBox = append(outputBox, widget.NewHBox( + // widget.NewLabelWithStyle(txDetails.Outputs[i].Address, fyne.TextAlignLeading, fyne.TextStyle{}), + // widget.NewLabelWithStyle(txDetails.Outputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), + // widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + // widget.NewLabelWithStyle(txDetails.Outputs[i].ScriptType, fyne.TextAlignCenter, fyne.TextStyle{}))) + // } + // txOutput.NewTable(heading, outputBox...) + + // output := widget.NewHBox(widgets.NewHSpacer(10), widget.NewVBox( + // form, + // widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), + // txInput.Result, + // widgets.NewVSpacer(10), + // widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), + // txOutput.Result, + // ), widgets.NewHSpacer(10)) + + // scrollContainer := widget.NewScrollContainer(output) + // scrollContainer.Resize(fyne.NewSize(scrollContainer.MinSize().Width, 500)) + // popUp := widget.NewPopUp(widget.NewVBox(label, fyne.NewContainer(scrollContainer)), + // window.Canvas()) + // popUp.Show() + return +} \ No newline at end of file diff --git a/fyne/widgets/table.go b/fyne/widgets/table.go index 22bc6c614..68f4aa136 100644 --- a/fyne/widgets/table.go +++ b/fyne/widgets/table.go @@ -1,6 +1,9 @@ package widgets -import "fyne.io/fyne/widget" +import ( + "fyne.io/fyne" + "fyne.io/fyne/widget" +) type Table struct { tableData []*widget.Box @@ -9,67 +12,158 @@ type Table struct { Container *widget.ScrollContainer } +// NewTable creates a new table widget func (table *Table) NewTable(heading *widget.Box, data ...*widget.Box) { table.heading = heading - table.Container = widget.NewScrollContainer(nil) + table.Result = widget.NewHBox() + table.Container = widget.NewScrollContainer(table.Result) table.tableData = []*widget.Box{heading} table.tableData = append(table.tableData, data...) - table.Result = widget.NewHBox() - table.Refresh() + table.set() } +// Append widget adds to the bottom row of a table. func (table *Table) Append(data ...*widget.Box) { - table.tableData = append(table.tableData, data...) - table.Refresh() + if len(table.tableData) == 0 { + return + } + iTable := Table{ + heading: table.heading, + tableData: data, + Result: widget.NewHBox(), + Container: widget.NewScrollContainer(nil), + } + iTable.set() + + for i := 0; i < len(table.heading.Children); i++ { + tableBox, ok := interface{}(table.Result.Children[i]).(*widget.Box) + if !ok { + return + } + iTableBox, ok := interface{}(iTable.Result.Children[i]).(*widget.Box) + if !ok { + return + } + tableBox.Children = append(tableBox.Children, iTableBox.Children...) + widget.Refresh(tableBox) + } } -// Prepend is used to add to a stack +// Prepend adds to the top row of a table. func (table *Table) Prepend(data ...*widget.Box) { - table.tableData = append(data, table.tableData[1:]...) - table.tableData = append([]*widget.Box{table.heading}, table.tableData...) - table.Refresh() + // Makes sure an heading is placed + if len(table.Result.Children) == 0 || len(table.heading.Children) == 0 || len(table.tableData) == 0 { + return + } + + iTable := Table{ + heading: table.heading, + tableData: data, + Result: widget.NewHBox(), + Container: widget.NewScrollContainer(nil), + } + iTable.set() + + for i := 0; i < len(table.heading.Children); i++ { + tableBox, ok := interface{}(table.Result.Children[i]).(*widget.Box) + if !ok { + return + } + iTableBox, ok := interface{}(iTable.Result.Children[i]).(*widget.Box) + if !ok { + return + } + iTableBox.Children = append([]fyne.CanvasObject{tableBox.Children[0]}, iTableBox.Children...) + iTableBox.Children = append(iTableBox.Children, tableBox.Children[1:]...) + tableBox.Children = iTableBox.Children + widget.Refresh(tableBox) + } + table.Container.Offset.Y = 1110 + widget.Refresh(table.Container) } -// Delete method is used to delete object from stack. if tx notifier is created this remove the table from the stack thereby allowing call for for now we should just track transactions by comparing old with new -// Note: while using delete, consider heading -func (table *Table) Delete(tableNo int) { - if len(table.tableData) < tableNo || tableNo >= len(table.tableData) { +// DeleteContent deletes all table data aside heading. +func (table *Table) DeleteContent() { + if len(table.Result.Children) == 0 || len(table.heading.Children) == 0 || len(table.tableData) == 0 { return } - // cannot delete heading - if tableNo == 0 { - return + for i := 0; i < len(table.heading.Children); i++ { + a, ok := interface{}(table.Result.Children[i]).(*widget.Box) + if !ok { + return + } + a.Children = []fyne.CanvasObject{a.Children[0]} + widget.Refresh(a) } - table.tableData = append(table.tableData[:tableNo], table.tableData[tableNo+1:]...) - table.Refresh() } -// Pop remove an object from the stack, Note it cant remove header -func (table *Table) Pop() { - // not allowed to remove heading - if len(table.tableData) <= 1 { +// NumberOfColumns returns the number of columns in a table neglecting header count. +func (table *Table) NumberOfColumns() (count int) { + for i := 0; i < len(table.heading.Children); i++ { + a, ok := interface{}(table.Result.Children[i]).(*widget.Box) + if !ok { + return 0 + } + if count < len(a.Children) { + count = len(a.Children) + } + + } + return count - 1 +} + +// Delete method deletes contents from the table NEGLECTING header. +// If deleting only one content then specify to as 0. +func (table *Table) Delete(from, to int) { + if len(table.Result.Children) == 0 || len(table.heading.Children) == 0 || len(table.tableData) == 0 { return } - table.tableData = table.tableData[:len(table.tableData)-1] - table.Refresh() + if from < 0 || to < 0 { + return + } + if to != 0 { + for i := 0; i < len(table.heading.Children); i++ { + a, ok := interface{}(table.Result.Children[i]).(*widget.Box) + if !ok { + return + } + a.Children = append(a.Children[:from+1], a.Children[to+1:]...) + widget.Refresh(a) + } + } else { + for i := 0; i < len(table.heading.Children); i++ { + a, ok := interface{}(table.Result.Children[i]).(*widget.Box) + if !ok { + return + } + a.Children = append(a.Children[:from+1], a.Children[from+2:]...) + widget.Refresh(a) + } + } + + table.Container.Offset.Y = 1110 + widget.Refresh(table.Container) } -func (table *Table) Refresh() { +func (table *Table) set() { var container = widget.NewHBox() - // get horizontals apart from heading + + // Get horizontals apart from heading. for i := 0; i < len(table.heading.Children); i++ { - // get vertical + // Get vertical. var getVerticals = widget.NewVBox() for _, data := range table.tableData { + if len(table.heading.Children) > len(data.Children) && i > len(data.Children)-1 { + continue + } getVerticals.Append(data.Children[i]) } container.Append(getVerticals) } table.Result.Children = container.Children - table.Container.Content = widget.NewScrollContainer(table.Result).Content widget.Refresh(table.Result) } From d19d5f813d6debd4a2220d145df8ad68af341e90 Mon Sep 17 00:00:00 2001 From: morrison Date: Tue, 19 Nov 2019 23:23:01 +0100 Subject: [PATCH 09/73] removed txdetails.go --- fyne/pages/transactionDetails.go | 140 ------------------------------- 1 file changed, 140 deletions(-) delete mode 100644 fyne/pages/transactionDetails.go diff --git a/fyne/pages/transactionDetails.go b/fyne/pages/transactionDetails.go deleted file mode 100644 index aeec2a8a2..000000000 --- a/fyne/pages/transactionDetails.go +++ /dev/null @@ -1,140 +0,0 @@ -package pages - -// import ( -// // "fmt" -// // "strings" -// // "strconv" - -// "fyne.io/fyne" -// // "fyne.io/fyne/widget" -// // "fyne.io/fyne/layout" - -// // "github.com/raedahgroup/godcr/fyne/widgets" -// ) - -func displayTransactionDetails() { - // var confirmations int32 = 0 - // if handler.selectedTxDetails.BlockHeight != -1 { - // confirmations = handler.wallet.GetBestBlock() - handler.selectedTxDetails.BlockHeight + 1 - // } - - // var spendUnconfirmed = handler.wallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey) - - // var status string - // // var statusColor color.RGBA - // if spendUnconfirmed || confirmations > dcrlibwallet.DefaultRequiredConfirmations { - // status = "Confirmed" - // // statusColor = styles.DecredGreenColor - // } else { - // status = "Pending" - // // statusColor = styles.DecredOrangeColor - // } - - // tableConfirmations := widget.NewHBox( - // widget.NewLabelWithStyle("Confirmations", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableHash := widget.NewHBox( - // widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(handler.selectedTxDetails.Hash, fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableBlockHeight := widget.NewHBox( - // widget.NewLabelWithStyle("Block Height", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(strconv.Itoa(int(handler.selectedTxDetails.BlockHeight)), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableDirection := widget.NewHBox( - // widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(handler.selectedTxDetails.Direction), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableType := widget.NewHBox( - // widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(handler.selectedTxDetails.Type, fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableAmount := widget.NewHBox( - // widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(dcrutil.Amount(handler.selectedTxDetails.Amount).String(), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableSize := widget.NewHBox( - // widget.NewLabelWithStyle("Size", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(strconv.Itoa(handler.selectedTxDetails.Size)+" Bytes", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableFee := widget.NewHBox( - // widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(dcrutil.Amount(handler.selectedTxDetails.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableFeeRate := widget.NewHBox( - // widget.NewLabelWithStyle("Fee Rate", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(dcrutil.Amount(handler.selectedTxDetails.FeeRate).String(), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableStatus := widget.NewHBox( - // widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(status, fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableDate := widget.NewHBox( - // widget.NewLabelWithStyle("Date", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(handler.selectedTxDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - - // tableData := widget.NewVBox( - // tableConfirmations, - // tableHash, - // tableBlockHeight, - // tableDirection, - // tableType, - // tableAmount, - // tableSize, - // tableFee, - // tableFeeRate, - // tableStatus, - // tableDate, - // ) - - // var txInput widgets.TableStruct - // heading := widget.NewHBox( - // widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) - - // var inputBox []*widget.Box - // for i := range txDetails.Inputs { - // inputBox = append(inputBox, widget.NewHBox( - // widget.NewLabelWithStyle(txDetails.Inputs[i].PreviousOutpoint, fyne.TextAlignLeading, fyne.TextStyle{}), - // widget.NewLabelWithStyle(txDetails.Inputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), - // widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), - // )) - // } - // txInput.NewTable(heading, inputBox...) - - // var txOutput widgets.TableStruct - // heading = widget.NewHBox( - // widget.NewLabelWithStyle("Address", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle("Value", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) - - // var outputBox []*widget.Box - // for i := range txDetails.Outputs { - // outputBox = append(outputBox, widget.NewHBox( - // widget.NewLabelWithStyle(txDetails.Outputs[i].Address, fyne.TextAlignLeading, fyne.TextStyle{}), - // widget.NewLabelWithStyle(txDetails.Outputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), - // widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), - // widget.NewLabelWithStyle(txDetails.Outputs[i].ScriptType, fyne.TextAlignCenter, fyne.TextStyle{}))) - // } - // txOutput.NewTable(heading, outputBox...) - - // output := widget.NewHBox(widgets.NewHSpacer(10), widget.NewVBox( - // form, - // widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), - // txInput.Result, - // widgets.NewVSpacer(10), - // widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), - // txOutput.Result, - // ), widgets.NewHSpacer(10)) - - // scrollContainer := widget.NewScrollContainer(output) - // scrollContainer.Resize(fyne.NewSize(scrollContainer.MinSize().Width, 500)) - // popUp := widget.NewPopUp(widget.NewVBox(label, fyne.NewContainer(scrollContainer)), - // window.Canvas()) - // popUp.Show() - return -} \ No newline at end of file From 95100e2e8d3b613b33ceeede77a63435fb7aa45c Mon Sep 17 00:00:00 2001 From: morrison Date: Sun, 24 Nov 2019 00:37:27 +0100 Subject: [PATCH 10/73] added errorhandling, split function into table header and table content function, cleaned up code --- fyne/pages/history.go | 154 ++++++++++++++++++++++---------------- terminal/pages/history.go | 2 +- 2 files changed, 90 insertions(+), 66 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 4d3711a17..7a0a841be 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -16,20 +16,17 @@ import ( "github.com/raedahgroup/godcr/fyne/assets" ) -const txPerPage int32 = 10 +const txPerPage int32 = 15 type historyPageData struct { txTable widgets.Table txDetailsTable widgets.Table currentFilter int32 - currentPage int32 selectedFilterCount int - txCountErr error - txCountForFilter int txns []*dcrlibwallet.Transaction selectedFilterId int32 errorLabel *widget.Label - txl int + txOffset int32 } var history historyPageData @@ -37,34 +34,31 @@ var history historyPageData func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) fyne.CanvasObject { // error handler - var errorLabel *widget.Label - errorLabel = widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) - errorLabel.Hide() - - history.currentPage = 1 - history.selectedFilterId = dcrlibwallet.TxFilterAll + history.errorLabel = widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) + history.errorLabel.Hide() pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - filterDropdown := txFilterDropDown(wallet, window, errorLabel) + filterDropdown := txFilterDropDown(wallet, window) + + txTableHeader(wallet, &history.txTable, window) + addToHistoryTable(&history.txTable, 0, dcrlibwallet.TxFilterAll, wallet, window, false) - fetchAndDisplayTransactions(wallet, &history.txTable, window) - output := widget.NewVBox( widgets.NewVSpacer(5), widget.NewHBox(pageTitleLabel), widgets.NewVSpacer(5), filterDropdown, widgets.NewVSpacer(5), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(history.txTable.Container.MinSize().Width, history.txTable.Container.MinSize().Height+200)), history.txTable.Container), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(history.txTable.Container.MinSize().Width, history.txTable.Container.MinSize().Height+400)), history.txTable.Container), widgets.NewVSpacer(15), - errorLabel, + history.errorLabel, ) return widget.NewHBox(widgets.NewHSpacer(18), output) } -func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label) *widgets.ClickableBox { +func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window) *widgets.ClickableBox { var txTable widgets.Table var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} @@ -77,24 +71,30 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorL "Staking": dcrlibwallet.TxFilterStaking, } - history.txCountForFilter, _ = wallet.CountTransactions(allTxFilters["All"]) - selectedAccountLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", history.txCountForFilter)) - history.selectedFilterCount = history.txCountForFilter + txCountForFilter, err := wallet.CountTransactions(allTxFilters["All"]) + if err != nil { + errorMessage := fmt.Sprintf("Cannot load history page. Error getting transaction count for filter All: %s", err.Error()) + errorHandler(errorMessage, history.errorLabel) + return nil + } + + selectedAccountLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) + history.selectedFilterCount = txCountForFilter var accountSelectionPopup *widget.PopUp accountListWidget := widget.NewVBox() for _, filterName := range allTxFilterNames { filterId := allTxFilters[filterName] - history.txCountForFilter, history.txCountErr = wallet.CountTransactions(filterId) - if history.txCountErr != nil { + txCountForFilter, err := wallet.CountTransactions(filterId) + if err != nil { errorMessage := fmt.Sprintf("Cannot load history page. Error getting transaction count for filter %s: %s", - filterName, history.txCountErr.Error()) - errorHandler(errorMessage, errorLabel) + filterName, err.Error()) + errorHandler(errorMessage, history.errorLabel) return nil } - if history.txCountForFilter > 0 { - filter := fmt.Sprintf("%s (%d)", filterName, history.txCountForFilter) + if txCountForFilter > 0 { + filter := fmt.Sprintf("%s (%d)", filterName, txCountForFilter) accountsView := widget.NewHBox( widgets.NewHSpacer(5), widget.NewLabel(filter), @@ -103,14 +103,17 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorL accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { selectedFilterName := strings.Split(filter, " ")[0] - history.selectedFilterId = allTxFilters[selectedFilterName] + selectedFilterId := allTxFilters[selectedFilterName] history.selectedFilterCount, _ = strconv.Atoi(strings.Split(filter, " ")[1]) - fetchAndDisplayTransactions(wallet, &txTable, window) - history.txTable.Result.Children = txTable.Result.Children - widget.Refresh(history.txTable.Result) + if selectedFilterId != history.selectedFilterId{ + txTableHeader(wallet, &txTable, window) + history.txTable.Result.Children = txTable.Result.Children + addToHistoryTable(&txTable, 0, selectedFilterId, wallet, window, false) + widget.Refresh(history.txTable.Result) - selectedAccountLabel.SetText(filter) + selectedAccountLabel.SetText(filter) + } accountSelectionPopup.Hide() })) } @@ -142,7 +145,7 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorL return accountDropdown } -func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window) { +func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window) { tableHeading := widget.NewHBox( widget.NewLabelWithStyle("#", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -154,45 +157,14 @@ func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widget widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), ) - txOffset := 0 - if history.txns != nil { - txOffset = len(history.txns) - } - - txns, err := wallet.GetTransactionsRaw(int32(txOffset), txPerPage, history.selectedFilterId) - if err != nil { - // displayMessage(err.Error(), MessageKindError) - // return - } - var hBox []*widget.Box - for currentTxIndex, tx := range txns { - status := "Pending" - confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 - if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { - status = "Confirmed" - } - trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] - hBox = append(hBox, widget.NewHBox( - widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(),fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), - widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { - fetchTxDetails(tx.Hash, wallet, window) - }), - )) - } txTable.NewTable(tableHeading, hBox...) return } -func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window) { +func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label) { var confirmations int32 = 0 // if txDetails.BlockHeight != -1 { // confirmations = wallet.GetBestBlock() - txDetails.BlockHeight + 1 @@ -200,7 +172,8 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win newHash, _ := chainhash.NewHashFromStr(hash) txDetails, err := wallet.GetTransactionRaw(newHash[:]) if err != nil { - + errorHandler(fmt.Sprintf("Error fetching transaction details for %s: %s", hash, err.Error()), history.errorLabel) + return } var spendUnconfirmed = wallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey) @@ -328,3 +301,54 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win popUp.Show() } +func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool) { + if filter != history.selectedFilterId { + // filter changed, reset data + txOffset = 0 + history.txns = nil + history.selectedFilterId = filter + } + + txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) + if err != nil { + errorHandler(fmt.Sprintf("Error getting transaction for Filter %s: %s", filter, err.Error()), history.errorLabel) + return + } + if len(txns) < 10 { + errorHandler("No transaction history yet.", history.errorLabel) + txTable.Container.Hide() + return + } + + history.txns = append(history.txns, txns...) + + var hBox []*widget.Box + for currentTxIndex, tx := range txns { + status := "Pending" + confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 + if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { + status = "Confirmed" + } + + trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] + hBox = append(hBox, widget.NewHBox( + widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(),fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), + widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { + fetchTxDetails(tx.Hash, wallet, window, history.errorLabel) + }), + )) + } + + if prepend { + history.txTable.Prepend(hBox...) + } else { + history.txTable.Append(hBox...) + } + history.errorLabel.Hide() +} diff --git a/terminal/pages/history.go b/terminal/pages/history.go index c9e303186..9b66225aa 100644 --- a/terminal/pages/history.go +++ b/terminal/pages/history.go @@ -20,7 +20,7 @@ const ( MessageKindInfo ) -const txPerPage int32 = 25 +const txPerPage int32 = 10 var historyPageData struct { pageContentHolder *tview.Flex From 4bd5f6dd3cd2e05e944a3dc270b05b93f8dd6e88 Mon Sep 17 00:00:00 2001 From: morrison Date: Mon, 25 Nov 2019 21:01:00 +0100 Subject: [PATCH 11/73] added copy txhash copy functionality for txdetails page, aligned txdetails popup, cleaned up code --- fyne/go.mod | 1 + fyne/pages/history.go | 133 ++++++++++++++++++++++++++++-------------- 2 files changed, 91 insertions(+), 43 deletions(-) diff --git a/fyne/go.mod b/fyne/go.mod index 2340a9a21..c5965b641 100644 --- a/fyne/go.mod +++ b/fyne/go.mod @@ -5,6 +5,7 @@ go 1.13 require ( fyne.io/fyne v1.2.0 github.com/decred/dcrd/dcrutil v1.4.0 + github.com/decred/dcrd/chaincfg/chainhash v1.0.1 github.com/decred/slog v1.0.0 github.com/gen2brain/beeep v0.0.0-20190719094215-ece0cb67ca77 github.com/gobuffalo/packr/v2 v2.6.0 diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 7a0a841be..abc951c2b 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -2,31 +2,34 @@ package pages import ( "fmt" - "strings" + "image/color" "strconv" + "strings" + "time" "fyne.io/fyne" - "fyne.io/fyne/widget" + "fyne.io/fyne/canvas" "fyne.io/fyne/layout" + "fyne.io/fyne/widget" - "github.com/raedahgroup/dcrlibwallet" - "github.com/decred/dcrd/dcrutil" "github.com/decred/dcrd/chaincfg/chainhash" - "github.com/raedahgroup/godcr/fyne/widgets" + "github.com/decred/dcrd/dcrutil" + "github.com/raedahgroup/dcrlibwallet" "github.com/raedahgroup/godcr/fyne/assets" + "github.com/raedahgroup/godcr/fyne/widgets" ) const txPerPage int32 = 15 type historyPageData struct { - txTable widgets.Table - txDetailsTable widgets.Table - currentFilter int32 + txTable widgets.Table + txDetailsTable widgets.Table + currentFilter int32 selectedFilterCount int - txns []*dcrlibwallet.Transaction - selectedFilterId int32 - errorLabel *widget.Label - txOffset int32 + txns []*dcrlibwallet.Transaction + selectedFilterId int32 + errorLabel *widget.Label + txOffset int32 } var history historyPageData @@ -38,11 +41,11 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm history.errorLabel.Hide() pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - - filterDropdown := txFilterDropDown(wallet, window) + + filterDropdown := txFilterDropDown(wallet, window, tabmenu) txTableHeader(wallet, &history.txTable, window) - addToHistoryTable(&history.txTable, 0, dcrlibwallet.TxFilterAll, wallet, window, false) + addToHistoryTable(&history.txTable, 0, dcrlibwallet.TxFilterAll, wallet, window, false, tabmenu) output := widget.NewVBox( widgets.NewVSpacer(5), @@ -50,7 +53,7 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm widgets.NewVSpacer(5), filterDropdown, widgets.NewVSpacer(5), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(history.txTable.Container.MinSize().Width, history.txTable.Container.MinSize().Height+400)), history.txTable.Container), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(history.txTable.Container.MinSize().Width, history.txTable.Container.MinSize().Height+450)), history.txTable.Container), widgets.NewVSpacer(15), history.errorLabel, ) @@ -58,7 +61,7 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm return widget.NewHBox(widgets.NewHSpacer(18), output) } -func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window) *widgets.ClickableBox { +func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) *widgets.ClickableBox { var txTable widgets.Table var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} @@ -106,10 +109,10 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window) *widge selectedFilterId := allTxFilters[selectedFilterName] history.selectedFilterCount, _ = strconv.Atoi(strings.Split(filter, " ")[1]) - if selectedFilterId != history.selectedFilterId{ + if selectedFilterId != history.selectedFilterId { txTableHeader(wallet, &txTable, window) history.txTable.Result.Children = txTable.Result.Children - addToHistoryTable(&txTable, 0, selectedFilterId, wallet, window, false) + addToHistoryTable(&txTable, 0, selectedFilterId, wallet, window, false, tabmenu) widget.Refresh(history.txTable.Result) selectedAccountLabel.SetText(filter) @@ -150,7 +153,7 @@ func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, windo widget.NewLabelWithStyle("#", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -164,7 +167,7 @@ func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, windo return } -func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label) { +func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, tabmenu *widget.TabContainer) { var confirmations int32 = 0 // if txDetails.BlockHeight != -1 { // confirmations = wallet.GetBestBlock() - txDetails.BlockHeight + 1 @@ -177,7 +180,6 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win } var spendUnconfirmed = wallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey) - var status string // var statusColor color.RGBA if spendUnconfirmed || confirmations > dcrlibwallet.DefaultRequiredConfirmations { @@ -188,14 +190,49 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win // statusColor = styles.DecredOrangeColor } + copiedLabel := widget.NewLabelWithStyle("Text copied to clipboard", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) + copiedLabel.Hide() + tableConfirmations := widget.NewHBox( widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), ) + + copyAbleText := func(textToCopy string, copyAble bool) *widgets.ClickableBox { + var t *canvas.Text + if copyAble { + t = canvas.NewText(textToCopy, color.RGBA{0, 255, 255, 1}) + } else { + t = canvas.NewText(textToCopy, color.RGBA{255, 255, 255, 1}) + } + t.TextSize = 14 + t.Alignment = fyne.TextAlignTrailing + + return widgets.NewClickableBox(widget.NewHBox(t), + func() { + clipboard := window.Clipboard() + clipboard.SetContent(textToCopy) + copiedLabel.Show() + + // only hide accountCopiedLabel text if user is currently on the page after 2secs + if copiedLabel.Hidden == false { + time.AfterFunc(time.Second*2, func() { + if tabmenu.CurrentTabIndex() == 1 { + copiedLabel.Hide() + } + }) + } + }, + ) + } + tableHash := widget.NewHBox( - widget.NewLabelWithStyle("Hash:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(txDetails.Hash, fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle("Transaction ID:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + // copyAddressAction enables address copying + copyAbleText(txDetails.Hash, true), + // canvas.NewText(txDetails.Hash, color.RGBA{0, 255, 255, 1}), ) + tableBlockHeight := widget.NewHBox( widget.NewLabelWithStyle("Block Height:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle(strconv.Itoa(int(txDetails.BlockHeight)), fyne.TextAlignCenter, fyne.TextStyle{}), @@ -247,7 +284,6 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win tableDate, ) - var txInput widgets.Table heading := widget.NewHBox( widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -257,9 +293,9 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win var inputBox []*widget.Box for i := range txDetails.Inputs { inputBox = append(inputBox, widget.NewHBox( - widget.NewLabelWithStyle(txDetails.Inputs[i].PreviousOutpoint, fyne.TextAlignLeading, fyne.TextStyle{}), - widget.NewLabelWithStyle(txDetails.Inputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + copyAbleText(txDetails.Inputs[i].PreviousOutpoint, true), + copyAbleText(txDetails.Inputs[i].AccountName, false), + copyAbleText(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), false), )) } txInput.NewTable(heading, inputBox...) @@ -274,34 +310,45 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win var outputBox []*widget.Box for i := range txDetails.Outputs { outputBox = append(outputBox, widget.NewHBox( - widget.NewLabelWithStyle(txDetails.Outputs[i].Address, fyne.TextAlignLeading, fyne.TextStyle{}), - widget.NewLabelWithStyle(txDetails.Outputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), - widget.NewLabelWithStyle(txDetails.Outputs[i].ScriptType, fyne.TextAlignCenter, fyne.TextStyle{}))) + copyAbleText(txDetails.Outputs[i].AccountName, false), + copyAbleText(txDetails.Outputs[i].Address, true), + copyAbleText(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), false), + copyAbleText(txDetails.Outputs[i].ScriptType, false), + )) } txOutput.NewTable(heading, outputBox...) label := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - - output := widget.NewHBox(widgets.NewHSpacer(10), widget.NewVBox( - label, - widgets.NewVSpacer(10), + v := widget.NewVBox( + widgets.NewHSpacer(5), tableData, widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txInput.Result, widgets.NewVSpacer(10), widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txOutput.Result, - ), widgets.NewHSpacer(10)) + widgets.NewHSpacer(5), + ) + + scrollContainer := widget.NewScrollContainer(v) + + output := widget.NewVBox( + widgets.NewHSpacer(10), + label, + copiedLabel, + widgets.NewVSpacer(40), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(scrollContainer.MinSize().Width+10, scrollContainer.MinSize().Height+400)), scrollContainer), + widgets.NewHSpacer(10), + ) - scrollContainer := widget.NewScrollContainer(output) - scrollContainer.Resize(fyne.NewSize(scrollContainer.MinSize().Width, 500)) - popUp := widget.NewPopUp(widget.NewVBox(fyne.NewContainer(scrollContainer)), + // scrollContainer.Resize(fyne.NewSize(scrollContainer.MinSize().Width, 500)) + popUp := widget.NewPopUp(widget.NewVBox(fyne.NewContainer(output)), window.Canvas()) + popUp.Move(fyne.NewPos(105, 40)) popUp.Show() } -func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool) { +func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { if filter != history.selectedFilterId { // filter changed, reset data txOffset = 0 @@ -337,10 +384,10 @@ func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *d widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(),fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { - fetchTxDetails(tx.Hash, wallet, window, history.errorLabel) + fetchTxDetails(tx.Hash, wallet, window, history.errorLabel, tabmenu) }), )) } From c70253a3124efa25e09dee8367df6213cf8509a8 Mon Sep 17 00:00:00 2001 From: morrison Date: Thu, 28 Nov 2019 07:27:01 +0100 Subject: [PATCH 12/73] added modal popup collapse icon, made txdetail pop a modal popup, added copy info etc --- fyne/pages/history.go | 187 ++++++++++++++++++++++++++---------------- 1 file changed, 116 insertions(+), 71 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index abc951c2b..8567ed5cc 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -11,6 +11,7 @@ import ( "fyne.io/fyne/canvas" "fyne.io/fyne/layout" "fyne.io/fyne/widget" + "fyne.io/fyne/theme" "github.com/decred/dcrd/chaincfg/chainhash" "github.com/decred/dcrd/dcrutil" @@ -44,12 +45,39 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm filterDropdown := txFilterDropDown(wallet, window, tabmenu) + // get icons used on the page. + icons, err := assets.GetIcons(assets.InfoIcon) + if err != nil { + return widget.NewLabel(fmt.Sprintf("Error: %s", err.Error())) + } + txTableHeader(wallet, &history.txTable, window) addToHistoryTable(&history.txTable, 0, dcrlibwallet.TxFilterAll, wallet, window, false, tabmenu) + + // clickableInfoIcon holds receiving decred hint-text pop-up + var clickableInfoIcon *widgets.ClickableIcon + clickableInfoIcon = widgets.NewClickableIcon(icons[assets.InfoIcon], nil, func() { + txHintLabel := widget.NewLabelWithStyle("Click on the blue text to copy", fyne.TextAlignLeading, fyne.TextStyle{Monospace: true}) + gotItLabel := canvas.NewText("Got it", color.RGBA{41, 112, 255, 255}) + gotItLabel.TextStyle = fyne.TextStyle{Bold: true} + gotItLabel.TextSize = 16 + + var txHintLabelPopUp *widget.PopUp + txHintLabelPopUp = widget.NewPopUp(widget.NewVBox( + widgets.NewVSpacer(14), + widget.NewHBox(widgets.NewHSpacer(14), txHintLabel, widgets.NewHSpacer(14)), + widgets.NewVSpacer(10), + widget.NewHBox(layout.NewSpacer(), widgets.NewClickableBox(widget.NewVBox(gotItLabel), func() { txHintLabelPopUp.Hide() }), widgets.NewHSpacer(14)), + widgets.NewVSpacer(14), + ), window.Canvas()) + + txHintLabelPopUp.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject(clickableInfoIcon).Add(fyne.NewPos(0, clickableInfoIcon.Size().Height))) + }) + output := widget.NewVBox( widgets.NewVSpacer(5), - widget.NewHBox(pageTitleLabel), + widget.NewHBox(pageTitleLabel, widgets.NewHSpacer(100), clickableInfoIcon), widgets.NewVSpacer(5), filterDropdown, widgets.NewVSpacer(5), @@ -131,7 +159,12 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmen accountSelectionPopup.Hide() // accountTab shows the selected account - icons, _ := assets.GetIcons(assets.CollapseIcon) + icons, err := assets.GetIcons(assets.CollapseIcon) + if err != nil { + errorMessage := fmt.Sprintf("Error: %s",err.Error()) + errorHandler(errorMessage, history.errorLabel) + return nil + } accountTab := widget.NewHBox( selectedAccountLabel, widgets.NewHSpacer(50), @@ -167,11 +200,80 @@ func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, windo return } +func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { + if filter != history.selectedFilterId { + // filter changed, reset data + txOffset = 0 + history.txns = nil + history.selectedFilterId = filter + } + + txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) + if err != nil { + errorHandler(fmt.Sprintf("Error getting transaction for Filter %s: %s", filter, err.Error()), history.errorLabel) + return + } + if len(txns) == 0 { + errorHandler("No transaction history yet.", history.errorLabel) + txTable.Container.Hide() + return + } + + history.txns = append(history.txns, txns...) + + var hBox []*widget.Box + for currentTxIndex, tx := range txns { + status := "Pending" + confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 + if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { + status = "Confirmed" + } + fmt.Println(tx.Hash) + + // trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] + hBox = append(hBox, widget.NewHBox( + widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), + // widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(tx.Hash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { + // fmt.Println(tx.Hash) + // fetchTxDetails(tx.Hash, wallet, window, history.errorLabel, tabmenu) + // }), + widget.NewButton(tx.Hash, func(){ + fmt.Println(tx.Hash) + fetchTxDetails(tx.Hash, wallet, window, history.errorLabel, tabmenu) + }), + )) + } + + if prepend { + history.txTable.Prepend(hBox...) + } else { + history.txTable.Append(hBox...) + } + history.errorLabel.Hide() +} + + func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, tabmenu *widget.TabContainer) { var confirmations int32 = 0 // if txDetails.BlockHeight != -1 { // confirmations = wallet.GetBestBlock() - txDetails.BlockHeight + 1 // } + + messageLabel := widget.NewLabelWithStyle("Fetching data..", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) + if messageLabel.Hidden == false { + time.AfterFunc(time.Millisecond*120, func() { + if tabmenu.CurrentTabIndex() == 1 { + messageLabel.Hide() + } + }) + } + newHash, _ := chainhash.NewHashFromStr(hash) txDetails, err := wallet.GetTransactionRaw(newHash[:]) if err != nil { @@ -189,10 +291,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win status = "Pending" // statusColor = styles.DecredOrangeColor } - - copiedLabel := widget.NewLabelWithStyle("Text copied to clipboard", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) - copiedLabel.Hide() - + tableConfirmations := widget.NewHBox( widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), @@ -207,18 +306,18 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win } t.TextSize = 14 t.Alignment = fyne.TextAlignTrailing - return widgets.NewClickableBox(widget.NewHBox(t), func() { + messageLabel.SetText("Data Copied") clipboard := window.Clipboard() clipboard.SetContent(textToCopy) - copiedLabel.Show() + messageLabel.Show() // only hide accountCopiedLabel text if user is currently on the page after 2secs - if copiedLabel.Hidden == false { + if messageLabel.Hidden == false { time.AfterFunc(time.Second*2, func() { if tabmenu.CurrentTabIndex() == 1 { - copiedLabel.Hide() + messageLabel.Hide() } }) } @@ -228,9 +327,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win tableHash := widget.NewHBox( widget.NewLabelWithStyle("Transaction ID:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - // copyAddressAction enables address copying copyAbleText(txDetails.Hash, true), - // canvas.NewText(txDetails.Hash, color.RGBA{0, 255, 255, 1}), ) tableBlockHeight := widget.NewHBox( @@ -320,82 +417,30 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win label := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) v := widget.NewVBox( - widgets.NewHSpacer(5), + widgets.NewHSpacer(10), tableData, widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txInput.Result, widgets.NewVSpacer(10), widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txOutput.Result, - widgets.NewHSpacer(5), + widgets.NewHSpacer(10), ) + var popUp *widget.PopUp scrollContainer := widget.NewScrollContainer(v) + minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { popUp.Hide() }) output := widget.NewVBox( widgets.NewHSpacer(10), - label, - copiedLabel, - widgets.NewVSpacer(40), + widget.NewHBox(label, widgets.NewHSpacer(150), messageLabel, layout.NewSpacer(), minimizeIcon, widgets.NewHSpacer(30)), + widgets.NewHSpacer(10), fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(scrollContainer.MinSize().Width+10, scrollContainer.MinSize().Height+400)), scrollContainer), widgets.NewHSpacer(10), ) - // scrollContainer.Resize(fyne.NewSize(scrollContainer.MinSize().Width, 500)) - popUp := widget.NewPopUp(widget.NewVBox(fyne.NewContainer(output)), + popUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(output)), window.Canvas()) - popUp.Move(fyne.NewPos(105, 40)) popUp.Show() } -func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { - if filter != history.selectedFilterId { - // filter changed, reset data - txOffset = 0 - history.txns = nil - history.selectedFilterId = filter - } - - txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) - if err != nil { - errorHandler(fmt.Sprintf("Error getting transaction for Filter %s: %s", filter, err.Error()), history.errorLabel) - return - } - if len(txns) < 10 { - errorHandler("No transaction history yet.", history.errorLabel) - txTable.Container.Hide() - return - } - - history.txns = append(history.txns, txns...) - - var hBox []*widget.Box - for currentTxIndex, tx := range txns { - status := "Pending" - confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 - if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { - status = "Confirmed" - } - - trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] - hBox = append(hBox, widget.NewHBox( - widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), - widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { - fetchTxDetails(tx.Hash, wallet, window, history.errorLabel, tabmenu) - }), - )) - } - - if prepend { - history.txTable.Prepend(hBox...) - } else { - history.txTable.Append(hBox...) - } - history.errorLabel.Hide() -} From a241b45ac30d69935711e6ab28aff774f52f90bc Mon Sep 17 00:00:00 2001 From: morrison Date: Fri, 29 Nov 2019 07:04:21 +0100 Subject: [PATCH 13/73] hint tip --- fyne/pages/history.go | 123 ++++++++++++++++++++++++++++++------------ 1 file changed, 88 insertions(+), 35 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 8567ed5cc..f6f66c9e0 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -45,39 +45,39 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm filterDropdown := txFilterDropDown(wallet, window, tabmenu) - // get icons used on the page. - icons, err := assets.GetIcons(assets.InfoIcon) - if err != nil { - return widget.NewLabel(fmt.Sprintf("Error: %s", err.Error())) - } + // // get icons used on the page. + // icons, err := assets.GetIcons(assets.InfoIcon) + // if err != nil { + // return widget.NewLabel(fmt.Sprintf("Error: %s", err.Error())) + // } txTableHeader(wallet, &history.txTable, window) addToHistoryTable(&history.txTable, 0, dcrlibwallet.TxFilterAll, wallet, window, false, tabmenu) // clickableInfoIcon holds receiving decred hint-text pop-up - var clickableInfoIcon *widgets.ClickableIcon - clickableInfoIcon = widgets.NewClickableIcon(icons[assets.InfoIcon], nil, func() { - txHintLabel := widget.NewLabelWithStyle("Click on the blue text to copy", fyne.TextAlignLeading, fyne.TextStyle{Monospace: true}) - gotItLabel := canvas.NewText("Got it", color.RGBA{41, 112, 255, 255}) - gotItLabel.TextStyle = fyne.TextStyle{Bold: true} - gotItLabel.TextSize = 16 - - var txHintLabelPopUp *widget.PopUp - txHintLabelPopUp = widget.NewPopUp(widget.NewVBox( - widgets.NewVSpacer(14), - widget.NewHBox(widgets.NewHSpacer(14), txHintLabel, widgets.NewHSpacer(14)), - widgets.NewVSpacer(10), - widget.NewHBox(layout.NewSpacer(), widgets.NewClickableBox(widget.NewVBox(gotItLabel), func() { txHintLabelPopUp.Hide() }), widgets.NewHSpacer(14)), - widgets.NewVSpacer(14), - ), window.Canvas()) - - txHintLabelPopUp.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject(clickableInfoIcon).Add(fyne.NewPos(0, clickableInfoIcon.Size().Height))) - }) + // var clickableInfoIcon *widgets.ClickableIcon + // clickableInfoIcon = widgets.NewClickableIcon(icons[assets.InfoIcon], nil, func() { + // txHintLabel := widget.NewLabelWithStyle("Click on the blue text to copy", fyne.TextAlignLeading, fyne.TextStyle{Monospace: true}) + // gotItLabel := canvas.NewText("Got it", color.RGBA{41, 112, 255, 255}) + // gotItLabel.TextStyle = fyne.TextStyle{Bold: true} + // gotItLabel.TextSize = 16 + + // var txHintLabelPopUp *widget.PopUp + // txHintLabelPopUp = widget.NewPopUp(widget.NewVBox( + // widgets.NewVSpacer(14), + // widget.NewHBox(widgets.NewHSpacer(14), txHintLabel, widgets.NewHSpacer(14)), + // widgets.NewVSpacer(10), + // widget.NewHBox(layout.NewSpacer(), widgets.NewClickableBox(widget.NewVBox(gotItLabel), func() { txHintLabelPopUp.Hide() }), widgets.NewHSpacer(14)), + // widgets.NewVSpacer(14), + // ), window.Canvas()) + + // txHintLabelPopUp.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject(clickableInfoIcon).Add(fyne.NewPos(0, clickableInfoIcon.Size().Height))) + // }) output := widget.NewVBox( widgets.NewVSpacer(5), - widget.NewHBox(pageTitleLabel, widgets.NewHSpacer(100), clickableInfoIcon), + widget.NewHBox(pageTitleLabel), widgets.NewVSpacer(5), filterDropdown, widgets.NewVSpacer(5), @@ -206,6 +206,7 @@ func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *d txOffset = 0 history.txns = nil history.selectedFilterId = filter + history.txTable.Container.Offset.Y = 0 } txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) @@ -228,9 +229,9 @@ func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *d if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { status = "Confirmed" } - fmt.Println(tx.Hash) - // trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] + trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] + txForTrimmedHash := tx.Hash hBox = append(hBox, widget.NewHBox( widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), @@ -239,13 +240,8 @@ func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *d widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), - // widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(tx.Hash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { - // fmt.Println(tx.Hash) - // fetchTxDetails(tx.Hash, wallet, window, history.errorLabel, tabmenu) - // }), - widget.NewButton(tx.Hash, func(){ - fmt.Println(tx.Hash) - fetchTxDetails(tx.Hash, wallet, window, history.errorLabel, tabmenu) + widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignCenter, fyne.TextStyle{Italic: true})), func() { + fetchTxDetails(txForTrimmedHash, wallet, window, history.errorLabel, tabmenu) }), )) } @@ -256,8 +252,15 @@ func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *d history.txTable.Append(hBox...) } history.errorLabel.Hide() -} + y := txTable.Container.Scrolled(txTable.Container.Content.Size().Height - txTable.Container.Size().Height) + fmt.Println(y) + + size := txTable.Container.Content.Size().Height - txTable.Container.Size().Height + scrollPosition := float64(history.txTable.Container.Offset.Y) / float64(size) + fmt.Println(size) + fmt.Println(scrollPosition) +} func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, tabmenu *widget.TabContainer) { var confirmations int32 = 0 @@ -267,7 +270,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win messageLabel := widget.NewLabelWithStyle("Fetching data..", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) if messageLabel.Hidden == false { - time.AfterFunc(time.Millisecond*120, func() { + time.AfterFunc(time.Millisecond*200, func() { if tabmenu.CurrentTabIndex() == 1 { messageLabel.Hide() } @@ -444,3 +447,53 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win popUp.Show() } +// func updateTx (){ +// size := history.txTable.Container.Content.Size().Height - history.txTable.Container.Size().Height +// scrollPosition := float64(history.txTable.Container.Offset.Y) / float64(size) + +// splittedWord := strings.Split(history.txFilters.Selected, " ") +// var found int32 +// if int32(txCountByFilter[splittedWord[0]]) > history.currentTxCount { +// found = int32(txCountByFilter[splittedWord[0]]) - history.currentTxCount +// history.txFilters.Selected = splittedWord[0] + " (" + strconv.Itoa(txCountByFilter[splittedWord[0]]) + ")" +// widget.Refresh(history.txFilters) +// } + +// // Append to table when scrollbar is at 90% of the scrollbar. +// if scrollPosition == 0.9 { +// if history.totalTxOnTable == int32(count)-found { +// return +// } +// addToHistoryTable(&history.txTable, history.totalTxOnTable+found, 20, wallet, window, false) +// if txCountByFilter[splittedWord[0]] > int(history.totalTxOnTable+20) { +// history.totalTxOnTable = history.totalTxOnTable + 20 +// } else { +// history.totalTxOnTable = int32(txCountByFilter[splittedWord[0]]) +// } +// // Delete from table if rows exceeds 90. +// if history.txTable.NumberOfColumns() >= 90 { +// history.txTable.Delete(0, 20) +// history.offset = history.offset + 20 +// } + +// } else if history.txTable.Container.Offset.Y == 0 { +// // If the scroll bar is at the begining, then fetch 1st 50 tx +// if int32(txCountByFilter[splittedWord[0]]) > history.currentTxCount { +// history.txFilters.SetSelected(splittedWord[0] + " (" + strconv.Itoa(txCountByFilter[splittedWord[0]]) + ")") +// } +// } else if scrollPosition < 0.2 { +// // Return if there's no currently deleted table. +// if history.offset == 0 { +// return +// } +// addToHistoryTable(&history.txTable, history.offset+found-20, 20+found, wallet, window, true) +// history.offset = history.offset - 20 + +// rowNo := history.txTable.NumberOfColumns() +// if rowNo >= 90 { +// history.txTable.Delete(rowNo-20, rowNo) +// history.totalTxOnTable = int32(rowNo) + history.offset +// } +// } +// } + From 60ad5d181b31a49739b08ba23a0c632457bcc197 Mon Sep 17 00:00:00 2001 From: morrison Date: Sun, 1 Dec 2019 02:08:51 +0100 Subject: [PATCH 14/73] renamed variables, remoeved commentedline and un used lines ofcode --- fyne/pages/history.go | 268 ++++++++++++++---------------------------- 1 file changed, 85 insertions(+), 183 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index f6f66c9e0..d9b282ece 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -25,8 +25,7 @@ const txPerPage int32 = 15 type historyPageData struct { txTable widgets.Table txDetailsTable widgets.Table - currentFilter int32 - selectedFilterCount int + allTxCount int txns []*dcrlibwallet.Transaction selectedFilterId int32 errorLabel *widget.Label @@ -42,54 +41,26 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm history.errorLabel.Hide() pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) + + txFilterDropDown := prepareTxFilterDropDown(wallet, window, tabmenu) - filterDropdown := txFilterDropDown(wallet, window, tabmenu) - - // // get icons used on the page. - // icons, err := assets.GetIcons(assets.InfoIcon) - // if err != nil { - // return widget.NewLabel(fmt.Sprintf("Error: %s", err.Error())) - // } - - txTableHeader(wallet, &history.txTable, window) - addToHistoryTable(&history.txTable, 0, dcrlibwallet.TxFilterAll, wallet, window, false, tabmenu) - - - // clickableInfoIcon holds receiving decred hint-text pop-up - // var clickableInfoIcon *widgets.ClickableIcon - // clickableInfoIcon = widgets.NewClickableIcon(icons[assets.InfoIcon], nil, func() { - // txHintLabel := widget.NewLabelWithStyle("Click on the blue text to copy", fyne.TextAlignLeading, fyne.TextStyle{Monospace: true}) - // gotItLabel := canvas.NewText("Got it", color.RGBA{41, 112, 255, 255}) - // gotItLabel.TextStyle = fyne.TextStyle{Bold: true} - // gotItLabel.TextSize = 16 - - // var txHintLabelPopUp *widget.PopUp - // txHintLabelPopUp = widget.NewPopUp(widget.NewVBox( - // widgets.NewVSpacer(14), - // widget.NewHBox(widgets.NewHSpacer(14), txHintLabel, widgets.NewHSpacer(14)), - // widgets.NewVSpacer(10), - // widget.NewHBox(layout.NewSpacer(), widgets.NewClickableBox(widget.NewVBox(gotItLabel), func() { txHintLabelPopUp.Hide() }), widgets.NewHSpacer(14)), - // widgets.NewVSpacer(14), - // ), window.Canvas()) - - // txHintLabelPopUp.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject(clickableInfoIcon).Add(fyne.NewPos(0, clickableInfoIcon.Size().Height))) - // }) + fetchTx(&history.txTable, 0, dcrlibwallet.TxFilterAll, wallet, window, false, tabmenu) - output := widget.NewVBox( + historyPageOutput := widget.NewVBox( widgets.NewVSpacer(5), widget.NewHBox(pageTitleLabel), widgets.NewVSpacer(5), - filterDropdown, + txFilterDropDown, widgets.NewVSpacer(5), fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(history.txTable.Container.MinSize().Width, history.txTable.Container.MinSize().Height+450)), history.txTable.Container), widgets.NewVSpacer(15), history.errorLabel, ) - return widget.NewHBox(widgets.NewHSpacer(18), output) + return widget.NewHBox(widgets.NewHSpacer(18), historyPageOutput) } -func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) *widgets.ClickableBox { +func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) *widgets.ClickableBox { var txTable widgets.Table var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} @@ -108,12 +79,12 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmen errorHandler(errorMessage, history.errorLabel) return nil } + history.allTxCount = txCountForFilter - selectedAccountLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) - history.selectedFilterCount = txCountForFilter + selectedTxFilterLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) - var accountSelectionPopup *widget.PopUp - accountListWidget := widget.NewVBox() + var txFilterSelectionPopup *widget.PopUp + txFilterListWidget := widget.NewVBox() for _, filterName := range allTxFilterNames { filterId := allTxFilters[filterName] txCountForFilter, err := wallet.CountTransactions(filterId) @@ -126,63 +97,64 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmen if txCountForFilter > 0 { filter := fmt.Sprintf("%s (%d)", filterName, txCountForFilter) - accountsView := widget.NewHBox( + txFilterView := widget.NewHBox( widgets.NewHSpacer(5), widget.NewLabel(filter), widgets.NewHSpacer(5), ) - accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { + txFilterListWidget.Append(widgets.NewClickableBox(txFilterView, func() { selectedFilterName := strings.Split(filter, " ")[0] selectedFilterId := allTxFilters[selectedFilterName] - history.selectedFilterCount, _ = strconv.Atoi(strings.Split(filter, " ")[1]) if selectedFilterId != history.selectedFilterId { - txTableHeader(wallet, &txTable, window) + // txTableHeader(wallet, &txTable, window) + fetchTx(&txTable, 0, selectedFilterId, wallet, window, false, tabmenu) history.txTable.Result.Children = txTable.Result.Children - addToHistoryTable(&txTable, 0, selectedFilterId, wallet, window, false, tabmenu) widget.Refresh(history.txTable.Result) - selectedAccountLabel.SetText(filter) + selectedTxFilterLabel.SetText(filter) } - accountSelectionPopup.Hide() + + txFilterSelectionPopup.Hide() })) } } - // accountSelectionPopup create a popup that has account names with spendable amount - accountSelectionPopup = widget.NewPopUp( - widget.NewVBox( - accountListWidget, - ), window.Canvas(), - ) - accountSelectionPopup.Hide() + // txFilterSelectionPopup create a popup that has tx filter name and tx count + txFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txFilterListWidget), window.Canvas()) + txFilterSelectionPopup.Hide() - // accountTab shows the selected account icons, err := assets.GetIcons(assets.CollapseIcon) if err != nil { errorMessage := fmt.Sprintf("Error: %s",err.Error()) errorHandler(errorMessage, history.errorLabel) return nil } - accountTab := widget.NewHBox( - selectedAccountLabel, + + txFilterTab := widget.NewHBox( + selectedTxFilterLabel, widgets.NewHSpacer(50), widget.NewIcon(icons[assets.CollapseIcon]), ) - var accountDropdown *widgets.ClickableBox - accountDropdown = widgets.NewClickableBox(accountTab, func() { - accountSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( - accountDropdown).Add(fyne.NewPos(0, accountDropdown.Size().Height))) - accountSelectionPopup.Show() + var txFilterDropDown *widgets.ClickableBox + txFilterDropDown = widgets.NewClickableBox(txFilterTab, func() { + txFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( + txFilterDropDown).Add(fyne.NewPos(0, txFilterDropDown.Size().Height))) + txFilterSelectionPopup.Show() }) - return accountDropdown + return txFilterDropDown } -func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window) { - tableHeading := widget.NewHBox( +func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { + if filter != history.selectedFilterId { + txOffset = 0 + history.selectedFilterId = filter + } + + tableColumnLabels := widget.NewHBox( widget.NewLabelWithStyle("#", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -193,22 +165,6 @@ func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, windo widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), ) - var hBox []*widget.Box - - txTable.NewTable(tableHeading, hBox...) - - return -} - -func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { - if filter != history.selectedFilterId { - // filter changed, reset data - txOffset = 0 - history.txns = nil - history.selectedFilterId = filter - history.txTable.Container.Offset.Y = 0 - } - txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) if err != nil { errorHandler(fmt.Sprintf("Error getting transaction for Filter %s: %s", filter, err.Error()), history.errorLabel) @@ -220,9 +176,7 @@ func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *d return } - history.txns = append(history.txns, txns...) - - var hBox []*widget.Box + var txBox []*widget.Box for currentTxIndex, tx := range txns { status := "Pending" confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 @@ -232,7 +186,7 @@ func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *d trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] txForTrimmedHash := tx.Hash - hBox = append(hBox, widget.NewHBox( + txBox = append(txBox, widget.NewHBox( widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), @@ -246,28 +200,12 @@ func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *d )) } - if prepend { - history.txTable.Prepend(hBox...) - } else { - history.txTable.Append(hBox...) - } - history.errorLabel.Hide() + txTable.NewTable(tableColumnLabels, txBox...) - y := txTable.Container.Scrolled(txTable.Container.Content.Size().Height - txTable.Container.Size().Height) - fmt.Println(y) - - size := txTable.Container.Content.Size().Height - txTable.Container.Size().Height - scrollPosition := float64(history.txTable.Container.Offset.Y) / float64(size) - fmt.Println(size) - fmt.Println(scrollPosition) + history.errorLabel.Hide() } func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, tabmenu *widget.TabContainer) { - var confirmations int32 = 0 - // if txDetails.BlockHeight != -1 { - // confirmations = wallet.GetBestBlock() - txDetails.BlockHeight + 1 - // } - messageLabel := widget.NewLabelWithStyle("Fetching data..", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) if messageLabel.Hidden == false { time.AfterFunc(time.Millisecond*200, func() { @@ -277,22 +215,29 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win }) } - newHash, _ := chainhash.NewHashFromStr(hash) - txDetails, err := wallet.GetTransactionRaw(newHash[:]) + chainHash, err := chainhash.NewHashFromStr(hash) + if err != nil { + errorHandler(fmt.Sprintf("Error: %s", err.Error()), history.errorLabel) + return + } + + txDetails, err := wallet.GetTransactionRaw(chainHash[:]) if err != nil { errorHandler(fmt.Sprintf("Error fetching transaction details for %s: %s", hash, err.Error()), history.errorLabel) return } - var spendUnconfirmed = wallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey) + var confirmations int32 = 0 + if txDetails.BlockHeight != -1 { + confirmations = wallet.GetBestBlock() - txDetails.BlockHeight + 1 + } + var status string - // var statusColor color.RGBA + var spendUnconfirmed = wallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey) if spendUnconfirmed || confirmations > dcrlibwallet.DefaultRequiredConfirmations { status = "Confirmed" - // statusColor = styles.DecredGreenColor } else { status = "Pending" - // statusColor = styles.DecredOrangeColor } tableConfirmations := widget.NewHBox( @@ -300,20 +245,21 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), ) - copyAbleText := func(textToCopy string, copyAble bool) *widgets.ClickableBox { - var t *canvas.Text + copyAbleText := func(text string, copyAble bool) *widgets.ClickableBox { + var textToCopy *canvas.Text if copyAble { - t = canvas.NewText(textToCopy, color.RGBA{0, 255, 255, 1}) + textToCopy = canvas.NewText(text, color.RGBA{0, 255, 255, 1}) } else { - t = canvas.NewText(textToCopy, color.RGBA{255, 255, 255, 1}) + textToCopy = canvas.NewText(text, color.RGBA{255, 255, 255, 1}) } - t.TextSize = 14 - t.Alignment = fyne.TextAlignTrailing - return widgets.NewClickableBox(widget.NewHBox(t), + textToCopy.TextSize = 14 + textToCopy.Alignment = fyne.TextAlignTrailing + + return widgets.NewClickableBox(widget.NewHBox(textToCopy), func() { messageLabel.SetText("Data Copied") clipboard := window.Clipboard() - clipboard.SetContent(textToCopy) + clipboard.SetContent(text) messageLabel.Show() // only hide accountCopiedLabel text if user is currently on the page after 2secs @@ -385,7 +331,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win ) var txInput widgets.Table - heading := widget.NewHBox( + inputTableColumnLabels := widget.NewHBox( widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) @@ -398,10 +344,10 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win copyAbleText(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), false), )) } - txInput.NewTable(heading, inputBox...) + txInput.NewTable(inputTableColumnLabels, inputBox...) var txOutput widgets.Table - heading = widget.NewHBox( + outputTableColumnLabels := widget.NewHBox( widget.NewLabelWithStyle("Address", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Value", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -416,10 +362,10 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win copyAbleText(txDetails.Outputs[i].ScriptType, false), )) } - txOutput.NewTable(heading, outputBox...) + txOutput.NewTable(outputTableColumnLabels, outputBox...) - label := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - v := widget.NewVBox( + txDetailslabel := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) + txDetailsData := widget.NewVBox( widgets.NewHSpacer(10), tableData, widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), @@ -430,70 +376,26 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win widgets.NewHSpacer(10), ) - var popUp *widget.PopUp - scrollContainer := widget.NewScrollContainer(v) - minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { popUp.Hide() }) + var txDetailsPopUp *widget.PopUp + txDetailsScrollContainer := widget.NewScrollContainer(txDetailsData) + minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) - output := widget.NewVBox( + txDetailsOutput := widget.NewVBox( widgets.NewHSpacer(10), - widget.NewHBox(label, widgets.NewHSpacer(150), messageLabel, layout.NewSpacer(), minimizeIcon, widgets.NewHSpacer(30)), + widget.NewHBox( + txDetailslabel, + widgets.NewHSpacer(150), + messageLabel, + layout.NewSpacer(), + minimizeIcon, + widgets.NewHSpacer(30), + ), widgets.NewHSpacer(10), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(scrollContainer.MinSize().Width+10, scrollContainer.MinSize().Height+400)), scrollContainer), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer), widgets.NewHSpacer(10), ) - popUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(output)), + txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), window.Canvas()) - popUp.Show() + txDetailsPopUp.Show() } - -// func updateTx (){ -// size := history.txTable.Container.Content.Size().Height - history.txTable.Container.Size().Height -// scrollPosition := float64(history.txTable.Container.Offset.Y) / float64(size) - -// splittedWord := strings.Split(history.txFilters.Selected, " ") -// var found int32 -// if int32(txCountByFilter[splittedWord[0]]) > history.currentTxCount { -// found = int32(txCountByFilter[splittedWord[0]]) - history.currentTxCount -// history.txFilters.Selected = splittedWord[0] + " (" + strconv.Itoa(txCountByFilter[splittedWord[0]]) + ")" -// widget.Refresh(history.txFilters) -// } - -// // Append to table when scrollbar is at 90% of the scrollbar. -// if scrollPosition == 0.9 { -// if history.totalTxOnTable == int32(count)-found { -// return -// } -// addToHistoryTable(&history.txTable, history.totalTxOnTable+found, 20, wallet, window, false) -// if txCountByFilter[splittedWord[0]] > int(history.totalTxOnTable+20) { -// history.totalTxOnTable = history.totalTxOnTable + 20 -// } else { -// history.totalTxOnTable = int32(txCountByFilter[splittedWord[0]]) -// } -// // Delete from table if rows exceeds 90. -// if history.txTable.NumberOfColumns() >= 90 { -// history.txTable.Delete(0, 20) -// history.offset = history.offset + 20 -// } - -// } else if history.txTable.Container.Offset.Y == 0 { -// // If the scroll bar is at the begining, then fetch 1st 50 tx -// if int32(txCountByFilter[splittedWord[0]]) > history.currentTxCount { -// history.txFilters.SetSelected(splittedWord[0] + " (" + strconv.Itoa(txCountByFilter[splittedWord[0]]) + ")") -// } -// } else if scrollPosition < 0.2 { -// // Return if there's no currently deleted table. -// if history.offset == 0 { -// return -// } -// addToHistoryTable(&history.txTable, history.offset+found-20, 20+found, wallet, window, true) -// history.offset = history.offset - 20 - -// rowNo := history.txTable.NumberOfColumns() -// if rowNo >= 90 { -// history.txTable.Delete(rowNo-20, rowNo) -// history.totalTxOnTable = int32(rowNo) + history.offset -// } -// } -// } - From c35e1ba7a8bc0c1b774ff3cc58869407f4a1ed74 Mon Sep 17 00:00:00 2001 From: morrison Date: Tue, 3 Dec 2019 17:47:13 +0100 Subject: [PATCH 15/73] fixed ssues with tx table not scrolling and returning to the table to when a filter with smaler no of tx --- fyne/pages/history.go | 120 +++++++++++++++++++++++++++++------------- 1 file changed, 83 insertions(+), 37 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index d9b282ece..e1e3ff01a 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -10,8 +10,8 @@ import ( "fyne.io/fyne" "fyne.io/fyne/canvas" "fyne.io/fyne/layout" - "fyne.io/fyne/widget" "fyne.io/fyne/theme" + "fyne.io/fyne/widget" "github.com/decred/dcrd/chaincfg/chainhash" "github.com/decred/dcrd/dcrutil" @@ -20,16 +20,17 @@ import ( "github.com/raedahgroup/godcr/fyne/widgets" ) -const txPerPage int32 = 15 +const txPerPage int32 = 8 type historyPageData struct { - txTable widgets.Table - txDetailsTable widgets.Table - allTxCount int - txns []*dcrlibwallet.Transaction - selectedFilterId int32 - errorLabel *widget.Label - txOffset int32 + txTable widgets.Table + txDetailsTable widgets.Table + allTxCount int + txns []*dcrlibwallet.Transaction + selectedFilterId int32 + errorLabel *widget.Label + txOffset int32 + TotalTxFetched int32 } var history historyPageData @@ -41,18 +42,18 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm history.errorLabel.Hide() pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - + txFilterDropDown := prepareTxFilterDropDown(wallet, window, tabmenu) + txTableHeader(wallet, &history.txTable, window) fetchTx(&history.txTable, 0, dcrlibwallet.TxFilterAll, wallet, window, false, tabmenu) - historyPageOutput := widget.NewVBox( widgets.NewVSpacer(5), widget.NewHBox(pageTitleLabel), widgets.NewVSpacer(5), txFilterDropDown, widgets.NewVSpacer(5), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(history.txTable.Container.MinSize().Width, history.txTable.Container.MinSize().Height+450)), history.txTable.Container), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(history.txTable.Container.MinSize().Width, history.txTable.Container.MinSize().Height+200)), history.txTable.Container), widgets.NewVSpacer(15), history.errorLabel, ) @@ -106,13 +107,15 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, txFilterListWidget.Append(widgets.NewClickableBox(txFilterView, func() { selectedFilterName := strings.Split(filter, " ")[0] selectedFilterId := allTxFilters[selectedFilterName] + if allTxCountForSelectedTx, err := wallet.CountTransactions(selectedFilterId); err == nil { + history.allTxCount = allTxCountForSelectedTx + } if selectedFilterId != history.selectedFilterId { - // txTableHeader(wallet, &txTable, window) - fetchTx(&txTable, 0, selectedFilterId, wallet, window, false, tabmenu) + txTableHeader(wallet, &txTable, window) history.txTable.Result.Children = txTable.Result.Children + fetchTx(&txTable, 0, selectedFilterId, wallet, window, false, tabmenu) widget.Refresh(history.txTable.Result) - selectedTxFilterLabel.SetText(filter) } @@ -127,7 +130,7 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, icons, err := assets.GetIcons(assets.CollapseIcon) if err != nil { - errorMessage := fmt.Sprintf("Error: %s",err.Error()) + errorMessage := fmt.Sprintf("Error: %s", err.Error()) errorHandler(errorMessage, history.errorLabel) return nil } @@ -148,14 +151,8 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, return txFilterDropDown } -func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { - if filter != history.selectedFilterId { - txOffset = 0 - history.selectedFilterId = filter - } - - tableColumnLabels := widget.NewHBox( - widget.NewLabelWithStyle("#", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), +func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window) { + tableHeading := widget.NewHBox( widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -165,6 +162,20 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), ) + var hBox []*widget.Box + + txTable.NewTable(tableHeading, hBox...) + + return +} + +func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { + if filter != history.selectedFilterId { + txOffset = 0 + history.TotalTxFetched = 0 + history.selectedFilterId = filter + } + txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) if err != nil { errorHandler(fmt.Sprintf("Error getting transaction for Filter %s: %s", filter, err.Error()), history.errorLabel) @@ -176,8 +187,10 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle return } + history.TotalTxFetched += int32(len(txns)) + var txBox []*widget.Box - for currentTxIndex, tx := range txns { + for _, tx := range txns { status := "Pending" confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { @@ -187,7 +200,6 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] txForTrimmedHash := tx.Hash txBox = append(txBox, widget.NewHBox( - widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), @@ -200,7 +212,19 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle )) } - txTable.NewTable(tableColumnLabels, txBox...) + if prepend { + txTable.Prepend(txBox...) + } else { + txTable.Append(txBox...) + } + + history.txTable.Result.Children = txTable.Result.Children + widget.Refresh(history.txTable.Result) + widget.Refresh(history.txTable.Container) + + time.AfterFunc(time.Second*8, func() { + updateTable(wallet, window, tabmenu) + }) history.errorLabel.Hide() } @@ -239,7 +263,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win } else { status = "Pending" } - + tableConfirmations := widget.NewHBox( widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), @@ -262,7 +286,6 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win clipboard.SetContent(text) messageLabel.Show() - // only hide accountCopiedLabel text if user is currently on the page after 2secs if messageLabel.Hidden == false { time.AfterFunc(time.Second*2, func() { if tabmenu.CurrentTabIndex() == 1 { @@ -376,20 +399,20 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win widgets.NewHSpacer(10), ) - var txDetailsPopUp *widget.PopUp + var txDetailsPopUp *widget.PopUp txDetailsScrollContainer := widget.NewScrollContainer(txDetailsData) - minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) + minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) txDetailsOutput := widget.NewVBox( widgets.NewHSpacer(10), widget.NewHBox( - txDetailslabel, - widgets.NewHSpacer(150), - messageLabel, - layout.NewSpacer(), - minimizeIcon, + txDetailslabel, + widgets.NewHSpacer(150), + messageLabel, + layout.NewSpacer(), + minimizeIcon, widgets.NewHSpacer(30), - ), + ), widgets.NewHSpacer(10), fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer), widgets.NewHSpacer(10), @@ -399,3 +422,26 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win window.Canvas()) txDetailsPopUp.Show() } + +func updateTable(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) { + size := history.txTable.Container.Content.Size().Height - history.txTable.Container.Size().Height + scrollPosition := float64(history.txTable.Container.Offset.Y) / float64(size) + fmt.Println(scrollPosition, size) + + if history.allTxCount > int(history.TotalTxFetched) { + if history.txTable.Container.Offset.Y == 0 { + fetchTx(&history.txTable, history.TotalTxFetched, history.selectedFilterId, wallet, window, false, tabmenu) + }else if scrollPosition < 0.8 { + time.AfterFunc(time.Second*8, func() { + updateTable(wallet, window, tabmenu) + }) + } else if scrollPosition >= 0.8 { + fetchTx(&history.txTable, history.TotalTxFetched, history.selectedFilterId, wallet, window, false, tabmenu) + } else if scrollPosition < 0.2 { + if history.TotalTxFetched <= txPerPage { + + } + fetchTx(&history.txTable, history.TotalTxFetched, history.selectedFilterId, wallet, window, true, tabmenu) + } + } +} From 3463275e9aafd76b9e2e142e9e63c1bfdef5942a Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 4 Dec 2019 01:19:47 +0100 Subject: [PATCH 16/73] fixed panic issue with error handlers for txdetails page and txdropdown when they are initialized --- fyne/pages/history.go | 209 ++++++++++++++++++++++++------------------ 1 file changed, 118 insertions(+), 91 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index e1e3ff01a..959d8d735 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -20,48 +20,52 @@ import ( "github.com/raedahgroup/godcr/fyne/widgets" ) -const txPerPage int32 = 8 +const txPerPage int32 = 25 -type historyPageData struct { +type txHistoryPageData struct { txTable widgets.Table - txDetailsTable widgets.Table allTxCount int - txns []*dcrlibwallet.Transaction selectedFilterId int32 errorLabel *widget.Label - txOffset int32 TotalTxFetched int32 } -var history historyPageData +var txHistory txHistoryPageData func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) fyne.CanvasObject { - // error handler - history.errorLabel = widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) - history.errorLabel.Hide() + txHistory.errorLabel = widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) + txHistory.errorLabel.Hide() pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - txFilterDropDown := prepareTxFilterDropDown(wallet, window, tabmenu) - - txTableHeader(wallet, &history.txTable, window) - fetchTx(&history.txTable, 0, dcrlibwallet.TxFilterAll, wallet, window, false, tabmenu) - historyPageOutput := widget.NewVBox( + txHistoryPageOutput := widget.NewVBox( widgets.NewVSpacer(5), widget.NewHBox(pageTitleLabel), widgets.NewVSpacer(5), - txFilterDropDown, - widgets.NewVSpacer(5), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(history.txTable.Container.MinSize().Width, history.txTable.Container.MinSize().Height+200)), history.txTable.Container), - widgets.NewVSpacer(15), - history.errorLabel, ) - return widget.NewHBox(widgets.NewHSpacer(18), historyPageOutput) + txFilterDropDown, errorMessage := txFilterDropDown(wallet, window, tabmenu) + fmt.Println(errorMessage) + if errorMessage != "" { + errorHandler(errorMessage, txHistory.errorLabel) + txHistoryPageOutput.Append(txHistory.errorLabel) + return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) + } + + txTableHeader(wallet, &txHistory.txTable, window) + fetchTx(&txHistory.txTable, 0, dcrlibwallet.TxFilterAll, wallet, window, false, tabmenu) + + txHistoryPageOutput.Append(txFilterDropDown) + txHistoryPageOutput.Append(txHistory.errorLabel) + txHistoryPageOutput.Append(widgets.NewVSpacer(5)) + txHistoryPageOutput.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txHistory.txTable.Container.MinSize().Width, txHistory.txTable.Container.MinSize().Height+450)), txHistory.txTable.Container)) + txHistoryPageOutput.Append(widgets.NewVSpacer(15)) + + return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } -func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) *widgets.ClickableBox { +func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) (*widgets.ClickableBox, string) { var txTable widgets.Table var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} @@ -76,11 +80,10 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, txCountForFilter, err := wallet.CountTransactions(allTxFilters["All"]) if err != nil { - errorMessage := fmt.Sprintf("Cannot load history page. Error getting transaction count for filter All: %s", err.Error()) - errorHandler(errorMessage, history.errorLabel) - return nil + errorMessage := fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter All: %s", err.Error()) + return nil, errorMessage } - history.allTxCount = txCountForFilter + txHistory.allTxCount = txCountForFilter selectedTxFilterLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) @@ -90,10 +93,9 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, filterId := allTxFilters[filterName] txCountForFilter, err := wallet.CountTransactions(filterId) if err != nil { - errorMessage := fmt.Sprintf("Cannot load history page. Error getting transaction count for filter %s: %s", + errorMessage := fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter %s: %s", filterName, err.Error()) - errorHandler(errorMessage, history.errorLabel) - return nil + return nil, errorMessage } if txCountForFilter > 0 { @@ -108,15 +110,15 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, selectedFilterName := strings.Split(filter, " ")[0] selectedFilterId := allTxFilters[selectedFilterName] if allTxCountForSelectedTx, err := wallet.CountTransactions(selectedFilterId); err == nil { - history.allTxCount = allTxCountForSelectedTx + txHistory.allTxCount = allTxCountForSelectedTx } - if selectedFilterId != history.selectedFilterId { + if selectedFilterId != txHistory.selectedFilterId { + selectedTxFilterLabel.SetText(filter) txTableHeader(wallet, &txTable, window) - history.txTable.Result.Children = txTable.Result.Children + txHistory.txTable.Result.Children = txTable.Result.Children fetchTx(&txTable, 0, selectedFilterId, wallet, window, false, tabmenu) - widget.Refresh(history.txTable.Result) - selectedTxFilterLabel.SetText(filter) + widget.Refresh(txHistory.txTable.Result) } txFilterSelectionPopup.Hide() @@ -131,13 +133,12 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, icons, err := assets.GetIcons(assets.CollapseIcon) if err != nil { errorMessage := fmt.Sprintf("Error: %s", err.Error()) - errorHandler(errorMessage, history.errorLabel) - return nil + return nil, errorMessage } txFilterTab := widget.NewHBox( selectedTxFilterLabel, - widgets.NewHSpacer(50), + widgets.NewHSpacer(60), widget.NewIcon(icons[assets.CollapseIcon]), ) @@ -148,7 +149,7 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, txFilterSelectionPopup.Show() }) - return txFilterDropDown + return txFilterDropDown, "" } func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window) { @@ -170,24 +171,24 @@ func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, windo } func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { - if filter != history.selectedFilterId { + if filter != txHistory.selectedFilterId { txOffset = 0 - history.TotalTxFetched = 0 - history.selectedFilterId = filter + txHistory.TotalTxFetched = 0 + txHistory.selectedFilterId = filter } txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) if err != nil { - errorHandler(fmt.Sprintf("Error getting transaction for Filter %s: %s", filter, err.Error()), history.errorLabel) + errorHandler(fmt.Sprintf("Error getting transaction for Filter: %s", err.Error()), txHistory.errorLabel) return } if len(txns) == 0 { - errorHandler("No transaction history yet.", history.errorLabel) - txTable.Container.Hide() + errorHandler("No transactions yet.", txHistory.errorLabel) + txHistory.txTable.Container.Hide() return } - history.TotalTxFetched += int32(len(txns)) + txHistory.TotalTxFetched += int32(len(txns)) var txBox []*widget.Box for _, tx := range txns { @@ -207,7 +208,7 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignCenter, fyne.TextStyle{Italic: true})), func() { - fetchTxDetails(txForTrimmedHash, wallet, window, history.errorLabel, tabmenu) + fetchTxDetails(txForTrimmedHash, wallet, window, txHistory.errorLabel, tabmenu) }), )) } @@ -218,15 +219,48 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle txTable.Append(txBox...) } - history.txTable.Result.Children = txTable.Result.Children - widget.Refresh(history.txTable.Result) - widget.Refresh(history.txTable.Container) + txHistory.txTable.Result.Children = txTable.Result.Children + widget.Refresh(txHistory.txTable.Result) + widget.Refresh(txHistory.txTable.Container) time.AfterFunc(time.Second*8, func() { updateTable(wallet, window, tabmenu) }) - history.errorLabel.Hide() + txHistory.errorLabel.Hide() +} + +func updateTable(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) { + size := txHistory.txTable.Container.Content.Size().Height - txHistory.txTable.Container.Size().Height + scrollPosition := float64(txHistory.txTable.Container.Offset.Y) / float64(size) + txTableRowCount := txHistory.txTable.NumberOfColumns() + + if txHistory.allTxCount > int(txHistory.TotalTxFetched) { + if txHistory.txTable.Container.Offset.Y == 0 { + + time.AfterFunc(time.Second*8, func() { + updateTable(wallet, window, tabmenu) + }) + } else if scrollPosition < 0.5 { + if txHistory.TotalTxFetched <= txPerPage { + time.AfterFunc(time.Second*8, func() { + updateTable(wallet, window, tabmenu) + }) + } + if txTableRowCount <= int(txPerPage) { + return + } + + txHistory.TotalTxFetched -= int32(txPerPage) + + fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, wallet, window, true, tabmenu) + } else if scrollPosition >= 0.5 { + fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, wallet, window, false, tabmenu) + if txTableRowCount > 12 { + txHistory.txTable.Delete(0, txTableRowCount-int(txPerPage)) + } + } + } } func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, tabmenu *widget.TabContainer) { @@ -239,15 +273,45 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win }) } + var txDetailsPopUp *widget.PopUp + + txDetailslabel := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) + + minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) + errorMessageLabel := widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) + + txDetailsOutput := widget.NewVBox( + widgets.NewHSpacer(10), + widget.NewHBox( + txDetailslabel, + widgets.NewHSpacer(150), + messageLabel, + layout.NewSpacer(), + minimizeIcon, + widgets.NewHSpacer(20), + ), + widgets.NewVSpacer(10), + ) + txDetailsOutput.Resize(fyne.NewSize(600, 150)) + + txDetailsErrorMethod := func() { + txDetailsOutput.Append(errorMessageLabel) + txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), + window.Canvas()) + txDetailsPopUp.Show() + } + chainHash, err := chainhash.NewHashFromStr(hash) if err != nil { - errorHandler(fmt.Sprintf("Error: %s", err.Error()), history.errorLabel) + errorHandler(fmt.Sprintf("fetching generating chainhash from for \n %s \n %s ", hash, err.Error()), errorMessageLabel) + txDetailsErrorMethod() return } txDetails, err := wallet.GetTransactionRaw(chainHash[:]) if err != nil { - errorHandler(fmt.Sprintf("Error fetching transaction details for %s: %s", hash, err.Error()), history.errorLabel) + errorHandler(fmt.Sprintf("Error fetching transaction details for \n %s \n %s ", hash, err.Error()), errorMessageLabel) + txDetailsErrorMethod() return } @@ -387,7 +451,6 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win } txOutput.NewTable(outputTableColumnLabels, outputBox...) - txDetailslabel := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) txDetailsData := widget.NewVBox( widgets.NewHSpacer(10), tableData, @@ -399,49 +462,13 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win widgets.NewHSpacer(10), ) - var txDetailsPopUp *widget.PopUp txDetailsScrollContainer := widget.NewScrollContainer(txDetailsData) - minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) - txDetailsOutput := widget.NewVBox( - widgets.NewHSpacer(10), - widget.NewHBox( - txDetailslabel, - widgets.NewHSpacer(150), - messageLabel, - layout.NewSpacer(), - minimizeIcon, - widgets.NewHSpacer(30), - ), - widgets.NewHSpacer(10), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer), - widgets.NewHSpacer(10), - ) + txDetailsOutput.Append(widgets.NewHSpacer(10)) + txDetailsOutput.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer)) + txDetailsOutput.Append(widgets.NewHSpacer(10)) txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), window.Canvas()) txDetailsPopUp.Show() } - -func updateTable(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) { - size := history.txTable.Container.Content.Size().Height - history.txTable.Container.Size().Height - scrollPosition := float64(history.txTable.Container.Offset.Y) / float64(size) - fmt.Println(scrollPosition, size) - - if history.allTxCount > int(history.TotalTxFetched) { - if history.txTable.Container.Offset.Y == 0 { - fetchTx(&history.txTable, history.TotalTxFetched, history.selectedFilterId, wallet, window, false, tabmenu) - }else if scrollPosition < 0.8 { - time.AfterFunc(time.Second*8, func() { - updateTable(wallet, window, tabmenu) - }) - } else if scrollPosition >= 0.8 { - fetchTx(&history.txTable, history.TotalTxFetched, history.selectedFilterId, wallet, window, false, tabmenu) - } else if scrollPosition < 0.2 { - if history.TotalTxFetched <= txPerPage { - - } - fetchTx(&history.txTable, history.TotalTxFetched, history.selectedFilterId, wallet, window, true, tabmenu) - } - } -} From 1e8334c69168b984cd3c573fddedd5b862d2769c Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 4 Dec 2019 08:00:24 +0100 Subject: [PATCH 17/73] fixed error handler panic for tx, added txsort dropdown to history page --- fyne/pages/history.go | 64 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 959d8d735..657813be9 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -46,7 +46,13 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm ) txFilterDropDown, errorMessage := txFilterDropDown(wallet, window, tabmenu) - fmt.Println(errorMessage) + if errorMessage != "" { + errorHandler(errorMessage, txHistory.errorLabel) + txHistoryPageOutput.Append(txHistory.errorLabel) + return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) + } + + txSortFilterDropDown, errorMessage := txSortDropDown(window) if errorMessage != "" { errorHandler(errorMessage, txHistory.errorLabel) txHistoryPageOutput.Append(txHistory.errorLabel) @@ -56,7 +62,7 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm txTableHeader(wallet, &txHistory.txTable, window) fetchTx(&txHistory.txTable, 0, dcrlibwallet.TxFilterAll, wallet, window, false, tabmenu) - txHistoryPageOutput.Append(txFilterDropDown) + txHistoryPageOutput.Append(widget.NewHBox(txSortFilterDropDown, widgets.NewHSpacer(30), txFilterDropDown)) txHistoryPageOutput.Append(txHistory.errorLabel) txHistoryPageOutput.Append(widgets.NewVSpacer(5)) txHistoryPageOutput.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txHistory.txTable.Container.MinSize().Width, txHistory.txTable.Container.MinSize().Height+450)), txHistory.txTable.Container)) @@ -152,6 +158,59 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmen return txFilterDropDown, "" } +func txSortDropDown(window fyne.Window) (*widgets.ClickableBox, string) { + var allTxSortNames = []string{"Newest", "Oldest"} + var allTxSortFilters = map[string]int32{ + "Newest": 0, + "Oldest": 1, + } + + selectedTxSortFilterLabel := widget.NewLabel("Newest") + + var txSortFilterSelectionPopup *widget.PopUp + txSortFilterListWidget := widget.NewVBox() + for _, sortName := range allTxSortNames { + sortId := allTxSortFilters[sortName] + fmt.Println(sortId) + + txSortView := widget.NewHBox( + widgets.NewHSpacer(5), + widget.NewLabel(sortName), + widgets.NewHSpacer(5), + ) + + txSortFilterListWidget.Append(widgets.NewClickableBox(txSortView, func() { + selectedTxSortFilterLabel.SetText(sortName) + txSortFilterSelectionPopup.Hide() + })) + } + + // txSortFilterSelectionPopup create a popup that has tx filter name and tx count + txSortFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txSortFilterListWidget), window.Canvas()) + txSortFilterSelectionPopup.Hide() + + icons, err := assets.GetIcons(assets.CollapseIcon) + if err != nil { + errorMessage := fmt.Sprintf("Error: %s", err.Error()) + return nil, errorMessage + } + + txSortFilterTab := widget.NewHBox( + selectedTxSortFilterLabel, + widgets.NewHSpacer(10), + widget.NewIcon(icons[assets.CollapseIcon]), + ) + + var txSortFilterDropDown *widgets.ClickableBox + txSortFilterDropDown = widgets.NewClickableBox(txSortFilterTab, func() { + txSortFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( + txSortFilterDropDown).Add(fyne.NewPos(0, txSortFilterDropDown.Size().Height))) + txSortFilterSelectionPopup.Show() + }) + + return txSortFilterDropDown, "" +} + func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window) { tableHeading := widget.NewHBox( widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -180,6 +239,7 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) if err != nil { errorHandler(fmt.Sprintf("Error getting transaction for Filter: %s", err.Error()), txHistory.errorLabel) + txHistory.txTable.Container.Hide() return } if len(txns) == 0 { From c328cb19b059f7ef260d298ffd80a5454c11047a Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 4 Dec 2019 13:44:58 +0100 Subject: [PATCH 18/73] fixe issues with txdetails popup --- fyne/pages/history.go | 54 +++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 657813be9..bf9f23bec 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -324,9 +324,9 @@ func updateTable(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *wi } func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, tabmenu *widget.TabContainer) { - messageLabel := widget.NewLabelWithStyle("Fetching data..", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) + messageLabel := widget.NewLabelWithStyle("Fetching data..", fyne.TextAlignCenter, fyne.TextStyle{}) if messageLabel.Hidden == false { - time.AfterFunc(time.Millisecond*200, func() { + time.AfterFunc(time.Millisecond*300, func() { if tabmenu.CurrentTabIndex() == 1 { messageLabel.Hide() } @@ -340,30 +340,27 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) errorMessageLabel := widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) - txDetailsOutput := widget.NewVBox( - widgets.NewHSpacer(10), - widget.NewHBox( - txDetailslabel, - widgets.NewHSpacer(150), - messageLabel, - layout.NewSpacer(), - minimizeIcon, - widgets.NewHSpacer(20), - ), - widgets.NewVSpacer(10), - ) - txDetailsOutput.Resize(fyne.NewSize(600, 150)) - txDetailsErrorMethod := func() { - txDetailsOutput.Append(errorMessageLabel) - txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), + txErrorDetailsOutput := widget.NewVBox( + widgets.NewHSpacer(10), + widget.NewHBox( + txDetailslabel, + widgets.NewHSpacer(150), + messageLabel, + layout.NewSpacer(), + minimizeIcon, + widgets.NewHSpacer(30), + ), + errorMessageLabel, + ) + txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txErrorDetailsOutput)), window.Canvas()) txDetailsPopUp.Show() } chainHash, err := chainhash.NewHashFromStr(hash) - if err != nil { - errorHandler(fmt.Sprintf("fetching generating chainhash from for \n %s \n %s ", hash, err.Error()), errorMessageLabel) + if err == nil { + errorHandler(fmt.Sprintf("fetching generating chainhash from for \n %s \n %s ", hash, "err.Error()"), errorMessageLabel) txDetailsErrorMethod() return } @@ -524,9 +521,20 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win txDetailsScrollContainer := widget.NewScrollContainer(txDetailsData) - txDetailsOutput.Append(widgets.NewHSpacer(10)) - txDetailsOutput.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer)) - txDetailsOutput.Append(widgets.NewHSpacer(10)) + txDetailsOutput := widget.NewVBox( + widgets.NewHSpacer(10), + widget.NewHBox( + txDetailslabel, + widgets.NewHSpacer(150), + messageLabel, + layout.NewSpacer(), + minimizeIcon, + widgets.NewHSpacer(30), + ), + widgets.NewHSpacer(10), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer), + widgets.NewHSpacer(10), + ) txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), window.Canvas()) From 6278f2199c23d23b37bda06e56a11de222c4593d Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 4 Dec 2019 13:48:12 +0100 Subject: [PATCH 19/73] un-did changes --- fyne/pages/history.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index bf9f23bec..e9456a33d 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -359,8 +359,8 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win } chainHash, err := chainhash.NewHashFromStr(hash) - if err == nil { - errorHandler(fmt.Sprintf("fetching generating chainhash from for \n %s \n %s ", hash, "err.Error()"), errorMessageLabel) + if err != nil { + errorHandler(fmt.Sprintf("fetching generating chainhash from for \n %s \n %s ", hash, err.Error()), errorMessageLabel) txDetailsErrorMethod() return } From 7540cf949c871a9cdd86dd4d1f289fbed5c4dfd4 Mon Sep 17 00:00:00 2001 From: morrison Date: Thu, 5 Dec 2019 07:22:53 +0100 Subject: [PATCH 20/73] rebased pr --- fyne/widgets/table.go | 1 - 1 file changed, 1 deletion(-) diff --git a/fyne/widgets/table.go b/fyne/widgets/table.go index 68f4aa136..a3afc7860 100644 --- a/fyne/widgets/table.go +++ b/fyne/widgets/table.go @@ -166,4 +166,3 @@ func (table *Table) set() { table.Result.Children = container.Children widget.Refresh(table.Result) } - From b5c41bd998cccee655814b8a47557fe5b7808924 Mon Sep 17 00:00:00 2001 From: morrison Date: Tue, 5 Nov 2019 19:30:54 +0100 Subject: [PATCH 21/73] added transaction filter popup --- fyne/pages/history.go | 90 +++++++++++++++++++++++++++ go.mod~added transaction filter popup | 15 +++++ 2 files changed, 105 insertions(+) create mode 100644 go.mod~added transaction filter popup diff --git a/fyne/pages/history.go b/fyne/pages/history.go index e9456a33d..72ed43a0c 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -540,3 +540,93 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win window.Canvas()) txDetailsPopUp.Show() } + +func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window) *widgets.ClickableBox { + var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} + var allTxFilters = map[string]int32{ + "All": dcrlibwallet.TxFilterAll, + "Sent": dcrlibwallet.TxFilterSent, + "Received": dcrlibwallet.TxFilterReceived, + "Transferred": dcrlibwallet.TxFilterTransferred, + "Coinbase": dcrlibwallet.TxFilterCoinBase, + "Staking": dcrlibwallet.TxFilterStaking, + } + + txCountForFilter, _ := wallet.CountTransactions(allTxFilters["All"]) + selectedAccountLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) + + activeFiltersWithTxCounts := make(map[int32]int) + + var accountSelectionPopup *widget.PopUp + accountListWidget := widget.NewVBox() + for _, filterName := range allTxFilterNames { + filterId := allTxFilters[filterName] + txCountForFilter, _ := wallet.CountTransactions(filterId) + // if txCountErr != nil { + // errorMessage := fmt.Sprintf("Cannot load history page. Error getting transaction count for filter %s: %s", + // filterName, txCountErr.Error()) + // displayMessage(errorMessage, MessageKindError) + // return nil + // } + + if txCountForFilter > 0 { + activeFiltersWithTxCounts[filterId] = txCountForFilter + accountsView := widget.NewHBox( + widgets.NewHSpacer(5), + widget.NewLabel(fmt.Sprintf("%s (%d)", filterName, txCountForFilter)), + widgets.NewHSpacer(5), + ) + + accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { + selectedAccountLabel.SetText(fmt.Sprintf("%s (%d)", filterName, txCountForFilter)) + accountSelectionPopup.Hide() + })) + } + } + + // if len(activeFiltersWithTxCounts) == 0 { + // displayMessage("No transactions yet", MessageKindInfo) + // return nil + // } + + // accountSelectionPopup create a popup that has account names with spendable amount + accountSelectionPopup = widget.NewPopUp( + widget.NewVBox( + accountListWidget, + ), window.Canvas(), + ) + accountSelectionPopup.Hide() + + + + // // dropDown selection change listener + // txFilterDropDown.AddDropDown("", txFilterSelectionOptions, 0, func(selectedOption string, index int) { + // selectedFilterName := strings.Split(selectedOption, " ")[0] + // selectedFilterId := allTxFilters[selectedFilterName] + // if selectedFilterId != historyPageData.currentTxFilter { + // go fetchAndDisplayTransactions(0, selectedFilterId) + // } + // }) + + // accountTab shows the selected account + icons, _ := assets.GetIcons(assets.CollapseIcon) + accountTab := widget.NewHBox( + selectedAccountLabel, + widgets.NewHSpacer(8), + widget.NewIcon(icons[assets.CollapseIcon]), + ) + + var accountDropdown *widgets.ClickableBox + accountDropdown = widgets.NewClickableBox(accountTab, func() { + accountSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( + accountDropdown).Add(fyne.NewPos(0, accountDropdown.Size().Height))) + accountSelectionPopup.Show() + }) + + return accountDropdown +} + +// func errorHandler(err string, errorLabel *widget.Label) { +// errorLabel.SetText(err) +// errorLabel.Show() +// } diff --git a/go.mod~added transaction filter popup b/go.mod~added transaction filter popup new file mode 100644 index 000000000..86d1355d3 --- /dev/null +++ b/go.mod~added transaction filter popup @@ -0,0 +1,15 @@ +module github.com/raedahgroup/godcr + +go 1.12 + +replace ( + github.com/raedahgroup/godcr/cmd/godcr-fyne => ./cmd/godcr-fyne + github.com/raedahgroup/godcr/cmd/godcr-terminal => ./cmd/godcr-terminal + github.com/raedahgroup/godcr/fyne => ./fyne + github.com/raedahgroup/godcr/terminal => ./terminal +) + +require ( + github.com/raedahgroup/godcr/cmd/godcr-fyne v0.0.0-00010101000000-000000000000 // indirect + github.com/raedahgroup/godcr/cmd/godcr-terminal v0.0.0-00010101000000-000000000000 // indirect +) From f3057c6e266c1a8b4757cfae120211cd972d300c Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 6 Nov 2019 07:51:18 +0100 Subject: [PATCH 22/73] fixed dropdown selection issues --- fyne/pages/history.go | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 72ed43a0c..05a1b3d48 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -541,7 +541,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win txDetailsPopUp.Show() } -func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window) *widgets.ClickableBox { +func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label) *widgets.ClickableBox { var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} var allTxFilters = map[string]int32{ "All": dcrlibwallet.TxFilterAll, @@ -558,36 +558,35 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window) activeFiltersWithTxCounts := make(map[int32]int) var accountSelectionPopup *widget.PopUp + var accountsView *widget.Box accountListWidget := widget.NewVBox() for _, filterName := range allTxFilterNames { filterId := allTxFilters[filterName] - txCountForFilter, _ := wallet.CountTransactions(filterId) - // if txCountErr != nil { - // errorMessage := fmt.Sprintf("Cannot load history page. Error getting transaction count for filter %s: %s", - // filterName, txCountErr.Error()) - // displayMessage(errorMessage, MessageKindError) - // return nil - // } + txCountForFilter, txCountErr := wallet.CountTransactions(filterId) + if txCountErr != nil { + errorMessage := fmt.Sprintf("Cannot load history page. Error getting transaction count for filter %s: %s", + filterName, txCountErr.Error()) + errorHandler(errorMessage, errorLabel) + return nil + } if txCountForFilter > 0 { activeFiltersWithTxCounts[filterId] = txCountForFilter - accountsView := widget.NewHBox( + filter := fmt.Sprintf("%s (%d)", filterName, txCountForFilter) + accountsView = widget.NewHBox( widgets.NewHSpacer(5), - widget.NewLabel(fmt.Sprintf("%s (%d)", filterName, txCountForFilter)), + widget.NewLabel(filter), widgets.NewHSpacer(5), ) - accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { - selectedAccountLabel.SetText(fmt.Sprintf("%s (%d)", filterName, txCountForFilter)) - accountSelectionPopup.Hide() - })) + accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { + selectedAccountLabel.SetText(filter) + accountSelectionPopup.Hide() + })) } } - // if len(activeFiltersWithTxCounts) == 0 { - // displayMessage("No transactions yet", MessageKindInfo) - // return nil - // } + // accountSelectionPopup create a popup that has account names with spendable amount accountSelectionPopup = widget.NewPopUp( From b9b10abd2ed041804c52a55707af81148b510348 Mon Sep 17 00:00:00 2001 From: morrison Date: Sat, 9 Nov 2019 22:33:26 +0100 Subject: [PATCH 23/73] added table.go, and table header --- fyne/pages/history.go | 83 ++++++++++++++++++++++++++++++++----------- fyne/widgets/table.go | 1 + 2 files changed, 63 insertions(+), 21 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 05a1b3d48..dbce65a52 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -22,6 +22,8 @@ import ( const txPerPage int32 = 25 +const txPerPage int32 = 25 + type txHistoryPageData struct { txTable widgets.Table allTxCount int @@ -579,15 +581,19 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, widgets.NewHSpacer(5), ) - accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { - selectedAccountLabel.SetText(filter) - accountSelectionPopup.Hide() - })) + accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { + // selectedFilterName := strings.Split(filter, " ")[0] + // selectedFilterId := allTxFilters[selectedFilterName] + // if selectedFilterId != historyPageData.currentTxFilter { + // go fetchAndDisplayTransactions(0, selectedFilterId) + // } + + selectedAccountLabel.SetText(filter) + accountSelectionPopup.Hide() + })) } } - - // accountSelectionPopup create a popup that has account names with spendable amount accountSelectionPopup = widget.NewPopUp( widget.NewVBox( @@ -596,17 +602,6 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, ) accountSelectionPopup.Hide() - - - // // dropDown selection change listener - // txFilterDropDown.AddDropDown("", txFilterSelectionOptions, 0, func(selectedOption string, index int) { - // selectedFilterName := strings.Split(selectedOption, " ")[0] - // selectedFilterId := allTxFilters[selectedFilterName] - // if selectedFilterId != historyPageData.currentTxFilter { - // go fetchAndDisplayTransactions(0, selectedFilterId) - // } - // }) - // accountTab shows the selected account icons, _ := assets.GetIcons(assets.CollapseIcon) accountTab := widget.NewHBox( @@ -625,7 +620,53 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, return accountDropdown } -// func errorHandler(err string, errorLabel *widget.Label) { -// errorLabel.SetText(err) -// errorLabel.Show() -// } +func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txOffset int, filter int32) *widget.Box { + tableHeading := widget.NewHBox( + widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) + + + // txns, err := wallet.GetTransactionsRaw(int32(txOffset), txPerPage, dcrlibwallet.TxFilterAll) + // if err != nil { + // // displayMessage(err.Error(), MessageKindError) + // // return + // } + + // // calculate max number of digits after decimal point for all tx amounts + // inputsAndOutputsAmount := make([]int64, len(txns)) + // for i, tx := range txns { + // inputsAndOutputsAmount[i] = tx.Amount + // } + // maxDecimalPlacesForTxAmounts := helpers.MaxDecimalPlaces(inputsAndOutputsAmount) + + // var hBox []*widget.Box + // for i, tx := range txns { + // status := "Pending" + // confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 + // if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { + // status = "Confirmed" + // } + + // formattedAmount := helpers.FormatAmountDisplay(tx.Amount, maxDecimalPlacesForTxAmounts) + // trimmedHash := txns[i].Hash[:25] + "..." + // hBox = append(hBox, widget.NewHBox( + // widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.ExtractDateOrTime(tx.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), + // widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.TransactionDirectionName(tx.Direction)), fyne.TextAlignCenter, fyne.TextStyle{}), + // widget.NewLabelWithStyle(fmt.Sprintf("%12s", status), fyne.TextAlignLeading, fyne.TextStyle{}), + // widget.NewLabelWithStyle(fmt.Sprintf("%15s", formattedAmount), fyne.TextAlignTrailing, fyne.TextStyle{}), + // widget.NewLabelWithStyle(fmt.Sprintf("%-8s", tx.Type), fyne.TextAlignCenter, fyne.TextStyle{}), + // widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{}), + // )) + // } + + h := widgets.NewTable(tableHeading, nil) + // txTable.Refresh() + + return h +} + diff --git a/fyne/widgets/table.go b/fyne/widgets/table.go index a3afc7860..11469f78c 100644 --- a/fyne/widgets/table.go +++ b/fyne/widgets/table.go @@ -158,6 +158,7 @@ func (table *Table) set() { if len(table.heading.Children) > len(data.Children) && i > len(data.Children)-1 { continue } + getVerticals.Append(data.Children[i]) } container.Append(getVerticals) From b6de20bce8b7e36decdc20e0aa938bb9aa2c7b35 Mon Sep 17 00:00:00 2001 From: morrison Date: Mon, 11 Nov 2019 08:34:47 +0100 Subject: [PATCH 24/73] added table.go, and fetched table data into the table --- fyne/pages/history.go | 89 ++++++++++++++++++++++--------------------- fyne/widgets/table.go | 2 + 2 files changed, 47 insertions(+), 44 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index dbce65a52..d87259f2b 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -620,53 +620,54 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, return accountDropdown } -func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txOffset int, filter int32) *widget.Box { +func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, txOffset int, filter int32) { tableHeading := widget.NewHBox( widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) - - - // txns, err := wallet.GetTransactionsRaw(int32(txOffset), txPerPage, dcrlibwallet.TxFilterAll) - // if err != nil { - // // displayMessage(err.Error(), MessageKindError) - // // return - // } - - // // calculate max number of digits after decimal point for all tx amounts - // inputsAndOutputsAmount := make([]int64, len(txns)) - // for i, tx := range txns { - // inputsAndOutputsAmount[i] = tx.Amount - // } - // maxDecimalPlacesForTxAmounts := helpers.MaxDecimalPlaces(inputsAndOutputsAmount) - - // var hBox []*widget.Box - // for i, tx := range txns { - // status := "Pending" - // confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 - // if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { - // status = "Confirmed" - // } - - // formattedAmount := helpers.FormatAmountDisplay(tx.Amount, maxDecimalPlacesForTxAmounts) - // trimmedHash := txns[i].Hash[:25] + "..." - // hBox = append(hBox, widget.NewHBox( - // widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.ExtractDateOrTime(tx.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), - // widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.TransactionDirectionName(tx.Direction)), fyne.TextAlignCenter, fyne.TextStyle{}), - // widget.NewLabelWithStyle(fmt.Sprintf("%12s", status), fyne.TextAlignLeading, fyne.TextStyle{}), - // widget.NewLabelWithStyle(fmt.Sprintf("%15s", formattedAmount), fyne.TextAlignTrailing, fyne.TextStyle{}), - // widget.NewLabelWithStyle(fmt.Sprintf("%-8s", tx.Type), fyne.TextAlignCenter, fyne.TextStyle{}), - // widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{}), - // )) - // } - - h := widgets.NewTable(tableHeading, nil) - // txTable.Refresh() - - return h + widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + ) + + + txns, err := wallet.GetTransactionsRaw(int32(txOffset), txPerPage, dcrlibwallet.TxFilterAll) + if err != nil { + // displayMessage(err.Error(), MessageKindError) + // return + } + + // calculate max number of digits after decimal point for all tx amounts + inputsAndOutputsAmount := make([]int64, len(txns)) + for i, tx := range txns { + inputsAndOutputsAmount[i] = tx.Amount + } + maxDecimalPlacesForTxAmounts := helpers.MaxDecimalPlaces(inputsAndOutputsAmount) + + var hBox []*widget.Box + for _, tx := range txns { + status := "Pending" + confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 + if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { + status = "Confirmed" + } + + formattedAmount := helpers.FormatAmountDisplay(tx.Amount, maxDecimalPlacesForTxAmounts) + trimmedHash := tx.Hash[:25] + "..." + + hBox = append(hBox, widget.NewHBox( + widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.ExtractDateOrTime(tx.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.TransactionDirectionName(tx.Direction)), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(fmt.Sprintf("%12s", status), fyne.TextAlignLeading, fyne.TextStyle{}), + widget.NewLabelWithStyle(fmt.Sprintf("%15s", formattedAmount), fyne.TextAlignTrailing, fyne.TextStyle{}), + widget.NewLabelWithStyle(fmt.Sprintf("%-8s", tx.Type), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{}), + )) + } + + txTable.NewTable(tableHeading, hBox...) + txTable.Refresh() + + return } diff --git a/fyne/widgets/table.go b/fyne/widgets/table.go index 11469f78c..398b1311d 100644 --- a/fyne/widgets/table.go +++ b/fyne/widgets/table.go @@ -149,6 +149,8 @@ func (table *Table) Delete(from, to int) { func (table *Table) set() { var container = widget.NewHBox() + fmt.Println(container) + fmt.Println(table.heading.Children) // Get horizontals apart from heading. for i := 0; i < len(table.heading.Children); i++ { From 1a72ea411ee7c09274837576fd395f8536ea7f47 Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 13 Nov 2019 07:00:46 +0100 Subject: [PATCH 25/73] bug fix with tablefilter --- fyne/pages/history.go | 56 +++++++++++++++++++++++++++++++++++-------- fyne/widgets/table.go | 1 - 2 files changed, 46 insertions(+), 11 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index d87259f2b..d767a3290 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -2,10 +2,15 @@ package pages import ( "fmt" +<<<<<<< HEAD "image/color" "strconv" "strings" "time" +======= + "strings" + // "image/color" +>>>>>>> bug fix with tablefilter "fyne.io/fyne" "fyne.io/fyne/canvas" @@ -21,7 +26,9 @@ import ( ) const txPerPage int32 = 25 + var txTable widgets.Table +<<<<<<< HEAD const txPerPage int32 = 25 type txHistoryPageData struct { @@ -33,6 +40,9 @@ type txHistoryPageData struct { } var txHistory txHistoryPageData +======= +func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) fyne.CanvasObject { +>>>>>>> bug fix with tablefilter func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) fyne.CanvasObject { @@ -40,6 +50,7 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm txHistory.errorLabel.Hide() pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) +<<<<<<< HEAD txHistoryPageOutput := widget.NewVBox( widgets.NewVSpacer(5), @@ -536,6 +547,23 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win widgets.NewHSpacer(10), fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer), widgets.NewHSpacer(10), +======= + + t := prepareTxFilterDropDown(wallet, &txTable, window, errorLabel) + + fetchAndDisplayTransactions(wallet, &txTable, 0, dcrlibwallet.TxFilterAll) + txTable.Result.Children = txTable.Result.Children + widget.Refresh(txTable.Result) + fmt.Println(txTable.Result) + output := widget.NewVBox( + widgets.NewVSpacer(5), + widget.NewHBox(pageTitleLabel), + widgets.NewVSpacer(5), + t, + widgets.NewVSpacer(5), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txTable.Container.MinSize().Width, txTable.Container.MinSize().Height+200)), txTable.Container), + errorLabel, +>>>>>>> bug fix with tablefilter ) txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), @@ -543,7 +571,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win txDetailsPopUp.Show() } -func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label) *widgets.ClickableBox { +func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window, errorLabel *widget.Label) *widgets.ClickableBox { var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} var allTxFilters = map[string]int32{ "All": dcrlibwallet.TxFilterAll, @@ -582,11 +610,11 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, ) accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { - // selectedFilterName := strings.Split(filter, " ")[0] - // selectedFilterId := allTxFilters[selectedFilterName] + selectedFilterName := strings.Split(filter, " ")[0] + selectedFilterId := allTxFilters[selectedFilterName] + // if selectedFilterId != historyPageData.currentTxFilter { - // go fetchAndDisplayTransactions(0, selectedFilterId) - // } + fetchAndDisplayTransactions(wallet, txTable, 0, selectedFilterId) selectedAccountLabel.SetText(filter) accountSelectionPopup.Hide() @@ -606,7 +634,7 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, icons, _ := assets.GetIcons(assets.CollapseIcon) accountTab := widget.NewHBox( selectedAccountLabel, - widgets.NewHSpacer(8), + widgets.NewHSpacer(12), widget.NewIcon(icons[assets.CollapseIcon]), ) @@ -630,8 +658,7 @@ func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widget widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), ) - - txns, err := wallet.GetTransactionsRaw(int32(txOffset), txPerPage, dcrlibwallet.TxFilterAll) + txns, err := wallet.GetTransactionsRaw(int32(txOffset), txPerPage, filter) if err != nil { // displayMessage(err.Error(), MessageKindError) // return @@ -653,7 +680,7 @@ func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widget } formattedAmount := helpers.FormatAmountDisplay(tx.Amount, maxDecimalPlacesForTxAmounts) - trimmedHash := tx.Hash[:25] + "..." + // trimmedHash := tx.Hash[:25] + "..." hBox = append(hBox, widget.NewHBox( widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.ExtractDateOrTime(tx.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), @@ -661,13 +688,22 @@ func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widget widget.NewLabelWithStyle(fmt.Sprintf("%12s", status), fyne.TextAlignLeading, fyne.TextStyle{}), widget.NewLabelWithStyle(fmt.Sprintf("%15s", formattedAmount), fyne.TextAlignTrailing, fyne.TextStyle{}), widget.NewLabelWithStyle(fmt.Sprintf("%-8s", tx.Type), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{}), + widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(fmt.Sprintf("%-8s", tx.Hash), fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { + fmt.Println(tx.Hash) + }), )) } txTable.NewTable(tableHeading, hBox...) txTable.Refresh() + // fmt.Println("new line") + // fmt.Println(txTable.Result.Children) + // txTable.Result.Children = txTable.Result.Children + // widget.Refresh(txTable.Result) return } +func fetchTxDetail() { + +} diff --git a/fyne/widgets/table.go b/fyne/widgets/table.go index 398b1311d..8efe56533 100644 --- a/fyne/widgets/table.go +++ b/fyne/widgets/table.go @@ -4,7 +4,6 @@ import ( "fyne.io/fyne" "fyne.io/fyne/widget" ) - type Table struct { tableData []*widget.Box heading *widget.Box From e17a82731a8d9a512070db22f47aefbaec7e7834 Mon Sep 17 00:00:00 2001 From: morrison Date: Fri, 15 Nov 2019 08:05:11 +0100 Subject: [PATCH 26/73] implemented txtable filtering --- fyne/pages/history.go | 44 ++++++------------------------------------- 1 file changed, 6 insertions(+), 38 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index d767a3290..032745e14 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -2,15 +2,10 @@ package pages import ( "fmt" -<<<<<<< HEAD "image/color" "strconv" "strings" "time" -======= - "strings" - // "image/color" ->>>>>>> bug fix with tablefilter "fyne.io/fyne" "fyne.io/fyne/canvas" @@ -25,10 +20,6 @@ import ( "github.com/raedahgroup/godcr/fyne/widgets" ) -const txPerPage int32 = 25 - var txTable widgets.Table - -<<<<<<< HEAD const txPerPage int32 = 25 type txHistoryPageData struct { @@ -40,17 +31,12 @@ type txHistoryPageData struct { } var txHistory txHistoryPageData -======= -func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) fyne.CanvasObject { ->>>>>>> bug fix with tablefilter - func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) fyne.CanvasObject { txHistory.errorLabel = widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) txHistory.errorLabel.Hide() pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) -<<<<<<< HEAD txHistoryPageOutput := widget.NewVBox( widgets.NewVSpacer(5), @@ -547,23 +533,6 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win widgets.NewHSpacer(10), fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer), widgets.NewHSpacer(10), -======= - - t := prepareTxFilterDropDown(wallet, &txTable, window, errorLabel) - - fetchAndDisplayTransactions(wallet, &txTable, 0, dcrlibwallet.TxFilterAll) - txTable.Result.Children = txTable.Result.Children - widget.Refresh(txTable.Result) - fmt.Println(txTable.Result) - output := widget.NewVBox( - widgets.NewVSpacer(5), - widget.NewHBox(pageTitleLabel), - widgets.NewVSpacer(5), - t, - widgets.NewVSpacer(5), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txTable.Container.MinSize().Width, txTable.Container.MinSize().Height+200)), txTable.Container), - errorLabel, ->>>>>>> bug fix with tablefilter ) txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), @@ -571,7 +540,9 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win txDetailsPopUp.Show() } -func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window, errorLabel *widget.Label) *widgets.ClickableBox { +func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label) *widgets.ClickableBox { + var txTable widgets.Table + var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} var allTxFilters = map[string]int32{ "All": dcrlibwallet.TxFilterAll, @@ -614,7 +585,9 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, txTable *widgets.Ta selectedFilterId := allTxFilters[selectedFilterName] // if selectedFilterId != historyPageData.currentTxFilter { - fetchAndDisplayTransactions(wallet, txTable, 0, selectedFilterId) + fetchAndDisplayTransactions(wallet, &txTable, 0, selectedFilterId) + overview.txTable.Result.Children = txTable.Result.Children + widget.Refresh(overview.txTable.Result) selectedAccountLabel.SetText(filter) accountSelectionPopup.Hide() @@ -696,11 +669,6 @@ func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widget txTable.NewTable(tableHeading, hBox...) txTable.Refresh() - // fmt.Println("new line") - // fmt.Println(txTable.Result.Children) - - // txTable.Result.Children = txTable.Result.Children - // widget.Refresh(txTable.Result) return } From f8d90cc7a77d9c7c8457b630595ccffd57cf49b2 Mon Sep 17 00:00:00 2001 From: morrison Date: Sun, 17 Nov 2019 00:17:36 +0100 Subject: [PATCH 27/73] added pagination --- fyne/pages/history.go | 141 ++++++++++++++++++++++++++++++------------ fyne/widgets/table.go | 1 + 2 files changed, 102 insertions(+), 40 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 032745e14..a32b21fe2 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -36,6 +36,19 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm txHistory.errorLabel = widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) txHistory.errorLabel.Hide() + history.currentPage = 1 + history.selectedFilterId = dcrlibwallet.TxFilterAll + + var prevButton *widget.Button + var nextButton *widget.Button + prevButton = widget.NewButton("Prev", func() { + loadPreviousPage(wallet , nextButton, prevButton) + }) + + nextButton = widget.NewButton("Next", func() { + loadNextPage(wallet , nextButton, prevButton) + }) + pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) txHistoryPageOutput := widget.NewVBox( @@ -540,7 +553,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win txDetailsPopUp.Show() } -func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label) *widgets.ClickableBox { +func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, nextButton, prevButton *widget.Button) *widgets.ClickableBox { var txTable widgets.Table var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} @@ -553,28 +566,25 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, "Staking": dcrlibwallet.TxFilterStaking, } - txCountForFilter, _ := wallet.CountTransactions(allTxFilters["All"]) - selectedAccountLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) - - activeFiltersWithTxCounts := make(map[int32]int) + history.txCountForFilter, _ = wallet.CountTransactions(allTxFilters["All"]) + selectedAccountLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", history.txCountForFilter)) + history.selectedFilterCount = history.txCountForFilter var accountSelectionPopup *widget.PopUp - var accountsView *widget.Box accountListWidget := widget.NewVBox() for _, filterName := range allTxFilterNames { filterId := allTxFilters[filterName] - txCountForFilter, txCountErr := wallet.CountTransactions(filterId) - if txCountErr != nil { + history.txCountForFilter, history.txCountErr = wallet.CountTransactions(filterId) + if history.txCountErr != nil { errorMessage := fmt.Sprintf("Cannot load history page. Error getting transaction count for filter %s: %s", - filterName, txCountErr.Error()) + filterName, history.txCountErr.Error()) errorHandler(errorMessage, errorLabel) return nil } - if txCountForFilter > 0 { - activeFiltersWithTxCounts[filterId] = txCountForFilter - filter := fmt.Sprintf("%s (%d)", filterName, txCountForFilter) - accountsView = widget.NewHBox( + if history.txCountForFilter > 0 { + filter := fmt.Sprintf("%s (%d)", filterName, history.txCountForFilter) + accountsView := widget.NewHBox( widgets.NewHSpacer(5), widget.NewLabel(filter), widgets.NewHSpacer(5), @@ -582,13 +592,12 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { selectedFilterName := strings.Split(filter, " ")[0] - selectedFilterId := allTxFilters[selectedFilterName] - - // if selectedFilterId != historyPageData.currentTxFilter { - fetchAndDisplayTransactions(wallet, &txTable, 0, selectedFilterId) - overview.txTable.Result.Children = txTable.Result.Children - widget.Refresh(overview.txTable.Result) + history.selectedFilterId = allTxFilters[selectedFilterName] + history.selectedFilterCount, _ = strconv.Atoi(strings.Split(filter, " ")[1]) + fetchAndDisplayTransactions(wallet, &txTable, nextButton, prevButton) + history.txTable.Result.Children = txTable.Result.Children + widget.Refresh(history.txTable.Result) selectedAccountLabel.SetText(filter) accountSelectionPopup.Hide() })) @@ -607,7 +616,7 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, icons, _ := assets.GetIcons(assets.CollapseIcon) accountTab := widget.NewHBox( selectedAccountLabel, - widgets.NewHSpacer(12), + widgets.NewHSpacer(50), widget.NewIcon(icons[assets.CollapseIcon]), ) @@ -621,57 +630,109 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, return accountDropdown } -func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, txOffset int, filter int32) { +func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, nextButton, prevButton *widget.Button) { tableHeading := widget.NewHBox( + widget.NewLabelWithStyle("#", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), ) - txns, err := wallet.GetTransactionsRaw(int32(txOffset), txPerPage, filter) + txOffset := 0 + if history.txns != nil { + txOffset = len(history.txns) + } + + txns, err := wallet.GetTransactionsRaw(int32(txOffset), txPerPage, history.selectedFilterId) if err != nil { // displayMessage(err.Error(), MessageKindError) // return } - // calculate max number of digits after decimal point for all tx amounts - inputsAndOutputsAmount := make([]int64, len(txns)) - for i, tx := range txns { - inputsAndOutputsAmount[i] = tx.Amount - } - maxDecimalPlacesForTxAmounts := helpers.MaxDecimalPlaces(inputsAndOutputsAmount) + history.txl = len(txns) + history.txns = append(history.txns, txns...) + pageTxOffset := (history.currentPage - 1) * txPerPage + maxTxIndexForCurrentPage := pageTxOffset + txPerPage var hBox []*widget.Box - for _, tx := range txns { + for currentTxIndex, tx := range history.txns { + if currentTxIndex < int(pageTxOffset) { + continue // skip txs not belonging to this page + } + if currentTxIndex >= int(maxTxIndexForCurrentPage) { + break // max number of tx displayed for this page + } + status := "Pending" confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { status = "Confirmed" } - formattedAmount := helpers.FormatAmountDisplay(tx.Amount, maxDecimalPlacesForTxAmounts) - // trimmedHash := tx.Hash[:25] + "..." - hBox = append(hBox, widget.NewHBox( - widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.ExtractDateOrTime(tx.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(fmt.Sprintf("%-10s", dcrlibwallet.TransactionDirectionName(tx.Direction)), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(fmt.Sprintf("%12s", status), fyne.TextAlignLeading, fyne.TextStyle{}), - widget.NewLabelWithStyle(fmt.Sprintf("%15s", formattedAmount), fyne.TextAlignTrailing, fyne.TextStyle{}), - widget.NewLabelWithStyle(fmt.Sprintf("%-8s", tx.Type), fyne.TextAlignCenter, fyne.TextStyle{}), - widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(fmt.Sprintf("%-8s", tx.Hash), fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { - fmt.Println(tx.Hash) + widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(),fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), + widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(tx.Hash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { + history.txTable.Container.Hide() + history.txDetailsTable.Container.Show() + fetchTxDetail(&history.txDetailsTable, wallet, tx.Hash) }), )) } txTable.NewTable(tableHeading, hBox...) txTable.Refresh() + + if history.currentPage > 1 { + prevButton.Enable() + }else{ + prevButton.Disable() + } + + if history.selectedFilterCount > int(maxTxIndexForCurrentPage) { + nextButton.Enable() + }else{ + nextButton.Disable() + } + return } -func fetchTxDetail() { +func loadPreviousPage(wallet *dcrlibwallet.LibWallet, nextButton, prevButton *widget.Button) { + var txTable widgets.Table + history.currentPage-- + history.txns = history.txns[:len(history.txns)-(int(txPerPage) + history.txl)] + + fetchAndDisplayTransactions(wallet, &txTable, nextButton, prevButton) + history.txTable.Result.Children = txTable.Result.Children + widget.Refresh(history.txTable.Result) + return } + +func loadNextPage(wallet *dcrlibwallet.LibWallet, nextButton, prevButton *widget.Button) { + var txTable widgets.Table + + nextPage := history.currentPage + 1 + history.currentPage = nextPage + nextPageTxOffset := (nextPage - 1) * txPerPage + + if int(nextPageTxOffset) >= len(history.txns) { + // we've not loaded txs for this page + fetchAndDisplayTransactions(wallet, &txTable, nextButton, prevButton) + history.txTable.Result.Children = txTable.Result.Children + widget.Refresh(history.txTable.Result) + } + + return +} + diff --git a/fyne/widgets/table.go b/fyne/widgets/table.go index 8efe56533..398b1311d 100644 --- a/fyne/widgets/table.go +++ b/fyne/widgets/table.go @@ -4,6 +4,7 @@ import ( "fyne.io/fyne" "fyne.io/fyne/widget" ) + type Table struct { tableData []*widget.Box heading *widget.Box From 49f45bbfc92eee7bba6e5538df82bad233f1c20e Mon Sep 17 00:00:00 2001 From: morrison Date: Tue, 19 Nov 2019 23:19:54 +0100 Subject: [PATCH 28/73] added transaction details page, improved table.go, removed pagination basedd on review, minor code clean up --- fyne/pages/history.go | 233 ++++++++++++++++++++++--------- fyne/pages/transactionDetails.go | 140 +++++++++++++++++++ fyne/widgets/table.go | 3 - 3 files changed, 309 insertions(+), 67 deletions(-) create mode 100644 fyne/pages/transactionDetails.go diff --git a/fyne/pages/history.go b/fyne/pages/history.go index a32b21fe2..0e9b676a8 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -20,6 +20,7 @@ import ( "github.com/raedahgroup/godcr/fyne/widgets" ) +<<<<<<< HEAD const txPerPage int32 = 25 type txHistoryPageData struct { @@ -28,6 +29,22 @@ type txHistoryPageData struct { selectedFilterId int32 errorLabel *widget.Label TotalTxFetched int32 +======= +const txPerPage int32 = 10 + +type historyPageData struct { + txTable widgets.Table + txDetailsTable widgets.Table + currentFilter int32 + currentPage int32 + selectedFilterCount int + txCountErr error + txCountForFilter int + txns []*dcrlibwallet.Transaction + selectedFilterId int32 + errorLabel *widget.Label + txl int +>>>>>>> added transaction details page, improved table.go, removed pagination basedd on review, minor code clean up } var txHistory txHistoryPageData @@ -39,22 +56,29 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm history.currentPage = 1 history.selectedFilterId = dcrlibwallet.TxFilterAll - var prevButton *widget.Button - var nextButton *widget.Button - prevButton = widget.NewButton("Prev", func() { - loadPreviousPage(wallet , nextButton, prevButton) - }) - - nextButton = widget.NewButton("Next", func() { - loadNextPage(wallet , nextButton, prevButton) - }) - pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) +<<<<<<< HEAD txHistoryPageOutput := widget.NewVBox( widgets.NewVSpacer(5), widget.NewHBox(pageTitleLabel), widgets.NewVSpacer(5), +======= + + filterDropdown := txFilterDropDown(wallet, window, errorLabel) + + fetchAndDisplayTransactions(wallet, &history.txTable, window) + + output := widget.NewVBox( + widgets.NewVSpacer(5), + widget.NewHBox(pageTitleLabel), + widgets.NewVSpacer(5), + filterDropdown, + widgets.NewVSpacer(5), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(history.txTable.Container.MinSize().Width, history.txTable.Container.MinSize().Height+200)), history.txTable.Container), + widgets.NewVSpacer(15), + errorLabel, +>>>>>>> added transaction details page, improved table.go, removed pagination basedd on review, minor code clean up ) txFilterDropDown, errorMessage := txFilterDropDown(wallet, window, tabmenu) @@ -553,7 +577,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win txDetailsPopUp.Show() } -func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, nextButton, prevButton *widget.Button) *widgets.ClickableBox { +func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label) *widgets.ClickableBox { var txTable widgets.Table var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} @@ -595,9 +619,10 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorL history.selectedFilterId = allTxFilters[selectedFilterName] history.selectedFilterCount, _ = strconv.Atoi(strings.Split(filter, " ")[1]) - fetchAndDisplayTransactions(wallet, &txTable, nextButton, prevButton) + fetchAndDisplayTransactions(wallet, &txTable, window) history.txTable.Result.Children = txTable.Result.Children widget.Refresh(history.txTable.Result) + selectedAccountLabel.SetText(filter) accountSelectionPopup.Hide() })) @@ -630,7 +655,7 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorL return accountDropdown } -func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, nextButton, prevButton *widget.Button) { +func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window) { tableHeading := widget.NewHBox( widget.NewLabelWithStyle("#", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -653,26 +678,14 @@ func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widget // return } - history.txl = len(txns) - history.txns = append(history.txns, txns...) - pageTxOffset := (history.currentPage - 1) * txPerPage - maxTxIndexForCurrentPage := pageTxOffset + txPerPage - var hBox []*widget.Box - for currentTxIndex, tx := range history.txns { - if currentTxIndex < int(pageTxOffset) { - continue // skip txs not belonging to this page - } - if currentTxIndex >= int(maxTxIndexForCurrentPage) { - break // max number of tx displayed for this page - } - + for currentTxIndex, tx := range txns { status := "Pending" confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { status = "Confirmed" } - + trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] hBox = append(hBox, widget.NewHBox( widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), @@ -681,58 +694,150 @@ func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widget widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(),fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), - widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(tx.Hash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { - history.txTable.Container.Hide() - history.txDetailsTable.Container.Show() - fetchTxDetail(&history.txDetailsTable, wallet, tx.Hash) + widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { + fetchTxDetails(tx.Hash, wallet, window) }), )) } txTable.NewTable(tableHeading, hBox...) - txTable.Refresh() - if history.currentPage > 1 { - prevButton.Enable() - }else{ - prevButton.Disable() + return +} + +func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window) { + var confirmations int32 = 0 + // if txDetails.BlockHeight != -1 { + // confirmations = wallet.GetBestBlock() - txDetails.BlockHeight + 1 + // } + newHash, _ := chainhash.NewHashFromStr(hash) + txDetails, err := wallet.GetTransactionRaw(newHash[:]) + if err != nil { + } - if history.selectedFilterCount > int(maxTxIndexForCurrentPage) { - nextButton.Enable() - }else{ - nextButton.Disable() + var spendUnconfirmed = wallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey) + + var status string + // var statusColor color.RGBA + if spendUnconfirmed || confirmations > dcrlibwallet.DefaultRequiredConfirmations { + status = "Confirmed" + // statusColor = styles.DecredGreenColor + } else { + status = "Pending" + // statusColor = styles.DecredOrangeColor } - return -} + tableConfirmations := widget.NewHBox( + widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableHash := widget.NewHBox( + widget.NewLabelWithStyle("Hash:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(txDetails.Hash, fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableBlockHeight := widget.NewHBox( + widget.NewLabelWithStyle("Block Height:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(strconv.Itoa(int(txDetails.BlockHeight)), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableDirection := widget.NewHBox( + widget.NewLabelWithStyle("Direction:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(txDetails.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableType := widget.NewHBox( + widget.NewLabelWithStyle("Type:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(txDetails.Type, fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableAmount := widget.NewHBox( + widget.NewLabelWithStyle("Amount:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Amount).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableSize := widget.NewHBox( + widget.NewLabelWithStyle("Size:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(strconv.Itoa(txDetails.Size)+" Bytes", fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableFee := widget.NewHBox( + widget.NewLabelWithStyle("Fee:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableFeeRate := widget.NewHBox( + widget.NewLabelWithStyle("Fee Rate:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.FeeRate).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableStatus := widget.NewHBox( + widget.NewLabelWithStyle("Status:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(status, fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableDate := widget.NewHBox( + widget.NewLabelWithStyle("Date:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(txDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), + ) -func loadPreviousPage(wallet *dcrlibwallet.LibWallet, nextButton, prevButton *widget.Button) { - var txTable widgets.Table + tableData := widget.NewVBox( + tableConfirmations, + tableHash, + tableBlockHeight, + tableDirection, + tableType, + tableAmount, + tableSize, + tableFee, + tableFeeRate, + tableStatus, + tableDate, + ) - history.currentPage-- - history.txns = history.txns[:len(history.txns)-(int(txPerPage) + history.txl)] - - fetchAndDisplayTransactions(wallet, &txTable, nextButton, prevButton) - history.txTable.Result.Children = txTable.Result.Children - widget.Refresh(history.txTable.Result) - return -} -func loadNextPage(wallet *dcrlibwallet.LibWallet, nextButton, prevButton *widget.Button) { - var txTable widgets.Table + var txInput widgets.Table + heading := widget.NewHBox( + widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) - nextPage := history.currentPage + 1 - history.currentPage = nextPage - nextPageTxOffset := (nextPage - 1) * txPerPage - - if int(nextPageTxOffset) >= len(history.txns) { - // we've not loaded txs for this page - fetchAndDisplayTransactions(wallet, &txTable, nextButton, prevButton) - history.txTable.Result.Children = txTable.Result.Children - widget.Refresh(history.txTable.Result) + var inputBox []*widget.Box + for i := range txDetails.Inputs { + inputBox = append(inputBox, widget.NewHBox( + widget.NewLabelWithStyle(txDetails.Inputs[i].PreviousOutpoint, fyne.TextAlignLeading, fyne.TextStyle{}), + widget.NewLabelWithStyle(txDetails.Inputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + )) } + txInput.NewTable(heading, inputBox...) - return + var txOutput widgets.Table + heading = widget.NewHBox( + widget.NewLabelWithStyle("Address", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Value", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) + + var outputBox []*widget.Box + for i := range txDetails.Outputs { + outputBox = append(outputBox, widget.NewHBox( + widget.NewLabelWithStyle(txDetails.Outputs[i].Address, fyne.TextAlignLeading, fyne.TextStyle{}), + widget.NewLabelWithStyle(txDetails.Outputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + widget.NewLabelWithStyle(txDetails.Outputs[i].ScriptType, fyne.TextAlignCenter, fyne.TextStyle{}))) + } + txOutput.NewTable(heading, outputBox...) + + label := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) + + output := widget.NewHBox(widgets.NewHSpacer(10), widget.NewVBox( + label, + widgets.NewVSpacer(10), + tableData, + widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), + txInput.Result, + widgets.NewVSpacer(10), + widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), + txOutput.Result, + ), widgets.NewHSpacer(10)) + + scrollContainer := widget.NewScrollContainer(output) + scrollContainer.Resize(fyne.NewSize(scrollContainer.MinSize().Width, 500)) + popUp := widget.NewPopUp(widget.NewVBox(fyne.NewContainer(scrollContainer)), + window.Canvas()) + popUp.Show() } diff --git a/fyne/pages/transactionDetails.go b/fyne/pages/transactionDetails.go new file mode 100644 index 000000000..aeec2a8a2 --- /dev/null +++ b/fyne/pages/transactionDetails.go @@ -0,0 +1,140 @@ +package pages + +// import ( +// // "fmt" +// // "strings" +// // "strconv" + +// "fyne.io/fyne" +// // "fyne.io/fyne/widget" +// // "fyne.io/fyne/layout" + +// // "github.com/raedahgroup/godcr/fyne/widgets" +// ) + +func displayTransactionDetails() { + // var confirmations int32 = 0 + // if handler.selectedTxDetails.BlockHeight != -1 { + // confirmations = handler.wallet.GetBestBlock() - handler.selectedTxDetails.BlockHeight + 1 + // } + + // var spendUnconfirmed = handler.wallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey) + + // var status string + // // var statusColor color.RGBA + // if spendUnconfirmed || confirmations > dcrlibwallet.DefaultRequiredConfirmations { + // status = "Confirmed" + // // statusColor = styles.DecredGreenColor + // } else { + // status = "Pending" + // // statusColor = styles.DecredOrangeColor + // } + + // tableConfirmations := widget.NewHBox( + // widget.NewLabelWithStyle("Confirmations", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableHash := widget.NewHBox( + // widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(handler.selectedTxDetails.Hash, fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableBlockHeight := widget.NewHBox( + // widget.NewLabelWithStyle("Block Height", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(strconv.Itoa(int(handler.selectedTxDetails.BlockHeight)), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableDirection := widget.NewHBox( + // widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(handler.selectedTxDetails.Direction), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableType := widget.NewHBox( + // widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(handler.selectedTxDetails.Type, fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableAmount := widget.NewHBox( + // widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(dcrutil.Amount(handler.selectedTxDetails.Amount).String(), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableSize := widget.NewHBox( + // widget.NewLabelWithStyle("Size", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(strconv.Itoa(handler.selectedTxDetails.Size)+" Bytes", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableFee := widget.NewHBox( + // widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(dcrutil.Amount(handler.selectedTxDetails.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableFeeRate := widget.NewHBox( + // widget.NewLabelWithStyle("Fee Rate", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(dcrutil.Amount(handler.selectedTxDetails.FeeRate).String(), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableStatus := widget.NewHBox( + // widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(status, fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + // tableDate := widget.NewHBox( + // widget.NewLabelWithStyle("Date", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // // widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(handler.selectedTxDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // ) + + // tableData := widget.NewVBox( + // tableConfirmations, + // tableHash, + // tableBlockHeight, + // tableDirection, + // tableType, + // tableAmount, + // tableSize, + // tableFee, + // tableFeeRate, + // tableStatus, + // tableDate, + // ) + + // var txInput widgets.TableStruct + // heading := widget.NewHBox( + // widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) + + // var inputBox []*widget.Box + // for i := range txDetails.Inputs { + // inputBox = append(inputBox, widget.NewHBox( + // widget.NewLabelWithStyle(txDetails.Inputs[i].PreviousOutpoint, fyne.TextAlignLeading, fyne.TextStyle{}), + // widget.NewLabelWithStyle(txDetails.Inputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), + // widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + // )) + // } + // txInput.NewTable(heading, inputBox...) + + // var txOutput widgets.TableStruct + // heading = widget.NewHBox( + // widget.NewLabelWithStyle("Address", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle("Value", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) + + // var outputBox []*widget.Box + // for i := range txDetails.Outputs { + // outputBox = append(outputBox, widget.NewHBox( + // widget.NewLabelWithStyle(txDetails.Outputs[i].Address, fyne.TextAlignLeading, fyne.TextStyle{}), + // widget.NewLabelWithStyle(txDetails.Outputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), + // widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + // widget.NewLabelWithStyle(txDetails.Outputs[i].ScriptType, fyne.TextAlignCenter, fyne.TextStyle{}))) + // } + // txOutput.NewTable(heading, outputBox...) + + // output := widget.NewHBox(widgets.NewHSpacer(10), widget.NewVBox( + // form, + // widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), + // txInput.Result, + // widgets.NewVSpacer(10), + // widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), + // txOutput.Result, + // ), widgets.NewHSpacer(10)) + + // scrollContainer := widget.NewScrollContainer(output) + // scrollContainer.Resize(fyne.NewSize(scrollContainer.MinSize().Width, 500)) + // popUp := widget.NewPopUp(widget.NewVBox(label, fyne.NewContainer(scrollContainer)), + // window.Canvas()) + // popUp.Show() + return +} \ No newline at end of file diff --git a/fyne/widgets/table.go b/fyne/widgets/table.go index 398b1311d..a3afc7860 100644 --- a/fyne/widgets/table.go +++ b/fyne/widgets/table.go @@ -149,8 +149,6 @@ func (table *Table) Delete(from, to int) { func (table *Table) set() { var container = widget.NewHBox() - fmt.Println(container) - fmt.Println(table.heading.Children) // Get horizontals apart from heading. for i := 0; i < len(table.heading.Children); i++ { @@ -160,7 +158,6 @@ func (table *Table) set() { if len(table.heading.Children) > len(data.Children) && i > len(data.Children)-1 { continue } - getVerticals.Append(data.Children[i]) } container.Append(getVerticals) From 433720d386b69da4321d1b9b11c845df4239e314 Mon Sep 17 00:00:00 2001 From: morrison Date: Tue, 19 Nov 2019 23:23:01 +0100 Subject: [PATCH 29/73] removed txdetails.go --- fyne/pages/transactionDetails.go | 140 ------------------------------- 1 file changed, 140 deletions(-) delete mode 100644 fyne/pages/transactionDetails.go diff --git a/fyne/pages/transactionDetails.go b/fyne/pages/transactionDetails.go deleted file mode 100644 index aeec2a8a2..000000000 --- a/fyne/pages/transactionDetails.go +++ /dev/null @@ -1,140 +0,0 @@ -package pages - -// import ( -// // "fmt" -// // "strings" -// // "strconv" - -// "fyne.io/fyne" -// // "fyne.io/fyne/widget" -// // "fyne.io/fyne/layout" - -// // "github.com/raedahgroup/godcr/fyne/widgets" -// ) - -func displayTransactionDetails() { - // var confirmations int32 = 0 - // if handler.selectedTxDetails.BlockHeight != -1 { - // confirmations = handler.wallet.GetBestBlock() - handler.selectedTxDetails.BlockHeight + 1 - // } - - // var spendUnconfirmed = handler.wallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey) - - // var status string - // // var statusColor color.RGBA - // if spendUnconfirmed || confirmations > dcrlibwallet.DefaultRequiredConfirmations { - // status = "Confirmed" - // // statusColor = styles.DecredGreenColor - // } else { - // status = "Pending" - // // statusColor = styles.DecredOrangeColor - // } - - // tableConfirmations := widget.NewHBox( - // widget.NewLabelWithStyle("Confirmations", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableHash := widget.NewHBox( - // widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(handler.selectedTxDetails.Hash, fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableBlockHeight := widget.NewHBox( - // widget.NewLabelWithStyle("Block Height", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(strconv.Itoa(int(handler.selectedTxDetails.BlockHeight)), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableDirection := widget.NewHBox( - // widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(handler.selectedTxDetails.Direction), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableType := widget.NewHBox( - // widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(handler.selectedTxDetails.Type, fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableAmount := widget.NewHBox( - // widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(dcrutil.Amount(handler.selectedTxDetails.Amount).String(), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableSize := widget.NewHBox( - // widget.NewLabelWithStyle("Size", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(strconv.Itoa(handler.selectedTxDetails.Size)+" Bytes", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableFee := widget.NewHBox( - // widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(dcrutil.Amount(handler.selectedTxDetails.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableFeeRate := widget.NewHBox( - // widget.NewLabelWithStyle("Fee Rate", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(dcrutil.Amount(handler.selectedTxDetails.FeeRate).String(), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableStatus := widget.NewHBox( - // widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(status, fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - // tableDate := widget.NewHBox( - // widget.NewLabelWithStyle("Date", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // // widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(handler.selectedTxDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // ) - - // tableData := widget.NewVBox( - // tableConfirmations, - // tableHash, - // tableBlockHeight, - // tableDirection, - // tableType, - // tableAmount, - // tableSize, - // tableFee, - // tableFeeRate, - // tableStatus, - // tableDate, - // ) - - // var txInput widgets.TableStruct - // heading := widget.NewHBox( - // widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) - - // var inputBox []*widget.Box - // for i := range txDetails.Inputs { - // inputBox = append(inputBox, widget.NewHBox( - // widget.NewLabelWithStyle(txDetails.Inputs[i].PreviousOutpoint, fyne.TextAlignLeading, fyne.TextStyle{}), - // widget.NewLabelWithStyle(txDetails.Inputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), - // widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), - // )) - // } - // txInput.NewTable(heading, inputBox...) - - // var txOutput widgets.TableStruct - // heading = widget.NewHBox( - // widget.NewLabelWithStyle("Address", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle("Value", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) - - // var outputBox []*widget.Box - // for i := range txDetails.Outputs { - // outputBox = append(outputBox, widget.NewHBox( - // widget.NewLabelWithStyle(txDetails.Outputs[i].Address, fyne.TextAlignLeading, fyne.TextStyle{}), - // widget.NewLabelWithStyle(txDetails.Outputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), - // widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), - // widget.NewLabelWithStyle(txDetails.Outputs[i].ScriptType, fyne.TextAlignCenter, fyne.TextStyle{}))) - // } - // txOutput.NewTable(heading, outputBox...) - - // output := widget.NewHBox(widgets.NewHSpacer(10), widget.NewVBox( - // form, - // widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), - // txInput.Result, - // widgets.NewVSpacer(10), - // widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), - // txOutput.Result, - // ), widgets.NewHSpacer(10)) - - // scrollContainer := widget.NewScrollContainer(output) - // scrollContainer.Resize(fyne.NewSize(scrollContainer.MinSize().Width, 500)) - // popUp := widget.NewPopUp(widget.NewVBox(label, fyne.NewContainer(scrollContainer)), - // window.Canvas()) - // popUp.Show() - return -} \ No newline at end of file From c3f4dad6a393e40356b793dbdffd42bc0e015e96 Mon Sep 17 00:00:00 2001 From: morrison Date: Sun, 24 Nov 2019 00:37:27 +0100 Subject: [PATCH 30/73] added errorhandling, split function into table header and table content function, cleaned up code --- fyne/pages/history.go | 162 ++++++++++++++++++++---------------------- 1 file changed, 79 insertions(+), 83 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 0e9b676a8..39b76ced8 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -20,7 +20,6 @@ import ( "github.com/raedahgroup/godcr/fyne/widgets" ) -<<<<<<< HEAD const txPerPage int32 = 25 type txHistoryPageData struct { @@ -29,22 +28,6 @@ type txHistoryPageData struct { selectedFilterId int32 errorLabel *widget.Label TotalTxFetched int32 -======= -const txPerPage int32 = 10 - -type historyPageData struct { - txTable widgets.Table - txDetailsTable widgets.Table - currentFilter int32 - currentPage int32 - selectedFilterCount int - txCountErr error - txCountForFilter int - txns []*dcrlibwallet.Transaction - selectedFilterId int32 - errorLabel *widget.Label - txl int ->>>>>>> added transaction details page, improved table.go, removed pagination basedd on review, minor code clean up } var txHistory txHistoryPageData @@ -57,28 +40,11 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm history.selectedFilterId = dcrlibwallet.TxFilterAll pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) -<<<<<<< HEAD txHistoryPageOutput := widget.NewVBox( widgets.NewVSpacer(5), widget.NewHBox(pageTitleLabel), widgets.NewVSpacer(5), -======= - - filterDropdown := txFilterDropDown(wallet, window, errorLabel) - - fetchAndDisplayTransactions(wallet, &history.txTable, window) - - output := widget.NewVBox( - widgets.NewVSpacer(5), - widget.NewHBox(pageTitleLabel), - widgets.NewVSpacer(5), - filterDropdown, - widgets.NewVSpacer(5), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(history.txTable.Container.MinSize().Width, history.txTable.Container.MinSize().Height+200)), history.txTable.Container), - widgets.NewVSpacer(15), - errorLabel, ->>>>>>> added transaction details page, improved table.go, removed pagination basedd on review, minor code clean up ) txFilterDropDown, errorMessage := txFilterDropDown(wallet, window, tabmenu) @@ -577,7 +543,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win txDetailsPopUp.Show() } -func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label) *widgets.ClickableBox { +func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window) *widgets.ClickableBox { var txTable widgets.Table var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} @@ -590,24 +556,30 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorL "Staking": dcrlibwallet.TxFilterStaking, } - history.txCountForFilter, _ = wallet.CountTransactions(allTxFilters["All"]) - selectedAccountLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", history.txCountForFilter)) - history.selectedFilterCount = history.txCountForFilter + txCountForFilter, err := wallet.CountTransactions(allTxFilters["All"]) + if err != nil { + errorMessage := fmt.Sprintf("Cannot load history page. Error getting transaction count for filter All: %s", err.Error()) + errorHandler(errorMessage, history.errorLabel) + return nil + } + + selectedAccountLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) + history.selectedFilterCount = txCountForFilter var accountSelectionPopup *widget.PopUp accountListWidget := widget.NewVBox() for _, filterName := range allTxFilterNames { filterId := allTxFilters[filterName] - history.txCountForFilter, history.txCountErr = wallet.CountTransactions(filterId) - if history.txCountErr != nil { + txCountForFilter, err := wallet.CountTransactions(filterId) + if err != nil { errorMessage := fmt.Sprintf("Cannot load history page. Error getting transaction count for filter %s: %s", - filterName, history.txCountErr.Error()) - errorHandler(errorMessage, errorLabel) + filterName, err.Error()) + errorHandler(errorMessage, history.errorLabel) return nil } - if history.txCountForFilter > 0 { - filter := fmt.Sprintf("%s (%d)", filterName, history.txCountForFilter) + if txCountForFilter > 0 { + filter := fmt.Sprintf("%s (%d)", filterName, txCountForFilter) accountsView := widget.NewHBox( widgets.NewHSpacer(5), widget.NewLabel(filter), @@ -616,14 +588,17 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorL accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { selectedFilterName := strings.Split(filter, " ")[0] - history.selectedFilterId = allTxFilters[selectedFilterName] + selectedFilterId := allTxFilters[selectedFilterName] history.selectedFilterCount, _ = strconv.Atoi(strings.Split(filter, " ")[1]) - fetchAndDisplayTransactions(wallet, &txTable, window) - history.txTable.Result.Children = txTable.Result.Children - widget.Refresh(history.txTable.Result) + if selectedFilterId != history.selectedFilterId{ + txTableHeader(wallet, &txTable, window) + history.txTable.Result.Children = txTable.Result.Children + addToHistoryTable(&txTable, 0, selectedFilterId, wallet, window, false) + widget.Refresh(history.txTable.Result) - selectedAccountLabel.SetText(filter) + selectedAccountLabel.SetText(filter) + } accountSelectionPopup.Hide() })) } @@ -655,7 +630,7 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, errorL return accountDropdown } -func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window) { +func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window) { tableHeading := widget.NewHBox( widget.NewLabelWithStyle("#", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -667,45 +642,14 @@ func fetchAndDisplayTransactions(wallet *dcrlibwallet.LibWallet, txTable *widget widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), ) - txOffset := 0 - if history.txns != nil { - txOffset = len(history.txns) - } - - txns, err := wallet.GetTransactionsRaw(int32(txOffset), txPerPage, history.selectedFilterId) - if err != nil { - // displayMessage(err.Error(), MessageKindError) - // return - } - var hBox []*widget.Box - for currentTxIndex, tx := range txns { - status := "Pending" - confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 - if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { - status = "Confirmed" - } - trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] - hBox = append(hBox, widget.NewHBox( - widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(),fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), - widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { - fetchTxDetails(tx.Hash, wallet, window) - }), - )) - } txTable.NewTable(tableHeading, hBox...) return } -func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window) { +func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label) { var confirmations int32 = 0 // if txDetails.BlockHeight != -1 { // confirmations = wallet.GetBestBlock() - txDetails.BlockHeight + 1 @@ -713,7 +657,8 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win newHash, _ := chainhash.NewHashFromStr(hash) txDetails, err := wallet.GetTransactionRaw(newHash[:]) if err != nil { - + errorHandler(fmt.Sprintf("Error fetching transaction details for %s: %s", hash, err.Error()), history.errorLabel) + return } var spendUnconfirmed = wallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey) @@ -841,3 +786,54 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win popUp.Show() } +func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool) { + if filter != history.selectedFilterId { + // filter changed, reset data + txOffset = 0 + history.txns = nil + history.selectedFilterId = filter + } + + txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) + if err != nil { + errorHandler(fmt.Sprintf("Error getting transaction for Filter %s: %s", filter, err.Error()), history.errorLabel) + return + } + if len(txns) < 10 { + errorHandler("No transaction history yet.", history.errorLabel) + txTable.Container.Hide() + return + } + + history.txns = append(history.txns, txns...) + + var hBox []*widget.Box + for currentTxIndex, tx := range txns { + status := "Pending" + confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 + if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { + status = "Confirmed" + } + + trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] + hBox = append(hBox, widget.NewHBox( + widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(),fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), + widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { + fetchTxDetails(tx.Hash, wallet, window, history.errorLabel) + }), + )) + } + + if prepend { + history.txTable.Prepend(hBox...) + } else { + history.txTable.Append(hBox...) + } + history.errorLabel.Hide() +} From 55fece0da9cb885dd420e5b6d5d18fa35a727fee Mon Sep 17 00:00:00 2001 From: morrison Date: Mon, 25 Nov 2019 21:01:00 +0100 Subject: [PATCH 31/73] added copy txhash copy functionality for txdetails page, aligned txdetails popup, cleaned up code --- fyne/go.mod | 1 + fyne/pages/history.go | 98 +++++++++++++++++++-------- go.mod~added transaction filter popup | 15 ---- 3 files changed, 72 insertions(+), 42 deletions(-) delete mode 100644 go.mod~added transaction filter popup diff --git a/fyne/go.mod b/fyne/go.mod index c5965b641..833422106 100644 --- a/fyne/go.mod +++ b/fyne/go.mod @@ -4,6 +4,7 @@ go 1.13 require ( fyne.io/fyne v1.2.0 + fyne.io/fyne v1.1.3-0.20191104221827-e8f6795efa08 github.com/decred/dcrd/dcrutil v1.4.0 github.com/decred/dcrd/chaincfg/chainhash v1.0.1 github.com/decred/slog v1.0.0 diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 39b76ced8..6af073dc7 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -543,7 +543,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win txDetailsPopUp.Show() } -func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window) *widgets.ClickableBox { +func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) *widgets.ClickableBox { var txTable widgets.Table var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} @@ -591,10 +591,10 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window) *widge selectedFilterId := allTxFilters[selectedFilterName] history.selectedFilterCount, _ = strconv.Atoi(strings.Split(filter, " ")[1]) - if selectedFilterId != history.selectedFilterId{ + if selectedFilterId != history.selectedFilterId { txTableHeader(wallet, &txTable, window) history.txTable.Result.Children = txTable.Result.Children - addToHistoryTable(&txTable, 0, selectedFilterId, wallet, window, false) + addToHistoryTable(&txTable, 0, selectedFilterId, wallet, window, false, tabmenu) widget.Refresh(history.txTable.Result) selectedAccountLabel.SetText(filter) @@ -635,7 +635,7 @@ func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, windo widget.NewLabelWithStyle("#", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -649,7 +649,7 @@ func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, windo return } -func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label) { +func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, tabmenu *widget.TabContainer) { var confirmations int32 = 0 // if txDetails.BlockHeight != -1 { // confirmations = wallet.GetBestBlock() - txDetails.BlockHeight + 1 @@ -662,7 +662,6 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win } var spendUnconfirmed = wallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey) - var status string // var statusColor color.RGBA if spendUnconfirmed || confirmations > dcrlibwallet.DefaultRequiredConfirmations { @@ -673,14 +672,49 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win // statusColor = styles.DecredOrangeColor } + copiedLabel := widget.NewLabelWithStyle("Text copied to clipboard", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) + copiedLabel.Hide() + tableConfirmations := widget.NewHBox( widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), ) + + copyAbleText := func(textToCopy string, copyAble bool) *widgets.ClickableBox { + var t *canvas.Text + if copyAble { + t = canvas.NewText(textToCopy, color.RGBA{0, 255, 255, 1}) + } else { + t = canvas.NewText(textToCopy, color.RGBA{255, 255, 255, 1}) + } + t.TextSize = 14 + t.Alignment = fyne.TextAlignTrailing + + return widgets.NewClickableBox(widget.NewHBox(t), + func() { + clipboard := window.Clipboard() + clipboard.SetContent(textToCopy) + copiedLabel.Show() + + // only hide accountCopiedLabel text if user is currently on the page after 2secs + if copiedLabel.Hidden == false { + time.AfterFunc(time.Second*2, func() { + if tabmenu.CurrentTabIndex() == 1 { + copiedLabel.Hide() + } + }) + } + }, + ) + } + tableHash := widget.NewHBox( - widget.NewLabelWithStyle("Hash:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(txDetails.Hash, fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle("Transaction ID:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + // copyAddressAction enables address copying + copyAbleText(txDetails.Hash, true), + // canvas.NewText(txDetails.Hash, color.RGBA{0, 255, 255, 1}), ) + tableBlockHeight := widget.NewHBox( widget.NewLabelWithStyle("Block Height:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle(strconv.Itoa(int(txDetails.BlockHeight)), fyne.TextAlignCenter, fyne.TextStyle{}), @@ -732,7 +766,6 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win tableDate, ) - var txInput widgets.Table heading := widget.NewHBox( widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -742,9 +775,9 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win var inputBox []*widget.Box for i := range txDetails.Inputs { inputBox = append(inputBox, widget.NewHBox( - widget.NewLabelWithStyle(txDetails.Inputs[i].PreviousOutpoint, fyne.TextAlignLeading, fyne.TextStyle{}), - widget.NewLabelWithStyle(txDetails.Inputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + copyAbleText(txDetails.Inputs[i].PreviousOutpoint, true), + copyAbleText(txDetails.Inputs[i].AccountName, false), + copyAbleText(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), false), )) } txInput.NewTable(heading, inputBox...) @@ -759,34 +792,45 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win var outputBox []*widget.Box for i := range txDetails.Outputs { outputBox = append(outputBox, widget.NewHBox( - widget.NewLabelWithStyle(txDetails.Outputs[i].Address, fyne.TextAlignLeading, fyne.TextStyle{}), - widget.NewLabelWithStyle(txDetails.Outputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), - widget.NewLabelWithStyle(txDetails.Outputs[i].ScriptType, fyne.TextAlignCenter, fyne.TextStyle{}))) + copyAbleText(txDetails.Outputs[i].AccountName, false), + copyAbleText(txDetails.Outputs[i].Address, true), + copyAbleText(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), false), + copyAbleText(txDetails.Outputs[i].ScriptType, false), + )) } txOutput.NewTable(heading, outputBox...) label := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - - output := widget.NewHBox(widgets.NewHSpacer(10), widget.NewVBox( - label, - widgets.NewVSpacer(10), + v := widget.NewVBox( + widgets.NewHSpacer(5), tableData, widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txInput.Result, widgets.NewVSpacer(10), widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txOutput.Result, - ), widgets.NewHSpacer(10)) + widgets.NewHSpacer(5), + ) + + scrollContainer := widget.NewScrollContainer(v) - scrollContainer := widget.NewScrollContainer(output) - scrollContainer.Resize(fyne.NewSize(scrollContainer.MinSize().Width, 500)) - popUp := widget.NewPopUp(widget.NewVBox(fyne.NewContainer(scrollContainer)), + output := widget.NewVBox( + widgets.NewHSpacer(10), + label, + copiedLabel, + widgets.NewVSpacer(40), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(scrollContainer.MinSize().Width+10, scrollContainer.MinSize().Height+400)), scrollContainer), + widgets.NewHSpacer(10), + ) + + // scrollContainer.Resize(fyne.NewSize(scrollContainer.MinSize().Width, 500)) + popUp := widget.NewPopUp(widget.NewVBox(fyne.NewContainer(output)), window.Canvas()) + popUp.Move(fyne.NewPos(105, 40)) popUp.Show() } -func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool) { +func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { if filter != history.selectedFilterId { // filter changed, reset data txOffset = 0 @@ -822,10 +866,10 @@ func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *d widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(),fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { - fetchTxDetails(tx.Hash, wallet, window, history.errorLabel) + fetchTxDetails(tx.Hash, wallet, window, history.errorLabel, tabmenu) }), )) } diff --git a/go.mod~added transaction filter popup b/go.mod~added transaction filter popup deleted file mode 100644 index 86d1355d3..000000000 --- a/go.mod~added transaction filter popup +++ /dev/null @@ -1,15 +0,0 @@ -module github.com/raedahgroup/godcr - -go 1.12 - -replace ( - github.com/raedahgroup/godcr/cmd/godcr-fyne => ./cmd/godcr-fyne - github.com/raedahgroup/godcr/cmd/godcr-terminal => ./cmd/godcr-terminal - github.com/raedahgroup/godcr/fyne => ./fyne - github.com/raedahgroup/godcr/terminal => ./terminal -) - -require ( - github.com/raedahgroup/godcr/cmd/godcr-fyne v0.0.0-00010101000000-000000000000 // indirect - github.com/raedahgroup/godcr/cmd/godcr-terminal v0.0.0-00010101000000-000000000000 // indirect -) From 9f7f4f2e3f0d4c53ac5b6b87d8c8f6376974bc45 Mon Sep 17 00:00:00 2001 From: morrison Date: Thu, 28 Nov 2019 07:27:01 +0100 Subject: [PATCH 32/73] added modal popup collapse icon, made txdetail pop a modal popup, added copy info etc --- fyne/pages/history.go | 160 +++++++++++++++++++++++------------------- 1 file changed, 89 insertions(+), 71 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 6af073dc7..a45dc448a 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -12,6 +12,7 @@ import ( "fyne.io/fyne/layout" "fyne.io/fyne/theme" "fyne.io/fyne/widget" + "fyne.io/fyne/theme" "github.com/decred/dcrd/chaincfg/chainhash" "github.com/decred/dcrd/dcrutil" @@ -43,7 +44,7 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm txHistoryPageOutput := widget.NewVBox( widgets.NewVSpacer(5), - widget.NewHBox(pageTitleLabel), + widget.NewHBox(pageTitleLabel, widgets.NewHSpacer(100), clickableInfoIcon), widgets.NewVSpacer(5), ) @@ -613,7 +614,12 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmen accountSelectionPopup.Hide() // accountTab shows the selected account - icons, _ := assets.GetIcons(assets.CollapseIcon) + icons, err := assets.GetIcons(assets.CollapseIcon) + if err != nil { + errorMessage := fmt.Sprintf("Error: %s",err.Error()) + errorHandler(errorMessage, history.errorLabel) + return nil + } accountTab := widget.NewHBox( selectedAccountLabel, widgets.NewHSpacer(50), @@ -649,11 +655,80 @@ func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, windo return } +func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { + if filter != history.selectedFilterId { + // filter changed, reset data + txOffset = 0 + history.txns = nil + history.selectedFilterId = filter + } + + txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) + if err != nil { + errorHandler(fmt.Sprintf("Error getting transaction for Filter %s: %s", filter, err.Error()), history.errorLabel) + return + } + if len(txns) == 0 { + errorHandler("No transaction history yet.", history.errorLabel) + txTable.Container.Hide() + return + } + + history.txns = append(history.txns, txns...) + + var hBox []*widget.Box + for currentTxIndex, tx := range txns { + status := "Pending" + confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 + if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { + status = "Confirmed" + } + fmt.Println(tx.Hash) + + // trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] + hBox = append(hBox, widget.NewHBox( + widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), + // widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(tx.Hash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { + // fmt.Println(tx.Hash) + // fetchTxDetails(tx.Hash, wallet, window, history.errorLabel, tabmenu) + // }), + widget.NewButton(tx.Hash, func(){ + fmt.Println(tx.Hash) + fetchTxDetails(tx.Hash, wallet, window, history.errorLabel, tabmenu) + }), + )) + } + + if prepend { + history.txTable.Prepend(hBox...) + } else { + history.txTable.Append(hBox...) + } + history.errorLabel.Hide() +} + + func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, tabmenu *widget.TabContainer) { var confirmations int32 = 0 // if txDetails.BlockHeight != -1 { // confirmations = wallet.GetBestBlock() - txDetails.BlockHeight + 1 // } + + messageLabel := widget.NewLabelWithStyle("Fetching data..", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) + if messageLabel.Hidden == false { + time.AfterFunc(time.Millisecond*120, func() { + if tabmenu.CurrentTabIndex() == 1 { + messageLabel.Hide() + } + }) + } + newHash, _ := chainhash.NewHashFromStr(hash) txDetails, err := wallet.GetTransactionRaw(newHash[:]) if err != nil { @@ -671,10 +746,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win status = "Pending" // statusColor = styles.DecredOrangeColor } - - copiedLabel := widget.NewLabelWithStyle("Text copied to clipboard", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) - copiedLabel.Hide() - + tableConfirmations := widget.NewHBox( widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), @@ -689,18 +761,18 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win } t.TextSize = 14 t.Alignment = fyne.TextAlignTrailing - return widgets.NewClickableBox(widget.NewHBox(t), func() { + messageLabel.SetText("Data Copied") clipboard := window.Clipboard() clipboard.SetContent(textToCopy) - copiedLabel.Show() + messageLabel.Show() // only hide accountCopiedLabel text if user is currently on the page after 2secs - if copiedLabel.Hidden == false { + if messageLabel.Hidden == false { time.AfterFunc(time.Second*2, func() { if tabmenu.CurrentTabIndex() == 1 { - copiedLabel.Hide() + messageLabel.Hide() } }) } @@ -710,9 +782,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win tableHash := widget.NewHBox( widget.NewLabelWithStyle("Transaction ID:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - // copyAddressAction enables address copying copyAbleText(txDetails.Hash, true), - // canvas.NewText(txDetails.Hash, color.RGBA{0, 255, 255, 1}), ) tableBlockHeight := widget.NewHBox( @@ -802,82 +872,30 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win label := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) v := widget.NewVBox( - widgets.NewHSpacer(5), + widgets.NewHSpacer(10), tableData, widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txInput.Result, widgets.NewVSpacer(10), widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txOutput.Result, - widgets.NewHSpacer(5), + widgets.NewHSpacer(10), ) + var popUp *widget.PopUp scrollContainer := widget.NewScrollContainer(v) + minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { popUp.Hide() }) output := widget.NewVBox( widgets.NewHSpacer(10), - label, - copiedLabel, - widgets.NewVSpacer(40), + widget.NewHBox(label, widgets.NewHSpacer(150), messageLabel, layout.NewSpacer(), minimizeIcon, widgets.NewHSpacer(30)), + widgets.NewHSpacer(10), fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(scrollContainer.MinSize().Width+10, scrollContainer.MinSize().Height+400)), scrollContainer), widgets.NewHSpacer(10), ) - // scrollContainer.Resize(fyne.NewSize(scrollContainer.MinSize().Width, 500)) - popUp := widget.NewPopUp(widget.NewVBox(fyne.NewContainer(output)), + popUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(output)), window.Canvas()) - popUp.Move(fyne.NewPos(105, 40)) popUp.Show() } -func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { - if filter != history.selectedFilterId { - // filter changed, reset data - txOffset = 0 - history.txns = nil - history.selectedFilterId = filter - } - - txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) - if err != nil { - errorHandler(fmt.Sprintf("Error getting transaction for Filter %s: %s", filter, err.Error()), history.errorLabel) - return - } - if len(txns) < 10 { - errorHandler("No transaction history yet.", history.errorLabel) - txTable.Container.Hide() - return - } - - history.txns = append(history.txns, txns...) - - var hBox []*widget.Box - for currentTxIndex, tx := range txns { - status := "Pending" - confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 - if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { - status = "Confirmed" - } - - trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] - hBox = append(hBox, widget.NewHBox( - widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), - widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { - fetchTxDetails(tx.Hash, wallet, window, history.errorLabel, tabmenu) - }), - )) - } - - if prepend { - history.txTable.Prepend(hBox...) - } else { - history.txTable.Append(hBox...) - } - history.errorLabel.Hide() -} From 321d755d1512a2036f5c1b006acc924330d1fb91 Mon Sep 17 00:00:00 2001 From: morrison Date: Fri, 29 Nov 2019 07:04:21 +0100 Subject: [PATCH 33/73] hint tip --- fyne/pages/history.go | 76 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 65 insertions(+), 11 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index a45dc448a..ae0b03ac7 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -223,6 +223,7 @@ func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, windo widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + ) var hBox []*widget.Box @@ -661,6 +662,7 @@ func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *d txOffset = 0 history.txns = nil history.selectedFilterId = filter + history.txTable.Container.Offset.Y = 0 } txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) @@ -683,9 +685,9 @@ func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *d if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { status = "Confirmed" } - fmt.Println(tx.Hash) - // trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] + trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] + txForTrimmedHash := tx.Hash hBox = append(hBox, widget.NewHBox( widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), @@ -694,13 +696,8 @@ func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *d widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), - // widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(tx.Hash, fyne.TextAlignLeading, fyne.TextStyle{Italic: true})), func() { - // fmt.Println(tx.Hash) - // fetchTxDetails(tx.Hash, wallet, window, history.errorLabel, tabmenu) - // }), - widget.NewButton(tx.Hash, func(){ - fmt.Println(tx.Hash) - fetchTxDetails(tx.Hash, wallet, window, history.errorLabel, tabmenu) + widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignCenter, fyne.TextStyle{Italic: true})), func() { + fetchTxDetails(txForTrimmedHash, wallet, window, history.errorLabel, tabmenu) }), )) } @@ -711,8 +708,15 @@ func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *d history.txTable.Append(hBox...) } history.errorLabel.Hide() -} + y := txTable.Container.Scrolled(txTable.Container.Content.Size().Height - txTable.Container.Size().Height) + fmt.Println(y) + + size := txTable.Container.Content.Size().Height - txTable.Container.Size().Height + scrollPosition := float64(history.txTable.Container.Offset.Y) / float64(size) + fmt.Println(size) + fmt.Println(scrollPosition) +} func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, tabmenu *widget.TabContainer) { var confirmations int32 = 0 @@ -722,7 +726,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win messageLabel := widget.NewLabelWithStyle("Fetching data..", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) if messageLabel.Hidden == false { - time.AfterFunc(time.Millisecond*120, func() { + time.AfterFunc(time.Millisecond*200, func() { if tabmenu.CurrentTabIndex() == 1 { messageLabel.Hide() } @@ -899,3 +903,53 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win popUp.Show() } +// func updateTx (){ +// size := history.txTable.Container.Content.Size().Height - history.txTable.Container.Size().Height +// scrollPosition := float64(history.txTable.Container.Offset.Y) / float64(size) + +// splittedWord := strings.Split(history.txFilters.Selected, " ") +// var found int32 +// if int32(txCountByFilter[splittedWord[0]]) > history.currentTxCount { +// found = int32(txCountByFilter[splittedWord[0]]) - history.currentTxCount +// history.txFilters.Selected = splittedWord[0] + " (" + strconv.Itoa(txCountByFilter[splittedWord[0]]) + ")" +// widget.Refresh(history.txFilters) +// } + +// // Append to table when scrollbar is at 90% of the scrollbar. +// if scrollPosition == 0.9 { +// if history.totalTxOnTable == int32(count)-found { +// return +// } +// addToHistoryTable(&history.txTable, history.totalTxOnTable+found, 20, wallet, window, false) +// if txCountByFilter[splittedWord[0]] > int(history.totalTxOnTable+20) { +// history.totalTxOnTable = history.totalTxOnTable + 20 +// } else { +// history.totalTxOnTable = int32(txCountByFilter[splittedWord[0]]) +// } +// // Delete from table if rows exceeds 90. +// if history.txTable.NumberOfColumns() >= 90 { +// history.txTable.Delete(0, 20) +// history.offset = history.offset + 20 +// } + +// } else if history.txTable.Container.Offset.Y == 0 { +// // If the scroll bar is at the begining, then fetch 1st 50 tx +// if int32(txCountByFilter[splittedWord[0]]) > history.currentTxCount { +// history.txFilters.SetSelected(splittedWord[0] + " (" + strconv.Itoa(txCountByFilter[splittedWord[0]]) + ")") +// } +// } else if scrollPosition < 0.2 { +// // Return if there's no currently deleted table. +// if history.offset == 0 { +// return +// } +// addToHistoryTable(&history.txTable, history.offset+found-20, 20+found, wallet, window, true) +// history.offset = history.offset - 20 + +// rowNo := history.txTable.NumberOfColumns() +// if rowNo >= 90 { +// history.txTable.Delete(rowNo-20, rowNo) +// history.totalTxOnTable = int32(rowNo) + history.offset +// } +// } +// } + From df594a1a8de76eead0be334390077d2334b4a58a Mon Sep 17 00:00:00 2001 From: morrison Date: Sun, 1 Dec 2019 02:08:51 +0100 Subject: [PATCH 34/73] renamed variables, remoeved commentedline and un used lines ofcode --- fyne/pages/history.go | 227 +++++++++++++++--------------------------- 1 file changed, 80 insertions(+), 147 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index ae0b03ac7..9d5e5c12b 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -41,6 +41,8 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm history.selectedFilterId = dcrlibwallet.TxFilterAll pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) + + txFilterDropDown := prepareTxFilterDropDown(wallet, window, tabmenu) txHistoryPageOutput := widget.NewVBox( widgets.NewVSpacer(5), @@ -545,7 +547,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win txDetailsPopUp.Show() } -func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) *widgets.ClickableBox { +func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) *widgets.ClickableBox { var txTable widgets.Table var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} @@ -564,12 +566,12 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmen errorHandler(errorMessage, history.errorLabel) return nil } + history.allTxCount = txCountForFilter - selectedAccountLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) - history.selectedFilterCount = txCountForFilter + selectedTxFilterLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) - var accountSelectionPopup *widget.PopUp - accountListWidget := widget.NewVBox() + var txFilterSelectionPopup *widget.PopUp + txFilterListWidget := widget.NewVBox() for _, filterName := range allTxFilterNames { filterId := allTxFilters[filterName] txCountForFilter, err := wallet.CountTransactions(filterId) @@ -582,63 +584,64 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmen if txCountForFilter > 0 { filter := fmt.Sprintf("%s (%d)", filterName, txCountForFilter) - accountsView := widget.NewHBox( + txFilterView := widget.NewHBox( widgets.NewHSpacer(5), widget.NewLabel(filter), widgets.NewHSpacer(5), ) - accountListWidget.Append(widgets.NewClickableBox(accountsView, func() { + txFilterListWidget.Append(widgets.NewClickableBox(txFilterView, func() { selectedFilterName := strings.Split(filter, " ")[0] selectedFilterId := allTxFilters[selectedFilterName] - history.selectedFilterCount, _ = strconv.Atoi(strings.Split(filter, " ")[1]) if selectedFilterId != history.selectedFilterId { - txTableHeader(wallet, &txTable, window) + // txTableHeader(wallet, &txTable, window) + fetchTx(&txTable, 0, selectedFilterId, wallet, window, false, tabmenu) history.txTable.Result.Children = txTable.Result.Children - addToHistoryTable(&txTable, 0, selectedFilterId, wallet, window, false, tabmenu) widget.Refresh(history.txTable.Result) - selectedAccountLabel.SetText(filter) + selectedTxFilterLabel.SetText(filter) } - accountSelectionPopup.Hide() + + txFilterSelectionPopup.Hide() })) } } - // accountSelectionPopup create a popup that has account names with spendable amount - accountSelectionPopup = widget.NewPopUp( - widget.NewVBox( - accountListWidget, - ), window.Canvas(), - ) - accountSelectionPopup.Hide() + // txFilterSelectionPopup create a popup that has tx filter name and tx count + txFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txFilterListWidget), window.Canvas()) + txFilterSelectionPopup.Hide() - // accountTab shows the selected account icons, err := assets.GetIcons(assets.CollapseIcon) if err != nil { errorMessage := fmt.Sprintf("Error: %s",err.Error()) errorHandler(errorMessage, history.errorLabel) return nil } - accountTab := widget.NewHBox( - selectedAccountLabel, + + txFilterTab := widget.NewHBox( + selectedTxFilterLabel, widgets.NewHSpacer(50), widget.NewIcon(icons[assets.CollapseIcon]), ) - var accountDropdown *widgets.ClickableBox - accountDropdown = widgets.NewClickableBox(accountTab, func() { - accountSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( - accountDropdown).Add(fyne.NewPos(0, accountDropdown.Size().Height))) - accountSelectionPopup.Show() + var txFilterDropDown *widgets.ClickableBox + txFilterDropDown = widgets.NewClickableBox(txFilterTab, func() { + txFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( + txFilterDropDown).Add(fyne.NewPos(0, txFilterDropDown.Size().Height))) + txFilterSelectionPopup.Show() }) - return accountDropdown + return txFilterDropDown } -func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window) { - tableHeading := widget.NewHBox( +func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { + if filter != history.selectedFilterId { + txOffset = 0 + history.selectedFilterId = filter + } + + tableColumnLabels := widget.NewHBox( widget.NewLabelWithStyle("#", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -649,22 +652,6 @@ func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, windo widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), ) - var hBox []*widget.Box - - txTable.NewTable(tableHeading, hBox...) - - return -} - -func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { - if filter != history.selectedFilterId { - // filter changed, reset data - txOffset = 0 - history.txns = nil - history.selectedFilterId = filter - history.txTable.Container.Offset.Y = 0 - } - txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) if err != nil { errorHandler(fmt.Sprintf("Error getting transaction for Filter %s: %s", filter, err.Error()), history.errorLabel) @@ -676,9 +663,7 @@ func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *d return } - history.txns = append(history.txns, txns...) - - var hBox []*widget.Box + var txBox []*widget.Box for currentTxIndex, tx := range txns { status := "Pending" confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 @@ -688,7 +673,7 @@ func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *d trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] txForTrimmedHash := tx.Hash - hBox = append(hBox, widget.NewHBox( + txBox = append(txBox, widget.NewHBox( widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), @@ -702,28 +687,12 @@ func addToHistoryTable(txTable *widgets.Table, txOffset, filter int32, wallet *d )) } - if prepend { - history.txTable.Prepend(hBox...) - } else { - history.txTable.Append(hBox...) - } - history.errorLabel.Hide() - - y := txTable.Container.Scrolled(txTable.Container.Content.Size().Height - txTable.Container.Size().Height) - fmt.Println(y) + txTable.NewTable(tableColumnLabels, txBox...) - size := txTable.Container.Content.Size().Height - txTable.Container.Size().Height - scrollPosition := float64(history.txTable.Container.Offset.Y) / float64(size) - fmt.Println(size) - fmt.Println(scrollPosition) + history.errorLabel.Hide() } func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, tabmenu *widget.TabContainer) { - var confirmations int32 = 0 - // if txDetails.BlockHeight != -1 { - // confirmations = wallet.GetBestBlock() - txDetails.BlockHeight + 1 - // } - messageLabel := widget.NewLabelWithStyle("Fetching data..", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) if messageLabel.Hidden == false { time.AfterFunc(time.Millisecond*200, func() { @@ -733,22 +702,29 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win }) } - newHash, _ := chainhash.NewHashFromStr(hash) - txDetails, err := wallet.GetTransactionRaw(newHash[:]) + chainHash, err := chainhash.NewHashFromStr(hash) + if err != nil { + errorHandler(fmt.Sprintf("Error: %s", err.Error()), history.errorLabel) + return + } + + txDetails, err := wallet.GetTransactionRaw(chainHash[:]) if err != nil { errorHandler(fmt.Sprintf("Error fetching transaction details for %s: %s", hash, err.Error()), history.errorLabel) return } - var spendUnconfirmed = wallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey) + var confirmations int32 = 0 + if txDetails.BlockHeight != -1 { + confirmations = wallet.GetBestBlock() - txDetails.BlockHeight + 1 + } + var status string - // var statusColor color.RGBA + var spendUnconfirmed = wallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey) if spendUnconfirmed || confirmations > dcrlibwallet.DefaultRequiredConfirmations { status = "Confirmed" - // statusColor = styles.DecredGreenColor } else { status = "Pending" - // statusColor = styles.DecredOrangeColor } tableConfirmations := widget.NewHBox( @@ -756,20 +732,21 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), ) - copyAbleText := func(textToCopy string, copyAble bool) *widgets.ClickableBox { - var t *canvas.Text + copyAbleText := func(text string, copyAble bool) *widgets.ClickableBox { + var textToCopy *canvas.Text if copyAble { - t = canvas.NewText(textToCopy, color.RGBA{0, 255, 255, 1}) + textToCopy = canvas.NewText(text, color.RGBA{0, 255, 255, 1}) } else { - t = canvas.NewText(textToCopy, color.RGBA{255, 255, 255, 1}) + textToCopy = canvas.NewText(text, color.RGBA{255, 255, 255, 1}) } - t.TextSize = 14 - t.Alignment = fyne.TextAlignTrailing - return widgets.NewClickableBox(widget.NewHBox(t), + textToCopy.TextSize = 14 + textToCopy.Alignment = fyne.TextAlignTrailing + + return widgets.NewClickableBox(widget.NewHBox(textToCopy), func() { messageLabel.SetText("Data Copied") clipboard := window.Clipboard() - clipboard.SetContent(textToCopy) + clipboard.SetContent(text) messageLabel.Show() // only hide accountCopiedLabel text if user is currently on the page after 2secs @@ -841,7 +818,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win ) var txInput widgets.Table - heading := widget.NewHBox( + inputTableColumnLabels := widget.NewHBox( widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) @@ -854,10 +831,10 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win copyAbleText(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), false), )) } - txInput.NewTable(heading, inputBox...) + txInput.NewTable(inputTableColumnLabels, inputBox...) var txOutput widgets.Table - heading = widget.NewHBox( + outputTableColumnLabels := widget.NewHBox( widget.NewLabelWithStyle("Address", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Value", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -872,10 +849,10 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win copyAbleText(txDetails.Outputs[i].ScriptType, false), )) } - txOutput.NewTable(heading, outputBox...) + txOutput.NewTable(outputTableColumnLabels, outputBox...) - label := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - v := widget.NewVBox( + txDetailslabel := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) + txDetailsData := widget.NewVBox( widgets.NewHSpacer(10), tableData, widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), @@ -886,70 +863,26 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win widgets.NewHSpacer(10), ) - var popUp *widget.PopUp - scrollContainer := widget.NewScrollContainer(v) - minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { popUp.Hide() }) + var txDetailsPopUp *widget.PopUp + txDetailsScrollContainer := widget.NewScrollContainer(txDetailsData) + minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) - output := widget.NewVBox( + txDetailsOutput := widget.NewVBox( widgets.NewHSpacer(10), - widget.NewHBox(label, widgets.NewHSpacer(150), messageLabel, layout.NewSpacer(), minimizeIcon, widgets.NewHSpacer(30)), + widget.NewHBox( + txDetailslabel, + widgets.NewHSpacer(150), + messageLabel, + layout.NewSpacer(), + minimizeIcon, + widgets.NewHSpacer(30), + ), widgets.NewHSpacer(10), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(scrollContainer.MinSize().Width+10, scrollContainer.MinSize().Height+400)), scrollContainer), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer), widgets.NewHSpacer(10), ) - popUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(output)), + txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), window.Canvas()) - popUp.Show() + txDetailsPopUp.Show() } - -// func updateTx (){ -// size := history.txTable.Container.Content.Size().Height - history.txTable.Container.Size().Height -// scrollPosition := float64(history.txTable.Container.Offset.Y) / float64(size) - -// splittedWord := strings.Split(history.txFilters.Selected, " ") -// var found int32 -// if int32(txCountByFilter[splittedWord[0]]) > history.currentTxCount { -// found = int32(txCountByFilter[splittedWord[0]]) - history.currentTxCount -// history.txFilters.Selected = splittedWord[0] + " (" + strconv.Itoa(txCountByFilter[splittedWord[0]]) + ")" -// widget.Refresh(history.txFilters) -// } - -// // Append to table when scrollbar is at 90% of the scrollbar. -// if scrollPosition == 0.9 { -// if history.totalTxOnTable == int32(count)-found { -// return -// } -// addToHistoryTable(&history.txTable, history.totalTxOnTable+found, 20, wallet, window, false) -// if txCountByFilter[splittedWord[0]] > int(history.totalTxOnTable+20) { -// history.totalTxOnTable = history.totalTxOnTable + 20 -// } else { -// history.totalTxOnTable = int32(txCountByFilter[splittedWord[0]]) -// } -// // Delete from table if rows exceeds 90. -// if history.txTable.NumberOfColumns() >= 90 { -// history.txTable.Delete(0, 20) -// history.offset = history.offset + 20 -// } - -// } else if history.txTable.Container.Offset.Y == 0 { -// // If the scroll bar is at the begining, then fetch 1st 50 tx -// if int32(txCountByFilter[splittedWord[0]]) > history.currentTxCount { -// history.txFilters.SetSelected(splittedWord[0] + " (" + strconv.Itoa(txCountByFilter[splittedWord[0]]) + ")") -// } -// } else if scrollPosition < 0.2 { -// // Return if there's no currently deleted table. -// if history.offset == 0 { -// return -// } -// addToHistoryTable(&history.txTable, history.offset+found-20, 20+found, wallet, window, true) -// history.offset = history.offset - 20 - -// rowNo := history.txTable.NumberOfColumns() -// if rowNo >= 90 { -// history.txTable.Delete(rowNo-20, rowNo) -// history.totalTxOnTable = int32(rowNo) + history.offset -// } -// } -// } - From f203132e2b791285775fae52d9c2333a0d60808c Mon Sep 17 00:00:00 2001 From: morrison Date: Tue, 3 Dec 2019 17:47:13 +0100 Subject: [PATCH 35/73] fixed ssues with tx table not scrolling and returning to the table to when a filter with smaler no of tx --- fyne/pages/history.go | 98 +++++++++++++++++++++++++++++++------------ 1 file changed, 72 insertions(+), 26 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 9d5e5c12b..57b842811 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -13,6 +13,7 @@ import ( "fyne.io/fyne/theme" "fyne.io/fyne/widget" "fyne.io/fyne/theme" + "fyne.io/fyne/widget" "github.com/decred/dcrd/chaincfg/chainhash" "github.com/decred/dcrd/dcrutil" @@ -41,7 +42,7 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm history.selectedFilterId = dcrlibwallet.TxFilterAll pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - + txFilterDropDown := prepareTxFilterDropDown(wallet, window, tabmenu) txHistoryPageOutput := widget.NewVBox( @@ -593,13 +594,15 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, txFilterListWidget.Append(widgets.NewClickableBox(txFilterView, func() { selectedFilterName := strings.Split(filter, " ")[0] selectedFilterId := allTxFilters[selectedFilterName] + if allTxCountForSelectedTx, err := wallet.CountTransactions(selectedFilterId); err == nil { + history.allTxCount = allTxCountForSelectedTx + } if selectedFilterId != history.selectedFilterId { - // txTableHeader(wallet, &txTable, window) - fetchTx(&txTable, 0, selectedFilterId, wallet, window, false, tabmenu) + txTableHeader(wallet, &txTable, window) history.txTable.Result.Children = txTable.Result.Children + fetchTx(&txTable, 0, selectedFilterId, wallet, window, false, tabmenu) widget.Refresh(history.txTable.Result) - selectedTxFilterLabel.SetText(filter) } @@ -614,7 +617,7 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, icons, err := assets.GetIcons(assets.CollapseIcon) if err != nil { - errorMessage := fmt.Sprintf("Error: %s",err.Error()) + errorMessage := fmt.Sprintf("Error: %s", err.Error()) errorHandler(errorMessage, history.errorLabel) return nil } @@ -635,14 +638,8 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, return txFilterDropDown } -func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { - if filter != history.selectedFilterId { - txOffset = 0 - history.selectedFilterId = filter - } - - tableColumnLabels := widget.NewHBox( - widget.NewLabelWithStyle("#", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), +func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window) { + tableHeading := widget.NewHBox( widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -652,6 +649,20 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), ) + var hBox []*widget.Box + + txTable.NewTable(tableHeading, hBox...) + + return +} + +func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { + if filter != history.selectedFilterId { + txOffset = 0 + history.TotalTxFetched = 0 + history.selectedFilterId = filter + } + txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) if err != nil { errorHandler(fmt.Sprintf("Error getting transaction for Filter %s: %s", filter, err.Error()), history.errorLabel) @@ -663,8 +674,10 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle return } + history.TotalTxFetched += int32(len(txns)) + var txBox []*widget.Box - for currentTxIndex, tx := range txns { + for _, tx := range txns { status := "Pending" confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { @@ -674,7 +687,6 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] txForTrimmedHash := tx.Hash txBox = append(txBox, widget.NewHBox( - widget.NewLabelWithStyle(fmt.Sprintf("%d", currentTxIndex+1), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), @@ -687,7 +699,19 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle )) } - txTable.NewTable(tableColumnLabels, txBox...) + if prepend { + txTable.Prepend(txBox...) + } else { + txTable.Append(txBox...) + } + + history.txTable.Result.Children = txTable.Result.Children + widget.Refresh(history.txTable.Result) + widget.Refresh(history.txTable.Container) + + time.AfterFunc(time.Second*8, func() { + updateTable(wallet, window, tabmenu) + }) history.errorLabel.Hide() } @@ -726,7 +750,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win } else { status = "Pending" } - + tableConfirmations := widget.NewHBox( widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), @@ -749,7 +773,6 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win clipboard.SetContent(text) messageLabel.Show() - // only hide accountCopiedLabel text if user is currently on the page after 2secs if messageLabel.Hidden == false { time.AfterFunc(time.Second*2, func() { if tabmenu.CurrentTabIndex() == 1 { @@ -863,20 +886,20 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win widgets.NewHSpacer(10), ) - var txDetailsPopUp *widget.PopUp + var txDetailsPopUp *widget.PopUp txDetailsScrollContainer := widget.NewScrollContainer(txDetailsData) - minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) + minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) txDetailsOutput := widget.NewVBox( widgets.NewHSpacer(10), widget.NewHBox( - txDetailslabel, - widgets.NewHSpacer(150), - messageLabel, - layout.NewSpacer(), - minimizeIcon, + txDetailslabel, + widgets.NewHSpacer(150), + messageLabel, + layout.NewSpacer(), + minimizeIcon, widgets.NewHSpacer(30), - ), + ), widgets.NewHSpacer(10), fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer), widgets.NewHSpacer(10), @@ -886,3 +909,26 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win window.Canvas()) txDetailsPopUp.Show() } + +func updateTable(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) { + size := history.txTable.Container.Content.Size().Height - history.txTable.Container.Size().Height + scrollPosition := float64(history.txTable.Container.Offset.Y) / float64(size) + fmt.Println(scrollPosition, size) + + if history.allTxCount > int(history.TotalTxFetched) { + if history.txTable.Container.Offset.Y == 0 { + fetchTx(&history.txTable, history.TotalTxFetched, history.selectedFilterId, wallet, window, false, tabmenu) + }else if scrollPosition < 0.8 { + time.AfterFunc(time.Second*8, func() { + updateTable(wallet, window, tabmenu) + }) + } else if scrollPosition >= 0.8 { + fetchTx(&history.txTable, history.TotalTxFetched, history.selectedFilterId, wallet, window, false, tabmenu) + } else if scrollPosition < 0.2 { + if history.TotalTxFetched <= txPerPage { + + } + fetchTx(&history.txTable, history.TotalTxFetched, history.selectedFilterId, wallet, window, true, tabmenu) + } + } +} From 4b9f4a122942aa0dca6d2e3e1ac21f34a2919c9c Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 4 Dec 2019 01:19:47 +0100 Subject: [PATCH 36/73] fixed panic issue with error handlers for txdetails page and txdropdown when they are initialized --- fyne/pages/history.go | 165 ++++++++++++++++++++++++------------------ 1 file changed, 94 insertions(+), 71 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 57b842811..5da736ecc 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -548,7 +548,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win txDetailsPopUp.Show() } -func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) *widgets.ClickableBox { +func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) (*widgets.ClickableBox, string) { var txTable widgets.Table var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} @@ -563,11 +563,10 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, txCountForFilter, err := wallet.CountTransactions(allTxFilters["All"]) if err != nil { - errorMessage := fmt.Sprintf("Cannot load history page. Error getting transaction count for filter All: %s", err.Error()) - errorHandler(errorMessage, history.errorLabel) - return nil + errorMessage := fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter All: %s", err.Error()) + return nil, errorMessage } - history.allTxCount = txCountForFilter + txHistory.allTxCount = txCountForFilter selectedTxFilterLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) @@ -577,10 +576,9 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, filterId := allTxFilters[filterName] txCountForFilter, err := wallet.CountTransactions(filterId) if err != nil { - errorMessage := fmt.Sprintf("Cannot load history page. Error getting transaction count for filter %s: %s", + errorMessage := fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter %s: %s", filterName, err.Error()) - errorHandler(errorMessage, history.errorLabel) - return nil + return nil, errorMessage } if txCountForFilter > 0 { @@ -595,15 +593,15 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, selectedFilterName := strings.Split(filter, " ")[0] selectedFilterId := allTxFilters[selectedFilterName] if allTxCountForSelectedTx, err := wallet.CountTransactions(selectedFilterId); err == nil { - history.allTxCount = allTxCountForSelectedTx + txHistory.allTxCount = allTxCountForSelectedTx } - if selectedFilterId != history.selectedFilterId { + if selectedFilterId != txHistory.selectedFilterId { + selectedTxFilterLabel.SetText(filter) txTableHeader(wallet, &txTable, window) - history.txTable.Result.Children = txTable.Result.Children + txHistory.txTable.Result.Children = txTable.Result.Children fetchTx(&txTable, 0, selectedFilterId, wallet, window, false, tabmenu) - widget.Refresh(history.txTable.Result) - selectedTxFilterLabel.SetText(filter) + widget.Refresh(txHistory.txTable.Result) } txFilterSelectionPopup.Hide() @@ -618,13 +616,12 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, icons, err := assets.GetIcons(assets.CollapseIcon) if err != nil { errorMessage := fmt.Sprintf("Error: %s", err.Error()) - errorHandler(errorMessage, history.errorLabel) - return nil + return nil, errorMessage } txFilterTab := widget.NewHBox( selectedTxFilterLabel, - widgets.NewHSpacer(50), + widgets.NewHSpacer(60), widget.NewIcon(icons[assets.CollapseIcon]), ) @@ -635,7 +632,7 @@ func prepareTxFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, txFilterSelectionPopup.Show() }) - return txFilterDropDown + return txFilterDropDown, "" } func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window) { @@ -657,24 +654,24 @@ func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, windo } func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { - if filter != history.selectedFilterId { + if filter != txHistory.selectedFilterId { txOffset = 0 - history.TotalTxFetched = 0 - history.selectedFilterId = filter + txHistory.TotalTxFetched = 0 + txHistory.selectedFilterId = filter } txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) if err != nil { - errorHandler(fmt.Sprintf("Error getting transaction for Filter %s: %s", filter, err.Error()), history.errorLabel) + errorHandler(fmt.Sprintf("Error getting transaction for Filter: %s", err.Error()), txHistory.errorLabel) return } if len(txns) == 0 { - errorHandler("No transaction history yet.", history.errorLabel) - txTable.Container.Hide() + errorHandler("No transactions yet.", txHistory.errorLabel) + txHistory.txTable.Container.Hide() return } - history.TotalTxFetched += int32(len(txns)) + txHistory.TotalTxFetched += int32(len(txns)) var txBox []*widget.Box for _, tx := range txns { @@ -694,7 +691,7 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignCenter, fyne.TextStyle{Italic: true})), func() { - fetchTxDetails(txForTrimmedHash, wallet, window, history.errorLabel, tabmenu) + fetchTxDetails(txForTrimmedHash, wallet, window, txHistory.errorLabel, tabmenu) }), )) } @@ -705,15 +702,48 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle txTable.Append(txBox...) } - history.txTable.Result.Children = txTable.Result.Children - widget.Refresh(history.txTable.Result) - widget.Refresh(history.txTable.Container) + txHistory.txTable.Result.Children = txTable.Result.Children + widget.Refresh(txHistory.txTable.Result) + widget.Refresh(txHistory.txTable.Container) time.AfterFunc(time.Second*8, func() { updateTable(wallet, window, tabmenu) }) - history.errorLabel.Hide() + txHistory.errorLabel.Hide() +} + +func updateTable(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) { + size := txHistory.txTable.Container.Content.Size().Height - txHistory.txTable.Container.Size().Height + scrollPosition := float64(txHistory.txTable.Container.Offset.Y) / float64(size) + txTableRowCount := txHistory.txTable.NumberOfColumns() + + if txHistory.allTxCount > int(txHistory.TotalTxFetched) { + if txHistory.txTable.Container.Offset.Y == 0 { + + time.AfterFunc(time.Second*8, func() { + updateTable(wallet, window, tabmenu) + }) + } else if scrollPosition < 0.5 { + if txHistory.TotalTxFetched <= txPerPage { + time.AfterFunc(time.Second*8, func() { + updateTable(wallet, window, tabmenu) + }) + } + if txTableRowCount <= int(txPerPage) { + return + } + + txHistory.TotalTxFetched -= int32(txPerPage) + + fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, wallet, window, true, tabmenu) + } else if scrollPosition >= 0.5 { + fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, wallet, window, false, tabmenu) + if txTableRowCount > 12 { + txHistory.txTable.Delete(0, txTableRowCount-int(txPerPage)) + } + } + } } func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, tabmenu *widget.TabContainer) { @@ -726,15 +756,45 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win }) } + var txDetailsPopUp *widget.PopUp + + txDetailslabel := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) + + minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) + errorMessageLabel := widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) + + txDetailsOutput := widget.NewVBox( + widgets.NewHSpacer(10), + widget.NewHBox( + txDetailslabel, + widgets.NewHSpacer(150), + messageLabel, + layout.NewSpacer(), + minimizeIcon, + widgets.NewHSpacer(20), + ), + widgets.NewVSpacer(10), + ) + txDetailsOutput.Resize(fyne.NewSize(600, 150)) + + txDetailsErrorMethod := func() { + txDetailsOutput.Append(errorMessageLabel) + txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), + window.Canvas()) + txDetailsPopUp.Show() + } + chainHash, err := chainhash.NewHashFromStr(hash) if err != nil { - errorHandler(fmt.Sprintf("Error: %s", err.Error()), history.errorLabel) + errorHandler(fmt.Sprintf("fetching generating chainhash from for \n %s \n %s ", hash, err.Error()), errorMessageLabel) + txDetailsErrorMethod() return } txDetails, err := wallet.GetTransactionRaw(chainHash[:]) if err != nil { - errorHandler(fmt.Sprintf("Error fetching transaction details for %s: %s", hash, err.Error()), history.errorLabel) + errorHandler(fmt.Sprintf("Error fetching transaction details for \n %s \n %s ", hash, err.Error()), errorMessageLabel) + txDetailsErrorMethod() return } @@ -874,7 +934,6 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win } txOutput.NewTable(outputTableColumnLabels, outputBox...) - txDetailslabel := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) txDetailsData := widget.NewVBox( widgets.NewHSpacer(10), tableData, @@ -886,49 +945,13 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win widgets.NewHSpacer(10), ) - var txDetailsPopUp *widget.PopUp txDetailsScrollContainer := widget.NewScrollContainer(txDetailsData) - minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) - txDetailsOutput := widget.NewVBox( - widgets.NewHSpacer(10), - widget.NewHBox( - txDetailslabel, - widgets.NewHSpacer(150), - messageLabel, - layout.NewSpacer(), - minimizeIcon, - widgets.NewHSpacer(30), - ), - widgets.NewHSpacer(10), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer), - widgets.NewHSpacer(10), - ) + txDetailsOutput.Append(widgets.NewHSpacer(10)) + txDetailsOutput.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer)) + txDetailsOutput.Append(widgets.NewHSpacer(10)) txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), window.Canvas()) txDetailsPopUp.Show() } - -func updateTable(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) { - size := history.txTable.Container.Content.Size().Height - history.txTable.Container.Size().Height - scrollPosition := float64(history.txTable.Container.Offset.Y) / float64(size) - fmt.Println(scrollPosition, size) - - if history.allTxCount > int(history.TotalTxFetched) { - if history.txTable.Container.Offset.Y == 0 { - fetchTx(&history.txTable, history.TotalTxFetched, history.selectedFilterId, wallet, window, false, tabmenu) - }else if scrollPosition < 0.8 { - time.AfterFunc(time.Second*8, func() { - updateTable(wallet, window, tabmenu) - }) - } else if scrollPosition >= 0.8 { - fetchTx(&history.txTable, history.TotalTxFetched, history.selectedFilterId, wallet, window, false, tabmenu) - } else if scrollPosition < 0.2 { - if history.TotalTxFetched <= txPerPage { - - } - fetchTx(&history.txTable, history.TotalTxFetched, history.selectedFilterId, wallet, window, true, tabmenu) - } - } -} From 452c58fd4eb0bda246f618f1171f49ad4d4b8118 Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 4 Dec 2019 08:00:24 +0100 Subject: [PATCH 37/73] fixed error handler panic for tx, added txsort dropdown to history page --- fyne/pages/history.go | 1 + 1 file changed, 1 insertion(+) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 5da736ecc..914b8a014 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -663,6 +663,7 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) if err != nil { errorHandler(fmt.Sprintf("Error getting transaction for Filter: %s", err.Error()), txHistory.errorLabel) + txHistory.txTable.Container.Hide() return } if len(txns) == 0 { From 7c42b02a6df35b5344a95feaf34a797250680e02 Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 4 Dec 2019 13:44:58 +0100 Subject: [PATCH 38/73] fixe issues with txdetails popup --- fyne/pages/history.go | 54 +++++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 914b8a014..258a6bfd9 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -748,9 +748,9 @@ func updateTable(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *wi } func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, tabmenu *widget.TabContainer) { - messageLabel := widget.NewLabelWithStyle("Fetching data..", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) + messageLabel := widget.NewLabelWithStyle("Fetching data..", fyne.TextAlignCenter, fyne.TextStyle{}) if messageLabel.Hidden == false { - time.AfterFunc(time.Millisecond*200, func() { + time.AfterFunc(time.Millisecond*300, func() { if tabmenu.CurrentTabIndex() == 1 { messageLabel.Hide() } @@ -764,30 +764,27 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) errorMessageLabel := widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) - txDetailsOutput := widget.NewVBox( - widgets.NewHSpacer(10), - widget.NewHBox( - txDetailslabel, - widgets.NewHSpacer(150), - messageLabel, - layout.NewSpacer(), - minimizeIcon, - widgets.NewHSpacer(20), - ), - widgets.NewVSpacer(10), - ) - txDetailsOutput.Resize(fyne.NewSize(600, 150)) - txDetailsErrorMethod := func() { - txDetailsOutput.Append(errorMessageLabel) - txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), + txErrorDetailsOutput := widget.NewVBox( + widgets.NewHSpacer(10), + widget.NewHBox( + txDetailslabel, + widgets.NewHSpacer(150), + messageLabel, + layout.NewSpacer(), + minimizeIcon, + widgets.NewHSpacer(30), + ), + errorMessageLabel, + ) + txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txErrorDetailsOutput)), window.Canvas()) txDetailsPopUp.Show() } chainHash, err := chainhash.NewHashFromStr(hash) - if err != nil { - errorHandler(fmt.Sprintf("fetching generating chainhash from for \n %s \n %s ", hash, err.Error()), errorMessageLabel) + if err == nil { + errorHandler(fmt.Sprintf("fetching generating chainhash from for \n %s \n %s ", hash, "err.Error()"), errorMessageLabel) txDetailsErrorMethod() return } @@ -948,9 +945,20 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win txDetailsScrollContainer := widget.NewScrollContainer(txDetailsData) - txDetailsOutput.Append(widgets.NewHSpacer(10)) - txDetailsOutput.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer)) - txDetailsOutput.Append(widgets.NewHSpacer(10)) + txDetailsOutput := widget.NewVBox( + widgets.NewHSpacer(10), + widget.NewHBox( + txDetailslabel, + widgets.NewHSpacer(150), + messageLabel, + layout.NewSpacer(), + minimizeIcon, + widgets.NewHSpacer(30), + ), + widgets.NewHSpacer(10), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer), + widgets.NewHSpacer(10), + ) txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), window.Canvas()) From 04756267eba81d8e9bc9cad0db5f22e2fe10fd64 Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 4 Dec 2019 13:48:12 +0100 Subject: [PATCH 39/73] un-did changes --- fyne/pages/history.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 258a6bfd9..eb5868339 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -783,8 +783,8 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win } chainHash, err := chainhash.NewHashFromStr(hash) - if err == nil { - errorHandler(fmt.Sprintf("fetching generating chainhash from for \n %s \n %s ", hash, "err.Error()"), errorMessageLabel) + if err != nil { + errorHandler(fmt.Sprintf("fetching generating chainhash from for \n %s \n %s ", hash, err.Error()), errorMessageLabel) txDetailsErrorMethod() return } From a6ab7d9afc621ce94679a1f1b3531ee2b7ef1d69 Mon Sep 17 00:00:00 2001 From: morrison Date: Fri, 6 Dec 2019 06:51:54 +0100 Subject: [PATCH 40/73] fixing history page --- fyne/pages/history.go | 93 +++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 47 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index eb5868339..624903edf 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -17,7 +17,6 @@ import ( "github.com/decred/dcrd/chaincfg/chainhash" "github.com/decred/dcrd/dcrutil" - "github.com/raedahgroup/dcrlibwallet" "github.com/raedahgroup/godcr/fyne/assets" "github.com/raedahgroup/godcr/fyne/widgets" ) @@ -34,7 +33,7 @@ type txHistoryPageData struct { var txHistory txHistoryPageData -func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) fyne.CanvasObject { +func historyPageContent() fyne.CanvasObject { txHistory.errorLabel = widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) txHistory.errorLabel.Hide() @@ -51,22 +50,22 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm widgets.NewVSpacer(5), ) - txFilterDropDown, errorMessage := txFilterDropDown(wallet, window, tabmenu) + txFilterDropDown, errorMessage := txFilterDropDown() if errorMessage != "" { errorHandler(errorMessage, txHistory.errorLabel) txHistoryPageOutput.Append(txHistory.errorLabel) return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } - txSortFilterDropDown, errorMessage := txSortDropDown(window) + txSortFilterDropDown, errorMessage := txSortDropDown() if errorMessage != "" { errorHandler(errorMessage, txHistory.errorLabel) txHistoryPageOutput.Append(txHistory.errorLabel) return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } - txTableHeader(wallet, &txHistory.txTable, window) - fetchTx(&txHistory.txTable, 0, dcrlibwallet.TxFilterAll, wallet, window, false, tabmenu) + txTableHeader(&txHistory.txTable) + fetchTx(&txHistory.txTable, 0, dcrlibwallet.TxFilterAll, false) txHistoryPageOutput.Append(widget.NewHBox(txSortFilterDropDown, widgets.NewHSpacer(30), txFilterDropDown)) txHistoryPageOutput.Append(txHistory.errorLabel) @@ -77,20 +76,20 @@ func HistoryPageContent(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabm return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } -func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) (*widgets.ClickableBox, string) { +func txFilterDropDown() (*widgets.ClickableBox, string) { var txTable widgets.Table var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} var allTxFilters = map[string]int32{ - "All": dcrlibwallet.TxFilterAll, - "Sent": dcrlibwallet.TxFilterSent, - "Received": dcrlibwallet.TxFilterReceived, - "Transferred": dcrlibwallet.TxFilterTransferred, - "Coinbase": dcrlibwallet.TxFilterCoinBase, - "Staking": dcrlibwallet.TxFilterStaking, + "All": dcrlibAppInterface.wallet.TxFilterAll, + "Sent": dcrlibAppInterface.wallet.TxFilterSent, + "Received": dcrlibAppInterface.wallet.TxFilterReceived, + "Transferred": dcrlibAppInterface.wallet.TxFilterTransferred, + "Coinbase": dcrlibAppInterface.wallet.TxFilterCoinBase, + "Staking": dcrlibAppInterface.wallet.TxFilterStaking, } - txCountForFilter, err := wallet.CountTransactions(allTxFilters["All"]) + txCountForFilter, err := AppInterface.wallet.CountTransactions(allTxFilters["All"]) if err != nil { errorMessage := fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter All: %s", err.Error()) return nil, errorMessage @@ -103,7 +102,7 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmen txFilterListWidget := widget.NewVBox() for _, filterName := range allTxFilterNames { filterId := allTxFilters[filterName] - txCountForFilter, err := wallet.CountTransactions(filterId) + txCountForFilter, err := AppInterface.wallet.CountTransactions(filterId) if err != nil { errorMessage := fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter %s: %s", filterName, err.Error()) @@ -121,15 +120,15 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmen txFilterListWidget.Append(widgets.NewClickableBox(txFilterView, func() { selectedFilterName := strings.Split(filter, " ")[0] selectedFilterId := allTxFilters[selectedFilterName] - if allTxCountForSelectedTx, err := wallet.CountTransactions(selectedFilterId); err == nil { + if allTxCountForSelectedTx, err := AppInterface.wallet.CountTransactions(selectedFilterId); err == nil { txHistory.allTxCount = allTxCountForSelectedTx } if selectedFilterId != txHistory.selectedFilterId { selectedTxFilterLabel.SetText(filter) - txTableHeader(wallet, &txTable, window) + txTableHeader(&txTable) txHistory.txTable.Result.Children = txTable.Result.Children - fetchTx(&txTable, 0, selectedFilterId, wallet, window, false, tabmenu) + fetchTx(&txTable, 0, selectedFilterId, AppInterface.wallet, AppInterface.AppInterface.window, false, AppInterface.tabmenu) widget.Refresh(txHistory.txTable.Result) } @@ -139,7 +138,7 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmen } // txFilterSelectionPopup create a popup that has tx filter name and tx count - txFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txFilterListWidget), window.Canvas()) + txFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txFilterListWidget), AppInterface.AppInterface.window.Canvas()) txFilterSelectionPopup.Hide() icons, err := assets.GetIcons(assets.CollapseIcon) @@ -164,7 +163,7 @@ func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmen return txFilterDropDown, "" } -func txSortDropDown(window fyne.Window) (*widgets.ClickableBox, string) { +func txSortDropDown() (*widgets.ClickableBox, string) { var allTxSortNames = []string{"Newest", "Oldest"} var allTxSortFilters = map[string]int32{ "Newest": 0, @@ -192,7 +191,7 @@ func txSortDropDown(window fyne.Window) (*widgets.ClickableBox, string) { } // txSortFilterSelectionPopup create a popup that has tx filter name and tx count - txSortFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txSortFilterListWidget), window.Canvas()) + txSortFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txSortFilterListWidget), AppInterface.AppInterface.window.Canvas()) txSortFilterSelectionPopup.Hide() icons, err := assets.GetIcons(assets.CollapseIcon) @@ -217,7 +216,7 @@ func txSortDropDown(window fyne.Window) (*widgets.ClickableBox, string) { return txSortFilterDropDown, "" } -func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window) { +func txTableHeader(txTable *widgets.Table) { tableHeading := widget.NewHBox( widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -236,14 +235,14 @@ func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, windo return } -func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { +func fetchTx(txTable *widgets.Table, txOffset, filter int32, prepend bool) { if filter != txHistory.selectedFilterId { txOffset = 0 txHistory.TotalTxFetched = 0 txHistory.selectedFilterId = filter } - txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) + txns, err := AppInterface.wallet.GetTransactionsRaw(txOffset, txPerPage, filter) if err != nil { errorHandler(fmt.Sprintf("Error getting transaction for Filter: %s", err.Error()), txHistory.errorLabel) txHistory.txTable.Container.Hide() @@ -260,22 +259,22 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle var txBox []*widget.Box for _, tx := range txns { status := "Pending" - confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 - if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { + confirmations := AppInterface.wallet.GetBestBlock() - tx.BlockHeight + 1 + if tx.BlockHeight != -1 && confirmations > dcrlibAppInterface.wallet.DefaultRequiredConfirmations { status = "Confirmed" } trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] txForTrimmedHash := tx.Hash txBox = append(txBox, widget.NewHBox( - widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrlibAppInterface.wallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrlibAppInterface.wallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignCenter, fyne.TextStyle{Italic: true})), func() { - fetchTxDetails(txForTrimmedHash, wallet, window, txHistory.errorLabel, tabmenu) + fetchTxDetails(txForTrimmedHash, txHistory.errorLabel) }), )) } @@ -291,13 +290,13 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle widget.Refresh(txHistory.txTable.Container) time.AfterFunc(time.Second*8, func() { - updateTable(wallet, window, tabmenu) + updateTable(AppInterface.wallet, AppInterface.AppInterface.window, AppInterface.tabmenu) }) txHistory.errorLabel.Hide() } -func updateTable(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) { +func updateTable() { size := txHistory.txTable.Container.Content.Size().Height - txHistory.txTable.Container.Size().Height scrollPosition := float64(txHistory.txTable.Container.Offset.Y) / float64(size) txTableRowCount := txHistory.txTable.NumberOfColumns() @@ -306,12 +305,12 @@ func updateTable(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *wi if txHistory.txTable.Container.Offset.Y == 0 { time.AfterFunc(time.Second*8, func() { - updateTable(wallet, window, tabmenu) + updateTable(AppInterface.wallet, AppInterface.AppInterface.window, AppInterface.tabmenu) }) } else if scrollPosition < 0.5 { if txHistory.TotalTxFetched <= txPerPage { time.AfterFunc(time.Second*8, func() { - updateTable(wallet, window, tabmenu) + updateTable(AppInterface.wallet, AppInterface.AppInterface.window, AppInterface.tabmenu) }) } if txTableRowCount <= int(txPerPage) { @@ -320,9 +319,9 @@ func updateTable(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *wi txHistory.TotalTxFetched -= int32(txPerPage) - fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, wallet, window, true, tabmenu) + fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, true) } else if scrollPosition >= 0.5 { - fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, wallet, window, false, tabmenu) + fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, false) if txTableRowCount > 12 { txHistory.txTable.Delete(0, txTableRowCount-int(txPerPage)) } @@ -330,11 +329,11 @@ func updateTable(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *wi } } -func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, tabmenu *widget.TabContainer) { +func fetchTxDetails(hash string, errorLabel *widget.Label) { messageLabel := widget.NewLabelWithStyle("Fetching data..", fyne.TextAlignCenter, fyne.TextStyle{}) if messageLabel.Hidden == false { time.AfterFunc(time.Millisecond*300, func() { - if tabmenu.CurrentTabIndex() == 1 { + if AppInterface.tabmenu.CurrentTabIndex() == 1 { messageLabel.Hide() } }) @@ -361,7 +360,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win errorMessageLabel, ) txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txErrorDetailsOutput)), - window.Canvas()) + AppInterface.AppInterface.window.Canvas()) txDetailsPopUp.Show() } @@ -372,7 +371,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win return } - txDetails, err := wallet.GetTransactionRaw(chainHash[:]) + txDetails, err := AppInterface.wallet.GetTransactionRaw(chainHash[:]) if err != nil { errorHandler(fmt.Sprintf("Error fetching transaction details for \n %s \n %s ", hash, err.Error()), errorMessageLabel) txDetailsErrorMethod() @@ -381,12 +380,12 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win var confirmations int32 = 0 if txDetails.BlockHeight != -1 { - confirmations = wallet.GetBestBlock() - txDetails.BlockHeight + 1 + confirmations = AppInterface.wallet.GetBestBlock() - txDetails.BlockHeight + 1 } var status string - var spendUnconfirmed = wallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey) - if spendUnconfirmed || confirmations > dcrlibwallet.DefaultRequiredConfirmations { + var spendUnconfirmed = AppInterface.wallet.ReadBoolConfigValueForKey(dcrlibAppInterface.wallet.SpendUnconfirmedConfigKey) + if spendUnconfirmed || confirmations > dcrlibAppInterface.wallet.DefaultRequiredConfirmations { status = "Confirmed" } else { status = "Pending" @@ -410,13 +409,13 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win return widgets.NewClickableBox(widget.NewHBox(textToCopy), func() { messageLabel.SetText("Data Copied") - clipboard := window.Clipboard() + clipboard := AppInterface.window.Clipboard() clipboard.SetContent(text) messageLabel.Show() if messageLabel.Hidden == false { time.AfterFunc(time.Second*2, func() { - if tabmenu.CurrentTabIndex() == 1 { + if AppInterface.tabmenu.CurrentTabIndex() == 1 { messageLabel.Hide() } }) @@ -436,7 +435,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win ) tableDirection := widget.NewHBox( widget.NewLabelWithStyle("Direction:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(txDetails.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrlibAppInterface.wallet.TransactionDirectionName(txDetails.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), ) tableType := widget.NewHBox( widget.NewLabelWithStyle("Type:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), @@ -464,7 +463,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win ) tableDate := widget.NewHBox( widget.NewLabelWithStyle("Date:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(txDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibAppInterface.wallet.FormatUTCTime(txDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), ) tableData := widget.NewVBox( @@ -544,7 +543,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win ) txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), - window.Canvas()) + AppInterface.window.Canvas()) txDetailsPopUp.Show() } From aa8fde157c71e59f374a9cd960eced62a0238733 Mon Sep 17 00:00:00 2001 From: morrison Date: Sun, 8 Dec 2019 23:41:54 +0100 Subject: [PATCH 41/73] implemented multiwallet feature --- cmd/go.mod | 2 +- fyne/go.mod | 3 +- fyne/pages/display.go | 2 +- fyne/pages/history.go | 564 ++++++------------------------------ fyne/widgets/overviewBox.go | 18 +- go.mod | 5 + go.sum | 341 ++++++++++++++++++++++ nuklear/go.sum | 27 -- 8 files changed, 446 insertions(+), 516 deletions(-) create mode 100644 go.sum diff --git a/cmd/go.mod b/cmd/go.mod index 4990e1715..5fa5ca7e8 100644 --- a/cmd/go.mod +++ b/cmd/go.mod @@ -6,10 +6,10 @@ require ( github.com/decred/slog v1.0.0 github.com/jessevdk/go-flags v1.4.0 github.com/jrick/logrotate v1.0.0 + github.com/raedahgroup/dcrlibwallet v1.1.1-0.20190928085114-bcc6e6b7769a // indirect github.com/raedahgroup/godcr/app v0.0.0-00010101000000-000000000000 github.com/raedahgroup/godcr/cli v0.0.0-00010101000000-000000000000 github.com/raedahgroup/godcr/nuklear v0.0.0-00010101000000-000000000000 - github.com/raedahgroup/godcr/terminal v0.0.0-00010101000000-000000000000 // indirect github.com/raedahgroup/godcr/web v0.0.0-00010101000000-000000000000 ) diff --git a/fyne/go.mod b/fyne/go.mod index 833422106..1fc6a1cdf 100644 --- a/fyne/go.mod +++ b/fyne/go.mod @@ -4,9 +4,8 @@ go 1.13 require ( fyne.io/fyne v1.2.0 - fyne.io/fyne v1.1.3-0.20191104221827-e8f6795efa08 + github.com/decred/dcrd/chaincfg/chainhash v1.0.2 github.com/decred/dcrd/dcrutil v1.4.0 - github.com/decred/dcrd/chaincfg/chainhash v1.0.1 github.com/decred/slog v1.0.0 github.com/gen2brain/beeep v0.0.0-20190719094215-ece0cb67ca77 github.com/gobuffalo/packr/v2 v2.6.0 diff --git a/fyne/pages/display.go b/fyne/pages/display.go index 5a2a281e9..253120623 100644 --- a/fyne/pages/display.go +++ b/fyne/pages/display.go @@ -104,7 +104,7 @@ func (app *AppInterface) setupNavigationMenu() { case 0: newPageContent = overviewPageContent(app) case 1: - newPageContent = historyPageContent() + newPageContent = historyPageContent(app) case 2: newPageContent = sendPageContent(app.MultiWallet, app.Window) case 3: diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 624903edf..5167ddacb 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -3,6 +3,7 @@ package pages import ( "fmt" "image/color" + "sort" "strconv" "strings" "time" @@ -12,11 +13,10 @@ import ( "fyne.io/fyne/layout" "fyne.io/fyne/theme" "fyne.io/fyne/widget" - "fyne.io/fyne/theme" - "fyne.io/fyne/widget" "github.com/decred/dcrd/chaincfg/chainhash" "github.com/decred/dcrd/dcrutil" + "github.com/raedahgroup/dcrlibwallet" "github.com/raedahgroup/godcr/fyne/assets" "github.com/raedahgroup/godcr/fyne/widgets" ) @@ -29,44 +29,44 @@ type txHistoryPageData struct { selectedFilterId int32 errorLabel *widget.Label TotalTxFetched int32 + selectedWalletID int + selectedtxSort bool } var txHistory txHistoryPageData -func historyPageContent() fyne.CanvasObject { +func historyPageContent(app *AppInterface) fyne.CanvasObject { txHistory.errorLabel = widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) txHistory.errorLabel.Hide() - history.currentPage = 1 - history.selectedFilterId = dcrlibwallet.TxFilterAll + txHistory.selectedFilterId = dcrlibwallet.TxFilterAll pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - txFilterDropDown := prepareTxFilterDropDown(wallet, window, tabmenu) - txHistoryPageOutput := widget.NewVBox( widgets.NewVSpacer(5), - widget.NewHBox(pageTitleLabel, widgets.NewHSpacer(100), clickableInfoIcon), + pageTitleLabel, widgets.NewVSpacer(5), ) - txFilterDropDown, errorMessage := txFilterDropDown() + walletList, txFilterDropDown, errorMessage := txFilterDropDown(app.MultiWallet, app.Window, app.tabMenu) if errorMessage != "" { errorHandler(errorMessage, txHistory.errorLabel) txHistoryPageOutput.Append(txHistory.errorLabel) return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } - txSortFilterDropDown, errorMessage := txSortDropDown() + txSortFilterDropDown, errorMessage := txSortDropDown(app.Window) if errorMessage != "" { errorHandler(errorMessage, txHistory.errorLabel) txHistoryPageOutput.Append(txHistory.errorLabel) return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } - txTableHeader(&txHistory.txTable) - fetchTx(&txHistory.txTable, 0, dcrlibwallet.TxFilterAll, false) + txTableHeader(app.MultiWallet, &txHistory.txTable, app.Window) + fetchTx(&txHistory.txTable, 0, dcrlibwallet.TxFilterAll, app.MultiWallet, app.Window, app.tabMenu, false) + txHistoryPageOutput.Append(walletList) txHistoryPageOutput.Append(widget.NewHBox(txSortFilterDropDown, widgets.NewHSpacer(30), txFilterDropDown)) txHistoryPageOutput.Append(txHistory.errorLabel) txHistoryPageOutput.Append(widgets.NewVSpacer(5)) @@ -76,37 +76,66 @@ func historyPageContent() fyne.CanvasObject { return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } -func txFilterDropDown() (*widgets.ClickableBox, string) { +func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer) (*widget.Box, *widgets.ClickableBox, string) { var txTable widgets.Table + walletsID := multiWallet.OpenedWalletIDsRaw() + if len(walletsID) == 0 { + return nil, nil, "Could not retrieve wallets" + } + sort.Ints(walletsID) + + // default wallet selected + txHistory.selectedWalletID = walletsID[0] + + walletListWidget := widget.NewHBox() + for _, walletID := range walletsID { + wallet := multiWallet.WalletWithID(walletID) + if wallet == nil { + continue + } + + walletView := widget.NewHBox( + widget.NewLabel(wallet.Name), + widgets.NewHSpacer(5), + ) + individualWalletID := walletID + + walletListWidget.Append(widgets.NewClickableBox(walletView, func() { + txHistory.selectedWalletID = individualWalletID + })) + walletListWidget.Append(widgets.NewHSpacer(8)) + } + + var txFilterSelectionPopup *widget.PopUp + txFilterListWidget := widget.NewVBox() + var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} var allTxFilters = map[string]int32{ - "All": dcrlibAppInterface.wallet.TxFilterAll, - "Sent": dcrlibAppInterface.wallet.TxFilterSent, - "Received": dcrlibAppInterface.wallet.TxFilterReceived, - "Transferred": dcrlibAppInterface.wallet.TxFilterTransferred, - "Coinbase": dcrlibAppInterface.wallet.TxFilterCoinBase, - "Staking": dcrlibAppInterface.wallet.TxFilterStaking, + "All": dcrlibwallet.TxFilterAll, + "Sent": dcrlibwallet.TxFilterSent, + "Received": dcrlibwallet.TxFilterReceived, + "Transferred": dcrlibwallet.TxFilterTransferred, + "Coinbase": dcrlibwallet.TxFilterCoinBase, + "Staking": dcrlibwallet.TxFilterStaking, } - txCountForFilter, err := AppInterface.wallet.CountTransactions(allTxFilters["All"]) + txCountForFilter, err := multiWallet.WalletWithID(txHistory.selectedWalletID).CountTransactions(allTxFilters["All"]) if err != nil { errorMessage := fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter All: %s", err.Error()) - return nil, errorMessage + return nil, nil, errorMessage } txHistory.allTxCount = txCountForFilter selectedTxFilterLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) - var txFilterSelectionPopup *widget.PopUp - txFilterListWidget := widget.NewVBox() for _, filterName := range allTxFilterNames { filterId := allTxFilters[filterName] - txCountForFilter, err := AppInterface.wallet.CountTransactions(filterId) + txCountForFilter, err := multiWallet.WalletWithID(txHistory.selectedWalletID).CountTransactions(filterId) if err != nil { errorMessage := fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter %s: %s", filterName, err.Error()) - return nil, errorMessage + return nil, nil, errorMessage } if txCountForFilter > 0 { @@ -120,15 +149,15 @@ func txFilterDropDown() (*widgets.ClickableBox, string) { txFilterListWidget.Append(widgets.NewClickableBox(txFilterView, func() { selectedFilterName := strings.Split(filter, " ")[0] selectedFilterId := allTxFilters[selectedFilterName] - if allTxCountForSelectedTx, err := AppInterface.wallet.CountTransactions(selectedFilterId); err == nil { + if allTxCountForSelectedTx, err := multiWallet.WalletWithID(txHistory.selectedWalletID).CountTransactions(selectedFilterId); err == nil { txHistory.allTxCount = allTxCountForSelectedTx } if selectedFilterId != txHistory.selectedFilterId { selectedTxFilterLabel.SetText(filter) - txTableHeader(&txTable) + txTableHeader(multiWallet, &txTable, window) txHistory.txTable.Result.Children = txTable.Result.Children - fetchTx(&txTable, 0, selectedFilterId, AppInterface.wallet, AppInterface.AppInterface.window, false, AppInterface.tabmenu) + fetchTx(&txTable, 0, selectedFilterId, multiWallet, window, tabMenu, false) widget.Refresh(txHistory.txTable.Result) } @@ -138,13 +167,13 @@ func txFilterDropDown() (*widgets.ClickableBox, string) { } // txFilterSelectionPopup create a popup that has tx filter name and tx count - txFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txFilterListWidget), AppInterface.AppInterface.window.Canvas()) + txFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txFilterListWidget), window.Canvas()) txFilterSelectionPopup.Hide() icons, err := assets.GetIcons(assets.CollapseIcon) if err != nil { errorMessage := fmt.Sprintf("Error: %s", err.Error()) - return nil, errorMessage + return nil, nil, errorMessage } txFilterTab := widget.NewHBox( @@ -160,38 +189,39 @@ func txFilterDropDown() (*widgets.ClickableBox, string) { txFilterSelectionPopup.Show() }) - return txFilterDropDown, "" + return walletListWidget, txFilterDropDown, "" } -func txSortDropDown() (*widgets.ClickableBox, string) { +func txSortDropDown(window fyne.Window) (*widgets.ClickableBox, string) { var allTxSortNames = []string{"Newest", "Oldest"} - var allTxSortFilters = map[string]int32{ - "Newest": 0, - "Oldest": 1, + var allTxSortFilters = map[string]bool{ + "Newest": true, + "Oldest": false, } selectedTxSortFilterLabel := widget.NewLabel("Newest") + txHistory.selectedtxSort = allTxSortFilters["Newest"] var txSortFilterSelectionPopup *widget.PopUp txSortFilterListWidget := widget.NewVBox() for _, sortName := range allTxSortNames { - sortId := allTxSortFilters[sortName] - fmt.Println(sortId) - txSortView := widget.NewHBox( widgets.NewHSpacer(5), widget.NewLabel(sortName), widgets.NewHSpacer(5), ) + txSort := allTxSortFilters[sortName] + newSortName := sortName txSortFilterListWidget.Append(widgets.NewClickableBox(txSortView, func() { - selectedTxSortFilterLabel.SetText(sortName) + selectedTxSortFilterLabel.SetText(newSortName) + txHistory.selectedtxSort = txSort txSortFilterSelectionPopup.Hide() })) } // txSortFilterSelectionPopup create a popup that has tx filter name and tx count - txSortFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txSortFilterListWidget), AppInterface.AppInterface.window.Canvas()) + txSortFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txSortFilterListWidget), window.Canvas()) txSortFilterSelectionPopup.Hide() icons, err := assets.GetIcons(assets.CollapseIcon) @@ -216,425 +246,7 @@ func txSortDropDown() (*widgets.ClickableBox, string) { return txSortFilterDropDown, "" } -func txTableHeader(txTable *widgets.Table) { - tableHeading := widget.NewHBox( - widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - - ) - - var hBox []*widget.Box - - txTable.NewTable(tableHeading, hBox...) - - return -} - -func fetchTx(txTable *widgets.Table, txOffset, filter int32, prepend bool) { - if filter != txHistory.selectedFilterId { - txOffset = 0 - txHistory.TotalTxFetched = 0 - txHistory.selectedFilterId = filter - } - - txns, err := AppInterface.wallet.GetTransactionsRaw(txOffset, txPerPage, filter) - if err != nil { - errorHandler(fmt.Sprintf("Error getting transaction for Filter: %s", err.Error()), txHistory.errorLabel) - txHistory.txTable.Container.Hide() - return - } - if len(txns) == 0 { - errorHandler("No transactions yet.", txHistory.errorLabel) - txHistory.txTable.Container.Hide() - return - } - - txHistory.TotalTxFetched += int32(len(txns)) - - var txBox []*widget.Box - for _, tx := range txns { - status := "Pending" - confirmations := AppInterface.wallet.GetBestBlock() - tx.BlockHeight + 1 - if tx.BlockHeight != -1 && confirmations > dcrlibAppInterface.wallet.DefaultRequiredConfirmations { - status = "Confirmed" - } - - trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] - txForTrimmedHash := tx.Hash - txBox = append(txBox, widget.NewHBox( - widget.NewLabelWithStyle(dcrlibAppInterface.wallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrlibAppInterface.wallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), - widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignCenter, fyne.TextStyle{Italic: true})), func() { - fetchTxDetails(txForTrimmedHash, txHistory.errorLabel) - }), - )) - } - - if prepend { - txTable.Prepend(txBox...) - } else { - txTable.Append(txBox...) - } - - txHistory.txTable.Result.Children = txTable.Result.Children - widget.Refresh(txHistory.txTable.Result) - widget.Refresh(txHistory.txTable.Container) - - time.AfterFunc(time.Second*8, func() { - updateTable(AppInterface.wallet, AppInterface.AppInterface.window, AppInterface.tabmenu) - }) - - txHistory.errorLabel.Hide() -} - -func updateTable() { - size := txHistory.txTable.Container.Content.Size().Height - txHistory.txTable.Container.Size().Height - scrollPosition := float64(txHistory.txTable.Container.Offset.Y) / float64(size) - txTableRowCount := txHistory.txTable.NumberOfColumns() - - if txHistory.allTxCount > int(txHistory.TotalTxFetched) { - if txHistory.txTable.Container.Offset.Y == 0 { - - time.AfterFunc(time.Second*8, func() { - updateTable(AppInterface.wallet, AppInterface.AppInterface.window, AppInterface.tabmenu) - }) - } else if scrollPosition < 0.5 { - if txHistory.TotalTxFetched <= txPerPage { - time.AfterFunc(time.Second*8, func() { - updateTable(AppInterface.wallet, AppInterface.AppInterface.window, AppInterface.tabmenu) - }) - } - if txTableRowCount <= int(txPerPage) { - return - } - - txHistory.TotalTxFetched -= int32(txPerPage) - - fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, true) - } else if scrollPosition >= 0.5 { - fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, false) - if txTableRowCount > 12 { - txHistory.txTable.Delete(0, txTableRowCount-int(txPerPage)) - } - } - } -} - -func fetchTxDetails(hash string, errorLabel *widget.Label) { - messageLabel := widget.NewLabelWithStyle("Fetching data..", fyne.TextAlignCenter, fyne.TextStyle{}) - if messageLabel.Hidden == false { - time.AfterFunc(time.Millisecond*300, func() { - if AppInterface.tabmenu.CurrentTabIndex() == 1 { - messageLabel.Hide() - } - }) - } - - var txDetailsPopUp *widget.PopUp - - txDetailslabel := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - - minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) - errorMessageLabel := widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) - - txDetailsErrorMethod := func() { - txErrorDetailsOutput := widget.NewVBox( - widgets.NewHSpacer(10), - widget.NewHBox( - txDetailslabel, - widgets.NewHSpacer(150), - messageLabel, - layout.NewSpacer(), - minimizeIcon, - widgets.NewHSpacer(30), - ), - errorMessageLabel, - ) - txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txErrorDetailsOutput)), - AppInterface.AppInterface.window.Canvas()) - txDetailsPopUp.Show() - } - - chainHash, err := chainhash.NewHashFromStr(hash) - if err != nil { - errorHandler(fmt.Sprintf("fetching generating chainhash from for \n %s \n %s ", hash, err.Error()), errorMessageLabel) - txDetailsErrorMethod() - return - } - - txDetails, err := AppInterface.wallet.GetTransactionRaw(chainHash[:]) - if err != nil { - errorHandler(fmt.Sprintf("Error fetching transaction details for \n %s \n %s ", hash, err.Error()), errorMessageLabel) - txDetailsErrorMethod() - return - } - - var confirmations int32 = 0 - if txDetails.BlockHeight != -1 { - confirmations = AppInterface.wallet.GetBestBlock() - txDetails.BlockHeight + 1 - } - - var status string - var spendUnconfirmed = AppInterface.wallet.ReadBoolConfigValueForKey(dcrlibAppInterface.wallet.SpendUnconfirmedConfigKey) - if spendUnconfirmed || confirmations > dcrlibAppInterface.wallet.DefaultRequiredConfirmations { - status = "Confirmed" - } else { - status = "Pending" - } - - tableConfirmations := widget.NewHBox( - widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - - copyAbleText := func(text string, copyAble bool) *widgets.ClickableBox { - var textToCopy *canvas.Text - if copyAble { - textToCopy = canvas.NewText(text, color.RGBA{0, 255, 255, 1}) - } else { - textToCopy = canvas.NewText(text, color.RGBA{255, 255, 255, 1}) - } - textToCopy.TextSize = 14 - textToCopy.Alignment = fyne.TextAlignTrailing - - return widgets.NewClickableBox(widget.NewHBox(textToCopy), - func() { - messageLabel.SetText("Data Copied") - clipboard := AppInterface.window.Clipboard() - clipboard.SetContent(text) - messageLabel.Show() - - if messageLabel.Hidden == false { - time.AfterFunc(time.Second*2, func() { - if AppInterface.tabmenu.CurrentTabIndex() == 1 { - messageLabel.Hide() - } - }) - } - }, - ) - } - - tableHash := widget.NewHBox( - widget.NewLabelWithStyle("Transaction ID:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - copyAbleText(txDetails.Hash, true), - ) - - tableBlockHeight := widget.NewHBox( - widget.NewLabelWithStyle("Block Height:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(strconv.Itoa(int(txDetails.BlockHeight)), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableDirection := widget.NewHBox( - widget.NewLabelWithStyle("Direction:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrlibAppInterface.wallet.TransactionDirectionName(txDetails.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableType := widget.NewHBox( - widget.NewLabelWithStyle("Type:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(txDetails.Type, fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableAmount := widget.NewHBox( - widget.NewLabelWithStyle("Amount:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Amount).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableSize := widget.NewHBox( - widget.NewLabelWithStyle("Size:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(strconv.Itoa(txDetails.Size)+" Bytes", fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableFee := widget.NewHBox( - widget.NewLabelWithStyle("Fee:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableFeeRate := widget.NewHBox( - widget.NewLabelWithStyle("Fee Rate:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrutil.Amount(txDetails.FeeRate).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableStatus := widget.NewHBox( - widget.NewLabelWithStyle("Status:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(status, fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableDate := widget.NewHBox( - widget.NewLabelWithStyle("Date:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibAppInterface.wallet.FormatUTCTime(txDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - - tableData := widget.NewVBox( - tableConfirmations, - tableHash, - tableBlockHeight, - tableDirection, - tableType, - tableAmount, - tableSize, - tableFee, - tableFeeRate, - tableStatus, - tableDate, - ) - - var txInput widgets.Table - inputTableColumnLabels := widget.NewHBox( - widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) - - var inputBox []*widget.Box - for i := range txDetails.Inputs { - inputBox = append(inputBox, widget.NewHBox( - copyAbleText(txDetails.Inputs[i].PreviousOutpoint, true), - copyAbleText(txDetails.Inputs[i].AccountName, false), - copyAbleText(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), false), - )) - } - txInput.NewTable(inputTableColumnLabels, inputBox...) - - var txOutput widgets.Table - outputTableColumnLabels := widget.NewHBox( - widget.NewLabelWithStyle("Address", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Value", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) - - var outputBox []*widget.Box - for i := range txDetails.Outputs { - outputBox = append(outputBox, widget.NewHBox( - copyAbleText(txDetails.Outputs[i].AccountName, false), - copyAbleText(txDetails.Outputs[i].Address, true), - copyAbleText(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), false), - copyAbleText(txDetails.Outputs[i].ScriptType, false), - )) - } - txOutput.NewTable(outputTableColumnLabels, outputBox...) - - txDetailsData := widget.NewVBox( - widgets.NewHSpacer(10), - tableData, - widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), - txInput.Result, - widgets.NewVSpacer(10), - widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), - txOutput.Result, - widgets.NewHSpacer(10), - ) - - txDetailsScrollContainer := widget.NewScrollContainer(txDetailsData) - - txDetailsOutput := widget.NewVBox( - widgets.NewHSpacer(10), - widget.NewHBox( - txDetailslabel, - widgets.NewHSpacer(150), - messageLabel, - layout.NewSpacer(), - minimizeIcon, - widgets.NewHSpacer(30), - ), - widgets.NewHSpacer(10), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer), - widgets.NewHSpacer(10), - ) - - txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), - AppInterface.window.Canvas()) - txDetailsPopUp.Show() -} - -func txFilterDropDown(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) (*widgets.ClickableBox, string) { - var txTable widgets.Table - - var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} - var allTxFilters = map[string]int32{ - "All": dcrlibwallet.TxFilterAll, - "Sent": dcrlibwallet.TxFilterSent, - "Received": dcrlibwallet.TxFilterReceived, - "Transferred": dcrlibwallet.TxFilterTransferred, - "Coinbase": dcrlibwallet.TxFilterCoinBase, - "Staking": dcrlibwallet.TxFilterStaking, - } - - txCountForFilter, err := wallet.CountTransactions(allTxFilters["All"]) - if err != nil { - errorMessage := fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter All: %s", err.Error()) - return nil, errorMessage - } - txHistory.allTxCount = txCountForFilter - - selectedTxFilterLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) - - var txFilterSelectionPopup *widget.PopUp - txFilterListWidget := widget.NewVBox() - for _, filterName := range allTxFilterNames { - filterId := allTxFilters[filterName] - txCountForFilter, err := wallet.CountTransactions(filterId) - if err != nil { - errorMessage := fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter %s: %s", - filterName, err.Error()) - return nil, errorMessage - } - - if txCountForFilter > 0 { - filter := fmt.Sprintf("%s (%d)", filterName, txCountForFilter) - txFilterView := widget.NewHBox( - widgets.NewHSpacer(5), - widget.NewLabel(filter), - widgets.NewHSpacer(5), - ) - - txFilterListWidget.Append(widgets.NewClickableBox(txFilterView, func() { - selectedFilterName := strings.Split(filter, " ")[0] - selectedFilterId := allTxFilters[selectedFilterName] - if allTxCountForSelectedTx, err := wallet.CountTransactions(selectedFilterId); err == nil { - txHistory.allTxCount = allTxCountForSelectedTx - } - - if selectedFilterId != txHistory.selectedFilterId { - selectedTxFilterLabel.SetText(filter) - txTableHeader(wallet, &txTable, window) - txHistory.txTable.Result.Children = txTable.Result.Children - fetchTx(&txTable, 0, selectedFilterId, wallet, window, false, tabmenu) - widget.Refresh(txHistory.txTable.Result) - } - - txFilterSelectionPopup.Hide() - })) - } - } - - // txFilterSelectionPopup create a popup that has tx filter name and tx count - txFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txFilterListWidget), window.Canvas()) - txFilterSelectionPopup.Hide() - - icons, err := assets.GetIcons(assets.CollapseIcon) - if err != nil { - errorMessage := fmt.Sprintf("Error: %s", err.Error()) - return nil, errorMessage - } - - txFilterTab := widget.NewHBox( - selectedTxFilterLabel, - widgets.NewHSpacer(60), - widget.NewIcon(icons[assets.CollapseIcon]), - ) - - var txFilterDropDown *widgets.ClickableBox - txFilterDropDown = widgets.NewClickableBox(txFilterTab, func() { - txFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( - txFilterDropDown).Add(fyne.NewPos(0, txFilterDropDown.Size().Height))) - txFilterSelectionPopup.Show() - }) - - return txFilterDropDown, "" -} - -func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, window fyne.Window) { +func txTableHeader(wallet *dcrlibwallet.MultiWallet, txTable *widgets.Table, window fyne.Window) { tableHeading := widget.NewHBox( widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -652,14 +264,14 @@ func txTableHeader(wallet *dcrlibwallet.LibWallet, txTable *widgets.Table, windo return } -func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwallet.LibWallet, window fyne.Window, prepend bool, tabmenu *widget.TabContainer) { +func fetchTx(txTable *widgets.Table, txOffset, filter int32, multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer, prepend bool) { if filter != txHistory.selectedFilterId { txOffset = 0 txHistory.TotalTxFetched = 0 txHistory.selectedFilterId = filter } - txns, err := wallet.GetTransactionsRaw(txOffset, txPerPage, filter) + txns, err := multiWallet.WalletWithID(txHistory.selectedWalletID).GetTransactionsRaw(txOffset, txPerPage, filter, txHistory.selectedtxSort) if err != nil { errorHandler(fmt.Sprintf("Error getting transaction for Filter: %s", err.Error()), txHistory.errorLabel) txHistory.txTable.Container.Hide() @@ -676,7 +288,7 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle var txBox []*widget.Box for _, tx := range txns { status := "Pending" - confirmations := wallet.GetBestBlock() - tx.BlockHeight + 1 + confirmations := multiWallet.WalletWithID(txHistory.selectedWalletID).GetBestBlock() - tx.BlockHeight + 1 if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { status = "Confirmed" } @@ -691,7 +303,7 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignCenter, fyne.TextStyle{Italic: true})), func() { - fetchTxDetails(txForTrimmedHash, wallet, window, txHistory.errorLabel, tabmenu) + fetchTxDetails(txForTrimmedHash, multiWallet, window, txHistory.errorLabel, tabMenu) }), )) } @@ -707,13 +319,13 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, wallet *dcrlibwalle widget.Refresh(txHistory.txTable.Container) time.AfterFunc(time.Second*8, func() { - updateTable(wallet, window, tabmenu) + updateTable(multiWallet, window, tabMenu) }) txHistory.errorLabel.Hide() } -func updateTable(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *widget.TabContainer) { +func updateTable(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer) { size := txHistory.txTable.Container.Content.Size().Height - txHistory.txTable.Container.Size().Height scrollPosition := float64(txHistory.txTable.Container.Offset.Y) / float64(size) txTableRowCount := txHistory.txTable.NumberOfColumns() @@ -722,12 +334,12 @@ func updateTable(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *wi if txHistory.txTable.Container.Offset.Y == 0 { time.AfterFunc(time.Second*8, func() { - updateTable(wallet, window, tabmenu) + updateTable(multiWallet, window, tabMenu) }) } else if scrollPosition < 0.5 { if txHistory.TotalTxFetched <= txPerPage { time.AfterFunc(time.Second*8, func() { - updateTable(wallet, window, tabmenu) + updateTable(multiWallet, window, tabMenu) }) } if txTableRowCount <= int(txPerPage) { @@ -736,9 +348,9 @@ func updateTable(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *wi txHistory.TotalTxFetched -= int32(txPerPage) - fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, wallet, window, true, tabmenu) + fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, multiWallet, window, tabMenu, true) } else if scrollPosition >= 0.5 { - fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, wallet, window, false, tabmenu) + fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, multiWallet, window, tabMenu, false) if txTableRowCount > 12 { txHistory.txTable.Delete(0, txTableRowCount-int(txPerPage)) } @@ -746,11 +358,11 @@ func updateTable(wallet *dcrlibwallet.LibWallet, window fyne.Window, tabmenu *wi } } -func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Window, errorLabel *widget.Label, tabmenu *widget.TabContainer) { +func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, errorLabel *widget.Label, tabMenu *widget.TabContainer) { messageLabel := widget.NewLabelWithStyle("Fetching data..", fyne.TextAlignCenter, fyne.TextStyle{}) if messageLabel.Hidden == false { time.AfterFunc(time.Millisecond*300, func() { - if tabmenu.CurrentTabIndex() == 1 { + if tabMenu.CurrentTabIndex() == 1 { messageLabel.Hide() } }) @@ -760,7 +372,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win txDetailslabel := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - minimizeIcon := widgets.NewClickableIcon(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) + minimizeIcon := widgets.NewImageButton(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) errorMessageLabel := widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) txDetailsErrorMethod := func() { @@ -788,7 +400,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win return } - txDetails, err := wallet.GetTransactionRaw(chainHash[:]) + txDetails, err := multiWallet.WalletWithID(txHistory.selectedWalletID).GetTransactionRaw(chainHash[:]) if err != nil { errorHandler(fmt.Sprintf("Error fetching transaction details for \n %s \n %s ", hash, err.Error()), errorMessageLabel) txDetailsErrorMethod() @@ -797,11 +409,11 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win var confirmations int32 = 0 if txDetails.BlockHeight != -1 { - confirmations = wallet.GetBestBlock() - txDetails.BlockHeight + 1 + confirmations = multiWallet.WalletWithID(txHistory.selectedWalletID).GetBestBlock() - txDetails.BlockHeight + 1 } var status string - var spendUnconfirmed = wallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey) + var spendUnconfirmed = multiWallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey, true) if spendUnconfirmed || confirmations > dcrlibwallet.DefaultRequiredConfirmations { status = "Confirmed" } else { @@ -832,7 +444,7 @@ func fetchTxDetails(hash string, wallet *dcrlibwallet.LibWallet, window fyne.Win if messageLabel.Hidden == false { time.AfterFunc(time.Second*2, func() { - if tabmenu.CurrentTabIndex() == 1 { + if tabMenu.CurrentTabIndex() == 1 { messageLabel.Hide() } }) diff --git a/fyne/widgets/overviewBox.go b/fyne/widgets/overviewBox.go index 418f16c5d..30902cc0a 100644 --- a/fyne/widgets/overviewBox.go +++ b/fyne/widgets/overviewBox.go @@ -11,7 +11,7 @@ type overviewBox struct { *widget.Box position fyne.Position - size fyne.Size + size fyne.Size } type overviewBoxRenderer struct { @@ -19,26 +19,26 @@ type overviewBoxRenderer struct { box *overviewBox } -func (b *overviewBox) CreateRenderer () fyne.WidgetRenderer { +func (b *overviewBox) CreateRenderer() fyne.WidgetRenderer { var objects []fyne.CanvasObject objects = append(objects, b.Box) return &overviewBoxRenderer{objects: objects, box: b} } -func (r *overviewBoxRenderer) MinSize () fyne.Size { - return fyne.NewSize(theme.Padding()*2 + 300, theme.Padding()*2 + 150) +func (r *overviewBoxRenderer) MinSize() fyne.Size { + return fyne.NewSize(theme.Padding()*2+300, theme.Padding()*2+150) } -func (r *overviewBoxRenderer) ApplyTheme () { +func (r *overviewBoxRenderer) ApplyTheme() { } -func (r *overviewBoxRenderer) Layout (size fyne.Size) { +func (r *overviewBoxRenderer) Layout(size fyne.Size) { } -func (r *overviewBoxRenderer) BackgroundColor () color.Color { +func (r *overviewBoxRenderer) BackgroundColor() color.Color { return color.RGBA{242, 241, 239, 1} } @@ -53,7 +53,7 @@ func (r *overviewBoxRenderer) Objects() []fyne.CanvasObject { func (r *overviewBoxRenderer) Destroy() { } -func (b *overviewBox) Size () fyne.Size { +func (b *overviewBox) Size() fyne.Size { return b.size } @@ -93,4 +93,4 @@ func NewOverviewBox(children ...fyne.CanvasObject) *overviewBox { box := &overviewBox{Box: widget.NewVBox(children...)} widget.Renderer(box).Layout(box.MinSize()) return box -} \ No newline at end of file +} diff --git a/go.mod b/go.mod index 59873f51e..21bfce6a5 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,11 @@ replace ( ) require ( +<<<<<<< HEAD github.com/raedahgroup/godcr/app v0.0.0-20191104184142-723795cee288 // indirect github.com/raedahgroup/godcr/cmd/godcr-fyne v0.0.0-00010101000000-000000000000 // indirect +======= + github.com/raedahgroup/godcr/cmd/godcr-fyne v0.0.0-00010101000000-000000000000 // indirect + github.com/raedahgroup/godcr/fyne v0.0.0-00010101000000-000000000000 // indirect +>>>>>>> implemented multiwallet feature ) diff --git a/go.sum b/go.sum new file mode 100644 index 000000000..4f07ff74f --- /dev/null +++ b/go.sum @@ -0,0 +1,341 @@ +fyne.io/fyne v1.1.3-0.20191104221827-e8f6795efa08 h1:io8pkG6pP1FjpSDoj+OMowNPylACUqWc+Cwc7DHFmZs= +fyne.io/fyne v1.1.3-0.20191104221827-e8f6795efa08/go.mod h1:QKalFvMg5T4bJYGoygqrz662GbMymGEGR5gDqcoO9CM= +github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9 h1:HD8gA2tkByhMAwYaFAX9w2l7vxvBQ5NMoxDrkhqhtn4= +github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/DataDog/zstd v1.3.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= +github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9/go.mod h1:7uhhqiBaR4CpN0k9rMjOtjpcfGd6DG2m04zQxKnWQ0I= +github.com/Sereal/Sereal v0.0.0-20181211220259-509a78ddbda3/go.mod h1:D0JMgToj/WdxCgd30Kc1UcA9E+WdZoJqeVOuYW7iTBM= +github.com/aead/siphash v0.0.0-20170329201724-e404fcfc8885/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= +github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= +github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= +github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/asdine/storm v0.0.0-20190216191021-fe89819f6282 h1:DmSVc81daQAPvXwcCZi0W6A14sTCYQ1QI21C0E37KoY= +github.com/asdine/storm v0.0.0-20190216191021-fe89819f6282/go.mod h1:cMLKpjHSP4q0P133fV15ojQgwWWB2IMv+hrFsmBF/wI= +github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= +github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= +github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw= +github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= +github.com/btcsuite/goleveldb v1.0.0 h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4= +github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= +github.com/btcsuite/snappy-go v1.0.0 h1:ZxaA6lo2EpxGddsA8JwWOcxlzRybb444sgmeJQMJGQE= +github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dchest/blake256 v1.0.0 h1:6gUgI5MHdz9g0TdrgKqXsoDX+Zjxmm1Sc6OsoGru50I= +github.com/dchest/blake256 v1.0.0/go.mod h1:xXNWCE1jsAP8DAjP+rKw2MbeqLczjI3TRx2VK+9OEYY= +github.com/dchest/siphash v1.2.0/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4= +github.com/dchest/siphash v1.2.1 h1:4cLinnzVJDKxTCl9B01807Yiy+W7ZzVHj/KIroQRvT4= +github.com/dchest/siphash v1.2.1/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4= +github.com/decred/base58 v1.0.0 h1:BVi1FQCThIjZ0ehG+I99NJ51o0xcc9A/fDKhmJxY6+w= +github.com/decred/base58 v1.0.0/go.mod h1:LLY1p5e3g91byL/UO1eiZaYd+uRoVRarybgcoymu9Ks= +github.com/decred/dcrd/addrmgr v1.0.2 h1:BfJoFEkdDDhaQSsx9NkVOTiOTUbEevbVf+aYRQSIAmU= +github.com/decred/dcrd/addrmgr v1.0.2/go.mod h1:gNnmTuf/Xkg8ZX3j5GXbajzPrSdf5bA7HitO2bjmq0Q= +github.com/decred/dcrd/blockchain v1.0.0/go.mod h1:nNMgOz12wlasmEJDCuSuMWYSnjDdmB4l38GKuQ/Yd+8= +github.com/decred/dcrd/blockchain v1.0.1/go.mod h1:R/4XnwNOTj5IP8jQIUzrJ8zhr/7EOk09IMODwBamZoI= +github.com/decred/dcrd/blockchain v1.0.2/go.mod h1:R/4XnwNOTj5IP8jQIUzrJ8zhr/7EOk09IMODwBamZoI= +github.com/decred/dcrd/blockchain v1.1.1 h1:CWr90sZ2YLQz84EGT+X/pzU+9AZB1eXQUy+4fsJSt5w= +github.com/decred/dcrd/blockchain v1.1.1/go.mod h1:zxi/41LgzHitpz/CZu0gxHyFHz8+ysd3lH8E3P5Uifg= +github.com/decred/dcrd/blockchain/stake v1.0.0/go.mod h1:opuzF8UouYyQyRJVF00Rdd7OgWb1WKyy1pyU0QYaxz0= +github.com/decred/dcrd/blockchain/stake v1.0.1/go.mod h1:hgoGmWMIu2LLApBbcguVpzCEEfX7M2YhuMrQdpohJzc= +github.com/decred/dcrd/blockchain/stake v1.0.2/go.mod h1:hgoGmWMIu2LLApBbcguVpzCEEfX7M2YhuMrQdpohJzc= +github.com/decred/dcrd/blockchain/stake v1.1.0 h1:kCxZdQ2/UfcD+XjE3wlCv0vLKWR9ZFtjbbTTpudb74o= +github.com/decred/dcrd/blockchain/stake v1.1.0/go.mod h1:WRuaml4bcyZYza1NT3qizlLcQwMIcAQRENvZVb2t884= +github.com/decred/dcrd/certgen v1.0.1/go.mod h1:NxEyGwzPHak+h3tNLYAXU4vWuL98HrY9Z59hc1E3SGI= +github.com/decred/dcrd/chaincfg v1.0.1/go.mod h1:O+443mQNPjci+WqWkKta3v2MgJn2u20YWy5mW3c2T7M= +github.com/decred/dcrd/chaincfg v1.1.1/go.mod h1:UlGtnp8Xx9YK+etBTybGjoFGoGXSw2bxZQuAnwfKv6I= +github.com/decred/dcrd/chaincfg v1.2.0/go.mod h1:kpoGTMIriKn5hHRSu5b65+Q9LlGUdbQcMzGujac1BVs= +github.com/decred/dcrd/chaincfg v1.3.0/go.mod h1:kpoGTMIriKn5hHRSu5b65+Q9LlGUdbQcMzGujac1BVs= +github.com/decred/dcrd/chaincfg v1.4.0/go.mod h1:ypuM30F+XgZmZTFfAkWHWd0lwwkWWAOAQYNRkRDlYLc= +github.com/decred/dcrd/chaincfg v1.5.1 h1:u1Xbq0VTnAXIHW5ECqrWe0VYSgf5vWHqpSiwoLBzxAQ= +github.com/decred/dcrd/chaincfg v1.5.1/go.mod h1:FukMzTjkwzjPU+hK7CqDMQe3NMbSZAYU5PAcsx1wlv0= +github.com/decred/dcrd/chaincfg/chainhash v1.0.1 h1:0vG7U9+dSjSCaHQKdoSKURK2pOb47+b+8FK5q4+Je7M= +github.com/decred/dcrd/chaincfg/chainhash v1.0.1/go.mod h1:OVfvaOsNLS/A1y4Eod0Ip/Lf8qga7VXCQjUQLbkY0Go= +github.com/decred/dcrd/chaincfg/v2 v2.0.2 h1:VeGY52lHuYT01tIGbvYj+OO0GaGxGaJmnh+4vGca1+U= +github.com/decred/dcrd/chaincfg/v2 v2.0.2/go.mod h1:hpKvhLCDAD/xDZ3V1Pqpv9fIKVYYi11DyxETguazyvg= +github.com/decred/dcrd/connmgr v1.0.1/go.mod h1:jR+woh3BTbP/35v0nHMiz6GfV1RO0uF1JA+mKeXNk04= +github.com/decred/dcrd/connmgr v1.0.2 h1:ipHJBV9fmhLi8ZZCtsNpG+kLY2c+yu59/8oOkA8BNJY= +github.com/decred/dcrd/connmgr v1.0.2/go.mod h1:jBNfQLh+454n3crgNCPrhMgZ9mVvYcMbWSCEAHsJQus= +github.com/decred/dcrd/database v1.0.0/go.mod h1:eQOhTdO3oYBshjCVxMt747CP6yKKIls6IIdqYxMRzEk= +github.com/decred/dcrd/database v1.0.1/go.mod h1:ILCeyOHFew3fZ7K2B9jl+tp5qFOap/pEGoo6Yy6Wk0g= +github.com/decred/dcrd/database v1.0.2/go.mod h1:ILCeyOHFew3fZ7K2B9jl+tp5qFOap/pEGoo6Yy6Wk0g= +github.com/decred/dcrd/database v1.0.3 h1:e5Q3gDt9LwfvpZxYqFF3OVzgr8bGeC1cen+V3mv/CCw= +github.com/decred/dcrd/database v1.0.3/go.mod h1:TLxRwIV8x85+dxPTLAWu4mHg45TkKrrza5xzwOS1QtA= +github.com/decred/dcrd/dcrec v0.0.0-20180721005212-59fe2b293f69/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= +github.com/decred/dcrd/dcrec v0.0.0-20180721005914-d26200ec716b/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= +github.com/decred/dcrd/dcrec v0.0.0-20180721031028-5369a485acf6/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= +github.com/decred/dcrd/dcrec v0.0.0-20180801202239-0761de129164/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= +github.com/decred/dcrd/dcrec v0.0.0-20180809193022-9536f0c88fa8/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= +github.com/decred/dcrd/dcrec v0.0.0-20180816212643-20eda7ec9229/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= +github.com/decred/dcrd/dcrec v0.0.0-20181212181811-1a370d38d671/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= +github.com/decred/dcrd/dcrec v0.0.0-20190130161649-59ed4247a1d5/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= +github.com/decred/dcrd/dcrec v0.0.0-20190402182842-879eebce3333/go.mod h1:HIaqbEJQ+PDzQcORxnqen5/V1FR3B4VpIfmePklt8Q8= +github.com/decred/dcrd/dcrec v1.0.0 h1:W+z6Es+Rai3MXYVoPAxYr5U1DGis0Co33scJ6uH2J6o= +github.com/decred/dcrd/dcrec v1.0.0/go.mod h1:HIaqbEJQ+PDzQcORxnqen5/V1FR3B4VpIfmePklt8Q8= +github.com/decred/dcrd/dcrec/edwards v0.0.0-20180721005212-59fe2b293f69/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= +github.com/decred/dcrd/dcrec/edwards v0.0.0-20180721031028-5369a485acf6/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= +github.com/decred/dcrd/dcrec/edwards v0.0.0-20180809193022-9536f0c88fa8/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= +github.com/decred/dcrd/dcrec/edwards v0.0.0-20180816212643-20eda7ec9229/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= +github.com/decred/dcrd/dcrec/edwards v0.0.0-20181208004914-a0816cf4301f/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= +github.com/decred/dcrd/dcrec/edwards v0.0.0-20190130161649-59ed4247a1d5/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= +github.com/decred/dcrd/dcrec/edwards v0.0.0-20190402182842-879eebce3333/go.mod h1:HblVh1OfMt7xSxUL1ufjToaEvpbjpWvvTAUx4yem8BI= +github.com/decred/dcrd/dcrec/edwards v1.0.0 h1:UDcPNzclKiJlWqV3x1Fl8xMCJrolo4PB4X9t8LwKDWU= +github.com/decred/dcrd/dcrec/edwards v1.0.0/go.mod h1:HblVh1OfMt7xSxUL1ufjToaEvpbjpWvvTAUx4yem8BI= +github.com/decred/dcrd/dcrec/secp256k1 v1.0.0/go.mod h1:JPMFscGlgXTV684jxQNDijae2qrh0fLG7pJBimaYotE= +github.com/decred/dcrd/dcrec/secp256k1 v1.0.1/go.mod h1:lhu4eZFSfTJWUnR3CFRcpD+Vta0KUAqnhTsTksHXgy0= +github.com/decred/dcrd/dcrec/secp256k1 v1.0.2 h1:awk7sYJ4pGWmtkiGHFfctztJjHMKGLV8jctGQhAbKe0= +github.com/decred/dcrd/dcrec/secp256k1 v1.0.2/go.mod h1:CHTUIVfmDDd0KFVFpNX1pFVCBUegxW387nN0IGwNKR0= +github.com/decred/dcrd/dcrjson v1.0.0/go.mod h1:ozddIaeF+EAvZZvFuB3zpfxhyxBGfvbt22crQh+PYuI= +github.com/decred/dcrd/dcrjson v1.1.0 h1:pFpbay3cWACkgloFxWjHBwlXWG2+S2QCJJzNxL40hwg= +github.com/decred/dcrd/dcrjson v1.1.0/go.mod h1:ozddIaeF+EAvZZvFuB3zpfxhyxBGfvbt22crQh+PYuI= +github.com/decred/dcrd/dcrjson/v2 v2.0.0 h1:W0q4Alh36c5N318eUpfmU8kXoCNgImMLI87NIXni9Us= +github.com/decred/dcrd/dcrjson/v2 v2.0.0/go.mod h1:FYueNy8BREAFq04YNEwcTsmGFcNqY+ehUUO81w2igi4= +github.com/decred/dcrd/dcrutil v1.0.0/go.mod h1:CBpbItyMKkL/4i1qPJDsE/cdSYklsWFcTYgprRZh4yk= +github.com/decred/dcrd/dcrutil v1.1.1/go.mod h1:Jsttr0pEvzPAw+qay1kS1/PsbZYPyhluiNwwY6yBJS4= +github.com/decred/dcrd/dcrutil v1.2.0/go.mod h1:tUNHS2gj7ApeEVS8gb6O+4wJW7w3O2MSRyRdcjW1JxU= +github.com/decred/dcrd/dcrutil v1.4.0 h1:xD5aUqysGQnsnP1c9J0kGeW8lDIwFGC3ja/gE3HnpCs= +github.com/decred/dcrd/dcrutil v1.4.0/go.mod h1:Bs74gm1jQ9ZAbmEh9FWOEZ1HQzlMg5iPATDMzMnCMlQ= +github.com/decred/dcrd/dcrutil/v2 v2.0.0 h1:HTqn2tZ8eqBF4y3hJwjyKBmJt16y7/HjzpE82E/crhY= +github.com/decred/dcrd/dcrutil/v2 v2.0.0/go.mod h1:gUshVAXpd51DlcEhr51QfWL2HJGkMDM1U8chY+9VvQg= +github.com/decred/dcrd/gcs v1.0.0/go.mod h1:5uHIPAzn4SdGP2/FhVBK2YdAoKmufds3ZI8yNzojUCM= +github.com/decred/dcrd/gcs v1.0.1/go.mod h1:YwutGzusSdJM79CJtxCo9t7WRCvnkLtWSD19TPo1i9g= +github.com/decred/dcrd/gcs v1.0.2 h1:wZjxeC9WPBoRApaAQpBrzvN9NA0iS2KWrTJa9IiDgc8= +github.com/decred/dcrd/gcs v1.0.2/go.mod h1:eLCvrzUsWro48TlTyrmFcZAZqnllYFz0vEv5VZtufF4= +github.com/decred/dcrd/hdkeychain v1.1.0/go.mod h1:zyUZtZ3PdnTPHt2XUr1x76b8ZuiM+9aVkP8Rq8Scp1k= +github.com/decred/dcrd/hdkeychain v1.1.1 h1:6+BwOmPfEyw/Krm+91RXysc76F1jqCta3m45DyD5+s4= +github.com/decred/dcrd/hdkeychain v1.1.1/go.mod h1:CLBVXLoO63fIiqkv38KR23zXGSgrfiAWOybOKTneLhA= +github.com/decred/dcrd/mempool v1.0.1/go.mod h1:r+/DGiiluXi1EyMCCPPH58Qu+rsr8nZv0DialAG5VZQ= +github.com/decred/dcrd/mempool v1.1.1 h1:ysFIS3HzEIJ88B1Y4OfL6wjzBurlChbKkzq54hPglGo= +github.com/decred/dcrd/mempool v1.1.1/go.mod h1:u1I2KRv9UHhx2crlbZXYoLDabWyQ8VnnHDSG53UdhCA= +github.com/decred/dcrd/mining v1.0.0/go.mod h1:VA5H4zhJgXb8LK5lqM5H58dhMRXJRcaQQoX3G8QRpP8= +github.com/decred/dcrd/mining v1.0.1/go.mod h1:+CSOLPi7TM8OlQg7mJ7XzWLXCDb4nHK8R6cvXOzhEoU= +github.com/decred/dcrd/mining v1.1.0 h1:9Wtla+i+pEjfYsNCfixsipmyyoB26DgL4LSXWAin/zw= +github.com/decred/dcrd/mining v1.1.0/go.mod h1:NQEtX604XgNwKcPFId1hVTTiBqmVQDlnqV1yNqGl4oU= +github.com/decred/dcrd/rpcclient v1.0.1/go.mod h1:tApXK3wwrAQtz7lcXeeqBwuktUZesvrFfvhAdedYqdM= +github.com/decred/dcrd/rpcclient v1.1.0 h1:nQZ1qOJaLYoOTM1oQ2dLaqocb5TWI7gNBK+BTY7UVXk= +github.com/decred/dcrd/rpcclient v1.1.0/go.mod h1:SCwBs4d+aqRV2ChnriIZ1y/LgNVHG/2ieEC1vIop82s= +github.com/decred/dcrd/rpcclient/v2 v2.0.0 h1:Zy9twdEaOGUdCj/89LAs/IrStm6FcabxzBve4UsA73A= +github.com/decred/dcrd/rpcclient/v2 v2.0.0/go.mod h1:9XjbRHBSNqN+DXz8I47gUZszvVjvugqLGK8TZQ4c/u0= +github.com/decred/dcrd/txscript v1.0.0/go.mod h1:9byvrOaBSBVVnDG7Cm0JgN8bZytl1oi9Ba245VBeI18= +github.com/decred/dcrd/txscript v1.0.1/go.mod h1:FqUX07Y+u3cJ1eIGPoyWbJg+Wk1NTllln/TyDpx9KnY= +github.com/decred/dcrd/txscript v1.0.2/go.mod h1:hmUOHFlOjU7H6T/czt6kurWwXJvGPGKKGtXoft6w/qY= +github.com/decred/dcrd/txscript v1.0.3-0.20190402182842-879eebce3333 h1:nsk8gnezIxeC4Dboj/VE9Epe1ItlAhUxAvOliRRtfec= +github.com/decred/dcrd/txscript v1.0.3-0.20190402182842-879eebce3333/go.mod h1:OhSIXbXdGDRNtkzW7Pil22tj+fcqpUp8r/E4LAz1yoQ= +github.com/decred/dcrd/wire v1.0.1/go.mod h1:zpKZnBiN59CrzfXFigwgXmUDVYf34OLbEr8xwAwriHc= +github.com/decred/dcrd/wire v1.1.0/go.mod h1:/JKOsLInOJu6InN+/zH5AyCq3YDIOW/EqcffvU8fJHM= +github.com/decred/dcrd/wire v1.2.0 h1:HqJVB7vcklIguzFWgRXw/WYCQ9cD3bUC5TKj53i1Hng= +github.com/decred/dcrd/wire v1.2.0/go.mod h1:/JKOsLInOJu6InN+/zH5AyCq3YDIOW/EqcffvU8fJHM= +github.com/decred/dcrdata/semver v1.0.0/go.mod h1:z+nQqiAd9fYkHhBLbejysZ2FPHtgkrErWDgMf+JlZWE= +github.com/decred/dcrdata/txhelpers v1.1.0 h1:xKK+1/OASkSxMe/KDLaLJeJjJdopgC+FV8+EFPpJAGk= +github.com/decred/dcrdata/txhelpers v1.1.0/go.mod h1:IyxuqUxIPrHnOmRy9DCl90oqw7FxYHde/fkIkF21B7w= +github.com/decred/dcrwallet v1.2.2 h1:NdI13wxP+OsWKXPqjWQQ9VSGAl4VoSLBfAunzFreeJg= +github.com/decred/dcrwallet v1.2.2/go.mod h1:BrSus0F+Rx8UhvPNBfuRMIjRJBNrW2sLspN9iQR5hm8= +github.com/decred/dcrwallet/chain v1.0.0/go.mod h1:KpZFaKlKajfUZt36+RmBn2HKwTbwoa3yt9HPALqlShI= +github.com/decred/dcrwallet/chain v1.1.1 h1:YUJ1ArUaN/WuMnTP1PvfirNaqIQO9+UUNDifhnJ8QQQ= +github.com/decred/dcrwallet/chain v1.1.1/go.mod h1:2kA82rBDkCKOSYFV+Q14RZNCuYwdaQ9uO/c+RixqRNs= +github.com/decred/dcrwallet/deployments v1.0.0/go.mod h1:0bWER/DAYoGbzkWzbUf6k2agW4YkSyvNLZDhBGThz/4= +github.com/decred/dcrwallet/deployments v1.1.0 h1:83arg+7ct7PS1H2IYhuePnrBK2rkVpEYWKqrJpCwtHA= +github.com/decred/dcrwallet/deployments v1.1.0/go.mod h1:8Sasryu8SX23Jvqr6maZ7MoS7wFIGXupWzbsVtcZsUg= +github.com/decred/dcrwallet/errors v1.0.0/go.mod h1:XUm95dWmm9XmQGvneBXJkkIaFeRsQVBB6ni/KTy1hrY= +github.com/decred/dcrwallet/errors v1.0.1 h1:8EF7IY6twRlo9sqWaSfm8abfi2/rHZ1wacOiGvBy+bM= +github.com/decred/dcrwallet/errors v1.0.1/go.mod h1:XUm95dWmm9XmQGvneBXJkkIaFeRsQVBB6ni/KTy1hrY= +github.com/decred/dcrwallet/internal/helpers v1.0.0/go.mod h1:FsihtjCyFrGL6gdmkxBWTYQ1CUgbfM9tyinYNOzLnlk= +github.com/decred/dcrwallet/internal/helpers v1.0.1 h1:oEqfJPs1uI7QI0Aejx2MUWq/yD609cc9Z8P7vQ6cDz8= +github.com/decred/dcrwallet/internal/helpers v1.0.1/go.mod h1:qIXcze8VZ+A3sEgZou7PTOe4Vsnmks54SGTSGZ6084g= +github.com/decred/dcrwallet/internal/zero v1.0.0/go.mod h1:vULuNLRTcnifKCepcIxUDL4jrR3rJOwVR9UDH89Qpms= +github.com/decred/dcrwallet/internal/zero v1.0.1 h1:hO7orPk13AFp7pFTL739CbVLKImSNorI2J9/tiucNQY= +github.com/decred/dcrwallet/internal/zero v1.0.1/go.mod h1:mXUIsKATE1pIaNAJQ4lhSTX6c9N5sYoSrlScgRCaMJs= +github.com/decred/dcrwallet/lru v1.0.0 h1:vz71/Wa2890CUQeWsOTI6u6iGGfXGAhIQ/hnqMUh6Xc= +github.com/decred/dcrwallet/lru v1.0.0/go.mod h1:jEty7mdT5VaaV06DEV2Avv0R3HpGvUwvDW4lw8ECtiY= +github.com/decred/dcrwallet/p2p v1.0.0/go.mod h1:b1CLZAkl/K5dr5I5B4SdFT8FrE11jSkfA4VAA862ACA= +github.com/decred/dcrwallet/p2p v1.0.1 h1:UTsD5I8YtWVf2SEg0mSd5+hIlp7Ihj3rS2PZ9P5cXVI= +github.com/decred/dcrwallet/p2p v1.0.1/go.mod h1:FsoAR0cBOLW3VKMg+Tdx+wdSezR7g8NGOdz4fx6gtpM= +github.com/decred/dcrwallet/pgpwordlist v1.0.0 h1:H7Y3+yRZq7PXMPfpKLMnY5TKTjTWhc0oJmyN7v8tC/M= +github.com/decred/dcrwallet/pgpwordlist v1.0.0/go.mod h1:Fek3uYn+9DnEFIreA/8PnTIXUl2lBO64JpEBkL9BXtk= +github.com/decred/dcrwallet/rpc/jsonrpc/types v1.0.0 h1:FPVohgxZHHwi7qTOBki/Dw9j5cgGsZYiktGSfgqHR0w= +github.com/decred/dcrwallet/rpc/jsonrpc/types v1.0.0/go.mod h1:k+IOPnUY0YqlwhSDhczzaUN17NX/gMtztwl3UxKgVZY= +github.com/decred/dcrwallet/rpc/walletrpc v0.1.0/go.mod h1:Zp1ZFTCUo7S6MJvUyS5tYfaDUxGAMHkZ+vbsLgAdd4A= +github.com/decred/dcrwallet/spv v1.0.0/go.mod h1:lz39nz9P/HVoxYa4XAT6ithyR3WgdF0oVu4jtFwnCxE= +github.com/decred/dcrwallet/spv v1.1.1 h1:G5yXkoiO4LOh3Ba+qvyUIjF2dChOXpiuRCPpjYzzhZw= +github.com/decred/dcrwallet/spv v1.1.1/go.mod h1:HYfF+A1F+Apf0WPT6QRsG/gfvaFQmWObAytq8pWc6ME= +github.com/decred/dcrwallet/ticketbuyer v1.0.0/go.mod h1:mrAlRjOJ6txO8Zyqo5koxVOMEYLK2POUX35a/QcKN8g= +github.com/decred/dcrwallet/ticketbuyer v1.0.2 h1:vEcUSwCGZolg8fxSJ8+mW2XCdZ6J9LtwxCxRPdcpbQk= +github.com/decred/dcrwallet/ticketbuyer v1.0.2/go.mod h1:oDHY0TOFIaQjZ11TJbgztC5tt1zi6wKoRmyQMmwfft4= +github.com/decred/dcrwallet/ticketbuyer/v2 v2.0.0/go.mod h1:VKo2PjXAlF/E46tSBKrIgqKbVcHVLfM5ACyOehT1unA= +github.com/decred/dcrwallet/ticketbuyer/v2 v2.0.1 h1:RLCly+fnbrMXzWVi4a4cUU2sGWi56e7UPJq9GHoe1iw= +github.com/decred/dcrwallet/ticketbuyer/v2 v2.0.1/go.mod h1:ngtx8I/+Jo+U+E/5XjwCkmU55wCGtUbaDnCP5qazNGM= +github.com/decred/dcrwallet/validate v1.0.0/go.mod h1:zHIlcrjAWl6LK+X+R7jc3F9wIM/qxjtMjG/mdEwt4tY= +github.com/decred/dcrwallet/validate v1.0.1/go.mod h1:9DCtLFnnTOC/7PKkF7jehvDyHkfUBl41ZbcT1u4PmQM= +github.com/decred/dcrwallet/validate v1.0.2 h1:EXY48b3SOkTGXJAB+OUmilvyFNROZywYIWTGYfUnTDE= +github.com/decred/dcrwallet/validate v1.0.2/go.mod h1:1ur2sRZkQ23ECalUKdwgx6rdIiP8rIiaSQAz1Y9LQsI= +github.com/decred/dcrwallet/version v1.0.0/go.mod h1:rXeMsUaI03WtlQrSol7Q7sJ8HBOB+tZvT7YQRXD5Y7M= +github.com/decred/dcrwallet/version v1.0.1 h1:gAz1lDkcJ+oAbg0tOn/J0KwZBVWIlhWmHhSUi9GbB2E= +github.com/decred/dcrwallet/version v1.0.1/go.mod h1:rXeMsUaI03WtlQrSol7Q7sJ8HBOB+tZvT7YQRXD5Y7M= +github.com/decred/dcrwallet/wallet v1.0.0/go.mod h1:VWRnpNFRiKPo7FUPbzj0t5ElcGxNXMPIa4vGcGe94uM= +github.com/decred/dcrwallet/wallet v1.1.0/go.mod h1:g4OzDG7jpsRqTDP3bHiA0LIEZFx81accYPCkO1DBNT8= +github.com/decred/dcrwallet/wallet v1.2.3 h1:iQErxoEfm13XmgWQ5HKFbHwYjFcNO3jTiuNpZuAvI7A= +github.com/decred/dcrwallet/wallet v1.2.3/go.mod h1:ItOhnw3C4znuLQVWACSq8jCLy221v9X0Xo0b/j5WqgU= +github.com/decred/dcrwallet/walletseed v1.0.0/go.mod h1:xSF6hZW+5Xhm0jJFsI5jQSfViuZUQJoDXa/cQxtgncs= +github.com/decred/dcrwallet/walletseed v1.0.1 h1:gxvlj0GRw+H0VumCxTlEysu+/nltcp9+lgzVgzsnI/Y= +github.com/decred/dcrwallet/walletseed v1.0.1/go.mod h1:ENlwTabC2JVmT4S1eCP44fnwX4+9y2RLsnfSU21CJ+4= +github.com/decred/slog v1.0.0 h1:Dl+W8O6/JH6n2xIFN2p3DNjCmjYwvrXsjlSJTQQ4MhE= +github.com/decred/slog v1.0.0/go.mod h1:zR98rEZHSnbZ4WHZtO0iqmSZjDLKhkXfrPTZQKtAonQ= +github.com/dgraph-io/badger v1.5.4 h1:gVTrpUTbbr/T24uvoCaqY2KSHfNLVGm0w+hbee2HMeg= +github.com/dgraph-io/badger v1.5.4/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ= +github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f h1:dDxpBYafY/GYpcl+LS4Bn3ziLPuEdGRkRjYAbSlWxSA= +github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/gen2brain/beeep v0.0.0-20190719094215-ece0cb67ca77 h1:bvjWrvlA7ddo8+E8X5D+m5jg0GkwTeG6eRJGb6f/rRE= +github.com/gen2brain/beeep v0.0.0-20190719094215-ece0cb67ca77/go.mod h1:GprdPCZglWh5OMcIDpeKBxuUJI+fEDOTVUfxZeda4zo= +github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw= +github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk= +github.com/go-gl/glfw v0.0.0-20181213070059-819e8ce5125f/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/gobuffalo/envy v1.7.0 h1:GlXgaiBkmrYMHco6t4j7SacKO4XUjvh5pwXh0f4uxXU= +github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= +github.com/gobuffalo/logger v1.0.0 h1:xw9Ko9EcC5iAFprrjJ6oZco9UpzS5MQ4jAwghsLHdy4= +github.com/gobuffalo/logger v1.0.0/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= +github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4= +github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= +github.com/gobuffalo/packr/v2 v2.6.0 h1:EMUzJIb5rof6r087PtGmgdzdLKpRBESJ/8jyL9MexfY= +github.com/gobuffalo/packr/v2 v2.6.0/go.mod h1:sgEE1xNZ6G0FNN5xn9pevVu4nywaxHvgup67xisti08= +github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff h1:W71vTCKoxtdXgnm1ECDFkfQnpdqAO00zzGXLA5yaEX8= +github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff/go.mod h1:wfqRWLHRBsRgkp5dmbG56SA0DmVtwrF5N3oPdI8t+Aw= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= +github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jackmordaunt/icns v0.0.0-20181231085925-4f16af745526/go.mod h1:UQkeMHVoNcyXYq9otUupF7/h/2tmHlhrS2zw7ZVvUqc= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= +github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/josephspurrier/goversioninfo v0.0.0-20190124120936-8611f5a5ff3f/go.mod h1:eJTEwMjXb7kZ633hO3Ln9mBUCOjX2+FlTljvpl9SYdE= +github.com/jrick/bitset v1.0.0 h1:Ws0PXV3PwXqWK2n7Vz6idCdrV/9OrBXgHEJi27ZB9Dw= +github.com/jrick/bitset v1.0.0/go.mod h1:ZOYB5Uvkla7wIEY4FEssPVi3IQXa02arznRaYaAEPe4= +github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI= +github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= +github.com/karrick/godirwalk v1.10.12 h1:BqUm+LuJcXjGv1d2mj3gBiQyrQ57a0rYoAmhvJQ7RDU= +github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/pty v1.1.2/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/raedahgroup/dcrlibwallet v1.1.1-0.20190928085114-bcc6e6b7769a h1:BvFVstGjzuNeFsNTmAZCfPxK2u51EGQVAdFKCauqaNE= +github.com/raedahgroup/dcrlibwallet v1.1.1-0.20190928085114-bcc6e6b7769a/go.mod h1:6AGgglq9BB0twJnZnHvfH8hIQrbw6yBJSPp9QI+hBk0= +github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/skip2/go-qrcode v0.0.0-20191027152451-9434209cb086 h1:RYiqpb2ii2Z6J4x0wxK46kvPBbFuZcdhS+CIztmYgZs= +github.com/skip2/go-qrcode v0.0.0-20191027152451-9434209cb086/go.mod h1:PLPIyL7ikehBD1OAjmKKiOEhbvWyHGaNDjquXMcYABo= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/srwiley/oksvg v0.0.0-20190829233741-58e08c8fe40e h1:LJUrNHytcMXWKxnULIHPe5SCb1jDpO9o672VB1x2EuQ= +github.com/srwiley/oksvg v0.0.0-20190829233741-58e08c8fe40e/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4= +github.com/srwiley/rasterx v0.0.0-20181219215540-696f7edb7a7e h1:FFotfUvew9Eg02LYRl8YybAnm0HCwjjfY5JlOI1oB00= +github.com/srwiley/rasterx v0.0.0-20181219215540-696f7edb7a7e/go.mod h1:mvWM0+15UqyrFKqdRjY6LuAVJR0HOVhJlEgZ5JWtSWU= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +go.etcd.io/bbolt v1.3.0 h1:oY10fI923Q5pVCVt1GBTZMn8LHo5M+RCInFpeMnV4QI= +go.etcd.io/bbolt v1.3.0/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +golang.org/x/crypto v0.0.0-20180718160520-a2144134853f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20180808211826-de0752318171/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 h1:1wopBVtVdWnn03fZelqdXTqk7U7zPQCb+T4rbU9ZEoU= +golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 h1:ydJNl0ENAG67pFbB+9tfhiL2pYqLhfoaZFw/cjLhY4A= +golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180808004115-f9ce57c11b24/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190420063019-afa5a82059c6 h1:HdqqaWmYAUI7/dmByKKEw+yxDksGSo+9GjkUc9Zp34E= +golang.org/x/net v0.0.0-20190420063019-afa5a82059c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180810070207-f0d5e33068cb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180816055513-1c9583448a9c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181206074257-70b957f3b65e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181212120007-b05ddf57801d/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190203050204-7ae0202eb74c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190402142545-baf5eb976a8c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb h1:fgwFCsaw9buMuxNd6+DQfAuSFqbNiQZpcgJQAgJsK6k= +golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180808183934-383e8b2c3b9e/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/nuklear/go.sum b/nuklear/go.sum index 9a4a707b3..e17d21e0b 100644 --- a/nuklear/go.sum +++ b/nuklear/go.sum @@ -14,8 +14,6 @@ github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9/go.mod github.com/Sereal/Sereal v0.0.0-20181211220259-509a78ddbda3/go.mod h1:D0JMgToj/WdxCgd30Kc1UcA9E+WdZoJqeVOuYW7iTBM= github.com/aarzilli/nucular v0.0.0-20190403084742-0071461892e4 h1:v7eVtJ0ycKmpNgiB7DMGz5zLwzES+0i/RyIfbT16has= github.com/aarzilli/nucular v0.0.0-20190403084742-0071461892e4/go.mod h1:KI8zBeoLu/Y4Jx1qXSlldLCfZ/TCR8VRmkjPqldnfo0= -github.com/aarzilli/nucular v0.0.0-20190902135428-56f96409e78a h1:oLYXIvaqKR2YrOWTsia89hjYGdfPUM2D7d5rF06SbHY= -github.com/aarzilli/nucular v0.0.0-20190902135428-56f96409e78a/go.mod h1:wGdJsPGGsknzeob6x436MChSy8DAom5UxdzUTjNCNDw= github.com/aead/siphash v0.0.0-20170329201724-e404fcfc8885/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= @@ -63,8 +61,6 @@ github.com/decred/dcrd/chaincfg v1.5.1 h1:u1Xbq0VTnAXIHW5ECqrWe0VYSgf5vWHqpSiwoL github.com/decred/dcrd/chaincfg v1.5.1/go.mod h1:FukMzTjkwzjPU+hK7CqDMQe3NMbSZAYU5PAcsx1wlv0= github.com/decred/dcrd/chaincfg/chainhash v1.0.1 h1:0vG7U9+dSjSCaHQKdoSKURK2pOb47+b+8FK5q4+Je7M= github.com/decred/dcrd/chaincfg/chainhash v1.0.1/go.mod h1:OVfvaOsNLS/A1y4Eod0Ip/Lf8qga7VXCQjUQLbkY0Go= -github.com/decred/dcrd/chaincfg/v2 v2.0.2 h1:VeGY52lHuYT01tIGbvYj+OO0GaGxGaJmnh+4vGca1+U= -github.com/decred/dcrd/chaincfg/v2 v2.0.2/go.mod h1:hpKvhLCDAD/xDZ3V1Pqpv9fIKVYYi11DyxETguazyvg= github.com/decred/dcrd/connmgr v1.0.1/go.mod h1:jR+woh3BTbP/35v0nHMiz6GfV1RO0uF1JA+mKeXNk04= github.com/decred/dcrd/connmgr v1.0.2 h1:ipHJBV9fmhLi8ZZCtsNpG+kLY2c+yu59/8oOkA8BNJY= github.com/decred/dcrd/connmgr v1.0.2/go.mod h1:jBNfQLh+454n3crgNCPrhMgZ9mVvYcMbWSCEAHsJQus= @@ -95,8 +91,6 @@ github.com/decred/dcrd/dcrec/edwards v1.0.0/go.mod h1:HblVh1OfMt7xSxUL1ufjToaEvp github.com/decred/dcrd/dcrec/secp256k1 v1.0.0/go.mod h1:JPMFscGlgXTV684jxQNDijae2qrh0fLG7pJBimaYotE= github.com/decred/dcrd/dcrec/secp256k1 v1.0.1 h1:EFWVd1p0t0Y5tnsm/dJujgV0ORogRJ6vo7CMAjLseAc= github.com/decred/dcrd/dcrec/secp256k1 v1.0.1/go.mod h1:lhu4eZFSfTJWUnR3CFRcpD+Vta0KUAqnhTsTksHXgy0= -github.com/decred/dcrd/dcrec/secp256k1 v1.0.2 h1:awk7sYJ4pGWmtkiGHFfctztJjHMKGLV8jctGQhAbKe0= -github.com/decred/dcrd/dcrec/secp256k1 v1.0.2/go.mod h1:CHTUIVfmDDd0KFVFpNX1pFVCBUegxW387nN0IGwNKR0= github.com/decred/dcrd/dcrjson v1.0.0/go.mod h1:ozddIaeF+EAvZZvFuB3zpfxhyxBGfvbt22crQh+PYuI= github.com/decred/dcrd/dcrjson v1.1.0/go.mod h1:ozddIaeF+EAvZZvFuB3zpfxhyxBGfvbt22crQh+PYuI= github.com/decred/dcrd/dcrjson v1.2.0 h1:3BFFQHq3/YO/zae9WLxQkXsX6AXKx3+M8H3yk4oXZi0= @@ -105,10 +99,6 @@ github.com/decred/dcrd/dcrutil v1.0.0/go.mod h1:CBpbItyMKkL/4i1qPJDsE/cdSYklsWFc github.com/decred/dcrd/dcrutil v1.1.1/go.mod h1:Jsttr0pEvzPAw+qay1kS1/PsbZYPyhluiNwwY6yBJS4= github.com/decred/dcrd/dcrutil v1.2.0 h1:Pd5Wf650g6Xu6luYDfGkh1yiUoPUAgqzRu6K+BGyJGg= github.com/decred/dcrd/dcrutil v1.2.0/go.mod h1:tUNHS2gj7ApeEVS8gb6O+4wJW7w3O2MSRyRdcjW1JxU= -github.com/decred/dcrd/dcrutil v1.4.0 h1:xD5aUqysGQnsnP1c9J0kGeW8lDIwFGC3ja/gE3HnpCs= -github.com/decred/dcrd/dcrutil v1.4.0/go.mod h1:Bs74gm1jQ9ZAbmEh9FWOEZ1HQzlMg5iPATDMzMnCMlQ= -github.com/decred/dcrd/dcrutil/v2 v2.0.0 h1:HTqn2tZ8eqBF4y3hJwjyKBmJt16y7/HjzpE82E/crhY= -github.com/decred/dcrd/dcrutil/v2 v2.0.0/go.mod h1:gUshVAXpd51DlcEhr51QfWL2HJGkMDM1U8chY+9VvQg= github.com/decred/dcrd/gcs v1.0.0/go.mod h1:5uHIPAzn4SdGP2/FhVBK2YdAoKmufds3ZI8yNzojUCM= github.com/decred/dcrd/gcs v1.0.1/go.mod h1:YwutGzusSdJM79CJtxCo9t7WRCvnkLtWSD19TPo1i9g= github.com/decred/dcrd/gcs v1.0.2 h1:wZjxeC9WPBoRApaAQpBrzvN9NA0iS2KWrTJa9IiDgc8= @@ -207,7 +197,6 @@ github.com/golang/freetype v0.0.0-20161208064710-d9be45aaf745/go.mod h1:E/TSTwGw github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -286,21 +275,11 @@ golang.org/x/image v0.0.0-20181116024801-cd38e8056d9b/go.mod h1:ux5Hcp/YLpHSI86h golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190501045829-6d32002ffd75 h1:TbGuee8sSq15Iguxu4deQ7+Bqq/d2rsQejGcEtADAMQ= golang.org/x/image v0.0.0-20190501045829-6d32002ffd75/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/image v0.0.0-20190902063713-cb417be4ba39 h1:4dQcAORh9oYBwVSBVIkP489LUPC+f1HBkTYXgmqfR+o= -golang.org/x/image v0.0.0-20190902063713-cb417be4ba39/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190318164015-6bd122906c08 h1:REhdg1qxVTaAJcvh9BOGNgt2kd+KiUZ148XXlLp08FU= golang.org/x/mobile v0.0.0-20190318164015-6bd122906c08/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/mobile v0.0.0-20190830201351-c6da95954960 h1:g5dGzuzMMVsqpij5zmxpKHDVCSJ61fyK+G28hlQ9Zok= -golang.org/x/mobile v0.0.0-20190830201351-c6da95954960/go.mod h1:mJOp/i0LXPxJZ9weeIadcPqKVfS05Ai7m6/t9z1Hs/Y= -golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180808004115-f9ce57c11b24/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd h1:HuTn7WObtcDo9uEEU7rEqL0jYthdXAmZ6PP+meazmaU= @@ -308,10 +287,6 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190420063019-afa5a82059c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859 h1:R/3boaszxrf1GEUWTVDzSKVwLmSJpwZ1yqXm8j0v2QI= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= @@ -320,7 +295,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEha golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180810070207-f0d5e33068cb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180816055513-1c9583448a9c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181206074257-70b957f3b65e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181212120007-b05ddf57801d/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -351,4 +325,3 @@ gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMy gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 578a185a28fd69fcc52da60fd69b7e0df9122595 Mon Sep 17 00:00:00 2001 From: morrison Date: Mon, 9 Dec 2019 13:53:04 +0100 Subject: [PATCH 42/73] added selected wallet line --- fyne/pages/history.go | 30 +++- go.mod | 5 - go.sum | 341 ------------------------------------------ 3 files changed, 29 insertions(+), 347 deletions(-) delete mode 100644 go.sum diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 5167ddacb..cb1cd1991 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -95,13 +95,41 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, continue } - walletView := widget.NewHBox( + selectedWalletLine := canvas.NewLine(color.RGBA{0xbd, 0xbd, 0xbd, 0xff}) + selectedWalletLine.StrokeWidth = 1.5 + if walletID != walletsID[0] { + selectedWalletLine.Hide() + } + + walletContainer := widget.NewVBox( widget.NewLabel(wallet.Name), + selectedWalletLine, + ) + + walletView := widget.NewHBox( + walletContainer, widgets.NewHSpacer(5), ) + individualWalletID := walletID + // working on hiding line walletListWidget.Append(widgets.NewClickableBox(walletView, func() { + for _, children := range walletView.Children { + if box, ok := children.(*widget.Box); !ok { + continue + } else { + if len(box.Children) != 2 { + continue + } + if line, ok := box.Children[1].(*canvas.Line); !ok { + continue + } else { + line.Hide() + } + } + } + txHistory.selectedWalletID = individualWalletID })) walletListWidget.Append(widgets.NewHSpacer(8)) diff --git a/go.mod b/go.mod index 21bfce6a5..59873f51e 100644 --- a/go.mod +++ b/go.mod @@ -10,11 +10,6 @@ replace ( ) require ( -<<<<<<< HEAD github.com/raedahgroup/godcr/app v0.0.0-20191104184142-723795cee288 // indirect github.com/raedahgroup/godcr/cmd/godcr-fyne v0.0.0-00010101000000-000000000000 // indirect -======= - github.com/raedahgroup/godcr/cmd/godcr-fyne v0.0.0-00010101000000-000000000000 // indirect - github.com/raedahgroup/godcr/fyne v0.0.0-00010101000000-000000000000 // indirect ->>>>>>> implemented multiwallet feature ) diff --git a/go.sum b/go.sum deleted file mode 100644 index 4f07ff74f..000000000 --- a/go.sum +++ /dev/null @@ -1,341 +0,0 @@ -fyne.io/fyne v1.1.3-0.20191104221827-e8f6795efa08 h1:io8pkG6pP1FjpSDoj+OMowNPylACUqWc+Cwc7DHFmZs= -fyne.io/fyne v1.1.3-0.20191104221827-e8f6795efa08/go.mod h1:QKalFvMg5T4bJYGoygqrz662GbMymGEGR5gDqcoO9CM= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9 h1:HD8gA2tkByhMAwYaFAX9w2l7vxvBQ5NMoxDrkhqhtn4= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/DataDog/zstd v1.3.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9/go.mod h1:7uhhqiBaR4CpN0k9rMjOtjpcfGd6DG2m04zQxKnWQ0I= -github.com/Sereal/Sereal v0.0.0-20181211220259-509a78ddbda3/go.mod h1:D0JMgToj/WdxCgd30Kc1UcA9E+WdZoJqeVOuYW7iTBM= -github.com/aead/siphash v0.0.0-20170329201724-e404fcfc8885/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= -github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= -github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/asdine/storm v0.0.0-20190216191021-fe89819f6282 h1:DmSVc81daQAPvXwcCZi0W6A14sTCYQ1QI21C0E37KoY= -github.com/asdine/storm v0.0.0-20190216191021-fe89819f6282/go.mod h1:cMLKpjHSP4q0P133fV15ojQgwWWB2IMv+hrFsmBF/wI= -github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v1.0.0 h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4= -github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= -github.com/btcsuite/snappy-go v1.0.0 h1:ZxaA6lo2EpxGddsA8JwWOcxlzRybb444sgmeJQMJGQE= -github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dchest/blake256 v1.0.0 h1:6gUgI5MHdz9g0TdrgKqXsoDX+Zjxmm1Sc6OsoGru50I= -github.com/dchest/blake256 v1.0.0/go.mod h1:xXNWCE1jsAP8DAjP+rKw2MbeqLczjI3TRx2VK+9OEYY= -github.com/dchest/siphash v1.2.0/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4= -github.com/dchest/siphash v1.2.1 h1:4cLinnzVJDKxTCl9B01807Yiy+W7ZzVHj/KIroQRvT4= -github.com/dchest/siphash v1.2.1/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4= -github.com/decred/base58 v1.0.0 h1:BVi1FQCThIjZ0ehG+I99NJ51o0xcc9A/fDKhmJxY6+w= -github.com/decred/base58 v1.0.0/go.mod h1:LLY1p5e3g91byL/UO1eiZaYd+uRoVRarybgcoymu9Ks= -github.com/decred/dcrd/addrmgr v1.0.2 h1:BfJoFEkdDDhaQSsx9NkVOTiOTUbEevbVf+aYRQSIAmU= -github.com/decred/dcrd/addrmgr v1.0.2/go.mod h1:gNnmTuf/Xkg8ZX3j5GXbajzPrSdf5bA7HitO2bjmq0Q= -github.com/decred/dcrd/blockchain v1.0.0/go.mod h1:nNMgOz12wlasmEJDCuSuMWYSnjDdmB4l38GKuQ/Yd+8= -github.com/decred/dcrd/blockchain v1.0.1/go.mod h1:R/4XnwNOTj5IP8jQIUzrJ8zhr/7EOk09IMODwBamZoI= -github.com/decred/dcrd/blockchain v1.0.2/go.mod h1:R/4XnwNOTj5IP8jQIUzrJ8zhr/7EOk09IMODwBamZoI= -github.com/decred/dcrd/blockchain v1.1.1 h1:CWr90sZ2YLQz84EGT+X/pzU+9AZB1eXQUy+4fsJSt5w= -github.com/decred/dcrd/blockchain v1.1.1/go.mod h1:zxi/41LgzHitpz/CZu0gxHyFHz8+ysd3lH8E3P5Uifg= -github.com/decred/dcrd/blockchain/stake v1.0.0/go.mod h1:opuzF8UouYyQyRJVF00Rdd7OgWb1WKyy1pyU0QYaxz0= -github.com/decred/dcrd/blockchain/stake v1.0.1/go.mod h1:hgoGmWMIu2LLApBbcguVpzCEEfX7M2YhuMrQdpohJzc= -github.com/decred/dcrd/blockchain/stake v1.0.2/go.mod h1:hgoGmWMIu2LLApBbcguVpzCEEfX7M2YhuMrQdpohJzc= -github.com/decred/dcrd/blockchain/stake v1.1.0 h1:kCxZdQ2/UfcD+XjE3wlCv0vLKWR9ZFtjbbTTpudb74o= -github.com/decred/dcrd/blockchain/stake v1.1.0/go.mod h1:WRuaml4bcyZYza1NT3qizlLcQwMIcAQRENvZVb2t884= -github.com/decred/dcrd/certgen v1.0.1/go.mod h1:NxEyGwzPHak+h3tNLYAXU4vWuL98HrY9Z59hc1E3SGI= -github.com/decred/dcrd/chaincfg v1.0.1/go.mod h1:O+443mQNPjci+WqWkKta3v2MgJn2u20YWy5mW3c2T7M= -github.com/decred/dcrd/chaincfg v1.1.1/go.mod h1:UlGtnp8Xx9YK+etBTybGjoFGoGXSw2bxZQuAnwfKv6I= -github.com/decred/dcrd/chaincfg v1.2.0/go.mod h1:kpoGTMIriKn5hHRSu5b65+Q9LlGUdbQcMzGujac1BVs= -github.com/decred/dcrd/chaincfg v1.3.0/go.mod h1:kpoGTMIriKn5hHRSu5b65+Q9LlGUdbQcMzGujac1BVs= -github.com/decred/dcrd/chaincfg v1.4.0/go.mod h1:ypuM30F+XgZmZTFfAkWHWd0lwwkWWAOAQYNRkRDlYLc= -github.com/decred/dcrd/chaincfg v1.5.1 h1:u1Xbq0VTnAXIHW5ECqrWe0VYSgf5vWHqpSiwoLBzxAQ= -github.com/decred/dcrd/chaincfg v1.5.1/go.mod h1:FukMzTjkwzjPU+hK7CqDMQe3NMbSZAYU5PAcsx1wlv0= -github.com/decred/dcrd/chaincfg/chainhash v1.0.1 h1:0vG7U9+dSjSCaHQKdoSKURK2pOb47+b+8FK5q4+Je7M= -github.com/decred/dcrd/chaincfg/chainhash v1.0.1/go.mod h1:OVfvaOsNLS/A1y4Eod0Ip/Lf8qga7VXCQjUQLbkY0Go= -github.com/decred/dcrd/chaincfg/v2 v2.0.2 h1:VeGY52lHuYT01tIGbvYj+OO0GaGxGaJmnh+4vGca1+U= -github.com/decred/dcrd/chaincfg/v2 v2.0.2/go.mod h1:hpKvhLCDAD/xDZ3V1Pqpv9fIKVYYi11DyxETguazyvg= -github.com/decred/dcrd/connmgr v1.0.1/go.mod h1:jR+woh3BTbP/35v0nHMiz6GfV1RO0uF1JA+mKeXNk04= -github.com/decred/dcrd/connmgr v1.0.2 h1:ipHJBV9fmhLi8ZZCtsNpG+kLY2c+yu59/8oOkA8BNJY= -github.com/decred/dcrd/connmgr v1.0.2/go.mod h1:jBNfQLh+454n3crgNCPrhMgZ9mVvYcMbWSCEAHsJQus= -github.com/decred/dcrd/database v1.0.0/go.mod h1:eQOhTdO3oYBshjCVxMt747CP6yKKIls6IIdqYxMRzEk= -github.com/decred/dcrd/database v1.0.1/go.mod h1:ILCeyOHFew3fZ7K2B9jl+tp5qFOap/pEGoo6Yy6Wk0g= -github.com/decred/dcrd/database v1.0.2/go.mod h1:ILCeyOHFew3fZ7K2B9jl+tp5qFOap/pEGoo6Yy6Wk0g= -github.com/decred/dcrd/database v1.0.3 h1:e5Q3gDt9LwfvpZxYqFF3OVzgr8bGeC1cen+V3mv/CCw= -github.com/decred/dcrd/database v1.0.3/go.mod h1:TLxRwIV8x85+dxPTLAWu4mHg45TkKrrza5xzwOS1QtA= -github.com/decred/dcrd/dcrec v0.0.0-20180721005212-59fe2b293f69/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20180721005914-d26200ec716b/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20180721031028-5369a485acf6/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20180801202239-0761de129164/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20180809193022-9536f0c88fa8/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20180816212643-20eda7ec9229/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20181212181811-1a370d38d671/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20190130161649-59ed4247a1d5/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20190402182842-879eebce3333/go.mod h1:HIaqbEJQ+PDzQcORxnqen5/V1FR3B4VpIfmePklt8Q8= -github.com/decred/dcrd/dcrec v1.0.0 h1:W+z6Es+Rai3MXYVoPAxYr5U1DGis0Co33scJ6uH2J6o= -github.com/decred/dcrd/dcrec v1.0.0/go.mod h1:HIaqbEJQ+PDzQcORxnqen5/V1FR3B4VpIfmePklt8Q8= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20180721005212-59fe2b293f69/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20180721031028-5369a485acf6/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20180809193022-9536f0c88fa8/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20180816212643-20eda7ec9229/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20181208004914-a0816cf4301f/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20190130161649-59ed4247a1d5/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20190402182842-879eebce3333/go.mod h1:HblVh1OfMt7xSxUL1ufjToaEvpbjpWvvTAUx4yem8BI= -github.com/decred/dcrd/dcrec/edwards v1.0.0 h1:UDcPNzclKiJlWqV3x1Fl8xMCJrolo4PB4X9t8LwKDWU= -github.com/decred/dcrd/dcrec/edwards v1.0.0/go.mod h1:HblVh1OfMt7xSxUL1ufjToaEvpbjpWvvTAUx4yem8BI= -github.com/decred/dcrd/dcrec/secp256k1 v1.0.0/go.mod h1:JPMFscGlgXTV684jxQNDijae2qrh0fLG7pJBimaYotE= -github.com/decred/dcrd/dcrec/secp256k1 v1.0.1/go.mod h1:lhu4eZFSfTJWUnR3CFRcpD+Vta0KUAqnhTsTksHXgy0= -github.com/decred/dcrd/dcrec/secp256k1 v1.0.2 h1:awk7sYJ4pGWmtkiGHFfctztJjHMKGLV8jctGQhAbKe0= -github.com/decred/dcrd/dcrec/secp256k1 v1.0.2/go.mod h1:CHTUIVfmDDd0KFVFpNX1pFVCBUegxW387nN0IGwNKR0= -github.com/decred/dcrd/dcrjson v1.0.0/go.mod h1:ozddIaeF+EAvZZvFuB3zpfxhyxBGfvbt22crQh+PYuI= -github.com/decred/dcrd/dcrjson v1.1.0 h1:pFpbay3cWACkgloFxWjHBwlXWG2+S2QCJJzNxL40hwg= -github.com/decred/dcrd/dcrjson v1.1.0/go.mod h1:ozddIaeF+EAvZZvFuB3zpfxhyxBGfvbt22crQh+PYuI= -github.com/decred/dcrd/dcrjson/v2 v2.0.0 h1:W0q4Alh36c5N318eUpfmU8kXoCNgImMLI87NIXni9Us= -github.com/decred/dcrd/dcrjson/v2 v2.0.0/go.mod h1:FYueNy8BREAFq04YNEwcTsmGFcNqY+ehUUO81w2igi4= -github.com/decred/dcrd/dcrutil v1.0.0/go.mod h1:CBpbItyMKkL/4i1qPJDsE/cdSYklsWFcTYgprRZh4yk= -github.com/decred/dcrd/dcrutil v1.1.1/go.mod h1:Jsttr0pEvzPAw+qay1kS1/PsbZYPyhluiNwwY6yBJS4= -github.com/decred/dcrd/dcrutil v1.2.0/go.mod h1:tUNHS2gj7ApeEVS8gb6O+4wJW7w3O2MSRyRdcjW1JxU= -github.com/decred/dcrd/dcrutil v1.4.0 h1:xD5aUqysGQnsnP1c9J0kGeW8lDIwFGC3ja/gE3HnpCs= -github.com/decred/dcrd/dcrutil v1.4.0/go.mod h1:Bs74gm1jQ9ZAbmEh9FWOEZ1HQzlMg5iPATDMzMnCMlQ= -github.com/decred/dcrd/dcrutil/v2 v2.0.0 h1:HTqn2tZ8eqBF4y3hJwjyKBmJt16y7/HjzpE82E/crhY= -github.com/decred/dcrd/dcrutil/v2 v2.0.0/go.mod h1:gUshVAXpd51DlcEhr51QfWL2HJGkMDM1U8chY+9VvQg= -github.com/decred/dcrd/gcs v1.0.0/go.mod h1:5uHIPAzn4SdGP2/FhVBK2YdAoKmufds3ZI8yNzojUCM= -github.com/decred/dcrd/gcs v1.0.1/go.mod h1:YwutGzusSdJM79CJtxCo9t7WRCvnkLtWSD19TPo1i9g= -github.com/decred/dcrd/gcs v1.0.2 h1:wZjxeC9WPBoRApaAQpBrzvN9NA0iS2KWrTJa9IiDgc8= -github.com/decred/dcrd/gcs v1.0.2/go.mod h1:eLCvrzUsWro48TlTyrmFcZAZqnllYFz0vEv5VZtufF4= -github.com/decred/dcrd/hdkeychain v1.1.0/go.mod h1:zyUZtZ3PdnTPHt2XUr1x76b8ZuiM+9aVkP8Rq8Scp1k= -github.com/decred/dcrd/hdkeychain v1.1.1 h1:6+BwOmPfEyw/Krm+91RXysc76F1jqCta3m45DyD5+s4= -github.com/decred/dcrd/hdkeychain v1.1.1/go.mod h1:CLBVXLoO63fIiqkv38KR23zXGSgrfiAWOybOKTneLhA= -github.com/decred/dcrd/mempool v1.0.1/go.mod h1:r+/DGiiluXi1EyMCCPPH58Qu+rsr8nZv0DialAG5VZQ= -github.com/decred/dcrd/mempool v1.1.1 h1:ysFIS3HzEIJ88B1Y4OfL6wjzBurlChbKkzq54hPglGo= -github.com/decred/dcrd/mempool v1.1.1/go.mod h1:u1I2KRv9UHhx2crlbZXYoLDabWyQ8VnnHDSG53UdhCA= -github.com/decred/dcrd/mining v1.0.0/go.mod h1:VA5H4zhJgXb8LK5lqM5H58dhMRXJRcaQQoX3G8QRpP8= -github.com/decred/dcrd/mining v1.0.1/go.mod h1:+CSOLPi7TM8OlQg7mJ7XzWLXCDb4nHK8R6cvXOzhEoU= -github.com/decred/dcrd/mining v1.1.0 h1:9Wtla+i+pEjfYsNCfixsipmyyoB26DgL4LSXWAin/zw= -github.com/decred/dcrd/mining v1.1.0/go.mod h1:NQEtX604XgNwKcPFId1hVTTiBqmVQDlnqV1yNqGl4oU= -github.com/decred/dcrd/rpcclient v1.0.1/go.mod h1:tApXK3wwrAQtz7lcXeeqBwuktUZesvrFfvhAdedYqdM= -github.com/decred/dcrd/rpcclient v1.1.0 h1:nQZ1qOJaLYoOTM1oQ2dLaqocb5TWI7gNBK+BTY7UVXk= -github.com/decred/dcrd/rpcclient v1.1.0/go.mod h1:SCwBs4d+aqRV2ChnriIZ1y/LgNVHG/2ieEC1vIop82s= -github.com/decred/dcrd/rpcclient/v2 v2.0.0 h1:Zy9twdEaOGUdCj/89LAs/IrStm6FcabxzBve4UsA73A= -github.com/decred/dcrd/rpcclient/v2 v2.0.0/go.mod h1:9XjbRHBSNqN+DXz8I47gUZszvVjvugqLGK8TZQ4c/u0= -github.com/decred/dcrd/txscript v1.0.0/go.mod h1:9byvrOaBSBVVnDG7Cm0JgN8bZytl1oi9Ba245VBeI18= -github.com/decred/dcrd/txscript v1.0.1/go.mod h1:FqUX07Y+u3cJ1eIGPoyWbJg+Wk1NTllln/TyDpx9KnY= -github.com/decred/dcrd/txscript v1.0.2/go.mod h1:hmUOHFlOjU7H6T/czt6kurWwXJvGPGKKGtXoft6w/qY= -github.com/decred/dcrd/txscript v1.0.3-0.20190402182842-879eebce3333 h1:nsk8gnezIxeC4Dboj/VE9Epe1ItlAhUxAvOliRRtfec= -github.com/decred/dcrd/txscript v1.0.3-0.20190402182842-879eebce3333/go.mod h1:OhSIXbXdGDRNtkzW7Pil22tj+fcqpUp8r/E4LAz1yoQ= -github.com/decred/dcrd/wire v1.0.1/go.mod h1:zpKZnBiN59CrzfXFigwgXmUDVYf34OLbEr8xwAwriHc= -github.com/decred/dcrd/wire v1.1.0/go.mod h1:/JKOsLInOJu6InN+/zH5AyCq3YDIOW/EqcffvU8fJHM= -github.com/decred/dcrd/wire v1.2.0 h1:HqJVB7vcklIguzFWgRXw/WYCQ9cD3bUC5TKj53i1Hng= -github.com/decred/dcrd/wire v1.2.0/go.mod h1:/JKOsLInOJu6InN+/zH5AyCq3YDIOW/EqcffvU8fJHM= -github.com/decred/dcrdata/semver v1.0.0/go.mod h1:z+nQqiAd9fYkHhBLbejysZ2FPHtgkrErWDgMf+JlZWE= -github.com/decred/dcrdata/txhelpers v1.1.0 h1:xKK+1/OASkSxMe/KDLaLJeJjJdopgC+FV8+EFPpJAGk= -github.com/decred/dcrdata/txhelpers v1.1.0/go.mod h1:IyxuqUxIPrHnOmRy9DCl90oqw7FxYHde/fkIkF21B7w= -github.com/decred/dcrwallet v1.2.2 h1:NdI13wxP+OsWKXPqjWQQ9VSGAl4VoSLBfAunzFreeJg= -github.com/decred/dcrwallet v1.2.2/go.mod h1:BrSus0F+Rx8UhvPNBfuRMIjRJBNrW2sLspN9iQR5hm8= -github.com/decred/dcrwallet/chain v1.0.0/go.mod h1:KpZFaKlKajfUZt36+RmBn2HKwTbwoa3yt9HPALqlShI= -github.com/decred/dcrwallet/chain v1.1.1 h1:YUJ1ArUaN/WuMnTP1PvfirNaqIQO9+UUNDifhnJ8QQQ= -github.com/decred/dcrwallet/chain v1.1.1/go.mod h1:2kA82rBDkCKOSYFV+Q14RZNCuYwdaQ9uO/c+RixqRNs= -github.com/decred/dcrwallet/deployments v1.0.0/go.mod h1:0bWER/DAYoGbzkWzbUf6k2agW4YkSyvNLZDhBGThz/4= -github.com/decred/dcrwallet/deployments v1.1.0 h1:83arg+7ct7PS1H2IYhuePnrBK2rkVpEYWKqrJpCwtHA= -github.com/decred/dcrwallet/deployments v1.1.0/go.mod h1:8Sasryu8SX23Jvqr6maZ7MoS7wFIGXupWzbsVtcZsUg= -github.com/decred/dcrwallet/errors v1.0.0/go.mod h1:XUm95dWmm9XmQGvneBXJkkIaFeRsQVBB6ni/KTy1hrY= -github.com/decred/dcrwallet/errors v1.0.1 h1:8EF7IY6twRlo9sqWaSfm8abfi2/rHZ1wacOiGvBy+bM= -github.com/decred/dcrwallet/errors v1.0.1/go.mod h1:XUm95dWmm9XmQGvneBXJkkIaFeRsQVBB6ni/KTy1hrY= -github.com/decred/dcrwallet/internal/helpers v1.0.0/go.mod h1:FsihtjCyFrGL6gdmkxBWTYQ1CUgbfM9tyinYNOzLnlk= -github.com/decred/dcrwallet/internal/helpers v1.0.1 h1:oEqfJPs1uI7QI0Aejx2MUWq/yD609cc9Z8P7vQ6cDz8= -github.com/decred/dcrwallet/internal/helpers v1.0.1/go.mod h1:qIXcze8VZ+A3sEgZou7PTOe4Vsnmks54SGTSGZ6084g= -github.com/decred/dcrwallet/internal/zero v1.0.0/go.mod h1:vULuNLRTcnifKCepcIxUDL4jrR3rJOwVR9UDH89Qpms= -github.com/decred/dcrwallet/internal/zero v1.0.1 h1:hO7orPk13AFp7pFTL739CbVLKImSNorI2J9/tiucNQY= -github.com/decred/dcrwallet/internal/zero v1.0.1/go.mod h1:mXUIsKATE1pIaNAJQ4lhSTX6c9N5sYoSrlScgRCaMJs= -github.com/decred/dcrwallet/lru v1.0.0 h1:vz71/Wa2890CUQeWsOTI6u6iGGfXGAhIQ/hnqMUh6Xc= -github.com/decred/dcrwallet/lru v1.0.0/go.mod h1:jEty7mdT5VaaV06DEV2Avv0R3HpGvUwvDW4lw8ECtiY= -github.com/decred/dcrwallet/p2p v1.0.0/go.mod h1:b1CLZAkl/K5dr5I5B4SdFT8FrE11jSkfA4VAA862ACA= -github.com/decred/dcrwallet/p2p v1.0.1 h1:UTsD5I8YtWVf2SEg0mSd5+hIlp7Ihj3rS2PZ9P5cXVI= -github.com/decred/dcrwallet/p2p v1.0.1/go.mod h1:FsoAR0cBOLW3VKMg+Tdx+wdSezR7g8NGOdz4fx6gtpM= -github.com/decred/dcrwallet/pgpwordlist v1.0.0 h1:H7Y3+yRZq7PXMPfpKLMnY5TKTjTWhc0oJmyN7v8tC/M= -github.com/decred/dcrwallet/pgpwordlist v1.0.0/go.mod h1:Fek3uYn+9DnEFIreA/8PnTIXUl2lBO64JpEBkL9BXtk= -github.com/decred/dcrwallet/rpc/jsonrpc/types v1.0.0 h1:FPVohgxZHHwi7qTOBki/Dw9j5cgGsZYiktGSfgqHR0w= -github.com/decred/dcrwallet/rpc/jsonrpc/types v1.0.0/go.mod h1:k+IOPnUY0YqlwhSDhczzaUN17NX/gMtztwl3UxKgVZY= -github.com/decred/dcrwallet/rpc/walletrpc v0.1.0/go.mod h1:Zp1ZFTCUo7S6MJvUyS5tYfaDUxGAMHkZ+vbsLgAdd4A= -github.com/decred/dcrwallet/spv v1.0.0/go.mod h1:lz39nz9P/HVoxYa4XAT6ithyR3WgdF0oVu4jtFwnCxE= -github.com/decred/dcrwallet/spv v1.1.1 h1:G5yXkoiO4LOh3Ba+qvyUIjF2dChOXpiuRCPpjYzzhZw= -github.com/decred/dcrwallet/spv v1.1.1/go.mod h1:HYfF+A1F+Apf0WPT6QRsG/gfvaFQmWObAytq8pWc6ME= -github.com/decred/dcrwallet/ticketbuyer v1.0.0/go.mod h1:mrAlRjOJ6txO8Zyqo5koxVOMEYLK2POUX35a/QcKN8g= -github.com/decred/dcrwallet/ticketbuyer v1.0.2 h1:vEcUSwCGZolg8fxSJ8+mW2XCdZ6J9LtwxCxRPdcpbQk= -github.com/decred/dcrwallet/ticketbuyer v1.0.2/go.mod h1:oDHY0TOFIaQjZ11TJbgztC5tt1zi6wKoRmyQMmwfft4= -github.com/decred/dcrwallet/ticketbuyer/v2 v2.0.0/go.mod h1:VKo2PjXAlF/E46tSBKrIgqKbVcHVLfM5ACyOehT1unA= -github.com/decred/dcrwallet/ticketbuyer/v2 v2.0.1 h1:RLCly+fnbrMXzWVi4a4cUU2sGWi56e7UPJq9GHoe1iw= -github.com/decred/dcrwallet/ticketbuyer/v2 v2.0.1/go.mod h1:ngtx8I/+Jo+U+E/5XjwCkmU55wCGtUbaDnCP5qazNGM= -github.com/decred/dcrwallet/validate v1.0.0/go.mod h1:zHIlcrjAWl6LK+X+R7jc3F9wIM/qxjtMjG/mdEwt4tY= -github.com/decred/dcrwallet/validate v1.0.1/go.mod h1:9DCtLFnnTOC/7PKkF7jehvDyHkfUBl41ZbcT1u4PmQM= -github.com/decred/dcrwallet/validate v1.0.2 h1:EXY48b3SOkTGXJAB+OUmilvyFNROZywYIWTGYfUnTDE= -github.com/decred/dcrwallet/validate v1.0.2/go.mod h1:1ur2sRZkQ23ECalUKdwgx6rdIiP8rIiaSQAz1Y9LQsI= -github.com/decred/dcrwallet/version v1.0.0/go.mod h1:rXeMsUaI03WtlQrSol7Q7sJ8HBOB+tZvT7YQRXD5Y7M= -github.com/decred/dcrwallet/version v1.0.1 h1:gAz1lDkcJ+oAbg0tOn/J0KwZBVWIlhWmHhSUi9GbB2E= -github.com/decred/dcrwallet/version v1.0.1/go.mod h1:rXeMsUaI03WtlQrSol7Q7sJ8HBOB+tZvT7YQRXD5Y7M= -github.com/decred/dcrwallet/wallet v1.0.0/go.mod h1:VWRnpNFRiKPo7FUPbzj0t5ElcGxNXMPIa4vGcGe94uM= -github.com/decred/dcrwallet/wallet v1.1.0/go.mod h1:g4OzDG7jpsRqTDP3bHiA0LIEZFx81accYPCkO1DBNT8= -github.com/decred/dcrwallet/wallet v1.2.3 h1:iQErxoEfm13XmgWQ5HKFbHwYjFcNO3jTiuNpZuAvI7A= -github.com/decred/dcrwallet/wallet v1.2.3/go.mod h1:ItOhnw3C4znuLQVWACSq8jCLy221v9X0Xo0b/j5WqgU= -github.com/decred/dcrwallet/walletseed v1.0.0/go.mod h1:xSF6hZW+5Xhm0jJFsI5jQSfViuZUQJoDXa/cQxtgncs= -github.com/decred/dcrwallet/walletseed v1.0.1 h1:gxvlj0GRw+H0VumCxTlEysu+/nltcp9+lgzVgzsnI/Y= -github.com/decred/dcrwallet/walletseed v1.0.1/go.mod h1:ENlwTabC2JVmT4S1eCP44fnwX4+9y2RLsnfSU21CJ+4= -github.com/decred/slog v1.0.0 h1:Dl+W8O6/JH6n2xIFN2p3DNjCmjYwvrXsjlSJTQQ4MhE= -github.com/decred/slog v1.0.0/go.mod h1:zR98rEZHSnbZ4WHZtO0iqmSZjDLKhkXfrPTZQKtAonQ= -github.com/dgraph-io/badger v1.5.4 h1:gVTrpUTbbr/T24uvoCaqY2KSHfNLVGm0w+hbee2HMeg= -github.com/dgraph-io/badger v1.5.4/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ= -github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f h1:dDxpBYafY/GYpcl+LS4Bn3ziLPuEdGRkRjYAbSlWxSA= -github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/gen2brain/beeep v0.0.0-20190719094215-ece0cb67ca77 h1:bvjWrvlA7ddo8+E8X5D+m5jg0GkwTeG6eRJGb6f/rRE= -github.com/gen2brain/beeep v0.0.0-20190719094215-ece0cb67ca77/go.mod h1:GprdPCZglWh5OMcIDpeKBxuUJI+fEDOTVUfxZeda4zo= -github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw= -github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk= -github.com/go-gl/glfw v0.0.0-20181213070059-819e8ce5125f/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/gobuffalo/envy v1.7.0 h1:GlXgaiBkmrYMHco6t4j7SacKO4XUjvh5pwXh0f4uxXU= -github.com/gobuffalo/envy v1.7.0/go.mod h1:n7DRkBerg/aorDM8kbduw5dN3oXGswK5liaSCx4T5NI= -github.com/gobuffalo/logger v1.0.0 h1:xw9Ko9EcC5iAFprrjJ6oZco9UpzS5MQ4jAwghsLHdy4= -github.com/gobuffalo/logger v1.0.0/go.mod h1:2zbswyIUa45I+c+FLXuWl9zSWEiVuthsk8ze5s8JvPs= -github.com/gobuffalo/packd v0.3.0 h1:eMwymTkA1uXsqxS0Tpoop3Lc0u3kTfiMBE6nKtQU4g4= -github.com/gobuffalo/packd v0.3.0/go.mod h1:zC7QkmNkYVGKPw4tHpBQ+ml7W/3tIebgeo1b36chA3Q= -github.com/gobuffalo/packr/v2 v2.6.0 h1:EMUzJIb5rof6r087PtGmgdzdLKpRBESJ/8jyL9MexfY= -github.com/gobuffalo/packr/v2 v2.6.0/go.mod h1:sgEE1xNZ6G0FNN5xn9pevVu4nywaxHvgup67xisti08= -github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff h1:W71vTCKoxtdXgnm1ECDFkfQnpdqAO00zzGXLA5yaEX8= -github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff/go.mod h1:wfqRWLHRBsRgkp5dmbG56SA0DmVtwrF5N3oPdI8t+Aw= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/jackmordaunt/icns v0.0.0-20181231085925-4f16af745526/go.mod h1:UQkeMHVoNcyXYq9otUupF7/h/2tmHlhrS2zw7ZVvUqc= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/josephspurrier/goversioninfo v0.0.0-20190124120936-8611f5a5ff3f/go.mod h1:eJTEwMjXb7kZ633hO3Ln9mBUCOjX2+FlTljvpl9SYdE= -github.com/jrick/bitset v1.0.0 h1:Ws0PXV3PwXqWK2n7Vz6idCdrV/9OrBXgHEJi27ZB9Dw= -github.com/jrick/bitset v1.0.0/go.mod h1:ZOYB5Uvkla7wIEY4FEssPVi3IQXa02arznRaYaAEPe4= -github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/karrick/godirwalk v1.10.12 h1:BqUm+LuJcXjGv1d2mj3gBiQyrQ57a0rYoAmhvJQ7RDU= -github.com/karrick/godirwalk v1.10.12/go.mod h1:RoGL9dQei4vP9ilrpETWE8CLOZ1kiN0LhBygSwrAsHA= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.2/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/raedahgroup/dcrlibwallet v1.1.1-0.20190928085114-bcc6e6b7769a h1:BvFVstGjzuNeFsNTmAZCfPxK2u51EGQVAdFKCauqaNE= -github.com/raedahgroup/dcrlibwallet v1.1.1-0.20190928085114-bcc6e6b7769a/go.mod h1:6AGgglq9BB0twJnZnHvfH8hIQrbw6yBJSPp9QI+hBk0= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/skip2/go-qrcode v0.0.0-20191027152451-9434209cb086 h1:RYiqpb2ii2Z6J4x0wxK46kvPBbFuZcdhS+CIztmYgZs= -github.com/skip2/go-qrcode v0.0.0-20191027152451-9434209cb086/go.mod h1:PLPIyL7ikehBD1OAjmKKiOEhbvWyHGaNDjquXMcYABo= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= -github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= -github.com/srwiley/oksvg v0.0.0-20190829233741-58e08c8fe40e h1:LJUrNHytcMXWKxnULIHPe5SCb1jDpO9o672VB1x2EuQ= -github.com/srwiley/oksvg v0.0.0-20190829233741-58e08c8fe40e/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4= -github.com/srwiley/rasterx v0.0.0-20181219215540-696f7edb7a7e h1:FFotfUvew9Eg02LYRl8YybAnm0HCwjjfY5JlOI1oB00= -github.com/srwiley/rasterx v0.0.0-20181219215540-696f7edb7a7e/go.mod h1:mvWM0+15UqyrFKqdRjY6LuAVJR0HOVhJlEgZ5JWtSWU= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= -go.etcd.io/bbolt v1.3.0 h1:oY10fI923Q5pVCVt1GBTZMn8LHo5M+RCInFpeMnV4QI= -go.etcd.io/bbolt v1.3.0/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -golang.org/x/crypto v0.0.0-20180718160520-a2144134853f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180808211826-de0752318171/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190131182504-b8fe1690c613/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 h1:1wopBVtVdWnn03fZelqdXTqk7U7zPQCb+T4rbU9ZEoU= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4 h1:ydJNl0ENAG67pFbB+9tfhiL2pYqLhfoaZFw/cjLhY4A= -golang.org/x/crypto v0.0.0-20190621222207-cc06ce4a13d4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180808004115-f9ce57c11b24/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190420063019-afa5a82059c6 h1:HdqqaWmYAUI7/dmByKKEw+yxDksGSo+9GjkUc9Zp34E= -golang.org/x/net v0.0.0-20190420063019-afa5a82059c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180810070207-f0d5e33068cb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180816055513-1c9583448a9c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181206074257-70b957f3b65e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181212120007-b05ddf57801d/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190203050204-7ae0202eb74c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190402142545-baf5eb976a8c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190515120540-06a5c4944438/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb h1:fgwFCsaw9buMuxNd6+DQfAuSFqbNiQZpcgJQAgJsK6k= -golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180808183934-383e8b2c3b9e/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 39010fca4d385e7283cae01b5db032758883e639 Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 11 Dec 2019 14:01:16 +0100 Subject: [PATCH 43/73] fixed issues with txDetailsPopup --- fyne/pages/history.go | 53 ++++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 33 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index cb1cd1991..74eefaf45 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -153,6 +153,7 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, errorMessage := fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter All: %s", err.Error()) return nil, nil, errorMessage } + txHistory.allTxCount = txCountForFilter selectedTxFilterLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) @@ -165,7 +166,6 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, filterName, err.Error()) return nil, nil, errorMessage } - if txCountForFilter > 0 { filter := fmt.Sprintf("%s (%d)", filterName, txCountForFilter) txFilterView := widget.NewHBox( @@ -388,13 +388,11 @@ func updateTable(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabM func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, errorLabel *widget.Label, tabMenu *widget.TabContainer) { messageLabel := widget.NewLabelWithStyle("Fetching data..", fyne.TextAlignCenter, fyne.TextStyle{}) - if messageLabel.Hidden == false { - time.AfterFunc(time.Millisecond*300, func() { - if tabMenu.CurrentTabIndex() == 1 { - messageLabel.Hide() - } - }) - } + time.AfterFunc(time.Millisecond*300, func() { + if tabMenu.CurrentTabIndex() == 1 { + messageLabel.SetText("") + } + }) var txDetailsPopUp *widget.PopUp @@ -408,11 +406,8 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f widgets.NewHSpacer(10), widget.NewHBox( txDetailslabel, - widgets.NewHSpacer(150), - messageLabel, - layout.NewSpacer(), + widgets.NewHSpacer(txDetailslabel.MinSize().Width+180), minimizeIcon, - widgets.NewHSpacer(30), ), errorMessageLabel, ) @@ -456,9 +451,9 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f copyAbleText := func(text string, copyAble bool) *widgets.ClickableBox { var textToCopy *canvas.Text if copyAble { - textToCopy = canvas.NewText(text, color.RGBA{0, 255, 255, 1}) + textToCopy = canvas.NewText(text, color.RGBA{0x44, 0x8a, 0xff, 0xff}) } else { - textToCopy = canvas.NewText(text, color.RGBA{255, 255, 255, 1}) + textToCopy = canvas.NewText(text, color.RGBA{0x00, 0x00, 0x00, 0xff}) } textToCopy.TextSize = 14 textToCopy.Alignment = fyne.TextAlignTrailing @@ -468,15 +463,12 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f messageLabel.SetText("Data Copied") clipboard := window.Clipboard() clipboard.SetContent(text) - messageLabel.Show() - - if messageLabel.Hidden == false { - time.AfterFunc(time.Second*2, func() { - if tabMenu.CurrentTabIndex() == 1 { - messageLabel.Hide() - } - }) - } + + time.AfterFunc(time.Second*2, func() { + if tabMenu.CurrentTabIndex() == 1 { + messageLabel.SetText("") + } + }) }, ) } @@ -583,23 +575,18 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f ) txDetailsScrollContainer := widget.NewScrollContainer(txDetailsData) - + //fixing exit icon txDetailsOutput := widget.NewVBox( widgets.NewHSpacer(10), widget.NewHBox( txDetailslabel, - widgets.NewHSpacer(150), - messageLabel, - layout.NewSpacer(), + widgets.NewHSpacer(txDetailsScrollContainer.MinSize().Width-txDetailslabel.MinSize().Width-30), minimizeIcon, - widgets.NewHSpacer(30), ), - widgets.NewHSpacer(10), + widget.NewHBox(widgets.NewHSpacer(txDetailsScrollContainer.MinSize().Width/2-30), messageLabel), fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer), - widgets.NewHSpacer(10), + widgets.NewVSpacer(10), ) - txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), - window.Canvas()) - txDetailsPopUp.Show() + txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), window.Canvas()) } From 5804ef80807720cf463e0141099690a88cc53590 Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 11 Dec 2019 17:58:10 +0100 Subject: [PATCH 44/73] hide filter popup when there re no tx in wallet --- fyne/pages/history.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 74eefaf45..c3cc4871b 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -212,9 +212,13 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, var txFilterDropDown *widgets.ClickableBox txFilterDropDown = widgets.NewClickableBox(txFilterTab, func() { - txFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( - txFilterDropDown).Add(fyne.NewPos(0, txFilterDropDown.Size().Height))) - txFilterSelectionPopup.Show() + if len(txFilterListWidget.Children) == 0 { + txFilterSelectionPopup.Hide() + } else { + txFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( + txFilterDropDown).Add(fyne.NewPos(0, txFilterDropDown.Size().Height))) + txFilterSelectionPopup.Show() + } }) return walletListWidget, txFilterDropDown, "" From 86fe1b55294ffe7816fbf75c83b35337bdd5a048 Mon Sep 17 00:00:00 2001 From: morrison Date: Thu, 12 Dec 2019 07:33:31 +0100 Subject: [PATCH 45/73] fixed issues with txSort dropdown --- fyne/pages/history.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index c3cc4871b..43e479c62 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -56,7 +56,7 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } - txSortFilterDropDown, errorMessage := txSortDropDown(app.Window) + txSortFilterDropDown, errorMessage := txSortDropDown(app.MultiWallet, app.Window, app.tabMenu) if errorMessage != "" { errorHandler(errorMessage, txHistory.errorLabel) txHistoryPageOutput.Append(txHistory.errorLabel) @@ -224,7 +224,8 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, return walletListWidget, txFilterDropDown, "" } -func txSortDropDown(window fyne.Window) (*widgets.ClickableBox, string) { +func txSortDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer) (*widgets.ClickableBox, string) { + var txTable widgets.Table var allTxSortNames = []string{"Newest", "Oldest"} var allTxSortFilters = map[string]bool{ "Newest": true, @@ -248,6 +249,11 @@ func txSortDropDown(window fyne.Window) (*widgets.ClickableBox, string) { txSortFilterListWidget.Append(widgets.NewClickableBox(txSortView, func() { selectedTxSortFilterLabel.SetText(newSortName) txHistory.selectedtxSort = txSort + + txTableHeader(multiWallet, &txTable, window) + txHistory.txTable.Result.Children = txTable.Result.Children + fetchTx(&txTable, 0, txHistory.selectedFilterId, multiWallet, window, tabMenu, false) + widget.Refresh(txHistory.txTable.Result) txSortFilterSelectionPopup.Hide() })) } From e2fe7aae0a23127d5dcb3bc809824c36a75e5446 Mon Sep 17 00:00:00 2001 From: morrison Date: Thu, 12 Dec 2019 14:38:09 +0100 Subject: [PATCH 46/73] added info popup and cleaned up code --- fyne/pages/history.go | 59 ++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 43e479c62..d754246d4 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -41,22 +41,51 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { txHistory.selectedFilterId = dcrlibwallet.TxFilterAll + icons, err := assets.GetIcons(assets.CollapseIcon, assets.InfoIcon) + if err != nil { + errorMessage := fmt.Sprintf("Error: %s", err.Error()) + errorHandler(errorMessage, txHistory.errorLabel) + return widget.NewHBox(widgets.NewHSpacer(18), txHistory.errorLabel) + } + pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) + // infoIcon holds receiving decred hint-text pop-up + var infoIcon *widgets.ImageButton + info := "- Tap Hash to view Transaction details.\n\n- Tap Blue Text to Copy." + infoIcon = widgets.NewImageButton(icons[assets.InfoIcon], nil, func() { + infoLabel := widget.NewLabelWithStyle(info, fyne.TextAlignLeading, fyne.TextStyle{Monospace: true}) + gotItLabel := canvas.NewText("Got it", color.RGBA{41, 112, 255, 255}) + gotItLabel.TextStyle = fyne.TextStyle{Bold: true} + gotItLabel.TextSize = 14 + + var infoPopUp *widget.PopUp + infoPopUp = widget.NewPopUp(widget.NewVBox( + widgets.NewVSpacer(5), + widget.NewHBox(widgets.NewHSpacer(5), infoLabel, widgets.NewHSpacer(5)), + widgets.NewVSpacer(5), + widget.NewHBox(layout.NewSpacer(), widgets.NewClickableBox(widget.NewVBox(gotItLabel), func() { infoPopUp.Hide() }), widgets.NewHSpacer(5)), + widgets.NewVSpacer(5), + ), app.Window.Canvas()) + + infoPopUp.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject(infoIcon).Add(fyne.NewPos(0, infoIcon.Size().Height))) + }) + + /// added info popup and cleaned up code. txHistoryPageOutput := widget.NewVBox( widgets.NewVSpacer(5), - pageTitleLabel, + widget.NewHBox(pageTitleLabel, widgets.NewHSpacer(110), infoIcon), widgets.NewVSpacer(5), ) - walletList, txFilterDropDown, errorMessage := txFilterDropDown(app.MultiWallet, app.Window, app.tabMenu) + walletList, txFilterDropDown, errorMessage := txFilterDropDown(app.MultiWallet, app.Window, app.tabMenu, icons) if errorMessage != "" { errorHandler(errorMessage, txHistory.errorLabel) txHistoryPageOutput.Append(txHistory.errorLabel) return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } - txSortFilterDropDown, errorMessage := txSortDropDown(app.MultiWallet, app.Window, app.tabMenu) + txSortFilterDropDown, errorMessage := txSortDropDown(app.MultiWallet, app.Window, app.tabMenu, icons) if errorMessage != "" { errorHandler(errorMessage, txHistory.errorLabel) txHistoryPageOutput.Append(txHistory.errorLabel) @@ -76,7 +105,7 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } -func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer) (*widget.Box, *widgets.ClickableBox, string) { +func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer, icons map[string]*fyne.StaticResource) (*widget.Box, *widgets.ClickableBox, string) { var txTable widgets.Table walletsID := multiWallet.OpenedWalletIDsRaw() @@ -198,11 +227,11 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, txFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txFilterListWidget), window.Canvas()) txFilterSelectionPopup.Hide() - icons, err := assets.GetIcons(assets.CollapseIcon) - if err != nil { - errorMessage := fmt.Sprintf("Error: %s", err.Error()) - return nil, nil, errorMessage - } + // icons, err := assets.GetIcons(assets.CollapseIcon) + // if err != nil { + // errorMessage := fmt.Sprintf("Error: %s", err.Error()) + // return nil, nil, errorMessage + // } txFilterTab := widget.NewHBox( selectedTxFilterLabel, @@ -224,7 +253,7 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, return walletListWidget, txFilterDropDown, "" } -func txSortDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer) (*widgets.ClickableBox, string) { +func txSortDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer, icons map[string]*fyne.StaticResource) (*widgets.ClickableBox, string) { var txTable widgets.Table var allTxSortNames = []string{"Newest", "Oldest"} var allTxSortFilters = map[string]bool{ @@ -262,11 +291,11 @@ func txSortDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, t txSortFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txSortFilterListWidget), window.Canvas()) txSortFilterSelectionPopup.Hide() - icons, err := assets.GetIcons(assets.CollapseIcon) - if err != nil { - errorMessage := fmt.Sprintf("Error: %s", err.Error()) - return nil, errorMessage - } + // icons, err := assets.GetIcons(assets.CollapseIcon) + // if err != nil { + // errorMessage := fmt.Sprintf("Error: %s", err.Error()) + // return nil, errorMessage + // } txSortFilterTab := widget.NewHBox( selectedTxSortFilterLabel, From 8a838e4ed9c490e1ed3460bd559df4b98485e98a Mon Sep 17 00:00:00 2001 From: morrison Date: Fri, 13 Dec 2019 08:00:58 +0100 Subject: [PATCH 47/73] added txdirection icon to tx table --- cmd/godcr-fyne/fyne.go | 2 +- cmd/godcr-fyne/go.sum | 2 +- fyne/pages/history.go | 50 +++++++++++++++++++++++------------------- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/cmd/godcr-fyne/fyne.go b/cmd/godcr-fyne/fyne.go index 3969c8cb0..f0b5b184c 100644 --- a/cmd/godcr-fyne/fyne.go +++ b/cmd/godcr-fyne/fyne.go @@ -15,4 +15,4 @@ var defaultAppDataDir = dcrutil.AppDataDir("godcr", false) func main() { fyne.LaunchUserInterface(appDisplayName, defaultAppDataDir, "testnet3") -} +} \ No newline at end of file diff --git a/cmd/godcr-fyne/go.sum b/cmd/godcr-fyne/go.sum index 74d368e92..d702fe653 100644 --- a/cmd/godcr-fyne/go.sum +++ b/cmd/godcr-fyne/go.sum @@ -407,4 +407,4 @@ gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkep gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= \ No newline at end of file diff --git a/fyne/pages/history.go b/fyne/pages/history.go index d754246d4..4108be68a 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -31,6 +31,7 @@ type txHistoryPageData struct { TotalTxFetched int32 selectedWalletID int selectedtxSort bool + icons map[string]*fyne.StaticResource } var txHistory txHistoryPageData @@ -41,19 +42,20 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { txHistory.selectedFilterId = dcrlibwallet.TxFilterAll - icons, err := assets.GetIcons(assets.CollapseIcon, assets.InfoIcon) + icons, err := assets.GetIcons(assets.CollapseIcon, assets.InfoIcon, assets.SendIcon, assets.ReceiveIcon, assets.ReceiveIcon, assets.InfoIcon) if err != nil { errorMessage := fmt.Sprintf("Error: %s", err.Error()) errorHandler(errorMessage, txHistory.errorLabel) return widget.NewHBox(widgets.NewHSpacer(18), txHistory.errorLabel) } + txHistory.icons = icons pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - // infoIcon holds receiving decred hint-text pop-up + // infoIcon holds receiving decred hint-text var infoIcon *widgets.ImageButton info := "- Tap Hash to view Transaction details.\n\n- Tap Blue Text to Copy." - infoIcon = widgets.NewImageButton(icons[assets.InfoIcon], nil, func() { + infoIcon = widgets.NewImageButton(txHistory.icons[assets.InfoIcon], nil, func() { infoLabel := widget.NewLabelWithStyle(info, fyne.TextAlignLeading, fyne.TextStyle{Monospace: true}) gotItLabel := canvas.NewText("Got it", color.RGBA{41, 112, 255, 255}) gotItLabel.TextStyle = fyne.TextStyle{Bold: true} @@ -71,21 +73,20 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { infoPopUp.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject(infoIcon).Add(fyne.NewPos(0, infoIcon.Size().Height))) }) - /// added info popup and cleaned up code. txHistoryPageOutput := widget.NewVBox( widgets.NewVSpacer(5), widget.NewHBox(pageTitleLabel, widgets.NewHSpacer(110), infoIcon), widgets.NewVSpacer(5), ) - walletList, txFilterDropDown, errorMessage := txFilterDropDown(app.MultiWallet, app.Window, app.tabMenu, icons) + walletList, txFilterDropDown, errorMessage := txFilterDropDown(app.MultiWallet, app.Window, app.tabMenu) if errorMessage != "" { errorHandler(errorMessage, txHistory.errorLabel) txHistoryPageOutput.Append(txHistory.errorLabel) return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } - txSortFilterDropDown, errorMessage := txSortDropDown(app.MultiWallet, app.Window, app.tabMenu, icons) + txSortFilterDropDown, errorMessage := txSortDropDown(app.MultiWallet, app.Window, app.tabMenu) if errorMessage != "" { errorHandler(errorMessage, txHistory.errorLabel) txHistoryPageOutput.Append(txHistory.errorLabel) @@ -105,7 +106,7 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } -func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer, icons map[string]*fyne.StaticResource) (*widget.Box, *widgets.ClickableBox, string) { +func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer) (*widget.Box, *widgets.ClickableBox, string) { var txTable widgets.Table walletsID := multiWallet.OpenedWalletIDsRaw() @@ -227,16 +228,10 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, txFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txFilterListWidget), window.Canvas()) txFilterSelectionPopup.Hide() - // icons, err := assets.GetIcons(assets.CollapseIcon) - // if err != nil { - // errorMessage := fmt.Sprintf("Error: %s", err.Error()) - // return nil, nil, errorMessage - // } - txFilterTab := widget.NewHBox( selectedTxFilterLabel, widgets.NewHSpacer(60), - widget.NewIcon(icons[assets.CollapseIcon]), + widget.NewIcon(txHistory.icons[assets.CollapseIcon]), ) var txFilterDropDown *widgets.ClickableBox @@ -253,7 +248,7 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, return walletListWidget, txFilterDropDown, "" } -func txSortDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer, icons map[string]*fyne.StaticResource) (*widgets.ClickableBox, string) { +func txSortDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer) (*widgets.ClickableBox, string) { var txTable widgets.Table var allTxSortNames = []string{"Newest", "Oldest"} var allTxSortFilters = map[string]bool{ @@ -291,16 +286,10 @@ func txSortDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, t txSortFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txSortFilterListWidget), window.Canvas()) txSortFilterSelectionPopup.Hide() - // icons, err := assets.GetIcons(assets.CollapseIcon) - // if err != nil { - // errorMessage := fmt.Sprintf("Error: %s", err.Error()) - // return nil, errorMessage - // } - txSortFilterTab := widget.NewHBox( selectedTxSortFilterLabel, widgets.NewHSpacer(10), - widget.NewIcon(icons[assets.CollapseIcon]), + widget.NewIcon(txHistory.icons[assets.CollapseIcon]), ) var txSortFilterDropDown *widgets.ClickableBox @@ -362,9 +351,11 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, multiWallet *dcrlib trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] txForTrimmedHash := tx.Hash + txDirectionLabel := widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}) + txDirectionIcon := widget.NewIcon(txHistory.icons[txDirectionIcon(tx.Direction)]) txBox = append(txBox, widget.NewHBox( widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewHBox(txDirectionIcon, txDirectionLabel), widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), @@ -629,3 +620,16 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), window.Canvas()) } + +func txDirectionIcon(direction int32) string { + switch direction { + case 0: + return assets.SendIcon + case 1: + return assets.ReceiveIcon + case 2: + return assets.ReceiveIcon + default: + return assets.InfoIcon + } +} From 77776e13cbb8e54cf733889d058a9614f9638357 Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 18 Dec 2019 16:34:44 +0100 Subject: [PATCH 48/73] fixed issues with history table when a diiferent wallet is selected --- fyne/pages/history.go | 165 ++++++++++++++++++++---------------------- 1 file changed, 79 insertions(+), 86 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 4108be68a..49d69e1f8 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -24,14 +24,19 @@ import ( const txPerPage int32 = 25 type txHistoryPageData struct { - txTable widgets.Table - allTxCount int - selectedFilterId int32 - errorLabel *widget.Label - TotalTxFetched int32 - selectedWalletID int - selectedtxSort bool - icons map[string]*fyne.StaticResource + txTable widgets.Table + allTxCount int + selectedFilterId int32 + errorLabel *widget.Label + TotalTxFetched int32 + selectedWalletID int + selectedtxSort bool + walletListWidget *widget.Box + txFilterTab *widget.Box + txSortFilterTab *widget.Box + txFilterSelectionPopup *widget.PopUp + txSortFilterSelectionPopup *widget.PopUp + icons map[string]*fyne.StaticResource } var txHistory txHistoryPageData @@ -78,25 +83,31 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { widget.NewHBox(pageTitleLabel, widgets.NewHSpacer(110), infoIcon), widgets.NewVSpacer(5), ) + txHistory.walletListWidget = widget.NewHBox() - walletList, txFilterDropDown, errorMessage := txFilterDropDown(app.MultiWallet, app.Window, app.tabMenu) - if errorMessage != "" { - errorHandler(errorMessage, txHistory.errorLabel) - txHistoryPageOutput.Append(txHistory.errorLabel) - return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) - } + txWalletList(app.MultiWallet, app.Window, app.tabMenu, txHistory.walletListWidget) + txSortDropDown(app.MultiWallet, app.Window, app.tabMenu) - txSortFilterDropDown, errorMessage := txSortDropDown(app.MultiWallet, app.Window, app.tabMenu) - if errorMessage != "" { - errorHandler(errorMessage, txHistory.errorLabel) - txHistoryPageOutput.Append(txHistory.errorLabel) - return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) - } + txHistoryPageOutput.Append(txHistory.walletListWidget) + + var txSortFilterDropDown *widgets.ClickableBox + txSortFilterDropDown = widgets.NewClickableBox(txHistory.txSortFilterTab, func() { + txHistory.txSortFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( + txSortFilterDropDown).Add(fyne.NewPos(0, txSortFilterDropDown.Size().Height))) + txHistory.txSortFilterSelectionPopup.Show() + }) - txTableHeader(app.MultiWallet, &txHistory.txTable, app.Window) - fetchTx(&txHistory.txTable, 0, dcrlibwallet.TxFilterAll, app.MultiWallet, app.Window, app.tabMenu, false) + var txFilterDropDown *widgets.ClickableBox + txFilterDropDown = widgets.NewClickableBox(txHistory.txFilterTab, func() { + // if len(txFilterListWidget.Children) == 0 { + // txFilterSelectionPopup.Hide() + // } else { + txHistory.txFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( + txFilterDropDown).Add(fyne.NewPos(0, txFilterDropDown.Size().Height))) + txHistory.txFilterSelectionPopup.Show() + // } + }) - txHistoryPageOutput.Append(walletList) txHistoryPageOutput.Append(widget.NewHBox(txSortFilterDropDown, widgets.NewHSpacer(30), txFilterDropDown)) txHistoryPageOutput.Append(txHistory.errorLabel) txHistoryPageOutput.Append(widgets.NewVSpacer(5)) @@ -106,19 +117,18 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } -func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer) (*widget.Box, *widgets.ClickableBox, string) { +func txWalletList(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer, walletListWidget *widget.Box) { var txTable widgets.Table - walletsID := multiWallet.OpenedWalletIDsRaw() if len(walletsID) == 0 { - return nil, nil, "Could not retrieve wallets" + errorHandler("Could not retrieve wallets", txHistory.errorLabel) } sort.Ints(walletsID) - // default wallet selected - txHistory.selectedWalletID = walletsID[0] + txFilterDropDown(multiWallet, window, tabMenu, walletsID[0]) + txTableHeader(multiWallet, &txHistory.txTable, window) + fetchTx(&txHistory.txTable, 0, dcrlibwallet.TxFilterAll, multiWallet, window, tabMenu, false) - walletListWidget := widget.NewHBox() for _, walletID := range walletsID { wallet := multiWallet.WalletWithID(walletID) if wallet == nil { @@ -145,27 +155,31 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, // working on hiding line walletListWidget.Append(widgets.NewClickableBox(walletView, func() { - for _, children := range walletView.Children { - if box, ok := children.(*widget.Box); !ok { - continue - } else { - if len(box.Children) != 2 { - continue - } - if line, ok := box.Children[1].(*canvas.Line); !ok { - continue - } else { - line.Hide() - } - } - } - - txHistory.selectedWalletID = individualWalletID + // for _, children := range walletView.Children { + // if box, ok := children.(*widget.Box); !ok { + // continue + // } else { + // if len(box.Children) != 2 { + // continue + // } + // box.Children[1].Hide() + // } + // } + + selectedWalletLine.Show() + txHistory.selectedFilterId = dcrlibwallet.TxFilterAll + txFilterDropDown(multiWallet, window, tabMenu, individualWalletID) + txTableHeader(multiWallet, &txTable, window) + fetchTx(&txTable, 0, txHistory.selectedFilterId, multiWallet, window, tabMenu, false) + widget.Refresh(txHistory.txTable.Result) })) + walletListWidget.Append(widgets.NewHSpacer(8)) } +} - var txFilterSelectionPopup *widget.PopUp +func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer, walletId int) { + var txTable widgets.Table txFilterListWidget := widget.NewVBox() var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} @@ -177,24 +191,25 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, "Coinbase": dcrlibwallet.TxFilterCoinBase, "Staking": dcrlibwallet.TxFilterStaking, } + if walletId != txHistory.selectedWalletID { + txHistory.selectedWalletID = walletId + } txCountForFilter, err := multiWallet.WalletWithID(txHistory.selectedWalletID).CountTransactions(allTxFilters["All"]) if err != nil { errorMessage := fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter All: %s", err.Error()) - return nil, nil, errorMessage + errorHandler(errorMessage, txHistory.errorLabel) } txHistory.allTxCount = txCountForFilter - selectedTxFilterLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) for _, filterName := range allTxFilterNames { filterId := allTxFilters[filterName] txCountForFilter, err := multiWallet.WalletWithID(txHistory.selectedWalletID).CountTransactions(filterId) if err != nil { - errorMessage := fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter %s: %s", - filterName, err.Error()) - return nil, nil, errorMessage + errorMessage := fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter %s: %s", filterName, err.Error()) + errorHandler(errorMessage, txHistory.errorLabel) } if txCountForFilter > 0 { filter := fmt.Sprintf("%s (%d)", filterName, txCountForFilter) @@ -214,41 +229,28 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, if selectedFilterId != txHistory.selectedFilterId { selectedTxFilterLabel.SetText(filter) txTableHeader(multiWallet, &txTable, window) - txHistory.txTable.Result.Children = txTable.Result.Children fetchTx(&txTable, 0, selectedFilterId, multiWallet, window, tabMenu, false) widget.Refresh(txHistory.txTable.Result) } - txFilterSelectionPopup.Hide() + txHistory.txFilterSelectionPopup.Hide() })) } } // txFilterSelectionPopup create a popup that has tx filter name and tx count - txFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txFilterListWidget), window.Canvas()) - txFilterSelectionPopup.Hide() + txHistory.txFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txFilterListWidget), window.Canvas()) + txHistory.txFilterSelectionPopup.Hide() - txFilterTab := widget.NewHBox( + txHistory.txFilterTab = widget.NewHBox( selectedTxFilterLabel, - widgets.NewHSpacer(60), + widgets.NewHSpacer(10), widget.NewIcon(txHistory.icons[assets.CollapseIcon]), ) - - var txFilterDropDown *widgets.ClickableBox - txFilterDropDown = widgets.NewClickableBox(txFilterTab, func() { - if len(txFilterListWidget.Children) == 0 { - txFilterSelectionPopup.Hide() - } else { - txFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( - txFilterDropDown).Add(fyne.NewPos(0, txFilterDropDown.Size().Height))) - txFilterSelectionPopup.Show() - } - }) - - return walletListWidget, txFilterDropDown, "" + widget.Refresh(txHistory.txFilterTab) } -func txSortDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer) (*widgets.ClickableBox, string) { +func txSortDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer) { var txTable widgets.Table var allTxSortNames = []string{"Newest", "Oldest"} var allTxSortFilters = map[string]bool{ @@ -259,7 +261,6 @@ func txSortDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, t selectedTxSortFilterLabel := widget.NewLabel("Newest") txHistory.selectedtxSort = allTxSortFilters["Newest"] - var txSortFilterSelectionPopup *widget.PopUp txSortFilterListWidget := widget.NewVBox() for _, sortName := range allTxSortNames { txSortView := widget.NewHBox( @@ -278,28 +279,19 @@ func txSortDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, t txHistory.txTable.Result.Children = txTable.Result.Children fetchTx(&txTable, 0, txHistory.selectedFilterId, multiWallet, window, tabMenu, false) widget.Refresh(txHistory.txTable.Result) - txSortFilterSelectionPopup.Hide() + txHistory.txSortFilterSelectionPopup.Hide() })) } // txSortFilterSelectionPopup create a popup that has tx filter name and tx count - txSortFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txSortFilterListWidget), window.Canvas()) - txSortFilterSelectionPopup.Hide() + txHistory.txSortFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txSortFilterListWidget), window.Canvas()) + txHistory.txSortFilterSelectionPopup.Hide() - txSortFilterTab := widget.NewHBox( + txHistory.txSortFilterTab = widget.NewHBox( selectedTxSortFilterLabel, widgets.NewHSpacer(10), widget.NewIcon(txHistory.icons[assets.CollapseIcon]), ) - - var txSortFilterDropDown *widgets.ClickableBox - txSortFilterDropDown = widgets.NewClickableBox(txSortFilterTab, func() { - txSortFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( - txSortFilterDropDown).Add(fyne.NewPos(0, txSortFilterDropDown.Size().Height))) - txSortFilterSelectionPopup.Show() - }) - - return txSortFilterDropDown, "" } func txTableHeader(wallet *dcrlibwallet.MultiWallet, txTable *widgets.Table, window fyne.Window) { @@ -316,7 +308,7 @@ func txTableHeader(wallet *dcrlibwallet.MultiWallet, txTable *widgets.Table, win var hBox []*widget.Box txTable.NewTable(tableHeading, hBox...) - + txHistory.txTable.Result.Children = txTable.Result.Children return } @@ -375,6 +367,7 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, multiWallet *dcrlib txHistory.txTable.Result.Children = txTable.Result.Children widget.Refresh(txHistory.txTable.Result) widget.Refresh(txHistory.txTable.Container) + txHistory.txTable.Container.Show() time.AfterFunc(time.Second*8, func() { updateTable(multiWallet, window, tabMenu) From ffbc3394f269babf44d0e839f9c6bfdfef5f18ac Mon Sep 17 00:00:00 2001 From: morrison Date: Thu, 19 Dec 2019 15:26:56 +0100 Subject: [PATCH 49/73] fixed issues with txDropdown and txSort Labels not reflecting the current wallet changes --- fyne/pages/history.go | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 49d69e1f8..31c208ef6 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -28,6 +28,8 @@ type txHistoryPageData struct { allTxCount int selectedFilterId int32 errorLabel *widget.Label + selectedTxFilterLabel *widget.Label + selectedTxSortFilterLabel *widget.Label TotalTxFetched int32 selectedWalletID int selectedtxSort bool @@ -46,6 +48,8 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { txHistory.errorLabel.Hide() txHistory.selectedFilterId = dcrlibwallet.TxFilterAll + txHistory.selectedTxFilterLabel = widget.NewLabel("") + txHistory.selectedTxSortFilterLabel = widget.NewLabel("") icons, err := assets.GetIcons(assets.CollapseIcon, assets.InfoIcon, assets.SendIcon, assets.ReceiveIcon, assets.ReceiveIcon, assets.InfoIcon) if err != nil { @@ -128,6 +132,7 @@ func txWalletList(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tab txFilterDropDown(multiWallet, window, tabMenu, walletsID[0]) txTableHeader(multiWallet, &txHistory.txTable, window) fetchTx(&txHistory.txTable, 0, dcrlibwallet.TxFilterAll, multiWallet, window, tabMenu, false) + txSortDropDown(multiWallet, window, tabMenu) for _, walletID := range walletsID { wallet := multiWallet.WalletWithID(walletID) @@ -169,6 +174,7 @@ func txWalletList(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tab selectedWalletLine.Show() txHistory.selectedFilterId = dcrlibwallet.TxFilterAll txFilterDropDown(multiWallet, window, tabMenu, individualWalletID) + txSortDropDown(multiWallet, window, tabMenu) txTableHeader(multiWallet, &txTable, window) fetchTx(&txTable, 0, txHistory.selectedFilterId, multiWallet, window, tabMenu, false) widget.Refresh(txHistory.txTable.Result) @@ -202,7 +208,7 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, } txHistory.allTxCount = txCountForFilter - selectedTxFilterLabel := widget.NewLabel(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) + txHistory.selectedTxFilterLabel.SetText(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) for _, filterName := range allTxFilterNames { filterId := allTxFilters[filterName] @@ -227,7 +233,7 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, } if selectedFilterId != txHistory.selectedFilterId { - selectedTxFilterLabel.SetText(filter) + txHistory.selectedTxFilterLabel.SetText(filter) txTableHeader(multiWallet, &txTable, window) fetchTx(&txTable, 0, selectedFilterId, multiWallet, window, tabMenu, false) widget.Refresh(txHistory.txTable.Result) @@ -243,7 +249,7 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, txHistory.txFilterSelectionPopup.Hide() txHistory.txFilterTab = widget.NewHBox( - selectedTxFilterLabel, + txHistory.selectedTxFilterLabel, widgets.NewHSpacer(10), widget.NewIcon(txHistory.icons[assets.CollapseIcon]), ) @@ -258,7 +264,7 @@ func txSortDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, t "Oldest": false, } - selectedTxSortFilterLabel := widget.NewLabel("Newest") + txHistory.selectedTxSortFilterLabel.SetText("Newest") txHistory.selectedtxSort = allTxSortFilters["Newest"] txSortFilterListWidget := widget.NewVBox() @@ -272,7 +278,7 @@ func txSortDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, t newSortName := sortName txSortFilterListWidget.Append(widgets.NewClickableBox(txSortView, func() { - selectedTxSortFilterLabel.SetText(newSortName) + txHistory.selectedTxSortFilterLabel.SetText(newSortName) txHistory.selectedtxSort = txSort txTableHeader(multiWallet, &txTable, window) @@ -288,7 +294,7 @@ func txSortDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, t txHistory.txSortFilterSelectionPopup.Hide() txHistory.txSortFilterTab = widget.NewHBox( - selectedTxSortFilterLabel, + txHistory.selectedTxSortFilterLabel, widgets.NewHSpacer(10), widget.NewIcon(txHistory.icons[assets.CollapseIcon]), ) From e78054f46559568112007a7c30a56bd54cf48d83 Mon Sep 17 00:00:00 2001 From: morrison Date: Fri, 20 Dec 2019 06:00:59 +0100 Subject: [PATCH 50/73] fixed panic when there is an error, changed wallet list to a dropdown, hide dropdowns when lenght of tx is less than or equal to one --- fyne/pages/history.go | 128 ++++++++++++++++++++++++++---------------- 1 file changed, 80 insertions(+), 48 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 31c208ef6..084c9439a 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -30,14 +30,17 @@ type txHistoryPageData struct { errorLabel *widget.Label selectedTxFilterLabel *widget.Label selectedTxSortFilterLabel *widget.Label + selectedWalletLabel *widget.Label TotalTxFetched int32 selectedWalletID int selectedtxSort bool - walletListWidget *widget.Box + walletListTab *widget.Box txFilterTab *widget.Box txSortFilterTab *widget.Box txFilterSelectionPopup *widget.PopUp txSortFilterSelectionPopup *widget.PopUp + txWalletSelectionPopup *widget.PopUp + errorMessage string icons map[string]*fyne.StaticResource } @@ -48,6 +51,7 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { txHistory.errorLabel.Hide() txHistory.selectedFilterId = dcrlibwallet.TxFilterAll + txHistory.selectedWalletLabel = widget.NewLabel("") txHistory.selectedTxFilterLabel = widget.NewLabel("") txHistory.selectedTxSortFilterLabel = widget.NewLabel("") @@ -59,9 +63,10 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { } txHistory.icons = icons + // history page title label pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - // infoIcon holds receiving decred hint-text + // infoIcon holds history page hint-text var infoIcon *widgets.ImageButton info := "- Tap Hash to view Transaction details.\n\n- Tap Blue Text to Copy." infoIcon = widgets.NewImageButton(txHistory.icons[assets.InfoIcon], nil, func() { @@ -82,17 +87,21 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { infoPopUp.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject(infoIcon).Add(fyne.NewPos(0, infoIcon.Size().Height))) }) + // history output widget txHistoryPageOutput := widget.NewVBox( widgets.NewVSpacer(5), widget.NewHBox(pageTitleLabel, widgets.NewHSpacer(110), infoIcon), widgets.NewVSpacer(5), ) - txHistory.walletListWidget = widget.NewHBox() - txWalletList(app.MultiWallet, app.Window, app.tabMenu, txHistory.walletListWidget) - txSortDropDown(app.MultiWallet, app.Window, app.tabMenu) + txWalletList(app.MultiWallet, app.Window, app.tabMenu) - txHistoryPageOutput.Append(txHistory.walletListWidget) + var walletDropDown *widgets.ClickableBox + walletDropDown = widgets.NewClickableBox(txHistory.walletListTab, func() { + txHistory.txWalletSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( + walletDropDown).Add(fyne.NewPos(0, walletDropDown.Size().Height))) + txHistory.txWalletSelectionPopup.Show() + }) var txSortFilterDropDown *widgets.ClickableBox txSortFilterDropDown = widgets.NewClickableBox(txHistory.txSortFilterTab, func() { @@ -103,85 +112,106 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { var txFilterDropDown *widgets.ClickableBox txFilterDropDown = widgets.NewClickableBox(txHistory.txFilterTab, func() { - // if len(txFilterListWidget.Children) == 0 { - // txFilterSelectionPopup.Hide() - // } else { - txHistory.txFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( - txFilterDropDown).Add(fyne.NewPos(0, txFilterDropDown.Size().Height))) - txHistory.txFilterSelectionPopup.Show() - // } + if txHistory.allTxCount == 0 { + txHistory.txFilterSelectionPopup.Hide() + } else { + txHistory.txFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( + txFilterDropDown).Add(fyne.NewPos(0, txFilterDropDown.Size().Height))) + txHistory.txFilterSelectionPopup.Show() + } }) + if txHistory.errorMessage != "" { + errorHandler(txHistory.errorMessage, txHistory.errorLabel) + txHistoryPageOutput.Append(txHistory.errorLabel) + return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) + } + + txHistoryPageOutput.Append(walletDropDown) txHistoryPageOutput.Append(widget.NewHBox(txSortFilterDropDown, widgets.NewHSpacer(30), txFilterDropDown)) - txHistoryPageOutput.Append(txHistory.errorLabel) txHistoryPageOutput.Append(widgets.NewVSpacer(5)) + txHistoryPageOutput.Append(txHistory.errorLabel) txHistoryPageOutput.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txHistory.txTable.Container.MinSize().Width, txHistory.txTable.Container.MinSize().Height+450)), txHistory.txTable.Container)) txHistoryPageOutput.Append(widgets.NewVSpacer(15)) return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } -func txWalletList(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer, walletListWidget *widget.Box) { +func txWalletList(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer) { var txTable widgets.Table + walletListWidget := widget.NewVBox() + walletsID := multiWallet.OpenedWalletIDsRaw() if len(walletsID) == 0 { - errorHandler("Could not retrieve wallets", txHistory.errorLabel) + txHistory.errorMessage = "Could not retrieve wallets" + return } sort.Ints(walletsID) + txHistory.selectedWalletLabel.SetText(multiWallet.WalletWithID(walletsID[0]).Name) + txFilterDropDown(multiWallet, window, tabMenu, walletsID[0]) txTableHeader(multiWallet, &txHistory.txTable, window) fetchTx(&txHistory.txTable, 0, dcrlibwallet.TxFilterAll, multiWallet, window, tabMenu, false) txSortDropDown(multiWallet, window, tabMenu) - for _, walletID := range walletsID { + for index, walletID := range walletsID { wallet := multiWallet.WalletWithID(walletID) if wallet == nil { continue } - selectedWalletLine := canvas.NewLine(color.RGBA{0xbd, 0xbd, 0xbd, 0xff}) - selectedWalletLine.StrokeWidth = 1.5 - if walletID != walletsID[0] { - selectedWalletLine.Hide() + checkmarkIcon := widget.NewIcon(theme.ConfirmIcon()) + if index != 0 || walletID != walletsID[0] { + checkmarkIcon.Hide() } - walletContainer := widget.NewVBox( + walletContainer := widget.NewHBox( widget.NewLabel(wallet.Name), - selectedWalletLine, - ) - - walletView := widget.NewHBox( - walletContainer, + checkmarkIcon, widgets.NewHSpacer(5), ) individualWalletID := walletID - // working on hiding line - walletListWidget.Append(widgets.NewClickableBox(walletView, func() { - // for _, children := range walletView.Children { - // if box, ok := children.(*widget.Box); !ok { - // continue - // } else { - // if len(box.Children) != 2 { - // continue - // } - // box.Children[1].Hide() - // } - // } - - selectedWalletLine.Show() + walletListWidget.Append(widgets.NewClickableBox(walletContainer, func() { + // hide checkmark icon of other accounts + for _, children := range walletListWidget.Children { + if box, ok := children.(*widgets.ClickableBox); !ok { + continue + } else { + if len(box.Children) != 3 { + continue + } + + if icon, ok := box.Children[1].(*widget.Icon); !ok { + continue + } else { + icon.Hide() + } + } + } + + checkmarkIcon.Show() + txHistory.selectedWalletLabel.SetText(wallet.Name) txHistory.selectedFilterId = dcrlibwallet.TxFilterAll txFilterDropDown(multiWallet, window, tabMenu, individualWalletID) txSortDropDown(multiWallet, window, tabMenu) txTableHeader(multiWallet, &txTable, window) fetchTx(&txTable, 0, txHistory.selectedFilterId, multiWallet, window, tabMenu, false) - widget.Refresh(txHistory.txTable.Result) + txHistory.txWalletSelectionPopup.Hide() })) - - walletListWidget.Append(widgets.NewHSpacer(8)) } + + // txWalletSelectionPopup create a popup that has tx wallet + txHistory.txWalletSelectionPopup = widget.NewPopUp(widget.NewVBox(walletListWidget), window.Canvas()) + txHistory.txWalletSelectionPopup.Hide() + + txHistory.walletListTab = widget.NewHBox( + txHistory.selectedWalletLabel, + widgets.NewHSpacer(10), + widget.NewIcon(txHistory.icons[assets.CollapseIcon]), + ) } func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer, walletId int) { @@ -203,8 +233,8 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, txCountForFilter, err := multiWallet.WalletWithID(txHistory.selectedWalletID).CountTransactions(allTxFilters["All"]) if err != nil { - errorMessage := fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter All: %s", err.Error()) - errorHandler(errorMessage, txHistory.errorLabel) + txHistory.errorMessage = fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter All: %s", err.Error()) + return } txHistory.allTxCount = txCountForFilter @@ -214,8 +244,8 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, filterId := allTxFilters[filterName] txCountForFilter, err := multiWallet.WalletWithID(txHistory.selectedWalletID).CountTransactions(filterId) if err != nil { - errorMessage := fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter %s: %s", filterName, err.Error()) - errorHandler(errorMessage, txHistory.errorLabel) + txHistory.errorMessage = fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter %s: %s", filterName, err.Error()) + return } if txCountForFilter > 0 { filter := fmt.Sprintf("%s (%d)", filterName, txCountForFilter) @@ -298,6 +328,7 @@ func txSortDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, t widgets.NewHSpacer(10), widget.NewIcon(txHistory.icons[assets.CollapseIcon]), ) + widget.Refresh(txHistory.txSortFilterTab) } func txTableHeader(wallet *dcrlibwallet.MultiWallet, txTable *widgets.Table, window fyne.Window) { @@ -331,6 +362,7 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, multiWallet *dcrlib txHistory.txTable.Container.Hide() return } + if len(txns) == 0 { errorHandler("No transactions yet.", txHistory.errorLabel) txHistory.txTable.Container.Hide() From e7c6888f21e48a8f6d286c62934104fbc1159be0 Mon Sep 17 00:00:00 2001 From: morrison Date: Fri, 20 Dec 2019 06:51:45 +0100 Subject: [PATCH 51/73] cleaned up code --- cli/go.sum | 1 - fyne/helpers/amount.go | 59 ------------------------- fyne/pages/history.go | 91 +++++++++++++++++++++------------------ terminal/pages/history.go | 2 +- 4 files changed, 51 insertions(+), 102 deletions(-) delete mode 100644 fyne/helpers/amount.go diff --git a/cli/go.sum b/cli/go.sum index 3acbe15f1..c5edaa216 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -14,7 +14,6 @@ github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0 github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= github.com/asdine/storm v0.0.0-20190216191021-fe89819f6282 h1:DmSVc81daQAPvXwcCZi0W6A14sTCYQ1QI21C0E37KoY= github.com/asdine/storm v0.0.0-20190216191021-fe89819f6282/go.mod h1:cMLKpjHSP4q0P133fV15ojQgwWWB2IMv+hrFsmBF/wI= -github.com/atotto/clipboard v0.1.2 h1:YZCtFu5Ie8qX2VmVTBnrqLSiU9XOWwqNRmdT3gIQzbY= github.com/atotto/clipboard v0.1.2/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= diff --git a/fyne/helpers/amount.go b/fyne/helpers/amount.go deleted file mode 100644 index 83ed14f61..000000000 --- a/fyne/helpers/amount.go +++ /dev/null @@ -1,59 +0,0 @@ -package helpers - -import ( - "fmt" - "math" - "strconv" - "strings" - - "github.com/decred/dcrd/dcrutil" -) - -func DecimalPortion(n float64) string { - decimalPlaces := fmt.Sprintf("%f", n-math.Floor(n)) // produces 0.xxxx0000 - decimalPlaces = strings.Replace(decimalPlaces, "0.", "", -1) // remove 0. - decimalPlaces = strings.TrimRight(decimalPlaces, "0") // remove trailing 0s - return decimalPlaces -} - -func SplitAmountIntoParts(amount float64) []string { - balanceParts := make([]string, 3) - - wholeNumber := int(math.Floor(amount)) - balanceParts[0] = strconv.Itoa(wholeNumber) - - decimalPortion := DecimalPortion(amount) - if len(decimalPortion) == 0 { - balanceParts[2] = " DCR" - } else if len(decimalPortion) <= 2 { - balanceParts[1] = fmt.Sprintf(".%s DCR", decimalPortion) - } else { - balanceParts[1] = fmt.Sprintf(".%s", decimalPortion[0:2]) - balanceParts[2] = fmt.Sprintf("%s DCR", decimalPortion[2:]) - } - - return balanceParts -} - -func MaxDecimalPlaces(amounts []int64) (maxDecimalPlaces int) { - for _, amount := range amounts { - decimalPortion := DecimalPortion(dcrutil.Amount(amount).ToCoin()) - nDecimalPlaces := len(decimalPortion) - if nDecimalPlaces > maxDecimalPlaces { - maxDecimalPlaces = nDecimalPlaces - } - } - return -} - -func FormatAmountDisplay(amount int64, maxDecimalPlaces int) string { - dcrAmount := dcrutil.Amount(amount).ToCoin() - wholeNumber := int(math.Floor(dcrAmount)) - decimalPortion := DecimalPortion(dcrAmount) - - if len(decimalPortion) == 0 { - return fmt.Sprintf("%2d%-*s DCR", wholeNumber, maxDecimalPlaces+1, decimalPortion) - } else { - return fmt.Sprintf("%2d.%-*s DCR", wholeNumber, maxDecimalPlaces, decimalPortion) - } -} diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 084c9439a..3067e9f46 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -24,23 +24,23 @@ import ( const txPerPage int32 = 25 type txHistoryPageData struct { - txTable widgets.Table allTxCount int + selectedWalletID int selectedFilterId int32 - errorLabel *widget.Label - selectedTxFilterLabel *widget.Label - selectedTxSortFilterLabel *widget.Label - selectedWalletLabel *widget.Label TotalTxFetched int32 - selectedWalletID int selectedtxSort bool + errorMessage string walletListTab *widget.Box txFilterTab *widget.Box txSortFilterTab *widget.Box + txTable widgets.Table + errorLabel *widget.Label + selectedTxFilterLabel *widget.Label + selectedTxSortFilterLabel *widget.Label + selectedWalletLabel *widget.Label txFilterSelectionPopup *widget.PopUp txSortFilterSelectionPopup *widget.PopUp txWalletSelectionPopup *widget.PopUp - errorMessage string icons map[string]*fyne.StaticResource } @@ -55,6 +55,7 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { txHistory.selectedTxFilterLabel = widget.NewLabel("") txHistory.selectedTxSortFilterLabel = widget.NewLabel("") + // gets all icons used on this page icons, err := assets.GetIcons(assets.CollapseIcon, assets.InfoIcon, assets.SendIcon, assets.ReceiveIcon, assets.ReceiveIcon, assets.InfoIcon) if err != nil { errorMessage := fmt.Sprintf("Error: %s", err.Error()) @@ -66,8 +67,8 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { // history page title label pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - // infoIcon holds history page hint-text - var infoIcon *widgets.ImageButton + // infoPopUp creates a popup with history page hint-text + var infoPopUp *widgets.ImageButton info := "- Tap Hash to view Transaction details.\n\n- Tap Blue Text to Copy." infoIcon = widgets.NewImageButton(txHistory.icons[assets.InfoIcon], nil, func() { infoLabel := widget.NewLabelWithStyle(info, fyne.TextAlignLeading, fyne.TextStyle{Monospace: true}) @@ -94,8 +95,10 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { widgets.NewVSpacer(5), ) + // initialize history page data txWalletList(app.MultiWallet, app.Window, app.tabMenu) + // walletDropDown creates a popup like dropdown that holds the list of available wallets. var walletDropDown *widgets.ClickableBox walletDropDown = widgets.NewClickableBox(txHistory.walletListTab, func() { txHistory.txWalletSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( @@ -103,13 +106,7 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { txHistory.txWalletSelectionPopup.Show() }) - var txSortFilterDropDown *widgets.ClickableBox - txSortFilterDropDown = widgets.NewClickableBox(txHistory.txSortFilterTab, func() { - txHistory.txSortFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( - txSortFilterDropDown).Add(fyne.NewPos(0, txSortFilterDropDown.Size().Height))) - txHistory.txSortFilterSelectionPopup.Show() - }) - + // txFilterDropDown creates a popup like dropdown that holds the list of tx filters. var txFilterDropDown *widgets.ClickableBox txFilterDropDown = widgets.NewClickableBox(txHistory.txFilterTab, func() { if txHistory.allTxCount == 0 { @@ -121,6 +118,19 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { } }) + // txSortFilterDropDown creates a popup like dropdown that holds the list of sort filters. + var txSortFilterDropDown *widgets.ClickableBox + txSortFilterDropDown = widgets.NewClickableBox(txHistory.txSortFilterTab, func() { + if txHistory.allTxCount == 0 { + txHistory.txSortFilterSelectionPopup.Hide() + } else { + txHistory.txSortFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( + txSortFilterDropDown).Add(fyne.NewPos(0, txSortFilterDropDown.Size().Height))) + txHistory.txSortFilterSelectionPopup.Show() + } + }) + + // catch all errors when trying to setup and render tx page data. if txHistory.errorMessage != "" { errorHandler(txHistory.errorMessage, txHistory.errorLabel) txHistoryPageOutput.Append(txHistory.errorLabel) @@ -151,9 +161,9 @@ func txWalletList(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tab txHistory.selectedWalletLabel.SetText(multiWallet.WalletWithID(walletsID[0]).Name) txFilterDropDown(multiWallet, window, tabMenu, walletsID[0]) + txSortDropDown(multiWallet, window, tabMenu) txTableHeader(multiWallet, &txHistory.txTable, window) fetchTx(&txHistory.txTable, 0, dcrlibwallet.TxFilterAll, multiWallet, window, tabMenu, false) - txSortDropDown(multiWallet, window, tabMenu) for index, walletID := range walletsID { wallet := multiWallet.WalletWithID(walletID) @@ -227,6 +237,7 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, "Coinbase": dcrlibwallet.TxFilterCoinBase, "Staking": dcrlibwallet.TxFilterStaking, } + if walletId != txHistory.selectedWalletID { txHistory.selectedWalletID = walletId } @@ -282,6 +293,7 @@ func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, txHistory.selectedTxFilterLabel, widgets.NewHSpacer(10), widget.NewIcon(txHistory.icons[assets.CollapseIcon]), + widgets.NewHSpacer(10), ) widget.Refresh(txHistory.txFilterTab) } @@ -364,7 +376,7 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, multiWallet *dcrlib } if len(txns) == 0 { - errorHandler("No transactions yet.", txHistory.errorLabel) + errorHandler(fmt.Sprintf("No transactions for %s yet.", multiWallet.WalletWithID(txHistory.selectedWalletID).Name), txHistory.errorLabel) txHistory.txTable.Container.Hide() return } @@ -421,7 +433,6 @@ func updateTable(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabM if txHistory.allTxCount > int(txHistory.TotalTxFetched) { if txHistory.txTable.Container.Offset.Y == 0 { - time.AfterFunc(time.Second*8, func() { updateTable(multiWallet, window, tabMenu) }) @@ -455,10 +466,9 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f } }) - var txDetailsPopUp *widget.PopUp - txDetailslabel := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) + var txDetailsPopUp *widget.PopUp minimizeIcon := widgets.NewImageButton(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) errorMessageLabel := widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) @@ -504,11 +514,6 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f status = "Pending" } - tableConfirmations := widget.NewHBox( - widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - copyAbleText := func(text string, copyAble bool) *widgets.ClickableBox { var textToCopy *canvas.Text if copyAble { @@ -534,6 +539,11 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f ) } + tableConfirmations := widget.NewHBox( + widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableHash := widget.NewHBox( widget.NewLabelWithStyle("Transaction ID:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), copyAbleText(txDetails.Hash, true), @@ -576,20 +586,6 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(txDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), ) - tableData := widget.NewVBox( - tableConfirmations, - tableHash, - tableBlockHeight, - tableDirection, - tableType, - tableAmount, - tableSize, - tableFee, - tableFeeRate, - tableStatus, - tableDate, - ) - var txInput widgets.Table inputTableColumnLabels := widget.NewHBox( widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -624,6 +620,20 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f } txOutput.NewTable(outputTableColumnLabels, outputBox...) + tableData := widget.NewVBox( + tableConfirmations, + tableHash, + tableBlockHeight, + tableDirection, + tableType, + tableAmount, + tableSize, + tableFee, + tableFeeRate, + tableStatus, + tableDate, + ) + txDetailsData := widget.NewVBox( widgets.NewHSpacer(10), tableData, @@ -636,7 +646,6 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f ) txDetailsScrollContainer := widget.NewScrollContainer(txDetailsData) - //fixing exit icon txDetailsOutput := widget.NewVBox( widgets.NewHSpacer(10), widget.NewHBox( diff --git a/terminal/pages/history.go b/terminal/pages/history.go index 9b66225aa..c9e303186 100644 --- a/terminal/pages/history.go +++ b/terminal/pages/history.go @@ -20,7 +20,7 @@ const ( MessageKindInfo ) -const txPerPage int32 = 10 +const txPerPage int32 = 25 var historyPageData struct { pageContentHolder *tview.Flex From fc7fa45d6224f18954165113b2fa99d8a0997b5e Mon Sep 17 00:00:00 2001 From: morrison Date: Fri, 20 Dec 2019 07:51:38 +0100 Subject: [PATCH 52/73] removed repeated codes, rebased pr and cleaned up code --- fyne/helpers/helpers.go | 24 ++++++++++++++++++++++++ fyne/pages/history.go | 32 +++++++++----------------------- fyne/pages/overview.go | 16 ++-------------- 3 files changed, 35 insertions(+), 37 deletions(-) create mode 100644 fyne/helpers/helpers.go diff --git a/fyne/helpers/helpers.go b/fyne/helpers/helpers.go new file mode 100644 index 000000000..cf1a8afbe --- /dev/null +++ b/fyne/helpers/helpers.go @@ -0,0 +1,24 @@ +package helpers + +import ( + "fyne.io/fyne/widget" + "github.com/raedahgroup/godcr/fyne/assets" +) + +func TxDirectionIcon(direction int32) string { + switch direction { + case 0: + return assets.SendIcon + case 1: + return assets.ReceiveIcon + case 2: + return assets.ReceiveIcon + default: + return assets.InfoIcon + } +} + +func ErrorHandler(err string, errorLabel *widget.Label) { + errorLabel.SetText(err) + errorLabel.Show() +} diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 3067e9f46..1b5c83034 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -18,6 +18,7 @@ import ( "github.com/decred/dcrd/dcrutil" "github.com/raedahgroup/dcrlibwallet" "github.com/raedahgroup/godcr/fyne/assets" + "github.com/raedahgroup/godcr/fyne/helpers" "github.com/raedahgroup/godcr/fyne/widgets" ) @@ -59,7 +60,7 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { icons, err := assets.GetIcons(assets.CollapseIcon, assets.InfoIcon, assets.SendIcon, assets.ReceiveIcon, assets.ReceiveIcon, assets.InfoIcon) if err != nil { errorMessage := fmt.Sprintf("Error: %s", err.Error()) - errorHandler(errorMessage, txHistory.errorLabel) + helpers.ErrorHandler(errorMessage, txHistory.errorLabel) return widget.NewHBox(widgets.NewHSpacer(18), txHistory.errorLabel) } txHistory.icons = icons @@ -68,7 +69,7 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) // infoPopUp creates a popup with history page hint-text - var infoPopUp *widgets.ImageButton + var infoIcon *widgets.ImageButton info := "- Tap Hash to view Transaction details.\n\n- Tap Blue Text to Copy." infoIcon = widgets.NewImageButton(txHistory.icons[assets.InfoIcon], nil, func() { infoLabel := widget.NewLabelWithStyle(info, fyne.TextAlignLeading, fyne.TextStyle{Monospace: true}) @@ -90,7 +91,6 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { // history output widget txHistoryPageOutput := widget.NewVBox( - widgets.NewVSpacer(5), widget.NewHBox(pageTitleLabel, widgets.NewHSpacer(110), infoIcon), widgets.NewVSpacer(5), ) @@ -132,7 +132,7 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { // catch all errors when trying to setup and render tx page data. if txHistory.errorMessage != "" { - errorHandler(txHistory.errorMessage, txHistory.errorLabel) + helpers.ErrorHandler(txHistory.errorMessage, txHistory.errorLabel) txHistoryPageOutput.Append(txHistory.errorLabel) return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } @@ -370,13 +370,12 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, multiWallet *dcrlib txns, err := multiWallet.WalletWithID(txHistory.selectedWalletID).GetTransactionsRaw(txOffset, txPerPage, filter, txHistory.selectedtxSort) if err != nil { - errorHandler(fmt.Sprintf("Error getting transaction for Filter: %s", err.Error()), txHistory.errorLabel) + helpers.ErrorHandler(fmt.Sprintf("Error getting transaction for Filter: %s", err.Error()), txHistory.errorLabel) txHistory.txTable.Container.Hide() return } - if len(txns) == 0 { - errorHandler(fmt.Sprintf("No transactions for %s yet.", multiWallet.WalletWithID(txHistory.selectedWalletID).Name), txHistory.errorLabel) + helpers.ErrorHandler(fmt.Sprintf("No transactions for %s yet.", multiWallet.WalletWithID(txHistory.selectedWalletID).Name), txHistory.errorLabel) txHistory.txTable.Container.Hide() return } @@ -394,7 +393,7 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, multiWallet *dcrlib trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] txForTrimmedHash := tx.Hash txDirectionLabel := widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}) - txDirectionIcon := widget.NewIcon(txHistory.icons[txDirectionIcon(tx.Direction)]) + txDirectionIcon := widget.NewIcon(txHistory.icons[helpers.TxDirectionIcon(tx.Direction)]) txBox = append(txBox, widget.NewHBox( widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewHBox(txDirectionIcon, txDirectionLabel), @@ -489,14 +488,14 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f chainHash, err := chainhash.NewHashFromStr(hash) if err != nil { - errorHandler(fmt.Sprintf("fetching generating chainhash from for \n %s \n %s ", hash, err.Error()), errorMessageLabel) + helpers.ErrorHandler(fmt.Sprintf("fetching generating chainhash from for \n %s \n %s ", hash, err.Error()), errorMessageLabel) txDetailsErrorMethod() return } txDetails, err := multiWallet.WalletWithID(txHistory.selectedWalletID).GetTransactionRaw(chainHash[:]) if err != nil { - errorHandler(fmt.Sprintf("Error fetching transaction details for \n %s \n %s ", hash, err.Error()), errorMessageLabel) + helpers.ErrorHandler(fmt.Sprintf("Error fetching transaction details for \n %s \n %s ", hash, err.Error()), errorMessageLabel) txDetailsErrorMethod() return } @@ -660,16 +659,3 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), window.Canvas()) } - -func txDirectionIcon(direction int32) string { - switch direction { - case 0: - return assets.SendIcon - case 1: - return assets.ReceiveIcon - case 2: - return assets.ReceiveIcon - default: - return assets.InfoIcon - } -} diff --git a/fyne/pages/overview.go b/fyne/pages/overview.go index c56d1aa84..3e65daae9 100644 --- a/fyne/pages/overview.go +++ b/fyne/pages/overview.go @@ -16,6 +16,7 @@ import ( "github.com/raedahgroup/dcrlibwallet" "github.com/raedahgroup/godcr/fyne/assets" "github.com/raedahgroup/godcr/fyne/pages/handler/values" + "github.com/raedahgroup/godcr/fyne/helpers" "github.com/raedahgroup/godcr/fyne/widgets" ) @@ -95,7 +96,7 @@ func (ov *overview) recentTransactionBox() fyne.CanvasObject { fee := dcrutil.Amount(txn.Fee).String() timeDate := dcrlibwallet.ExtractDateOrTime(txn.Timestamp) status := transactionStatus(ov, txn) - table.Append(newTransactionRow(transactionIcon(txn.Direction), amount, fee, + table.Append(newTransactionRow(helpers.TxDirectionIcon(txn.Direction), amount, fee, dcrlibwallet.TransactionDirectionName(txn.Direction), status, timeDate)) } @@ -264,19 +265,6 @@ func recentTransactions(overview *overview) (transactions []dcrlibwallet.Transac return } -func transactionIcon(direction int32) string { - switch direction { - case 0: - return assets.SendIcon - case 1: - return assets.ReceiveIcon - case 2: - return assets.ReceiveIcon - default: - return assets.InfoIcon - } -} - func transactionStatus(overview *overview, txn dcrlibwallet.Transaction) string { confirmations := overview.multiWallet.GetBestBlock().Height - txn.BlockHeight + 1 if txn.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { From f0761746ecda8b5df0072f443dbdd6e7703cda5d Mon Sep 17 00:00:00 2001 From: morrison Date: Fri, 20 Dec 2019 17:14:19 +0100 Subject: [PATCH 53/73] optimzed txupdate --- fyne/pages/history.go | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 1b5c83034..f9f901f94 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -185,7 +185,7 @@ func txWalletList(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tab individualWalletID := walletID walletListWidget.Append(widgets.NewClickableBox(walletContainer, func() { - // hide checkmark icon of other accounts + // hide checkmark icon of other wallets for _, children := range walletListWidget.Children { if box, ok := children.(*widgets.ClickableBox); !ok { continue @@ -418,7 +418,8 @@ func fetchTx(txTable *widgets.Table, txOffset, filter int32, multiWallet *dcrlib widget.Refresh(txHistory.txTable.Container) txHistory.txTable.Container.Show() - time.AfterFunc(time.Second*8, func() { + // wait four sec then update tx table + time.AfterFunc(time.Second*4, func() { updateTable(multiWallet, window, tabMenu) }) @@ -432,27 +433,31 @@ func updateTable(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabM if txHistory.allTxCount > int(txHistory.TotalTxFetched) { if txHistory.txTable.Container.Offset.Y == 0 { - time.AfterFunc(time.Second*8, func() { + if txTableRowCount < int(txPerPage) { + return + } + // table not yet scrolled wait 4 secs and update + time.AfterFunc(time.Second*4, func() { updateTable(multiWallet, window, tabMenu) }) } else if scrollPosition < 0.5 { - if txHistory.TotalTxFetched <= txPerPage { - time.AfterFunc(time.Second*8, func() { + if txHistory.TotalTxFetched == txPerPage { + time.AfterFunc(time.Second*4, func() { updateTable(multiWallet, window, tabMenu) }) } - if txTableRowCount <= int(txPerPage) { - return + if txHistory.TotalTxFetched >= 50 { + txHistory.TotalTxFetched -= txPerPage*2 + if txTableRowCount >= 50 { + txHistory.txTable.Delete(txTableRowCount-int(txPerPage), txTableRowCount) + } + fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, multiWallet, window, tabMenu, true) } - - txHistory.TotalTxFetched -= int32(txPerPage) - - fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, multiWallet, window, tabMenu, true) } else if scrollPosition >= 0.5 { - fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, multiWallet, window, tabMenu, false) - if txTableRowCount > 12 { + if txTableRowCount >= 50 { txHistory.txTable.Delete(0, txTableRowCount-int(txPerPage)) } + fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, multiWallet, window, tabMenu, false) } } } From f70be2e49fa1891b05cde5de4b89b8c8fb44d208 Mon Sep 17 00:00:00 2001 From: morrison Date: Fri, 20 Dec 2019 18:43:21 +0100 Subject: [PATCH 54/73] added redirect to dcrdata feature --- cmd/godcr-fyne/.~bash-profile.swp | Bin 0 -> 12288 bytes fyne/assets/icons.go | 2 +- fyne/assets/redirect.png | Bin 0 -> 7990 bytes fyne/assets/share.png | Bin 0 -> 8620 bytes fyne/pages/history.go | 21 +++++++++++++++++++-- 5 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 cmd/godcr-fyne/.~bash-profile.swp create mode 100644 fyne/assets/redirect.png create mode 100644 fyne/assets/share.png diff --git a/cmd/godcr-fyne/.~bash-profile.swp b/cmd/godcr-fyne/.~bash-profile.swp new file mode 100644 index 0000000000000000000000000000000000000000..f8b58e4ebe373098e4c596ef34393cb04371699c GIT binary patch literal 12288 zcmeI%y>7xV5Ww++fvqYkFOZfQ!pFh`uykOmV0WC*rX)CWvarzSqz}{96f71{_VBml zoO3!`x}W4BN;F!%E`r%`ByMz%kJC7GL~^AgV>T+aK6^dBr8YO#re-_Lj8@t8Dv|x= zz;K?Fo5~d7y9o+wJ`-J)ZXIhI>O4NJ2J7863HOmIKL)O5oo30clgT51K)t}jayl9R zU-kaWbI^NQ)^DK#0R#|0009ILKmY**8Y55@E%|cYw9g&+*gC)a*qDZC1OWsPKmY** z5I_I{1Q0*~fjbmXvB>wM$d8-H|Ns8`|JUd4(1ex|KmY**5I_I{1Q0*~0R#|en!q0( C2QPR4 literal 0 HcmV?d00001 diff --git a/fyne/assets/icons.go b/fyne/assets/icons.go index bd31a9dde..09e05298c 100644 --- a/fyne/assets/icons.go +++ b/fyne/assets/icons.go @@ -29,9 +29,9 @@ const ( MoreIcon = "more.png" InfoIcon = "info.png" ReceiveAccountIcon = "receiveAccount.png" - CollapseDropdown = "collapseDropdown.png" ExpandDropdown = "expandDropdown.png" + RedirectIcon = "redirect.png" ) var imageBox = packr.New("icons", "../assets") diff --git a/fyne/assets/redirect.png b/fyne/assets/redirect.png new file mode 100644 index 0000000000000000000000000000000000000000..e181993b72569bcb38f58b151da6c0275f6dab18 GIT binary patch literal 7990 zcmd5Bi9gia_s$?&B@$jl%hy&}+Q_qvlI4pKWy@MUN}(nUS!Q~?B$a&0kgZ;eitv(T zpY*CXQOVvg-Nwk^Sbq8AUMM$eeL@ zbZK~?x7y@HG6`_`y2I-lTB*UbMC&p*p;*j*W^`Ii z$-fSuEPNiR&*!ut;@7oJ+|;97FmZ9(){tyYJ6i0xvQB@<93vej(}8{_HH*V*qcRKw zrhhn2)ga46^Uyi<#o0FMEyI9fi>zON!^Xm>)=S!ohr&Gy`zqR-K!;S*}PUOwr-kuJrMMDtQPUs0|XWrLqgvCaJO z!gE&gjJ@Pt)FpBauNUR(vzdnk>J4h|M!$zyPdpm>fuvlQS@-9zlR99zC3o)(AIV3j zW+K(h>|fWO)ziOK)*4H@C1<|pojXuX6|a&ZiGt_G2>#Z9*8!l@7h3H)?75N z>TFSUjZ*Yea`{#7%rEM+fa~`_P9|p`YId6|vzCzwjk`BUJRgZEB8y~wt!umv3mu^z0{Trl6JFWp!R*=Ve{Gl4OJrH#|`jL3PA}o=Y z?|ea=mZ3$EcPRupdE7(wE<0kWG*@kc{E_>>M3ZTprsC2cEpq*`%(@fj)p0k|H5OO) zH>&w*=BLOpXto<@Z?KwQnbOj+B$~DpQOQ1uc>WM(s1ap#c|uHopDl=2ssbum9KpLR zJ{WT%erMkj`!?Ug(OM(3(b zV|AL(>LVa-A3J)55HZGLNncNpW3ZNV0V$WGZc07uXIAGCeOdMh(cLaz?AsR9r*oiF zWN3JxTu}+S+_by1wX-r7#;ws`1tsE5pF7ifw3)Nzioe{0uG3)=xDP~fP#x#?n#1fIF&a4q##ZSGlX6yoq?S!IJY&uZQ=6J{M zBsO&fwu*KBQLdPE6|&T4N|r0$3m#J;?BBvXyX+~N`LMIV_;)Sd@_-H4@%1d+AMW|w z^$s-lQUunCM44B~NLIfXHE4YxT6({>PIU5m)7V$REc)s2)Z6&!!LZNnx~BW-$k%+1 z`7<$p(X~kBex@aqC95Z1`mk1>wjPVw!VJFD`%v9YbJ4wuv|r7h?27Fu3=u6gv<0d zEL5M7piLMucb&mjDX_=9ayf6&n?AGeh)py(zlgAIgubuzyU$P~%B}uzLp1YV;3NLP zizkN0mn=o>xWD!0a59gDY-X%BH5rH{2QFm=Z_4LfTb0rC(JPyy_?$1kiC}+w(olTu z=ea!k1#kI4Dpr6*1&&*Sjk7SQGB^s*^WN4Emp3Pk>iqV$Qj2M^Y7qtY@qzpy@iMk7 zE&pSr+4w|FSbj`+1Wq-WMcVO|&M9d%xA5@SP1>_UcsY<&?_prK(z;6F_;1CwQ~x{* z5d{r>JM(Ysod2Q2kF{HiEM_5U@bopmuQC_tcGH1;X5(p1XKV2`AEHcv?OhnBsC)VWNTl( z&)L)sykW$*q*m1YWCAIg{M`u5+mT(LSw>7gLnscEel_rGL%yl;j0EH4)8N0#=#~p2 zDz*z{85YuvH*lbKI*oT=TpeuO%Jb-cw}l!!dq2!Ki*t=-2lgIZXia`=1PYMFn2(k( z&mY6OH7j4uZ3S!A@n-^H&Kx*a(Zw>}$|K12JAPIW`{sk=V`ue1Gw64m@YDsv>QTOs z_xAPt)hCVsu19$CVDBBy9mxAA!uzGk3L8l4DW2PE$BP;l1KZ{JtAn;NndNl%f6cKy zXY~k9Nt1!+pDEBjBbB9da$ti5_1fujkmC_eph+c=-kw7iQ(1O9e^#=jfxHG!8xq62 z?XSO$$`yf@&4No0(N$a5#?dt3`}_^AP=ax6OO zuHq)WRJGst(;)iEW{L%`BDqopcs)-fP>qr&1OouM;r>>e7`psTWw%Uw>D$$OdA05M$$Wu6R9jc!A#PhSM3tnkHjCe{g0KU)q*o z0Cmrn;}5RhfMW^}Q-*V^g>!Py_%%@1hYi#Nl3jvl$Id4aib0w?Jh*f_l1^OHPoy0*Vlf@0AfH%x!?EZ zr0+*9T#M^TlX}(*6Q876r???3>aP?juzMae>P z;RO-AuwS5W<1M#el3ch2F=?>vKO8ZU8y^c-)qF8u zR?Xu)Z=>$K^TsP;a`@w<13H!4Cdl=rb3&5F00{osRIl=x*BCTt!zfIPIrCGdy!)S_ z3!-3%xko_0=z+DmE|)i#-LWQqvLo|O$XWxMLgWx0!tjpV25+k;a0(V-zgq|_$2F>= zR0y;v$g(GLsPATrH8C#ut6cfSt!!%oZE+oc&}yM#I34NxG+Dn)SN~dZ?lOz=;p2V4 zFo9-o<8_A*Bg3aM`2cHvYChL1KDfQ^Vu-33 zcm%^(xu2vP2oJK3<=hF!sTQQdb5OaXE?zioC!BUjRF87T<~1q}3I%obcQ}@)gZr%V zrrzNW&^_r|Pp)YXttqyfdKrK59A>Q^<%FpnCOc#I)4b9+4al&@qCF;~x#(53wRA`M z@lo74kKRM)48S|)!j{c`r}Gx+IP3ywTkr@VRsRWqg)Dzif*Ns{0IqDtH}OXj5zIhk zxADI25d+`T@E9nA$^SiB2pK>q9*0_`#eh3q2q{A-Q3&l216@1t5GtTZfl`rOxlW1QCU2;{Os$ZtQC0kdu! z@5w;|Fo2GhpguhUXcj^y$Fu?CcU%D%cyJ*N^+>s zOHl9N8!03_>FY+)GV)L=Y@w2M4 zO>u5A@LF;bZuuK{)}{-yzf?>Nd=M(!1${m!+|wWC1ln#PDLl#SMzcBEubOxQ!PYDBtip5M{g_3$3(tw>U;BMS5(H$5&2!Q$l|?rjgbmHl28cn)S!D}Odo&nl06`cSfB?AcV& z(sz8V_CK<~{YD^vFmkBAw)&xr>W2ACEM#zDB=4T(CJK$3q57>9H3aM-eZ^_>lZH?ZBWJOaMG zTWdFUC2S%zz`a3jyEDY|?r>Y%lrkn0Kgfeue+{?$_^nDH?S-4G+@ry?2-4eip+Rlq zJ$UJIRq1;-VUvkhw7~iJ`>;{;yZ0{{-m$NR13@Qdd_5`tP}Y5C~glskWd=kpk{TD zK+CQ&U^=Qtg^pWVSuMP|ss&1WZlifh>VC)IJUoz}X%h-%`T7T?z&S@rSXLya!h8?3 zWsu=C^h3KA!BB(e&yff2xpK{LA-srxeCn}-qLZ9}-~5m#F@ak$zs!0V!z52N&Ckh=N8o4>U|bN&;2;hwv|y#5`&uqlBE zR+P`;3%5yu)hEy43!Aine$HRQg?LtY>Jb{$0-#U&%W=_7nMCm03s)Sv1p9D^BX@eHbUSd$DhjA62v#Rhh>EG7`_hdQ%eploH$lM|ZKmaWLXurU^@&9}19<1Q&U=hBz=_FFy zWkU`gS2r+%&ud^!wa2(v#;dA1;*VY{tPocH%v9I~oOVx6Nqsgbv7^f-`s27OKGL`Bnl+u{} z-WXV&8~El+Iu4sP_*CnOn|Hn*A$dYcCd+DnSrQh)+I3#e6-62XMj2G=5BP_%1U+$h zRL#NDKqqfj%IU){R2N-&|L-05B&S*`v3 z_7iF#D~P-A+xV)}?MFr&UKFk<)tsy0lgP@6yp^o-4ENWe?NIIChaa#h7P+wXTe_GW zrYQQ9y}ja&LdoSd`spXJ7{gh$=!%Uc0>`Fh7lA{0dyI*p*$IOFZ+eGU-m{+#eF)P` z*|ViSXNgiYJ~W(IJpw-N-^Xl!BFL<6uL*pW?Vv+JSByI%E?&U8Wg^B1qun-BU)rcO z?2tU;u4e^L%bW$D%Gta#UMdoq#lE&H@4t=@RUsA1KRR66rCkJTU$*iZ{3=xM<}E)M zPy0*efw9~5q+g9@C;W^*9z#|2+hm~rYPM6i+o&<@GoH0OcbOXPnVmRg{L%1VeR=&g zu#q72S)4uRJ$5Kgw2*3Lhmoa3lDw>qx6v^RL_Lr^h4sTO3>oEV47J{_lzBi*eXV z@r5XTqKw^&@i(8LJ4n5prZ{mnH}55hMX8SZ0!T7e9MdOM&7Lv%0GGQYNCiK>XQ2G! zqolRmaNTRtf~H;(DD>4QShR_a_)tZ(`Y)h$c}pqOv8Iw)zKef)Z{`x^UHEWL7*(s5 zzCr236SOyXDTOljsdK=#P-W)LNFLf*=Q6iT?eNrhEuuM$@0?MbFQrop4soU7|E^8SV)S9M4PTuJ)n5Y4uhbw?xgdmQq|SK84QD z?74p-I`-u<3;F#0LW-+5owH|z&!8Hx6a90txd$ye-Fl>z-qnRE)*2Zx*=apHVCiJC zfBIF^f?ErFXr)}yKQdYeyniJ9W_@(eZ}!C~IS!M?yfQdX;{{yvj}K|y#wN_v5uaWY zU1qQhe??`J&D3Kg(6u-IU`JH#@(e=l=-dj9&Q2kEuwof3x|r2df>a)^vN#E@clv5Z zc~;R)vy#F;N0PR)#|Gwq_$z`B-T7RT#EU_C2R)R}@&zUKQze*J%Nt#gK3^mu@bIhv z2$PPP)WT;`bC3Eo?(T^uCttPO%WuO1Tk|?vJ4O85saagx$Gt5kF0mVE$l`e{`oZ$% z)qpkIj-;UEGvk(z3nm(Sdrg?)1Gxn7tZF|q<)JaT@%rqAwTydnno$R<5}B;E?kuUOGU zRXrD$iA`@Q7%v$KZ1+icxh6{P+it~2(G*6u6xEkzwBMK+51-Z!lu;`zvEYU?vAK$(VPwjLwQa(MAf0oLc2kKc*C|?- zW;O0O^*d6pn8@?6khTVEXJ--WEsny-r&Gbt?t(V>aUKTb#dM|{ie%h7E< zqIaJsW4vV~^lISB%!Bf6AaTjHig^A2re;Sz$_@wDs&$zY8jDZhH=G*j^{r&+r;3W0 zt%fx_&kNG)BW2CkOxR65fUo-VRiv4qo&J~nv0+Ukb*A8&g&!jN^|hXhiZL) zoqUnfTo+;G~6YG<#qBU#I@NX)O_0gcg8P00W?7oa4yO0^31Vs5#6#oz0!mtrOO#?j&~`CDfA}5C(QQ@S?p`DCV(<;h z55y|oCB+^!fFDvGAAh)fs;J;mwb#(c(PELNw)d^Ey-Wc*_3=YBL&m-msEl@?s%f0- z@fVlj_onp`9+(Ug<%m%<7p>UgewCH-G>dUN^5-zU4JI?+cmq$B2`3{^OhD(3M^jTd zC(+{KD%m2xn__-hYA87$ng4Y^{6;p6Shsmeo&In+%uQ>h8_734WtPvq7OTHqiqT*CeeZqFzRy`iKG4&+OmU3@0D#L{nyLl>Km`6I z0-z+|#nOY#1H6zpD&128fSNeU6B|-+%xSA>a1Q_iZU6uZ4FLZ@6KVqhkRkx^!x{kK zX#l|Fp4F@`2ReulIvT0~P!`KA29C(xHBG$$fV%tQ50WfE%?cXHytVGBku6hQp%sKa zQ>iQk2?DfKm5ltp{QBmEy0Y4|zkR-29m(oIn`}+w!50PV#D@*GHjyw%2+=aeevNMY z_!RN?Qa)cFtrxwg1iuhDM@$q-fFDYM`9Nnu8~y=GuSoJ7Lgr937D4Bjwz;`kSy{YQ z7E);y`oN*+Z6$w+b3ke32a@;|{zZ|H&Nn~rvu5abMg;YH$&D1_I#jzW9$F0Y6^PF} zh_=IXFpXYpI;=8>4f8o~@{yW!#J55zaCd*vh1 zH^I>QJ?F|=EGWiW(bR`UA^GX5GG5g3m6^9boD zj3b0}S~anYGkJn2qKJ z!7WWsAg9NwVlUii-sc4OqShS2oklN7AgNR(XhPps`p>O1eBs7WlCxY$_TZ)?m@9d# zFJ{!8JwxDXys~qln63dqkg#MH(|1wVIeh1^AAwEvjk6rVlt(v2m|ID=JE0`-8rBQk zNP}TQ3Gx`h1R1Krk_5i12r)guAF145CgSfpX|UM8FG5S=WKnK2{cWbh z%2yNWsh8heO`1p%8@x&E12L<z&8I?xbNpIFl^q^PbxNhc>>LNQjbC&G*t&#Mb+F-}*lW z^n9s*n`Ub6(tWHUT*ZgL_$#OTXCV~5q4 zRnvUi7>?UilEsVEq^>D%y)zF!Bz5OhSRZZ-ITWSw^_0mhSK;X&Wz+I)9)HoYJLzdz zCLOKyP=KZu$nfA#^+10vLc7ZMZM)%VYo>GZHwN^*Kigb4VRRIkb@*(O3{v=$LD#;UiD*c>$_rXGZEY+Gnp7v<7TViL;J2bk7 z#r)-SC-(DS?UZw?+R6SC zjY+f(p7ilB@2C;1r=Doc_U}J=Zm`?HSMD3g(=0llSd83my&dVAWzrf4G>b;I)GX`Mkq)u+u@<3-nMc>%vD_q>M&Nm zl>3kv>nO*u6Z{Wn_V(wJ79Fs&fw8?91)qI;_<~nk##}Cu#n3&ECTx0SvYL;cwT94A zC$q&XwQCKi)^d*zQFGLr^u3;Sd-EdGDW7q4%9F_g(%gDX#VP6^hXKh(3nkb45ZBL( zG-}&FG{{f=!j7n>7jvPbeUYmMz_eH7UI^xeBo0FHDS^_YTNm3v4fEgVGDT?0lz2EJ zmb>3Ewb#gLmhR#DdIRtPq=30MP_BC(r&Pc>+8b$azTqlI+hEgMlwv~GZ%EGf=Mqg# z6_S?xdAbqA7v3)6&j%>`!2i6WT*i*BXmNXZ>tP&fRCiGcR@5xR4)&Z>CeezCHFX zaj(92IGMar)h}vMuEPU9P>k8L=N5j^&^X+-+NZvwRX}3eO@xQu`_aQXXKt5k^6F); zr-vWqkP)EaQMo7CI~r6`{y>?$;cxAqs}HTj=f}nS15#?37;#+Jj62=W z*m^WHcqPl2M~Q6&OBQQ;hP)4@+@HnJoVPS4%Hz0r5QVx0Vlf_wz3Y(o>sC4UUEDTI z|0UK_$Lot%F8x!zY?b=QWz8-}(3@+|ikLaSt1Txv2D7;s3a$DR$bL5ev}2`H_)*(0 zZj_#&&p}hZYMC{sSA~k*cm^v=#h8B-sp7wH*J4@*JLSm5P?cnt5yQ9eKkeEq@w{ZD4j#M<~ zcm1&*{{j=>UqrG;m3~`*xp#DCdjiZ6uo03T|b| zH+<_oTYnbfw{<5Lg;{>}4qGpGKfMn5*dLEGw{c}RY>G~;u(cZxKaO51>t51(?SU|- zv<{uG9d)y#WHlK*{@CSWiQPn=pJet5Dt#QQISO$=;!E3$HJEo;EfLhe|Hu!`GA}2( zEWhDx@N7jwwa~%oO1US!(=Ndz)fi$}9M)xlFo$dGBhAhQ8fm)owX$klN1h1kqPWo_lp3Jt?j`~h5!u0mQ&dd}XedT#pZ)72= zD_iX_Y|1v^={<|=vBYN14``kU55%qS)*5f`i-#rSjyaXI8*@JFcIKj=@Pv+@5sy4s z{s~zRmUC`7C7(ad9tY{xPuZ<-Y&2$Y=T(6y9LeIo8&3uKU{a&MGrSlh44U=R{zj@)lWwO(H zSB{g2p5W?AxS~#ZgZO^)Mv|3i4f~XI(SF=5Gq_2l9x%8CIBXIvAPVlpdClMy3bJ&G zKQW+O_7PVq%|Tec51U8LYDrFyYi&@MYRk4e>q5tQ5!-6AIg; zgdNS~*n+Oc44n#YjD(0PDeVixqZTAdJQcMuq;WbsaL+8ddvfbv#HJZv(Zm-xT2q}L z=xgnpdS6S;HHmpo(O&4F>!1KK#+tn$a^Jl1&qRZE0MSIzp8dwco?VIO?GZolXn%RW zXzg7jbD$aN_g+1@B7rl_;b+#B6zwnQ&x)ANdG@#Rlu5sL3d{7s!!#KNS>E0!ZWckY zmV=U<*aVD##jn|sNnkacIy2{>{HW?=_lD7v#F^s+8zU42r%V2i`<8T(*>zMaT^Z-b z5cFo>znQ9TOBp_~Q2cc;+i5^yW)zhEFjG3mzb@1Wf_4-nGY54(6)zSm-eNKWY&OU2 zadfKhzI2w#)%{8ZbDq2vKj&R5WA0$sYbzmw_C5P)1I{M;>F8?5ORI+v^rGKOQxE|* zQm8w;dzn#j(PzmA4~3aN?qW}GdqZ?{Zp6D9%bC!FJgKR1D+MT!R7@9@S!$U3bSPyE zyl@&|57@IpxUfw-9@kU67Mb=!fmK)kHpn;|sz~|(Bh>t}xO;{~U22b;ANAc}PQ~k@ z#)o9wrLI3BjDU{V6%mjw)(`EKA%9{Fbo?rz4ApWO`A)^}b)>|o_@K?k7xc4?AfAlu zg=7>FK^=tEF9dJ!>Mdnjgqo1j4(C2`0;d%Ih^71GT&M*pt?G5X_n_nsb1Iu)dEW<+ zm8v8Uuqa|C!-}ngzlHcwCy%?8K*P1eSM%ll2YURdpkGO+b5H3Qa>pZ9j~4EczN#8> za%NX5$g$sD-r@8$f~*u@P6Z2H>d1R~Bt7%k7&tl#{fS^#vSYQHOg#vjHzj=)SKqwb z&^(;pD^!E!G|*@fwNfepJP<K*S@x@c)LN zEt$@fmIqBoeZCk@0KqQ_)vq7lw zm9#2OBjDcD?)Av<8-%PU+EM`*o5`L)S!ChLu82PNWZ7XvQ*eF|)2qXB&Ih8szOkM0 zql&1ClaVCb7NZ16JKt6$ux-Kd-@uDUp&rX=Ipj=$aoL4f*CeeI$YQ^yPl2~W-(QXk z%-0@{n-q$O8}0x3rYKPe-tqr_Z|Xh5LzhZX{|RGv=zn>6;sCGNo0uaCWzz8n;xEB< zszOT;iluTo^BErIR}e+F_@Db#C4^_9bd8PUy?G18>sI0q` z{t(t_=3(fs_#4LC@|0;~Uj-c^k!k4W7tR&jpT-pqo^6sVF3Yc}S=vL~^j+C`7q@)G z3G;f)%a6Lm?;oD(7oVEftbT9eLmcJuj*%AWgGWrQZtPs@@(x#P(+14&oN7IbgjGOZ zuBN7?#HV*84%?+8U%@0|bDLQS3s;$6LCky{!=k&)lA2%gQ8L=brJlOxHltz%J+>Na zy~ce*G+nB~_DbFQQRG*`vOWE!VUCAhO8G02=r1ZStixFPNG2y1?9B`ypWuUV#coNF z7j5GABSJ{7iu9in=<5Q^$S~uqa|6WNCw!*ptK!m?zY9x%r$^fq?bpsm{pK66i}44W zj3b0-^E!Jgu#rEFmTfd&-&T7{PJGya#PpT|_3$WqJe1ma8`|*aBa-U3U?CIuQq-?b zT5Y`DO7x&ZaZ=+2P0~9zvDSRCTq0bvH0|78m%6#lwbu(8&HbD37pl4z$Znmcr6Af z{j*ypUw%#3&U^+QEU1F3?Wr-=D8232NGo?8w6nmf&sp@E|H5w`%Q>Ic1PZ{~4Se^| zEfQy_Q0Z^TW8XNx7>?3TWLzd5+p*)^>UZ zjYbRjC-3YpAHGU?&u|W&xIlI}@yhqR)a$=-Tz0JD(gNUiXru5jU7xT76a7d;;=2;u zJ;dQKf$L2x(n-8f*67BQ@ZwmQG_a+OLYAR{ z<}$0FGqFcM7Om4GHg74WBT+FpkE>JVDw@P8wypbK)x)R8fCn3SYs|7g*uF|w%dWi* z54YbcEe5s)P}9=75usGK3mZ1mgqc!0pO6kR04JlgI&XXr7F>?EL!qLwBsH;WJR$Zv2;ODm{CN28Iaa?nT5EFSK z6E%hT`gur#Qijfn-+gsHqS?DdhZ)b|C$>K_H2Z>B3?L?ViDvq@1*_-%1~%YlPuRKm z`GHIgAX6rtsa)!@*uUFSrWzP5MSC7l?@l3JE@dGW6)>DC%BZ*t?*B3Gnz*!!u?#q_ zf>?|Y<5+LAsNG!?xMTzzjhP4!TOB6u-Oy1#5EWYzwYun6amyE7qF4ah>r@tOVNIwV+}GJ4Xg(jGum?eFrv8w6`*4L+c6fURrEn#+6* zH5ZFX>`@dsqoPFRvIib|(Zq;?M=&ct>gL>-$%Wy=?y>-$w%!QXy1fFv87Fj*?XK(K zX>mqC<+JY+k2e)wri|yV;<$d60v57WH_5blviH)eW*$Hq?_dXTbWy!U<0*CuYXXu+ zfKW^49njMM<5h|w*c}k*LmF#yYG)Dbc^LFgOz>^uXynCX4)9gqjz^;N{%S*qZmz4Y znY(Fbl>ip$-7R49umYvLjW4%Kls_RMRxcgN>mQgW{V^IqawJfo_5^g%#egAIHbAN@$ zf3Ossa;(hH*gLqzXCk5xMV1dH<wx@^TigZm%=igy<>Dw{I0t#;gvTqUd zn|6}P^(6+`unXM+dvMc!X%N+{9b6r)qGG_NN%{I|@`^qLy{zwW(YoeRa8hM9;lNh} zu(cDJ8$1R(Ij}RkayERbbJi8Wts15exguY^qmDCiLu-ogqmoJIL&=vbq?CAWGPZvp zoj<>1#W$oQ3a0GueN)BhA?ESwzzM`>XCdtgr!;5tvJw zavTzGk{oCJp^8u;1>Ck96b~|oz405c7y1w&#&yMObvCHC5Lcr{QAh;bbTrA~+bMT^ z0xhPEWHy9+@=I*>Hv(_jzePy9_)hQ!Hd7p9>r-zV(*Nkf{)mT)A7vK3(Q(^l^q;u- zA>}tyJ9c9pHhxsIqzB9Kwv?p9$(H)oDj?*Th}4a*-pD}h1rKVfi>5Jb47R=}!tLCu z5>M4Ib!6A$vEWDPN{S_y0`K#*r~f4`6%zGtvEl)k(B>V0E)M*FEC+rX-oE(GYzux| z{y)S2mUu^NN=rLIu_&FRN$l^w*-R}dZo?lF*L63-j{%O=R4;z zvlGNI5>90@3js7yJUCM7xDg2z=ZEh;OeGtY5vdY2p|p$Jvf7Tv=aq{YABOl`l48UMKKjcDrnHcv6-KCWCLU9gQ2Pse6mZ2iZH}Jd*V;(>oamRQl}qT75IG z`eH2Uh$Iovt&I`5RXg7Xt1<317K~mou~6G-7HE}CNG{Sc?8vtmK5Mqa^!sYh=IZ#x zMD=64WSt*c{C$QxlVjMv@#qiN&}{ove6TR0L`JrnEKuWYxAFRz@-s-%Ur~kXc_tWr zWTAI?6UQO0VZAKPI$KK><~fG*0C*RIH_3v^*H>X2B}*FS!X!q4VWadMwWGW+I=_N_ zxHT`bbuRo-MPekzOXKff+<8S{)Ryx{yKG%mw#-L?hlamR&&5XT_4r_Vu`7vR6p}t2 zud!k4M)_c)AKNF8=O%3c*1i2Tf{%eM^{ag4II}x^*2a3C z7mL)RBmZ^-KAlTE`R7xv=O7Cr+elT}mpE?v+@NUv_?Bf+1o9yr`Df+knx-=*@yBIv zGluGOZVAHF-b7Je<2aM>+&>r7miTU7fQcD6`5R*Ec2tNuZYVVlvIh*d(({^kDnJQ9M-an*Poue!tito?B>fI z$F2MwXvde zYta^N?O!GHV*lEba;94|&rdhd!LaLqbXCYW=0WjuIM6hkx@BVQ_7t*`H*FQtSH&rK zMkLClZ>(!vhS68>_qrSJOP$pxpYNSxS3|y-yA@+3suLEEsE;a889c zVrnh`uO?R?$;zxR`%~QN1vO-|J=C*aJra|a)@zR>3tp`nZ`e%{3$yi`4^Y7PIa1%1 zc~jlh_J;`Ydv3cqMu|IC>1N&8(D?n&FeD7R({W5^(W3>wr`i4HDaT^mM|#{+XUP71 z&Z32C-;;w#3{$H$Y?(56yzMrV@Ivxr^ps5cJB&}XW{vqsmo7r@Fm)4o@GsaaKn&Bt zw&LA~xzf;(KI*-uzv-~Owb1U|7teOjmwIy8CZ4TgmEF>jL%3%0S5#gQ**Tea5kvM& z;&s<7)a@_+TY=YG&BWWz z#@ill>uC>O05K6!ncJdbx5Y$^L?z)85^xb|0TB_nh)B^OgU;J z_5e&^xnMAKbMW@H@w5kgeSL+TT%EmaZQSjJ+&mpKx8$yYL4cN;o@%ACb=dy^BzC1S literal 0 HcmV?d00001 diff --git a/fyne/pages/history.go b/fyne/pages/history.go index f9f901f94..1774a0fc9 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -3,6 +3,7 @@ package pages import ( "fmt" "image/color" + "net/url" "sort" "strconv" "strings" @@ -23,6 +24,7 @@ import ( ) const txPerPage int32 = 25 +const netType = "testnet" type txHistoryPageData struct { allTxCount int @@ -57,7 +59,7 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { txHistory.selectedTxSortFilterLabel = widget.NewLabel("") // gets all icons used on this page - icons, err := assets.GetIcons(assets.CollapseIcon, assets.InfoIcon, assets.SendIcon, assets.ReceiveIcon, assets.ReceiveIcon, assets.InfoIcon) + icons, err := assets.GetIcons(assets.CollapseIcon, assets.InfoIcon, assets.SendIcon, assets.ReceiveIcon, assets.ReceiveIcon, assets.InfoIcon, assets.RedirectIcon) if err != nil { errorMessage := fmt.Sprintf("Error: %s", err.Error()) helpers.ErrorHandler(errorMessage, txHistory.errorLabel) @@ -447,7 +449,7 @@ func updateTable(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabM }) } if txHistory.TotalTxFetched >= 50 { - txHistory.TotalTxFetched -= txPerPage*2 + txHistory.TotalTxFetched -= txPerPage * 2 if txTableRowCount >= 50 { txHistory.txTable.Delete(txTableRowCount-int(txPerPage), txTableRowCount) } @@ -638,9 +640,24 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f tableDate, ) + link, err := url.Parse(fmt.Sprintf("https://%s.dcrdata.org/tx/%s", netType, txDetails.Hash)) + if err != nil { + helpers.ErrorHandler(fmt.Sprintf("Error: ", err.Error()), errorMessageLabel) + txDetailsErrorMethod() + return + } + redirectWidget := widget.NewHBox( + widget.NewHyperlinkWithStyle("View on dcrdata", link, fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), + widgets.NewHSpacer(20), + widget.NewIcon(txHistory.icons[assets.RedirectIcon]), + ) + txDetailsData := widget.NewVBox( widgets.NewHSpacer(10), tableData, + widgets.NewHSpacer(15), + redirectWidget, + widgets.NewHSpacer(15), widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txInput.Result, widgets.NewVSpacer(10), From 00b4208c026fd09e1ef4d76bff1cb0a59ccafcca Mon Sep 17 00:00:00 2001 From: morrison Date: Sat, 21 Dec 2019 13:01:18 +0100 Subject: [PATCH 55/73] added section seperators --- fyne/pages/history.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 1774a0fc9..2b213e6e7 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -594,7 +594,7 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f var txInput widgets.Table inputTableColumnLabels := widget.NewHBox( - widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) @@ -655,12 +655,14 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f txDetailsData := widget.NewVBox( widgets.NewHSpacer(10), tableData, - widgets.NewHSpacer(15), + canvas.NewLine(color.RGBA{0xe0, 0xe0, 0xe0, 0xff}), redirectWidget, - widgets.NewHSpacer(15), + widgets.NewHSpacer(10), + canvas.NewLine(color.RGBA{0xe0, 0xe0, 0xe0, 0xff}), widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txInput.Result, - widgets.NewVSpacer(10), + widgets.NewHSpacer(10), + canvas.NewLine(color.RGBA{0xe0, 0xe0, 0xe0, 0xff}), widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txOutput.Result, widgets.NewHSpacer(10), From 6cc735339fdd3ca59557f906a1f000333b13b20e Mon Sep 17 00:00:00 2001 From: morrison Date: Sat, 21 Dec 2019 13:10:14 +0100 Subject: [PATCH 56/73] removed file --- cmd/godcr-fyne/.~bash-profile.swp | Bin 12288 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 cmd/godcr-fyne/.~bash-profile.swp diff --git a/cmd/godcr-fyne/.~bash-profile.swp b/cmd/godcr-fyne/.~bash-profile.swp deleted file mode 100644 index f8b58e4ebe373098e4c596ef34393cb04371699c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI%y>7xV5Ww++fvqYkFOZfQ!pFh`uykOmV0WC*rX)CWvarzSqz}{96f71{_VBml zoO3!`x}W4BN;F!%E`r%`ByMz%kJC7GL~^AgV>T+aK6^dBr8YO#re-_Lj8@t8Dv|x= zz;K?Fo5~d7y9o+wJ`-J)ZXIhI>O4NJ2J7863HOmIKL)O5oo30clgT51K)t}jayl9R zU-kaWbI^NQ)^DK#0R#|0009ILKmY**8Y55@E%|cYw9g&+*gC)a*qDZC1OWsPKmY** z5I_I{1Q0*~fjbmXvB>wM$d8-H|Ns8`|JUd4(1ex|KmY**5I_I{1Q0*~0R#|en!q0( C2QPR4 From 19e6a96d6a8a10a023126515d1d71017aa90ac5b Mon Sep 17 00:00:00 2001 From: morrison Date: Sat, 21 Dec 2019 13:49:28 +0100 Subject: [PATCH 57/73] rebased PR --- fyne/assets/icons.go | 4 ++-- fyne/pages/overview.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fyne/assets/icons.go b/fyne/assets/icons.go index 09e05298c..4faaa8b70 100644 --- a/fyne/assets/icons.go +++ b/fyne/assets/icons.go @@ -29,8 +29,8 @@ const ( MoreIcon = "more.png" InfoIcon = "info.png" ReceiveAccountIcon = "receiveAccount.png" - CollapseDropdown = "collapseDropdown.png" - ExpandDropdown = "expandDropdown.png" + CollapseDropdown = "collapseDropdown.png" + ExpandDropdown = "expandDropdown.png" RedirectIcon = "redirect.png" ) diff --git a/fyne/pages/overview.go b/fyne/pages/overview.go index 3e65daae9..51fcaa611 100644 --- a/fyne/pages/overview.go +++ b/fyne/pages/overview.go @@ -15,8 +15,8 @@ import ( "github.com/decred/dcrd/dcrutil" "github.com/raedahgroup/dcrlibwallet" "github.com/raedahgroup/godcr/fyne/assets" - "github.com/raedahgroup/godcr/fyne/pages/handler/values" "github.com/raedahgroup/godcr/fyne/helpers" + "github.com/raedahgroup/godcr/fyne/pages/handler/values" "github.com/raedahgroup/godcr/fyne/widgets" ) From 6a52d76aa3a23815c88a422aa17ad2426b9a8dfc Mon Sep 17 00:00:00 2001 From: morrison Date: Sat, 21 Dec 2019 16:11:18 +0100 Subject: [PATCH 58/73] fixed broken page after rebase due to fyne update --- fyne/pages/handler/values/colors.go | 1 + fyne/pages/handler/values/strings.go | 3 +++ fyne/pages/history.go | 40 +++++++++++++--------------- fyne/pages/send.go | 2 ++ 4 files changed, 24 insertions(+), 22 deletions(-) diff --git a/fyne/pages/handler/values/colors.go b/fyne/pages/handler/values/colors.go index 493491977..ce484e744 100644 --- a/fyne/pages/handler/values/colors.go +++ b/fyne/pages/handler/values/colors.go @@ -16,4 +16,5 @@ var ( Green = color.RGBA{65, 190, 83, 255} NilAmountColor = color.RGBA{137, 151, 165, 255} ConfirmationPageStrippedColor = color.RGBA{237, 239, 241, 255} + TxdetailsLineColor = color.RGBA{0xe0, 0xe0, 0xe0, 0xff} ) diff --git a/fyne/pages/handler/values/strings.go b/fyne/pages/handler/values/strings.go index 36cb28d4a..a59e2a2d6 100644 --- a/fyne/pages/handler/values/strings.go +++ b/fyne/pages/handler/values/strings.go @@ -70,6 +70,9 @@ const ( GenerateNewAddress = "Generate new address" ReceivePageInfo = "Each time you request a \npayment, a new address is \ncreated to protect your privacy." + // History Page + PageHint = "- Tap Hash to view Transaction details.\n\n- Tap Blue Text to Copy." + // Error Messages AmountDecimalPlaceErr = "Amount has more than 8 decimal places" AccountSelectorIconErr = "Could not retrieve account selector icons" diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 2b213e6e7..b390c99d6 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -2,7 +2,6 @@ package pages import ( "fmt" - "image/color" "net/url" "sort" "strconv" @@ -20,6 +19,7 @@ import ( "github.com/raedahgroup/dcrlibwallet" "github.com/raedahgroup/godcr/fyne/assets" "github.com/raedahgroup/godcr/fyne/helpers" + "github.com/raedahgroup/godcr/fyne/pages/handler/values" "github.com/raedahgroup/godcr/fyne/widgets" ) @@ -72,10 +72,9 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { // infoPopUp creates a popup with history page hint-text var infoIcon *widgets.ImageButton - info := "- Tap Hash to view Transaction details.\n\n- Tap Blue Text to Copy." infoIcon = widgets.NewImageButton(txHistory.icons[assets.InfoIcon], nil, func() { - infoLabel := widget.NewLabelWithStyle(info, fyne.TextAlignLeading, fyne.TextStyle{Monospace: true}) - gotItLabel := canvas.NewText("Got it", color.RGBA{41, 112, 255, 255}) + infoLabel := widget.NewLabelWithStyle(values.PageHint, fyne.TextAlignLeading, fyne.TextStyle{Monospace: true}) + gotItLabel := canvas.NewText(values.GotIt, values.Blue) gotItLabel.TextStyle = fyne.TextStyle{Bold: true} gotItLabel.TextSize = 14 @@ -139,13 +138,12 @@ func historyPageContent(app *AppInterface) fyne.CanvasObject { return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } - txHistoryPageOutput.Append(walletDropDown) + txHistoryPageOutput.Append(widget.NewHBox(walletDropDown)) txHistoryPageOutput.Append(widget.NewHBox(txSortFilterDropDown, widgets.NewHSpacer(30), txFilterDropDown)) txHistoryPageOutput.Append(widgets.NewVSpacer(5)) txHistoryPageOutput.Append(txHistory.errorLabel) - txHistoryPageOutput.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txHistory.txTable.Container.MinSize().Width, txHistory.txTable.Container.MinSize().Height+450)), txHistory.txTable.Container)) + txHistoryPageOutput.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txHistory.txTable.Container.MinSize().Width*33, txHistory.txTable.Container.MinSize().Height+450)), txHistory.txTable.Container)) txHistoryPageOutput.Append(widgets.NewVSpacer(15)) - return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) } @@ -155,7 +153,7 @@ func txWalletList(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tab walletsID := multiWallet.OpenedWalletIDsRaw() if len(walletsID) == 0 { - txHistory.errorMessage = "Could not retrieve wallets" + txHistory.errorMessage = values.WalletsErr return } sort.Ints(walletsID) @@ -480,22 +478,20 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f txDetailsErrorMethod := func() { txErrorDetailsOutput := widget.NewVBox( - widgets.NewHSpacer(10), widget.NewHBox( txDetailslabel, - widgets.NewHSpacer(txDetailslabel.MinSize().Width+180), + widgets.NewHSpacer(txDetailslabel.MinSize().Width*3), minimizeIcon, ), - errorMessageLabel, + widget.NewHBox(errorMessageLabel), ) - txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txErrorDetailsOutput)), - window.Canvas()) + txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txErrorDetailsOutput)), window.Canvas()) txDetailsPopUp.Show() } chainHash, err := chainhash.NewHashFromStr(hash) if err != nil { - helpers.ErrorHandler(fmt.Sprintf("fetching generating chainhash from for \n %s \n %s ", hash, err.Error()), errorMessageLabel) + helpers.ErrorHandler(fmt.Sprintf("Error fetching generating chainhash from for \n %s \n %s ", hash, err.Error()), errorMessageLabel) txDetailsErrorMethod() return } @@ -523,9 +519,9 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f copyAbleText := func(text string, copyAble bool) *widgets.ClickableBox { var textToCopy *canvas.Text if copyAble { - textToCopy = canvas.NewText(text, color.RGBA{0x44, 0x8a, 0xff, 0xff}) + textToCopy = canvas.NewText(text, values.Blue) } else { - textToCopy = canvas.NewText(text, color.RGBA{0x00, 0x00, 0x00, 0xff}) + textToCopy = canvas.NewText(text, values.DefaultTextColor) } textToCopy.TextSize = 14 textToCopy.Alignment = fyne.TextAlignTrailing @@ -655,14 +651,14 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f txDetailsData := widget.NewVBox( widgets.NewHSpacer(10), tableData, - canvas.NewLine(color.RGBA{0xe0, 0xe0, 0xe0, 0xff}), + canvas.NewLine(values.TxdetailsLineColor), redirectWidget, widgets.NewHSpacer(10), - canvas.NewLine(color.RGBA{0xe0, 0xe0, 0xe0, 0xff}), + canvas.NewLine(values.TxdetailsLineColor), widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txInput.Result, widgets.NewHSpacer(10), - canvas.NewLine(color.RGBA{0xe0, 0xe0, 0xe0, 0xff}), + canvas.NewLine(values.TxdetailsLineColor), widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txOutput.Result, widgets.NewHSpacer(10), @@ -673,11 +669,11 @@ func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window f widgets.NewHSpacer(10), widget.NewHBox( txDetailslabel, - widgets.NewHSpacer(txDetailsScrollContainer.MinSize().Width-txDetailslabel.MinSize().Width-30), + widgets.NewHSpacer(txDetailsScrollContainer.MinSize().Width*22), minimizeIcon, ), - widget.NewHBox(widgets.NewHSpacer(txDetailsScrollContainer.MinSize().Width/2-30), messageLabel), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width+10, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer), + widget.NewHBox(widgets.NewHSpacer(txDetailsScrollContainer.MinSize().Width*13), messageLabel), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width*30, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer), widgets.NewVSpacer(10), ) diff --git a/fyne/pages/send.go b/fyne/pages/send.go index 038fd7f1e..72c6ceafc 100644 --- a/fyne/pages/send.go +++ b/fyne/pages/send.go @@ -1,6 +1,7 @@ package pages import ( + "fmt" "sort" "fyne.io/fyne" @@ -96,6 +97,7 @@ func sendPageContent(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window) err = initSendPage.InitAllSendPageComponents() if err != nil { + fmt.Println(err) return widget.NewLabelWithStyle(values.SendPageLoadErr, fyne.TextAlignLeading, fyne.TextStyle{}) } From 5463d006c2916c4b808a7191f83d32fba2ca3864 Mon Sep 17 00:00:00 2001 From: morrison Date: Sat, 21 Dec 2019 16:15:16 +0100 Subject: [PATCH 59/73] undid changes --- fyne/pages/send.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/fyne/pages/send.go b/fyne/pages/send.go index 72c6ceafc..038fd7f1e 100644 --- a/fyne/pages/send.go +++ b/fyne/pages/send.go @@ -1,7 +1,6 @@ package pages import ( - "fmt" "sort" "fyne.io/fyne" @@ -97,7 +96,6 @@ func sendPageContent(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window) err = initSendPage.InitAllSendPageComponents() if err != nil { - fmt.Println(err) return widget.NewLabelWithStyle(values.SendPageLoadErr, fyne.TextAlignLeading, fyne.TextStyle{}) } From ef81d88e21ae326255610b3b6b5c14d7607b7184 Mon Sep 17 00:00:00 2001 From: morrison Date: Sun, 22 Dec 2019 20:44:49 +0100 Subject: [PATCH 60/73] added scroll feature to wallet dropdown --- fyne/pages/history.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fyne/pages/history.go b/fyne/pages/history.go index b390c99d6..96312cbb4 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -214,7 +214,8 @@ func txWalletList(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tab } // txWalletSelectionPopup create a popup that has tx wallet - txHistory.txWalletSelectionPopup = widget.NewPopUp(widget.NewVBox(walletListWidget), window.Canvas()) + txHistory.txWalletSelectionPopup = widget.NewPopUp(fyne.NewContainerWithLayout( + layout.NewFixedGridLayout(fyne.NewSize(100, 100)), widget.NewScrollContainer(walletListWidget)), window.Canvas()) txHistory.txWalletSelectionPopup.Hide() txHistory.walletListTab = widget.NewHBox( From 9f4ce433eb766a7287945389e2a8f2a8b69f88f4 Mon Sep 17 00:00:00 2001 From: morrison Date: Tue, 24 Dec 2019 00:21:15 +0100 Subject: [PATCH 61/73] implemented @metaclips review --- .../handler/historypagehandler/basewidgets.go | 45 ++ .../historypagehandler/filterselector.go | 133 ++++ .../historypagehandler/inithistorypage.go | 90 +++ .../historypagehandler/txdetailscomponent.go | 242 +++++++ .../historypagehandler/txtablecomponents.go | 141 ++++ .../historypagehandler/walletselector.go | 105 +++ fyne/pages/handler/values/strings.go | 4 +- fyne/pages/history.go | 675 +----------------- 8 files changed, 779 insertions(+), 656 deletions(-) create mode 100644 fyne/pages/handler/historypagehandler/basewidgets.go create mode 100644 fyne/pages/handler/historypagehandler/filterselector.go create mode 100644 fyne/pages/handler/historypagehandler/inithistorypage.go create mode 100644 fyne/pages/handler/historypagehandler/txdetailscomponent.go create mode 100644 fyne/pages/handler/historypagehandler/txtablecomponents.go create mode 100644 fyne/pages/handler/historypagehandler/walletselector.go diff --git a/fyne/pages/handler/historypagehandler/basewidgets.go b/fyne/pages/handler/historypagehandler/basewidgets.go new file mode 100644 index 000000000..45f560a65 --- /dev/null +++ b/fyne/pages/handler/historypagehandler/basewidgets.go @@ -0,0 +1,45 @@ +package historypagehandler + +import ( + "fyne.io/fyne" + "fyne.io/fyne/canvas" + "fyne.io/fyne/layout" + "fyne.io/fyne/widget" + + "github.com/raedahgroup/godcr/fyne/assets" + "github.com/raedahgroup/godcr/fyne/pages/handler/values" + "github.com/raedahgroup/godcr/fyne/widgets" +) + +func (historyPage *HistoryPageData) initBaseObjects() error { + icons, err := assets.GetIcons(assets.CollapseIcon, assets.InfoIcon, assets.SendIcon, assets.ReceiveIcon, assets.ReceiveIcon, assets.InfoIcon, assets.RedirectIcon) + if err != nil { + return err + } + historyPage.icons = icons + // history page title label + historyTitleLabel := widget.NewLabelWithStyle(values.HistoryTitle, fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) + + // infoPopUp creates a popup with history page hint-text + var infoIcon *widgets.ImageButton + infoIcon = widgets.NewImageButton(historyPage.icons[assets.InfoIcon], nil, func() { + infoLabel := widget.NewLabelWithStyle(values.PageHint, fyne.TextAlignLeading, fyne.TextStyle{Monospace: true}) + gotItLabel := canvas.NewText(values.GotIt, values.Blue) + gotItLabel.TextStyle = fyne.TextStyle{Bold: true} + gotItLabel.TextSize = 14 + + var infoPopUp *widget.PopUp + infoPopUp = widget.NewPopUp(widget.NewVBox( + widgets.NewVSpacer(5), + widget.NewHBox(widgets.NewHSpacer(5), infoLabel, widgets.NewHSpacer(5)), + widgets.NewVSpacer(5), + widget.NewHBox(layout.NewSpacer(), widgets.NewClickableBox(widget.NewVBox(gotItLabel), func() { infoPopUp.Hide() }), widgets.NewHSpacer(5)), + widgets.NewVSpacer(5), + ), historyPage.Window.Canvas()) + + infoPopUp.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject(infoIcon).Add(fyne.NewPos(0, infoIcon.Size().Height))) + }) + + historyPage.HistoryPageContents.Append(widget.NewHBox(historyTitleLabel, widgets.NewHSpacer(110), infoIcon)) + return nil +} diff --git a/fyne/pages/handler/historypagehandler/filterselector.go b/fyne/pages/handler/historypagehandler/filterselector.go new file mode 100644 index 000000000..9a9964ae3 --- /dev/null +++ b/fyne/pages/handler/historypagehandler/filterselector.go @@ -0,0 +1,133 @@ +package historypagehandler + +import ( + "fmt" + "strings" + + "fyne.io/fyne/widget" + + "github.com/raedahgroup/dcrlibwallet" + "github.com/raedahgroup/godcr/fyne/assets" + "github.com/raedahgroup/godcr/fyne/widgets" +) + +func (historyPage *HistoryPageData) txFilterDropDown(walletId int) { + var txTable widgets.Table + txFilterListWidget := widget.NewVBox() + + var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} + var allTxFilters = map[string]int32{ + "All": dcrlibwallet.TxFilterAll, + "Sent": dcrlibwallet.TxFilterSent, + "Received": dcrlibwallet.TxFilterReceived, + "Transferred": dcrlibwallet.TxFilterTransferred, + "Coinbase": dcrlibwallet.TxFilterCoinBase, + "Staking": dcrlibwallet.TxFilterStaking, + } + + if walletId != historyPage.selectedWalletID { + historyPage.selectedWalletID = walletId + } + + txCountForFilter, err := historyPage.MultiWallet.WalletWithID(historyPage.selectedWalletID).CountTransactions(allTxFilters["All"]) + if err != nil { + historyPage.errorMessage = fmt.Sprintf("Cannot load history page page. Error getting transaction count for filter All: %s", err.Error()) + return + } + + historyPage.allTxCount = txCountForFilter + + historyPage.selectedTxFilterLabel.SetText(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) + + for _, filterName := range allTxFilterNames { + filterId := allTxFilters[filterName] + txCountForFilter, err := historyPage.MultiWallet.WalletWithID(historyPage.selectedWalletID).CountTransactions(filterId) + if err != nil { + historyPage.errorMessage = fmt.Sprintf("Cannot load historyPage page. Error getting transaction count for filter %s: %s", filterName, err.Error()) + return + } + if txCountForFilter > 0 { + filter := fmt.Sprintf("%s (%d)", filterName, txCountForFilter) + txFilterView := widget.NewHBox( + widgets.NewHSpacer(5), + widget.NewLabel(filter), + widgets.NewHSpacer(5), + ) + + txFilterListWidget.Append(widgets.NewClickableBox(txFilterView, func() { + selectedFilterName := strings.Split(filter, " ")[0] + selectedFilterId := allTxFilters[selectedFilterName] + if allTxCountForSelectedTx, err := historyPage.MultiWallet.WalletWithID(historyPage.selectedWalletID).CountTransactions(selectedFilterId); err == nil { + historyPage.allTxCount = allTxCountForSelectedTx + } + + if selectedFilterId != historyPage.selectedFilterId { + historyPage.selectedTxFilterLabel.SetText(filter) + historyPage.txTableHeader(&txTable) + historyPage.fetchTx(&txTable, 0, selectedFilterId, false) + widget.Refresh(historyPage.txTable.Result) + } + + historyPage.txFilterSelectionPopup.Hide() + })) + } + } + + // txFilterSelectionPopup create a popup that has tx filter name and tx count + historyPage.txFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txFilterListWidget), historyPage.Window.Canvas()) + historyPage.txFilterSelectionPopup.Hide() + + historyPage.txFilterTab = widget.NewHBox( + historyPage.selectedTxFilterLabel, + widgets.NewHSpacer(10), + widget.NewIcon(historyPage.icons[assets.CollapseIcon]), + widgets.NewHSpacer(10), + ) + widget.Refresh(historyPage.txFilterTab) +} + +func (historyPage *HistoryPageData) txSortDropDown() { + var txTable widgets.Table + var allTxSortNames = []string{"Newest", "Oldest"} + var allTxSortFilters = map[string]bool{ + "Newest": true, + "Oldest": false, + } + + historyPage.selectedTxSortFilterLabel.SetText("Newest") + + historyPage.selectedtxSort = allTxSortFilters["Newest"] + + txSortFilterListWidget := widget.NewVBox() + for _, sortName := range allTxSortNames { + txSortView := widget.NewHBox( + widgets.NewHSpacer(5), + widget.NewLabel(sortName), + widgets.NewHSpacer(5), + ) + txSort := allTxSortFilters[sortName] + newSortName := sortName + + txSortFilterListWidget.Append(widgets.NewClickableBox(txSortView, func() { + historyPage.selectedTxSortFilterLabel.SetText(newSortName) + historyPage.selectedtxSort = txSort + + historyPage.txTableHeader(&txTable) + historyPage.txTable.Result.Children = txTable.Result.Children + historyPage.fetchTx(&txTable, 0, historyPage.selectedFilterId, false) + widget.Refresh(historyPage.txTable.Result) + historyPage.txSortFilterSelectionPopup.Hide() + })) + } + + // txSortFilterSelectionPopup create a popup that has tx filter name and tx count + historyPage.txSortFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txSortFilterListWidget), historyPage.Window.Canvas()) + historyPage.txSortFilterSelectionPopup.Hide() + + historyPage.txSortFilterTab = widget.NewHBox( + historyPage.selectedTxSortFilterLabel, + widgets.NewHSpacer(10), + widget.NewIcon(historyPage.icons[assets.CollapseIcon]), + ) + widget.Refresh(historyPage.txSortFilterTab) +} diff --git a/fyne/pages/handler/historypagehandler/inithistorypage.go b/fyne/pages/handler/historypagehandler/inithistorypage.go new file mode 100644 index 000000000..e748702fe --- /dev/null +++ b/fyne/pages/handler/historypagehandler/inithistorypage.go @@ -0,0 +1,90 @@ +package historypagehandler + +import ( + "errors" + + "fyne.io/fyne" + "fyne.io/fyne/layout" + "fyne.io/fyne/widget" + + "github.com/raedahgroup/dcrlibwallet" + "github.com/raedahgroup/godcr/fyne/pages/handler/values" + "github.com/raedahgroup/godcr/fyne/widgets" +) + +type HistoryPageData struct { + allTxCount int + selectedWalletID int + selectedFilterId int32 + TotalTxFetched int32 + selectedtxSort bool + errorMessage string + txFilterTab *widget.Box + txSortFilterTab *widget.Box + txTable widgets.Table + errorLabel *widget.Label + selectedTxFilterLabel *widget.Label + selectedTxSortFilterLabel *widget.Label + txFilterSelectionPopup *widget.PopUp + txSortFilterSelectionPopup *widget.PopUp + MultiWallet *dcrlibwallet.MultiWallet + icons map[string]*fyne.StaticResource + HistoryPageContents *widget.Box + Window fyne.Window + TabMenu *widget.TabContainer +} + +func (historyPage *HistoryPageData) InitHistoryPage() error { + historyPage.HistoryPageContents.Append(widgets.NewVSpacer(values.Padding)) + + err := historyPage.initBaseObjects() + if err != nil { + return err + } + + historyPage.HistoryPageContents.Append(widgets.NewVSpacer(values.SpacerSize10)) + + historyPage.errorLabel = widget.NewLabel("") + historyPage.errorLabel.Hide() + + historyPage.selectedFilterId = dcrlibwallet.TxFilterAll + historyPage.selectedTxFilterLabel = widget.NewLabel("") + historyPage.selectedTxSortFilterLabel = widget.NewLabel("") + + historyPage.txWalletList() + + // txFilterDropDown creates a popup like dropdown that holds the list of tx filters. + var txFilterDropDown *widgets.ClickableBox + txFilterDropDown = widgets.NewClickableBox(historyPage.txFilterTab, func() { + if historyPage.allTxCount == 0 { + historyPage.txFilterSelectionPopup.Hide() + } else { + historyPage.txFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( + txFilterDropDown).Add(fyne.NewPos(0, txFilterDropDown.Size().Height))) + historyPage.txFilterSelectionPopup.Show() + } + }) + + // txSortFilterDropDown creates a popup like dropdown that holds the list of sort filters. + var txSortFilterDropDown *widgets.ClickableBox + txSortFilterDropDown = widgets.NewClickableBox(historyPage.txSortFilterTab, func() { + if historyPage.allTxCount == 0 { + historyPage.txSortFilterSelectionPopup.Hide() + } else { + historyPage.txSortFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( + txSortFilterDropDown).Add(fyne.NewPos(0, txSortFilterDropDown.Size().Height))) + historyPage.txSortFilterSelectionPopup.Show() + } + }) + + // catch all errors when trying to setup and render tx page data. + if historyPage.errorMessage != "" { + return errors.New(historyPage.errorMessage) + } + + historyPage.HistoryPageContents.Append(widget.NewHBox(txSortFilterDropDown, widgets.NewHSpacer(30), txFilterDropDown)) + historyPage.HistoryPageContents.Append(widgets.NewVSpacer(5)) + historyPage.HistoryPageContents.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(historyPage.txTable.Container.MinSize().Width*33, historyPage.txTable.Container.MinSize().Height+450)), historyPage.txTable.Container)) + historyPage.HistoryPageContents.Append(widgets.NewVSpacer(15)) + return nil +} diff --git a/fyne/pages/handler/historypagehandler/txdetailscomponent.go b/fyne/pages/handler/historypagehandler/txdetailscomponent.go new file mode 100644 index 000000000..faca8d52d --- /dev/null +++ b/fyne/pages/handler/historypagehandler/txdetailscomponent.go @@ -0,0 +1,242 @@ +package historypagehandler + +import ( + "fmt" + "net/url" + "strconv" + "time" + + "fyne.io/fyne" + "fyne.io/fyne/canvas" + "fyne.io/fyne/layout" + "fyne.io/fyne/theme" + "fyne.io/fyne/widget" + + "github.com/decred/dcrd/chaincfg/chainhash" + "github.com/decred/dcrd/dcrutil" + "github.com/raedahgroup/dcrlibwallet" + "github.com/raedahgroup/godcr/fyne/assets" + "github.com/raedahgroup/godcr/fyne/helpers" + "github.com/raedahgroup/godcr/fyne/pages/handler/values" + "github.com/raedahgroup/godcr/fyne/widgets" +) + +func (historyPage *HistoryPageData) fetchTxDetails(hash string) { + messageLabel := widget.NewLabelWithStyle("Fetching data..", fyne.TextAlignCenter, fyne.TextStyle{}) + time.AfterFunc(time.Millisecond*300, func() { + if historyPage.TabMenu.CurrentTabIndex() == 1 { + messageLabel.Hide() + } + }) + + txDetailslabel := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) + + var txDetailsPopUp *widget.PopUp + minimizeIcon := widgets.NewImageButton(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) + errorMessageLabel := widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) + + txDetailsErrorMethod := func() { + txErrorDetailsOutput := widget.NewVBox( + widget.NewHBox( + txDetailslabel, + widgets.NewHSpacer(txDetailslabel.MinSize().Width*3), + minimizeIcon, + ), + widget.NewHBox(errorMessageLabel), + ) + txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txErrorDetailsOutput)), historyPage.Window.Canvas()) + txDetailsPopUp.Show() + } + + chainHash, err := chainhash.NewHashFromStr(hash) + if err != nil { + helpers.ErrorHandler(fmt.Sprintf("Error fetching generating chainhash from for \n %s \n %s ", hash, err.Error()), errorMessageLabel) + txDetailsErrorMethod() + return + } + + txDetails, err := historyPage.MultiWallet.WalletWithID(historyPage.selectedWalletID).GetTransactionRaw(chainHash[:]) + if err != nil { + helpers.ErrorHandler(fmt.Sprintf("Error fetching transaction details for \n %s \n %s ", hash, err.Error()), errorMessageLabel) + txDetailsErrorMethod() + return + } + + var confirmations int32 = 0 + if txDetails.BlockHeight != -1 { + confirmations = historyPage.MultiWallet.WalletWithID(historyPage.selectedWalletID).GetBestBlock() - txDetails.BlockHeight + 1 + } + + var status string + var spendUnconfirmed = historyPage.MultiWallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey, true) + if spendUnconfirmed || confirmations > dcrlibwallet.DefaultRequiredConfirmations { + status = "Confirmed" + } else { + status = "Pending" + } + + copyAbleText := func(text string, copyAble bool) *widgets.ClickableBox { + var textToCopy *canvas.Text + if copyAble { + textToCopy = canvas.NewText(text, values.Blue) + } else { + textToCopy = canvas.NewText(text, values.DefaultTextColor) + } + textToCopy.TextSize = 14 + textToCopy.Alignment = fyne.TextAlignTrailing + + return widgets.NewClickableBox(widget.NewHBox(textToCopy), + func() { + messageLabel.SetText("Data Copied") + clipboard := historyPage.Window.Clipboard() + clipboard.SetContent(text) + messageLabel.Show() + + time.AfterFunc(time.Second*2, func() { + if historyPage.TabMenu.CurrentTabIndex() == 1 { + messageLabel.Hide() + } + }) + }, + ) + } + + tableConfirmations := widget.NewHBox( + widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + + tableHash := widget.NewHBox( + widget.NewLabelWithStyle("Transaction ID:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + copyAbleText(txDetails.Hash, true), + ) + + tableBlockHeight := widget.NewHBox( + widget.NewLabelWithStyle("Block Height:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(strconv.Itoa(int(txDetails.BlockHeight)), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableDirection := widget.NewHBox( + widget.NewLabelWithStyle("Direction:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(txDetails.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableType := widget.NewHBox( + widget.NewLabelWithStyle("Type:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(txDetails.Type, fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableAmount := widget.NewHBox( + widget.NewLabelWithStyle("Amount:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Amount).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableSize := widget.NewHBox( + widget.NewLabelWithStyle("Size:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(strconv.Itoa(txDetails.Size)+" Bytes", fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableFee := widget.NewHBox( + widget.NewLabelWithStyle("Fee:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableFeeRate := widget.NewHBox( + widget.NewLabelWithStyle("Fee Rate:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.FeeRate).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableStatus := widget.NewHBox( + widget.NewLabelWithStyle("Status:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(status, fyne.TextAlignCenter, fyne.TextStyle{}), + ) + tableDate := widget.NewHBox( + widget.NewLabelWithStyle("Date:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(txDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), + ) + + var txInput widgets.Table + inputTableColumnLabels := widget.NewHBox( + widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) + + var inputBox []*widget.Box + for i := range txDetails.Inputs { + inputBox = append(inputBox, widget.NewHBox( + copyAbleText(txDetails.Inputs[i].PreviousOutpoint, true), + copyAbleText(txDetails.Inputs[i].AccountName, false), + copyAbleText(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), false), + )) + } + txInput.NewTable(inputTableColumnLabels, inputBox...) + + var txOutput widgets.Table + outputTableColumnLabels := widget.NewHBox( + widget.NewLabelWithStyle("Address", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Value", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) + + var outputBox []*widget.Box + for i := range txDetails.Outputs { + outputBox = append(outputBox, widget.NewHBox( + copyAbleText(txDetails.Outputs[i].AccountName, false), + copyAbleText(txDetails.Outputs[i].Address, true), + copyAbleText(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), false), + copyAbleText(txDetails.Outputs[i].ScriptType, false), + )) + } + txOutput.NewTable(outputTableColumnLabels, outputBox...) + + tableData := widget.NewVBox( + tableConfirmations, + tableHash, + tableBlockHeight, + tableDirection, + tableType, + tableAmount, + tableSize, + tableFee, + tableFeeRate, + tableStatus, + tableDate, + ) + + link, err := url.Parse(fmt.Sprintf("https://%s.dcrdata.org/tx/%s", values.NetType, txDetails.Hash)) + if err != nil { + helpers.ErrorHandler(fmt.Sprintf("Error: ", err.Error()), errorMessageLabel) + txDetailsErrorMethod() + return + } + + redirectWidget := widget.NewHBox( + widget.NewHyperlinkWithStyle("View on dcrdata", link, fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), + widgets.NewHSpacer(20), + widget.NewIcon(historyPage.icons[assets.RedirectIcon]), + ) + + txDetailsData := widget.NewVBox( + widgets.NewHSpacer(10), + tableData, + canvas.NewLine(values.TxdetailsLineColor), + redirectWidget, + widgets.NewHSpacer(10), + canvas.NewLine(values.TxdetailsLineColor), + widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), + txInput.Result, + widgets.NewHSpacer(10), + canvas.NewLine(values.TxdetailsLineColor), + widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), + txOutput.Result, + widgets.NewHSpacer(10), + ) + + txDetailsScrollContainer := widget.NewScrollContainer(txDetailsData) + txDetailsOutput := widget.NewVBox( + widgets.NewHSpacer(10), + widget.NewHBox( + txDetailslabel, + widgets.NewHSpacer(txDetailsData.MinSize().Width-200), + minimizeIcon, + ), + widget.NewHBox(widgets.NewHSpacer(txDetailsScrollContainer.MinSize().Width*13), messageLabel), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsData.MinSize().Width, txDetailsData.MinSize().Height-200)), txDetailsScrollContainer), + widgets.NewVSpacer(10), + ) + + txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), historyPage.Window.Canvas()) +} diff --git a/fyne/pages/handler/historypagehandler/txtablecomponents.go b/fyne/pages/handler/historypagehandler/txtablecomponents.go new file mode 100644 index 000000000..65ff8e191 --- /dev/null +++ b/fyne/pages/handler/historypagehandler/txtablecomponents.go @@ -0,0 +1,141 @@ +package historypagehandler + +import ( + "fmt" + "time" + + "fyne.io/fyne" + "fyne.io/fyne/widget" + + "github.com/decred/dcrd/dcrutil" + "github.com/raedahgroup/dcrlibwallet" + "github.com/raedahgroup/godcr/fyne/helpers" + "github.com/raedahgroup/godcr/fyne/widgets" +) + +const txPerPage int32 = 15 + +func (historyPage *HistoryPageData) txTableHeader(txTable *widgets.Table) { + tableHeading := widget.NewHBox( + widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + ) + + var hBox []*widget.Box + + txTable.NewTable(tableHeading, hBox...) + historyPage.txTable.Result.Children = txTable.Result.Children + return +} + +func (historyPage *HistoryPageData) fetchTx(txTable *widgets.Table, txOffset, filter int32, prepend bool) { + if filter != historyPage.selectedFilterId { + txOffset = 0 + historyPage.TotalTxFetched = 0 + historyPage.selectedFilterId = filter + } + + txns, err := historyPage.MultiWallet.WalletWithID(historyPage.selectedWalletID).GetTransactionsRaw(txOffset, txPerPage, filter, historyPage.selectedtxSort) + if err != nil { + helpers.ErrorHandler(fmt.Sprintf("Error getting transaction for Filter: %s", err.Error()), historyPage.errorLabel) + historyPage.txTable.Container.Hide() + return + } + if len(txns) == 0 { + helpers.ErrorHandler(fmt.Sprintf("No transactions for %s yet.", historyPage.MultiWallet.WalletWithID(historyPage.selectedWalletID).Name), historyPage.errorLabel) + historyPage.txTable.Container.Hide() + return + } + + historyPage.TotalTxFetched += int32(len(txns)) + + var txBox []*widget.Box + for _, tx := range txns { + status := "Pending" + confirmations := historyPage.MultiWallet.WalletWithID(historyPage.selectedWalletID).GetBestBlock() - tx.BlockHeight + 1 + if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { + status = "Confirmed" + } + + trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] + txForTrimmedHash := tx.Hash + txDirectionLabel := widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}) + txDirectionIcon := widget.NewIcon(historyPage.icons[helpers.TxDirectionIcon(tx.Direction)]) + txBox = append(txBox, widget.NewHBox( + widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewHBox(txDirectionIcon, txDirectionLabel), + widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), + widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignCenter, fyne.TextStyle{Italic: true})), func() { + historyPage.fetchTxDetails(txForTrimmedHash) + }), + )) + } + + if prepend { + txTable.Prepend(txBox...) + } else { + txTable.Append(txBox...) + } + + historyPage.txTable.Result.Children = txTable.Result.Children + widget.Refresh(historyPage.txTable.Result) + widget.Refresh(historyPage.txTable.Container) + historyPage.txTable.Container.Show() + + // wait four sec then update tx table + time.AfterFunc(time.Second*4, func() { + if historyPage.TabMenu.CurrentTabIndex() != 1 { + return + } + historyPage.updateTable() + }) + + historyPage.errorLabel.Hide() +} + +func (historyPage *HistoryPageData) updateTable() { + size := historyPage.txTable.Container.Content.Size().Height - historyPage.txTable.Container.Size().Height + scrollPosition := float64(historyPage.txTable.Container.Offset.Y) / float64(size) + txTableRowCount := historyPage.txTable.NumberOfColumns() + + if historyPage.allTxCount > int(historyPage.TotalTxFetched) { + if historyPage.txTable.Container.Offset.Y == 0 { + // table not yet scrolled wait 4 secs and update + time.AfterFunc(time.Second*4, func() { + if historyPage.TabMenu.CurrentTabIndex() != 1 { + return + } + historyPage.updateTable() + }) + } else if scrollPosition < 0.5 { + if historyPage.TotalTxFetched == txPerPage { + time.AfterFunc(time.Second*4, func() { + if historyPage.TabMenu.CurrentTabIndex() != 1 { + return + } + historyPage.updateTable() + }) + } + if historyPage.TotalTxFetched >= 50 { + historyPage.TotalTxFetched -= txPerPage * 2 + if txTableRowCount >= 50 { + historyPage.txTable.Delete(txTableRowCount-int(txPerPage), txTableRowCount) + } + historyPage.fetchTx(&historyPage.txTable, historyPage.TotalTxFetched, historyPage.selectedFilterId, true) + } + } else if scrollPosition >= 0.5 { + if txTableRowCount >= 50 { + historyPage.txTable.Delete(0, txTableRowCount-int(txPerPage)) + } + historyPage.fetchTx(&historyPage.txTable, historyPage.TotalTxFetched, historyPage.selectedFilterId, false) + } + } +} diff --git a/fyne/pages/handler/historypagehandler/walletselector.go b/fyne/pages/handler/historypagehandler/walletselector.go new file mode 100644 index 000000000..c1162157a --- /dev/null +++ b/fyne/pages/handler/historypagehandler/walletselector.go @@ -0,0 +1,105 @@ +package historypagehandler + +import ( + "sort" + + "fyne.io/fyne" + "fyne.io/fyne/layout" + "fyne.io/fyne/theme" + "fyne.io/fyne/widget" + + "github.com/raedahgroup/dcrlibwallet" + "github.com/raedahgroup/godcr/fyne/assets" + "github.com/raedahgroup/godcr/fyne/pages/handler/values" + "github.com/raedahgroup/godcr/fyne/widgets" +) + +func (historyPage *HistoryPageData) txWalletList() { + var txTable widgets.Table + walletListWidget := widget.NewVBox() + + walletsID := historyPage.MultiWallet.OpenedWalletIDsRaw() + if len(walletsID) == 0 { + historyPage.errorMessage = values.WalletsErr + return + } + sort.Ints(walletsID) + + // var selectedWalletLabel *widget.Label + selectedWalletLabel := widget.NewLabel(historyPage.MultiWallet.WalletWithID(walletsID[0]).Name) + var txWalletSelectionPopup *widget.PopUp + + historyPage.txFilterDropDown(walletsID[0]) + historyPage.txSortDropDown() + historyPage.txTableHeader(&historyPage.txTable) + historyPage.fetchTx(&historyPage.txTable, 0, dcrlibwallet.TxFilterAll, false) + + for index, walletID := range walletsID { + wallet := historyPage.MultiWallet.WalletWithID(walletID) + if wallet == nil { + continue + } + + checkmarkIcon := widget.NewIcon(theme.ConfirmIcon()) + if index != 0 || walletID != walletsID[0] { + checkmarkIcon.Hide() + } + + walletContainer := widget.NewHBox( + widget.NewLabel(wallet.Name), + checkmarkIcon, + widgets.NewHSpacer(5), + ) + + individualWalletID := walletID + + walletListWidget.Append(widgets.NewClickableBox(walletContainer, func() { + // hide checkmark icon of other wallets + for _, children := range walletListWidget.Children { + if box, ok := children.(*widgets.ClickableBox); !ok { + continue + } else { + if len(box.Children) != 3 { + continue + } + + if icon, ok := box.Children[1].(*widget.Icon); !ok { + continue + } else { + icon.Hide() + } + } + } + + checkmarkIcon.Show() + selectedWalletLabel.SetText(wallet.Name) + historyPage.selectedFilterId = dcrlibwallet.TxFilterAll + historyPage.txFilterDropDown(individualWalletID) + historyPage.txSortDropDown() + historyPage.txTableHeader(&txTable) + historyPage.fetchTx(&txTable, 0, historyPage.selectedFilterId, false) + txWalletSelectionPopup.Hide() + })) + } + + // txWalletSelectionPopup create a popup that has tx wallet + txWalletSelectionPopup = widget.NewPopUp(fyne.NewContainerWithLayout( + layout.NewFixedGridLayout(fyne.NewSize(walletListWidget.MinSize().Width, 70)), widget.NewScrollContainer(walletListWidget)), historyPage.Window.Canvas()) + txWalletSelectionPopup.Hide() + + walletListTab := widget.NewHBox( + selectedWalletLabel, + widgets.NewHSpacer(10), + widget.NewIcon(historyPage.icons[assets.CollapseIcon]), + ) + + // walletDropDown creates a popup like dropdown that holds the list of available wallets. + var walletDropDown *widgets.ClickableBox + walletDropDown = widgets.NewClickableBox(walletListTab, func() { + txWalletSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( + walletDropDown).Add(fyne.NewPos(0, walletDropDown.Size().Height))) + txWalletSelectionPopup.Show() + }) + + historyPage.HistoryPageContents.Append(widget.NewHBox(walletDropDown)) +} diff --git a/fyne/pages/handler/values/strings.go b/fyne/pages/handler/values/strings.go index a59e2a2d6..e68aaa659 100644 --- a/fyne/pages/handler/values/strings.go +++ b/fyne/pages/handler/values/strings.go @@ -71,7 +71,9 @@ const ( ReceivePageInfo = "Each time you request a \npayment, a new address is \ncreated to protect your privacy." // History Page - PageHint = "- Tap Hash to view Transaction details.\n\n- Tap Blue Text to Copy." + PageHint = "- Tap Hash to view Transaction details.\n\n- Tap Blue Text to Copy." + HistoryTitle = "Transaction" + NetType = "testnet" // Error Messages AmountDecimalPlaceErr = "Amount has more than 8 decimal places" diff --git a/fyne/pages/history.go b/fyne/pages/history.go index 96312cbb4..d079c3e0f 100644 --- a/fyne/pages/history.go +++ b/fyne/pages/history.go @@ -1,682 +1,47 @@ package pages import ( - "fmt" - "net/url" "sort" - "strconv" - "strings" - "time" "fyne.io/fyne" - "fyne.io/fyne/canvas" - "fyne.io/fyne/layout" - "fyne.io/fyne/theme" "fyne.io/fyne/widget" - "github.com/decred/dcrd/chaincfg/chainhash" - "github.com/decred/dcrd/dcrutil" - "github.com/raedahgroup/dcrlibwallet" - "github.com/raedahgroup/godcr/fyne/assets" - "github.com/raedahgroup/godcr/fyne/helpers" + "github.com/raedahgroup/godcr/fyne/pages/handler/historypagehandler" "github.com/raedahgroup/godcr/fyne/pages/handler/values" "github.com/raedahgroup/godcr/fyne/widgets" ) -const txPerPage int32 = 25 -const netType = "testnet" - -type txHistoryPageData struct { - allTxCount int - selectedWalletID int - selectedFilterId int32 - TotalTxFetched int32 - selectedtxSort bool - errorMessage string - walletListTab *widget.Box - txFilterTab *widget.Box - txSortFilterTab *widget.Box - txTable widgets.Table - errorLabel *widget.Label - selectedTxFilterLabel *widget.Label - selectedTxSortFilterLabel *widget.Label - selectedWalletLabel *widget.Label - txFilterSelectionPopup *widget.PopUp - txSortFilterSelectionPopup *widget.PopUp - txWalletSelectionPopup *widget.PopUp - icons map[string]*fyne.StaticResource +type historyPageDynamicData struct { + Contents *widget.Box } -var txHistory txHistoryPageData +var txHistory historyPageDynamicData func historyPageContent(app *AppInterface) fyne.CanvasObject { - txHistory.errorLabel = widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) - txHistory.errorLabel.Hide() - - txHistory.selectedFilterId = dcrlibwallet.TxFilterAll - txHistory.selectedWalletLabel = widget.NewLabel("") - txHistory.selectedTxFilterLabel = widget.NewLabel("") - txHistory.selectedTxSortFilterLabel = widget.NewLabel("") - - // gets all icons used on this page - icons, err := assets.GetIcons(assets.CollapseIcon, assets.InfoIcon, assets.SendIcon, assets.ReceiveIcon, assets.ReceiveIcon, assets.InfoIcon, assets.RedirectIcon) - if err != nil { - errorMessage := fmt.Sprintf("Error: %s", err.Error()) - helpers.ErrorHandler(errorMessage, txHistory.errorLabel) - return widget.NewHBox(widgets.NewHSpacer(18), txHistory.errorLabel) - } - txHistory.icons = icons - - // history page title label - pageTitleLabel := widget.NewLabelWithStyle("Transactions", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - - // infoPopUp creates a popup with history page hint-text - var infoIcon *widgets.ImageButton - infoIcon = widgets.NewImageButton(txHistory.icons[assets.InfoIcon], nil, func() { - infoLabel := widget.NewLabelWithStyle(values.PageHint, fyne.TextAlignLeading, fyne.TextStyle{Monospace: true}) - gotItLabel := canvas.NewText(values.GotIt, values.Blue) - gotItLabel.TextStyle = fyne.TextStyle{Bold: true} - gotItLabel.TextSize = 14 - - var infoPopUp *widget.PopUp - infoPopUp = widget.NewPopUp(widget.NewVBox( - widgets.NewVSpacer(5), - widget.NewHBox(widgets.NewHSpacer(5), infoLabel, widgets.NewHSpacer(5)), - widgets.NewVSpacer(5), - widget.NewHBox(layout.NewSpacer(), widgets.NewClickableBox(widget.NewVBox(gotItLabel), func() { infoPopUp.Hide() }), widgets.NewHSpacer(5)), - widgets.NewVSpacer(5), - ), app.Window.Canvas()) - - infoPopUp.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject(infoIcon).Add(fyne.NewPos(0, infoIcon.Size().Height))) - }) - - // history output widget - txHistoryPageOutput := widget.NewVBox( - widget.NewHBox(pageTitleLabel, widgets.NewHSpacer(110), infoIcon), - widgets.NewVSpacer(5), - ) - - // initialize history page data - txWalletList(app.MultiWallet, app.Window, app.tabMenu) - - // walletDropDown creates a popup like dropdown that holds the list of available wallets. - var walletDropDown *widgets.ClickableBox - walletDropDown = widgets.NewClickableBox(txHistory.walletListTab, func() { - txHistory.txWalletSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( - walletDropDown).Add(fyne.NewPos(0, walletDropDown.Size().Height))) - txHistory.txWalletSelectionPopup.Show() - }) - - // txFilterDropDown creates a popup like dropdown that holds the list of tx filters. - var txFilterDropDown *widgets.ClickableBox - txFilterDropDown = widgets.NewClickableBox(txHistory.txFilterTab, func() { - if txHistory.allTxCount == 0 { - txHistory.txFilterSelectionPopup.Hide() - } else { - txHistory.txFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( - txFilterDropDown).Add(fyne.NewPos(0, txFilterDropDown.Size().Height))) - txHistory.txFilterSelectionPopup.Show() - } - }) - - // txSortFilterDropDown creates a popup like dropdown that holds the list of sort filters. - var txSortFilterDropDown *widgets.ClickableBox - txSortFilterDropDown = widgets.NewClickableBox(txHistory.txSortFilterTab, func() { - if txHistory.allTxCount == 0 { - txHistory.txSortFilterSelectionPopup.Hide() - } else { - txHistory.txSortFilterSelectionPopup.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject( - txSortFilterDropDown).Add(fyne.NewPos(0, txSortFilterDropDown.Size().Height))) - txHistory.txSortFilterSelectionPopup.Show() - } - }) - - // catch all errors when trying to setup and render tx page data. - if txHistory.errorMessage != "" { - helpers.ErrorHandler(txHistory.errorMessage, txHistory.errorLabel) - txHistoryPageOutput.Append(txHistory.errorLabel) - return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) - } - - txHistoryPageOutput.Append(widget.NewHBox(walletDropDown)) - txHistoryPageOutput.Append(widget.NewHBox(txSortFilterDropDown, widgets.NewHSpacer(30), txFilterDropDown)) - txHistoryPageOutput.Append(widgets.NewVSpacer(5)) - txHistoryPageOutput.Append(txHistory.errorLabel) - txHistoryPageOutput.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txHistory.txTable.Container.MinSize().Width*33, txHistory.txTable.Container.MinSize().Height+450)), txHistory.txTable.Container)) - txHistoryPageOutput.Append(widgets.NewVSpacer(15)) - return widget.NewHBox(widgets.NewHSpacer(18), txHistoryPageOutput) -} - -func txWalletList(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer) { - var txTable widgets.Table - walletListWidget := widget.NewVBox() - - walletsID := multiWallet.OpenedWalletIDsRaw() - if len(walletsID) == 0 { - txHistory.errorMessage = values.WalletsErr - return - } - sort.Ints(walletsID) - - txHistory.selectedWalletLabel.SetText(multiWallet.WalletWithID(walletsID[0]).Name) - - txFilterDropDown(multiWallet, window, tabMenu, walletsID[0]) - txSortDropDown(multiWallet, window, tabMenu) - txTableHeader(multiWallet, &txHistory.txTable, window) - fetchTx(&txHistory.txTable, 0, dcrlibwallet.TxFilterAll, multiWallet, window, tabMenu, false) - - for index, walletID := range walletsID { - wallet := multiWallet.WalletWithID(walletID) - if wallet == nil { - continue - } - - checkmarkIcon := widget.NewIcon(theme.ConfirmIcon()) - if index != 0 || walletID != walletsID[0] { - checkmarkIcon.Hide() - } - - walletContainer := widget.NewHBox( - widget.NewLabel(wallet.Name), - checkmarkIcon, - widgets.NewHSpacer(5), - ) - - individualWalletID := walletID - - walletListWidget.Append(widgets.NewClickableBox(walletContainer, func() { - // hide checkmark icon of other wallets - for _, children := range walletListWidget.Children { - if box, ok := children.(*widgets.ClickableBox); !ok { - continue - } else { - if len(box.Children) != 3 { - continue - } - - if icon, ok := box.Children[1].(*widget.Icon); !ok { - continue - } else { - icon.Hide() - } - } - } - - checkmarkIcon.Show() - txHistory.selectedWalletLabel.SetText(wallet.Name) - txHistory.selectedFilterId = dcrlibwallet.TxFilterAll - txFilterDropDown(multiWallet, window, tabMenu, individualWalletID) - txSortDropDown(multiWallet, window, tabMenu) - txTableHeader(multiWallet, &txTable, window) - fetchTx(&txTable, 0, txHistory.selectedFilterId, multiWallet, window, tabMenu, false) - txHistory.txWalletSelectionPopup.Hide() - })) - } - - // txWalletSelectionPopup create a popup that has tx wallet - txHistory.txWalletSelectionPopup = widget.NewPopUp(fyne.NewContainerWithLayout( - layout.NewFixedGridLayout(fyne.NewSize(100, 100)), widget.NewScrollContainer(walletListWidget)), window.Canvas()) - txHistory.txWalletSelectionPopup.Hide() - - txHistory.walletListTab = widget.NewHBox( - txHistory.selectedWalletLabel, - widgets.NewHSpacer(10), - widget.NewIcon(txHistory.icons[assets.CollapseIcon]), - ) -} - -func txFilterDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer, walletId int) { - var txTable widgets.Table - txFilterListWidget := widget.NewVBox() - - var allTxFilterNames = []string{"All", "Sent", "Received", "Transferred", "Coinbase", "Staking"} - var allTxFilters = map[string]int32{ - "All": dcrlibwallet.TxFilterAll, - "Sent": dcrlibwallet.TxFilterSent, - "Received": dcrlibwallet.TxFilterReceived, - "Transferred": dcrlibwallet.TxFilterTransferred, - "Coinbase": dcrlibwallet.TxFilterCoinBase, - "Staking": dcrlibwallet.TxFilterStaking, - } - - if walletId != txHistory.selectedWalletID { - txHistory.selectedWalletID = walletId - } - - txCountForFilter, err := multiWallet.WalletWithID(txHistory.selectedWalletID).CountTransactions(allTxFilters["All"]) - if err != nil { - txHistory.errorMessage = fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter All: %s", err.Error()) - return - } - - txHistory.allTxCount = txCountForFilter - txHistory.selectedTxFilterLabel.SetText(fmt.Sprintf("%s (%d)", "All", txCountForFilter)) - - for _, filterName := range allTxFilterNames { - filterId := allTxFilters[filterName] - txCountForFilter, err := multiWallet.WalletWithID(txHistory.selectedWalletID).CountTransactions(filterId) - if err != nil { - txHistory.errorMessage = fmt.Sprintf("Cannot load txHistory page. Error getting transaction count for filter %s: %s", filterName, err.Error()) - return - } - if txCountForFilter > 0 { - filter := fmt.Sprintf("%s (%d)", filterName, txCountForFilter) - txFilterView := widget.NewHBox( - widgets.NewHSpacer(5), - widget.NewLabel(filter), - widgets.NewHSpacer(5), - ) - - txFilterListWidget.Append(widgets.NewClickableBox(txFilterView, func() { - selectedFilterName := strings.Split(filter, " ")[0] - selectedFilterId := allTxFilters[selectedFilterName] - if allTxCountForSelectedTx, err := multiWallet.WalletWithID(txHistory.selectedWalletID).CountTransactions(selectedFilterId); err == nil { - txHistory.allTxCount = allTxCountForSelectedTx - } - - if selectedFilterId != txHistory.selectedFilterId { - txHistory.selectedTxFilterLabel.SetText(filter) - txTableHeader(multiWallet, &txTable, window) - fetchTx(&txTable, 0, selectedFilterId, multiWallet, window, tabMenu, false) - widget.Refresh(txHistory.txTable.Result) - } - - txHistory.txFilterSelectionPopup.Hide() - })) - } - } - - // txFilterSelectionPopup create a popup that has tx filter name and tx count - txHistory.txFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txFilterListWidget), window.Canvas()) - txHistory.txFilterSelectionPopup.Hide() - - txHistory.txFilterTab = widget.NewHBox( - txHistory.selectedTxFilterLabel, - widgets.NewHSpacer(10), - widget.NewIcon(txHistory.icons[assets.CollapseIcon]), - widgets.NewHSpacer(10), - ) - widget.Refresh(txHistory.txFilterTab) -} - -func txSortDropDown(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer) { - var txTable widgets.Table - var allTxSortNames = []string{"Newest", "Oldest"} - var allTxSortFilters = map[string]bool{ - "Newest": true, - "Oldest": false, - } - - txHistory.selectedTxSortFilterLabel.SetText("Newest") - txHistory.selectedtxSort = allTxSortFilters["Newest"] - - txSortFilterListWidget := widget.NewVBox() - for _, sortName := range allTxSortNames { - txSortView := widget.NewHBox( - widgets.NewHSpacer(5), - widget.NewLabel(sortName), - widgets.NewHSpacer(5), - ) - txSort := allTxSortFilters[sortName] - newSortName := sortName - - txSortFilterListWidget.Append(widgets.NewClickableBox(txSortView, func() { - txHistory.selectedTxSortFilterLabel.SetText(newSortName) - txHistory.selectedtxSort = txSort - - txTableHeader(multiWallet, &txTable, window) - txHistory.txTable.Result.Children = txTable.Result.Children - fetchTx(&txTable, 0, txHistory.selectedFilterId, multiWallet, window, tabMenu, false) - widget.Refresh(txHistory.txTable.Result) - txHistory.txSortFilterSelectionPopup.Hide() - })) + openedWalletIDs := app.MultiWallet.OpenedWalletIDsRaw() + if len(openedWalletIDs) == 0 { + return widget.NewHBox(widgets.NewHSpacer(10), widget.NewLabelWithStyle(values.WalletsErr, fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) } + sort.Ints(openedWalletIDs) - // txSortFilterSelectionPopup create a popup that has tx filter name and tx count - txHistory.txSortFilterSelectionPopup = widget.NewPopUp(widget.NewVBox(txSortFilterListWidget), window.Canvas()) - txHistory.txSortFilterSelectionPopup.Hide() - - txHistory.txSortFilterTab = widget.NewHBox( - txHistory.selectedTxSortFilterLabel, - widgets.NewHSpacer(10), - widget.NewIcon(txHistory.icons[assets.CollapseIcon]), - ) - widget.Refresh(txHistory.txSortFilterTab) -} - -func txTableHeader(wallet *dcrlibwallet.MultiWallet, txTable *widgets.Table, window fyne.Window) { - tableHeading := widget.NewHBox( - widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - ) - - var hBox []*widget.Box - - txTable.NewTable(tableHeading, hBox...) - txHistory.txTable.Result.Children = txTable.Result.Children - return -} + initHistoryPageDynamicContent(openedWalletIDs) -func fetchTx(txTable *widgets.Table, txOffset, filter int32, multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer, prepend bool) { - if filter != txHistory.selectedFilterId { - txOffset = 0 - txHistory.TotalTxFetched = 0 - txHistory.selectedFilterId = filter + initHistoryPage := historypagehandler.HistoryPageData{ + MultiWallet: app.MultiWallet, + HistoryPageContents: txHistory.Contents, + Window: app.Window, + TabMenu: app.tabMenu, } - txns, err := multiWallet.WalletWithID(txHistory.selectedWalletID).GetTransactionsRaw(txOffset, txPerPage, filter, txHistory.selectedtxSort) + err := initHistoryPage.InitHistoryPage() if err != nil { - helpers.ErrorHandler(fmt.Sprintf("Error getting transaction for Filter: %s", err.Error()), txHistory.errorLabel) - txHistory.txTable.Container.Hide() - return - } - if len(txns) == 0 { - helpers.ErrorHandler(fmt.Sprintf("No transactions for %s yet.", multiWallet.WalletWithID(txHistory.selectedWalletID).Name), txHistory.errorLabel) - txHistory.txTable.Container.Hide() - return - } - - txHistory.TotalTxFetched += int32(len(txns)) - - var txBox []*widget.Box - for _, tx := range txns { - status := "Pending" - confirmations := multiWallet.WalletWithID(txHistory.selectedWalletID).GetBestBlock() - tx.BlockHeight + 1 - if tx.BlockHeight != -1 && confirmations > dcrlibwallet.DefaultRequiredConfirmations { - status = "Confirmed" - } - - trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] - txForTrimmedHash := tx.Hash - txDirectionLabel := widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}) - txDirectionIcon := widget.NewIcon(txHistory.icons[helpers.TxDirectionIcon(tx.Direction)]) - txBox = append(txBox, widget.NewHBox( - widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewHBox(txDirectionIcon, txDirectionLabel), - widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), - widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), - widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignCenter, fyne.TextStyle{Italic: true})), func() { - fetchTxDetails(txForTrimmedHash, multiWallet, window, txHistory.errorLabel, tabMenu) - }), - )) - } - - if prepend { - txTable.Prepend(txBox...) - } else { - txTable.Append(txBox...) + return widget.NewLabelWithStyle(values.ReceivePageLoadErr, fyne.TextAlignLeading, fyne.TextStyle{}) } - txHistory.txTable.Result.Children = txTable.Result.Children - widget.Refresh(txHistory.txTable.Result) - widget.Refresh(txHistory.txTable.Container) - txHistory.txTable.Container.Show() - - // wait four sec then update tx table - time.AfterFunc(time.Second*4, func() { - updateTable(multiWallet, window, tabMenu) - }) - - txHistory.errorLabel.Hide() -} - -func updateTable(multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, tabMenu *widget.TabContainer) { - size := txHistory.txTable.Container.Content.Size().Height - txHistory.txTable.Container.Size().Height - scrollPosition := float64(txHistory.txTable.Container.Offset.Y) / float64(size) - txTableRowCount := txHistory.txTable.NumberOfColumns() - - if txHistory.allTxCount > int(txHistory.TotalTxFetched) { - if txHistory.txTable.Container.Offset.Y == 0 { - if txTableRowCount < int(txPerPage) { - return - } - // table not yet scrolled wait 4 secs and update - time.AfterFunc(time.Second*4, func() { - updateTable(multiWallet, window, tabMenu) - }) - } else if scrollPosition < 0.5 { - if txHistory.TotalTxFetched == txPerPage { - time.AfterFunc(time.Second*4, func() { - updateTable(multiWallet, window, tabMenu) - }) - } - if txHistory.TotalTxFetched >= 50 { - txHistory.TotalTxFetched -= txPerPage * 2 - if txTableRowCount >= 50 { - txHistory.txTable.Delete(txTableRowCount-int(txPerPage), txTableRowCount) - } - fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, multiWallet, window, tabMenu, true) - } - } else if scrollPosition >= 0.5 { - if txTableRowCount >= 50 { - txHistory.txTable.Delete(0, txTableRowCount-int(txPerPage)) - } - fetchTx(&txHistory.txTable, txHistory.TotalTxFetched, txHistory.selectedFilterId, multiWallet, window, tabMenu, false) - } - } + return widget.NewHBox(widgets.NewHSpacer(values.Padding), txHistory.Contents, widgets.NewHSpacer(values.Padding)) } -func fetchTxDetails(hash string, multiWallet *dcrlibwallet.MultiWallet, window fyne.Window, errorLabel *widget.Label, tabMenu *widget.TabContainer) { - messageLabel := widget.NewLabelWithStyle("Fetching data..", fyne.TextAlignCenter, fyne.TextStyle{}) - time.AfterFunc(time.Millisecond*300, func() { - if tabMenu.CurrentTabIndex() == 1 { - messageLabel.SetText("") - } - }) - - txDetailslabel := widget.NewLabelWithStyle("Transaction Details", fyne.TextAlignLeading, fyne.TextStyle{Bold: true, Italic: true}) - - var txDetailsPopUp *widget.PopUp - minimizeIcon := widgets.NewImageButton(theme.CancelIcon(), nil, func() { txDetailsPopUp.Hide() }) - errorMessageLabel := widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) - - txDetailsErrorMethod := func() { - txErrorDetailsOutput := widget.NewVBox( - widget.NewHBox( - txDetailslabel, - widgets.NewHSpacer(txDetailslabel.MinSize().Width*3), - minimizeIcon, - ), - widget.NewHBox(errorMessageLabel), - ) - txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txErrorDetailsOutput)), window.Canvas()) - txDetailsPopUp.Show() - } - - chainHash, err := chainhash.NewHashFromStr(hash) - if err != nil { - helpers.ErrorHandler(fmt.Sprintf("Error fetching generating chainhash from for \n %s \n %s ", hash, err.Error()), errorMessageLabel) - txDetailsErrorMethod() - return - } - - txDetails, err := multiWallet.WalletWithID(txHistory.selectedWalletID).GetTransactionRaw(chainHash[:]) - if err != nil { - helpers.ErrorHandler(fmt.Sprintf("Error fetching transaction details for \n %s \n %s ", hash, err.Error()), errorMessageLabel) - txDetailsErrorMethod() - return - } - - var confirmations int32 = 0 - if txDetails.BlockHeight != -1 { - confirmations = multiWallet.WalletWithID(txHistory.selectedWalletID).GetBestBlock() - txDetails.BlockHeight + 1 - } - - var status string - var spendUnconfirmed = multiWallet.ReadBoolConfigValueForKey(dcrlibwallet.SpendUnconfirmedConfigKey, true) - if spendUnconfirmed || confirmations > dcrlibwallet.DefaultRequiredConfirmations { - status = "Confirmed" - } else { - status = "Pending" - } - - copyAbleText := func(text string, copyAble bool) *widgets.ClickableBox { - var textToCopy *canvas.Text - if copyAble { - textToCopy = canvas.NewText(text, values.Blue) - } else { - textToCopy = canvas.NewText(text, values.DefaultTextColor) - } - textToCopy.TextSize = 14 - textToCopy.Alignment = fyne.TextAlignTrailing - - return widgets.NewClickableBox(widget.NewHBox(textToCopy), - func() { - messageLabel.SetText("Data Copied") - clipboard := window.Clipboard() - clipboard.SetContent(text) - - time.AfterFunc(time.Second*2, func() { - if tabMenu.CurrentTabIndex() == 1 { - messageLabel.SetText("") - } - }) - }, - ) - } - - tableConfirmations := widget.NewHBox( - widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - - tableHash := widget.NewHBox( - widget.NewLabelWithStyle("Transaction ID:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - copyAbleText(txDetails.Hash, true), - ) - - tableBlockHeight := widget.NewHBox( - widget.NewLabelWithStyle("Block Height:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(strconv.Itoa(int(txDetails.BlockHeight)), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableDirection := widget.NewHBox( - widget.NewLabelWithStyle("Direction:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(txDetails.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableType := widget.NewHBox( - widget.NewLabelWithStyle("Type:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(txDetails.Type, fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableAmount := widget.NewHBox( - widget.NewLabelWithStyle("Amount:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Amount).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableSize := widget.NewHBox( - widget.NewLabelWithStyle("Size:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(strconv.Itoa(txDetails.Size)+" Bytes", fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableFee := widget.NewHBox( - widget.NewLabelWithStyle("Fee:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableFeeRate := widget.NewHBox( - widget.NewLabelWithStyle("Fee Rate:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrutil.Amount(txDetails.FeeRate).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableStatus := widget.NewHBox( - widget.NewLabelWithStyle("Status:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(status, fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableDate := widget.NewHBox( - widget.NewLabelWithStyle("Date:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(txDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - - var txInput widgets.Table - inputTableColumnLabels := widget.NewHBox( - widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) - - var inputBox []*widget.Box - for i := range txDetails.Inputs { - inputBox = append(inputBox, widget.NewHBox( - copyAbleText(txDetails.Inputs[i].PreviousOutpoint, true), - copyAbleText(txDetails.Inputs[i].AccountName, false), - copyAbleText(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), false), - )) - } - txInput.NewTable(inputTableColumnLabels, inputBox...) - - var txOutput widgets.Table - outputTableColumnLabels := widget.NewHBox( - widget.NewLabelWithStyle("Address", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Value", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) - - var outputBox []*widget.Box - for i := range txDetails.Outputs { - outputBox = append(outputBox, widget.NewHBox( - copyAbleText(txDetails.Outputs[i].AccountName, false), - copyAbleText(txDetails.Outputs[i].Address, true), - copyAbleText(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), false), - copyAbleText(txDetails.Outputs[i].ScriptType, false), - )) - } - txOutput.NewTable(outputTableColumnLabels, outputBox...) - - tableData := widget.NewVBox( - tableConfirmations, - tableHash, - tableBlockHeight, - tableDirection, - tableType, - tableAmount, - tableSize, - tableFee, - tableFeeRate, - tableStatus, - tableDate, - ) - - link, err := url.Parse(fmt.Sprintf("https://%s.dcrdata.org/tx/%s", netType, txDetails.Hash)) - if err != nil { - helpers.ErrorHandler(fmt.Sprintf("Error: ", err.Error()), errorMessageLabel) - txDetailsErrorMethod() - return - } - redirectWidget := widget.NewHBox( - widget.NewHyperlinkWithStyle("View on dcrdata", link, fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), - widgets.NewHSpacer(20), - widget.NewIcon(txHistory.icons[assets.RedirectIcon]), - ) - - txDetailsData := widget.NewVBox( - widgets.NewHSpacer(10), - tableData, - canvas.NewLine(values.TxdetailsLineColor), - redirectWidget, - widgets.NewHSpacer(10), - canvas.NewLine(values.TxdetailsLineColor), - widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), - txInput.Result, - widgets.NewHSpacer(10), - canvas.NewLine(values.TxdetailsLineColor), - widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), - txOutput.Result, - widgets.NewHSpacer(10), - ) - - txDetailsScrollContainer := widget.NewScrollContainer(txDetailsData) - txDetailsOutput := widget.NewVBox( - widgets.NewHSpacer(10), - widget.NewHBox( - txDetailslabel, - widgets.NewHSpacer(txDetailsScrollContainer.MinSize().Width*22), - minimizeIcon, - ), - widget.NewHBox(widgets.NewHSpacer(txDetailsScrollContainer.MinSize().Width*13), messageLabel), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsScrollContainer.MinSize().Width*30, txDetailsScrollContainer.MinSize().Height+400)), txDetailsScrollContainer), - widgets.NewVSpacer(10), - ) - - txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), window.Canvas()) +func initHistoryPageDynamicContent(openedWalletIDs []int) { + txHistory = historyPageDynamicData{} + txHistory.Contents = widget.NewVBox() } From a8cab7a906d682a6d0e9afa05f67d570d663e3e7 Mon Sep 17 00:00:00 2001 From: Sirmorrison Date: Tue, 24 Dec 2019 06:48:29 +0100 Subject: [PATCH 62/73] removed unrelated file --- nuklear/go.sum | 327 ------------------------------------------------- 1 file changed, 327 deletions(-) delete mode 100644 nuklear/go.sum diff --git a/nuklear/go.sum b/nuklear/go.sum deleted file mode 100644 index e17d21e0b..000000000 --- a/nuklear/go.sum +++ /dev/null @@ -1,327 +0,0 @@ -fyne.io/fyne v1.0.2-0.20190912194812-5b44bfe4c1aa h1:S+Oe5wSu+wdR8y8Aqxxd6Irk1OtqjznqI93EcBFS3+A= -fyne.io/fyne v1.0.2-0.20190912194812-5b44bfe4c1aa/go.mod h1:33kcuZDAiuenHBiyYh0t9k/d75hFGQ1KXbD5RJaMpTE= -fyne.io/fyne v1.1.3-0.20191104221827-e8f6795efa08 h1:io8pkG6pP1FjpSDoj+OMowNPylACUqWc+Cwc7DHFmZs= -fyne.io/fyne v1.1.3-0.20191104221827-e8f6795efa08/go.mod h1:QKalFvMg5T4bJYGoygqrz662GbMymGEGR5gDqcoO9CM= -fyne.io/fyne v1.1.3-0.20191105230429-790ec3d460be h1:idvVpsW8VVEZc91jTmmwXTuA4uZxFv0DReWazw9hILU= -fyne.io/fyne v1.1.3-0.20191105230429-790ec3d460be/go.mod h1:QKalFvMg5T4bJYGoygqrz662GbMymGEGR5gDqcoO9CM= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9 h1:HD8gA2tkByhMAwYaFAX9w2l7vxvBQ5NMoxDrkhqhtn4= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/BurntSushi/xgb v0.0.0-20160522221800-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/zstd v1.3.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9/go.mod h1:7uhhqiBaR4CpN0k9rMjOtjpcfGd6DG2m04zQxKnWQ0I= -github.com/Sereal/Sereal v0.0.0-20181211220259-509a78ddbda3/go.mod h1:D0JMgToj/WdxCgd30Kc1UcA9E+WdZoJqeVOuYW7iTBM= -github.com/aarzilli/nucular v0.0.0-20190403084742-0071461892e4 h1:v7eVtJ0ycKmpNgiB7DMGz5zLwzES+0i/RyIfbT16has= -github.com/aarzilli/nucular v0.0.0-20190403084742-0071461892e4/go.mod h1:KI8zBeoLu/Y4Jx1qXSlldLCfZ/TCR8VRmkjPqldnfo0= -github.com/aead/siphash v0.0.0-20170329201724-e404fcfc8885/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= -github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= -github.com/asdine/storm v0.0.0-20190216191021-fe89819f6282 h1:DmSVc81daQAPvXwcCZi0W6A14sTCYQ1QI21C0E37KoY= -github.com/asdine/storm v0.0.0-20190216191021-fe89819f6282/go.mod h1:cMLKpjHSP4q0P133fV15ojQgwWWB2IMv+hrFsmBF/wI= -github.com/atotto/clipboard v0.1.2 h1:YZCtFu5Ie8qX2VmVTBnrqLSiU9XOWwqNRmdT3gIQzbY= -github.com/atotto/clipboard v0.1.2/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v1.0.0 h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4= -github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= -github.com/btcsuite/snappy-go v1.0.0 h1:ZxaA6lo2EpxGddsA8JwWOcxlzRybb444sgmeJQMJGQE= -github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dchest/blake256 v1.0.0 h1:6gUgI5MHdz9g0TdrgKqXsoDX+Zjxmm1Sc6OsoGru50I= -github.com/dchest/blake256 v1.0.0/go.mod h1:xXNWCE1jsAP8DAjP+rKw2MbeqLczjI3TRx2VK+9OEYY= -github.com/dchest/siphash v1.2.0 h1:YWOShuhvg0GqbQpMa60QlCGtEyf7O7HC1Jf0VjdQ60M= -github.com/dchest/siphash v1.2.0/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4= -github.com/decred/base58 v1.0.0 h1:BVi1FQCThIjZ0ehG+I99NJ51o0xcc9A/fDKhmJxY6+w= -github.com/decred/base58 v1.0.0/go.mod h1:LLY1p5e3g91byL/UO1eiZaYd+uRoVRarybgcoymu9Ks= -github.com/decred/dcrd/addrmgr v1.0.2 h1:BfJoFEkdDDhaQSsx9NkVOTiOTUbEevbVf+aYRQSIAmU= -github.com/decred/dcrd/addrmgr v1.0.2/go.mod h1:gNnmTuf/Xkg8ZX3j5GXbajzPrSdf5bA7HitO2bjmq0Q= -github.com/decred/dcrd/blockchain v1.0.0/go.mod h1:nNMgOz12wlasmEJDCuSuMWYSnjDdmB4l38GKuQ/Yd+8= -github.com/decred/dcrd/blockchain v1.0.1/go.mod h1:R/4XnwNOTj5IP8jQIUzrJ8zhr/7EOk09IMODwBamZoI= -github.com/decred/dcrd/blockchain v1.0.2/go.mod h1:R/4XnwNOTj5IP8jQIUzrJ8zhr/7EOk09IMODwBamZoI= -github.com/decred/dcrd/blockchain v1.1.1 h1:CWr90sZ2YLQz84EGT+X/pzU+9AZB1eXQUy+4fsJSt5w= -github.com/decred/dcrd/blockchain v1.1.1/go.mod h1:zxi/41LgzHitpz/CZu0gxHyFHz8+ysd3lH8E3P5Uifg= -github.com/decred/dcrd/blockchain/stake v1.0.0/go.mod h1:opuzF8UouYyQyRJVF00Rdd7OgWb1WKyy1pyU0QYaxz0= -github.com/decred/dcrd/blockchain/stake v1.0.1/go.mod h1:hgoGmWMIu2LLApBbcguVpzCEEfX7M2YhuMrQdpohJzc= -github.com/decred/dcrd/blockchain/stake v1.0.2/go.mod h1:hgoGmWMIu2LLApBbcguVpzCEEfX7M2YhuMrQdpohJzc= -github.com/decred/dcrd/blockchain/stake v1.1.0 h1:kCxZdQ2/UfcD+XjE3wlCv0vLKWR9ZFtjbbTTpudb74o= -github.com/decred/dcrd/blockchain/stake v1.1.0/go.mod h1:WRuaml4bcyZYza1NT3qizlLcQwMIcAQRENvZVb2t884= -github.com/decred/dcrd/certgen v1.0.1/go.mod h1:NxEyGwzPHak+h3tNLYAXU4vWuL98HrY9Z59hc1E3SGI= -github.com/decred/dcrd/chaincfg v1.0.1/go.mod h1:O+443mQNPjci+WqWkKta3v2MgJn2u20YWy5mW3c2T7M= -github.com/decred/dcrd/chaincfg v1.1.1/go.mod h1:UlGtnp8Xx9YK+etBTybGjoFGoGXSw2bxZQuAnwfKv6I= -github.com/decred/dcrd/chaincfg v1.2.0/go.mod h1:kpoGTMIriKn5hHRSu5b65+Q9LlGUdbQcMzGujac1BVs= -github.com/decred/dcrd/chaincfg v1.3.0 h1:DEysyX1/kxlWbY97PTIPpGbMOp3+n2iixi3m9d27A6c= -github.com/decred/dcrd/chaincfg v1.3.0/go.mod h1:kpoGTMIriKn5hHRSu5b65+Q9LlGUdbQcMzGujac1BVs= -github.com/decred/dcrd/chaincfg v1.5.1 h1:u1Xbq0VTnAXIHW5ECqrWe0VYSgf5vWHqpSiwoLBzxAQ= -github.com/decred/dcrd/chaincfg v1.5.1/go.mod h1:FukMzTjkwzjPU+hK7CqDMQe3NMbSZAYU5PAcsx1wlv0= -github.com/decred/dcrd/chaincfg/chainhash v1.0.1 h1:0vG7U9+dSjSCaHQKdoSKURK2pOb47+b+8FK5q4+Je7M= -github.com/decred/dcrd/chaincfg/chainhash v1.0.1/go.mod h1:OVfvaOsNLS/A1y4Eod0Ip/Lf8qga7VXCQjUQLbkY0Go= -github.com/decred/dcrd/connmgr v1.0.1/go.mod h1:jR+woh3BTbP/35v0nHMiz6GfV1RO0uF1JA+mKeXNk04= -github.com/decred/dcrd/connmgr v1.0.2 h1:ipHJBV9fmhLi8ZZCtsNpG+kLY2c+yu59/8oOkA8BNJY= -github.com/decred/dcrd/connmgr v1.0.2/go.mod h1:jBNfQLh+454n3crgNCPrhMgZ9mVvYcMbWSCEAHsJQus= -github.com/decred/dcrd/database v1.0.0/go.mod h1:eQOhTdO3oYBshjCVxMt747CP6yKKIls6IIdqYxMRzEk= -github.com/decred/dcrd/database v1.0.1/go.mod h1:ILCeyOHFew3fZ7K2B9jl+tp5qFOap/pEGoo6Yy6Wk0g= -github.com/decred/dcrd/database v1.0.2/go.mod h1:ILCeyOHFew3fZ7K2B9jl+tp5qFOap/pEGoo6Yy6Wk0g= -github.com/decred/dcrd/database v1.0.3 h1:e5Q3gDt9LwfvpZxYqFF3OVzgr8bGeC1cen+V3mv/CCw= -github.com/decred/dcrd/database v1.0.3/go.mod h1:TLxRwIV8x85+dxPTLAWu4mHg45TkKrrza5xzwOS1QtA= -github.com/decred/dcrd/dcrec v0.0.0-20180721005212-59fe2b293f69/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20180721005914-d26200ec716b/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20180721031028-5369a485acf6/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20180801202239-0761de129164/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20180809193022-9536f0c88fa8/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20180816212643-20eda7ec9229/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20181212181811-1a370d38d671/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20190311054417-9a5161ce9e68 h1:B1D7mNerPowhabwwGMB8ZzLiG8gtacAt+0CcIffpKDU= -github.com/decred/dcrd/dcrec v0.0.0-20190311054417-9a5161ce9e68/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v1.0.0 h1:W+z6Es+Rai3MXYVoPAxYr5U1DGis0Co33scJ6uH2J6o= -github.com/decred/dcrd/dcrec v1.0.0/go.mod h1:HIaqbEJQ+PDzQcORxnqen5/V1FR3B4VpIfmePklt8Q8= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20180721005212-59fe2b293f69/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20180721031028-5369a485acf6/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20180809193022-9536f0c88fa8/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20180816212643-20eda7ec9229/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20181208004914-a0816cf4301f h1:NF7vp3nZ4MsAiXswGmE//m83jCN0lDsQrLI7IwLCTlo= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20181208004914-a0816cf4301f/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= -github.com/decred/dcrd/dcrec/edwards v1.0.0 h1:UDcPNzclKiJlWqV3x1Fl8xMCJrolo4PB4X9t8LwKDWU= -github.com/decred/dcrd/dcrec/edwards v1.0.0/go.mod h1:HblVh1OfMt7xSxUL1ufjToaEvpbjpWvvTAUx4yem8BI= -github.com/decred/dcrd/dcrec/secp256k1 v1.0.0/go.mod h1:JPMFscGlgXTV684jxQNDijae2qrh0fLG7pJBimaYotE= -github.com/decred/dcrd/dcrec/secp256k1 v1.0.1 h1:EFWVd1p0t0Y5tnsm/dJujgV0ORogRJ6vo7CMAjLseAc= -github.com/decred/dcrd/dcrec/secp256k1 v1.0.1/go.mod h1:lhu4eZFSfTJWUnR3CFRcpD+Vta0KUAqnhTsTksHXgy0= -github.com/decred/dcrd/dcrjson v1.0.0/go.mod h1:ozddIaeF+EAvZZvFuB3zpfxhyxBGfvbt22crQh+PYuI= -github.com/decred/dcrd/dcrjson v1.1.0/go.mod h1:ozddIaeF+EAvZZvFuB3zpfxhyxBGfvbt22crQh+PYuI= -github.com/decred/dcrd/dcrjson v1.2.0 h1:3BFFQHq3/YO/zae9WLxQkXsX6AXKx3+M8H3yk4oXZi0= -github.com/decred/dcrd/dcrjson v1.2.0/go.mod h1:ozddIaeF+EAvZZvFuB3zpfxhyxBGfvbt22crQh+PYuI= -github.com/decred/dcrd/dcrutil v1.0.0/go.mod h1:CBpbItyMKkL/4i1qPJDsE/cdSYklsWFcTYgprRZh4yk= -github.com/decred/dcrd/dcrutil v1.1.1/go.mod h1:Jsttr0pEvzPAw+qay1kS1/PsbZYPyhluiNwwY6yBJS4= -github.com/decred/dcrd/dcrutil v1.2.0 h1:Pd5Wf650g6Xu6luYDfGkh1yiUoPUAgqzRu6K+BGyJGg= -github.com/decred/dcrd/dcrutil v1.2.0/go.mod h1:tUNHS2gj7ApeEVS8gb6O+4wJW7w3O2MSRyRdcjW1JxU= -github.com/decred/dcrd/gcs v1.0.0/go.mod h1:5uHIPAzn4SdGP2/FhVBK2YdAoKmufds3ZI8yNzojUCM= -github.com/decred/dcrd/gcs v1.0.1/go.mod h1:YwutGzusSdJM79CJtxCo9t7WRCvnkLtWSD19TPo1i9g= -github.com/decred/dcrd/gcs v1.0.2 h1:wZjxeC9WPBoRApaAQpBrzvN9NA0iS2KWrTJa9IiDgc8= -github.com/decred/dcrd/gcs v1.0.2/go.mod h1:eLCvrzUsWro48TlTyrmFcZAZqnllYFz0vEv5VZtufF4= -github.com/decred/dcrd/hdkeychain v1.1.0/go.mod h1:zyUZtZ3PdnTPHt2XUr1x76b8ZuiM+9aVkP8Rq8Scp1k= -github.com/decred/dcrd/hdkeychain v1.1.1 h1:6+BwOmPfEyw/Krm+91RXysc76F1jqCta3m45DyD5+s4= -github.com/decred/dcrd/hdkeychain v1.1.1/go.mod h1:CLBVXLoO63fIiqkv38KR23zXGSgrfiAWOybOKTneLhA= -github.com/decred/dcrd/mempool v1.0.1/go.mod h1:r+/DGiiluXi1EyMCCPPH58Qu+rsr8nZv0DialAG5VZQ= -github.com/decred/dcrd/mempool v1.1.1 h1:ysFIS3HzEIJ88B1Y4OfL6wjzBurlChbKkzq54hPglGo= -github.com/decred/dcrd/mempool v1.1.1/go.mod h1:u1I2KRv9UHhx2crlbZXYoLDabWyQ8VnnHDSG53UdhCA= -github.com/decred/dcrd/mining v1.0.0/go.mod h1:VA5H4zhJgXb8LK5lqM5H58dhMRXJRcaQQoX3G8QRpP8= -github.com/decred/dcrd/mining v1.0.1/go.mod h1:+CSOLPi7TM8OlQg7mJ7XzWLXCDb4nHK8R6cvXOzhEoU= -github.com/decred/dcrd/mining v1.1.0 h1:9Wtla+i+pEjfYsNCfixsipmyyoB26DgL4LSXWAin/zw= -github.com/decred/dcrd/mining v1.1.0/go.mod h1:NQEtX604XgNwKcPFId1hVTTiBqmVQDlnqV1yNqGl4oU= -github.com/decred/dcrd/rpcclient v1.0.1/go.mod h1:tApXK3wwrAQtz7lcXeeqBwuktUZesvrFfvhAdedYqdM= -github.com/decred/dcrd/rpcclient v1.1.0 h1:nQZ1qOJaLYoOTM1oQ2dLaqocb5TWI7gNBK+BTY7UVXk= -github.com/decred/dcrd/rpcclient v1.1.0/go.mod h1:SCwBs4d+aqRV2ChnriIZ1y/LgNVHG/2ieEC1vIop82s= -github.com/decred/dcrd/txscript v1.0.0/go.mod h1:9byvrOaBSBVVnDG7Cm0JgN8bZytl1oi9Ba245VBeI18= -github.com/decred/dcrd/txscript v1.0.1/go.mod h1:FqUX07Y+u3cJ1eIGPoyWbJg+Wk1NTllln/TyDpx9KnY= -github.com/decred/dcrd/txscript v1.0.2 h1:kzJZDuteyzvI15VNhtgFHxeeq210RTkFyfzN7d+1iPo= -github.com/decred/dcrd/txscript v1.0.2/go.mod h1:hmUOHFlOjU7H6T/czt6kurWwXJvGPGKKGtXoft6w/qY= -github.com/decred/dcrd/wire v1.0.1/go.mod h1:zpKZnBiN59CrzfXFigwgXmUDVYf34OLbEr8xwAwriHc= -github.com/decred/dcrd/wire v1.1.0/go.mod h1:/JKOsLInOJu6InN+/zH5AyCq3YDIOW/EqcffvU8fJHM= -github.com/decred/dcrd/wire v1.2.0 h1:HqJVB7vcklIguzFWgRXw/WYCQ9cD3bUC5TKj53i1Hng= -github.com/decred/dcrd/wire v1.2.0/go.mod h1:/JKOsLInOJu6InN+/zH5AyCq3YDIOW/EqcffvU8fJHM= -github.com/decred/dcrdata v2.1.3+incompatible h1:DLzrqgOOgHwrUSbuOVDAUzfQePhCGl9UsjEgZI1D0Kg= -github.com/decred/dcrdata v2.1.3+incompatible/go.mod h1:9dhUy80j3VCCh0JNYaW3b960hqkxATNq65FxGMYB7mA= -github.com/decred/dcrwallet v1.2.2 h1:NdI13wxP+OsWKXPqjWQQ9VSGAl4VoSLBfAunzFreeJg= -github.com/decred/dcrwallet v1.2.2/go.mod h1:BrSus0F+Rx8UhvPNBfuRMIjRJBNrW2sLspN9iQR5hm8= -github.com/decred/dcrwallet v1.2.3-0.20181120205657-8690f1096aa7/go.mod h1:BrSus0F+Rx8UhvPNBfuRMIjRJBNrW2sLspN9iQR5hm8= -github.com/decred/dcrwallet/chain v1.0.0/go.mod h1:KpZFaKlKajfUZt36+RmBn2HKwTbwoa3yt9HPALqlShI= -github.com/decred/dcrwallet/chain v1.1.1 h1:YUJ1ArUaN/WuMnTP1PvfirNaqIQO9+UUNDifhnJ8QQQ= -github.com/decred/dcrwallet/chain v1.1.1/go.mod h1:2kA82rBDkCKOSYFV+Q14RZNCuYwdaQ9uO/c+RixqRNs= -github.com/decred/dcrwallet/deployments v1.0.0/go.mod h1:0bWER/DAYoGbzkWzbUf6k2agW4YkSyvNLZDhBGThz/4= -github.com/decred/dcrwallet/deployments v1.1.0 h1:83arg+7ct7PS1H2IYhuePnrBK2rkVpEYWKqrJpCwtHA= -github.com/decred/dcrwallet/deployments v1.1.0/go.mod h1:8Sasryu8SX23Jvqr6maZ7MoS7wFIGXupWzbsVtcZsUg= -github.com/decred/dcrwallet/errors v1.0.0/go.mod h1:XUm95dWmm9XmQGvneBXJkkIaFeRsQVBB6ni/KTy1hrY= -github.com/decred/dcrwallet/errors v1.0.1 h1:8EF7IY6twRlo9sqWaSfm8abfi2/rHZ1wacOiGvBy+bM= -github.com/decred/dcrwallet/errors v1.0.1/go.mod h1:XUm95dWmm9XmQGvneBXJkkIaFeRsQVBB6ni/KTy1hrY= -github.com/decred/dcrwallet/internal/helpers v1.0.0/go.mod h1:FsihtjCyFrGL6gdmkxBWTYQ1CUgbfM9tyinYNOzLnlk= -github.com/decred/dcrwallet/internal/helpers v1.0.1 h1:oEqfJPs1uI7QI0Aejx2MUWq/yD609cc9Z8P7vQ6cDz8= -github.com/decred/dcrwallet/internal/helpers v1.0.1/go.mod h1:qIXcze8VZ+A3sEgZou7PTOe4Vsnmks54SGTSGZ6084g= -github.com/decred/dcrwallet/internal/zero v1.0.0/go.mod h1:vULuNLRTcnifKCepcIxUDL4jrR3rJOwVR9UDH89Qpms= -github.com/decred/dcrwallet/internal/zero v1.0.1 h1:hO7orPk13AFp7pFTL739CbVLKImSNorI2J9/tiucNQY= -github.com/decred/dcrwallet/internal/zero v1.0.1/go.mod h1:mXUIsKATE1pIaNAJQ4lhSTX6c9N5sYoSrlScgRCaMJs= -github.com/decred/dcrwallet/lru v1.0.0 h1:vz71/Wa2890CUQeWsOTI6u6iGGfXGAhIQ/hnqMUh6Xc= -github.com/decred/dcrwallet/lru v1.0.0/go.mod h1:jEty7mdT5VaaV06DEV2Avv0R3HpGvUwvDW4lw8ECtiY= -github.com/decred/dcrwallet/p2p v1.0.0/go.mod h1:b1CLZAkl/K5dr5I5B4SdFT8FrE11jSkfA4VAA862ACA= -github.com/decred/dcrwallet/p2p v1.0.1 h1:UTsD5I8YtWVf2SEg0mSd5+hIlp7Ihj3rS2PZ9P5cXVI= -github.com/decred/dcrwallet/p2p v1.0.1/go.mod h1:FsoAR0cBOLW3VKMg+Tdx+wdSezR7g8NGOdz4fx6gtpM= -github.com/decred/dcrwallet/pgpwordlist v1.0.0 h1:H7Y3+yRZq7PXMPfpKLMnY5TKTjTWhc0oJmyN7v8tC/M= -github.com/decred/dcrwallet/pgpwordlist v1.0.0/go.mod h1:Fek3uYn+9DnEFIreA/8PnTIXUl2lBO64JpEBkL9BXtk= -github.com/decred/dcrwallet/rpc/walletrpc v0.1.0/go.mod h1:Zp1ZFTCUo7S6MJvUyS5tYfaDUxGAMHkZ+vbsLgAdd4A= -github.com/decred/dcrwallet/rpc/walletrpc v1.0.1-0.20181109211527-ca582da21c08/go.mod h1:Zp1ZFTCUo7S6MJvUyS5tYfaDUxGAMHkZ+vbsLgAdd4A= -github.com/decred/dcrwallet/spv v1.0.0/go.mod h1:lz39nz9P/HVoxYa4XAT6ithyR3WgdF0oVu4jtFwnCxE= -github.com/decred/dcrwallet/spv v1.1.1 h1:G5yXkoiO4LOh3Ba+qvyUIjF2dChOXpiuRCPpjYzzhZw= -github.com/decred/dcrwallet/spv v1.1.1/go.mod h1:HYfF+A1F+Apf0WPT6QRsG/gfvaFQmWObAytq8pWc6ME= -github.com/decred/dcrwallet/ticketbuyer v1.0.0/go.mod h1:mrAlRjOJ6txO8Zyqo5koxVOMEYLK2POUX35a/QcKN8g= -github.com/decred/dcrwallet/ticketbuyer v1.0.2 h1:vEcUSwCGZolg8fxSJ8+mW2XCdZ6J9LtwxCxRPdcpbQk= -github.com/decred/dcrwallet/ticketbuyer v1.0.2/go.mod h1:oDHY0TOFIaQjZ11TJbgztC5tt1zi6wKoRmyQMmwfft4= -github.com/decred/dcrwallet/ticketbuyer/v2 v2.0.0/go.mod h1:VKo2PjXAlF/E46tSBKrIgqKbVcHVLfM5ACyOehT1unA= -github.com/decred/dcrwallet/ticketbuyer/v2 v2.0.1 h1:RLCly+fnbrMXzWVi4a4cUU2sGWi56e7UPJq9GHoe1iw= -github.com/decred/dcrwallet/ticketbuyer/v2 v2.0.1/go.mod h1:ngtx8I/+Jo+U+E/5XjwCkmU55wCGtUbaDnCP5qazNGM= -github.com/decred/dcrwallet/validate v1.0.0/go.mod h1:zHIlcrjAWl6LK+X+R7jc3F9wIM/qxjtMjG/mdEwt4tY= -github.com/decred/dcrwallet/validate v1.0.1/go.mod h1:9DCtLFnnTOC/7PKkF7jehvDyHkfUBl41ZbcT1u4PmQM= -github.com/decred/dcrwallet/validate v1.0.2 h1:EXY48b3SOkTGXJAB+OUmilvyFNROZywYIWTGYfUnTDE= -github.com/decred/dcrwallet/validate v1.0.2/go.mod h1:1ur2sRZkQ23ECalUKdwgx6rdIiP8rIiaSQAz1Y9LQsI= -github.com/decred/dcrwallet/version v1.0.0/go.mod h1:rXeMsUaI03WtlQrSol7Q7sJ8HBOB+tZvT7YQRXD5Y7M= -github.com/decred/dcrwallet/version v1.0.1 h1:gAz1lDkcJ+oAbg0tOn/J0KwZBVWIlhWmHhSUi9GbB2E= -github.com/decred/dcrwallet/version v1.0.1/go.mod h1:rXeMsUaI03WtlQrSol7Q7sJ8HBOB+tZvT7YQRXD5Y7M= -github.com/decred/dcrwallet/wallet v1.0.0/go.mod h1:VWRnpNFRiKPo7FUPbzj0t5ElcGxNXMPIa4vGcGe94uM= -github.com/decred/dcrwallet/wallet v1.1.0/go.mod h1:g4OzDG7jpsRqTDP3bHiA0LIEZFx81accYPCkO1DBNT8= -github.com/decred/dcrwallet/wallet v1.2.3/go.mod h1:ItOhnw3C4znuLQVWACSq8jCLy221v9X0Xo0b/j5WqgU= -github.com/decred/dcrwallet/wallet v1.3.0 h1:RQ4uHIfbDF0ppyeVDkTr7GapeABCddUUKOSexTN7X1M= -github.com/decred/dcrwallet/wallet v1.3.0/go.mod h1:ItOhnw3C4znuLQVWACSq8jCLy221v9X0Xo0b/j5WqgU= -github.com/decred/dcrwallet/walletseed v1.0.0/go.mod h1:xSF6hZW+5Xhm0jJFsI5jQSfViuZUQJoDXa/cQxtgncs= -github.com/decred/dcrwallet/walletseed v1.0.1 h1:gxvlj0GRw+H0VumCxTlEysu+/nltcp9+lgzVgzsnI/Y= -github.com/decred/dcrwallet/walletseed v1.0.1/go.mod h1:ENlwTabC2JVmT4S1eCP44fnwX4+9y2RLsnfSU21CJ+4= -github.com/decred/slog v1.0.0 h1:Dl+W8O6/JH6n2xIFN2p3DNjCmjYwvrXsjlSJTQQ4MhE= -github.com/decred/slog v1.0.0/go.mod h1:zR98rEZHSnbZ4WHZtO0iqmSZjDLKhkXfrPTZQKtAonQ= -github.com/dgraph-io/badger v1.5.4 h1:gVTrpUTbbr/T24uvoCaqY2KSHfNLVGm0w+hbee2HMeg= -github.com/dgraph-io/badger v1.5.4/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ= -github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f h1:dDxpBYafY/GYpcl+LS4Bn3ziLPuEdGRkRjYAbSlWxSA= -github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= -github.com/gdamore/tcell v1.1.1/go.mod h1:K1udHkiR3cOtlpKG5tZPD5XxrF7v2y7lDq7Whcj+xkQ= -github.com/go-chi/chi v4.0.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= -github.com/go-gl/gl v0.0.0-20181026044259-55b76b7df9d2/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk= -github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk= -github.com/go-gl/glfw v0.0.0-20181213070059-819e8ce5125f/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff/go.mod h1:wfqRWLHRBsRgkp5dmbG56SA0DmVtwrF5N3oPdI8t+Aw= -github.com/golang/freetype v0.0.0-20161208064710-d9be45aaf745 h1:0d9whnMsm0iklqvoBXNEgHPt8pkXdfDplBAswA/F8YA= -github.com/golang/freetype v0.0.0-20161208064710-d9be45aaf745/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gorilla/websocket v1.2.0 h1:VJtLvh6VQym50czpZzx07z/kw9EgAxI3x1ZB8taTMQQ= -github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/hashicorp/golang-lru v0.0.0-20160813221303-0a025b7e63ad h1:eMxs9EL0PvIGS9TTtxg4R+JxuPGav82J8rA+GFnY7po= -github.com/hashicorp/golang-lru v0.0.0-20160813221303-0a025b7e63ad/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/jackmordaunt/icns v0.0.0-20181231085925-4f16af745526/go.mod h1:UQkeMHVoNcyXYq9otUupF7/h/2tmHlhrS2zw7ZVvUqc= -github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/josephspurrier/goversioninfo v0.0.0-20190124120936-8611f5a5ff3f/go.mod h1:eJTEwMjXb7kZ633hO3Ln9mBUCOjX2+FlTljvpl9SYdE= -github.com/jrick/bitset v1.0.0 h1:Ws0PXV3PwXqWK2n7Vz6idCdrV/9OrBXgHEJi27ZB9Dw= -github.com/jrick/bitset v1.0.0/go.mod h1:ZOYB5Uvkla7wIEY4FEssPVi3IQXa02arznRaYaAEPe4= -github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.2/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/lucasb-eyer/go-colorful v0.0.0-20181028223441-12d3b2882a08/go.mod h1:NXg0ArsFk0Y01623LgUqoqcouGDB+PwCCQlrwrG6xJ4= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/raedahgroup/dcrlibwallet v1.0.1-0.20190807181808-37b6666fe764 h1:arCUsqsYbfYPNlNjP6H0ylKJS8H31t/AfFfKd/VHzKY= -github.com/raedahgroup/dcrlibwallet v1.0.1-0.20190807181808-37b6666fe764/go.mod h1:7BxsN3VU3KWUt9R8eHgrBI88kE7/WWSfN0yl0vU1SM8= -github.com/raedahgroup/dcrlibwallet v1.1.0 h1:UeOqLi3h9oQGUlhwwmCspJlEAPD2IfrHdu5EPtph54w= -github.com/raedahgroup/dcrlibwallet v1.1.0/go.mod h1:szxgNhCQ/GRyFpmkfYi3T3ZkXPx9Hm9j0EnjaBfJK/o= -github.com/raedahgroup/dcrlibwallet v1.1.1-0.20190928085114-bcc6e6b7769a h1:BvFVstGjzuNeFsNTmAZCfPxK2u51EGQVAdFKCauqaNE= -github.com/raedahgroup/dcrlibwallet v1.1.1-0.20190928085114-bcc6e6b7769a/go.mod h1:6AGgglq9BB0twJnZnHvfH8hIQrbw6yBJSPp9QI+hBk0= -github.com/raedahgroup/godcr/app v0.0.0-20191001132534-0f6d1a0712a5 h1:KYkmOcMcWW0wyfdogY0+xuoyuNfqSYJLMqbkT7u93z0= -github.com/raedahgroup/godcr/app v0.0.0-20191001132534-0f6d1a0712a5/go.mod h1:ak+aVMUsyGeqhHKFXDlu056ZFahud/MK+DEZEIeggWo= -github.com/raedahgroup/godcr/app v0.0.0-20191104184142-723795cee288 h1:2Wrrw4juUg8J7IhsGdt/dCrAcIMIM4feNFHdKdvOeZ0= -github.com/raedahgroup/godcr/app v0.0.0-20191104184142-723795cee288/go.mod h1:ak+aVMUsyGeqhHKFXDlu056ZFahud/MK+DEZEIeggWo= -github.com/rivo/tview v0.0.0-20190113120821-e5e361b9d790 h1:yt1AZgiBi8RcCo0PoyU4gSFwKjlbkSGRFVZGz7R6oB0= -github.com/rivo/tview v0.0.0-20190113120821-e5e361b9d790/go.mod h1:J4W+hErFfITUbyFAEXizpmkuxX7ZN56dopxHB4XQhMw= -github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9 h1:lpEzuenPuO1XNTeikEmvqYFcU37GVLl8SRNblzyvGBE= -github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9/go.mod h1:PLPIyL7ikehBD1OAjmKKiOEhbvWyHGaNDjquXMcYABo= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/srwiley/oksvg v0.0.0-20190105194046-ccbc7673cdf3/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4= -github.com/srwiley/oksvg v0.0.0-20190414003808-c520f0a6c5cc/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4= -github.com/srwiley/rasterx v0.0.0-20181219215540-696f7edb7a7e/go.mod h1:mvWM0+15UqyrFKqdRjY6LuAVJR0HOVhJlEgZ5JWtSWU= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -go.etcd.io/bbolt v1.3.0 h1:oY10fI923Q5pVCVt1GBTZMn8LHo5M+RCInFpeMnV4QI= -go.etcd.io/bbolt v1.3.0/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -golang.org/x/crypto v0.0.0-20180718160520-a2144134853f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180808211826-de0752318171/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8 h1:1wopBVtVdWnn03fZelqdXTqk7U7zPQCb+T4rbU9ZEoU= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8 h1:idBdZTd9UioThJp8KpM/rTSinK/ChZFBE43/WtIy8zg= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= -golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 h1:estk1glOnSVeJ9tdEZZc5mAMDZk5lNJNyJ6DvrBkTEU= -golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4= -golang.org/x/image v0.0.0-20181116024801-cd38e8056d9b/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190501045829-6d32002ffd75 h1:TbGuee8sSq15Iguxu4deQ7+Bqq/d2rsQejGcEtADAMQ= -golang.org/x/image v0.0.0-20190501045829-6d32002ffd75/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/mobile v0.0.0-20190318164015-6bd122906c08 h1:REhdg1qxVTaAJcvh9BOGNgt2kd+KiUZ148XXlLp08FU= -golang.org/x/mobile v0.0.0-20190318164015-6bd122906c08/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180808004115-f9ce57c11b24/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd h1:HuTn7WObtcDo9uEEU7rEqL0jYthdXAmZ6PP+meazmaU= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190420063019-afa5a82059c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180810070207-f0d5e33068cb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180816055513-1c9583448a9c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181206074257-70b957f3b65e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181212120007-b05ddf57801d/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313 h1:pczuHS43Cp2ktBEEmLwScxgjWsBSzdaQiKzUyf3DTTc= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180808183934-383e8b2c3b9e/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/grpc v1.14.0 h1:ArxJuB1NWfPY6r9Gp9gqwplT0Ge7nqv9msgu03lHLmo= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0/go.mod h1:OdE7CF6DbADk7lN8LIKRzRJTTZXIjtWgA5THM5lhBAw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= From 06b6a8b380347e5eb3ed60dc6fa5b4f250be4483 Mon Sep 17 00:00:00 2001 From: Sirmorrison Date: Tue, 24 Dec 2019 06:49:19 +0100 Subject: [PATCH 63/73] removed unrelated file --- cli/go.sum | 323 ----------------------------------------------------- 1 file changed, 323 deletions(-) delete mode 100644 cli/go.sum diff --git a/cli/go.sum b/cli/go.sum deleted file mode 100644 index c5edaa216..000000000 --- a/cli/go.sum +++ /dev/null @@ -1,323 +0,0 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -fyne.io/fyne v1.1.0/go.mod h1:mz0CvQX1ACEjiDGpSH3D8Qf9yHq8dfYA039kG7p8ZhQ= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9 h1:HD8gA2tkByhMAwYaFAX9w2l7vxvBQ5NMoxDrkhqhtn4= -github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/xgb v0.0.0-20160522221800-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/zstd v1.3.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= -github.com/Kodeworks/golang-image-ico v0.0.0-20141118225523-73f0f4cfade9/go.mod h1:7uhhqiBaR4CpN0k9rMjOtjpcfGd6DG2m04zQxKnWQ0I= -github.com/Sereal/Sereal v0.0.0-20181211220259-509a78ddbda3/go.mod h1:D0JMgToj/WdxCgd30Kc1UcA9E+WdZoJqeVOuYW7iTBM= -github.com/aarzilli/nucular v0.0.0-20190403084742-0071461892e4/go.mod h1:KI8zBeoLu/Y4Jx1qXSlldLCfZ/TCR8VRmkjPqldnfo0= -github.com/aead/siphash v0.0.0-20170329201724-e404fcfc8885/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= -github.com/akavel/rsrc v0.8.0/go.mod h1:uLoCtb9J+EyAqh+26kdrTgmzRBFPGOolLWKpdxkKq+c= -github.com/asdine/storm v0.0.0-20190216191021-fe89819f6282 h1:DmSVc81daQAPvXwcCZi0W6A14sTCYQ1QI21C0E37KoY= -github.com/asdine/storm v0.0.0-20190216191021-fe89819f6282/go.mod h1:cMLKpjHSP4q0P133fV15ojQgwWWB2IMv+hrFsmBF/wI= -github.com/atotto/clipboard v0.1.2/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= -github.com/boltdb/bolt v1.3.1 h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd h1:R/opQEbFEy9JGkIguV40SvRY1uliPX8ifOvi6ICsFCw= -github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= -github.com/btcsuite/goleveldb v1.0.0 h1:Tvd0BfvqX9o823q1j2UZ/epQo09eJh6dTcRp79ilIN4= -github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= -github.com/btcsuite/snappy-go v1.0.0 h1:ZxaA6lo2EpxGddsA8JwWOcxlzRybb444sgmeJQMJGQE= -github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dchest/blake256 v1.0.0 h1:6gUgI5MHdz9g0TdrgKqXsoDX+Zjxmm1Sc6OsoGru50I= -github.com/dchest/blake256 v1.0.0/go.mod h1:xXNWCE1jsAP8DAjP+rKw2MbeqLczjI3TRx2VK+9OEYY= -github.com/dchest/siphash v1.2.0 h1:YWOShuhvg0GqbQpMa60QlCGtEyf7O7HC1Jf0VjdQ60M= -github.com/dchest/siphash v1.2.0/go.mod h1:q+IRvb2gOSrUnYoPqHiyHXS0FOBBOdl6tONBlVnOnt4= -github.com/decred/base58 v1.0.0 h1:BVi1FQCThIjZ0ehG+I99NJ51o0xcc9A/fDKhmJxY6+w= -github.com/decred/base58 v1.0.0/go.mod h1:LLY1p5e3g91byL/UO1eiZaYd+uRoVRarybgcoymu9Ks= -github.com/decred/dcrd/addrmgr v1.0.2 h1:BfJoFEkdDDhaQSsx9NkVOTiOTUbEevbVf+aYRQSIAmU= -github.com/decred/dcrd/addrmgr v1.0.2/go.mod h1:gNnmTuf/Xkg8ZX3j5GXbajzPrSdf5bA7HitO2bjmq0Q= -github.com/decred/dcrd/blockchain v1.0.0/go.mod h1:nNMgOz12wlasmEJDCuSuMWYSnjDdmB4l38GKuQ/Yd+8= -github.com/decred/dcrd/blockchain v1.0.1/go.mod h1:R/4XnwNOTj5IP8jQIUzrJ8zhr/7EOk09IMODwBamZoI= -github.com/decred/dcrd/blockchain v1.0.2/go.mod h1:R/4XnwNOTj5IP8jQIUzrJ8zhr/7EOk09IMODwBamZoI= -github.com/decred/dcrd/blockchain v1.1.1 h1:CWr90sZ2YLQz84EGT+X/pzU+9AZB1eXQUy+4fsJSt5w= -github.com/decred/dcrd/blockchain v1.1.1/go.mod h1:zxi/41LgzHitpz/CZu0gxHyFHz8+ysd3lH8E3P5Uifg= -github.com/decred/dcrd/blockchain/stake v1.0.0/go.mod h1:opuzF8UouYyQyRJVF00Rdd7OgWb1WKyy1pyU0QYaxz0= -github.com/decred/dcrd/blockchain/stake v1.0.1/go.mod h1:hgoGmWMIu2LLApBbcguVpzCEEfX7M2YhuMrQdpohJzc= -github.com/decred/dcrd/blockchain/stake v1.0.2/go.mod h1:hgoGmWMIu2LLApBbcguVpzCEEfX7M2YhuMrQdpohJzc= -github.com/decred/dcrd/blockchain/stake v1.1.0 h1:kCxZdQ2/UfcD+XjE3wlCv0vLKWR9ZFtjbbTTpudb74o= -github.com/decred/dcrd/blockchain/stake v1.1.0/go.mod h1:WRuaml4bcyZYza1NT3qizlLcQwMIcAQRENvZVb2t884= -github.com/decred/dcrd/certgen v1.0.1/go.mod h1:NxEyGwzPHak+h3tNLYAXU4vWuL98HrY9Z59hc1E3SGI= -github.com/decred/dcrd/chaincfg v1.0.1/go.mod h1:O+443mQNPjci+WqWkKta3v2MgJn2u20YWy5mW3c2T7M= -github.com/decred/dcrd/chaincfg v1.1.1/go.mod h1:UlGtnp8Xx9YK+etBTybGjoFGoGXSw2bxZQuAnwfKv6I= -github.com/decred/dcrd/chaincfg v1.2.0/go.mod h1:kpoGTMIriKn5hHRSu5b65+Q9LlGUdbQcMzGujac1BVs= -github.com/decred/dcrd/chaincfg v1.3.0/go.mod h1:kpoGTMIriKn5hHRSu5b65+Q9LlGUdbQcMzGujac1BVs= -github.com/decred/dcrd/chaincfg v1.5.1 h1:u1Xbq0VTnAXIHW5ECqrWe0VYSgf5vWHqpSiwoLBzxAQ= -github.com/decred/dcrd/chaincfg v1.5.1/go.mod h1:FukMzTjkwzjPU+hK7CqDMQe3NMbSZAYU5PAcsx1wlv0= -github.com/decred/dcrd/chaincfg/chainhash v1.0.1 h1:0vG7U9+dSjSCaHQKdoSKURK2pOb47+b+8FK5q4+Je7M= -github.com/decred/dcrd/chaincfg/chainhash v1.0.1/go.mod h1:OVfvaOsNLS/A1y4Eod0Ip/Lf8qga7VXCQjUQLbkY0Go= -github.com/decred/dcrd/chaincfg/v2 v2.0.2 h1:VeGY52lHuYT01tIGbvYj+OO0GaGxGaJmnh+4vGca1+U= -github.com/decred/dcrd/chaincfg/v2 v2.0.2/go.mod h1:hpKvhLCDAD/xDZ3V1Pqpv9fIKVYYi11DyxETguazyvg= -github.com/decred/dcrd/connmgr v1.0.1/go.mod h1:jR+woh3BTbP/35v0nHMiz6GfV1RO0uF1JA+mKeXNk04= -github.com/decred/dcrd/connmgr v1.0.2 h1:ipHJBV9fmhLi8ZZCtsNpG+kLY2c+yu59/8oOkA8BNJY= -github.com/decred/dcrd/connmgr v1.0.2/go.mod h1:jBNfQLh+454n3crgNCPrhMgZ9mVvYcMbWSCEAHsJQus= -github.com/decred/dcrd/database v1.0.0/go.mod h1:eQOhTdO3oYBshjCVxMt747CP6yKKIls6IIdqYxMRzEk= -github.com/decred/dcrd/database v1.0.1/go.mod h1:ILCeyOHFew3fZ7K2B9jl+tp5qFOap/pEGoo6Yy6Wk0g= -github.com/decred/dcrd/database v1.0.2/go.mod h1:ILCeyOHFew3fZ7K2B9jl+tp5qFOap/pEGoo6Yy6Wk0g= -github.com/decred/dcrd/database v1.0.3 h1:e5Q3gDt9LwfvpZxYqFF3OVzgr8bGeC1cen+V3mv/CCw= -github.com/decred/dcrd/database v1.0.3/go.mod h1:TLxRwIV8x85+dxPTLAWu4mHg45TkKrrza5xzwOS1QtA= -github.com/decred/dcrd/dcrec v0.0.0-20180721005212-59fe2b293f69/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20180721005914-d26200ec716b/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20180721031028-5369a485acf6/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20180801202239-0761de129164/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20180809193022-9536f0c88fa8/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20180816212643-20eda7ec9229/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20181212181811-1a370d38d671/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v0.0.0-20190311054417-9a5161ce9e68/go.mod h1:cRAH1SNk8Mi9hKBc/DHbeiWz/fyO8KWZR3H7okrIuOA= -github.com/decred/dcrd/dcrec v1.0.0 h1:W+z6Es+Rai3MXYVoPAxYr5U1DGis0Co33scJ6uH2J6o= -github.com/decred/dcrd/dcrec v1.0.0/go.mod h1:HIaqbEJQ+PDzQcORxnqen5/V1FR3B4VpIfmePklt8Q8= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20180721005212-59fe2b293f69/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20180721031028-5369a485acf6/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20180809193022-9536f0c88fa8/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20180816212643-20eda7ec9229/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= -github.com/decred/dcrd/dcrec/edwards v0.0.0-20181208004914-a0816cf4301f/go.mod h1:+ehP0Hk/mesyZXttxCtBbhPX23BMpZJ1pcVBqUfbmvU= -github.com/decred/dcrd/dcrec/edwards v1.0.0 h1:UDcPNzclKiJlWqV3x1Fl8xMCJrolo4PB4X9t8LwKDWU= -github.com/decred/dcrd/dcrec/edwards v1.0.0/go.mod h1:HblVh1OfMt7xSxUL1ufjToaEvpbjpWvvTAUx4yem8BI= -github.com/decred/dcrd/dcrec/secp256k1 v1.0.0/go.mod h1:JPMFscGlgXTV684jxQNDijae2qrh0fLG7pJBimaYotE= -github.com/decred/dcrd/dcrec/secp256k1 v1.0.1/go.mod h1:lhu4eZFSfTJWUnR3CFRcpD+Vta0KUAqnhTsTksHXgy0= -github.com/decred/dcrd/dcrec/secp256k1 v1.0.2 h1:awk7sYJ4pGWmtkiGHFfctztJjHMKGLV8jctGQhAbKe0= -github.com/decred/dcrd/dcrec/secp256k1 v1.0.2/go.mod h1:CHTUIVfmDDd0KFVFpNX1pFVCBUegxW387nN0IGwNKR0= -github.com/decred/dcrd/dcrjson v1.0.0/go.mod h1:ozddIaeF+EAvZZvFuB3zpfxhyxBGfvbt22crQh+PYuI= -github.com/decred/dcrd/dcrjson v1.1.0/go.mod h1:ozddIaeF+EAvZZvFuB3zpfxhyxBGfvbt22crQh+PYuI= -github.com/decred/dcrd/dcrjson v1.2.0 h1:3BFFQHq3/YO/zae9WLxQkXsX6AXKx3+M8H3yk4oXZi0= -github.com/decred/dcrd/dcrjson v1.2.0/go.mod h1:ozddIaeF+EAvZZvFuB3zpfxhyxBGfvbt22crQh+PYuI= -github.com/decred/dcrd/dcrutil v1.0.0/go.mod h1:CBpbItyMKkL/4i1qPJDsE/cdSYklsWFcTYgprRZh4yk= -github.com/decred/dcrd/dcrutil v1.1.1/go.mod h1:Jsttr0pEvzPAw+qay1kS1/PsbZYPyhluiNwwY6yBJS4= -github.com/decred/dcrd/dcrutil v1.2.0/go.mod h1:tUNHS2gj7ApeEVS8gb6O+4wJW7w3O2MSRyRdcjW1JxU= -github.com/decred/dcrd/dcrutil v1.4.0 h1:xD5aUqysGQnsnP1c9J0kGeW8lDIwFGC3ja/gE3HnpCs= -github.com/decred/dcrd/dcrutil v1.4.0/go.mod h1:Bs74gm1jQ9ZAbmEh9FWOEZ1HQzlMg5iPATDMzMnCMlQ= -github.com/decred/dcrd/dcrutil/v2 v2.0.0 h1:HTqn2tZ8eqBF4y3hJwjyKBmJt16y7/HjzpE82E/crhY= -github.com/decred/dcrd/dcrutil/v2 v2.0.0/go.mod h1:gUshVAXpd51DlcEhr51QfWL2HJGkMDM1U8chY+9VvQg= -github.com/decred/dcrd/gcs v1.0.0/go.mod h1:5uHIPAzn4SdGP2/FhVBK2YdAoKmufds3ZI8yNzojUCM= -github.com/decred/dcrd/gcs v1.0.1/go.mod h1:YwutGzusSdJM79CJtxCo9t7WRCvnkLtWSD19TPo1i9g= -github.com/decred/dcrd/gcs v1.0.2 h1:wZjxeC9WPBoRApaAQpBrzvN9NA0iS2KWrTJa9IiDgc8= -github.com/decred/dcrd/gcs v1.0.2/go.mod h1:eLCvrzUsWro48TlTyrmFcZAZqnllYFz0vEv5VZtufF4= -github.com/decred/dcrd/hdkeychain v1.1.0/go.mod h1:zyUZtZ3PdnTPHt2XUr1x76b8ZuiM+9aVkP8Rq8Scp1k= -github.com/decred/dcrd/hdkeychain v1.1.1 h1:6+BwOmPfEyw/Krm+91RXysc76F1jqCta3m45DyD5+s4= -github.com/decred/dcrd/hdkeychain v1.1.1/go.mod h1:CLBVXLoO63fIiqkv38KR23zXGSgrfiAWOybOKTneLhA= -github.com/decred/dcrd/mempool v1.0.1/go.mod h1:r+/DGiiluXi1EyMCCPPH58Qu+rsr8nZv0DialAG5VZQ= -github.com/decred/dcrd/mempool v1.1.1 h1:ysFIS3HzEIJ88B1Y4OfL6wjzBurlChbKkzq54hPglGo= -github.com/decred/dcrd/mempool v1.1.1/go.mod h1:u1I2KRv9UHhx2crlbZXYoLDabWyQ8VnnHDSG53UdhCA= -github.com/decred/dcrd/mining v1.0.0/go.mod h1:VA5H4zhJgXb8LK5lqM5H58dhMRXJRcaQQoX3G8QRpP8= -github.com/decred/dcrd/mining v1.0.1/go.mod h1:+CSOLPi7TM8OlQg7mJ7XzWLXCDb4nHK8R6cvXOzhEoU= -github.com/decred/dcrd/mining v1.1.0 h1:9Wtla+i+pEjfYsNCfixsipmyyoB26DgL4LSXWAin/zw= -github.com/decred/dcrd/mining v1.1.0/go.mod h1:NQEtX604XgNwKcPFId1hVTTiBqmVQDlnqV1yNqGl4oU= -github.com/decred/dcrd/rpcclient v1.0.1/go.mod h1:tApXK3wwrAQtz7lcXeeqBwuktUZesvrFfvhAdedYqdM= -github.com/decred/dcrd/rpcclient v1.1.0 h1:nQZ1qOJaLYoOTM1oQ2dLaqocb5TWI7gNBK+BTY7UVXk= -github.com/decred/dcrd/rpcclient v1.1.0/go.mod h1:SCwBs4d+aqRV2ChnriIZ1y/LgNVHG/2ieEC1vIop82s= -github.com/decred/dcrd/txscript v1.0.0/go.mod h1:9byvrOaBSBVVnDG7Cm0JgN8bZytl1oi9Ba245VBeI18= -github.com/decred/dcrd/txscript v1.0.1/go.mod h1:FqUX07Y+u3cJ1eIGPoyWbJg+Wk1NTllln/TyDpx9KnY= -github.com/decred/dcrd/txscript v1.0.2 h1:kzJZDuteyzvI15VNhtgFHxeeq210RTkFyfzN7d+1iPo= -github.com/decred/dcrd/txscript v1.0.2/go.mod h1:hmUOHFlOjU7H6T/czt6kurWwXJvGPGKKGtXoft6w/qY= -github.com/decred/dcrd/wire v1.0.1/go.mod h1:zpKZnBiN59CrzfXFigwgXmUDVYf34OLbEr8xwAwriHc= -github.com/decred/dcrd/wire v1.1.0/go.mod h1:/JKOsLInOJu6InN+/zH5AyCq3YDIOW/EqcffvU8fJHM= -github.com/decred/dcrd/wire v1.2.0 h1:HqJVB7vcklIguzFWgRXw/WYCQ9cD3bUC5TKj53i1Hng= -github.com/decred/dcrd/wire v1.2.0/go.mod h1:/JKOsLInOJu6InN+/zH5AyCq3YDIOW/EqcffvU8fJHM= -github.com/decred/dcrdata v2.1.3+incompatible h1:DLzrqgOOgHwrUSbuOVDAUzfQePhCGl9UsjEgZI1D0Kg= -github.com/decred/dcrdata v2.1.3+incompatible/go.mod h1:9dhUy80j3VCCh0JNYaW3b960hqkxATNq65FxGMYB7mA= -github.com/decred/dcrwallet v1.2.2 h1:NdI13wxP+OsWKXPqjWQQ9VSGAl4VoSLBfAunzFreeJg= -github.com/decred/dcrwallet v1.2.2/go.mod h1:BrSus0F+Rx8UhvPNBfuRMIjRJBNrW2sLspN9iQR5hm8= -github.com/decred/dcrwallet v1.2.3-0.20181120205657-8690f1096aa7 h1:U4n2p1WgKikOrO7EdtTt6/jieTHtFIAIPmLXmxHnoWI= -github.com/decred/dcrwallet v1.2.3-0.20181120205657-8690f1096aa7/go.mod h1:BrSus0F+Rx8UhvPNBfuRMIjRJBNrW2sLspN9iQR5hm8= -github.com/decred/dcrwallet/chain v1.0.0/go.mod h1:KpZFaKlKajfUZt36+RmBn2HKwTbwoa3yt9HPALqlShI= -github.com/decred/dcrwallet/chain v1.1.1 h1:YUJ1ArUaN/WuMnTP1PvfirNaqIQO9+UUNDifhnJ8QQQ= -github.com/decred/dcrwallet/chain v1.1.1/go.mod h1:2kA82rBDkCKOSYFV+Q14RZNCuYwdaQ9uO/c+RixqRNs= -github.com/decred/dcrwallet/deployments v1.0.0/go.mod h1:0bWER/DAYoGbzkWzbUf6k2agW4YkSyvNLZDhBGThz/4= -github.com/decred/dcrwallet/deployments v1.1.0 h1:83arg+7ct7PS1H2IYhuePnrBK2rkVpEYWKqrJpCwtHA= -github.com/decred/dcrwallet/deployments v1.1.0/go.mod h1:8Sasryu8SX23Jvqr6maZ7MoS7wFIGXupWzbsVtcZsUg= -github.com/decred/dcrwallet/errors v1.0.0/go.mod h1:XUm95dWmm9XmQGvneBXJkkIaFeRsQVBB6ni/KTy1hrY= -github.com/decred/dcrwallet/errors v1.0.1 h1:8EF7IY6twRlo9sqWaSfm8abfi2/rHZ1wacOiGvBy+bM= -github.com/decred/dcrwallet/errors v1.0.1/go.mod h1:XUm95dWmm9XmQGvneBXJkkIaFeRsQVBB6ni/KTy1hrY= -github.com/decred/dcrwallet/internal/helpers v1.0.0/go.mod h1:FsihtjCyFrGL6gdmkxBWTYQ1CUgbfM9tyinYNOzLnlk= -github.com/decred/dcrwallet/internal/helpers v1.0.1 h1:oEqfJPs1uI7QI0Aejx2MUWq/yD609cc9Z8P7vQ6cDz8= -github.com/decred/dcrwallet/internal/helpers v1.0.1/go.mod h1:qIXcze8VZ+A3sEgZou7PTOe4Vsnmks54SGTSGZ6084g= -github.com/decred/dcrwallet/internal/zero v1.0.0/go.mod h1:vULuNLRTcnifKCepcIxUDL4jrR3rJOwVR9UDH89Qpms= -github.com/decred/dcrwallet/internal/zero v1.0.1 h1:hO7orPk13AFp7pFTL739CbVLKImSNorI2J9/tiucNQY= -github.com/decred/dcrwallet/internal/zero v1.0.1/go.mod h1:mXUIsKATE1pIaNAJQ4lhSTX6c9N5sYoSrlScgRCaMJs= -github.com/decred/dcrwallet/lru v1.0.0 h1:vz71/Wa2890CUQeWsOTI6u6iGGfXGAhIQ/hnqMUh6Xc= -github.com/decred/dcrwallet/lru v1.0.0/go.mod h1:jEty7mdT5VaaV06DEV2Avv0R3HpGvUwvDW4lw8ECtiY= -github.com/decred/dcrwallet/p2p v1.0.0/go.mod h1:b1CLZAkl/K5dr5I5B4SdFT8FrE11jSkfA4VAA862ACA= -github.com/decred/dcrwallet/p2p v1.0.1 h1:UTsD5I8YtWVf2SEg0mSd5+hIlp7Ihj3rS2PZ9P5cXVI= -github.com/decred/dcrwallet/p2p v1.0.1/go.mod h1:FsoAR0cBOLW3VKMg+Tdx+wdSezR7g8NGOdz4fx6gtpM= -github.com/decred/dcrwallet/pgpwordlist v1.0.0 h1:H7Y3+yRZq7PXMPfpKLMnY5TKTjTWhc0oJmyN7v8tC/M= -github.com/decred/dcrwallet/pgpwordlist v1.0.0/go.mod h1:Fek3uYn+9DnEFIreA/8PnTIXUl2lBO64JpEBkL9BXtk= -github.com/decred/dcrwallet/rpc/walletrpc v0.1.0/go.mod h1:Zp1ZFTCUo7S6MJvUyS5tYfaDUxGAMHkZ+vbsLgAdd4A= -github.com/decred/dcrwallet/rpc/walletrpc v1.0.1-0.20181109211527-ca582da21c08/go.mod h1:Zp1ZFTCUo7S6MJvUyS5tYfaDUxGAMHkZ+vbsLgAdd4A= -github.com/decred/dcrwallet/spv v1.0.0/go.mod h1:lz39nz9P/HVoxYa4XAT6ithyR3WgdF0oVu4jtFwnCxE= -github.com/decred/dcrwallet/spv v1.1.1 h1:G5yXkoiO4LOh3Ba+qvyUIjF2dChOXpiuRCPpjYzzhZw= -github.com/decred/dcrwallet/spv v1.1.1/go.mod h1:HYfF+A1F+Apf0WPT6QRsG/gfvaFQmWObAytq8pWc6ME= -github.com/decred/dcrwallet/ticketbuyer v1.0.0/go.mod h1:mrAlRjOJ6txO8Zyqo5koxVOMEYLK2POUX35a/QcKN8g= -github.com/decred/dcrwallet/ticketbuyer v1.0.2 h1:vEcUSwCGZolg8fxSJ8+mW2XCdZ6J9LtwxCxRPdcpbQk= -github.com/decred/dcrwallet/ticketbuyer v1.0.2/go.mod h1:oDHY0TOFIaQjZ11TJbgztC5tt1zi6wKoRmyQMmwfft4= -github.com/decred/dcrwallet/ticketbuyer/v2 v2.0.0/go.mod h1:VKo2PjXAlF/E46tSBKrIgqKbVcHVLfM5ACyOehT1unA= -github.com/decred/dcrwallet/ticketbuyer/v2 v2.0.1 h1:RLCly+fnbrMXzWVi4a4cUU2sGWi56e7UPJq9GHoe1iw= -github.com/decred/dcrwallet/ticketbuyer/v2 v2.0.1/go.mod h1:ngtx8I/+Jo+U+E/5XjwCkmU55wCGtUbaDnCP5qazNGM= -github.com/decred/dcrwallet/validate v1.0.0/go.mod h1:zHIlcrjAWl6LK+X+R7jc3F9wIM/qxjtMjG/mdEwt4tY= -github.com/decred/dcrwallet/validate v1.0.1/go.mod h1:9DCtLFnnTOC/7PKkF7jehvDyHkfUBl41ZbcT1u4PmQM= -github.com/decred/dcrwallet/validate v1.0.2 h1:EXY48b3SOkTGXJAB+OUmilvyFNROZywYIWTGYfUnTDE= -github.com/decred/dcrwallet/validate v1.0.2/go.mod h1:1ur2sRZkQ23ECalUKdwgx6rdIiP8rIiaSQAz1Y9LQsI= -github.com/decred/dcrwallet/version v1.0.0/go.mod h1:rXeMsUaI03WtlQrSol7Q7sJ8HBOB+tZvT7YQRXD5Y7M= -github.com/decred/dcrwallet/version v1.0.1 h1:gAz1lDkcJ+oAbg0tOn/J0KwZBVWIlhWmHhSUi9GbB2E= -github.com/decred/dcrwallet/version v1.0.1/go.mod h1:rXeMsUaI03WtlQrSol7Q7sJ8HBOB+tZvT7YQRXD5Y7M= -github.com/decred/dcrwallet/wallet v1.0.0/go.mod h1:VWRnpNFRiKPo7FUPbzj0t5ElcGxNXMPIa4vGcGe94uM= -github.com/decred/dcrwallet/wallet v1.1.0/go.mod h1:g4OzDG7jpsRqTDP3bHiA0LIEZFx81accYPCkO1DBNT8= -github.com/decred/dcrwallet/wallet v1.2.3/go.mod h1:ItOhnw3C4znuLQVWACSq8jCLy221v9X0Xo0b/j5WqgU= -github.com/decred/dcrwallet/wallet v1.3.0 h1:RQ4uHIfbDF0ppyeVDkTr7GapeABCddUUKOSexTN7X1M= -github.com/decred/dcrwallet/wallet v1.3.0/go.mod h1:ItOhnw3C4znuLQVWACSq8jCLy221v9X0Xo0b/j5WqgU= -github.com/decred/dcrwallet/walletseed v1.0.0/go.mod h1:xSF6hZW+5Xhm0jJFsI5jQSfViuZUQJoDXa/cQxtgncs= -github.com/decred/dcrwallet/walletseed v1.0.1 h1:gxvlj0GRw+H0VumCxTlEysu+/nltcp9+lgzVgzsnI/Y= -github.com/decred/dcrwallet/walletseed v1.0.1/go.mod h1:ENlwTabC2JVmT4S1eCP44fnwX4+9y2RLsnfSU21CJ+4= -github.com/decred/slog v1.0.0 h1:Dl+W8O6/JH6n2xIFN2p3DNjCmjYwvrXsjlSJTQQ4MhE= -github.com/decred/slog v1.0.0/go.mod h1:zR98rEZHSnbZ4WHZtO0iqmSZjDLKhkXfrPTZQKtAonQ= -github.com/dgraph-io/badger v1.5.4 h1:gVTrpUTbbr/T24uvoCaqY2KSHfNLVGm0w+hbee2HMeg= -github.com/dgraph-io/badger v1.5.4/go.mod h1:VZxzAIRPHRVNRKRo6AXrX9BJegn6il06VMTZVJYCIjQ= -github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f h1:dDxpBYafY/GYpcl+LS4Bn3ziLPuEdGRkRjYAbSlWxSA= -github.com/dgryski/go-farm v0.0.0-20190104051053-3adb47b1fb0f/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= -github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= -github.com/gdamore/tcell v1.1.1 h1:U73YL+jMem2XfhvaIUfPO6MpJawaG92B2funXVb9qLs= -github.com/gdamore/tcell v1.1.1/go.mod h1:K1udHkiR3cOtlpKG5tZPD5XxrF7v2y7lDq7Whcj+xkQ= -github.com/go-gl/gl v0.0.0-20181026044259-55b76b7df9d2/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk= -github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk= -github.com/go-gl/glfw v0.0.0-20181213070059-819e8ce5125f/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= -github.com/goki/freetype v0.0.0-20181231101311-fa8a33aabaff/go.mod h1:wfqRWLHRBsRgkp5dmbG56SA0DmVtwrF5N3oPdI8t+Aw= -github.com/golang/freetype v0.0.0-20161208064710-d9be45aaf745/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gorilla/websocket v1.2.0 h1:VJtLvh6VQym50czpZzx07z/kw9EgAxI3x1ZB8taTMQQ= -github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/hashicorp/golang-lru v0.0.0-20160813221303-0a025b7e63ad/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/jackmordaunt/icns v0.0.0-20181231085925-4f16af745526/go.mod h1:UQkeMHVoNcyXYq9otUupF7/h/2tmHlhrS2zw7ZVvUqc= -github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= -github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/josephspurrier/goversioninfo v0.0.0-20190124120936-8611f5a5ff3f/go.mod h1:eJTEwMjXb7kZ633hO3Ln9mBUCOjX2+FlTljvpl9SYdE= -github.com/jrick/bitset v1.0.0 h1:Ws0PXV3PwXqWK2n7Vz6idCdrV/9OrBXgHEJi27ZB9Dw= -github.com/jrick/bitset v1.0.0/go.mod h1:ZOYB5Uvkla7wIEY4FEssPVi3IQXa02arznRaYaAEPe4= -github.com/jrick/logrotate v1.0.0 h1:lQ1bL/n9mBNeIXoTUoYRlK4dHuNJVofX9oWqBtPnSzI= -github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/pty v1.1.2/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/lucasb-eyer/go-colorful v0.0.0-20181028223441-12d3b2882a08 h1:5MnxBC15uMxFv5FY/J/8vzyaBiArCOkMdFT9Jsw78iY= -github.com/lucasb-eyer/go-colorful v0.0.0-20181028223441-12d3b2882a08/go.mod h1:NXg0ArsFk0Y01623LgUqoqcouGDB+PwCCQlrwrG6xJ4= -github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/raedahgroup/dcrlibwallet v1.1.1-0.20190928085114-bcc6e6b7769a h1:BvFVstGjzuNeFsNTmAZCfPxK2u51EGQVAdFKCauqaNE= -github.com/raedahgroup/dcrlibwallet v1.1.1-0.20190928085114-bcc6e6b7769a/go.mod h1:6AGgglq9BB0twJnZnHvfH8hIQrbw6yBJSPp9QI+hBk0= -github.com/rivo/tview v0.0.0-20190113120821-e5e361b9d790 h1:yt1AZgiBi8RcCo0PoyU4gSFwKjlbkSGRFVZGz7R6oB0= -github.com/rivo/tview v0.0.0-20190113120821-e5e361b9d790/go.mod h1:J4W+hErFfITUbyFAEXizpmkuxX7ZN56dopxHB4XQhMw= -github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= -github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9 h1:lpEzuenPuO1XNTeikEmvqYFcU37GVLl8SRNblzyvGBE= -github.com/skip2/go-qrcode v0.0.0-20190110000554-dc11ecdae0a9/go.mod h1:PLPIyL7ikehBD1OAjmKKiOEhbvWyHGaNDjquXMcYABo= -github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/srwiley/oksvg v0.0.0-20190105194046-ccbc7673cdf3/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4= -github.com/srwiley/oksvg v0.0.0-20190414003808-c520f0a6c5cc/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4= -github.com/srwiley/rasterx v0.0.0-20181219215540-696f7edb7a7e/go.mod h1:mvWM0+15UqyrFKqdRjY6LuAVJR0HOVhJlEgZ5JWtSWU= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.3.1-0.20190311161405-34c6fa2dc709/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -go.etcd.io/bbolt v1.3.0 h1:oY10fI923Q5pVCVt1GBTZMn8LHo5M+RCInFpeMnV4QI= -go.etcd.io/bbolt v1.3.0/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -golang.org/x/crypto v0.0.0-20180718160520-a2144134853f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20180808211826-de0752318171/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472 h1:Gv7RPwsi3eZ2Fgewe3CBsuOebPwO27PoXzRpJPsvSSM= -golang.org/x/crypto v0.0.0-20190829043050-9756ffdc2472/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/image v0.0.0-20181116024801-cd38e8056d9b/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= -golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/image v0.0.0-20190501045829-6d32002ffd75/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/mobile v0.0.0-20190318164015-6bd122906c08/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= -golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180808004115-f9ce57c11b24/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190420063019-afa5a82059c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6 h1:bjcUS9ztw9kFmmIxJInhon/0Is3p+EHBKNgquIzo1OI= -golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20180810070207-f0d5e33068cb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180816055513-1c9583448a9c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181206074257-70b957f3b65e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181212120007-b05ddf57801d/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190412213103-97732733099d h1:+R4KGOnez64A81RvjARKc4UT5/tI9ujCIVX+P5KiHuI= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180808183934-383e8b2c3b9e/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -gopkg.in/DATA-DOG/go-sqlmock.v1 v1.3.0/go.mod h1:OdE7CF6DbADk7lN8LIKRzRJTTZXIjtWgA5THM5lhBAw= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 3bc6ba61a70bc7f0b550a1e3e6875e1e84afb0a4 Mon Sep 17 00:00:00 2001 From: morrison Date: Tue, 24 Dec 2019 07:06:38 +0100 Subject: [PATCH 64/73] minor mod --- fyne/pages/handler/historypagehandler/txtablecomponents.go | 6 +++--- fyne/pages/handler/historypagehandler/walletselector.go | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/fyne/pages/handler/historypagehandler/txtablecomponents.go b/fyne/pages/handler/historypagehandler/txtablecomponents.go index 65ff8e191..4ce55beb9 100644 --- a/fyne/pages/handler/historypagehandler/txtablecomponents.go +++ b/fyne/pages/handler/historypagehandler/txtablecomponents.go @@ -91,7 +91,7 @@ func (historyPage *HistoryPageData) fetchTx(txTable *widgets.Table, txOffset, fi historyPage.txTable.Container.Show() // wait four sec then update tx table - time.AfterFunc(time.Second*4, func() { + time.AfterFunc(time.Second*2, func() { if historyPage.TabMenu.CurrentTabIndex() != 1 { return } @@ -109,7 +109,7 @@ func (historyPage *HistoryPageData) updateTable() { if historyPage.allTxCount > int(historyPage.TotalTxFetched) { if historyPage.txTable.Container.Offset.Y == 0 { // table not yet scrolled wait 4 secs and update - time.AfterFunc(time.Second*4, func() { + time.AfterFunc(time.Second*2, func() { if historyPage.TabMenu.CurrentTabIndex() != 1 { return } @@ -117,7 +117,7 @@ func (historyPage *HistoryPageData) updateTable() { }) } else if scrollPosition < 0.5 { if historyPage.TotalTxFetched == txPerPage { - time.AfterFunc(time.Second*4, func() { + time.AfterFunc(time.Second*2, func() { if historyPage.TabMenu.CurrentTabIndex() != 1 { return } diff --git a/fyne/pages/handler/historypagehandler/walletselector.go b/fyne/pages/handler/historypagehandler/walletselector.go index c1162157a..f7ce3ba1e 100644 --- a/fyne/pages/handler/historypagehandler/walletselector.go +++ b/fyne/pages/handler/historypagehandler/walletselector.go @@ -25,7 +25,6 @@ func (historyPage *HistoryPageData) txWalletList() { } sort.Ints(walletsID) - // var selectedWalletLabel *widget.Label selectedWalletLabel := widget.NewLabel(historyPage.MultiWallet.WalletWithID(walletsID[0]).Name) var txWalletSelectionPopup *widget.PopUp From c868cab0a13d640441e802d995e0e43272a93c7e Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 25 Dec 2019 03:19:09 +0100 Subject: [PATCH 65/73] reduced table width, removed horizontal scroll, removed type column --- cmd/go.mod | 1 - fyne/pages/handler/historypagehandler/inithistorypage.go | 2 +- fyne/pages/handler/historypagehandler/txtablecomponents.go | 4 +--- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/cmd/go.mod b/cmd/go.mod index 5fa5ca7e8..851dd1229 100644 --- a/cmd/go.mod +++ b/cmd/go.mod @@ -6,7 +6,6 @@ require ( github.com/decred/slog v1.0.0 github.com/jessevdk/go-flags v1.4.0 github.com/jrick/logrotate v1.0.0 - github.com/raedahgroup/dcrlibwallet v1.1.1-0.20190928085114-bcc6e6b7769a // indirect github.com/raedahgroup/godcr/app v0.0.0-00010101000000-000000000000 github.com/raedahgroup/godcr/cli v0.0.0-00010101000000-000000000000 github.com/raedahgroup/godcr/nuklear v0.0.0-00010101000000-000000000000 diff --git a/fyne/pages/handler/historypagehandler/inithistorypage.go b/fyne/pages/handler/historypagehandler/inithistorypage.go index e748702fe..f962f188b 100644 --- a/fyne/pages/handler/historypagehandler/inithistorypage.go +++ b/fyne/pages/handler/historypagehandler/inithistorypage.go @@ -84,7 +84,7 @@ func (historyPage *HistoryPageData) InitHistoryPage() error { historyPage.HistoryPageContents.Append(widget.NewHBox(txSortFilterDropDown, widgets.NewHSpacer(30), txFilterDropDown)) historyPage.HistoryPageContents.Append(widgets.NewVSpacer(5)) - historyPage.HistoryPageContents.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(historyPage.txTable.Container.MinSize().Width*33, historyPage.txTable.Container.MinSize().Height+450)), historyPage.txTable.Container)) + historyPage.HistoryPageContents.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(historyPage.txTable.Result.MinSize().Width, historyPage.txTable.Container.MinSize().Height+450)), historyPage.txTable.Container)) historyPage.HistoryPageContents.Append(widgets.NewVSpacer(15)) return nil } diff --git a/fyne/pages/handler/historypagehandler/txtablecomponents.go b/fyne/pages/handler/historypagehandler/txtablecomponents.go index 4ce55beb9..d8bf60861 100644 --- a/fyne/pages/handler/historypagehandler/txtablecomponents.go +++ b/fyne/pages/handler/historypagehandler/txtablecomponents.go @@ -22,7 +22,6 @@ func (historyPage *HistoryPageData) txTableHeader(txTable *widgets.Table) { widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Hash", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), ) @@ -62,7 +61,7 @@ func (historyPage *HistoryPageData) fetchTx(txTable *widgets.Table, txOffset, fi status = "Confirmed" } - trimmedHash := tx.Hash[:15] + "..." + tx.Hash[len(tx.Hash)-15:] + trimmedHash := tx.Hash[:10] + "..." + tx.Hash[len(tx.Hash)-5:] txForTrimmedHash := tx.Hash txDirectionLabel := widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}) txDirectionIcon := widget.NewIcon(historyPage.icons[helpers.TxDirectionIcon(tx.Direction)]) @@ -72,7 +71,6 @@ func (historyPage *HistoryPageData) fetchTx(txTable *widgets.Table, txOffset, fi widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(tx.Type, fyne.TextAlignCenter, fyne.TextStyle{}), widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignCenter, fyne.TextStyle{Italic: true})), func() { historyPage.fetchTxDetails(txForTrimmedHash) }), From 0d86a52b74a70171cf88382d471480c98e89c519 Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 25 Dec 2019 03:35:36 +0100 Subject: [PATCH 66/73] fixed issues with no transaction in wallet message not showing --- fyne/pages/handler/historypagehandler/inithistorypage.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fyne/pages/handler/historypagehandler/inithistorypage.go b/fyne/pages/handler/historypagehandler/inithistorypage.go index f962f188b..c2519575c 100644 --- a/fyne/pages/handler/historypagehandler/inithistorypage.go +++ b/fyne/pages/handler/historypagehandler/inithistorypage.go @@ -44,7 +44,7 @@ func (historyPage *HistoryPageData) InitHistoryPage() error { historyPage.HistoryPageContents.Append(widgets.NewVSpacer(values.SpacerSize10)) - historyPage.errorLabel = widget.NewLabel("") + historyPage.errorLabel = widget.NewLabelWithStyle("", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}) historyPage.errorLabel.Hide() historyPage.selectedFilterId = dcrlibwallet.TxFilterAll @@ -84,6 +84,7 @@ func (historyPage *HistoryPageData) InitHistoryPage() error { historyPage.HistoryPageContents.Append(widget.NewHBox(txSortFilterDropDown, widgets.NewHSpacer(30), txFilterDropDown)) historyPage.HistoryPageContents.Append(widgets.NewVSpacer(5)) + historyPage.HistoryPageContents.Append(historyPage.errorLabel) historyPage.HistoryPageContents.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(historyPage.txTable.Result.MinSize().Width, historyPage.txTable.Container.MinSize().Height+450)), historyPage.txTable.Container)) historyPage.HistoryPageContents.Append(widgets.NewVSpacer(15)) return nil From 7e63a1841a85035ebddfbec0c886db23fc363689 Mon Sep 17 00:00:00 2001 From: morrison Date: Wed, 25 Dec 2019 23:19:22 +0100 Subject: [PATCH 67/73] removed direction label and added #column --- fyne/pages/handler/historypagehandler/txtablecomponents.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fyne/pages/handler/historypagehandler/txtablecomponents.go b/fyne/pages/handler/historypagehandler/txtablecomponents.go index d8bf60861..d48524cd6 100644 --- a/fyne/pages/handler/historypagehandler/txtablecomponents.go +++ b/fyne/pages/handler/historypagehandler/txtablecomponents.go @@ -17,8 +17,8 @@ const txPerPage int32 = 15 func (historyPage *HistoryPageData) txTableHeader(txTable *widgets.Table) { tableHeading := widget.NewHBox( + widget.NewLabelWithStyle("#", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Date (UTC)", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Direction", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Status", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), widget.NewLabelWithStyle("Fee", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), @@ -63,11 +63,10 @@ func (historyPage *HistoryPageData) fetchTx(txTable *widgets.Table, txOffset, fi trimmedHash := tx.Hash[:10] + "..." + tx.Hash[len(tx.Hash)-5:] txForTrimmedHash := tx.Hash - txDirectionLabel := widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(tx.Direction), fyne.TextAlignCenter, fyne.TextStyle{}) txDirectionIcon := widget.NewIcon(historyPage.icons[helpers.TxDirectionIcon(tx.Direction)]) txBox = append(txBox, widget.NewHBox( + widget.NewHBox(txDirectionIcon, widget.NewLabel("")), widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewHBox(txDirectionIcon, txDirectionLabel), widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), From c72a35a4974bfeb3501f4d3f12e69c04981bb996 Mon Sep 17 00:00:00 2001 From: morrison Date: Sat, 28 Dec 2019 14:52:03 +0100 Subject: [PATCH 68/73] fixed issues with txdetails popup being larger than the screensize, undid deletion --- cmd/go.mod | 1 + fyne/pages/handler/historypagehandler/inithistorypage.go | 2 +- .../handler/historypagehandler/txdetailscomponent.go | 9 +++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cmd/go.mod b/cmd/go.mod index 851dd1229..4990e1715 100644 --- a/cmd/go.mod +++ b/cmd/go.mod @@ -9,6 +9,7 @@ require ( github.com/raedahgroup/godcr/app v0.0.0-00010101000000-000000000000 github.com/raedahgroup/godcr/cli v0.0.0-00010101000000-000000000000 github.com/raedahgroup/godcr/nuklear v0.0.0-00010101000000-000000000000 + github.com/raedahgroup/godcr/terminal v0.0.0-00010101000000-000000000000 // indirect github.com/raedahgroup/godcr/web v0.0.0-00010101000000-000000000000 ) diff --git a/fyne/pages/handler/historypagehandler/inithistorypage.go b/fyne/pages/handler/historypagehandler/inithistorypage.go index c2519575c..9e1f0a928 100644 --- a/fyne/pages/handler/historypagehandler/inithistorypage.go +++ b/fyne/pages/handler/historypagehandler/inithistorypage.go @@ -85,7 +85,7 @@ func (historyPage *HistoryPageData) InitHistoryPage() error { historyPage.HistoryPageContents.Append(widget.NewHBox(txSortFilterDropDown, widgets.NewHSpacer(30), txFilterDropDown)) historyPage.HistoryPageContents.Append(widgets.NewVSpacer(5)) historyPage.HistoryPageContents.Append(historyPage.errorLabel) - historyPage.HistoryPageContents.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(historyPage.txTable.Result.MinSize().Width, historyPage.txTable.Container.MinSize().Height+450)), historyPage.txTable.Container)) + historyPage.HistoryPageContents.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(historyPage.txTable.Result.MinSize().Width+30, historyPage.txTable.Container.MinSize().Height+450)), historyPage.txTable.Container)) historyPage.HistoryPageContents.Append(widgets.NewVSpacer(15)) return nil } diff --git a/fyne/pages/handler/historypagehandler/txdetailscomponent.go b/fyne/pages/handler/historypagehandler/txdetailscomponent.go index faca8d52d..4e68b0ae2 100644 --- a/fyne/pages/handler/historypagehandler/txdetailscomponent.go +++ b/fyne/pages/handler/historypagehandler/txdetailscomponent.go @@ -222,7 +222,8 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { canvas.NewLine(values.TxdetailsLineColor), widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txOutput.Result, - widgets.NewHSpacer(10), + widgets.NewHSpacer(20), + widgets.NewVSpacer(10), ) txDetailsScrollContainer := widget.NewScrollContainer(txDetailsData) @@ -230,13 +231,13 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { widgets.NewHSpacer(10), widget.NewHBox( txDetailslabel, - widgets.NewHSpacer(txDetailsData.MinSize().Width-200), + widgets.NewHSpacer(txDetailsData.MinSize().Width-260), minimizeIcon, ), widget.NewHBox(widgets.NewHSpacer(txDetailsScrollContainer.MinSize().Width*13), messageLabel), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsData.MinSize().Width, txDetailsData.MinSize().Height-200)), txDetailsScrollContainer), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsData.MinSize().Width-80, txDetailsData.MinSize().Height-200)), txDetailsScrollContainer), widgets.NewVSpacer(10), ) - txDetailsPopUp = widget.NewModalPopUp(widget.NewVBox(fyne.NewContainer(txDetailsOutput)), historyPage.Window.Canvas()) + txDetailsPopUp = widget.NewModalPopUp(fyne.NewContainer(txDetailsOutput), historyPage.Window.Canvas()) } From 13039256ad4dbd8a6ca7a3f39275919f7ec0600f Mon Sep 17 00:00:00 2001 From: morrison Date: Sat, 28 Dec 2019 21:58:11 +0100 Subject: [PATCH 69/73] trimmed long string and optimized code --- .../historypagehandler/inithistorypage.go | 2 +- .../historypagehandler/txdetailscomponent.go | 120 +++++++++++------- .../historypagehandler/txtablecomponents.go | 2 +- 3 files changed, 73 insertions(+), 51 deletions(-) diff --git a/fyne/pages/handler/historypagehandler/inithistorypage.go b/fyne/pages/handler/historypagehandler/inithistorypage.go index 9e1f0a928..2b9e4f7f3 100644 --- a/fyne/pages/handler/historypagehandler/inithistorypage.go +++ b/fyne/pages/handler/historypagehandler/inithistorypage.go @@ -85,7 +85,7 @@ func (historyPage *HistoryPageData) InitHistoryPage() error { historyPage.HistoryPageContents.Append(widget.NewHBox(txSortFilterDropDown, widgets.NewHSpacer(30), txFilterDropDown)) historyPage.HistoryPageContents.Append(widgets.NewVSpacer(5)) historyPage.HistoryPageContents.Append(historyPage.errorLabel) - historyPage.HistoryPageContents.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(historyPage.txTable.Result.MinSize().Width+30, historyPage.txTable.Container.MinSize().Height+450)), historyPage.txTable.Container)) + historyPage.HistoryPageContents.Append(fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(historyPage.txTable.Result.MinSize().Width+15, historyPage.txTable.Container.MinSize().Height+450)), historyPage.txTable.Container)) historyPage.HistoryPageContents.Append(widgets.NewVSpacer(15)) return nil } diff --git a/fyne/pages/handler/historypagehandler/txdetailscomponent.go b/fyne/pages/handler/historypagehandler/txdetailscomponent.go index 4e68b0ae2..f24f8b0d2 100644 --- a/fyne/pages/handler/historypagehandler/txdetailscomponent.go +++ b/fyne/pages/handler/historypagehandler/txdetailscomponent.go @@ -4,6 +4,7 @@ import ( "fmt" "net/url" "strconv" + "strings" "time" "fyne.io/fyne" @@ -75,13 +76,23 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { status = "Pending" } - copyAbleText := func(text string, copyAble bool) *widgets.ClickableBox { + textObject := func(text string, copyAble bool, bold bool) *widgets.ClickableBox { var textToCopy *canvas.Text if copyAble { - textToCopy = canvas.NewText(text, values.Blue) + if strings.Contains(text, ":") { + txt := strings.Split(text, ":") + txt1, txt2 := txt[0], txt[1] + trimmedText := txt1[:25] + "..." + txt1[len(txt1)-25:] + ":" + txt2 + textToCopy = canvas.NewText(trimmedText, values.Blue) + } else { + textToCopy = canvas.NewText(text, values.Blue) + } } else { textToCopy = canvas.NewText(text, values.DefaultTextColor) } + if bold { + textToCopy.TextStyle = fyne.TextStyle{Bold: true} + } textToCopy.TextSize = 14 textToCopy.Alignment = fyne.TextAlignTrailing @@ -102,98 +113,109 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { } tableConfirmations := widget.NewHBox( - widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), + textObject("Confirmations:", false, true), + textObject(strconv.Itoa(int(confirmations)), false, false), ) tableHash := widget.NewHBox( - widget.NewLabelWithStyle("Transaction ID:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - copyAbleText(txDetails.Hash, true), + textObject("Transaction ID:", false, true), + textObject(txDetails.Hash, true, false), ) tableBlockHeight := widget.NewHBox( - widget.NewLabelWithStyle("Block Height:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(strconv.Itoa(int(txDetails.BlockHeight)), fyne.TextAlignCenter, fyne.TextStyle{}), + textObject("Block Height:", false, true), + textObject(strconv.Itoa(int(txDetails.BlockHeight)), false, false), ) tableDirection := widget.NewHBox( - widget.NewLabelWithStyle("Direction:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(txDetails.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), + textObject("Direction:", false, true), + textObject(dcrlibwallet.TransactionDirectionName(txDetails.Direction), false, false), ) tableType := widget.NewHBox( - widget.NewLabelWithStyle("Type:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(txDetails.Type, fyne.TextAlignCenter, fyne.TextStyle{}), + textObject("Type:", false, true), + textObject(txDetails.Type, false, false), ) tableAmount := widget.NewHBox( - widget.NewLabelWithStyle("Amount:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Amount).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + textObject("Amount:", false, true), + textObject(dcrutil.Amount(txDetails.Amount).String(), false, false), ) tableSize := widget.NewHBox( - widget.NewLabelWithStyle("Size:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(strconv.Itoa(txDetails.Size)+" Bytes", fyne.TextAlignCenter, fyne.TextStyle{}), + textObject("Size:", false, true), + textObject(strconv.Itoa(txDetails.Size)+" Bytes", false, false), ) tableFee := widget.NewHBox( - widget.NewLabelWithStyle("Fee:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + textObject("Fee:", false, true), + textObject(dcrutil.Amount(txDetails.Fee).String(), false, false), ) tableFeeRate := widget.NewHBox( - widget.NewLabelWithStyle("Fee Rate:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrutil.Amount(txDetails.FeeRate).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + textObject("Fee Rate:", false, true), + textObject(dcrutil.Amount(txDetails.FeeRate).String(), false, false), ) tableStatus := widget.NewHBox( - widget.NewLabelWithStyle("Status:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(status, fyne.TextAlignCenter, fyne.TextStyle{}), + textObject("Status:", false, true), + textObject(status, false, false), ) tableDate := widget.NewHBox( - widget.NewLabelWithStyle("Date:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(txDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), + textObject("Date:", false, true), + textObject(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(txDetails.Timestamp)), false, false), ) var txInput widgets.Table inputTableColumnLabels := widget.NewHBox( - widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) + textObject("Previous Outpoint", false, true), + textObject("Account", false, true), + textObject("Amount", false, true)) var inputBox []*widget.Box for i := range txDetails.Inputs { inputBox = append(inputBox, widget.NewHBox( - copyAbleText(txDetails.Inputs[i].PreviousOutpoint, true), - copyAbleText(txDetails.Inputs[i].AccountName, false), - copyAbleText(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), false), + textObject(txDetails.Inputs[i].PreviousOutpoint, true, false), + textObject(txDetails.Inputs[i].AccountName, false, false), + textObject(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), false, false), )) } txInput.NewTable(inputTableColumnLabels, inputBox...) var txOutput widgets.Table outputTableColumnLabels := widget.NewHBox( - widget.NewLabelWithStyle("Address", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Value", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) + textObject("Address", false, true), + textObject("Account", false, true), + textObject("Value", false, true), + textObject("Type", false, true)) var outputBox []*widget.Box for i := range txDetails.Outputs { outputBox = append(outputBox, widget.NewHBox( - copyAbleText(txDetails.Outputs[i].AccountName, false), - copyAbleText(txDetails.Outputs[i].Address, true), - copyAbleText(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), false), - copyAbleText(txDetails.Outputs[i].ScriptType, false), + textObject(txDetails.Outputs[i].AccountName, false, false), + textObject(txDetails.Outputs[i].Address, true, false), + textObject(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), false, false), + textObject(txDetails.Outputs[i].ScriptType, false, false), )) } txOutput.NewTable(outputTableColumnLabels, outputBox...) tableData := widget.NewVBox( tableConfirmations, + widgets.NewVSpacer(values.SpacerSize4), tableHash, + widgets.NewVSpacer(values.SpacerSize4), tableBlockHeight, + widgets.NewVSpacer(values.SpacerSize4), tableDirection, + widgets.NewVSpacer(values.SpacerSize4), tableType, + widgets.NewVSpacer(values.SpacerSize4), tableAmount, + widgets.NewVSpacer(values.SpacerSize4), tableSize, + widgets.NewVSpacer(values.SpacerSize4), tableFee, + widgets.NewVSpacer(values.SpacerSize4), tableFeeRate, + widgets.NewVSpacer(values.SpacerSize4), tableStatus, + widgets.NewVSpacer(values.SpacerSize4), tableDate, + widgets.NewVSpacer(values.SpacerSize4), ) link, err := url.Parse(fmt.Sprintf("https://%s.dcrdata.org/tx/%s", values.NetType, txDetails.Hash)) @@ -205,38 +227,38 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { redirectWidget := widget.NewHBox( widget.NewHyperlinkWithStyle("View on dcrdata", link, fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), - widgets.NewHSpacer(20), + widgets.NewHSpacer(values.SpacerSize20), widget.NewIcon(historyPage.icons[assets.RedirectIcon]), ) txDetailsData := widget.NewVBox( - widgets.NewHSpacer(10), + widgets.NewHSpacer(values.SpacerSize10), tableData, canvas.NewLine(values.TxdetailsLineColor), redirectWidget, - widgets.NewHSpacer(10), + widgets.NewHSpacer(values.SpacerSize10), canvas.NewLine(values.TxdetailsLineColor), widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txInput.Result, - widgets.NewHSpacer(10), + widgets.NewHSpacer(values.SpacerSize10), canvas.NewLine(values.TxdetailsLineColor), widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txOutput.Result, - widgets.NewHSpacer(20), - widgets.NewVSpacer(10), + widgets.NewHSpacer(values.SpacerSize20), + widgets.NewVSpacer(values.SpacerSize10), ) txDetailsScrollContainer := widget.NewScrollContainer(txDetailsData) txDetailsOutput := widget.NewVBox( - widgets.NewHSpacer(10), + widgets.NewHSpacer(values.SpacerSize10), widget.NewHBox( txDetailslabel, - widgets.NewHSpacer(txDetailsData.MinSize().Width-260), + widgets.NewHSpacer(txDetailsData.MinSize().Width-180), minimizeIcon, ), - widget.NewHBox(widgets.NewHSpacer(txDetailsScrollContainer.MinSize().Width*13), messageLabel), - fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsData.MinSize().Width-80, txDetailsData.MinSize().Height-200)), txDetailsScrollContainer), - widgets.NewVSpacer(10), + widget.NewHBox(widgets.NewHSpacer(txDetailsScrollContainer.MinSize().Width*12), messageLabel), + fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsData.MinSize().Width, txDetailsData.MinSize().Height-200)), txDetailsScrollContainer), + widgets.NewVSpacer(values.SpacerSize10), ) txDetailsPopUp = widget.NewModalPopUp(fyne.NewContainer(txDetailsOutput), historyPage.Window.Canvas()) diff --git a/fyne/pages/handler/historypagehandler/txtablecomponents.go b/fyne/pages/handler/historypagehandler/txtablecomponents.go index d48524cd6..4b2bb84f9 100644 --- a/fyne/pages/handler/historypagehandler/txtablecomponents.go +++ b/fyne/pages/handler/historypagehandler/txtablecomponents.go @@ -61,7 +61,7 @@ func (historyPage *HistoryPageData) fetchTx(txTable *widgets.Table, txOffset, fi status = "Confirmed" } - trimmedHash := tx.Hash[:10] + "..." + tx.Hash[len(tx.Hash)-5:] + trimmedHash := tx.Hash[:10] + "..." + tx.Hash[len(tx.Hash)-10:] txForTrimmedHash := tx.Hash txDirectionIcon := widget.NewIcon(historyPage.icons[helpers.TxDirectionIcon(tx.Direction)]) txBox = append(txBox, widget.NewHBox( From a50dcd405b4749d73c710f0df96308e096fd3075 Mon Sep 17 00:00:00 2001 From: morrison Date: Sat, 28 Dec 2019 23:58:45 +0100 Subject: [PATCH 70/73] aligned info icon to the right and reduced popup size, aligned table contents and other cleanups --- .../handler/historypagehandler/basewidgets.go | 27 +++-- .../historypagehandler/txdetailscomponent.go | 105 ++++++++---------- .../historypagehandler/txtablecomponents.go | 2 +- fyne/pages/handler/values/strings.go | 7 +- 4 files changed, 70 insertions(+), 71 deletions(-) diff --git a/fyne/pages/handler/historypagehandler/basewidgets.go b/fyne/pages/handler/historypagehandler/basewidgets.go index 45f560a65..5e5717adc 100644 --- a/fyne/pages/handler/historypagehandler/basewidgets.go +++ b/fyne/pages/handler/historypagehandler/basewidgets.go @@ -23,23 +23,32 @@ func (historyPage *HistoryPageData) initBaseObjects() error { // infoPopUp creates a popup with history page hint-text var infoIcon *widgets.ImageButton infoIcon = widgets.NewImageButton(historyPage.icons[assets.InfoIcon], nil, func() { - infoLabel := widget.NewLabelWithStyle(values.PageHint, fyne.TextAlignLeading, fyne.TextStyle{Monospace: true}) + infoLabel := canvas.NewText(values.TxdetailsHint, values.DefaultTextColor) + infoLabel.TextSize = 12 + infoLabel.TextStyle = fyne.TextStyle{Monospace: true} + + info2Label := canvas.NewText(values.CopyHint, values.DefaultTextColor) + info2Label.TextSize = 12 + info2Label.TextStyle = fyne.TextStyle{Monospace: true} + gotItLabel := canvas.NewText(values.GotIt, values.Blue) gotItLabel.TextStyle = fyne.TextStyle{Bold: true} - gotItLabel.TextSize = 14 + gotItLabel.TextSize = 12 var infoPopUp *widget.PopUp infoPopUp = widget.NewPopUp(widget.NewVBox( - widgets.NewVSpacer(5), - widget.NewHBox(widgets.NewHSpacer(5), infoLabel, widgets.NewHSpacer(5)), - widgets.NewVSpacer(5), - widget.NewHBox(layout.NewSpacer(), widgets.NewClickableBox(widget.NewVBox(gotItLabel), func() { infoPopUp.Hide() }), widgets.NewHSpacer(5)), - widgets.NewVSpacer(5), + widgets.NewVSpacer(values.SpacerSize2), + widget.NewHBox(widgets.NewHSpacer(values.SpacerSize2), infoLabel, widgets.NewHSpacer(values.SpacerSize2)), + widgets.NewVSpacer(values.SpacerSize2), + widget.NewHBox(widgets.NewHSpacer(values.SpacerSize2), info2Label, widgets.NewHSpacer(values.SpacerSize2)), + widgets.NewVSpacer(values.SpacerSize2), + widget.NewHBox(layout.NewSpacer(), widgets.NewClickableBox(widget.NewVBox(gotItLabel), func() { infoPopUp.Hide() }), widgets.NewHSpacer(values.SpacerSize2)), + widgets.NewVSpacer(values.SpacerSize2), ), historyPage.Window.Canvas()) - infoPopUp.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject(infoIcon).Add(fyne.NewPos(0, infoIcon.Size().Height))) + infoPopUp.Move(fyne.CurrentApp().Driver().AbsolutePositionForObject(infoIcon).Add(fyne.NewPos(10, infoIcon.MinSize().Height+5).Subtract(fyne.NewPos(infoPopUp.MinSize().Width, 0)))) }) - historyPage.HistoryPageContents.Append(widget.NewHBox(historyTitleLabel, widgets.NewHSpacer(110), infoIcon)) + historyPage.HistoryPageContents.Append(widget.NewHBox(historyTitleLabel, layout.NewSpacer(), infoIcon, widgets.NewHSpacer(values.SpacerSize10))) return nil } diff --git a/fyne/pages/handler/historypagehandler/txdetailscomponent.go b/fyne/pages/handler/historypagehandler/txdetailscomponent.go index f24f8b0d2..b8d490c33 100644 --- a/fyne/pages/handler/historypagehandler/txdetailscomponent.go +++ b/fyne/pages/handler/historypagehandler/txdetailscomponent.go @@ -76,7 +76,7 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { status = "Pending" } - textObject := func(text string, copyAble bool, bold bool) *widgets.ClickableBox { + textObject := func(text string, copyAble bool, align fyne.TextAlign, bold bool) *widgets.ClickableBox { var textToCopy *canvas.Text if copyAble { if strings.Contains(text, ":") { @@ -94,7 +94,7 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { textToCopy.TextStyle = fyne.TextStyle{Bold: true} } textToCopy.TextSize = 14 - textToCopy.Alignment = fyne.TextAlignTrailing + textToCopy.Alignment = align return widgets.NewClickableBox(widget.NewHBox(textToCopy), func() { @@ -113,109 +113,98 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { } tableConfirmations := widget.NewHBox( - textObject("Confirmations:", false, true), - textObject(strconv.Itoa(int(confirmations)), false, false), + widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), ) tableHash := widget.NewHBox( - textObject("Transaction ID:", false, true), - textObject(txDetails.Hash, true, false), + widget.NewLabelWithStyle("Transaction ID:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + textObject(txDetails.Hash, true, fyne.TextAlignCenter, false), ) tableBlockHeight := widget.NewHBox( - textObject("Block Height:", false, true), - textObject(strconv.Itoa(int(txDetails.BlockHeight)), false, false), + widget.NewLabelWithStyle("Block Height:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(strconv.Itoa(int(txDetails.BlockHeight)), fyne.TextAlignCenter, fyne.TextStyle{}), ) tableDirection := widget.NewHBox( - textObject("Direction:", false, true), - textObject(dcrlibwallet.TransactionDirectionName(txDetails.Direction), false, false), + widget.NewLabelWithStyle("Direction:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(txDetails.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), ) tableType := widget.NewHBox( - textObject("Type:", false, true), - textObject(txDetails.Type, false, false), + widget.NewLabelWithStyle("Type:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(txDetails.Type, fyne.TextAlignCenter, fyne.TextStyle{}), ) tableAmount := widget.NewHBox( - textObject("Amount:", false, true), - textObject(dcrutil.Amount(txDetails.Amount).String(), false, false), + widget.NewLabelWithStyle("Amount:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Amount).String(), fyne.TextAlignCenter, fyne.TextStyle{}), ) tableSize := widget.NewHBox( - textObject("Size:", false, true), - textObject(strconv.Itoa(txDetails.Size)+" Bytes", false, false), + widget.NewLabelWithStyle("Size:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(strconv.Itoa(txDetails.Size)+" Bytes", fyne.TextAlignCenter, fyne.TextStyle{}), ) tableFee := widget.NewHBox( - textObject("Fee:", false, true), - textObject(dcrutil.Amount(txDetails.Fee).String(), false, false), + widget.NewLabelWithStyle("Fee:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), ) tableFeeRate := widget.NewHBox( - textObject("Fee Rate:", false, true), - textObject(dcrutil.Amount(txDetails.FeeRate).String(), false, false), + widget.NewLabelWithStyle("Fee Rate:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.FeeRate).String(), fyne.TextAlignCenter, fyne.TextStyle{}), ) tableStatus := widget.NewHBox( - textObject("Status:", false, true), - textObject(status, false, false), + widget.NewLabelWithStyle("Status:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(status, fyne.TextAlignCenter, fyne.TextStyle{}), ) tableDate := widget.NewHBox( - textObject("Date:", false, true), - textObject(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(txDetails.Timestamp)), false, false), + widget.NewLabelWithStyle("Date:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(txDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), ) var txInput widgets.Table inputTableColumnLabels := widget.NewHBox( - textObject("Previous Outpoint", false, true), - textObject("Account", false, true), - textObject("Amount", false, true)) + widget.NewLabelWithStyle("Previous Outpoint", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Amount", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) var inputBox []*widget.Box for i := range txDetails.Inputs { inputBox = append(inputBox, widget.NewHBox( - textObject(txDetails.Inputs[i].PreviousOutpoint, true, false), - textObject(txDetails.Inputs[i].AccountName, false, false), - textObject(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), false, false), + textObject(txDetails.Inputs[i].PreviousOutpoint, true, fyne.TextAlignCenter, false), + textObject(txDetails.Inputs[i].AccountName, false, fyne.TextAlignCenter, false), + textObject(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), false, fyne.TextAlignTrailing, false), )) } txInput.NewTable(inputTableColumnLabels, inputBox...) var txOutput widgets.Table outputTableColumnLabels := widget.NewHBox( - textObject("Address", false, true), - textObject("Account", false, true), - textObject("Value", false, true), - textObject("Type", false, true)) + widget.NewLabelWithStyle("Account", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Address", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Value", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}), + widget.NewLabelWithStyle("Type", fyne.TextAlignCenter, fyne.TextStyle{Bold: true})) var outputBox []*widget.Box for i := range txDetails.Outputs { outputBox = append(outputBox, widget.NewHBox( - textObject(txDetails.Outputs[i].AccountName, false, false), - textObject(txDetails.Outputs[i].Address, true, false), - textObject(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), false, false), - textObject(txDetails.Outputs[i].ScriptType, false, false), + textObject(txDetails.Outputs[i].AccountName, false, fyne.TextAlignCenter, false), + textObject(txDetails.Outputs[i].Address, true, fyne.TextAlignCenter, false), + textObject(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), false, fyne.TextAlignTrailing, false), + textObject(txDetails.Outputs[i].ScriptType, false, fyne.TextAlignCenter, false), )) } txOutput.NewTable(outputTableColumnLabels, outputBox...) tableData := widget.NewVBox( tableConfirmations, - widgets.NewVSpacer(values.SpacerSize4), tableHash, - widgets.NewVSpacer(values.SpacerSize4), tableBlockHeight, - widgets.NewVSpacer(values.SpacerSize4), tableDirection, - widgets.NewVSpacer(values.SpacerSize4), tableType, - widgets.NewVSpacer(values.SpacerSize4), tableAmount, - widgets.NewVSpacer(values.SpacerSize4), tableSize, - widgets.NewVSpacer(values.SpacerSize4), tableFee, - widgets.NewVSpacer(values.SpacerSize4), tableFeeRate, - widgets.NewVSpacer(values.SpacerSize4), tableStatus, - widgets.NewVSpacer(values.SpacerSize4), tableDate, - widgets.NewVSpacer(values.SpacerSize4), ) link, err := url.Parse(fmt.Sprintf("https://%s.dcrdata.org/tx/%s", values.NetType, txDetails.Hash)) @@ -227,38 +216,38 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { redirectWidget := widget.NewHBox( widget.NewHyperlinkWithStyle("View on dcrdata", link, fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), - widgets.NewHSpacer(values.SpacerSize20), + widgets.NewHSpacer(20), widget.NewIcon(historyPage.icons[assets.RedirectIcon]), ) txDetailsData := widget.NewVBox( - widgets.NewHSpacer(values.SpacerSize10), + widgets.NewHSpacer(10), tableData, canvas.NewLine(values.TxdetailsLineColor), redirectWidget, - widgets.NewHSpacer(values.SpacerSize10), + widgets.NewHSpacer(10), canvas.NewLine(values.TxdetailsLineColor), widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txInput.Result, - widgets.NewHSpacer(values.SpacerSize10), + widgets.NewHSpacer(10), canvas.NewLine(values.TxdetailsLineColor), widget.NewLabelWithStyle("Outputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), txOutput.Result, - widgets.NewHSpacer(values.SpacerSize20), - widgets.NewVSpacer(values.SpacerSize10), + widgets.NewHSpacer(20), + widgets.NewVSpacer(10), ) txDetailsScrollContainer := widget.NewScrollContainer(txDetailsData) txDetailsOutput := widget.NewVBox( - widgets.NewHSpacer(values.SpacerSize10), + widgets.NewHSpacer(10), widget.NewHBox( txDetailslabel, widgets.NewHSpacer(txDetailsData.MinSize().Width-180), minimizeIcon, ), - widget.NewHBox(widgets.NewHSpacer(txDetailsScrollContainer.MinSize().Width*12), messageLabel), + widget.NewHBox(widgets.NewHSpacer(txDetailsScrollContainer.MinSize().Width*13), messageLabel), fyne.NewContainerWithLayout(layout.NewFixedGridLayout(fyne.NewSize(txDetailsData.MinSize().Width, txDetailsData.MinSize().Height-200)), txDetailsScrollContainer), - widgets.NewVSpacer(values.SpacerSize10), + widgets.NewVSpacer(10), ) txDetailsPopUp = widget.NewModalPopUp(fyne.NewContainer(txDetailsOutput), historyPage.Window.Canvas()) diff --git a/fyne/pages/handler/historypagehandler/txtablecomponents.go b/fyne/pages/handler/historypagehandler/txtablecomponents.go index 4b2bb84f9..6ea7423f8 100644 --- a/fyne/pages/handler/historypagehandler/txtablecomponents.go +++ b/fyne/pages/handler/historypagehandler/txtablecomponents.go @@ -67,7 +67,7 @@ func (historyPage *HistoryPageData) fetchTx(txTable *widgets.Table, txOffset, fi txBox = append(txBox, widget.NewHBox( widget.NewHBox(txDirectionIcon, widget.NewLabel("")), widget.NewLabelWithStyle(dcrlibwallet.ExtractDateOrTime(tx.Timestamp), fyne.TextAlignCenter, fyne.TextStyle{}), - widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{}), + widget.NewLabelWithStyle(status, fyne.TextAlignCenter, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrutil.Amount(tx.Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), widget.NewLabelWithStyle(dcrutil.Amount(tx.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), widgets.NewClickableBox(widget.NewHBox(widget.NewLabelWithStyle(trimmedHash, fyne.TextAlignCenter, fyne.TextStyle{Italic: true})), func() { diff --git a/fyne/pages/handler/values/strings.go b/fyne/pages/handler/values/strings.go index e68aaa659..03fbc98e5 100644 --- a/fyne/pages/handler/values/strings.go +++ b/fyne/pages/handler/values/strings.go @@ -71,9 +71,10 @@ const ( ReceivePageInfo = "Each time you request a \npayment, a new address is \ncreated to protect your privacy." // History Page - PageHint = "- Tap Hash to view Transaction details.\n\n- Tap Blue Text to Copy." - HistoryTitle = "Transaction" - NetType = "testnet" + TxdetailsHint = "- Tap Hash to view Transaction details." + CopyHint = "- Tap Blue Text to Copy." + HistoryTitle = "Transaction" + NetType = "testnet" // Error Messages AmountDecimalPlaceErr = "Amount has more than 8 decimal places" From 8b9d01800fd5f65117fc0bf5212dff99ccef218e Mon Sep 17 00:00:00 2001 From: morrison Date: Sun, 29 Dec 2019 00:36:15 +0100 Subject: [PATCH 71/73] used form widget for txdetails data --- .../historypagehandler/txdetailscomponent.go | 130 ++++++++++-------- 1 file changed, 72 insertions(+), 58 deletions(-) diff --git a/fyne/pages/handler/historypagehandler/txdetailscomponent.go b/fyne/pages/handler/historypagehandler/txdetailscomponent.go index b8d490c33..5a4522f8f 100644 --- a/fyne/pages/handler/historypagehandler/txdetailscomponent.go +++ b/fyne/pages/handler/historypagehandler/txdetailscomponent.go @@ -112,52 +112,65 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { ) } - tableConfirmations := widget.NewHBox( - widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), - ) + // tableConfirmations := widget.NewHBox( + // widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), + // ) - tableHash := widget.NewHBox( - widget.NewLabelWithStyle("Transaction ID:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - textObject(txDetails.Hash, true, fyne.TextAlignCenter, false), - ) + // tableHash := widget.NewHBox( + // widget.NewLabelWithStyle("Transaction ID:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + // textObject(txDetails.Hash, true, fyne.TextAlignCenter, false), + // ) - tableBlockHeight := widget.NewHBox( - widget.NewLabelWithStyle("Block Height:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(strconv.Itoa(int(txDetails.BlockHeight)), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableDirection := widget.NewHBox( - widget.NewLabelWithStyle("Direction:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(txDetails.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableType := widget.NewHBox( - widget.NewLabelWithStyle("Type:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(txDetails.Type, fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableAmount := widget.NewHBox( - widget.NewLabelWithStyle("Amount:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Amount).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableSize := widget.NewHBox( - widget.NewLabelWithStyle("Size:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(strconv.Itoa(txDetails.Size)+" Bytes", fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableFee := widget.NewHBox( - widget.NewLabelWithStyle("Fee:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableFeeRate := widget.NewHBox( - widget.NewLabelWithStyle("Fee Rate:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(dcrutil.Amount(txDetails.FeeRate).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableStatus := widget.NewHBox( - widget.NewLabelWithStyle("Status:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(status, fyne.TextAlignCenter, fyne.TextStyle{}), - ) - tableDate := widget.NewHBox( - widget.NewLabelWithStyle("Date:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(txDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), - ) + // tableBlockHeight := widget.NewHBox( + // widget.NewLabelWithStyle("Block Height:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle(strconv.Itoa(int(txDetails.BlockHeight)), fyne.TextAlignCenter, fyne.TextStyle{}), + // ) + // tableDirection := widget.NewHBox( + // widget.NewLabelWithStyle("Direction:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(txDetails.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), + // ) + // tableType := widget.NewHBox( + // widget.NewLabelWithStyle("Type:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle(txDetails.Type, fyne.TextAlignCenter, fyne.TextStyle{}), + // ) + // tableAmount := widget.NewHBox( + // widget.NewLabelWithStyle("Amount:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Amount).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + // ) + // tableSize := widget.NewHBox( + // widget.NewLabelWithStyle("Size:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle(strconv.Itoa(txDetails.Size)+" Bytes", fyne.TextAlignCenter, fyne.TextStyle{}), + // ) + // tableFee := widget.NewHBox( + // widget.NewLabelWithStyle("Fee:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + // ) + // tableFeeRate := widget.NewHBox( + // widget.NewLabelWithStyle("Fee Rate:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle(dcrutil.Amount(txDetails.FeeRate).String(), fyne.TextAlignCenter, fyne.TextStyle{}), + // ) + // tableStatus := widget.NewHBox( + // widget.NewLabelWithStyle("Status:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle(status, fyne.TextAlignCenter, fyne.TextStyle{}), + // ) + // tableDate := widget.NewHBox( + // widget.NewLabelWithStyle("Date:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), + // widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(txDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), + // ) + + txDetailsForm := widget.NewForm() + txDetailsForm.Append("Fee: ", widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Fee).String(), fyne.TextAlignLeading, fyne.TextStyle{})) + txDetailsForm.Append("Date: ", widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(txDetails.Timestamp)), fyne.TextAlignLeading, fyne.TextStyle{})) + txDetailsForm.Append("Type: ", widget.NewLabelWithStyle(txDetails.Type, fyne.TextAlignLeading, fyne.TextStyle{})) + txDetailsForm.Append("Size: ", widget.NewLabelWithStyle(strconv.Itoa(txDetails.Size)+" Bytes", fyne.TextAlignLeading, fyne.TextStyle{})) + txDetailsForm.Append("Amount: ", widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Amount).String(), fyne.TextAlignLeading, fyne.TextStyle{})) + txDetailsForm.Append("Status: ", widget.NewLabelWithStyle(status, fyne.TextAlignLeading, fyne.TextStyle{})) + txDetailsForm.Append("Fee Rate: ", widget.NewLabelWithStyle(dcrutil.Amount(txDetails.FeeRate).String(), fyne.TextAlignLeading, fyne.TextStyle{})) + txDetailsForm.Append("Direction: ", widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(txDetails.Direction), fyne.TextAlignLeading, fyne.TextStyle{})) + txDetailsForm.Append("Block Height: ", widget.NewLabelWithStyle(strconv.Itoa(int(txDetails.BlockHeight)), fyne.TextAlignLeading, fyne.TextStyle{})) + txDetailsForm.Append("Confirmations: ", widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignLeading, fyne.TextStyle{})) + txDetailsForm.Append("Transaction ID: ", textObject(txDetails.Hash, true, fyne.TextAlignLeading, false)) var txInput widgets.Table inputTableColumnLabels := widget.NewHBox( @@ -193,19 +206,19 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { } txOutput.NewTable(outputTableColumnLabels, outputBox...) - tableData := widget.NewVBox( - tableConfirmations, - tableHash, - tableBlockHeight, - tableDirection, - tableType, - tableAmount, - tableSize, - tableFee, - tableFeeRate, - tableStatus, - tableDate, - ) + // tableData := widget.NewVBox( + // tableConfirmations, + // tableHash, + // tableBlockHeight, + // tableDirection, + // tableType, + // tableAmount, + // tableSize, + // tableFee, + // tableFeeRate, + // tableStatus, + // tableDate, + // ) link, err := url.Parse(fmt.Sprintf("https://%s.dcrdata.org/tx/%s", values.NetType, txDetails.Hash)) if err != nil { @@ -222,7 +235,8 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { txDetailsData := widget.NewVBox( widgets.NewHSpacer(10), - tableData, + // tableData, + txDetailsForm, canvas.NewLine(values.TxdetailsLineColor), redirectWidget, widgets.NewHSpacer(10), From 08c678bbe25a6b7609f1372848bae39567b60472 Mon Sep 17 00:00:00 2001 From: morrison Date: Sun, 29 Dec 2019 02:05:40 +0100 Subject: [PATCH 72/73] cleaned up code and fixed issues with txtable content alignment --- .../historypagehandler/txdetailscomponent.go | 89 +++---------------- 1 file changed, 12 insertions(+), 77 deletions(-) diff --git a/fyne/pages/handler/historypagehandler/txdetailscomponent.go b/fyne/pages/handler/historypagehandler/txdetailscomponent.go index 5a4522f8f..593ebdab4 100644 --- a/fyne/pages/handler/historypagehandler/txdetailscomponent.go +++ b/fyne/pages/handler/historypagehandler/txdetailscomponent.go @@ -76,7 +76,7 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { status = "Pending" } - textObject := func(text string, copyAble bool, align fyne.TextAlign, bold bool) *widgets.ClickableBox { + textObject := func(text string, copyAble bool, align fyne.TextAlign) *widgets.ClickableBox { var textToCopy *canvas.Text if copyAble { if strings.Contains(text, ":") { @@ -90,13 +90,10 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { } else { textToCopy = canvas.NewText(text, values.DefaultTextColor) } - if bold { - textToCopy.TextStyle = fyne.TextStyle{Bold: true} - } textToCopy.TextSize = 14 textToCopy.Alignment = align - return widgets.NewClickableBox(widget.NewHBox(textToCopy), + return widgets.NewClickableBox(widget.NewVBox(widgets.NewVSpacer(1), textToCopy), func() { messageLabel.SetText("Data Copied") clipboard := historyPage.Window.Clipboard() @@ -112,53 +109,6 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { ) } - // tableConfirmations := widget.NewHBox( - // widget.NewLabelWithStyle("Confirmations:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignCenter, fyne.TextStyle{}), - // ) - - // tableHash := widget.NewHBox( - // widget.NewLabelWithStyle("Transaction ID:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - // textObject(txDetails.Hash, true, fyne.TextAlignCenter, false), - // ) - - // tableBlockHeight := widget.NewHBox( - // widget.NewLabelWithStyle("Block Height:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle(strconv.Itoa(int(txDetails.BlockHeight)), fyne.TextAlignCenter, fyne.TextStyle{}), - // ) - // tableDirection := widget.NewHBox( - // widget.NewLabelWithStyle("Direction:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(txDetails.Direction), fyne.TextAlignCenter, fyne.TextStyle{}), - // ) - // tableType := widget.NewHBox( - // widget.NewLabelWithStyle("Type:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle(txDetails.Type, fyne.TextAlignCenter, fyne.TextStyle{}), - // ) - // tableAmount := widget.NewHBox( - // widget.NewLabelWithStyle("Amount:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Amount).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - // ) - // tableSize := widget.NewHBox( - // widget.NewLabelWithStyle("Size:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle(strconv.Itoa(txDetails.Size)+" Bytes", fyne.TextAlignCenter, fyne.TextStyle{}), - // ) - // tableFee := widget.NewHBox( - // widget.NewLabelWithStyle("Fee:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Fee).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - // ) - // tableFeeRate := widget.NewHBox( - // widget.NewLabelWithStyle("Fee Rate:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle(dcrutil.Amount(txDetails.FeeRate).String(), fyne.TextAlignCenter, fyne.TextStyle{}), - // ) - // tableStatus := widget.NewHBox( - // widget.NewLabelWithStyle("Status:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle(status, fyne.TextAlignCenter, fyne.TextStyle{}), - // ) - // tableDate := widget.NewHBox( - // widget.NewLabelWithStyle("Date:", fyne.TextAlignTrailing, fyne.TextStyle{Bold: true}), - // widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(txDetails.Timestamp)), fyne.TextAlignCenter, fyne.TextStyle{}), - // ) - txDetailsForm := widget.NewForm() txDetailsForm.Append("Fee: ", widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Fee).String(), fyne.TextAlignLeading, fyne.TextStyle{})) txDetailsForm.Append("Date: ", widget.NewLabelWithStyle(fmt.Sprintf("%s UTC", dcrlibwallet.FormatUTCTime(txDetails.Timestamp)), fyne.TextAlignLeading, fyne.TextStyle{})) @@ -170,7 +120,7 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { txDetailsForm.Append("Direction: ", widget.NewLabelWithStyle(dcrlibwallet.TransactionDirectionName(txDetails.Direction), fyne.TextAlignLeading, fyne.TextStyle{})) txDetailsForm.Append("Block Height: ", widget.NewLabelWithStyle(strconv.Itoa(int(txDetails.BlockHeight)), fyne.TextAlignLeading, fyne.TextStyle{})) txDetailsForm.Append("Confirmations: ", widget.NewLabelWithStyle(strconv.Itoa(int(confirmations)), fyne.TextAlignLeading, fyne.TextStyle{})) - txDetailsForm.Append("Transaction ID: ", textObject(txDetails.Hash, true, fyne.TextAlignLeading, false)) + txDetailsForm.Append("Transaction ID: ", textObject(txDetails.Hash, true, fyne.TextAlignLeading)) var txInput widgets.Table inputTableColumnLabels := widget.NewHBox( @@ -181,9 +131,9 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { var inputBox []*widget.Box for i := range txDetails.Inputs { inputBox = append(inputBox, widget.NewHBox( - textObject(txDetails.Inputs[i].PreviousOutpoint, true, fyne.TextAlignCenter, false), - textObject(txDetails.Inputs[i].AccountName, false, fyne.TextAlignCenter, false), - textObject(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), false, fyne.TextAlignTrailing, false), + textObject(txDetails.Inputs[i].PreviousOutpoint, true, fyne.TextAlignLeading), + widget.NewLabelWithStyle(txDetails.Inputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Inputs[i].Amount).String(), fyne.TextAlignCenter, fyne.TextStyle{}), )) } txInput.NewTable(inputTableColumnLabels, inputBox...) @@ -198,28 +148,14 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { var outputBox []*widget.Box for i := range txDetails.Outputs { outputBox = append(outputBox, widget.NewHBox( - textObject(txDetails.Outputs[i].AccountName, false, fyne.TextAlignCenter, false), - textObject(txDetails.Outputs[i].Address, true, fyne.TextAlignCenter, false), - textObject(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), false, fyne.TextAlignTrailing, false), - textObject(txDetails.Outputs[i].ScriptType, false, fyne.TextAlignCenter, false), + widget.NewLabelWithStyle(txDetails.Outputs[i].AccountName, fyne.TextAlignCenter, fyne.TextStyle{}), + textObject(txDetails.Outputs[i].Address, true, fyne.TextAlignCenter), + widget.NewLabelWithStyle(dcrutil.Amount(txDetails.Outputs[i].Amount).String(), fyne.TextAlignTrailing, fyne.TextStyle{}), + widget.NewLabelWithStyle(txDetails.Outputs[i].ScriptType, fyne.TextAlignCenter, fyne.TextStyle{}), )) } txOutput.NewTable(outputTableColumnLabels, outputBox...) - // tableData := widget.NewVBox( - // tableConfirmations, - // tableHash, - // tableBlockHeight, - // tableDirection, - // tableType, - // tableAmount, - // tableSize, - // tableFee, - // tableFeeRate, - // tableStatus, - // tableDate, - // ) - link, err := url.Parse(fmt.Sprintf("https://%s.dcrdata.org/tx/%s", values.NetType, txDetails.Hash)) if err != nil { helpers.ErrorHandler(fmt.Sprintf("Error: ", err.Error()), errorMessageLabel) @@ -229,16 +165,15 @@ func (historyPage *HistoryPageData) fetchTxDetails(hash string) { redirectWidget := widget.NewHBox( widget.NewHyperlinkWithStyle("View on dcrdata", link, fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), - widgets.NewHSpacer(20), + widgets.NewHSpacer(5), widget.NewIcon(historyPage.icons[assets.RedirectIcon]), ) txDetailsData := widget.NewVBox( widgets.NewHSpacer(10), - // tableData, txDetailsForm, canvas.NewLine(values.TxdetailsLineColor), - redirectWidget, + widget.NewHBox(layout.NewSpacer(), redirectWidget, layout.NewSpacer()), widgets.NewHSpacer(10), canvas.NewLine(values.TxdetailsLineColor), widget.NewLabelWithStyle("Inputs", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}), From 2fb8d2e5d3126993bd77ca95ccc3b478b3e06c2e Mon Sep 17 00:00:00 2001 From: morrison Date: Sat, 5 Jan 2019 23:50:54 +0100 Subject: [PATCH 73/73] fixed pagination --- fyne/assets/refresh.png | Bin 0 -> 1253 bytes .../handler/historypagehandler/basewidgets.go | 2 +- .../historypagehandler/inithistorypage.go | 17 +++- .../historypagehandler/txtablecomponents.go | 91 ++++++++---------- 4 files changed, 59 insertions(+), 51 deletions(-) create mode 100644 fyne/assets/refresh.png diff --git a/fyne/assets/refresh.png b/fyne/assets/refresh.png new file mode 100644 index 0000000000000000000000000000000000000000..7db8751b63d79f8d6fdf34a470b2de82b3b2c870 GIT binary patch literal 1253 zcmVMSfQ;^N{J6&3va{ECW-mX?SmtgK~aWg{aaF)=YVHa1>fUXYNG3=9k|O&?4E00ccr zL_t(&f$f{wlHxE7MYHc4fh<4>{r_J%fixte9vS3^Muh%EbJ%&uBtLD3mi>%oun(=A zf~gmF{V$r#j!t^yN$zIgUuY`3*Cs!7Uw4(g|C_{4^o^e7F0;O%N$irgqh*R;oE6%3 z)M)2tH+s@pKoi*KZ;&TtTeOBHF^t0-aQu=4>ppgZte%i^ z9(jcQAz@$OFM0y`Ngwsu@H%tJ*U-u9>aqi{dB?hfN0lBM9Pu-UJjs(@vM{y-HP*OL z%kGv4+k@O@!ADybpA8-3I_N}p#=`6XxEJcYU~=hVgV}enA$OTQP0(29c`UT+zK@34 z;<4gtyp?m6KLy#M4~h6_PwC7cb}h8Z_~=0G$)MFM40+2(N9rpS$QIn+fsHN+Xp-GG zzSX4H1jH`)njKMYEy!v0xxHiVB8S~Ck^SlPQzm*lY&^ELcDvkTr69)$V0N;=E5;@1 zi4N^})-?pw#&4nC=`e4S>zx;;oF+SZDS#BMgbrxppR=x$185tQF85tSO0WeUGT(~(LR=?HLeO$Dn~VPJ__Bx1 zj<#)LPSD$y$Y!IrF&rogPh%6Zi5qPbI1SJSj34i|S~O|YWNSoLg)pC{-5T*^F?#_; z?9^P=xx`E%xW5(bt4;tPNCbd`Cua{jXrRj@wc*NYjkyLQ!`O0_ zv45B$r>CGmAGE;~Y@NUlgpLs#Wb7k1-ep+@)DM<=kTlsHAr8mSG+1~qd(cp z{CIooG%M0Uys$s24E9wH64U2z_GVS?sLQRWj`zhDH^hOK+}$b`>yZ^~XfJBjVK int(historyPage.TotalTxFetched) { - if historyPage.txTable.Container.Offset.Y == 0 { - // table not yet scrolled wait 4 secs and update - time.AfterFunc(time.Second*2, func() { + if historyPage.txTable.Container.Offset.Y == size { + historyPage.pageCount += 1 + historyPage.fetchTx(&txTable, historyPage.TotalTxFetched, historyPage.selectedFilterId, false) + } else if historyPage.txTable.Container.Offset.Y == 0 && historyPage.pageCount > 1 { + historyPage.pageCount -= 1 + historyPage.fetchTx(&txTable, historyPage.TotalTxFetched, historyPage.selectedFilterId, true) + } else { + time.AfterFunc(time.Millisecond*500, func() { if historyPage.TabMenu.CurrentTabIndex() != 1 { return } historyPage.updateTable() }) - } else if scrollPosition < 0.5 { - if historyPage.TotalTxFetched == txPerPage { - time.AfterFunc(time.Second*2, func() { - if historyPage.TabMenu.CurrentTabIndex() != 1 { - return - } - historyPage.updateTable() - }) - } - if historyPage.TotalTxFetched >= 50 { - historyPage.TotalTxFetched -= txPerPage * 2 - if txTableRowCount >= 50 { - historyPage.txTable.Delete(txTableRowCount-int(txPerPage), txTableRowCount) - } - historyPage.fetchTx(&historyPage.txTable, historyPage.TotalTxFetched, historyPage.selectedFilterId, true) - } - } else if scrollPosition >= 0.5 { - if txTableRowCount >= 50 { - historyPage.txTable.Delete(0, txTableRowCount-int(txPerPage)) - } - historyPage.fetchTx(&historyPage.txTable, historyPage.TotalTxFetched, historyPage.selectedFilterId, false) + } + } else if historyPage.allTxCount == int(historyPage.TotalTxFetched) && historyPage.pageCount > 1 { + if historyPage.lastTx < 10 { + historyPage.backIcon.Show() } } }