diff --git a/internal/ui/newobjectdialog.go b/internal/ui/newobjectdialog.go index f61f566..bd4104c 100644 --- a/internal/ui/newobjectdialog.go +++ b/internal/ui/newobjectdialog.go @@ -10,7 +10,7 @@ type NewObjectDialog struct { representation *fyne.Container // views selection *fyne.Container // 4buttons grid - protocolChooser *fyne.Container + protocolChooser *container.AppTabs packetChooser *fyne.Container } @@ -27,14 +27,14 @@ func CreateNewObjectDialog() *NewObjectDialog { buttons = append(buttons, *widget.NewButton("New protocol", func() { PPF.NewProtocolFile() })) - buttons = append(buttons, *widget.NewButton("Edit protocol", func() { + buttons = append(buttons, *widget.NewButton("Open/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() { + buttons = append(buttons, *widget.NewButton("Open/Edit packet", func() { pnod.representation.RemoveAll() pnod.representation.Add(pnod.packetChooser) })) @@ -44,13 +44,18 @@ 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 - */ + pnod.representation.Add(pnod.selection) // add selection per default + // generate protocol chooser view + // App Tabs or vertical Accordion (doesnt exist yet) + pnod.protocolChooser = container.NewAppTabs(nil) + // first tab -> official protocol repo, for viewing and editing/improvement + // file chooser embedded + // second tab -> own protocols, in a folder somewhere. + // file chooser embedded + + // generate packet chooser view + // Just a file chooser embedded. + // data } return pnod