Small progress...

This commit is contained in:
Marcel M. Otte 2023-03-18 23:07:14 +01:00
parent 724f2c87c6
commit ca786607fe
2 changed files with 17 additions and 5 deletions

View File

@ -90,7 +90,7 @@ func (ppf *ppfApp) OpenFile(path string) {
ppf.Workarea.Append(container.NewTabItem(pfh.Filename, pfh.GetWorkarea()))
}
func (ppf *ppfApp) NewFile() {
func (ppf *ppfApp) NewProtocolFile() {
//TODO: show entry screen with choosable ways of:
// PROTOCOL editor
// create a new protocol
@ -103,6 +103,10 @@ func (ppf *ppfApp) NewFile() {
ppf.Workarea.Append(container.NewTabItem(pfh.Filename, pfh.GetWorkarea()))
}
func (ppf *ppfApp) NewPacketFile() {
}
func (ppf *ppfApp) SaveFile(path string) {
item := ppf.Workarea.Selected()
for _, pfh := range ppf.OpenProtocolFiles {

View File

@ -25,16 +25,18 @@ func CreateNewObjectDialog() *NewObjectDialog {
// grid layout 100x100px elements in a center layout, 4 buttons, new Protocol, edit protocol, new Packet, edit Packet
buttons := []widget.Button{}
buttons = append(buttons, *widget.NewButton("New protocol", func() {
PPF.NewProtocolFile()
}))
buttons = append(buttons, *widget.NewButton("Edit protocol", func() {
pnod.representation.RemoveAll()
pnod.representation.Add(pnod.protocolChooser)
}))
buttons = append(buttons, *widget.NewButton("New packet", func() {
PPF.NewPacketFile()
}))
buttons = append(buttons, *widget.NewButton("Edit packet", func() {
pnod.representation.RemoveAll()
pnod.representation.Add(pnod.packetChooser)
}))
selectgrid := container.NewGridWithColumns(2, nil)
for _, v := range buttons {
@ -43,6 +45,12 @@ func CreateNewObjectDialog() *NewObjectDialog {
pnod.selection = container.NewMax(selectgrid)
pnod.representation.Add(pnod.selection)
// precreate the choosers
/* protocol chooser
Accordeon for
- Improve existing protocols (Account required)
- Open saved protocols
*/
// data
}
return pnod