summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar TheKoopaKingdom2017-04-13 01:15:23 -0400
committerGravatar TheKoopaKingdom2017-06-02 18:28:14 -0400
commit0409bdfea5ea046e3d040ab494b8a0764fd35424 (patch)
tree94540c98e22d04a8a1d6ca4d24ac3ae429ed3d97 /src
parentAdded message to status bar to show core errors ignored by the user. (diff)
downloadyuzu-0409bdfea5ea046e3d040ab494b8a0764fd35424.tar.gz
yuzu-0409bdfea5ea046e3d040ab494b8a0764fd35424.tar.xz
yuzu-0409bdfea5ea046e3d040ab494b8a0764fd35424.zip
Optimized messages that were repetitive and added ability for core errors to specify more details optionally.
Diffstat (limited to 'src')
-rw-r--r--src/citra_qt/bootmanager.cpp2
-rw-r--r--src/citra_qt/bootmanager.h2
-rw-r--r--src/citra_qt/main.cpp86
-rw-r--r--src/citra_qt/main.h2
-rw-r--r--src/core/core.h17
5 files changed, 70 insertions, 39 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp
index 0fdf0c600..a8a4aed8b 100644
--- a/src/citra_qt/bootmanager.cpp
+++ b/src/citra_qt/bootmanager.cpp
@@ -39,7 +39,7 @@ void EmuThread::run() {
39 39
40 Core::System::ResultStatus result = Core::System::GetInstance().RunLoop(); 40 Core::System::ResultStatus result = Core::System::GetInstance().RunLoop();
41 if (result != Core::System::ResultStatus::Success) { 41 if (result != Core::System::ResultStatus::Success) {
42 emit ErrorThrown(result); 42 emit ErrorThrown(result, Core::System::GetInstance().GetStatusDetails());
43 } 43 }
44 44
45 was_active = running || exec_step; 45 was_active = running || exec_step;
diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h
index c5430a3fa..b12b37132 100644
--- a/src/citra_qt/bootmanager.h
+++ b/src/citra_qt/bootmanager.h
@@ -99,7 +99,7 @@ signals:
99 */ 99 */
100 void DebugModeLeft(); 100 void DebugModeLeft();
101 101
102 void ErrorThrown(Core::System::ResultStatus); 102 void ErrorThrown(Core::System::ResultStatus, boost::optional<std::string>);
103}; 103};
104 104
105class GRenderWindow : public QWidget, public EmuWindow { 105class GRenderWindow : public QWidget, public EmuWindow {
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp
index 6121d4728..1688e55cd 100644
--- a/src/citra_qt/main.cpp
+++ b/src/citra_qt/main.cpp
@@ -553,8 +553,10 @@ void GMainWindow::OnMenuRecentFile() {
553void GMainWindow::OnStartGame() { 553void GMainWindow::OnStartGame() {
554 emu_thread->SetRunning(true); 554 emu_thread->SetRunning(true);
555 qRegisterMetaType<Core::System::ResultStatus>("Core::System::ResultStatus"); 555 qRegisterMetaType<Core::System::ResultStatus>("Core::System::ResultStatus");
556 connect(emu_thread.get(), SIGNAL(ErrorThrown(Core::System::ResultStatus)), this, 556 qRegisterMetaType<boost::optional<std::string>>("boost::optional<std::string>");
557 SLOT(OnCoreError(Core::System::ResultStatus))); 557 connect(emu_thread.get(),
558 SIGNAL(ErrorThrown(Core::System::ResultStatus, boost::optional<std::string>)), this,
559 SLOT(OnCoreError(Core::System::ResultStatus, boost::optional<std::string>)));
558 560
559 ui.action_Start->setEnabled(false); 561 ui.action_Start->setEnabled(false);
560 ui.action_Start->setText(tr("Continue")); 562 ui.action_Start->setText(tr("Continue"));
@@ -647,52 +649,68 @@ void GMainWindow::UpdateStatusBar() {
647 emu_frametime_label->setVisible(true); 649 emu_frametime_label->setVisible(true);
648} 650}
649 651
650void GMainWindow::OnCoreError(Core::System::ResultStatus result) { 652void GMainWindow::OnCoreError(Core::System::ResultStatus result,
653 boost::optional<std::string> details) {
654 QMessageBox::StandardButton answer;
655 QString status_message;
656 const QString common_message =
657 tr("The game you are trying to load requires additional files from your 3DS to be dumped "
658 "before playing.<br/><br/>For more information on dumping these files, please see the "
659 "following wiki page: <a "
660 "href='https://citra-emu.org/wiki/"
661 "Dumping-System-Archives-and-the-Shared-Fonts-from-a-3DS-Console/'>Dumping System "
662 "Archives and the Shared Fonts from a 3DS Console</a>.<br/><br/>Would you like to quit "
663 "back to the game list?");
651 switch (result) { 664 switch (result) {
652 case Core::System::ResultStatus::ErrorSystemFiles: 665 case Core::System::ResultStatus::ErrorSystemFiles: {
653 QMessageBox::critical( 666 QString message = "Citra was unable to locate a 3DS system archive";
654 this, "System Archive Not Found", 667 if (details)
655 "Citra was unable to locate the 3DS system archive.<br/><br/>" 668 message.append(tr(": %1. ").arg(details.get().c_str()));
656 "The game you are trying to load requires additional files from your 3DS to be dumped " 669 else
657 "before playing.<br/><br/>" 670 message.append(". ");
658 "For more information on dumping these files, please see the following wiki page: " 671 message.append(common_message);
659 "<a " 672
660 "href='https://citra-emu.org/wiki/" 673 answer = QMessageBox::question(this, tr("System Archive Not Found"), message,
661 "Dumping-System-Archives-and-the-Shared-Fonts-from-a-3DS-Console/'>Dumping System " 674 QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
662 "Archives and the Shared Fonts from a 3DS Console</a>" 675 status_message = "System Archive Missing";
663 ".");
664 break; 676 break;
677 }
665 678
666 case Core::System::ResultStatus::ErrorSharedFont: 679 case Core::System::ResultStatus::ErrorSharedFont: {
667 QMessageBox::critical( 680 QString message = tr("Citra was unable to locate the 3DS shared fonts. ");
668 this, "Shared Fonts Not Found", 681 message.append(common_message);
669 "Citra was unable to locate the 3DS shared fonts.<br/><br/>" 682 answer = QMessageBox::question(this, tr("Shared Fonts Not Found"), message,
670 "The game you are trying to load requires additional files from your 3DS to be dumped " 683 QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
671 "before playing.<br/><br/>" 684 status_message = "Shared Font Missing";
672 "For more information on dumping these files, please see the following wiki page: "
673 "<a "
674 "href='https://citra-emu.org/wiki/"
675 "Dumping-System-Archives-and-the-Shared-Fonts-from-a-3DS-Console/'>Dumping System "
676 "Archives and the Shared Fonts from a 3DS Console</a>"
677 ".");
678 break; 685 break;
686 }
679 687
680 default: 688 default:
681 QMessageBox::critical( 689 answer = QMessageBox::question(
682 this, "Fatal Error", 690 this, tr("Fatal Error"),
683 "Citra has encountered a fatal error, please see the log for more details. " 691 tr("Citra has encountered a fatal error, please see the log for more details. "
684 "For more information on accessing the log, please see the following page: " 692 "For more information on accessing the log, please see the following page: "
685 "<a href='https://community.citra-emu.org/t/how-to-upload-the-log-file/296'>How to " 693 "<a href='https://community.citra-emu.org/t/how-to-upload-the-log-file/296'>How to "
686 "Upload the Log File</a>."); 694 "Upload the Log File</a>.<br/><br/>Would you like to quit back to the game list?"),
695 QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
696 status_message = "Fatal Error encountered.";
687 break; 697 break;
688 } 698 }
699
700 if (answer == QMessageBox::Yes) {
701 if (emu_thread != nullptr)
702 ShutdownGame();
703 } else {
704 message_label->setText(status_message);
705 message_label->setVisible(true);
706 }
689} 707}
690 708
691bool GMainWindow::ConfirmClose() { 709bool GMainWindow::ConfirmClose() {
692 if (emu_thread == nullptr || !UISettings::values.confirm_before_closing) 710 if (emu_thread == nullptr || !UISettings::values.confirm_before_closing)
693 return true; 711 return true;
694 712
695 auto answer = 713 QMessageBox::StandardButton answer =
696 QMessageBox::question(this, tr("Citra"), tr("Are you sure you want to close Citra?"), 714 QMessageBox::question(this, tr("Citra"), tr("Are you sure you want to close Citra?"),
697 QMessageBox::Yes | QMessageBox::No, QMessageBox::No); 715 QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
698 return answer != QMessageBox::No; 716 return answer != QMessageBox::No;
diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h
index 3ecbc001e..eb2b055f6 100644
--- a/src/citra_qt/main.h
+++ b/src/citra_qt/main.h
@@ -125,7 +125,7 @@ private slots:
125 void OnDisplayTitleBars(bool); 125 void OnDisplayTitleBars(bool);
126 void ToggleWindowMode(); 126 void ToggleWindowMode();
127 void OnCreateGraphicsSurfaceViewer(); 127 void OnCreateGraphicsSurfaceViewer();
128 void OnCoreError(Core::System::ResultStatus); 128 void OnCoreError(Core::System::ResultStatus, boost::optional<std::string>);
129 129
130private: 130private:
131 void UpdateStatusBar(); 131 void UpdateStatusBar();
diff --git a/src/core/core.h b/src/core/core.h
index a7b4f8d62..bc363ed97 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -6,6 +6,9 @@
6 6
7#include <memory> 7#include <memory>
8#include <string> 8#include <string>
9
10#include <boost/optional.hpp>
11
9#include "common/common_types.h" 12#include "common/common_types.h"
10#include "core/memory.h" 13#include "core/memory.h"
11#include "core/perf_stats.h" 14#include "core/perf_stats.h"
@@ -112,8 +115,16 @@ public:
112 return status; 115 return status;
113 } 116 }
114 117
115 void SetStatus(ResultStatus newStatus) { 118 void SetStatus(ResultStatus new_status, std::string details = std::string()) {
116 status = newStatus; 119 status = new_status;
120 if (details == std::string())
121 status_details = boost::none;
122 else
123 status_details = details;
124 }
125
126 boost::optional<std::string> GetStatusDetails() {
127 return status_details;
117 } 128 }
118 129
119private: 130private:
@@ -141,7 +152,9 @@ private:
141 std::unique_ptr<Core::TelemetrySession> telemetry_session; 152 std::unique_ptr<Core::TelemetrySession> telemetry_session;
142 153
143 static System s_instance; 154 static System s_instance;
155
144 ResultStatus status; 156 ResultStatus status;
157 boost::optional<std::string> status_details;
145}; 158};
146 159
147inline ARM_Interface& CPU() { 160inline ARM_Interface& CPU() {