Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Qt: Post Game-Installation Assistant #14864

Merged
merged 1 commit into from Dec 11, 2023
Merged

Conversation

elad335
Copy link
Contributor

@elad335 elad335 commented Dec 2, 2023

New Features

  • "Add Games" would now prompt the post-install assistant, which was previously only done when installing game packages.
  • I added the option to precompile CPU caches right after installation for your convenience. Preventing the wait on boot before first boot when you actually want to play the game!

image

rpcs3/rpcs3qt/main_window.cpp Show resolved Hide resolved
rpcs3/rpcs3qt/game_list_frame.h Outdated Show resolved Hide resolved
vlayout->addWidget(btn_box);
dlg->setLayout(vlayout);

connect(btn_box, &QDialogButtonBox::accepted, this, [this, dlg, desk_check, quick_check, precompile_check, bootable_paths = std::move(bootable_paths)]()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This dialog should be its own class that connects to this main window function instead of adding more and more and more nested dialog code to big classes like this.

@elad335 elad335 force-pushed the save-breathe branch 3 times, most recently from edbd142 to cf62505 Compare December 5, 2023 19:29
{
if (bootable_paths_installed.empty())
m_game_list_frame->AddRefreshedSlot([paths = std::move(bootable_paths_installed)]() mutable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
m_game_list_frame->AddRefreshedSlot([paths = std::move(bootable_paths_installed)]() mutable
connect(m_game_list_frame, &game_list_frame::Refreshed, this, func, Qt::SingleShotConnection);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's cool!


for (const QString& path : paths)
{
AddGamesFromDir(path);
}

m_game_list_frame->AddRefreshedSlot([paths = std::move(paths), existing = std::move(existing)]()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
m_game_list_frame->AddRefreshedSlot([paths = std::move(paths), existing = std::move(existing)]()
connect(m_game_list_frame, &game_list_frame::Refreshed, this, func, Qt::SingleShotConnection);


for (const game_info& game : m_game_list_frame->GetGameInfo())
{
if (game)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (game)
if (!game) continue;


for (const game_info& game : m_game_list_frame->GetGameInfo())
{
if (game && !existing.contains(game->info.path))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (game && !existing.contains(game->info.path))
if (!game || existing.contains(game->info.path)) continue;

@@ -8,6 +8,7 @@
#include "Utilities/mutex.h"
#include "Emu/config_mode.h"


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty line

{
locations.insert(gui::utils::shortcut_location::applications);
}
std::this_thread::sleep_for(std::chrono::microseconds(100'000 - std::min<usz>(100'000, get_system_time() - start_time)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for again?
Please add a comment.

Copy link
Contributor Author

@elad335 elad335 Dec 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's so you had the 100% state seen for a little while, but this was in addition to the full refresh afterwards so it wasn't very efficient

Comment on lines +1118 to +1135

if (!cancelled)
{
return true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is placebo. we already return true in this scope no matter what

@@ -1095,80 +1095,30 @@ bool main_window::HandlePackageInstallation(QStringList file_paths, bool from_bo
bootable_paths_installed[bootable_paths[index]] = packages[index].title_id;
}

pdlg.hide();
const bool installed_a_whole_package_without_new_software = bootable_paths_installed.empty() && !cancelled;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a comment which explains the early check (due to move)

@elad335 elad335 force-pushed the save-breathe branch 5 times, most recently from ecb2301 to 0678ff6 Compare December 10, 2023 19:54
@elad335 elad335 merged commit a6839e8 into RPCS3:master Dec 11, 2023
4 of 6 checks passed
vlayout->addWidget(btn_box);
dlg->setLayout(vlayout);

connect(btn_box, &QDialogButtonBox::accepted, this, [=, paths = std::move(bootable_paths)]()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get this warning from Clang.

[550/577] Building CXX object rpcs3/rpcs3qt/CMakeFiles/rpcs3_ui.dir/main_window.cpp.obj
C:/src/rpcs3/rpcs3/rpcs3qt/main_window.cpp:2318:37: warning: implicit capture of 'this' with a capture default of '=' is deprecated [-Wdeprecated-this-capture]
 2318 |                         for (const game_info& gameinfo : m_game_list_frame->GetGameInfo())
      |                                                          ^
C:/src/rpcs3/rpcs3/rpcs3qt/main_window.cpp:2290:55: note: add an explicit capture of 'this' to capture '*this' by reference
 2290 |         connect(btn_box, &QDialogButtonBox::accepted, this, [=, paths = std::move(bootable_paths)]()
      |                                                              ^
      |                                                               , this
1 warning generated.

@Augusto7743
Copy link

THANKS VERY MUCH !!!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants