diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
commit | cc29364f06178f8f6b457384f2ec37a042bd9d43 (patch) | |
tree | 7c77a3184c698bbf9d98cef09fb1ba8124daceba /kresources/kolab/shared/resourcekolabbase.cpp | |
parent | 4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff) | |
download | tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip |
* Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch
* Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed
* Added journal read support to the CalDAV resource
* Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources/kolab/shared/resourcekolabbase.cpp')
-rw-r--r-- | kresources/kolab/shared/resourcekolabbase.cpp | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/kresources/kolab/shared/resourcekolabbase.cpp b/kresources/kolab/shared/resourcekolabbase.cpp index 291910fb9..2db2117db 100644 --- a/kresources/kolab/shared/resourcekolabbase.cpp +++ b/kresources/kolab/shared/resourcekolabbase.cpp @@ -210,9 +210,12 @@ bool ResourceKolabBase::kmailRemoveSubresource( const TQString& resource ) return mConnection->kmailRemoveSubresource( resource ); } -TQString ResourceKolabBase::findWritableResource( const ResourceMap& resources, +TQString ResourceKolabBase::findWritableResource( const ResourceType &type, + const ResourceMap& resources, const TQString& text ) { + mErrorCode = NoError; + // I have to use the label (shown in the dialog) as key here. But given how the // label is made up, it should be unique. If it's not, well the dialog would suck anyway... TQMap<TQString, TQString> possible; @@ -227,7 +230,33 @@ TQString ResourceKolabBase::findWritableResource( const ResourceMap& resources, if ( possible.isEmpty() ) { // None found!! kdWarning(5650) << "No writable resource found!" << endl; - KMessageBox::error( 0, i18n( "No writable resource was found, saving will not be possible. Reconfigure KMail first." ) ); + + TQString errorText; + switch( type ) { + case Events: + errorText = i18n( "You have no writable event folders so saving will not be possible.\n" + "Please create or activate at least one writable event folder and try again." ); + break; + case Tasks: + errorText = i18n( "You have no writable task folders so saving will not be possible.\n" + "Please create or activate at least one writable task folder and try again." ); + break; + case Incidences: + errorText = i18n( "You have no writable calendar folder so saving will not be possible.\n" + "Please create or activate at least one writable calendar folder and try again." ); + break; + case Notes: + errorText = i18n( "You have no writable notes folders so saving will not be possible.\n" + "Please create or activate at least one writable notes folder and try again." ); + break; + case Contacts: + errorText = i18n( "You have no writable addressbook folder so saving will not be possible.\n" + "Please create or activate at least one writable addressbook folder and try again." ); + break; + } + + KMessageBox::error( 0, errorText ); + mErrorCode = NoWritableFound; return TQString::null; } if ( possible.count() == 1 ) @@ -242,8 +271,11 @@ TQString ResourceKolabBase::findWritableResource( const ResourceMap& resources, // Several found, ask the user TQString chosenLabel = KPIM::FolderSelectDialog::getItem( i18n( "Select Resource Folder" ), t, possible.keys() ); - if ( chosenLabel.isEmpty() ) // cancelled + if ( chosenLabel.isEmpty() ) { + // cancelled + mErrorCode = UserCancel; return TQString::null; + } return possible[chosenLabel]; } |