[Libreoffice-commits] core.git: cui/source
Susobhan Ghosh
susobhang70 at gmail.com
Tue May 17 20:51:53 UTC 2016
cui/source/options/personalization.cxx | 38 +++++++++++++++++++--------------
cui/source/options/personalization.hxx | 2 -
2 files changed, 24 insertions(+), 16 deletions(-)
New commits:
commit bdcb496858a7d37e7d24436dcededa8613469df0
Author: Susobhan Ghosh <susobhang70 at gmail.com>
Date: Sun May 8 15:33:46 2016 +0530
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 at libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index 486529d..b752f30 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 f607cf3..602de52 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();
More information about the Libreoffice-commits
mailing list