GameList: Auto set cache/database path from user directory
This commit is contained in:
@@ -188,7 +188,6 @@ GameListSettingsWidget::GameListSettingsWidget(QtHostInterface* host_interface,
|
||||
m_ui.setupUi(this);
|
||||
|
||||
m_search_directories_model = new GameListSearchDirectoriesModel(host_interface);
|
||||
m_ui.redumpDatabasePath->setText(host_interface->getSettingValue("GameList/RedumpDatabasePath").toString());
|
||||
m_ui.searchDirectoryList->setModel(m_search_directories_model);
|
||||
m_ui.searchDirectoryList->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
m_ui.searchDirectoryList->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
@@ -205,9 +204,8 @@ GameListSettingsWidget::GameListSettingsWidget(QtHostInterface* host_interface,
|
||||
&GameListSettingsWidget::onRemoveSearchDirectoryButtonPressed);
|
||||
connect(m_ui.refreshGameListButton, &QToolButton::pressed, this,
|
||||
&GameListSettingsWidget::onRefreshGameListButtonPressed);
|
||||
connect(m_ui.browseRedumpPath, &QToolButton::pressed, this, &GameListSettingsWidget::onBrowseRedumpPathButtonPressed);
|
||||
connect(m_ui.downloadRedumpDatabase, &QToolButton::pressed, this,
|
||||
&GameListSettingsWidget::onDownloadRedumpDatabaseButtonPressed);
|
||||
connect(m_ui.updateRedumpDatabase, &QToolButton::pressed, this,
|
||||
&GameListSettingsWidget::onUpdateRedumpDatabaseButtonPressed);
|
||||
}
|
||||
|
||||
GameListSettingsWidget::~GameListSettingsWidget() = default;
|
||||
@@ -271,19 +269,7 @@ void GameListSettingsWidget::onRefreshGameListButtonPressed()
|
||||
m_host_interface->refreshGameList(true);
|
||||
}
|
||||
|
||||
void GameListSettingsWidget::onBrowseRedumpPathButtonPressed()
|
||||
{
|
||||
QString filename = QFileDialog::getOpenFileName(this, tr("Select Redump Database File"), QString(),
|
||||
tr("Redump Database Files (*.dat)"));
|
||||
if (filename.isEmpty())
|
||||
return;
|
||||
|
||||
m_ui.redumpDatabasePath->setText(filename);
|
||||
m_host_interface->putSettingValue(QStringLiteral("GameList/RedumpDatabasePath"), filename);
|
||||
m_host_interface->refreshGameList(true, true);
|
||||
}
|
||||
|
||||
void GameListSettingsWidget::onDownloadRedumpDatabaseButtonPressed()
|
||||
void GameListSettingsWidget::onUpdateRedumpDatabaseButtonPressed()
|
||||
{
|
||||
QMessageBox::information(this, tr("TODO"), tr("TODO"));
|
||||
}
|
||||
|
||||
@@ -24,8 +24,7 @@ private Q_SLOTS:
|
||||
void onAddSearchDirectoryButtonPressed();
|
||||
void onRemoveSearchDirectoryButtonPressed();
|
||||
void onRefreshGameListButtonPressed();
|
||||
void onBrowseRedumpPathButtonPressed();
|
||||
void onDownloadRedumpDatabaseButtonPressed();
|
||||
void onUpdateRedumpDatabaseButtonPressed();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<string>Add</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<iconset resource="resources/icons.qrc">
|
||||
<normaloff>:/icons/list-add.png</normaloff>:/icons/list-add.png</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
@@ -60,7 +60,7 @@
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<iconset resource="resources/icons.qrc">
|
||||
<normaloff>:/icons/list-remove.png</normaloff>:/icons/list-remove.png</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
@@ -87,7 +87,7 @@
|
||||
<string>Refresh</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<iconset resource="resources/icons.qrc">
|
||||
<normaloff>:/icons/view-refresh.png</normaloff>:/icons/view-refresh.png</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
@@ -95,44 +95,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Redump Database Path</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="redumpDatabasePath"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="browseRedumpPath">
|
||||
<widget class="QPushButton" name="updateRedumpDatabase">
|
||||
<property name="text">
|
||||
<string>Browse...</string>
|
||||
<string>Update Redump Database</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<normaloff>:/icons/system-search.png</normaloff>:/icons/system-search.png</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="downloadRedumpDatabase">
|
||||
<property name="text">
|
||||
<string>Download...</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="icons.qrc">
|
||||
<iconset resource="resources/icons.qrc">
|
||||
<normaloff>:/icons/applications-internet.png</normaloff>:/icons/applications-internet.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
@@ -144,7 +113,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="icons.qrc"/>
|
||||
<include location="resources/icons.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -158,7 +158,7 @@ void QtHostInterface::refreshGameList(bool invalidate_cache /* = false */, bool
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_qsettings_mutex);
|
||||
QtSettingsInterface si(m_qsettings);
|
||||
m_game_list->SetPathsFromSettings(si);
|
||||
m_game_list->SetSearchDirectoriesFromSettings(si);
|
||||
m_game_list->Refresh(invalidate_cache, invalidate_database);
|
||||
emit gameListRefreshed();
|
||||
}
|
||||
|
||||
@@ -114,7 +114,6 @@ private:
|
||||
void checkSettings();
|
||||
void updateQSettingsFromCoreSettings();
|
||||
|
||||
void createGameList();
|
||||
void updateControllerInputMap();
|
||||
void updateHotkeyInputMap();
|
||||
void addButtonToInputMap(const QString& binding, InputButtonHandler handler);
|
||||
|
||||
Reference in New Issue
Block a user