mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 12:32:43 +00:00
Qt: Add Create RPCS3 shortcuts to Wecome Dialog
This commit is contained in:
parent
83e22fa9f0
commit
6aa598b029
@ -2,8 +2,11 @@
|
|||||||
#include "ui_welcome_dialog.h"
|
#include "ui_welcome_dialog.h"
|
||||||
|
|
||||||
#include "gui_settings.h"
|
#include "gui_settings.h"
|
||||||
|
#include "shortcut_utils.h"
|
||||||
#include "qt_utils.h"
|
#include "qt_utils.h"
|
||||||
|
|
||||||
|
#include "Utilities/File.h"
|
||||||
|
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
#include <QSvgWidget>
|
#include <QSvgWidget>
|
||||||
@ -21,6 +24,7 @@ welcome_dialog::welcome_dialog(std::shared_ptr<gui_settings> gui_settings, bool
|
|||||||
ui->okay->setEnabled(is_manual_show);
|
ui->okay->setEnabled(is_manual_show);
|
||||||
ui->i_have_read->setChecked(is_manual_show);
|
ui->i_have_read->setChecked(is_manual_show);
|
||||||
ui->i_have_read->setEnabled(!is_manual_show);
|
ui->i_have_read->setEnabled(!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->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(
|
||||||
@ -63,7 +67,28 @@ welcome_dialog::welcome_dialog(std::shared_ptr<gui_settings> gui_settings, bool
|
|||||||
|
|
||||||
connect(ui->okay, &QPushButton::clicked, this, &QDialog::accept);
|
connect(ui->okay, &QPushButton::clicked, this, &QDialog::accept);
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
ui->create_applications_menu_shortcut->setText(tr("&Create Start Menu shortcut"));
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
ui->create_applications_menu_shortcut->setText(tr("&Create Launchpad shortcut"));
|
||||||
|
#else
|
||||||
|
ui->create_applications_menu_shortcut->setText(tr("&Create Application Menu shortcut"));
|
||||||
|
#endif
|
||||||
|
|
||||||
layout()->setSizeConstraint(QLayout::SetFixedSize);
|
layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
|
|
||||||
|
connect(this, &QDialog::finished, this, [this]()
|
||||||
|
{
|
||||||
|
if (ui->create_desktop_shortcut->isChecked())
|
||||||
|
{
|
||||||
|
gui::utils::create_shortcut("RPCS3", "", "RPCS3", ":/rpcs3.svg", fs::get_temp_dir(), gui::utils::shortcut_location::desktop);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ui->create_applications_menu_shortcut->isChecked())
|
||||||
|
{
|
||||||
|
gui::utils::create_shortcut("RPCS3", "", "RPCS3", ":/rpcs3.svg", fs::get_temp_dir(), gui::utils::shortcut_location::applications);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
welcome_dialog::~welcome_dialog()
|
welcome_dialog::~welcome_dialog()
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>611</width>
|
<width>611</width>
|
||||||
<height>272</height>
|
<height>319</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
@ -184,6 +184,33 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="create_desktop_shortcut">
|
||||||
|
<property name="text">
|
||||||
|
<string>Create desktop shortcut</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="create_applications_menu_shortcut">
|
||||||
|
<property name="text">
|
||||||
|
<string>Create Start Menu shortcut</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>10</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="button_layout">
|
<layout class="QHBoxLayout" name="button_layout">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user