From 3263bda23b8bccb9958471be064603d958f08253 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Mon, 26 Dec 2022 16:23:14 +0100 Subject: Improve game import in db --- src/gui.cpp | 50 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 20 deletions(-) (limited to 'src/gui.cpp') diff --git a/src/gui.cpp b/src/gui.cpp index 507eca0..b33583f 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -565,31 +565,38 @@ TabBase_TabImport::TabBase_TabImport( wxWindow* parent, wxWindowID id, const wxP wxBoxSizer* main_sizer; main_sizer = new wxBoxSizer( wxVERTICAL ); - from_game_label = new wxStaticText( this, wxID_ANY, wxT("From opened games"), wxDefaultPosition, wxDefaultSize, 0 ); + pending_imports = new wxStaticText( this, wxID_ANY, wxT("No pending imports"), wxDefaultPosition, wxDefaultSize, 0 ); + pending_imports->Wrap( -1 ); + pending_imports->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + main_sizer->Add( pending_imports, 0, wxALL|wxEXPAND, 5 ); + + m_staticline41 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + main_sizer->Add( m_staticline41, 0, wxEXPAND | wxALL, 5 ); + + wxBoxSizer* games_sizer; + games_sizer = new wxBoxSizer( wxHORIZONTAL ); + + from_game_label = new wxStaticText( this, wxID_ANY, wxT("Games:"), wxDefaultPosition, wxDefaultSize, 0 ); from_game_label->Wrap( -1 ); - main_sizer->Add( from_game_label, 0, wxALL, 5 ); + from_game_label->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - wxBoxSizer* top_sizer; - top_sizer = new wxBoxSizer( wxHORIZONTAL ); + games_sizer->Add( from_game_label, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); opened_game_list = new wxComboBox( this, wxID_ANY, wxT("No game opened"), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY ); - top_sizer->Add( opened_game_list, 100, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + games_sizer->Add( opened_game_list, 100, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - import_from_game_button = new wxButton( this, wxID_ANY, wxT("Import Game"), wxDefaultPosition, wxDefaultSize, 0 ); - top_sizer->Add( import_from_game_button, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + import_from_game_button = new wxButton( this, ID_IMPORT_GAME_BUTTON, wxT("Import Game"), wxDefaultPosition, wxDefaultSize, 0 ); + games_sizer->Add( import_from_game_button, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - main_sizer->Add( top_sizer, 1, wxALIGN_TOP|wxEXPAND, 5 ); + main_sizer->Add( games_sizer, 0, wxALIGN_TOP|wxEXPAND, 5 ); m_staticline4 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); main_sizer->Add( m_staticline4, 0, wxEXPAND | wxALL, 5 ); - from_db_label = new wxStaticText( this, wxID_ANY, wxT("From opened databases"), wxDefaultPosition, wxDefaultSize, 0 ); - from_db_label->Wrap( -1 ); - main_sizer->Add( from_db_label, 0, wxALL, 5 ); - - wxBoxSizer* bottom_sizer; - bottom_sizer = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* databases_sizer; + databases_sizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer* bSizer33; bSizer33 = new wxBoxSizer( wxHORIZONTAL ); @@ -605,18 +612,21 @@ TabBase_TabImport::TabBase_TabImport( wxWindow* parent, wxWindowID id, const wxP bSizer33->Add( load_button, 0, wxALL, 5 ); - bottom_sizer->Add( bSizer33, 1, wxEXPAND, 5 ); + databases_sizer->Add( bSizer33, 0, wxEXPAND, 5 ); - game_list = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_ICON|wxLC_REPORT ); + game_list = new wxListCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT ); game_list->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INACTIVECAPTIONTEXT ) ); - bottom_sizer->Add( game_list, 20, wxALL|wxEXPAND, 5 ); + databases_sizer->Add( game_list, 100, wxALL|wxEXPAND, 5 ); + + import_from_db_button = new wxButton( this, ID_IMPORT_SELECTION, wxT("Import Selection"), wxDefaultPosition, wxDefaultSize, 0 ); + databases_sizer->Add( import_from_db_button, 0, wxALL|wxEXPAND, 5 ); - import_from_db_button = new wxButton( this, wxID_ANY, wxT("Import Selection"), wxDefaultPosition, wxDefaultSize, 0 ); - bottom_sizer->Add( import_from_db_button, 0, wxALL|wxEXPAND, 5 ); + m_button16 = new wxButton( this, ID_IMPORT_DB, wxT("Import all games"), wxDefaultPosition, wxDefaultSize, 0 ); + databases_sizer->Add( m_button16, 0, wxALL|wxEXPAND, 5 ); - main_sizer->Add( bottom_sizer, 100, wxEXPAND, 5 ); + main_sizer->Add( databases_sizer, 80, wxEXPAND, 5 ); this->SetSizer( main_sizer ); -- cgit v1.2.3