Skip to content

Commit

Permalink
Fix set nickname dialog cjk display
Browse files Browse the repository at this point in the history
  • Loading branch information
creamlike1024 committed Jan 16, 2024
1 parent cc94410 commit 00cc77a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 44 deletions.
2 changes: 1 addition & 1 deletion FyneApp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Website = "https://github.com/creamlike1024/EasyLPAC"
Icon = "Icon.png"
Name = "EasyLPAC"
ID = "github.creamlike1024.EasyLPAC"
Version = "0.5.0"
Version = "0.5.1"
Build = 0
4 changes: 4 additions & 0 deletions control.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ func LockButton() {
SetDefaultSmdpButton.Disable()
ProfileMaskCheck.Disable()
NotificationMaskCheck.Disable()
ApduDriverSelect.Disable()
ApduDriverRefreshButton.Disable()
} else {
DownloadButton.Enable()
DiscoveryButton.Enable()
Expand All @@ -189,6 +191,8 @@ func LockButton() {
SetDefaultSmdpButton.Enable()
ProfileMaskCheck.Enable()
NotificationMaskCheck.Enable()
ApduDriverSelect.Enable()
ApduDriverRefreshButton.Enable()
}
}
}
Expand Down
38 changes: 12 additions & 26 deletions widgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,15 @@ func InitWidgets() {

StatusLabel = widget.NewLabel("Ready.")

DownloadButton = widget.NewButton("Download", downloadButtonFunc)
DownloadButton.SetIcon(theme.DownloadIcon())
DownloadButton = &widget.Button{Text: "Download", OnTapped: downloadButtonFunc, Icon: theme.DownloadIcon()}

DiscoveryButton = widget.NewButton("Discovery", discoveryButtonFunc)
DiscoveryButton.SetIcon(theme.SearchIcon())
DiscoveryButton = &widget.Button{Text: "Discovery", OnTapped: discoveryButtonFunc, Icon: theme.SearchIcon()}

SetNicknameButton = widget.NewButton("Nickname", setNicknameButtonFunc)
SetNicknameButton.SetIcon(theme.DocumentCreateIcon())
SetNicknameButton = &widget.Button{Text: "Nickname", OnTapped: setNicknameButtonFunc, Icon: theme.DocumentCreateIcon()}

DeleteButton = widget.NewButton("Delete", deleteButtonFunc)
DeleteButton.SetIcon(theme.DeleteIcon())
DeleteButton = &widget.Button{Text: "Delete", OnTapped: deleteButtonFunc, Icon: theme.DeleteIcon()}

EnableButton = widget.NewButton("Enable", enableButtonFunc)
EnableButton.SetIcon(theme.ConfirmIcon())
EnableButton = &widget.Button{Text: "Enable", OnTapped: enableButtonFunc, Icon: theme.ConfirmIcon()}

ProfileList = initProfileList()

Expand All @@ -91,19 +86,15 @@ func InitWidgets() {
&widget.Label{Text: "Operation\t\t\t", TextStyle: fyne.TextStyle{Bold: true}},
&widget.Label{Text: "Server", TextStyle: fyne.TextStyle{Bold: true}})

ProcessNotificationButton = widget.NewButton("Process", processNotificationButtonFunc)
ProcessNotificationButton.SetIcon(theme.MediaPlayIcon())
ProcessNotificationButton = &widget.Button{Text: "Process", OnTapped: processNotificationButtonFunc, Icon: theme.MediaPlayIcon()}

RemoveNotificationButton = widget.NewButton("Remove", removeNotificationButtonFunc)
RemoveNotificationButton.SetIcon(theme.DeleteIcon())
RemoveNotificationButton = &widget.Button{Text: "Remove", OnTapped: removeNotificationButtonFunc, Icon: theme.DeleteIcon()}

FreeSpaceLabel = widget.NewLabel("")

OpenLogButton = widget.NewButton("Open Log", OpenLog)
OpenLogButton.SetIcon(theme.FolderOpenIcon())
OpenLogButton = &widget.Button{Text: "Open Log", OnTapped: OpenLog, Icon: theme.FolderOpenIcon()}

RefreshButton = widget.NewButton("Refresh", Refresh)
RefreshButton.SetIcon(theme.ViewRefreshIcon())
RefreshButton = &widget.Button{Text: "Refresh", OnTapped: Refresh, Icon: theme.ViewRefreshIcon()}

ProfileMaskCheck = widget.NewCheck("Mask", func(b bool) {
if b {
Expand All @@ -128,19 +119,14 @@ func InitWidgets() {
DefaultDpAddressLabel = widget.NewLabel("")
RootDsAddressLabel = widget.NewLabel("")
EuiccInfo2TextGrid = widget.NewTextGrid()
CopyEidButton = widget.NewButton("Copy", copyEidButtonFunc)
CopyEidButton.SetIcon(theme.ContentCopyIcon())
CopyEidButton = &widget.Button{Text: "Copy", OnTapped: copyEidButtonFunc, Icon: theme.ContentCopyIcon()}
CopyEidButton.Hide()
SetDefaultSmdpButton = widget.NewButton("", setDefaultSmdpButtonFunc)
SetDefaultSmdpButton.SetIcon(theme.DocumentCreateIcon())
SetDefaultSmdpButton = &widget.Button{OnTapped: setDefaultSmdpButtonFunc, Icon: theme.DocumentCreateIcon()}
SetDefaultSmdpButton.Hide()
ApduDriverSelect = widget.NewSelect([]string{}, func(s string) {
SetDriverIfid(s)
})
ApduDriverRefreshButton = widget.NewButton("", func() {
RefreshApduDriver()
})
ApduDriverRefreshButton.SetIcon(theme.SearchReplaceIcon())
ApduDriverRefreshButton = &widget.Button{OnTapped: func() { RefreshApduDriver() }, Icon: theme.SearchReplaceIcon()}
}

func downloadButtonFunc() {
Expand Down
29 changes: 12 additions & 17 deletions window.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,10 @@ lpac GUI Frontend
}

func InitDownloadDialog() dialog.Dialog {
smdp := widget.NewEntry()
smdp.PlaceHolder = "Leave it empty to use default SM-DP+"
matchID := widget.NewEntry()
matchID.PlaceHolder = "Activation code. Optional"
confirmCode := widget.NewEntry()
confirmCode.PlaceHolder = "Optional"
imei := widget.NewEntry()
imei.PlaceHolder = "The IMEI sent to SM-DP+. Optional"
smdp := &widget.Entry{PlaceHolder: "Leave it empty to use default SM-DP+"}
matchID := &widget.Entry{PlaceHolder: "Activation code. Optional"}
confirmCode := &widget.Entry{PlaceHolder: "Optional"}
imei := &widget.Entry{PlaceHolder: "The IMEI sent to SM-DP+. Optional"}

form := []*widget.FormItem{
{Text: "SM-DP+", Widget: smdp},
Expand All @@ -146,11 +142,12 @@ func InitDownloadDialog() dialog.Dialog {

d := dialog.NewForm("Download", "Submit", "Cancel", form, func(b bool) {
if b {
var pullConfig PullInfo
pullConfig.SMDP = smdp.Text
pullConfig.MatchID = matchID.Text
pullConfig.ConfirmCode = confirmCode.Text
pullConfig.IMEI = imei.Text
pullConfig := PullInfo{
SMDP: smdp.Text,
MatchID: matchID.Text,
ConfirmCode: confirmCode.Text,
IMEI: imei.Text,
}
LpacProfileDownload(pullConfig)
RefreshProfile()
RefreshNotification()
Expand All @@ -165,8 +162,7 @@ func InitDownloadDialog() dialog.Dialog {
}

func InitSetNicknameDialog() dialog.Dialog {
entry := widget.NewEntry()
entry.SetPlaceHolder("Leave it empty to remove nickname")
entry := &widget.Entry{PlaceHolder: "Leave it empty to remove nickname", TextStyle: fyne.TextStyle{Monospace: true}}
form := []*widget.FormItem{
{Text: "Nickname", Widget: entry},
}
Expand All @@ -186,8 +182,7 @@ func InitSetNicknameDialog() dialog.Dialog {
}

func InitSetDefaultSmdpDialog() dialog.Dialog {
entry := widget.NewEntry()
entry.SetPlaceHolder("Leave it empty to remove default SM-DP+ setting")
entry := &widget.Entry{PlaceHolder: "Leave it empty to remove default SM-DP+ setting"}
form := []*widget.FormItem{
{Text: "Default SM-DP+", Widget: entry},
}
Expand Down

0 comments on commit 00cc77a

Please sign in to comment.