From 553ac7e7cd8a1cee19cc149c190edf571c742e7e Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Sat, 23 Jun 2018 19:02:54 -0700 Subject: [PATCH] Add nag dialog to get users to explain why they still use DolphinWX --- Source/Core/DolphinWX/Frame.h | 2 + Source/Core/DolphinWX/FrameTools.cpp | 77 ++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) diff --git a/Source/Core/DolphinWX/Frame.h b/Source/Core/DolphinWX/Frame.h index 4f2178862a..d1501539be 100644 --- a/Source/Core/DolphinWX/Frame.h +++ b/Source/Core/DolphinWX/Frame.h @@ -176,6 +176,8 @@ private: wxString m_aui_fullscreen_perspective; wxString m_aui_current_perspective; + bool m_qt_nag_shown = false; + #ifdef __WXGTK__ std::recursive_mutex m_keystate_lock; #endif diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index d1f8c5ff1d..496a6e1065 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -17,10 +17,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -297,6 +299,72 @@ void CFrame::OpenGeneralConfiguration(wxWindowID tab_id) // Menu items +class QtFeedback : public wxDialog +{ +public: + QtFeedback(wxWindow* parent) + : wxDialog(parent, wxID_ANY, _("Feedback Request"), wxDefaultPosition, wxDefaultSize, + wxDEFAULT_DIALOG_STYLE & ~wxCLOSE_BOX) + { + const wxString text = _("You are currently running the wxWidgets version of Dolphin.\n" + "Dolphin will soon complete the move to the Qt-based user " + "interface, and this wxWidgets version will be removed.\n" + "\n" + "Please use the Qt version in the future.\n" + "\n" + "If you're purposefully not using the Qt version for any reason, " + "please let us know why at this forum thread:"); + wxStaticText* const text_window = new wxStaticText(this, wxID_ANY, text); + + wxHyperlinkCtrl* const thread_link = + new wxHyperlinkCtrl(this, wxID_ANY, _("Qt Feedback Thread"), + "https://forums.dolphin-emu.org/" + "Thread-feedback-required-what-benefits-are-there-" + "to-the-wxwidgets-gui"); + + m_dismiss = new wxButton(this, wxID_CLOSE); + m_dismiss->Bind(wxEVT_BUTTON, &QtFeedback::OnCloseClicked, this); + m_dismiss->Disable(); + + const int space20 = FromDIP(20); + const int space40 = FromDIP(40); + + wxStdDialogButtonSizer* buttons = new wxStdDialogButtonSizer(); + buttons->AddButton(m_dismiss); + buttons->Realize(); + + wxBoxSizer* const message_sizer = new wxBoxSizer(wxVERTICAL); + message_sizer->Add(text_window, wxSizerFlags().Center()); + message_sizer->Add(thread_link, wxSizerFlags().Left()); + message_sizer->Add(buttons, 0, wxALIGN_CENTER_HORIZONTAL); + + wxBoxSizer* const pad_sizer = new wxBoxSizer(wxHORIZONTAL); + pad_sizer->AddSpacer(space40); + pad_sizer->Add(message_sizer); + pad_sizer->AddSpacer(space40); + + wxBoxSizer* const main_sizer = new wxBoxSizer(wxVERTICAL); + main_sizer->AddSpacer(space20); + main_sizer->Add(pad_sizer); + main_sizer->AddSpacer(space20); + + SetSizerAndFit(main_sizer); + Center(); + SetFocus(); + + m_dimiss_lock.SetOwner(this); + Bind(wxEVT_TIMER, &QtFeedback::DismissLockExpired, this, m_dimiss_lock.GetId()); + m_dimiss_lock.Start(10 * 1000, wxTIMER_ONE_SHOT); + } + +private: + void DismissLockExpired(wxTimerEvent&) { m_dismiss->Enable(); } + void OnCloseClicked(wxCommandEvent&) { Close(); } + + wxButton* m_dismiss = nullptr; + wxTimer m_dimiss_lock; +}; + // Start the game or change the disc. // Boot priority: // 1. Show the game list and boot the selected game. @@ -310,6 +378,15 @@ void CFrame::BootGame(const std::string& filename, const std::optional