mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2025-03-16 10:38:32 +01:00
qt: Check for migration before qt-config.ini is created
This commit is contained in:
parent
6cc98148db
commit
cee3c8ad31
@ -167,6 +167,8 @@ void GMainWindow::ShowCommandOutput(std::string title, std::string message) {
|
|||||||
|
|
||||||
GMainWindow::GMainWindow(Core::System& system_)
|
GMainWindow::GMainWindow(Core::System& system_)
|
||||||
: ui{std::make_unique<Ui::MainWindow>()}, system{system_}, movie{system.Movie()},
|
: ui{std::make_unique<Ui::MainWindow>()}, system{system_}, movie{system.Movie()},
|
||||||
|
emu_dir_exists{
|
||||||
|
std::filesystem::is_directory(FileUtil::GetUserPath(FileUtil::UserPath::UserDir))},
|
||||||
config{std::make_unique<QtConfig>()}, emu_thread{nullptr} {
|
config{std::make_unique<QtConfig>()}, emu_thread{nullptr} {
|
||||||
Common::Log::Initialize();
|
Common::Log::Initialize();
|
||||||
Common::Log::Start();
|
Common::Log::Start();
|
||||||
@ -308,7 +310,9 @@ GMainWindow::GMainWindow(Core::System& system_)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if data migration from Citra/Lime3DS needs to be performed
|
// Check if data migration from Citra/Lime3DS needs to be performed
|
||||||
CheckForMigration();
|
if (!emu_dir_exists) {
|
||||||
|
ShowMigrationPrompt();
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __unix__
|
#ifdef __unix__
|
||||||
SetGamemodeEnabled(Settings::values.enable_gamemode.GetValue());
|
SetGamemodeEnabled(Settings::values.enable_gamemode.GetValue());
|
||||||
@ -1218,13 +1222,9 @@ void GMainWindow::ShowMigrationCancelledMessage() {
|
|||||||
QMessageBox::Ok);
|
QMessageBox::Ok);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GMainWindow::CheckForMigration() {
|
void GMainWindow::ShowMigrationPrompt() {
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
if (fs::is_directory(FileUtil::GetUserPath(FileUtil::UserPath::UserDir))) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString migration_prompt_message =
|
const QString migration_prompt_message =
|
||||||
tr("Would you like to migrate your data for use in Azahar?\n"
|
tr("Would you like to migrate your data for use in Azahar?\n"
|
||||||
"(This may take a while; The old data will not be deleted)");
|
"(This may take a while; The old data will not be deleted)");
|
||||||
|
@ -178,7 +178,7 @@ private:
|
|||||||
Lime3DS,
|
Lime3DS,
|
||||||
};
|
};
|
||||||
void ShowMigrationCancelledMessage();
|
void ShowMigrationCancelledMessage();
|
||||||
void CheckForMigration();
|
void ShowMigrationPrompt();
|
||||||
void MigrateUserData(const LegacyEmu selected_legacy_emu);
|
void MigrateUserData(const LegacyEmu selected_legacy_emu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -357,6 +357,10 @@ private:
|
|||||||
bool message_label_used_for_movie = false;
|
bool message_label_used_for_movie = false;
|
||||||
|
|
||||||
MultiplayerState* multiplayer_state = nullptr;
|
MultiplayerState* multiplayer_state = nullptr;
|
||||||
|
|
||||||
|
// Created before `config` to ensure that emu data directory
|
||||||
|
// isn't created before the check is performed
|
||||||
|
bool emu_dir_exists;
|
||||||
std::unique_ptr<QtConfig> config;
|
std::unique_ptr<QtConfig> config;
|
||||||
|
|
||||||
// Whether emulation is currently running in Citra.
|
// Whether emulation is currently running in Citra.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user