summaryrefslogtreecommitdiff
path: root/src/citra_qt/main.cpp
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/citra_qt/main.cpp
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/citra_qt/main.cpp')
-rw-r--r--src/citra_qt/main.cpp86
1 files changed, 52 insertions, 34 deletions
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;