Skip to content

Commit e7aa641

Browse files
committed
refactor: info window
1 parent 8287bc8 commit e7aa641

38 files changed

+342
-310
lines changed

internal/app/ui/assetbrowser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func (a *assetBrowser) update(ctx context.Context) {
125125
}
126126
reportError := func(err error) {
127127
slog.Error("Failed to update asset browser", "error", err)
128-
setFooter(a.u.humanizeError(err), widget.DangerImportance)
128+
setFooter(a.u.HumanizeError(err), widget.DangerImportance)
129129
}
130130
el, err := a.u.eus.ListLocations(ctx)
131131
if err != nil {

internal/app/ui/assetsearch.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ func (a *assetSearch) update(ctx context.Context) {
697697
if err != nil {
698698
slog.Error("Failed to refresh asset data", "err", err)
699699
clear()
700-
setTop("ERROR: "+a.u.humanizeError(err), widget.DangerImportance)
700+
setTop("ERROR: "+a.u.HumanizeError(err), widget.DangerImportance)
701701
return
702702
}
703703
fyne.Do(func() {
@@ -860,7 +860,7 @@ func loadAssetIconAsync(eis assetIconEIS, icon *canvas.Image, typeID int64, vari
860860

861861
// showAssetDetailWindow shows the details for an assets in a new window.
862862
func showAssetDetailWindow(u *baseUI, r assetRow) {
863-
w, created := u.getOrCreateWindow(
863+
w, created := u.GetOrCreateWindow(
864864
fmt.Sprintf("asset-%d-%d", r.owner.ID, r.itemID),
865865
"Asset: Information",
866866
r.owner.Name,

internal/app/ui/augmentations.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func (a *augmentations) update(ctx context.Context) {
195195
if err != nil {
196196
slog.Error("Failed to refresh augmentations UI", "err", err)
197197
fyne.Do(func() {
198-
a.footer.Text = "ERROR: " + a.u.humanizeError(err)
198+
a.footer.Text = "ERROR: " + a.u.HumanizeError(err)
199199
a.footer.Importance = widget.DangerImportance
200200
a.footer.Refresh()
201201
})

internal/app/ui/charactercommunications.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func (a *characterCommunications) setDetail(n *app.CharacterNotification) {
201201
if err != nil {
202202
slog.Warn("Failed to set notification detail", "err", err)
203203
fyne.Do(func() {
204-
a.Detail.setError(a.u.humanizeError(err))
204+
a.Detail.setError(a.u.HumanizeError(err))
205205
})
206206
return
207207
}

internal/app/ui/charactercontacts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ func (a *characterContacts) update(ctx context.Context) {
403403
rows, err := a.fetchRows(ctx, characterID)
404404
if err != nil {
405405
clear()
406-
setFooter("ERROR: "+a.u.humanizeError(err), widget.DangerImportance)
406+
setFooter("ERROR: "+a.u.HumanizeError(err), widget.DangerImportance)
407407
return
408408
}
409409
fyne.Do(func() {

internal/app/ui/characterflyableships.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ func (a *characterFlyableShips) update(ctx context.Context) {
263263
}
264264
reportError := func(err error) {
265265
slog.Error("Failed to update data for flyable ships UI", "error", err)
266-
setTop(a.u.humanizeError(err), widget.DangerImportance)
266+
setTop(a.u.HumanizeError(err), widget.DangerImportance)
267267
}
268268

269269
ok1, err := a.u.eus.HasSection(ctx, app.SectionEveTypes)

internal/app/ui/characterjumpclones.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func (a *characterJumpClones) update(ctx context.Context) {
137137
if err != nil {
138138
slog.Error("Failed to refresh jump clones UI", "err", err)
139139
fyne.Do(func() {
140-
a.top.Set(iwidget.RichTextSegmentsFromText("ERROR: "+a.u.humanizeError(err), widget.RichTextStyle{
140+
a.top.Set(iwidget.RichTextSegmentsFromText("ERROR: "+a.u.HumanizeError(err), widget.RichTextStyle{
141141
ColorName: theme.ColorNameError,
142142
}))
143143
})

internal/app/ui/characterloyaltypoints.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ func (a *characterLoyaltyPoints) update(ctx context.Context) {
246246
rows, err := a.fetchRows(ctx, character.ID)
247247
if err != nil {
248248
clear()
249-
setFooter("ERROR: "+a.u.humanizeError(err), widget.DangerImportance)
249+
setFooter("ERROR: "+a.u.HumanizeError(err), widget.DangerImportance)
250250
return
251251
}
252252
fyne.Do(func() {

internal/app/ui/charactermails.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ func (a *characterMails) update(ctx context.Context) {
272272
td, folderAll, err := a.fetchFolders(ctx, characterID)
273273
if err != nil {
274274
slog.Error("Failed to build mail tree", "character", characterID, "error", err)
275-
setStatus("Error: "+a.u.humanizeError(err), widget.DangerImportance)
275+
setStatus("Error: "+a.u.HumanizeError(err), widget.DangerImportance)
276276
return
277277
}
278278
unread, err := a.updateCountsInTree(ctx, characterID, td)
@@ -625,7 +625,7 @@ func (a *characterMails) headerUpdate(ctx context.Context) {
625625
headers, err := a.fetchHeaders(ctx, folder)
626626
if err != nil {
627627
slog.Error("Failed to refresh mail headers UI", "characterID", folder.CharacterID, "folder", folder.Name, "err", err)
628-
setStatus("Failed to load: "+a.u.humanizeError(err), widget.DangerImportance)
628+
setStatus("Failed to load: "+a.u.HumanizeError(err), widget.DangerImportance)
629629
clear()
630630
return
631631
}
@@ -697,7 +697,7 @@ func (a *characterMails) MakeDeleteAction(onSuccess func()) (fyne.Resource, func
697697
}
698698
m.OnError = func(err error) {
699699
slog.Error("Failed to delete mail", "characterID", a.mail.CharacterID, "mailID", a.mail.MailID, "err", err)
700-
a.u.ShowSnackbar(fmt.Sprintf("Failed to delete mail: %s", a.u.humanizeError(err)))
700+
a.u.ShowSnackbar(fmt.Sprintf("Failed to delete mail: %s", a.u.HumanizeError(err)))
701701
}
702702
m.Start()
703703
}, a.u.MainWindow(),
@@ -751,7 +751,7 @@ func (a *characterMails) loadMail(ctx context.Context, mailID int64) {
751751
if err != nil {
752752
slog.Error("Failed to fetch mail", "mailID", mailID, "error", err)
753753
fyne.Do(func() {
754-
a.Detail.SetBody("ERROR: Failed to load: " + a.u.humanizeError(err))
754+
a.Detail.SetBody("ERROR: Failed to load: " + a.u.HumanizeError(err))
755755
})
756756
return
757757
}
@@ -776,7 +776,7 @@ func (a *characterMails) loadMail(ctx context.Context, mailID int64) {
776776
if a.mail.CharacterID != characterID || a.mail.MailID != mailID {
777777
return
778778
}
779-
a.Detail.SetBody("ERROR: Failed to load: " + a.u.humanizeError(err))
779+
a.Detail.SetBody("ERROR: Failed to load: " + a.u.HumanizeError(err))
780780
})
781781
return nil, nil
782782
}

internal/app/ui/characteroverview.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ func (a *characterOverview) makeGrid() *widget.GridWrap {
301301
err := a.u.loadCharacter(r.characterID)
302302
if err != nil {
303303
slog.Error("Failed to load character", "characterID", r.characterID, "error", err)
304-
a.u.ShowSnackbar(fmt.Sprintf("Failed to load character: %s", a.u.humanizeError(err)))
304+
a.u.ShowSnackbar(fmt.Sprintf("Failed to load character: %s", a.u.HumanizeError(err)))
305305
return
306306
}
307307
}()
@@ -348,7 +348,7 @@ func (a *characterOverview) makeList() *widget.List {
348348
err := a.u.loadCharacter(r.characterID)
349349
if err != nil {
350350
slog.Error("Failed to load character", "characterID", r.characterID, "error", err)
351-
a.u.ShowSnackbar(fmt.Sprintf("Failed to load character: %s", a.u.humanizeError(err)))
351+
a.u.ShowSnackbar(fmt.Sprintf("Failed to load character: %s", a.u.HumanizeError(err)))
352352
return
353353
}
354354
}()
@@ -451,7 +451,7 @@ func (a *characterOverview) update(ctx context.Context) {
451451
rows, err := a.fetchRows(ctx)
452452
if err != nil {
453453
clear()
454-
setFooter("ERROR: "+a.u.humanizeError(err), widget.DangerImportance)
454+
setFooter("ERROR: "+a.u.HumanizeError(err), widget.DangerImportance)
455455
slog.Error("Failed to refresh overview UI", "err", err)
456456
return
457457
}

0 commit comments

Comments
 (0)