aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/MainWindow.cpp10
-rw-r--r--src/MainWindow.hpp1
-rw-r--r--src/base_tab/BaseImportTab.cpp2
-rw-r--r--src/base_tab/BaseImportTab.hpp1
-rw-r--r--src/base_tab/BaseTab.hpp1
-rw-r--r--src/gui.cpp6
-rw-r--r--src/gui.h1
-rw-r--r--src/ochess.hpp1
-rw-r--r--tools/wxFrameBuilder.fbp63
9 files changed, 83 insertions, 3 deletions
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp
index a0e2ce6..7e50150 100644
--- a/src/MainWindow.cpp
+++ b/src/MainWindow.cpp
@@ -53,6 +53,7 @@ MainWindow::MainWindow()
Bind(wxEVT_MENU, &MainWindow::OnMenuItemClick, this, wxID_ANY);
Bind(REFRESH_ENGINE_LIST, &MainWindow::OnRefreshEngineList, this, wxID_ANY);
Bind(CLOSE_LINKED_TAB, &MainWindow::OnCloseTabLinkedTo, this, wxID_ANY);
+ Bind(wxEVT_AUINOTEBOOK_PAGE_CLOSED, &MainWindow::OnAuiNotebookPageClosed, this, wxID_ANY);
// Add new game tab by default
NewGame(std::shared_ptr<Game>(new Game()));
@@ -66,10 +67,19 @@ void MainWindow::AddPage(wxWindow* window, TabInfos* infos){
window->SetClientData(infos);
notebook->AddPage(window, window->GetLabel());
notebook->SetSelection(notebook->GetPageIndex(window));
+ // Refresh tab that require knowledge on other tabs
+ for(auto i: wxGetApp().ListTabInfos()){i->Refresh();}
+}
+
+void MainWindow::OnAuiNotebookPageClosed(wxAuiNotebookEvent& event){
+ // Refresh tab that require knowledge on other tabs
+ for(auto i: wxGetApp().ListTabInfos()){i->Refresh();}
}
void MainWindow::OnCloseTabEvent(wxCommandEvent &event) {
notebook->DeletePage(notebook->GetSelection());
+ // Refresh tab that require knowledge on other tabs
+ for(auto i: wxGetApp().ListTabInfos()){i->Refresh();}
}
void MainWindow::OnCloseTabLinkedTo(wxCommandEvent &event){
diff --git a/src/MainWindow.hpp b/src/MainWindow.hpp
index 5bff035..866a98b 100644
--- a/src/MainWindow.hpp
+++ b/src/MainWindow.hpp
@@ -29,6 +29,7 @@ class MainWindow : public MainFrame {
void OnCloseTabEvent(wxCommandEvent &event);
void OnRefreshEngineList(wxCommandEvent &event);
void OnMenuItemClick(wxCommandEvent &event);
+ void OnAuiNotebookPageClosed(wxAuiNotebookEvent& event);
void OnCloseTabLinkedTo(wxCommandEvent &event);
void AddPage(wxWindow* window, TabInfos* infos);
public:
diff --git a/src/base_tab/BaseImportTab.cpp b/src/base_tab/BaseImportTab.cpp
index 4fa9045..8396847 100644
--- a/src/base_tab/BaseImportTab.cpp
+++ b/src/base_tab/BaseImportTab.cpp
@@ -7,6 +7,8 @@ RefreshImportLists();
}
void BaseImportTab::RefreshImportLists(){
+ opened_game_list->Clear();
+ opened_db_list->Clear();
for (TabInfos *i : wxGetApp().ListTabInfos()) {
if (i->type == TabInfos::GAME) {
wxWindow *win = dynamic_cast<wxWindow *>(i);
diff --git a/src/base_tab/BaseImportTab.hpp b/src/base_tab/BaseImportTab.hpp
index 2076027..7a0237e 100644
--- a/src/base_tab/BaseImportTab.hpp
+++ b/src/base_tab/BaseImportTab.hpp
@@ -1,7 +1,6 @@
#include "ochess.hpp"
class BaseImportTab : public TabBase_TabImport {
-
TabInfos *main_tab;
public:
diff --git a/src/base_tab/BaseTab.hpp b/src/base_tab/BaseTab.hpp
index 788ba45..da70af4 100644
--- a/src/base_tab/BaseTab.hpp
+++ b/src/base_tab/BaseTab.hpp
@@ -23,4 +23,5 @@ public:
void RefreshLabel();
std::shared_ptr<Game> GetGame() { return (std::shared_ptr<Game>(game)); }
std::shared_ptr<GameBase> GetBase() { return (std::shared_ptr<GameBase>(base)); };
+ void Refresh() {import_tab->RefreshImportLists();};
}; \ No newline at end of file
diff --git a/src/gui.cpp b/src/gui.cpp
index ae717a5..b122cb1 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -616,10 +616,14 @@ TabBase_TabImport::TabBase_TabImport( wxWindow* parent, wxWindowID id, const wxP
wxBoxSizer* bSizer33;
bSizer33 = new wxBoxSizer( wxHORIZONTAL );
+ m_staticText29 = new wxStaticText( this, wxID_ANY, wxT("Database:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText29->Wrap( -1 );
+ bSizer33->Add( m_staticText29, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
+
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 );
+ import_from_db_button = new wxButton( this, wxID_ANY, wxT("Import Selection"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer33->Add( import_from_db_button, 0, wxALL, 5 );
diff --git a/src/gui.h b/src/gui.h
index 347cd89..ddf67e3 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -342,6 +342,7 @@ class TabBase_TabImport : public wxPanel
wxButton* import_from_game_button;
wxStaticLine* m_staticline4;
wxStaticText* from_db_label;
+ wxStaticText* m_staticText29;
wxComboBox* opened_db_list;
wxButton* import_from_db_button;
wxListCtrl* game_list;
diff --git a/src/ochess.hpp b/src/ochess.hpp
index 9b3bd3e..da9107b 100644
--- a/src/ochess.hpp
+++ b/src/ochess.hpp
@@ -52,6 +52,7 @@ public:
bool is_linked;
TabInfos(Type type_) : type(type_), id(tab_count), is_linked(false) { tab_count++; wxLogDebug("Tabid=%d",(int)id); }
void Link(TabInfos *tab);
+ virtual void Refresh(){};
virtual void ApplyPreferences() = 0;
virtual std::shared_ptr<Game> GetGame() = 0;
virtual std::shared_ptr<GameBase> GetBase() = 0;
diff --git a/tools/wxFrameBuilder.fbp b/tools/wxFrameBuilder.fbp
index 2e67c94..2a654ce 100644
--- a/tools/wxFrameBuilder.fbp
+++ b/tools/wxFrameBuilder.fbp
@@ -6246,6 +6246,67 @@
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
+ <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
+ <property name="proportion">0</property>
+ <object class="wxStaticText" expanded="1">
+ <property name="BottomDockable">1</property>
+ <property name="LeftDockable">1</property>
+ <property name="RightDockable">1</property>
+ <property name="TopDockable">1</property>
+ <property name="aui_layer"></property>
+ <property name="aui_name"></property>
+ <property name="aui_position"></property>
+ <property name="aui_row"></property>
+ <property name="best_size"></property>
+ <property name="bg"></property>
+ <property name="caption"></property>
+ <property name="caption_visible">1</property>
+ <property name="center_pane">0</property>
+ <property name="close_button">1</property>
+ <property name="context_help"></property>
+ <property name="context_menu">1</property>
+ <property name="default_pane">0</property>
+ <property name="dock">Dock</property>
+ <property name="dock_fixed">0</property>
+ <property name="docking">Left</property>
+ <property name="enabled">1</property>
+ <property name="fg"></property>
+ <property name="floatable">1</property>
+ <property name="font"></property>
+ <property name="gripper">0</property>
+ <property name="hidden">0</property>
+ <property name="id">wxID_ANY</property>
+ <property name="label">Database:</property>
+ <property name="markup">0</property>
+ <property name="max_size"></property>
+ <property name="maximize_button">0</property>
+ <property name="maximum_size"></property>
+ <property name="min_size"></property>
+ <property name="minimize_button">0</property>
+ <property name="minimum_size"></property>
+ <property name="moveable">1</property>
+ <property name="name">m_staticText29</property>
+ <property name="pane_border">1</property>
+ <property name="pane_position"></property>
+ <property name="pane_size"></property>
+ <property name="permission">protected</property>
+ <property name="pin_button">1</property>
+ <property name="pos"></property>
+ <property name="resize">Resizable</property>
+ <property name="show">1</property>
+ <property name="size"></property>
+ <property name="style"></property>
+ <property name="subclass">; ; forward_declare</property>
+ <property name="toolbar_pane">0</property>
+ <property name="tooltip"></property>
+ <property name="window_extra_style"></property>
+ <property name="window_name"></property>
+ <property name="window_style"></property>
+ <property name="wrap">-1</property>
+ </object>
+ </object>
+ <object class="sizeritem" expanded="1">
+ <property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">100</property>
<object class="wxComboBox" expanded="1">
@@ -6347,7 +6408,7 @@
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
- <property name="label">Import Selected Games</property>
+ <property name="label">Import Selection</property>
<property name="margins"></property>
<property name="markup">0</property>
<property name="max_size"></property>