mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-09 09:39:44 +00:00
Qt: Make welcome dialog accessible through F1 or Help menu
Enable window close button after "I have read the Quickstart" is checked.
This commit is contained in:
parent
a230340578
commit
83e22fa9f0
6 changed files with 50 additions and 6 deletions
|
@ -135,7 +135,7 @@ bool gui_application::Init()
|
||||||
|
|
||||||
if (m_gui_settings->GetValue(gui::ib_show_welcome).toBool())
|
if (m_gui_settings->GetValue(gui::ib_show_welcome).toBool())
|
||||||
{
|
{
|
||||||
welcome_dialog* welcome = new welcome_dialog(m_gui_settings);
|
welcome_dialog* welcome = new welcome_dialog(m_gui_settings, false);
|
||||||
welcome->exec();
|
welcome->exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#include "shortcut_dialog.h"
|
#include "shortcut_dialog.h"
|
||||||
#include "system_cmd_dialog.h"
|
#include "system_cmd_dialog.h"
|
||||||
#include "emulated_pad_settings_dialog.h"
|
#include "emulated_pad_settings_dialog.h"
|
||||||
|
#include "welcome_dialog.h"
|
||||||
|
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <charconv>
|
#include <charconv>
|
||||||
|
@ -2737,6 +2738,12 @@ void main_window::CreateConnects()
|
||||||
m_updater.check_for_updates(false, false, false, this);
|
m_updater.check_for_updates(false, false, false, this);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
connect(ui->welcomeAct, &QAction::triggered, this, [this]()
|
||||||
|
{
|
||||||
|
welcome_dialog* welcome = new welcome_dialog(m_gui_settings, true, this);
|
||||||
|
welcome->open();
|
||||||
|
});
|
||||||
|
|
||||||
connect(ui->aboutAct, &QAction::triggered, this, [this]
|
connect(ui->aboutAct, &QAction::triggered, this, [this]
|
||||||
{
|
{
|
||||||
about_dialog dlg(this);
|
about_dialog dlg(this);
|
||||||
|
@ -3389,3 +3396,24 @@ void main_window::dragLeaveEvent(QDragLeaveEvent* event)
|
||||||
{
|
{
|
||||||
event->accept();
|
event->accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void main_window::keyPressEvent(QKeyEvent* event)
|
||||||
|
{
|
||||||
|
QMainWindow::keyPressEvent(event);
|
||||||
|
|
||||||
|
if (event->isAutoRepeat() || event->modifiers())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (event->key())
|
||||||
|
{
|
||||||
|
case Qt::Key_F1:
|
||||||
|
{
|
||||||
|
welcome_dialog* welcome = new welcome_dialog(m_gui_settings, true, this);
|
||||||
|
welcome->open();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -135,6 +135,7 @@ protected:
|
||||||
void dragEnterEvent(QDragEnterEvent* event) override;
|
void dragEnterEvent(QDragEnterEvent* event) override;
|
||||||
void dragMoveEvent(QDragMoveEvent* event) override;
|
void dragMoveEvent(QDragMoveEvent* event) override;
|
||||||
void dragLeaveEvent(QDragLeaveEvent* event) override;
|
void dragLeaveEvent(QDragLeaveEvent* event) override;
|
||||||
|
void keyPressEvent(QKeyEvent* event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ConfigureGuiFromSettings();
|
void ConfigureGuiFromSettings();
|
||||||
|
|
|
@ -366,6 +366,7 @@
|
||||||
<addaction name="languageAct0"/>
|
<addaction name="languageAct0"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="updateAct"/>
|
<addaction name="updateAct"/>
|
||||||
|
<addaction name="welcomeAct"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="languageMenu"/>
|
<addaction name="languageMenu"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
|
@ -748,6 +749,11 @@
|
||||||
<string>Check for Updates</string>
|
<string>Check for Updates</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="welcomeAct">
|
||||||
|
<property name="text">
|
||||||
|
<string>View The Welcome Dialog</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
<action name="confVFSDialogAct">
|
<action name="confVFSDialogAct">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Virtual File System</string>
|
<string>Virtual File System</string>
|
||||||
|
|
|
@ -8,17 +8,20 @@
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QSvgWidget>
|
#include <QSvgWidget>
|
||||||
|
|
||||||
welcome_dialog::welcome_dialog(std::shared_ptr<gui_settings> gui_settings, QWidget* parent)
|
welcome_dialog::welcome_dialog(std::shared_ptr<gui_settings> gui_settings, bool is_manual_show, QWidget* parent)
|
||||||
: QDialog(parent)
|
: QDialog(parent)
|
||||||
, ui(new Ui::welcome_dialog)
|
, ui(new Ui::welcome_dialog)
|
||||||
, m_gui_settings(std::move(gui_settings))
|
, m_gui_settings(std::move(gui_settings))
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
setWindowFlags(windowFlags() & Qt::WindowTitleHint);
|
|
||||||
setAttribute(Qt::WA_DeleteOnClose);
|
setAttribute(Qt::WA_DeleteOnClose);
|
||||||
|
|
||||||
ui->okay->setEnabled(false);
|
setWindowFlag(Qt::WindowCloseButtonHint, is_manual_show);
|
||||||
|
ui->okay->setEnabled(is_manual_show);
|
||||||
|
ui->i_have_read->setChecked(is_manual_show);
|
||||||
|
ui->i_have_read->setEnabled(!is_manual_show);
|
||||||
|
ui->do_not_show->setChecked(!m_gui_settings->GetValue(gui::ib_show_welcome).toBool());
|
||||||
ui->icon_label->load(QStringLiteral(":/rpcs3.svg"));
|
ui->icon_label->load(QStringLiteral(":/rpcs3.svg"));
|
||||||
ui->label_3->setText(tr(
|
ui->label_3->setText(tr(
|
||||||
R"(
|
R"(
|
||||||
|
@ -42,9 +45,15 @@ welcome_dialog::welcome_dialog(std::shared_ptr<gui_settings> gui_settings, QWidg
|
||||||
)"
|
)"
|
||||||
).arg(gui::utils::get_link_style()));
|
).arg(gui::utils::get_link_style()));
|
||||||
|
|
||||||
connect(ui->i_have_read, &QCheckBox::clicked, [this](bool checked)
|
connect(ui->i_have_read, &QCheckBox::clicked, [this, is_manual_show](bool checked)
|
||||||
{
|
{
|
||||||
|
if (is_manual_show)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ui->okay->setEnabled(checked);
|
ui->okay->setEnabled(checked);
|
||||||
|
setWindowFlag(Qt::WindowCloseButtonHint, checked);
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(ui->do_not_show, &QCheckBox::clicked, [this](bool checked)
|
connect(ui->do_not_show, &QCheckBox::clicked, [this](bool checked)
|
||||||
|
|
|
@ -14,7 +14,7 @@ class welcome_dialog : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit welcome_dialog(std::shared_ptr<gui_settings> gui_settings, QWidget* parent = nullptr);
|
explicit welcome_dialog(std::shared_ptr<gui_settings> gui_settings, bool is_manual_show, QWidget* parent = nullptr);
|
||||||
~welcome_dialog();
|
~welcome_dialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue