[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    proko2: kdepim/kresources/kolab
From:       Bo Thorsen <bo () sonofthor ! dk>
Date:       2004-11-18 12:24:27
Message-ID: 20041118122427.AAF4116E2A () office ! kde ! org
[Download RAW message or body]

CVS commit by thorsen: 

Write some text in the resource chooser dialog


  M +31 -1     kcal/resourcekolab.cpp   1.1.2.49
  M +8 -4      shared/resourcekolabbase.cpp   1.1.2.20
  M +2 -1      shared/resourcekolabbase.h   1.1.2.26


--- kdepim/kresources/kolab/kcal/resourcekolab.cpp  #1.1.2.48:1.1.2.49
@@ -406,5 +406,35 @@ bool ResourceKolab::addIncidence( KCal::
     bool newIncidence = _subresource.isEmpty();
     if ( newIncidence ) {
-      subResource = findWritableResource( *map );
+      // Add a description of the incidence
+      QString text = "<b><font size=\"+1\">";
+      if ( incidence->type() == "Event" )
+        text += i18n( "Choose the folder where you want to store this \
event" ); +      else if ( incidence->type() == "Todo" )
+        text += i18n( "Choose the folder where you want to store this \
task" ); +      else
+        text += i18n( "Choose the folder where you want to store this \
incidence" ); +      text += "<font></b><br>";
+      if ( !incidence->summary().isEmpty() )
+        text += i18n( "<b>Summary:</b> %1" ).arg( incidence->summary() ) + \
"<br>"; +      if ( !incidence->location().isEmpty() )
+        text += i18n( "<b>Location:</b> %1" ).arg( incidence->location() \
); +      text += "<br>";
+      if ( !incidence->doesFloat() )
+        text += i18n( "<b>Start:</b> %1, %2" )
+                .arg( incidence->dtStartDateStr(), \
incidence->dtStartTimeStr() ); +      else
+        text += i18n( "<b>Start:</b> %1" ).arg( \
incidence->dtStartDateStr() ); +      text += "<br>";
+      if ( incidence->type() == "Event" ) {
+        Event* event = static_cast<Event*>( incidence );
+        if ( event->hasEndDate() )
+          if ( !event->doesFloat() )
+            text += i18n( "<b>End:</b> %1, %2" )
+                    .arg( event->dtEndDateStr(), event->dtEndTimeStr() );
+          else
+            text += i18n( "<b>End:</b> %1" ).arg( event->dtEndDateStr() );
+        text += "<br>";
+      }
+      subResource = findWritableResource( *map, text );
     }
     if ( subResource.isEmpty() )

--- kdepim/kresources/kolab/shared/resourcekolabbase.cpp  \
#1.1.2.19:1.1.2.20 @@ -168,5 +168,6 @@ bool \
ResourceKolabBase::connectToKMail()  }
 
-QString ResourceKolabBase::findWritableResource( const ResourceMap& \
resources ) +QString ResourceKolabBase::findWritableResource( const \
ResourceMap& resources, +                                                 \
const QString& text )  {
   // I have to use the label (shown in the dialog) as key here. But given \
how the @@ -191,9 +192,12 @@ QString ResourceKolabBase::findWritableR
     return possible.begin().data(); // yes this is the subresource key, \
i.e. location  
+  QString t = text;
+  if ( t.isEmpty() )
+    i18n( "You have more than one writable resource folder. "
+          "Please select the one you want to write to." );
+
   // Several found, ask the user
   QString chosenLabel = KInputDialog::getItem( i18n( "Select Resource \
                Folder" ),
-                                               i18n( "You have more than \
                one writable resource folder. "
-                                                     "Please select the \
                one you want to write to." ),
-                                               possible.keys() );
+                                               t, possible.keys() );
   if ( chosenLabel.isEmpty() ) // cancelled
     return QString::null;

--- kdepim/kresources/kolab/shared/resourcekolabbase.h  #1.1.2.25:1.1.2.26
@@ -152,5 +152,6 @@ protected:
 
   /// If only one of these is writable, return that. Otherwise return \
                null.
-  QString findWritableResource( const ResourceMap& resources );
+  QString findWritableResource( const ResourceMap& resources,
+                                const QString& text = QString::null );
 
   bool mSilent;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic