diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2018-06-24 06:11:28 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-24 06:11:28 +0200 |
| commit | 7388094e837dc2da9288769db689cd386c7f05bb (patch) | |
| tree | 2446e65979e29f1f85b53f03711c0186525049c8 /Source/Core/DolphinWX/FrameTools.cpp | |
| parent | b3fa5a4f2e8987888cae755791877da9c5f0a33d (diff) | |
| parent | 553ac7e7cd8a1cee19cc149c190edf571c742e7e (diff) | |
Merge pull request #7165 from shuffle2/qt-nag
Add nag dialog to get users to explain why they still use DolphinWX
Diffstat (limited to 'Source/Core/DolphinWX/FrameTools.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/FrameTools.cpp | 77 |
1 files changed, 77 insertions, 0 deletions
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 <wx/bitmap.h> #include <wx/filedlg.h> #include <wx/filefn.h> +#include <wx/hyperlink.h> #include <wx/menu.h> #include <wx/msgdlg.h> #include <wx/panel.h> #include <wx/progdlg.h> +#include <wx/stattext.h> #include <wx/statusbr.h> #include <wx/toolbar.h> #include <wx/toplevel.h> @@ -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<std::stri if (Core::GetState() != Core::State::Uninitialized) return; + if (!m_qt_nag_shown) + { + m_qt_nag_shown = true; + QtFeedback feedback(this); + HotkeyManagerEmu::Enable(false); + feedback.ShowModal(); + HotkeyManagerEmu::Enable(true); + } + // Start filename if non empty. // Start the selected ISO, or try one of the saved paths. // If all that fails, ask to add a dir and don't boot |
