mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2025-12-15 06:28:18 +08:00
temporary disable 2.5.0 entry redo/undo
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package component
|
package component
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"AynaLivePlayer/gui/xfyne"
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
)
|
)
|
||||||
@@ -14,6 +15,7 @@ type Entry struct {
|
|||||||
func NewEntry() *Entry {
|
func NewEntry() *Entry {
|
||||||
e := &Entry{}
|
e := &Entry{}
|
||||||
e.ExtendBaseWidget(e)
|
e.ExtendBaseWidget(e)
|
||||||
|
xfyne.EntryDisableUndoRedo(&e.Entry)
|
||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"AynaLivePlayer/core/events"
|
"AynaLivePlayer/core/events"
|
||||||
"AynaLivePlayer/core/model"
|
"AynaLivePlayer/core/model"
|
||||||
"AynaLivePlayer/global"
|
"AynaLivePlayer/global"
|
||||||
|
"AynaLivePlayer/gui/xfyne"
|
||||||
"AynaLivePlayer/pkg/event"
|
"AynaLivePlayer/pkg/event"
|
||||||
"AynaLivePlayer/pkg/i18n"
|
"AynaLivePlayer/pkg/i18n"
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
@@ -57,8 +58,8 @@ func createRoomSelector() fyne.CanvasObject {
|
|||||||
descriptionLabel.SetText("")
|
descriptionLabel.SetText("")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
idEntry := widget.NewEntry()
|
idEntry := xfyne.EntryDisableUndoRedo(widget.NewEntry())
|
||||||
nameEntry := widget.NewEntry()
|
nameEntry := xfyne.EntryDisableUndoRedo(widget.NewEntry())
|
||||||
dia := dialog.NewCustomConfirm(
|
dia := dialog.NewCustomConfirm(
|
||||||
i18n.T("gui.room.add.title"),
|
i18n.T("gui.room.add.title"),
|
||||||
i18n.T("gui.room.add.confirm"),
|
i18n.T("gui.room.add.confirm"),
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"AynaLivePlayer/core/events"
|
"AynaLivePlayer/core/events"
|
||||||
"AynaLivePlayer/core/model"
|
"AynaLivePlayer/core/model"
|
||||||
"AynaLivePlayer/global"
|
"AynaLivePlayer/global"
|
||||||
|
"AynaLivePlayer/gui/xfyne"
|
||||||
"AynaLivePlayer/pkg/event"
|
"AynaLivePlayer/pkg/event"
|
||||||
"AynaLivePlayer/pkg/i18n"
|
"AynaLivePlayer/pkg/i18n"
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -44,7 +45,7 @@ func createPlaylists() fyne.CanvasObject {
|
|||||||
})
|
})
|
||||||
PlaylistManager.AddBtn = widget.NewButton(i18n.T("gui.playlist.button.add"), func() {
|
PlaylistManager.AddBtn = widget.NewButton(i18n.T("gui.playlist.button.add"), func() {
|
||||||
providerEntry := widget.NewSelect(PlaylistManager.providers, nil)
|
providerEntry := widget.NewSelect(PlaylistManager.providers, nil)
|
||||||
idEntry := widget.NewEntry()
|
idEntry := xfyne.EntryDisableUndoRedo(widget.NewEntry())
|
||||||
dia := dialog.NewCustomConfirm(
|
dia := dialog.NewCustomConfirm(
|
||||||
i18n.T("gui.playlist.add.title"),
|
i18n.T("gui.playlist.add.title"),
|
||||||
i18n.T("gui.playlist.add.confirm"),
|
i18n.T("gui.playlist.add.confirm"),
|
||||||
|
|||||||
14
gui/xfyne/patch.go
Normal file
14
gui/xfyne/patch.go
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
package xfyne
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fyne.io/fyne/v2"
|
||||||
|
"fyne.io/fyne/v2/widget"
|
||||||
|
"reflect"
|
||||||
|
)
|
||||||
|
|
||||||
|
func EntryDisableUndoRedo(entry *widget.Entry) *widget.Entry {
|
||||||
|
val := reflect.ValueOf(entry).Elem().FieldByName("shortcut").Addr().UnsafePointer()
|
||||||
|
(*fyne.ShortcutHandler)(val).RemoveShortcut(&fyne.ShortcutRedo{})
|
||||||
|
(*fyne.ShortcutHandler)(val).RemoveShortcut(&fyne.ShortcutUndo{})
|
||||||
|
return entry
|
||||||
|
}
|
||||||
11
gui/xfyne/patch_test.go
Normal file
11
gui/xfyne/patch_test.go
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
package xfyne
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fyne.io/fyne/v2/widget"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestEntryDisableUndoRedo(t *testing.T) {
|
||||||
|
entry := widget.NewEntry()
|
||||||
|
EntryDisableUndoRedo(entry)
|
||||||
|
}
|
||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
ProgramName = "卡西米尔唱片机"
|
ProgramName = "卡西米尔唱片机"
|
||||||
Version uint32 = 0x010008
|
Version uint32 = 0x010009
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package diange
|
package diange
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"AynaLivePlayer/gui/xfyne"
|
||||||
"AynaLivePlayer/pkg/i18n"
|
"AynaLivePlayer/pkg/i18n"
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
@@ -30,7 +31,7 @@ func (b *blacklist) CreatePanel() fyne.CanvasObject {
|
|||||||
return b.panel
|
return b.panel
|
||||||
}
|
}
|
||||||
// UI组件
|
// UI组件
|
||||||
input := widget.NewEntry()
|
input := xfyne.EntryDisableUndoRedo(widget.NewEntry())
|
||||||
input.SetPlaceHolder(i18n.T("plugin.diange.blacklist.input.placeholder"))
|
input.SetPlaceHolder(i18n.T("plugin.diange.blacklist.input.placeholder"))
|
||||||
|
|
||||||
exactText := i18n.T("plugin.diange.blacklist.option.exact")
|
exactText := i18n.T("plugin.diange.blacklist.option.exact")
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"AynaLivePlayer/global"
|
"AynaLivePlayer/global"
|
||||||
"AynaLivePlayer/gui"
|
"AynaLivePlayer/gui"
|
||||||
"AynaLivePlayer/gui/component"
|
"AynaLivePlayer/gui/component"
|
||||||
|
"AynaLivePlayer/gui/xfyne"
|
||||||
"AynaLivePlayer/pkg/config"
|
"AynaLivePlayer/pkg/config"
|
||||||
"AynaLivePlayer/pkg/event"
|
"AynaLivePlayer/pkg/event"
|
||||||
"AynaLivePlayer/pkg/i18n"
|
"AynaLivePlayer/pkg/i18n"
|
||||||
@@ -345,27 +346,27 @@ func (d *Diange) CreatePanel() fyne.CanvasObject {
|
|||||||
container.NewGridWithColumns(2,
|
container.NewGridWithColumns(2,
|
||||||
container.NewBorder(nil, nil,
|
container.NewBorder(nil, nil,
|
||||||
widget.NewLabel(i18n.T("plugin.diange.medal.name")), nil,
|
widget.NewLabel(i18n.T("plugin.diange.medal.name")), nil,
|
||||||
widget.NewEntryWithData(binding.BindString(&d.MedalName))),
|
xfyne.EntryDisableUndoRedo(widget.NewEntryWithData(binding.BindString(&d.MedalName)))),
|
||||||
container.NewBorder(nil, nil,
|
container.NewBorder(nil, nil,
|
||||||
widget.NewLabel(i18n.T("plugin.diange.medal.level")), nil,
|
widget.NewLabel(i18n.T("plugin.diange.medal.level")), nil,
|
||||||
widget.NewEntryWithData(binding.IntToString(binding.BindInt(&d.MedalPermission)))),
|
xfyne.EntryDisableUndoRedo(widget.NewEntryWithData(binding.IntToString(binding.BindInt(&d.MedalPermission))))),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
dgQueue := container.NewBorder(nil, nil,
|
dgQueue := container.NewBorder(nil, nil,
|
||||||
widget.NewLabel(i18n.T("plugin.diange.queue_max")), nil,
|
widget.NewLabel(i18n.T("plugin.diange.queue_max")), nil,
|
||||||
widget.NewEntryWithData(binding.IntToString(binding.BindInt(&d.QueueMax))),
|
xfyne.EntryDisableUndoRedo(widget.NewEntryWithData(binding.IntToString(binding.BindInt(&d.QueueMax)))),
|
||||||
)
|
)
|
||||||
dgUserMax := container.NewBorder(nil, nil,
|
dgUserMax := container.NewBorder(nil, nil,
|
||||||
widget.NewLabel(i18n.T("plugin.diange.user_max")), nil,
|
widget.NewLabel(i18n.T("plugin.diange.user_max")), nil,
|
||||||
widget.NewEntryWithData(binding.IntToString(binding.BindInt(&d.UserMax))),
|
xfyne.EntryDisableUndoRedo(widget.NewEntryWithData(binding.IntToString(binding.BindInt(&d.UserMax)))),
|
||||||
)
|
)
|
||||||
dgCoolDown := container.NewBorder(nil, nil,
|
dgCoolDown := container.NewBorder(nil, nil,
|
||||||
widget.NewLabel(i18n.T("plugin.diange.cooldown")), nil,
|
widget.NewLabel(i18n.T("plugin.diange.cooldown")), nil,
|
||||||
widget.NewEntryWithData(binding.IntToString(binding.BindInt(&d.UserCoolDown))),
|
xfyne.EntryDisableUndoRedo(widget.NewEntryWithData(binding.IntToString(binding.BindInt(&d.UserCoolDown)))),
|
||||||
)
|
)
|
||||||
dgShortCut := container.NewBorder(nil, nil,
|
dgShortCut := container.NewBorder(nil, nil,
|
||||||
widget.NewLabel(i18n.T("plugin.diange.custom_cmd")), nil,
|
widget.NewLabel(i18n.T("plugin.diange.custom_cmd")), nil,
|
||||||
widget.NewEntryWithData(binding.BindString(&d.CustomCMD)),
|
xfyne.EntryDisableUndoRedo(widget.NewEntryWithData(binding.BindString(&d.CustomCMD))),
|
||||||
)
|
)
|
||||||
skipPlaylistCheck := widget.NewCheckWithData(i18n.T("plugin.diange.skip_playlist.prompt"), binding.BindBool(&d.SkipSystemPlaylist))
|
skipPlaylistCheck := widget.NewCheckWithData(i18n.T("plugin.diange.skip_playlist.prompt"), binding.BindBool(&d.SkipSystemPlaylist))
|
||||||
skipPlaylist := container.NewHBox(
|
skipPlaylist := container.NewHBox(
|
||||||
@@ -379,9 +380,9 @@ func (d *Diange) CreatePanel() fyne.CanvasObject {
|
|||||||
widget.NewLabel(source),
|
widget.NewLabel(source),
|
||||||
widget.NewCheckWithData(i18n.T("plugin.diange.source.enable"), binding.BindBool(&cfg.Enable)),
|
widget.NewCheckWithData(i18n.T("plugin.diange.source.enable"), binding.BindBool(&cfg.Enable)),
|
||||||
widget.NewLabel(i18n.T("plugin.diange.source.priority")),
|
widget.NewLabel(i18n.T("plugin.diange.source.priority")),
|
||||||
widget.NewEntryWithData(binding.IntToString(binding.BindInt(&cfg.Priority))),
|
xfyne.EntryDisableUndoRedo(widget.NewEntryWithData(binding.IntToString(binding.BindInt(&cfg.Priority)))),
|
||||||
widget.NewLabel(i18n.T("plugin.diange.source.command")),
|
widget.NewLabel(i18n.T("plugin.diange.source.command")),
|
||||||
widget.NewEntryWithData(binding.BindString(&cfg.Command)),
|
xfyne.EntryDisableUndoRedo(widget.NewEntryWithData(binding.BindString(&cfg.Command))),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import (
|
|||||||
"AynaLivePlayer/core/events"
|
"AynaLivePlayer/core/events"
|
||||||
"AynaLivePlayer/global"
|
"AynaLivePlayer/global"
|
||||||
"AynaLivePlayer/gui"
|
"AynaLivePlayer/gui"
|
||||||
|
"AynaLivePlayer/gui/xfyne"
|
||||||
"AynaLivePlayer/pkg/config"
|
"AynaLivePlayer/pkg/config"
|
||||||
"AynaLivePlayer/pkg/event"
|
"AynaLivePlayer/pkg/event"
|
||||||
"AynaLivePlayer/pkg/i18n"
|
"AynaLivePlayer/pkg/i18n"
|
||||||
@@ -90,7 +91,7 @@ func (d *MaxDuration) CreatePanel() fyne.CanvasObject {
|
|||||||
if d.panel != nil {
|
if d.panel != nil {
|
||||||
return d.panel
|
return d.panel
|
||||||
}
|
}
|
||||||
maxDurationInput := widget.NewEntryWithData(binding.IntToString(binding.BindInt(&d.MaxDuration)))
|
maxDurationInput := xfyne.EntryDisableUndoRedo(widget.NewEntryWithData(binding.IntToString(binding.BindInt(&d.MaxDuration))))
|
||||||
skipOnPlayCheckbox := widget.NewCheckWithData(i18n.T("plugin.maxduration.enable"), binding.BindBool(&d.SkipOnPlay))
|
skipOnPlayCheckbox := widget.NewCheckWithData(i18n.T("plugin.maxduration.enable"), binding.BindBool(&d.SkipOnPlay))
|
||||||
skipOnReachCheckbox := widget.NewCheckWithData(i18n.T("plugin.maxduration.enable"), binding.BindBool(&d.SkipOnReach))
|
skipOnReachCheckbox := widget.NewCheckWithData(i18n.T("plugin.maxduration.enable"), binding.BindBool(&d.SkipOnReach))
|
||||||
d.panel = container.New(
|
d.panel = container.New(
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
"AynaLivePlayer/global"
|
"AynaLivePlayer/global"
|
||||||
"AynaLivePlayer/gui"
|
"AynaLivePlayer/gui"
|
||||||
"AynaLivePlayer/gui/component"
|
"AynaLivePlayer/gui/component"
|
||||||
|
"AynaLivePlayer/gui/xfyne"
|
||||||
"AynaLivePlayer/pkg/config"
|
"AynaLivePlayer/pkg/config"
|
||||||
"AynaLivePlayer/pkg/event"
|
"AynaLivePlayer/pkg/event"
|
||||||
"AynaLivePlayer/pkg/i18n"
|
"AynaLivePlayer/pkg/i18n"
|
||||||
@@ -120,7 +121,7 @@ func (d *Qiege) CreatePanel() fyne.CanvasObject {
|
|||||||
)
|
)
|
||||||
qgShortCut := container.NewBorder(nil, nil,
|
qgShortCut := container.NewBorder(nil, nil,
|
||||||
widget.NewLabel(i18n.T("plugin.qiege.custom_cmd")), nil,
|
widget.NewLabel(i18n.T("plugin.qiege.custom_cmd")), nil,
|
||||||
widget.NewEntryWithData(binding.BindString(&d.CustomCMD)),
|
xfyne.EntryDisableUndoRedo(widget.NewEntryWithData(binding.BindString(&d.CustomCMD))),
|
||||||
)
|
)
|
||||||
d.panel = container.NewVBox(dgPerm, qgShortCut)
|
d.panel = container.NewVBox(dgPerm, qgShortCut)
|
||||||
return d.panel
|
return d.panel
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import (
|
|||||||
"AynaLivePlayer/core/model"
|
"AynaLivePlayer/core/model"
|
||||||
"AynaLivePlayer/gui"
|
"AynaLivePlayer/gui"
|
||||||
"AynaLivePlayer/gui/component"
|
"AynaLivePlayer/gui/component"
|
||||||
|
"AynaLivePlayer/gui/xfyne"
|
||||||
"AynaLivePlayer/pkg/config"
|
"AynaLivePlayer/pkg/config"
|
||||||
"AynaLivePlayer/pkg/event"
|
"AynaLivePlayer/pkg/event"
|
||||||
"AynaLivePlayer/pkg/i18n"
|
"AynaLivePlayer/pkg/i18n"
|
||||||
@@ -183,7 +184,7 @@ func (w *WebInfo) CreatePanel() fyne.CanvasObject {
|
|||||||
statusText.SetText(w.getServerStatusText())
|
statusText.SetText(w.getServerStatusText())
|
||||||
serverPort := container.NewBorder(nil, nil,
|
serverPort := container.NewBorder(nil, nil,
|
||||||
widget.NewLabel(i18n.T("plugin.webinfo.port")), nil,
|
widget.NewLabel(i18n.T("plugin.webinfo.port")), nil,
|
||||||
widget.NewEntryWithData(binding.IntToString(binding.BindInt(&w.Port))),
|
xfyne.EntryDisableUndoRedo(widget.NewEntryWithData(binding.IntToString(binding.BindInt(&w.Port)))),
|
||||||
)
|
)
|
||||||
serverUrl := widget.NewHyperlink(w.getServerUrl(), util.UrlMustParse(w.getServerUrl()))
|
serverUrl := widget.NewHyperlink(w.getServerUrl(), util.UrlMustParse(w.getServerUrl()))
|
||||||
serverPreview := container.NewHBox(
|
serverPreview := container.NewHBox(
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
"AynaLivePlayer/global"
|
"AynaLivePlayer/global"
|
||||||
"AynaLivePlayer/gui"
|
"AynaLivePlayer/gui"
|
||||||
"AynaLivePlayer/gui/component"
|
"AynaLivePlayer/gui/component"
|
||||||
|
"AynaLivePlayer/gui/xfyne"
|
||||||
"AynaLivePlayer/pkg/config"
|
"AynaLivePlayer/pkg/config"
|
||||||
"AynaLivePlayer/pkg/event"
|
"AynaLivePlayer/pkg/event"
|
||||||
"AynaLivePlayer/pkg/i18n"
|
"AynaLivePlayer/pkg/i18n"
|
||||||
@@ -97,9 +98,9 @@ func (w *WsHub) CreatePanel() fyne.CanvasObject {
|
|||||||
freshStatusText()
|
freshStatusText()
|
||||||
serverPort := container.NewBorder(nil, nil,
|
serverPort := container.NewBorder(nil, nil,
|
||||||
widget.NewLabel(i18n.T("plugin.wshub.port")), nil,
|
widget.NewLabel(i18n.T("plugin.wshub.port")), nil,
|
||||||
widget.NewEntryWithData(binding.IntToString(binding.BindInt(&w.Port))),
|
xfyne.EntryDisableUndoRedo(widget.NewEntryWithData(binding.IntToString(binding.BindInt(&w.Port)))),
|
||||||
)
|
)
|
||||||
serverUrl := widget.NewEntry()
|
serverUrl := xfyne.EntryDisableUndoRedo(widget.NewEntry())
|
||||||
serverUrl.SetText(w.server.getWsUrl())
|
serverUrl.SetText(w.server.getWsUrl())
|
||||||
serverUrl.Disable()
|
serverUrl.Disable()
|
||||||
serverPreview := container.NewBorder(nil, nil,
|
serverPreview := container.NewBorder(nil, nil,
|
||||||
|
|||||||
Reference in New Issue
Block a user