//all messageboxes need to be modal, updater closes immeadiately when receiving the UpdateFinished event void UpdaterClass::OnDownloadEvent( wxCommandEvent& event ) { int code = event.GetInt(); if ( code != 0) customMessageBox(SL_MAIN_ICON, _("There was an error downloading for the latest version.\nPlease try again later.\nIf the problem persists, please use Help->Report Bug to report this bug."), _("Error")); else { if (!PostMinGW44( m_newexe ) ) { customMessageBox(SL_MAIN_ICON, _("Automatic update failed\n\nyou will be redirected to a web page with instructions and the download link will be opened in your browser."), _("Updater error.") ); OpenWebBrowser( _T("http://projects.springlobby.info/wiki/springlobby/Install#Windows-Binary") ); OpenWebBrowser( GetDownloadUrl( m_latest_version ) ); } if ( !UpdateExe( m_newexe , false ) ) { customMessageBox(SL_MAIN_ICON, wxFormat( _("There was an error while trying to replace the current executable version.\n Please manually copy springlobby.exe from: %s\n to: %s\n") ) % m_newexe % m_currentexe, _("Error") ); } else { bool locale_ok = UpdateLocale( m_newexe, false ); if ( locale_ok ) { customMessageBox(SL_MAIN_ICON, IdentityString( _("Update complete. \nPlease restart %s now.") ), _("Success")); } else { customMessageBox(SL_MAIN_ICON, IdentityString( _("Binary updated successfully. \nSome translation files could not be updated.\nPlease report this in #springlobby. \nPlease restart %s now.") ), _("Partial success") ); } wxRmdir( m_newexe ); } } GetGlobalEventSender( GlobalEvents::UpdateFinished ).SendEvent( 0 ); }
void ChatPanel::OnLinkEvent(wxTextUrlEvent& event) { if (!event.GetMouseEvent().LeftDown()) return; wxString url = m_chatlog_text->GetRange(event.GetURLStart(), event.GetURLEnd()); OpenWebBrowser(url); }
int CWebView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (__super::OnCreate(lpCreateStruct) == -1) return -1; #ifndef _DEBUG GetWebBrowser2()->put_Silent(VARIANT_TRUE); #endif // !_DEBUG OpenWebBrowser(); return 0; }
void ServerEvents::OnFileDownload( bool autolaunch, bool autoclose, bool /*disconnectonrefuse*/, const wxString& FileName, const wxString& url, const wxString& description ) { wxString refinedurl; if ( url.Find(_T("http://")) != wxNOT_FOUND ) refinedurl = url.AfterFirst(_T('/')).AfterFirst(_T('/')); else refinedurl = url; bool result = ui().Ask( _("Download update"), wxString::Format( _("Would you like to download %s ? The file offers the following updates:\n\n%s\n\nThe download will be started in the background, you will be notified on operation completed."), url.c_str(), description.c_str() ) ); if ( result ) { m_autoclose = autoclose; m_autolaunch = autolaunch; wxString filename; if ( FileName != _T("*") ) filename = FileName; else filename = _T("Spring installer.exe"); m_savepath = sett().GetCurrentUsedDataDir() + filename; wxLogMessage(_T("downloading update in: %s, from: %s"),m_savepath.c_str(),refinedurl.c_str()); OpenWebBrowser( url ); //new HttpDownloaderThread<ServerEvents>( refinedurl, m_savepath, *this, wxID_HIGHEST + 100, true, false ); } }
void OnChangelog( wxCommandEvent& ) { OpenWebBrowser( _T("https://github.com/springlobby/springlobby/commits/master") ); }
void MainWindow::OnMenuFirstStart(wxCommandEvent& /*event*/) { OpenWebBrowser(_T("https://github.com/springlobby/springlobby/wiki/Userdoc")); }
void slAboutBox::showDocs() { OpenWebBrowser( _T("https://github.com/springlobby/springlobby/wiki/") ); }
void slAboutBox::openContactPage() { OpenWebBrowser(_T("https://github.com/springlobby?tab=members")); }
void slAboutBox::openNewTicket() { OpenWebBrowser(_T("https://github.com/springlobby/springlobby/issues/new")); }
void slHtmlWindow::OnLinkClicked( wxHtmlLinkEvent& evt ) { wxString url = evt.GetLinkInfo().GetHref(); OpenWebBrowser( url ); }
void slAboutBox::showChangelog() { OpenWebBrowser(_T("https://github.com/springlobby/springlobby/blob/master/ChangeLog")); }
void SimpleFront::OnHelp( wxCommandEvent& ) { OpenWebBrowser( SLcustomizations().GetHelpUrl() ); }