summaryrefslogtreecommitdiffabout
path: root/korganizer/calprintplugins.cpp
Unidiff
Diffstat (limited to 'korganizer/calprintplugins.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calprintplugins.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/calprintplugins.cpp b/korganizer/calprintplugins.cpp
index bc35ca4..9b6dc6e 100644
--- a/korganizer/calprintplugins.cpp
+++ b/korganizer/calprintplugins.cpp
@@ -1,128 +1,128 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 3
4 Copyright (c) 1998 Preston Brown 4 Copyright (c) 1998 Preston Brown
5 Copyright (c) 2003 Reinhold Kainhofer <reinhold@kainhofer.com> 5 Copyright (c) 2003 Reinhold Kainhofer <reinhold@kainhofer.com>
6 Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org> 6 Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
7 7
8 This program is free software; you can redistribute it and/or modify 8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by 9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or 10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version. 11 (at your option) any later version.
12 12
13 This program is distributed in the hope that it will be useful, 13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details. 16 GNU General Public License for more details.
17 17
18 You should have received a copy of the GNU General Public License 18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software 19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 21
22 As a special exception, permission is given to link this program 22 As a special exception, permission is given to link this program
23 with any edition of Qt, and distribute the resulting executable, 23 with any edition of Qt, and distribute the resulting executable,
24 without including the source code for Qt in the source distribution. 24 without including the source code for Qt in the source distribution.
25*/ 25*/
26 26
27#include <qpainter.h> 27#include <qpainter.h>
28#include <qdatetimeedit.h> 28#include <q3datetimeedit.h>
29#include <qdatetime.h> 29#include <qdatetime.h>
30#include <qcheckbox.h> 30#include <qcheckbox.h>
31#include <qlineedit.h> 31#include <qlineedit.h>
32#include <qbuttongroup.h> 32#include <q3buttongroup.h>
33 33
34#include <kglobal.h> 34#include <kglobal.h>
35#include <klocale.h> 35#include <klocale.h>
36#include <kdebug.h> 36#include <kdebug.h>
37#include <kprinter.h> 37#include <kprinter.h>
38#include <kconfig.h> 38#include <kconfig.h>
39#include <kcalendarsystem.h> 39#include <kcalendarsystem.h>
40 40
41#include <libkcal/todo.h> 41#include <libkcal/todo.h>
42#include <libkcal/calendar.h> 42#include <libkcal/calendar.h>
43 43
44#include <libkdepim/kdateedit.h> 44#include <libkdepim/kdateedit.h>
45 45
46#include "koprefs.h" 46#include "koprefs.h"
47#include "koglobals.h" 47#include "koglobals.h"
48#include "calprintplugins.h" 48#include "calprintplugins.h"
49#ifndef KORG_NOPRINTER 49#ifndef KORG_NOPRINTER
50 50
51//#include "calprintplugins.moc" 51//#include "calprintplugins.moc"
52 52
53#define LEFT_DISTANCE 45 53#define LEFT_DISTANCE 45
54 54
55/************************************************************** 55/**************************************************************
56 * Print Day 56 * Print Day
57 **************************************************************/ 57 **************************************************************/
58 58
59CalPrintDay::CalPrintDay( KPrinter *printer, Calendar *cal, KConfig *cfg ) 59CalPrintDay::CalPrintDay( KPrinter *printer, Calendar *cal, KConfig *cfg )
60 : CalPrintBase( printer, cal, cfg ) 60 : CalPrintBase( printer, cal, cfg )
61{ 61{
62} 62}
63 63
64CalPrintDay::~CalPrintDay() 64CalPrintDay::~CalPrintDay()
65{ 65{
66} 66}
67 67
68QWidget *CalPrintDay::configWidget( QWidget *w ) 68QWidget *CalPrintDay::configWidget( QWidget *w )
69{ 69{
70 mConfigWidget = new CalPrintDayConfig_Base( w ); 70 mConfigWidget = new CalPrintDayConfig_Base( w );
71 setSettingsWidget(); 71 setSettingsWidget();
72 return mConfigWidget; 72 return mConfigWidget;
73} 73}
74 74
75void CalPrintDay::readSettingsWidget() 75void CalPrintDay::readSettingsWidget()
76{ 76{
77 CalPrintDayConfig_Base *cfg = mConfigWidget; 77 CalPrintDayConfig_Base *cfg = mConfigWidget;
78 if ( cfg ) { 78 if ( cfg ) {
79 mFromDate = cfg->mFromDate->date(); 79 mFromDate = cfg->mFromDate->date();
80 mToDate = cfg->mToDate->date(); 80 mToDate = cfg->mToDate->date();
81 81
82 mStartTime = cfg->mFromTime->time(); 82 mStartTime = cfg->mFromTime->time();
83 mEndTime = cfg->mToTime->time(); 83 mEndTime = cfg->mToTime->time();
84 mIncludeAllEvents = cfg->mIncludeAllEvents->isChecked(); 84 mIncludeAllEvents = cfg->mIncludeAllEvents->isChecked();
85 85
86 mIncludeTodos = cfg->mIncludeTodos->isChecked(); 86 mIncludeTodos = cfg->mIncludeTodos->isChecked();
87 mUseColors = cfg->mColors->isChecked(); 87 mUseColors = cfg->mColors->isChecked();
88 } 88 }
89} 89}
90 90
91void CalPrintDay::setSettingsWidget() 91void CalPrintDay::setSettingsWidget()
92{ 92{
93 CalPrintDayConfig_Base *cfg =( mConfigWidget ); 93 CalPrintDayConfig_Base *cfg =( mConfigWidget );
94 if ( cfg ) { 94 if ( cfg ) {
95 cfg->mFromDate->setDate( mFromDate ); 95 cfg->mFromDate->setDate( mFromDate );
96 cfg->mToDate->setDate( mToDate ); 96 cfg->mToDate->setDate( mToDate );
97 97
98 cfg->mFromTime->setTime( mStartTime ); 98 cfg->mFromTime->setTime( mStartTime );
99 cfg->mToTime->setTime( mEndTime ); 99 cfg->mToTime->setTime( mEndTime );
100 cfg->mIncludeAllEvents->setChecked( mIncludeAllEvents ); 100 cfg->mIncludeAllEvents->setChecked( mIncludeAllEvents );
101 101
102 cfg->mIncludeTodos->setChecked( mIncludeTodos ); 102 cfg->mIncludeTodos->setChecked( mIncludeTodos );
103 cfg->mColors->setChecked( mUseColors ); 103 cfg->mColors->setChecked( mUseColors );
104 } 104 }
105} 105}
106 106
107void CalPrintDay::loadConfig() 107void CalPrintDay::loadConfig()
108{ 108{
109 if ( mConfig ) { 109 if ( mConfig ) {
110 QDate dt; 110 QDate dt;
111 QTime tm1 = QTime( KOPrefs::instance()->mDayBegins, 0,0 ); 111 QTime tm1 = QTime( KOPrefs::instance()->mDayBegins, 0,0 );
112 QDateTime startTm( dt, tm1 ); 112 QDateTime startTm( dt, tm1 );
113 QDateTime endTm( dt, tm1.addSecs( 12 * 60 * 60 ) ); 113 QDateTime endTm( dt, tm1.addSecs( 12 * 60 * 60 ) );
114 mStartTime = mConfig->readDateTimeEntry( "Start time", &startTm ).time(); 114 mStartTime = mConfig->readDateTimeEntry( "Start time", &startTm ).time();
115 mEndTime = mConfig->readDateTimeEntry( "End time", &endTm ).time(); 115 mEndTime = mConfig->readDateTimeEntry( "End time", &endTm ).time();
116 mIncludeTodos = mConfig->readBoolEntry( "Include todos", false ); 116 mIncludeTodos = mConfig->readBoolEntry( "Include todos", false );
117 mIncludeAllEvents = mConfig->readBoolEntry( "Include all events", false ); 117 mIncludeAllEvents = mConfig->readBoolEntry( "Include all events", false );
118 } 118 }
119 setSettingsWidget(); 119 setSettingsWidget();
120} 120}
121 121
122void CalPrintDay::saveConfig() 122void CalPrintDay::saveConfig()
123{ 123{
124 readSettingsWidget(); 124 readSettingsWidget();
125 if ( mConfig ) { 125 if ( mConfig ) {
126 mConfig->writeEntry( "Start time", QDateTime( QDate(), mStartTime ) ); 126 mConfig->writeEntry( "Start time", QDateTime( QDate(), mStartTime ) );
127 mConfig->writeEntry( "End time", QDateTime( QDate(), mEndTime ) ); 127 mConfig->writeEntry( "End time", QDateTime( QDate(), mEndTime ) );
128 mConfig->writeEntry( "Include todos", mIncludeTodos ); 128 mConfig->writeEntry( "Include todos", mIncludeTodos );