diff --git a/src/app.zig b/src/app.zig index b984ebc..23ac0a1 100644 --- a/src/app.zig +++ b/src/app.zig @@ -913,7 +913,30 @@ fn showAddFromDeviceWindow(self: *App) !void { } } - try self.showChannelInfoPanel(hot_channel); + { + const left_panel = self.ui.newBox(UI.Key.initNil()); + left_panel.layout_axis = .Y; + left_panel.size.y = UI.Size.percent(1, 0); + left_panel.size.x = UI.Size.percent(1, 0); + self.ui.pushParent(left_panel); + defer self.ui.popParent(); + + try self.showChannelInfoPanel(hot_channel); + + const add_button = self.ui.button(.text, "Add"); + if (self.ui.signalFromBox(add_button).clicked()) { + for (self.selected_channels.constSlice()) |channel_name| { + try self.appendChannelFromDevice(channel_name); + } + + self.shown_window = .channels; + for (self.selected_channels.constSlice()) |channel| { + self.allocator.free(channel); + } + self.selected_channels.len = 0; + + } + } if (hot_channel != null) { self.last_hot_channel = hot_channel;