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

List:       kde-commits
Subject:    KDE/kdepim/korganizer/printing
From:       Allen Winter <winter () kde ! org>
Date:       2010-01-19 14:17:44
Message-ID: 1263910664.629689.19142.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1077158 by winterz:

FEATURE: Add a new timetable print mode where all days are on one page.

Thanks for the code Reinhold!.
http://reviewboard.kde.org/r/2593/

CCMAIL: reinhold@kainhofer.com
MERGE: none


 M  +13 -0     calprintdayconfig_base.ui  
 M  +16 -8     calprintdefaultplugins.cpp  
 M  +2 -1      calprintdefaultplugins.h  


--- trunk/KDE/kdepim/korganizer/printing/calprintdayconfig_base.ui #1077157:1077158
@@ -224,6 +224,19 @@
         </property>
        </widget>
       </item>
+      <item row="2" column="0">
+       <widget class="QRadioButton" name="mPrintTypeSingleTimetable">
+        <property name="whatsThis">
+         <string>The timetable print view has the times to the left of the page, all \
days are printed as columns in one big timetable.</string> +        </property>
+        <property name="text">
+         <string>Print as timetable view, all days on a single page</string>
+        </property>
+        <property name="checked">
+         <bool>false</bool>
+        </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
--- trunk/KDE/kdepim/korganizer/printing/calprintdefaultplugins.cpp #1077157:1077158
@@ -659,7 +659,7 @@
     } else if ( cfg->mPrintTypeTimetable->isChecked() ) {
       mDayPrintType = Timetable;
     } else {
-      mDayPrintType = Timetable;
+      mDayPrintType = SingleTimetable;
     }
 
     mStartTime = cfg->mFromTime->time();
@@ -686,6 +686,7 @@
 
     cfg->mPrintTypeFilofax->setChecked( mDayPrintType == Filofax );
     cfg->mPrintTypeTimetable->setChecked( mDayPrintType == Timetable );
+    cfg->mPrintTypeSingleTimetable->setChecked( mDayPrintType == SingleTimetable );
 
     cfg->mFromTime->setTime( mStartTime );
     cfg->mToTime->setTime( mEndTime );
@@ -762,24 +763,31 @@
 
   switch ( mDayPrintType ) {
   case Filofax:
+  case SingleTimetable:
     {
-      QString line1, line2, title;
       QRect headerBox( 0, 0, width, headerHeight() );
       QRect daysBox( headerBox );
-      KLocale *local = KGlobal::locale();
       daysBox.setTop( headerBox.bottom() + padding() );
       daysBox.setBottom( height );
-      line1 = local->formatDate( mFromDate );
-      line2 = local->formatDate( mToDate );
+      KLocale *local = KGlobal::locale();
+      QString line1 = local->formatDate( mFromDate );
+      QString line2 = local->formatDate( mToDate );
+      QString title;
       if ( orientation() == QPrinter::Landscape ) {
         title = i18nc( "date from-to", "%1 - %2", line1, line2 );
       } else {
         title = i18nc( "date from-\nto", "%1 -\n%2", line1, line2 );
       }
       drawHeader( p, title, mFromDate, QDate(), headerBox );
-      drawDays( p, mFromDate, mToDate, daysBox, mSingleLineLimit,
-                mShowNoteLines, mIncludeDescription,
-                mExcludeConfidential, mExcludePrivate );
+      if (mDayPrintType == Filofax) {
+        drawDays( p, mFromDate, mToDate, daysBox, mSingleLineLimit,
+                  mShowNoteLines, mIncludeDescription,
+                  mExcludeConfidential, mExcludePrivate );
+      } else if (mDayPrintType == SingleTimetable) {
+        drawTimeTable( p, mFromDate, mToDate, mStartTime, mEndTime, daysBox,
+                       mIncludeDescription, mExcludeTime, mExcludeConfidential,
+                       mExcludePrivate );
+      }
       drawFooter( p, daysBox );
     }
     break;
--- trunk/KDE/kdepim/korganizer/printing/calprintdefaultplugins.h #1077157:1077158
@@ -124,7 +124,8 @@
   protected:
     enum eDayPrintType {
       Filofax=0,
-      Timetable
+      Timetable,
+      SingleTimetable
     } mDayPrintType;
     QTime mStartTime, mEndTime;
     bool mIncludeDescription;


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

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