From e0babeaf88b2a434b10ffb65824440b1adfaa151 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Wed, 1 Feb 2023 12:00:24 +0100 Subject: Improve management of engines tabs --- src/MainWindow.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/MainWindow.cpp') diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 27eda12..3a67975 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -120,9 +120,18 @@ void MainWindow::OnMenuItemClick(wxCommandEvent &event) { wxMenuItemList items = manageMenu->GetMenuItems(); for (wxMenuItem *item : items) { if (item->GetId() == id) { + std::uint32_t engine_id=item->GetId()-100; + // Check if not already opened + for(auto i: wxGetApp().ListTabInfos()){ + if(i->type==TabInfos::ENGINE && i->GetEngineId()==engine_id){ + wxGetApp().FocusOnTab(i); + return; + } + } + // Open engine configuration tag: wxLogDebug("Selected %s", item->GetItemLabel()); EngineTab *et = new EngineTab((wxWindow *)notebook, - item->GetId()-100); + engine_id); AddPage(et,et); } } -- cgit v1.2.3