forked from eden-emu/eden
qt_common init
Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
parent
28d26b0d76
commit
11db0f0dbf
56 changed files with 233 additions and 153 deletions
|
@ -1,14 +1,15 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "yuzu/configuration/configure_filesystem.h"
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include "common/fs/fs.h"
|
||||
#include "common/fs/path_util.h"
|
||||
#include "common/settings.h"
|
||||
#include "qt_common/qt_common.h"
|
||||
#include "qt_common/uisettings.h"
|
||||
#include "ui_configure_filesystem.h"
|
||||
#include "yuzu/configuration/configure_filesystem.h"
|
||||
#include "yuzu/uisettings.h"
|
||||
|
||||
ConfigureFilesystem::ConfigureFilesystem(QWidget* parent)
|
||||
: QWidget(parent), ui(std::make_unique<Ui::ConfigureFilesystem>()) {
|
||||
|
@ -126,19 +127,16 @@ void ConfigureFilesystem::SetDirectory(DirectoryTarget target, QLineEdit* edit)
|
|||
}
|
||||
|
||||
void ConfigureFilesystem::ResetMetadata() {
|
||||
if (!Common::FS::Exists(Common::FS::GetEdenPath(Common::FS::EdenPath::CacheDir) /
|
||||
"game_list/")) {
|
||||
QMessageBox::information(this, tr("Reset Metadata Cache"),
|
||||
tr("The metadata cache is already empty."));
|
||||
} else if (Common::FS::RemoveDirRecursively(
|
||||
Common::FS::GetEdenPath(Common::FS::EdenPath::CacheDir) / "game_list")) {
|
||||
QMessageBox::information(this, tr("Reset Metadata Cache"),
|
||||
tr("The operation completed successfully."));
|
||||
UISettings::values.is_game_list_reload_pending.exchange(true);
|
||||
} else {
|
||||
QMessageBox::warning(
|
||||
this, tr("Reset Metadata Cache"),
|
||||
tr("The metadata cache couldn't be deleted. It might be in use or non-existent."));
|
||||
auto result = QtCommon::ResetMetadata();
|
||||
const QString resultMessage = tr(QtCommon::GetResetMetadataResultString(result));
|
||||
const QString title = tr("Reset Metadata Cache");
|
||||
|
||||
switch (result) {
|
||||
case QtCommon::Failure:
|
||||
QMessageBox::warning(this, title, resultMessage);
|
||||
break;
|
||||
default:
|
||||
QMessageBox::information(this, title, resultMessage);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue