Merge pull request #375 from notgonnaleo/main

qt_gui: Added feature to toggle (show/hide) game list view
This commit is contained in:
georgemoralis 2024-08-20 11:47:00 +03:00 committed by GitHub
commit 95c89ca6a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View File

@ -179,6 +179,7 @@ void MainWindow::CreateConnects() {
connect(ui->mw_searchbar, &QLineEdit::textChanged, this, &MainWindow::SearchGameTable); connect(ui->mw_searchbar, &QLineEdit::textChanged, this, &MainWindow::SearchGameTable);
connect(ui->exitAct, &QAction::triggered, this, &QWidget::close); connect(ui->exitAct, &QAction::triggered, this, &QWidget::close);
connect(ui->refreshGameListAct, &QAction::triggered, this, &MainWindow::RefreshGameTable); connect(ui->refreshGameListAct, &QAction::triggered, this, &MainWindow::RefreshGameTable);
connect(ui->showGameListAct, &QAction::triggered, this, &MainWindow::ShowGameList);
connect(this, &MainWindow::ExtractionFinished, this, &MainWindow::RefreshGameTable); connect(this, &MainWindow::ExtractionFinished, this, &MainWindow::RefreshGameTable);
connect(ui->sizeSlider, &QSlider::valueChanged, this, [this](int value) { connect(ui->sizeSlider, &QSlider::valueChanged, this, [this](int value) {
@ -445,6 +446,15 @@ void MainWindow::SearchGameTable(const QString& text) {
} }
} }
void MainWindow::ShowGameList() {
if (ui->showGameListAct->isChecked()) {
RefreshGameTable();
} else {
m_game_grid_frame->clearContents();
m_game_list_frame->clearContents();
}
};
void MainWindow::RefreshGameTable() { void MainWindow::RefreshGameTable() {
// m_game_info->m_games.clear(); // m_game_info->m_games.clear();
m_game_info->GetGameInfo(this); m_game_info->GetGameInfo(this);

View File

@ -45,6 +45,7 @@ private Q_SLOTS:
void ConfigureGuiFromSettings(); void ConfigureGuiFromSettings();
void SaveWindowState() const; void SaveWindowState() const;
void SearchGameTable(const QString& text); void SearchGameTable(const QString& text);
void ShowGameList();
void RefreshGameTable(); void RefreshGameTable();
void HandleResize(QResizeEvent* event); void HandleResize(QResizeEvent* event);