diff options
| author | 2017-08-08 20:06:25 -0400 | |
|---|---|---|
| committer | 2017-08-25 23:10:00 -0400 | |
| commit | 59ad93302226f3e65aed1a62ea3c7b58315d0eb6 (patch) | |
| tree | cc670405b320b525ed05b87fd86fa9f53de86fb7 | |
| parent | SidebySide Layout (#2859) (diff) | |
| download | yuzu-59ad93302226f3e65aed1a62ea3c7b58315d0eb6.tar.gz yuzu-59ad93302226f3e65aed1a62ea3c7b58315d0eb6.tar.xz yuzu-59ad93302226f3e65aed1a62ea3c7b58315d0eb6.zip | |
citra_qt: Show one-time callout messages to user.
Diffstat (limited to '')
| -rw-r--r-- | src/citra_qt/configuration/config.cpp | 2 | ||||
| -rw-r--r-- | src/citra_qt/main.cpp | 44 | ||||
| -rw-r--r-- | src/citra_qt/main.h | 2 | ||||
| -rw-r--r-- | src/citra_qt/ui_settings.h | 2 |
4 files changed, 50 insertions, 0 deletions
diff --git a/src/citra_qt/configuration/config.cpp b/src/citra_qt/configuration/config.cpp index 6e42db007..7386814b3 100644 --- a/src/citra_qt/configuration/config.cpp +++ b/src/citra_qt/configuration/config.cpp | |||
| @@ -194,6 +194,7 @@ void Config::ReadValues() { | |||
| 194 | UISettings::values.show_status_bar = qt_config->value("showStatusBar", true).toBool(); | 194 | UISettings::values.show_status_bar = qt_config->value("showStatusBar", true).toBool(); |
| 195 | UISettings::values.confirm_before_closing = qt_config->value("confirmClose", true).toBool(); | 195 | UISettings::values.confirm_before_closing = qt_config->value("confirmClose", true).toBool(); |
| 196 | UISettings::values.first_start = qt_config->value("firstStart", true).toBool(); | 196 | UISettings::values.first_start = qt_config->value("firstStart", true).toBool(); |
| 197 | UISettings::values.callout_flags = qt_config->value("calloutFlags", 0).toUInt(); | ||
| 197 | 198 | ||
| 198 | qt_config->endGroup(); | 199 | qt_config->endGroup(); |
| 199 | } | 200 | } |
| @@ -320,6 +321,7 @@ void Config::SaveValues() { | |||
| 320 | qt_config->setValue("showStatusBar", UISettings::values.show_status_bar); | 321 | qt_config->setValue("showStatusBar", UISettings::values.show_status_bar); |
| 321 | qt_config->setValue("confirmClose", UISettings::values.confirm_before_closing); | 322 | qt_config->setValue("confirmClose", UISettings::values.confirm_before_closing); |
| 322 | qt_config->setValue("firstStart", UISettings::values.first_start); | 323 | qt_config->setValue("firstStart", UISettings::values.first_start); |
| 324 | qt_config->setValue("calloutFlags", UISettings::values.callout_flags); | ||
| 323 | 325 | ||
| 324 | qt_config->endGroup(); | 326 | qt_config->endGroup(); |
| 325 | } | 327 | } |
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index c1ae0ccc8..a8bf6201a 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -48,6 +48,47 @@ | |||
| 48 | Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin); | 48 | Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin); |
| 49 | #endif | 49 | #endif |
| 50 | 50 | ||
| 51 | /** | ||
| 52 | * "Callouts" are one-time instructional messages shown to the user. In the config settings, there | ||
| 53 | * is a bitfield "callout_flags" options, used to track if a message has already been shown to the | ||
| 54 | * user. This is 32-bits - if we have more than 32 callouts, we should retire and recyle old ones. | ||
| 55 | */ | ||
| 56 | enum class CalloutFlag : uint32_t { | ||
| 57 | Telemetry = 0x1, | ||
| 58 | }; | ||
| 59 | |||
| 60 | static void ShowCalloutMessage(const QString& message, CalloutFlag flag) { | ||
| 61 | if (UISettings::values.callout_flags & static_cast<uint32_t>(flag)) { | ||
| 62 | return; | ||
| 63 | } | ||
| 64 | |||
| 65 | UISettings::values.callout_flags |= static_cast<uint32_t>(flag); | ||
| 66 | |||
| 67 | QMessageBox msg; | ||
| 68 | msg.setText(message); | ||
| 69 | msg.setStandardButtons(QMessageBox::Ok); | ||
| 70 | msg.setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); | ||
| 71 | msg.setStyleSheet("QLabel{min-width: 900px;}"); | ||
| 72 | msg.exec(); | ||
| 73 | } | ||
| 74 | |||
| 75 | void GMainWindow::ShowCallouts() { | ||
| 76 | static const QString telemetry_message = | ||
| 77 | tr("To help improve Citra, the Citra Team collects anonymous usage data. No private or " | ||
| 78 | "personally identifying information is collected. This data helps us to understand how " | ||
| 79 | "people use Citra and prioritize our efforts. Furthermore, it helps us to more easily " | ||
| 80 | "identify emulation bugs and performance issues. This data includes:<ul><li>Information" | ||
| 81 | " about the version of Citra you are using</li><li>Performance data about the games you " | ||
| 82 | "play</li><li>Your configuration settings</li><li>Information about your computer " | ||
| 83 | "hardware</li><li>Emulation errors and crash information</li></ul>By default, this " | ||
| 84 | "feature is enabled. To disable this feature, click 'Emulation' from the menu and then " | ||
| 85 | "select 'Configure...'. Then, on the 'Web' tab, uncheck 'Share anonymous usage data with" | ||
| 86 | " the Citra team'. <br/><br/>By using this software, you agree to the above terms.<br/>" | ||
| 87 | "<br/><a href='https://citra-emu.org/entry/telemetry-and-why-thats-a-good-thing/'>Learn " | ||
| 88 | "more</a>"); | ||
| 89 | ShowCalloutMessage(telemetry_message, CalloutFlag::Telemetry); | ||
| 90 | } | ||
| 91 | |||
| 51 | GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) { | 92 | GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) { |
| 52 | Pica::g_debug_context = Pica::DebugContext::Construct(); | 93 | Pica::g_debug_context = Pica::DebugContext::Construct(); |
| 53 | setAcceptDrops(true); | 94 | setAcceptDrops(true); |
| @@ -73,6 +114,9 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) { | |||
| 73 | 114 | ||
| 74 | UpdateUITheme(); | 115 | UpdateUITheme(); |
| 75 | 116 | ||
| 117 | // Show one-time "callout" messages to the user | ||
| 118 | ShowCallouts(); | ||
| 119 | |||
| 76 | QStringList args = QApplication::arguments(); | 120 | QStringList args = QApplication::arguments(); |
| 77 | if (args.length() >= 2) { | 121 | if (args.length() >= 2) { |
| 78 | BootGame(args[1]); | 122 | BootGame(args[1]); |
diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 360de2ced..d59a6d67d 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h | |||
| @@ -80,6 +80,8 @@ private: | |||
| 80 | void BootGame(const QString& filename); | 80 | void BootGame(const QString& filename); |
| 81 | void ShutdownGame(); | 81 | void ShutdownGame(); |
| 82 | 82 | ||
| 83 | void ShowCallouts(); | ||
| 84 | |||
| 83 | /** | 85 | /** |
| 84 | * Stores the filename in the recently loaded files list. | 86 | * Stores the filename in the recently loaded files list. |
| 85 | * The new filename is stored at the beginning of the recently loaded files list. | 87 | * The new filename is stored at the beginning of the recently loaded files list. |
diff --git a/src/citra_qt/ui_settings.h b/src/citra_qt/ui_settings.h index 025c73f84..d85c92765 100644 --- a/src/citra_qt/ui_settings.h +++ b/src/citra_qt/ui_settings.h | |||
| @@ -48,6 +48,8 @@ struct Values { | |||
| 48 | 48 | ||
| 49 | // Shortcut name <Shortcut, context> | 49 | // Shortcut name <Shortcut, context> |
| 50 | std::vector<Shortcut> shortcuts; | 50 | std::vector<Shortcut> shortcuts; |
| 51 | |||
| 52 | uint32_t callout_flags; | ||
| 51 | }; | 53 | }; |
| 52 | 54 | ||
| 53 | extern Values values; | 55 | extern Values values; |