-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHashMaster3000.go
More file actions
61 lines (54 loc) · 1.6 KB
/
HashMaster3000.go
File metadata and controls
61 lines (54 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright (c) 2025 Neil Stephens. All rights reserved.
// Use of this source code is governed by an MIT license that can be
// found in the LICENSE file.
package main
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/widget"
)
type HashGenerator struct {
descriptionEntry *widget.Entry
masterPassEntry *widget.Entry
algorithmSelect *widget.Select
charRestSelect *widget.Select
lengthEntry *widget.Entry
iterationsEntry *widget.Entry
genButton *widget.Button
outputEntry *widget.Entry
app fyne.App
window fyne.Window
savedSettings map[string]SavedSetting
settingsList *widget.List
filterEntry *widget.Entry
filteredKeys []string
backupButton *widget.Button
mergeButton *widget.Button
restoreButton *widget.Button
hideZeroIterBox *widget.Check
copyToClipboard *widget.Check
appPrefs AppPreferences
}
func main() {
myApp := app.NewWithID("link.multifarious.hm3k")
myApp.SetIcon(nil)
myWindow := myApp.NewWindow("Hash Master 3000")
myWindow.Resize(fyne.NewSize(400, 700))
myWindow.SetCloseIntercept(func() {
myApp.Quit()
})
generator := &HashGenerator{
app: myApp,
window: myWindow,
savedSettings: make(map[string]SavedSetting),
filteredKeys: []string{},
appPrefs: AppPreferences{}, // Initialize preferences
}
generator.loadAppPreferences()
appLife := myApp.Lifecycle()
appLife.SetOnStarted(generator.loadSettings)
generator.makeUIcomponents()
myWindow.SetContent(generator.layoutUI())
myWindow.Canvas().Focus(generator.filterEntry)
myWindow.ShowAndRun()
}