mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 15:01:28 +12:00
Welcome Dialog: Reject users that reject our TOS
* Improved welcome dialog * "show at startup" checkbox always changeable
This commit is contained in:
parent
24655fd975
commit
68b7e5971d
4 changed files with 81 additions and 38 deletions
|
@ -161,7 +161,11 @@ bool gui_application::Init()
|
||||||
{
|
{
|
||||||
welcome_dialog* welcome = new welcome_dialog(m_gui_settings, false);
|
welcome_dialog* welcome = new welcome_dialog(m_gui_settings, false);
|
||||||
|
|
||||||
welcome->exec();
|
if (welcome->exec() == QDialog::Rejected)
|
||||||
|
{
|
||||||
|
// If the agreement on RPCS3's usage conditions was not accepted by the user, ask the main window to gracefully terminate
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check maxfiles
|
// Check maxfiles
|
||||||
|
|
|
@ -1848,12 +1848,29 @@ void main_window::SaveWindowState() const
|
||||||
// Save gui settings
|
// Save gui settings
|
||||||
m_gui_settings->SetValue(gui::mw_geometry, saveGeometry(), false);
|
m_gui_settings->SetValue(gui::mw_geometry, saveGeometry(), false);
|
||||||
m_gui_settings->SetValue(gui::mw_windowState, saveState(), false);
|
m_gui_settings->SetValue(gui::mw_windowState, saveState(), false);
|
||||||
m_gui_settings->SetValue(gui::mw_mwState, m_mw->saveState(), true);
|
|
||||||
|
|
||||||
|
// NOTE:
|
||||||
|
//
|
||||||
|
// This method is also invoked in case the gui_application::Init() method failed ("false" was returned)
|
||||||
|
// to initialize some modules leaving other modules uninitialized (NULL pointed).
|
||||||
|
// So, the following checks on NULL pointer are provided before accessing the related module's object
|
||||||
|
|
||||||
|
if (m_mw)
|
||||||
|
{
|
||||||
|
m_gui_settings->SetValue(gui::mw_mwState, m_mw->saveState(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_game_list_frame)
|
||||||
|
{
|
||||||
// Save column settings
|
// Save column settings
|
||||||
m_game_list_frame->SaveSettings();
|
m_game_list_frame->SaveSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_debugger_frame)
|
||||||
|
{
|
||||||
// Save splitter state
|
// Save splitter state
|
||||||
m_debugger_frame->SaveSettings();
|
m_debugger_frame->SaveSettings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void main_window::RepaintThumbnailIcons()
|
void main_window::RepaintThumbnailIcons()
|
||||||
|
|
|
@ -19,17 +19,12 @@ welcome_dialog::welcome_dialog(std::shared_ptr<gui_settings> gui_settings, bool
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
setWindowFlag(Qt::WindowCloseButtonHint, is_manual_show);
|
setWindowFlag(Qt::WindowCloseButtonHint, false); // disable the close button shown on the dialog's top right corner
|
||||||
|
layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
|
|
||||||
ui->okay->setEnabled(is_manual_show);
|
|
||||||
ui->i_have_read->setEnabled(!is_manual_show);
|
|
||||||
ui->i_have_read->setChecked(is_manual_show);
|
|
||||||
ui->do_not_show->setEnabled(!is_manual_show);
|
|
||||||
ui->do_not_show->setChecked(!m_gui_settings->GetValue(gui::ib_show_welcome).toBool());
|
|
||||||
ui->use_dark_theme->setEnabled(!is_manual_show);
|
|
||||||
ui->use_dark_theme->setChecked(gui::utils::dark_mode_active());
|
|
||||||
ui->icon_label->load(QStringLiteral(":/rpcs3.svg"));
|
ui->icon_label->load(QStringLiteral(":/rpcs3.svg"));
|
||||||
ui->label_3->setText(tr(
|
|
||||||
|
ui->label_desc->setText(tr(
|
||||||
R"(
|
R"(
|
||||||
<p style="white-space: nowrap;">
|
<p style="white-space: nowrap;">
|
||||||
RPCS3 is an open-source Sony PlayStation 3 emulator and debugger.<br>
|
RPCS3 is an open-source Sony PlayStation 3 emulator and debugger.<br>
|
||||||
|
@ -51,33 +46,44 @@ welcome_dialog::welcome_dialog(std::shared_ptr<gui_settings> gui_settings, bool
|
||||||
)"
|
)"
|
||||||
).arg(gui::utils::get_link_style()));
|
).arg(gui::utils::get_link_style()));
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
|
ui->create_applications_menu_shortcut->setText(tr("&Create Launchpad shortcut"));
|
||||||
|
ui->use_dark_theme->setVisible(false);
|
||||||
|
ui->use_dark_theme->setEnabled(false);
|
||||||
|
#else
|
||||||
|
#ifndef _WIN32
|
||||||
|
ui->create_applications_menu_shortcut->setText(tr("&Create Application Menu shortcut"));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ui->use_dark_theme->setVisible(!is_manual_show);
|
||||||
|
ui->use_dark_theme->setEnabled(!is_manual_show);
|
||||||
|
ui->use_dark_theme->setChecked(gui::utils::dark_mode_active());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
ui->accept->setEnabled(is_manual_show);
|
||||||
|
ui->reject->setVisible(!is_manual_show);
|
||||||
|
ui->i_have_read->setVisible(!is_manual_show);
|
||||||
|
ui->i_have_read->setChecked(is_manual_show);
|
||||||
|
ui->show_at_startup->setChecked(m_gui_settings->GetValue(gui::ib_show_welcome).toBool());
|
||||||
|
|
||||||
if (!is_manual_show)
|
if (!is_manual_show)
|
||||||
{
|
{
|
||||||
connect(ui->i_have_read, &QCheckBox::clicked, this, [this](bool checked)
|
connect(ui->i_have_read, &QCheckBox::clicked, this, [this](bool checked)
|
||||||
{
|
{
|
||||||
ui->okay->setEnabled(checked);
|
ui->accept->setEnabled(checked);
|
||||||
});
|
ui->reject->setEnabled(!checked);
|
||||||
|
|
||||||
connect(ui->do_not_show, &QCheckBox::clicked, this, [this](bool checked)
|
|
||||||
{
|
|
||||||
m_gui_settings->SetValue(gui::ib_show_welcome, QVariant(!checked));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(ui->okay, &QPushButton::clicked, this, &QDialog::accept);
|
connect(ui->show_at_startup, &QCheckBox::clicked, this, [this](bool checked)
|
||||||
|
{
|
||||||
|
m_gui_settings->SetValue(gui::ib_show_welcome, QVariant(checked));
|
||||||
|
});
|
||||||
|
|
||||||
#ifdef _WIN32
|
connect(ui->accept, &QPushButton::clicked, this, &QDialog::accept); // trigger "accept" signal (setting also dialog's result code to QDialog::Accepted)
|
||||||
ui->create_applications_menu_shortcut->setText(tr("&Create Start Menu shortcut"));
|
connect(ui->reject, &QPushButton::clicked, this, &QDialog::reject); // trigger "reject" signal (setting also dialog's result code to QDialog::Rejected)
|
||||||
#elif defined(__APPLE__)
|
|
||||||
ui->create_applications_menu_shortcut->setText(tr("&Create Launchpad shortcut"));
|
|
||||||
ui->use_dark_theme->setVisible(false);
|
|
||||||
#else
|
|
||||||
ui->create_applications_menu_shortcut->setText(tr("&Create Application Menu shortcut"));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
layout()->setSizeConstraint(QLayout::SetFixedSize);
|
connect(this, &QDialog::accepted, this, [this]() // "accept" signal's event handler
|
||||||
|
|
||||||
connect(this, &QDialog::accepted, this, [this]()
|
|
||||||
{
|
{
|
||||||
if (ui->create_desktop_shortcut->isChecked())
|
if (ui->create_desktop_shortcut->isChecked())
|
||||||
{
|
{
|
||||||
|
@ -94,6 +100,12 @@ welcome_dialog::welcome_dialog(std::shared_ptr<gui_settings> gui_settings, bool
|
||||||
m_gui_settings->SetValue(gui::m_currentStylesheet, gui::DarkStylesheet);
|
m_gui_settings->SetValue(gui::m_currentStylesheet, gui::DarkStylesheet);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
connect(this, &QDialog::rejected, this, [this]() // "reject" signal's event handler
|
||||||
|
{
|
||||||
|
// if the agreement on RPCS3's usage conditions was not accepted by the user, always display the initial welcome dialog at next startup
|
||||||
|
m_gui_settings->SetValue(gui::ib_show_welcome, QVariant(true));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
welcome_dialog::~welcome_dialog()
|
welcome_dialog::~welcome_dialog()
|
||||||
|
|
|
@ -103,7 +103,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_desc">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<family>Arial</family>
|
<family>Arial</family>
|
||||||
|
@ -201,7 +201,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="use_dark_theme">
|
<widget class="QCheckBox" name="use_dark_theme">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Use Dark Theme (Can Be Configured Later)</string>
|
<string>Use Dark Theme (can be configured later)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -233,7 +233,7 @@
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item alignment="Qt::AlignLeft">
|
<item alignment="Qt::AlignLeft">
|
||||||
<widget class="QPushButton" name="okay">
|
<widget class="QPushButton" name="accept">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Continue</string>
|
<string>Continue</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -242,6 +242,16 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item alignment="Qt::AlignLeft">
|
||||||
|
<widget class="QPushButton" name="reject">
|
||||||
|
<property name="text">
|
||||||
|
<string>Exit</string>
|
||||||
|
</property>
|
||||||
|
<property name="autoDefault">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="button_layout_left">
|
<spacer name="button_layout_left">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -276,9 +286,9 @@
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item alignment="Qt::AlignLeft">
|
<item alignment="Qt::AlignLeft">
|
||||||
<widget class="QCheckBox" name="do_not_show">
|
<widget class="QCheckBox" name="show_at_startup">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Do not show again</string>
|
<string>Show at startup</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue