diff options
| author | 2018-01-14 19:15:45 +0100 | |
|---|---|---|
| committer | 2018-01-14 19:15:45 +0100 | |
| commit | c493bd9cc927f9119960e6dc084d374a2ec75d26 (patch) | |
| tree | 94b90ebb26d2b9ae3a8822395e928a3eee5aba98 /src | |
| parent | externals: Remove unused repos. (diff) | |
| download | yuzu-c493bd9cc927f9119960e6dc084d374a2ec75d26.tar.gz yuzu-c493bd9cc927f9119960e6dc084d374a2ec75d26.tar.xz yuzu-c493bd9cc927f9119960e6dc084d374a2ec75d26.zip | |
Implement "About" dialog
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/CMakeLists.txt | 9 | ||||
| -rw-r--r-- | src/yuzu/about_dialog.cpp | 15 | ||||
| -rw-r--r-- | src/yuzu/about_dialog.h | 23 | ||||
| -rw-r--r-- | src/yuzu/aboutdialog.ui | 191 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 9 | ||||
| -rw-r--r-- | src/yuzu/main.h | 1 |
6 files changed, 245 insertions, 3 deletions
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index 5b446dc36..c52d5627a 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt | |||
| @@ -4,6 +4,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) | |||
| 4 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) | 4 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) |
| 5 | 5 | ||
| 6 | set(SRCS | 6 | set(SRCS |
| 7 | about_dialog.cpp | ||
| 7 | configuration/config.cpp | 8 | configuration/config.cpp |
| 8 | configuration/configure_debug.cpp | 9 | configuration/configure_debug.cpp |
| 9 | configuration/configure_dialog.cpp | 10 | configuration/configure_dialog.cpp |
| @@ -26,6 +27,7 @@ set(SRCS | |||
| 26 | ) | 27 | ) |
| 27 | 28 | ||
| 28 | set(HEADERS | 29 | set(HEADERS |
| 30 | about_dialog.h | ||
| 29 | configuration/config.h | 31 | configuration/config.h |
| 30 | configuration/configure_debug.h | 32 | configuration/configure_debug.h |
| 31 | configuration/configure_dialog.h | 33 | configuration/configure_dialog.h |
| @@ -47,6 +49,7 @@ set(HEADERS | |||
| 47 | ) | 49 | ) |
| 48 | 50 | ||
| 49 | set(UIS | 51 | set(UIS |
| 52 | aboutdialog.ui | ||
| 50 | configuration/configure.ui | 53 | configuration/configure.ui |
| 51 | configuration/configure_debug.ui | 54 | configuration/configure_debug.ui |
| 52 | configuration/configure_general.ui | 55 | configuration/configure_general.ui |
| @@ -58,7 +61,7 @@ set(UIS | |||
| 58 | main.ui | 61 | main.ui |
| 59 | ) | 62 | ) |
| 60 | 63 | ||
| 61 | # file(GLOB_RECURSE ICONS ${CMAKE_SOURCE_DIR}/dist/icons/*) | 64 | file(GLOB_RECURSE ICONS ${CMAKE_SOURCE_DIR}/dist/icons/*) |
| 62 | file(GLOB_RECURSE THEMES ${CMAKE_SOURCE_DIR}/dist/qt_themes/*) | 65 | file(GLOB_RECURSE THEMES ${CMAKE_SOURCE_DIR}/dist/qt_themes/*) |
| 63 | 66 | ||
| 64 | create_directory_groups(${SRCS} ${HEADERS} ${UIS}) | 67 | create_directory_groups(${SRCS} ${HEADERS} ${UIS}) |
| @@ -72,10 +75,10 @@ endif() | |||
| 72 | if (APPLE) | 75 | if (APPLE) |
| 73 | set(MACOSX_ICON "../../dist/yuzu.icns") | 76 | set(MACOSX_ICON "../../dist/yuzu.icns") |
| 74 | set_source_files_properties(${MACOSX_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) | 77 | set_source_files_properties(${MACOSX_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) |
| 75 | add_executable(yuzu MACOSX_BUNDLE ${SRCS} ${HEADERS} ${UI_HDRS} ${MACOSX_ICON}) | 78 | add_executable(yuzu MACOSX_BUNDLE ${SRCS} ${HEADERS} ${UI_HDRS} ${MACOSX_ICON} ${ICONS}) |
| 76 | set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) | 79 | set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) |
| 77 | else() | 80 | else() |
| 78 | add_executable(yuzu ${SRCS} ${HEADERS} ${UI_HDRS}) | 81 | add_executable(yuzu ${SRCS} ${HEADERS} ${UI_HDRS} ${ICONS}) |
| 79 | endif() | 82 | endif() |
| 80 | target_link_libraries(yuzu PRIVATE common core input_common video_core) | 83 | target_link_libraries(yuzu PRIVATE common core input_common video_core) |
| 81 | target_link_libraries(yuzu PRIVATE Boost::boost glad Qt5::OpenGL Qt5::Widgets) | 84 | target_link_libraries(yuzu PRIVATE Boost::boost glad Qt5::OpenGL Qt5::Widgets) |
diff --git a/src/yuzu/about_dialog.cpp b/src/yuzu/about_dialog.cpp new file mode 100644 index 000000000..0f1b6cdc6 --- /dev/null +++ b/src/yuzu/about_dialog.cpp | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | // Copyright 2018 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #include "common/scm_rev.h" | ||
| 6 | #include "ui_aboutdialog.h" | ||
| 7 | #include "yuzu/about_dialog.h" | ||
| 8 | |||
| 9 | AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) { | ||
| 10 | ui->setupUi(this); | ||
| 11 | ui->labelBuildInfo->setText(ui->labelBuildInfo->text().arg( | ||
| 12 | Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc)); | ||
| 13 | } | ||
| 14 | |||
| 15 | AboutDialog::~AboutDialog() {} | ||
diff --git a/src/yuzu/about_dialog.h b/src/yuzu/about_dialog.h new file mode 100644 index 000000000..2eb6e28f5 --- /dev/null +++ b/src/yuzu/about_dialog.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | // Copyright 2018 yuzu Emulator Project | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <memory> | ||
| 8 | #include <QDialog> | ||
| 9 | |||
| 10 | namespace Ui { | ||
| 11 | class AboutDialog; | ||
| 12 | } | ||
| 13 | |||
| 14 | class AboutDialog : public QDialog { | ||
| 15 | Q_OBJECT | ||
| 16 | |||
| 17 | public: | ||
| 18 | explicit AboutDialog(QWidget* parent); | ||
| 19 | ~AboutDialog(); | ||
| 20 | |||
| 21 | private: | ||
| 22 | std::unique_ptr<Ui::AboutDialog> ui; | ||
| 23 | }; | ||
diff --git a/src/yuzu/aboutdialog.ui b/src/yuzu/aboutdialog.ui new file mode 100644 index 000000000..cdcaa15b0 --- /dev/null +++ b/src/yuzu/aboutdialog.ui | |||
| @@ -0,0 +1,191 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <ui version="4.0"> | ||
| 3 | <class>AboutDialog</class> | ||
| 4 | <widget class="QDialog" name="AboutDialog"> | ||
| 5 | <property name="geometry"> | ||
| 6 | <rect> | ||
| 7 | <x>0</x> | ||
| 8 | <y>0</y> | ||
| 9 | <width>616</width> | ||
| 10 | <height>261</height> | ||
| 11 | </rect> | ||
| 12 | </property> | ||
| 13 | <property name="windowTitle"> | ||
| 14 | <string>About yuzu</string> | ||
| 15 | </property> | ||
| 16 | <layout class="QVBoxLayout" name="verticalLayout_3"> | ||
| 17 | <item> | ||
| 18 | <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1"> | ||
| 19 | <item> | ||
| 20 | <layout class="QVBoxLayout" name="verticalLayout_2"> | ||
| 21 | <item> | ||
| 22 | <widget class="QLabel" name="labelLogo"> | ||
| 23 | <property name="sizePolicy"> | ||
| 24 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | ||
| 25 | <horstretch>0</horstretch> | ||
| 26 | <verstretch>0</verstretch> | ||
| 27 | </sizepolicy> | ||
| 28 | </property> | ||
| 29 | <property name="text"> | ||
| 30 | <string><html><head/><body><p><img src=":/icons/yuzu.png"/></p></body></html></string> | ||
| 31 | </property> | ||
| 32 | </widget> | ||
| 33 | </item> | ||
| 34 | <item> | ||
| 35 | <spacer name="verticalSpacer"> | ||
| 36 | <property name="orientation"> | ||
| 37 | <enum>Qt::Vertical</enum> | ||
| 38 | </property> | ||
| 39 | <property name="sizeHint" stdset="0"> | ||
| 40 | <size> | ||
| 41 | <width>20</width> | ||
| 42 | <height>40</height> | ||
| 43 | </size> | ||
| 44 | </property> | ||
| 45 | </spacer> | ||
| 46 | </item> | ||
| 47 | </layout> | ||
| 48 | </item> | ||
| 49 | <item> | ||
| 50 | <layout class="QVBoxLayout" name="verticalLayout"> | ||
| 51 | <item> | ||
| 52 | <widget class="QLabel" name="labelYuzu"> | ||
| 53 | <property name="sizePolicy"> | ||
| 54 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | ||
| 55 | <horstretch>0</horstretch> | ||
| 56 | <verstretch>0</verstretch> | ||
| 57 | </sizepolicy> | ||
| 58 | </property> | ||
| 59 | <property name="text"> | ||
| 60 | <string><html><head/><body><p><span style=" font-size:28pt;">yuzu</span></p></body></html></string> | ||
| 61 | </property> | ||
| 62 | </widget> | ||
| 63 | </item> | ||
| 64 | <item> | ||
| 65 | <widget class="QLabel" name="labelBuildInfo"> | ||
| 66 | <property name="sizePolicy"> | ||
| 67 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | ||
| 68 | <horstretch>0</horstretch> | ||
| 69 | <verstretch>0</verstretch> | ||
| 70 | </sizepolicy> | ||
| 71 | </property> | ||
| 72 | <property name="text"> | ||
| 73 | <string><html><head/><body><p>%1 | %2-%3</p></body></html></string> | ||
| 74 | </property> | ||
| 75 | </widget> | ||
| 76 | </item> | ||
| 77 | <item> | ||
| 78 | <widget class="QLabel" name="labelAbout"> | ||
| 79 | <property name="sizePolicy"> | ||
| 80 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | ||
| 81 | <horstretch>0</horstretch> | ||
| 82 | <verstretch>0</verstretch> | ||
| 83 | </sizepolicy> | ||
| 84 | </property> | ||
| 85 | <property name="text"> | ||
| 86 | <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> | ||
| 87 | <html><head><meta name="qrichtext" content="1" /><style type="text/css"> | ||
| 88 | p, li { white-space: pre-wrap; } | ||
| 89 | </style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> | ||
| 90 | <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:12pt;">yuzu is an experimental open-source emulator for the Nintendo Switch licensed under GPLv2.0 or any later version.</span></p> | ||
| 91 | <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;"><br /></p> | ||
| 92 | <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:12pt;">This software should not be used to play games you have not legally obtained.</span></p></body></html></string> | ||
| 93 | </property> | ||
| 94 | <property name="alignment"> | ||
| 95 | <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> | ||
| 96 | </property> | ||
| 97 | <property name="wordWrap"> | ||
| 98 | <bool>true</bool> | ||
| 99 | </property> | ||
| 100 | </widget> | ||
| 101 | </item> | ||
| 102 | <item> | ||
| 103 | <spacer name="verticalSpacer_2"> | ||
| 104 | <property name="orientation"> | ||
| 105 | <enum>Qt::Vertical</enum> | ||
| 106 | </property> | ||
| 107 | <property name="sizeHint" stdset="0"> | ||
| 108 | <size> | ||
| 109 | <width>20</width> | ||
| 110 | <height>40</height> | ||
| 111 | </size> | ||
| 112 | </property> | ||
| 113 | </spacer> | ||
| 114 | </item> | ||
| 115 | <item> | ||
| 116 | <widget class="QLabel" name="labelLinks"> | ||
| 117 | <property name="text"> | ||
| 118 | <string><html><head/><body><p><a href="https://yuzu-emu.org/"><span style=" text-decoration: underline; color:#0000ff;">Website</span></a> | <a href="https://github.com/yuzu-emu"><span style=" text-decoration: underline; color:#0000ff;">Source Code</span></a> | <a href="https://github.com/yuzu-emu/yuzu/graphs/contributors"><span style=" text-decoration: underline; color:#0000ff;">Contributors</span></a> | <a href="https://github.com/yuzu-emu/yuzu/blob/master/license.txt"><span style=" text-decoration: underline; color:#0000ff;">License</span></a></p></body></html></string> | ||
| 119 | </property> | ||
| 120 | <property name="openExternalLinks"> | ||
| 121 | <bool>true</bool> | ||
| 122 | </property> | ||
| 123 | </widget> | ||
| 124 | </item> | ||
| 125 | <item> | ||
| 126 | <widget class="QLabel" name="labelLiability"> | ||
| 127 | <property name="sizePolicy"> | ||
| 128 | <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> | ||
| 129 | <horstretch>0</horstretch> | ||
| 130 | <verstretch>0</verstretch> | ||
| 131 | </sizepolicy> | ||
| 132 | </property> | ||
| 133 | <property name="text"> | ||
| 134 | <string><html><head/><body><p><span style=" font-size:7pt;">&quot;Nintendo Switch&quot; is a trademark of Nintendo. yuzu is not affiliated with Nintendo in any way.</span></p></body></html></string> | ||
| 135 | </property> | ||
| 136 | </widget> | ||
| 137 | </item> | ||
| 138 | </layout> | ||
| 139 | </item> | ||
| 140 | </layout> | ||
| 141 | </item> | ||
| 142 | <item> | ||
| 143 | <widget class="QDialogButtonBox" name="buttonBox"> | ||
| 144 | <property name="orientation"> | ||
| 145 | <enum>Qt::Horizontal</enum> | ||
| 146 | </property> | ||
| 147 | <property name="standardButtons"> | ||
| 148 | <set>QDialogButtonBox::Ok</set> | ||
| 149 | </property> | ||
| 150 | </widget> | ||
| 151 | </item> | ||
| 152 | </layout> | ||
| 153 | </widget> | ||
| 154 | <resources> | ||
| 155 | <include location="../../dist/icons/icons.qrc"/> | ||
| 156 | </resources> | ||
| 157 | <connections> | ||
| 158 | <connection> | ||
| 159 | <sender>buttonBox</sender> | ||
| 160 | <signal>accepted()</signal> | ||
| 161 | <receiver>AboutDialog</receiver> | ||
| 162 | <slot>accept()</slot> | ||
| 163 | <hints> | ||
| 164 | <hint type="sourcelabel"> | ||
| 165 | <x>248</x> | ||
| 166 | <y>254</y> | ||
| 167 | </hint> | ||
| 168 | <hint type="destinationlabel"> | ||
| 169 | <x>157</x> | ||
| 170 | <y>274</y> | ||
| 171 | </hint> | ||
| 172 | </hints> | ||
| 173 | </connection> | ||
| 174 | <connection> | ||
| 175 | <sender>buttonBox</sender> | ||
| 176 | <signal>rejected()</signal> | ||
| 177 | <receiver>AboutDialog</receiver> | ||
| 178 | <slot>reject()</slot> | ||
| 179 | <hints> | ||
| 180 | <hint type="sourcelabel"> | ||
| 181 | <x>316</x> | ||
| 182 | <y>260</y> | ||
| 183 | </hint> | ||
| 184 | <hint type="destinationlabel"> | ||
| 185 | <x>286</x> | ||
| 186 | <y>274</y> | ||
| 187 | </hint> | ||
| 188 | </hints> | ||
| 189 | </connection> | ||
| 190 | </connections> | ||
| 191 | </ui> | ||
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 99a62c432..5e0d1d0d5 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include "core/gdbstub/gdbstub.h" | 26 | #include "core/gdbstub/gdbstub.h" |
| 27 | #include "core/loader/loader.h" | 27 | #include "core/loader/loader.h" |
| 28 | #include "core/settings.h" | 28 | #include "core/settings.h" |
| 29 | #include "yuzu/about_dialog.h" | ||
| 29 | #include "yuzu/bootmanager.h" | 30 | #include "yuzu/bootmanager.h" |
| 30 | #include "yuzu/configuration/config.h" | 31 | #include "yuzu/configuration/config.h" |
| 31 | #include "yuzu/configuration/configure_dialog.h" | 32 | #include "yuzu/configuration/configure_dialog.h" |
| @@ -264,6 +265,9 @@ void GMainWindow::ConnectMenuEvents() { | |||
| 264 | ui.action_Show_Filter_Bar->setShortcut(tr("CTRL+F")); | 265 | ui.action_Show_Filter_Bar->setShortcut(tr("CTRL+F")); |
| 265 | connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); | 266 | connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); |
| 266 | connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); | 267 | connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); |
| 268 | |||
| 269 | // Help | ||
| 270 | connect(ui.action_About, &QAction::triggered, this, &GMainWindow::OnAbout); | ||
| 267 | } | 271 | } |
| 268 | 272 | ||
| 269 | void GMainWindow::OnDisplayTitleBars(bool show) { | 273 | void GMainWindow::OnDisplayTitleBars(bool show) { |
| @@ -581,6 +585,11 @@ void GMainWindow::OnConfigure() { | |||
| 581 | } | 585 | } |
| 582 | } | 586 | } |
| 583 | 587 | ||
| 588 | void GMainWindow::OnAbout() { | ||
| 589 | AboutDialog aboutDialog(this); | ||
| 590 | aboutDialog.exec(); | ||
| 591 | } | ||
| 592 | |||
| 584 | void GMainWindow::OnToggleFilterBar() { | 593 | void GMainWindow::OnToggleFilterBar() { |
| 585 | game_list->setFilterVisible(ui.action_Show_Filter_Bar->isChecked()); | 594 | game_list->setFilterVisible(ui.action_Show_Filter_Bar->isChecked()); |
| 586 | if (ui.action_Show_Filter_Bar->isChecked()) { | 595 | if (ui.action_Show_Filter_Bar->isChecked()) { |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index e37ef2b85..d3f3b3e59 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -124,6 +124,7 @@ private slots: | |||
| 124 | void OnMenuSelectGameListRoot(); | 124 | void OnMenuSelectGameListRoot(); |
| 125 | void OnMenuRecentFile(); | 125 | void OnMenuRecentFile(); |
| 126 | void OnConfigure(); | 126 | void OnConfigure(); |
| 127 | void OnAbout(); | ||
| 127 | void OnToggleFilterBar(); | 128 | void OnToggleFilterBar(); |
| 128 | void OnDisplayTitleBars(bool); | 129 | void OnDisplayTitleBars(bool); |
| 129 | void ToggleWindowMode(); | 130 | void ToggleWindowMode(); |