diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2023-02-01 12:00:24 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2023-02-01 12:00:24 +0100 |
| commit | e0babeaf88b2a434b10ffb65824440b1adfaa151 (patch) | |
| tree | 7ec40bc44f1c9ed72f6f455c28dd58a5d373a370 /src/MainWindow.cpp | |
| parent | d9818df8791730130adc5349e863b35de0e1c351 (diff) | |
Improve management of engines tabs
Diffstat (limited to 'src/MainWindow.cpp')
| -rw-r--r-- | src/MainWindow.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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); } } |
