aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoic Guegan <manzerbredes@mailbox.org>2022-12-25 14:32:06 +0100
committerLoic Guegan <manzerbredes@mailbox.org>2022-12-25 14:32:06 +0100
commit05ffd7c9e52d55dd5f7e155e233dfb147ceed485 (patch)
tree82fdf456ce0eb9c0e5bcb1902d51f3ac18a0097e
parent11a46aadf7c80d6b67af0c1094c8c5c4222bd3b1 (diff)
Update import
-rw-r--r--src/base_tab/BaseImportTab.cpp15
-rw-r--r--src/base_tab/BaseImportTab.hpp4
-rw-r--r--src/base_tab/BaseTab.cpp2
-rw-r--r--src/gui.cpp2
-rw-r--r--tools/wxFrameBuilder.fbp2
5 files changed, 18 insertions, 7 deletions
diff --git a/src/base_tab/BaseImportTab.cpp b/src/base_tab/BaseImportTab.cpp
index cd0d980..4fa9045 100644
--- a/src/base_tab/BaseImportTab.cpp
+++ b/src/base_tab/BaseImportTab.cpp
@@ -1,13 +1,22 @@
#include "BaseImportTab.hpp"
-BaseImportTab::BaseImportTab(wxFrame *parent):
-TabBase_TabImport(parent)
+BaseImportTab::BaseImportTab(wxFrame *parent, TabInfos *main_tab):
+TabBase_TabImport(parent), main_tab(main_tab)
{
+RefreshImportLists();
+}
+
+void BaseImportTab::RefreshImportLists(){
for (TabInfos *i : wxGetApp().ListTabInfos()) {
- if (i->type == TabInfos::GAME || i->type == TabInfos::BASE) {
+ if (i->type == TabInfos::GAME) {
wxWindow *win = dynamic_cast<wxWindow *>(i);
opened_game_list->Append(win->GetLabel(),i);
opened_game_list->SetSelection(0);
}
+ else if (i->type == TabInfos::BASE && i->id != main_tab->id) {
+ wxWindow *win = dynamic_cast<wxWindow *>(i);
+ opened_db_list->Append(win->GetLabel(),i);
+ opened_db_list->SetSelection(0);
+ }
}
}
diff --git a/src/base_tab/BaseImportTab.hpp b/src/base_tab/BaseImportTab.hpp
index 3d15e51..2076027 100644
--- a/src/base_tab/BaseImportTab.hpp
+++ b/src/base_tab/BaseImportTab.hpp
@@ -2,7 +2,9 @@
class BaseImportTab : public TabBase_TabImport {
+ TabInfos *main_tab;
public:
- BaseImportTab(wxFrame *parent);
+ BaseImportTab(wxFrame *parent, TabInfos *main_tab);
+ void RefreshImportLists();
}; \ No newline at end of file
diff --git a/src/base_tab/BaseTab.cpp b/src/base_tab/BaseTab.cpp
index 06774b4..78b546e 100644
--- a/src/base_tab/BaseTab.cpp
+++ b/src/base_tab/BaseTab.cpp
@@ -9,7 +9,7 @@ BaseTab::BaseTab(wxFrame *parent, std::string base_file)
games_tab=new BaseGameTab((wxFrame *)notebook,base_file,this);
notebook->AddPage(games_tab, "Games list",true); // true for selecting the tab
// Import tab
- import_tab=new BaseImportTab((wxFrame *)notebook);
+ import_tab=new BaseImportTab((wxFrame *)notebook,this);
notebook->AddPage(import_tab, "Import games");
// Manage tab
manage_tab=new BaseManageTab((wxFrame *)notebook);
diff --git a/src/gui.cpp b/src/gui.cpp
index f022fc8..765439f 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -603,7 +603,7 @@ TabBase_TabImport::TabBase_TabImport( wxWindow* parent, wxWindowID id, const wxP
wxBoxSizer* bSizer33;
bSizer33 = new wxBoxSizer( wxHORIZONTAL );
- opened_db_list = new wxComboBox( this, wxID_ANY, wxT("No database opened"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
+ opened_db_list = new wxComboBox( this, wxID_ANY, wxT("No other databases opened"), wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
bSizer33->Add( opened_db_list, 100, wxALL|wxEXPAND, 5 );
import_from_db_button = new wxButton( this, wxID_ANY, wxT("Import Selected Games"), wxDefaultPosition, wxDefaultSize, 0 );
diff --git a/tools/wxFrameBuilder.fbp b/tools/wxFrameBuilder.fbp
index 78addc4..5d49497 100644
--- a/tools/wxFrameBuilder.fbp
+++ b/tools/wxFrameBuilder.fbp
@@ -6104,7 +6104,7 @@
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
- <property name="value">No database opened</property>
+ <property name="value">No other databases opened</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>