diff --git a/0001-MGR-support-wxWidgets-without-webview.patch b/0001-MGR-support-wxWidgets-without-webview.patch new file mode 100644 index 0000000..2bdda12 --- /dev/null +++ b/0001-MGR-support-wxWidgets-without-webview.patch @@ -0,0 +1,111 @@ +From 84c17bc232a7721ab0687228af5b3acfba12ad75 Mon Sep 17 00:00:00 2001 +From: Jan Engelhardt +Date: Fri, 8 Sep 2017 01:55:57 +0200 +Subject: [PATCH] MGR: support wxWidgets without webview + +If wxWidgets is built without support for the webview widget, make do +with a wxHtmlWindow instead. +--- + clientgui/NoticeListCtrl.cpp | 25 +++++++++++++++++++++++++ + clientgui/NoticeListCtrl.h | 8 ++++++++ + 2 files changed, 33 insertions(+) + +Index: boinc-client_release-7.6-7.6.33/clientgui/NoticeListCtrl.cpp +=================================================================== +--- boinc-client_release-7.6-7.6.33.orig/clientgui/NoticeListCtrl.cpp ++++ boinc-client_release-7.6-7.6.33/clientgui/NoticeListCtrl.cpp +@@ -49,10 +49,14 @@ IMPLEMENT_DYNAMIC_CLASS( CNoticeListCtrl + + BEGIN_EVENT_TABLE( CNoticeListCtrl, wxWindow ) + ++#if wxUSE_WEBVIEW + ////@begin CNoticeListCtrl event table entries + EVT_WEBVIEW_NAVIGATING(ID_LIST_NOTIFICATIONSVIEW, CNoticeListCtrl::OnLinkClicked) + EVT_WEBVIEW_ERROR(ID_LIST_NOTIFICATIONSVIEW, CNoticeListCtrl::OnWebViewError) + ////@end CNoticeListCtrl event table entries ++#else ++ EVT_HTML_LINK_CLICKED(ID_LIST_NOTIFICATIONSVIEW, CNoticeListCtrl::OnLinkClicked) ++#endif + + END_EVENT_TABLE() + +@@ -84,7 +88,11 @@ bool CNoticeListCtrl::Create( wxWindow* + wxWindow::Create( parent, ID_LIST_NOTIFICATIONSVIEW, wxDefaultPosition, wxDefaultSize, + wxSUNKEN_BORDER | wxTAB_TRAVERSAL ); + ++#if wxUSE_WEBVIEW + m_browser = wxWebView::New( this, ID_LIST_NOTIFICATIONSVIEW ); ++#else ++ m_browser = new wxHtmlWindow(this, ID_LIST_NOTIFICATIONSVIEW); ++#endif + ////@end CNoticeListCtrl creation + + wxBoxSizer *topsizer; +@@ -236,7 +244,11 @@ void CNoticeListCtrl::SetItemCount(int n + m_noticesBody += strBuffer; + } + m_noticesBody += wxT(""); ++#if wxUSE_WEBVIEW + m_browser->SetPage(m_noticesBody, wxT("http://")); ++#else ++ m_browser->SetPage(m_noticesBody); ++#endif + } + + +@@ -246,6 +258,7 @@ void CNoticeListCtrl::Clear() { + } + + ++#if wxUSE_WEBVIEW + void CNoticeListCtrl::OnLinkClicked( wxWebViewEvent& event ) { + if (event.GetURL().StartsWith(wxT("http://")) || event.GetURL().StartsWith(wxT("https://"))) { + event.Veto(); // Tell wxWebView not to follow link +@@ -262,6 +275,18 @@ void CNoticeListCtrl::OnWebViewError( wx + + event.Skip(); + } ++#else ++void CNoticeListCtrl::OnLinkClicked(wxHtmlLinkEvent &event) ++{ ++ wxString url = event.GetLinkInfo().GetHref(); ++ if (!url.StartsWith(wxT("http://")) && !url.StartsWith(wxT("https://"))) { ++ event.Skip(); ++ return; ++ } ++ event.Skip(); // Tell element not to follow link ++ wxLaunchDefaultBrowser(url); ++} ++#endif + + + /*! +Index: boinc-client_release-7.6-7.6.33/clientgui/NoticeListCtrl.h +=================================================================== +--- boinc-client_release-7.6-7.6.33.orig/clientgui/NoticeListCtrl.h ++++ boinc-client_release-7.6-7.6.33/clientgui/NoticeListCtrl.h +@@ -45,8 +45,12 @@ public: + + ////@begin CNoticeListCtrl event handler declarations + ++#if defined(wxUSE_WEBVIEW) && wxUSE_WEBVIEW + void OnLinkClicked( wxWebViewEvent& event ); + void OnWebViewError( wxWebViewEvent& event ); ++#else ++ void OnLinkClicked(wxHtmlLinkEvent &); ++#endif + + ////@end CNoticeListCtrl event handler declarations + +@@ -56,7 +60,11 @@ public: + bool m_bDisplayFetchingNotices; + bool m_bDisplayEmptyNotice; + private: ++#if wxUSE_WEBVIEW + wxWebView* m_browser; ++#else ++ wxHtmlWindow *m_browser; ++#endif + bool m_bNeedsReloading; + int m_itemCount; + wxString m_noticesBody; diff --git a/boinc-client.changes b/boinc-client.changes index 1d97885..d793804 100644 --- a/boinc-client.changes +++ b/boinc-client.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Sep 8 09:38:10 UTC 2017 - jengelh@inai.de + +- Add 0001-MGR-support-wxWidgets-without-webview.patch + ------------------------------------------------------------------- Sat Sep 2 22:12:09 UTC 2017 - jengelh@inai.de diff --git a/boinc-client.spec b/boinc-client.spec index a3a4e57..b73a132 100644 --- a/boinc-client.spec +++ b/boinc-client.spec @@ -51,6 +51,7 @@ Patch1: boinc-guirpcauth.patch Patch2: boinc-docbook2x.patch Patch3: 0001-Fix-1530-null-pointer-dereference.patch Patch4: xlocale.patch +Patch5: 0001-MGR-support-wxWidgets-without-webview.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # BuildRequires: Mesa-devel @@ -161,7 +162,7 @@ This package contains documentation files for the BOINC client. %prep %setup -q -n %{name}_release-7.6-%{version} -D -a 1 -%patch -P 1 -P 2 -P 3 -P 4 -p1 +%patch -P 1 -P 2 -P 3 -P 4 -P 5 -p1 %build # Install user hints