From ca786607fe0e7f2df862c71d752361085e2dd14b Mon Sep 17 00:00:00 2001 From: "Marcel M. Otte" Date: Sat, 18 Mar 2023 23:07:14 +0100 Subject: [PATCH] Small progress... --- internal/ui/main.go | 6 +++++- internal/ui/newobjectdialog.go | 16 ++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/internal/ui/main.go b/internal/ui/main.go index 18a1fcc..a7a5b21 100644 --- a/internal/ui/main.go +++ b/internal/ui/main.go @@ -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 { diff --git a/internal/ui/newobjectdialog.go b/internal/ui/newobjectdialog.go index 09bcecb..f61f566 100644 --- a/internal/ui/newobjectdialog.go +++ b/internal/ui/newobjectdialog.go @@ -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