Skip to content

Commit

Permalink
Further project cleanup in preparation for rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed Jan 4, 2025
1 parent 741b7cc commit a87d786
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 445 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ require (
fyne.io/x/fyne v0.0.0-20241224222935-5be10b3dd763
github.com/fynelabs/fyneselfupdate v0.1.1
github.com/fynelabs/selfupdate v0.2.0
github.com/klauspost/compress v1.17.11
github.com/rymdport/wormhole v0.1.1-0.20241116103349-4e36e05aff6c
github.com/stretchr/testify v1.9.0
)
Expand All @@ -30,6 +29,7 @@ require (
github.com/gopherjs/gopherjs v1.17.2 // indirect
github.com/jeandeaual/go-locale v0.0.0-20240223122105-ce5225dcaa49 // indirect
github.com/jsummers/gobmp v0.0.0-20151104160322-e2ba15ffa76e // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/nicksnyder/go-i18n/v2 v2.4.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rymdport/portal v0.3.0 // indirect
Expand Down
154 changes: 0 additions & 154 deletions internal/transport/receiver.go

This file was deleted.

112 changes: 0 additions & 112 deletions internal/transport/sender.go

This file was deleted.

31 changes: 0 additions & 31 deletions internal/transport/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,10 @@
package transport

import (
"fyne.io/fyne/v2"
"github.com/rymdport/wormhole/wormhole"
)

// Client defines the client for handling sending and receiving using wormhole-william
type Client struct {
wormhole.Client

// App is a reference to the currently running Fyne application.
App fyne.App

// CustomCode defines if we should pass a custom code or let wormhole-william generate on for us.
CustomCode bool

// DownloadPath holds the download path used for saving received files.
DownloadPath string

// NoExtractDirectory specifies if we should extract directories or not.
NoExtractDirectory bool

// Notification holds the settings value for if we have notifications enabled or not.
Notifications bool

// OverwriteExisting holds the settings value for if we should overwrite already existing files.
OverwriteExisting bool
}

// ShowNotification sends a notification if c.Notifications is true.
func (c *Client) ShowNotification(title, content string) {
if c.Notifications {
c.App.SendNotification(&fyne.Notification{Title: title, Content: content})
}
}

// NewClient returns a new client for sending and receiving using wormhole-william
func NewClient(app fyne.App) *Client {
return &Client{App: app}
}
12 changes: 0 additions & 12 deletions internal/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package util

import (
"errors"
"os"
"path/filepath"
"strings"

"fyne.io/fyne/v2"
Expand Down Expand Up @@ -61,16 +59,6 @@ func runeIsNotNumerical(r rune) bool {
return r < '0' || r > '9'
}

// UserDownloadsFolder returns the downloads folder corresponding to the current user.
func UserDownloadsFolder() string {
dir, err := os.UserHomeDir()
if err != nil {
fyne.LogError("Could not get home dir", err)
}

return filepath.Join(dir, "Downloads")
}

// WindowSizeToDialog scales the window size to a suitable dialog size.
func WindowSizeToDialog(s fyne.Size) fyne.Size {
return fyne.NewSize(s.Width*0.8, s.Height*0.8)
Expand Down
Loading

0 comments on commit a87d786

Please sign in to comment.