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

List:       kde-commits
Subject:    KDE/kdepim/kontact/plugins/planner
From:       Oral Timocin <oral.timocin () kdemail ! net>
Date:       2008-09-02 6:10:32
Message-ID: 1220335832.383702.5074.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 856062 by timocin:

Todo and Event Config Update

 M  +12 -3     kcmplanner.cpp  
 M  +2 -0      kcmplanner.h  
 M  +20 -21    planner.cpp  
 M  +3 -0      planner.h  


--- trunk/KDE/kdepim/kontact/plugins/planner/kcmplanner.cpp #856061:856062
@@ -56,13 +56,10 @@
 KCMPlanner::KCMPlanner( const KComponentData &inst, QWidget *parent )
   : KCModule( inst, parent )
 {
-  //QWidget *widget = new QWidget( parent );
   initGUI();
 
   customDaysChanged( 1 );
 
-  
-//   connect( mTodoGroup, SIGNAL(clicked(int)), SLOT(modified()) );
   connect( mCustomDays, SIGNAL(valueChanged(int)), SLOT(modified()) );
   connect( mCustomDays, SIGNAL(valueChanged(int)), SLOT(customDaysChanged(int)) );
 
@@ -208,12 +205,15 @@
 
   mShowEventRecurrence = new QCheckBox( i18n( "Show event recurrence" ) );
   mShowEventReminder = new QCheckBox( i18n( "Show events with reminder" ) );
+  mUnderlineEvent = new QCheckBox( i18n( "underline Event label" ) );
 
   boxLayout->addWidget( mShowEventRecurrence );
   boxLayout->addWidget( mShowEventReminder );
+  boxLayout->addWidget( mUnderlineEvent);
 
   connect( mShowEventRecurrence, SIGNAL(toggled(bool)), SLOT(modified()) );
   connect( mShowEventReminder, SIGNAL(toggled(bool)), SLOT(modified()) );
+  connect( mUnderlineEvent, SIGNAL(toggled(bool)), SLOT(modified()) );
 
   groupBox->setLayout( boxLayout );
 
@@ -274,12 +274,15 @@
 
   mShowTodoRecurrence = new QCheckBox( i18n( "Show todo recurrence") );
   mShowTodoReminder = new QCheckBox( i18n( "Show todo reminder") );
+  mUnderlineTodo = new QCheckBox( i18n( "undeline Todo" ) );
 
   boxLayout->addWidget( mShowTodoRecurrence );
   boxLayout->addWidget( mShowTodoReminder );
+  boxLayout->addWidget( mUnderlineTodo );
 
   connect( mShowTodoRecurrence, SIGNAL(toggled(bool)), SLOT(modified()) );
   connect( mShowTodoReminder, SIGNAL(toggled(bool)), SLOT(modified()) );
+  connect( mUnderlineTodo, SIGNAL(toggled(bool)), SLOT(modified()) );
 
   groupBox->setLayout( boxLayout );
 
@@ -334,6 +337,7 @@
 
   mShowEventRecurrence->setChecked( calendar.readEntry( "ShowEventRecurrence", false ) );
   mShowEventReminder->setChecked( calendar.readEntry( "ShowEventReminder", false ) );
+  mUnderlineEvent->setChecked( calendar.readEntry( "underlineEvent", false ) );
 
 
   //Read Todo Config
@@ -351,6 +355,7 @@
 
   mShowTodoRecurrence->setChecked( todo.readEntry( "ShowTodoRecurrence", false ) );
   mShowTodoReminder->setChecked( todo.readEntry( "ShowTodoReminder", false ) );
+  mUnderlineTodo->setChecked( todo.readEntry( "underlineTodo", false) );
 
   //Read Special Dates Config
   KConfigGroup sd = config.group( "SpecialDates" );
@@ -389,6 +394,7 @@
 
   calendar.writeEntry( "ShowEventRecurrence", mShowEventRecurrence->isChecked() );
   calendar.writeEntry( "ShowEventReminder", mShowEventReminder->isChecked() );
+  calendar.writeEntry( "underlineEvent", mUnderlineEvent->isChecked() );
 
 /*
  * Todo Section
@@ -406,6 +412,7 @@
 
   todo.writeEntry( "ShowTodoRecurrence", mShowTodoRecurrence->isChecked() );
   todo.writeEntry( "ShowTodoReminder", mShowTodoReminder->isChecked() );
+  todo.writeEntry( "underlineTodo", mUnderlineTodo->isChecked() );
 
 /*
  * Special Dates Section
@@ -428,6 +435,7 @@
 //   mCalendarGroup->setButton( 0 );
   mShowEventRecurrence->setChecked( false );
   mShowEventReminder->setChecked( false );
+  mUnderlineEvent->setChecked( false );
 
 
   mTodo = true;
@@ -441,6 +449,7 @@
 
   mShowTodoRecurrence->setChecked( false );
   mShowTodoReminder->setChecked( false );
+  mUnderlineTodo->setChecked( false );
 
   mSd = true ;
 
--- trunk/KDE/kdepim/kontact/plugins/planner/kcmplanner.h #856061:856062
@@ -64,6 +64,7 @@
     QGroupBox *mTodoGroup;
     QSpinBox *mCustomDays;
     QGroupBox *mSdGroup;
+    QCheckBox *mUnderlineEvent;
 
     QRadioButton *mDay;
     QRadioButton *mFiveDays;
@@ -83,6 +84,7 @@
     QCheckBox *mShowTodoRecurrence;
     QCheckBox *mShowTodoReminder;
     QSpinBox *mPriority;
+    QCheckBox *mUnderlineTodo;
 
     bool mSd;
 };
--- trunk/KDE/kdepim/kontact/plugins/planner/planner.cpp #856061:856062
@@ -63,10 +63,6 @@
 Planner::Planner( Kontact::Plugin *plugin, QWidget *parent )
   : Kontact::Summary( parent ), mPlugin( plugin ), mCalendar( 0 )
 {
-//   QVBoxLayout *mainLayout = new QVBoxLayout( this );
-//   mainLayout->setSpacing( 3 );
-//   mainLayout->setMargin( 3 );
-//   
   mLayout = new QVBoxLayout( this );
   mLayout->setSpacing( 3 );
   mLayout->setMargin( 3 );
@@ -74,11 +70,6 @@
   QWidget *header = createHeader( this, "view-pim-summary", i18n( "Planner" ) );
   mLayout->addWidget( header );
 
-//   mLayout = new QGridLayout();
-//   mainLayout->addItem( mLayout );
-//   mLayout->setMargin( 3 );
-//   mLayout->setRowStretch( 6, 1 );
-
   mCalendar = KOrg::StdCalendar::self();
   mCalendar->load();
 
@@ -97,10 +88,11 @@
   mDays = calendar.readEntry( "DaysToShow", 1 );
   mShowEventRecurrence = calendar.readEntry( "ShowEventRecurrence", false );
   mShowEventReminder = calendar.readEntry( "ShowEventReminder", false );
+  mUnderlineEvent = calendar.readEntry( "underlineEvent", false );
 
   KConfigGroup todo = config.group( "Todo" );
-  mShowTodos = false;
-  mPriority = todo.readEntry( "MaxPriority", 0 );
+  mShowTodos = todo.readEntry( "Todo", false );
+  mPriority = todo.readEntry( "MaxPriority", 1 );
   mShowAllTodos = todo.readEntry( "ShowAllTodos", false );
   mShowTodayEndingTodos = todo.readEntry( "ShowTodayEndingTodos", false );
   mShowTodosInProgress = todo.readEntry( "ShowTodosInProgress", false );
@@ -118,6 +110,7 @@
 
   mShowTodoRecurrence = todo.readEntry( "ShowTodoRecurrence", false );
   mShowTodoReminder = todo.readEntry( "ShowTodoReminder", false );
+  mUnderlineTodo = todo.readEntry( "underlineTodo", false );
 
   KConfigGroup sd = config.group( "SpecialDates" );
   mShowSd = sd.readEntry( "SpecialDates", false );
@@ -180,7 +173,7 @@
         font.setItalic( true );
         label->setFont( font );
       }
-//       mLayout->addWidget( labe;l, counter, 0 );
+
       mLayout->addWidget( label );
       mLabels.append( label );
 
@@ -206,7 +199,6 @@
              "No appointments pending within the next %1 days", mDays ),
       this, "nothing to see" );
     noEvents->setAlignment( Qt::AlignHCenter | Qt::AlignVCenter );
-//     mLayout->addWidget( noEvents, 0, 2 );
     mLayout->addWidget( noEvents );
     mLabels.append( noEvents );
   }
@@ -317,6 +309,9 @@
         urlLabel->setText( "<font color = red >" + percent + "</font>" );
       }
       urlLabel->setAlignment( Qt::AlignHCenter | Qt::AlignTop );
+      if( !mUnderlineTodo ){
+        urlLabel->setUnderline( false );
+      }
       urlLabel->setMaximumWidth( urlLabel->minimumSizeHint().width() );
       mPlannerGrid->addWidget( urlLabel, counter, 3 );
       mLabels.append( urlLabel );
@@ -337,6 +332,9 @@
       if( stateText == i18nc( "to-do is overdue", "overdue" ) ){
         urlLabel2->setText( "<font color = red >" + string + "</font>" );
       }
+      if( !mUnderlineTodo ){
+        urlLabel2->setUnderline( false );
+      }
       mPlannerGrid->addWidget( urlLabel2, counter, 5 );
       mLabels.append( urlLabel2 );
 
@@ -458,7 +456,7 @@
         continue;
       }
 
-      mPlannerGrid->setColumnMinimumWidth( 0, 20 );
+      mPlannerGrid->setColumnMinimumWidth( 0, 40 );
 
       //Show Event icon
       QPixmap re = loader.loadIcon( "view-calendar-day", KIconLoader::Small );
@@ -506,7 +504,7 @@
         mLabels.append( label );
       }
 
-      mPlannerGrid->setColumnMinimumWidth( 4, 10 );
+      mPlannerGrid->setColumnMinimumWidth( 4, 15 );
 
       // Fill Event Summary Field
       QString newtext = ev->summary();
@@ -518,14 +516,15 @@
       urlLabel->setUrl( ev->uid() );
       urlLabel->installEventFilter( this );
       urlLabel->setAlignment( Qt::AlignLeft | Qt::AlignTop | Qt::WordBreak );
-      // TODO Set config item if urls be underlined or not
-//       urlLabel->setUnderline( false );
+      if( !mUnderlineEvent ){
+        urlLabel->setUnderline( false );
+      }
       mPlannerGrid->addWidget( urlLabel, counter, 5 );
       mLabels.append( urlLabel );
 
-      mPlannerGrid->setColumnMinimumWidth( 6, 10 );
-      mPlannerGrid->setColumnMinimumWidth( 7, 10 );
-      mPlannerGrid->setColumnMinimumWidth( 8, 10 );
+      mPlannerGrid->setColumnMinimumWidth( 6, 15 );
+      mPlannerGrid->setColumnMinimumWidth( 7, 15 );
+      mPlannerGrid->setColumnMinimumWidth( 8, 15 );
 
        //Show icon if Alarm is enabled
       if( mShowEventReminder ){
@@ -579,7 +578,7 @@
 void Planner::initSdList( const QDate &date )
 {
 }
-// 
+
 int Planner::showSd( int counter )
 {
 //   return counter;
--- trunk/KDE/kdepim/kontact/plugins/planner/planner.h #856061:856062
@@ -85,6 +85,8 @@
     int mDays;
     bool mShowEventRecurrence;
     bool mShowEventReminder;
+    bool mUnderlineEvent;
+
     int mPriority;
     bool mShowTodos;
     bool mShowAllTodos;
@@ -95,6 +97,7 @@
     bool mShowCompleted;
     bool mShowTodoRecurrence;
     bool mShowTodoReminder;
+    bool mUnderlineTodo;
 
     KCal::Event::List mEvents;
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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