Allow to skip optional packages installation
minor cleanup minor cleanup
This commit is contained in:
@@ -984,7 +984,7 @@ bool main_window::HandlePackageInstallation(QStringList file_paths, bool from_bo
|
|||||||
const game_compatibility* compat = m_game_list_frame ? m_game_list_frame->GetGameCompatibility() : nullptr;
|
const game_compatibility* compat = m_game_list_frame ? m_game_list_frame->GetGameCompatibility() : nullptr;
|
||||||
|
|
||||||
// Let the user choose the packages to install and select the order in which they shall be installed.
|
// Let the user choose the packages to install and select the order in which they shall be installed.
|
||||||
pkg_install_dialog dlg(file_paths, compat, this);
|
pkg_install_dialog dlg(file_paths, from_boot, compat, this);
|
||||||
connect(&dlg, &QDialog::finished, this, [&](int result)
|
connect(&dlg, &QDialog::finished, this, [&](int result)
|
||||||
{
|
{
|
||||||
if (result != QDialog::Accepted)
|
if (result != QDialog::Accepted)
|
||||||
@@ -1009,7 +1009,8 @@ bool main_window::HandlePackageInstallation(QStringList file_paths, bool from_bo
|
|||||||
|
|
||||||
if (canceled)
|
if (canceled)
|
||||||
{
|
{
|
||||||
return false;
|
// return "true" if installation of optional packages (requested by some games at first boot) is skipped
|
||||||
|
return from_boot;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!from_boot)
|
if (!from_boot)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ enum Roles
|
|||||||
DataSizeRole = Qt::UserRole + 5,
|
DataSizeRole = Qt::UserRole + 5,
|
||||||
};
|
};
|
||||||
|
|
||||||
pkg_install_dialog::pkg_install_dialog(const QStringList& paths, const game_compatibility* compat, QWidget* parent)
|
pkg_install_dialog::pkg_install_dialog(const QStringList& paths, bool from_boot, const game_compatibility* compat, QWidget* parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
{
|
{
|
||||||
ensure(!paths.empty());
|
ensure(!paths.empty());
|
||||||
@@ -148,6 +148,11 @@ pkg_install_dialog::pkg_install_dialog(const QStringList& paths, const game_comp
|
|||||||
buttons->button(QDialogButtonBox::Ok)->setText(tr("Install"));
|
buttons->button(QDialogButtonBox::Ok)->setText(tr("Install"));
|
||||||
buttons->button(QDialogButtonBox::Ok)->setDefault(true);
|
buttons->button(QDialogButtonBox::Ok)->setDefault(true);
|
||||||
|
|
||||||
|
if (from_boot)
|
||||||
|
{
|
||||||
|
buttons->button(QDialogButtonBox::Cancel)->setText(tr("Skip"));
|
||||||
|
}
|
||||||
|
|
||||||
m_dir_list->sortItems();
|
m_dir_list->sortItems();
|
||||||
m_dir_list->setCurrentRow(0);
|
m_dir_list->setCurrentRow(0);
|
||||||
m_dir_list->setMinimumWidth((m_dir_list->sizeHintForColumn(0) * 125) / 100);
|
m_dir_list->setMinimumWidth((m_dir_list->sizeHintForColumn(0) * 125) / 100);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class pkg_install_dialog : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit pkg_install_dialog(const QStringList& paths, const game_compatibility* compat, QWidget* parent = nullptr);
|
explicit pkg_install_dialog(const QStringList& paths, bool from_boot, const game_compatibility* compat, QWidget* parent = nullptr);
|
||||||
std::vector<compat::package_info> get_paths_to_install() const;
|
std::vector<compat::package_info> get_paths_to_install() const;
|
||||||
bool precompile_caches() const { return m_precompile_caches; }
|
bool precompile_caches() const { return m_precompile_caches; }
|
||||||
bool create_desktop_shortcuts() const { return m_create_desktop_shortcuts; }
|
bool create_desktop_shortcuts() const { return m_create_desktop_shortcuts; }
|
||||||
|
|||||||
Reference in New Issue
Block a user