diff options
author | Susobhan Ghosh <susobhang70@gmail.com> | 2016-05-08 15:33:46 +0530 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2016-05-17 20:51:32 +0000 |
commit | bdcb496858a7d37e7d24436dcededa8613469df0 (patch) | |
tree | 40c2febcabd683e59275a7f082bba4611cb98599 /cui | |
parent | 6c98575877a64ca7afeb98c5d20e27ba47c14485 (diff) |
tdf#88502 Added error box to denote connection errors instead of progress bar
Change-Id: I8217fa487ed58f5d396e8769c76dd2d16f390472
Reviewed-on: https://gerrit.libreoffice.org/24757
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/personalization.cxx | 38 | ||||
-rw-r--r-- | cui/source/options/personalization.hxx | 2 |
2 files changed, 24 insertions, 16 deletions
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index 486529de6229..b752f30ae44e 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -225,7 +225,7 @@ const OUString& SelectPersonaDialog::GetAppliedPersonaSetting() const return m_aAppliedPersona; } -void SelectPersonaDialog::SetProgress( OUString& rProgress ) +void SelectPersonaDialog::SetProgress( const OUString& rProgress ) { if(rProgress.isEmpty()) m_pProgressLabel->Hide(); @@ -677,7 +677,7 @@ void SearchAndParseThread::execute() if( m_aURL.startsWith( "https://" ) ) { m_pPersonaDialog->ClearSearchResults(); - OUString sProgress( CUI_RES( RID_SVXSTR_SEARCHING ) ); + OUString sProgress( CUI_RES( RID_SVXSTR_SEARCHING ) ), sError; m_pPersonaDialog->SetProgress( sProgress ); PersonasDocHandler* pHandler = new PersonasDocHandler(); @@ -704,9 +704,11 @@ void SearchAndParseThread::execute() { // in case of a returned CommandFailedException // SimpleFileAccess serves it, returning an empty stream - sProgress = CUI_RES(RID_SVXSTR_SEARCHERROR); - sProgress = sProgress.replaceAll("%1", m_aURL); - m_pPersonaDialog->SetProgress(sProgress); + sError = CUI_RES(RID_SVXSTR_SEARCHERROR); + sError = sError.replaceAll("%1", m_aURL); + m_pPersonaDialog->SetProgress( OUString() ); + ScopedVclPtrInstance< ErrorBox > aBox( nullptr, WB_OK, sError); + aBox->Execute(); return; } } @@ -714,9 +716,11 @@ void SearchAndParseThread::execute() { // a catch all clause, in case the exception is not // served elsewhere - sProgress = CUI_RES(RID_SVXSTR_SEARCHERROR); - sProgress = sProgress.replaceAll("%1", m_aURL); - m_pPersonaDialog->SetProgress(sProgress); + sError = CUI_RES(RID_SVXSTR_SEARCHERROR); + sError = sError.replaceAll("%1", m_aURL); + m_pPersonaDialog->SetProgress( OUString() ); + ScopedVclPtrInstance< ErrorBox > aBox( nullptr, WB_OK, sError ); + aBox->Execute(); return; } @@ -752,9 +756,11 @@ void SearchAndParseThread::execute() { if( m_bDirectURL ) { - sProgress = CUI_RES(RID_SVXSTR_SEARCHERROR); - sProgress = sProgress.replaceAll("%1", m_aURL); - m_pPersonaDialog->SetProgress(sProgress); + sError = CUI_RES(RID_SVXSTR_SEARCHERROR); + sError = sError.replaceAll("%1", m_aURL); + m_pPersonaDialog->SetProgress( OUString() ); + ScopedVclPtrInstance< ErrorBox > aBox( nullptr, WB_OK, sError); + aBox->Execute(); return; } continue; @@ -784,7 +790,7 @@ void SearchAndParseThread::execute() else { - OUString sProgress( CUI_RES( RID_SVXSTR_APPLYPERSONA ) ); + OUString sProgress( CUI_RES( RID_SVXSTR_APPLYPERSONA ) ), sError; m_pPersonaDialog->SetProgress( sProgress ); uno::Reference< ucb::XSimpleFileAccess3 > xFileAccess( ucb::SimpleFileAccess::create( comphelper::getProcessComponentContext() ), uno::UNO_QUERY ); @@ -833,9 +839,11 @@ void SearchAndParseThread::execute() } catch ( const uno::Exception & ) { - sProgress = CUI_RES( RID_SVXSTR_SEARCHERROR ); - sProgress = sProgress.replaceAll("%1", m_aURL); - m_pPersonaDialog->SetProgress( sProgress ); + sError = CUI_RES( RID_SVXSTR_SEARCHERROR ); + sError = sError.replaceAll("%1", m_aURL); + m_pPersonaDialog->SetProgress( OUString() ); + ScopedVclPtrInstance< ErrorBox > aBox( nullptr, WB_OK, sError); + aBox->Execute(); return; } diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx index f607cf39c70e..602de5276894 100644 --- a/cui/source/options/personalization.hxx +++ b/cui/source/options/personalization.hxx @@ -100,7 +100,7 @@ public: ::rtl::Reference< SearchAndParseThread > m_rSearchThread; OUString GetSelectedPersona() const; - void SetProgress( OUString& ); + void SetProgress( const OUString& ); void SetImages( const Image&, sal_Int32 ); void AddPersonaSetting( OUString& ); void ClearSearchResults(); |