From acc2b77512ce0d8d708dda14dec1464f3eed830c Mon Sep 17 00:00:00 2001 From: tpearson Date: Fri, 14 May 2010 02:06:47 +0000 Subject: Second batch of kdepim stability and functionality repairs git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1126473 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kresources/remote/resourceremote.cpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'kresources/remote') diff --git a/kresources/remote/resourceremote.cpp b/kresources/remote/resourceremote.cpp index 3c9db7695..68d484c01 100644 --- a/kresources/remote/resourceremote.cpp +++ b/kresources/remote/resourceremote.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -220,7 +221,20 @@ void ResourceRemote::slotPercent( KIO::Job *, unsigned long percent ) void ResourceRemote::slotLoadJobResult( KIO::Job *job ) { if ( job->error() ) { - job->showErrorDialog( 0 ); + // TODO: Should detect 404, 401 etc. vs host not found and prompt to create new resource only when 404 is returned + QString warningString = QString("") + i18n("Remote data access failure") + QString("

") + i18n("Detailed information") \ + + QString(":
") + job->errorString() + QString("

") + i18n("What would you like to do?"); + int rc = KMessageBox::warningContinueCancel(0, + warningString, i18n("Remote Data Access Failure"), i18n("&Continue with cached resource")); + if ( rc == KMessageBox::Continue ) { + mCalendar.close(); + disableChangeNotification(); + loadCache(); + enableChangeNotification(); + + emit resourceChanged( this ); + } + //job->showErrorDialog( 0 ); } else { kdDebug(5800) << "ResourceRemote::slotLoadJobResult() success" << endl; @@ -284,7 +298,7 @@ void ResourceRemote::slotSaveJobResult( KIO::Job *job ) job->showErrorDialog( 0 ); } else { kdDebug(5800) << "ResourceRemote::slotSaveJobResult() success" << endl; - + Incidence::List::ConstIterator it; for( it = mChangedIncidences.begin(); it != mChangedIncidences.end(); ++it ) { @@ -292,7 +306,7 @@ void ResourceRemote::slotSaveJobResult( KIO::Job *job ) } mChangedIncidences.clear(); } - + mUploadJob = 0; emit resourceSaved( this ); -- cgit v1.2.1