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

List:       kde-commits
Subject:    branches/work/kdepim-3.5.5+/kontact/plugins/planner
From:       Oral Timocin <oral.timocin () kdemail ! net>
Date:       2007-01-30 10:44:37
Message-ID: 1170153877.940512.22902.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 628550 by timocin:

Several Bug fixes

 M  +22 -16    branches/work/kdepim-3.5.5+/kontact/plugins/planner/planner.cpp  


--- branches/work/kdepim-3.5.5+/kontact/plugins/planner/planner.cpp #628549:628550
@@ -41,13 +41,12 @@
 #include <libkcal/incidenceformatter.h>
 #include <libkdepim/kpimprefs.h>
 #include <libkholidays/kholidays.h>
-#include "korganizeriface_stub.h"
 
 #include "core.h"
 #include "plugin.h"
 #include "plannerplugin.h"
 #include "korganizer/stdcalendar.h"
-
+#include "korganizeriface_stub.h"
 #include "planner.h"
 
 Planner::Planner( PlannerPlugin *plugin, QWidget *parent,
@@ -84,9 +83,9 @@
 void Planner::configUpdated()
 {
   KConfig config( "plannerrc" );
+  config.setGroup( "Calendar" );
+  mDays = config.readNumEntry( "DaysToShow", 1 );
 
-  //TODO: read config entries
-
   updateView();
 }
 
@@ -97,9 +96,6 @@
   mLabels.setAutoDelete( false );
 
   KIconLoader loader( "kdepim" );
-  KConfig config( "kcmplannerrc" );
-  config.setGroup( "Calendar" );
-  int days = config.readNumEntry( "DaysToShow", 1 );
 
   QLabel *label = 0;
   int counter = 0;
@@ -108,7 +104,7 @@
   QDate dt;
   QDate currentDate = QDate::currentDate();
   for ( dt = currentDate;
-        dt <= currentDate.addDays( days - 1 );
+        dt <= currentDate.addDays( mDays - 1 );
         dt = dt.addDays( 1 ) ) {
 
     // Get the Events-List
@@ -188,9 +184,9 @@
 
       if ( !todos.empty() ) {
         ++counter;
-        grid = new QGridLayout ( this, 2 , 5, 3 );
-        grid->setRowStretch( 6, 1 );
-        mLayout->addMultiCellLayout( grid, counter, counter, 1, 4 );
+        mGrid = new QGridLayout ( this, 2 , 5, 3 );
+        mGrid->setRowStretch( 6, 1 );
+        mLayout->addMultiCellLayout( mGrid, counter, counter, 1, 4 );
 
         for ( ; td != todos.end() ; ++td ) {
           todo = *td;
@@ -199,13 +195,13 @@
           label = new QLabel( this );
           label->setPixmap( todoPm );
           label->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
-          grid->addWidget( label, counter, 0 );
+          mGrid->addWidget( label, counter, 0 );
           mLabels.append( label );
 
           label = new QLabel( QString::number( todo->percentComplete() ) + '%', this );
           label->setAlignment( AlignHCenter | AlignVCenter );
           label->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
-          grid->addWidget( label, counter, 1 );
+          mGrid->addWidget( label, counter, 1 );
           mLabels.append( label );
 
           QString string = todo->summary();
@@ -214,7 +210,7 @@
           urlLabel->setURL( todo->uid() );
           urlLabel->installEventFilter( this );
           urlLabel->setTextFormat( Qt::RichText );
-          grid->addWidget( urlLabel, counter, 2 );
+          mGrid->addWidget( urlLabel, counter, 2 );
           mLabels.append( urlLabel );
 
           connect( urlLabel, SIGNAL( leftClickedURL( const QString& ) ),
@@ -226,7 +222,7 @@
           label = new QLabel( stateText, this );
           label->setAlignment( AlignLeft | AlignVCenter );
           label->setSizePolicy( QSizePolicy::Maximum, QSizePolicy::Maximum );
-          grid->addWidget( label, counter, 4 );
+          mGrid->addWidget( label, counter, 4 );
           mLabels.append( label );
 
           if ( td != todos.end() ) {
@@ -266,6 +262,16 @@
           datestr = KGlobal::locale()->formatDate( ev->dtStart().date() );
           datestr += " -\n " +
                      KGlobal::locale()->formatDate( sD.addDays( span-1 ) );
+          label = new QLabel( datestr, this );
+          label->setAlignment( AlignLeft | AlignTop );
+          label->setPaletteForegroundColor( colorGroup().text() );
+          if ( makeBold ){
+            QFont font = label->font();
+            font.setBold( true );
+            label->setFont( font );
+          }
+          mLayout->addWidget( label, i, 1 );
+          mLabels.append( label );
         }
 
         // Fill Event Summary Field
@@ -334,7 +340,7 @@
     QLabel *noEvents = new QLabel(
       i18n( "No appointments pending within the next day",
             "No appointments pending within the next %n days",
-            days ), this, "nothing to see" );
+            mDays ), this, "nothing to see" );
     noEvents->setAlignment( AlignHCenter | AlignVCenter );
     mLayout->addWidget( noEvents, 0, 2 );
     mLabels.append( noEvents );

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

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