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