qt_gui: Added feature to toggle (show/hide) game list view
"Show Game List" button originally didn't have any action assigned to it, so this PR is supposed to implement the change that would make sense to it (even though I don't think anyone would be using this too much.)
This commit is contained in:
parent
159be2c7f4
commit
ddec111da6
|
@ -162,6 +162,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) {
|
||||||
|
@ -406,6 +407,16 @@ 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);
|
||||||
|
|
|
@ -44,6 +44,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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue