00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "calprintdayconfig_base.h"
00013
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <qcheckbox.h>
00017 #include <qgroupbox.h>
00018 #include <qlabel.h>
00019 #include <qdatetimeedit.h>
00020 #include <libkdepim/kdateedit.h>
00021 #include <qlayout.h>
00022 #include <qtooltip.h>
00023 #include <qwhatsthis.h>
00024 #include "libkdepim/kdateedit.h"
00025
00026
00027
00028
00029
00030 CalPrintDayConfig_Base::CalPrintDayConfig_Base( QWidget* parent, const char* name, WFlags fl )
00031 : QWidget( parent, name, fl )
00032 {
00033 if ( !name )
00034 setName( "CalPrintDay_Base" );
00035 CalPrintDay_BaseLayout = new QGridLayout( this, 1, 1, 0, 6, "CalPrintDay_BaseLayout");
00036
00037 mIncludeTodos = new QCheckBox( this, "mIncludeTodos" );
00038 mIncludeTodos->setEnabled( FALSE );
00039
00040 CalPrintDay_BaseLayout->addWidget( mIncludeTodos, 1, 0 );
00041
00042 mDateRangeGroup = new QGroupBox( this, "mDateRangeGroup" );
00043 mDateRangeGroup->setColumnLayout(0, Qt::Vertical );
00044 mDateRangeGroup->layout()->setSpacing( 6 );
00045 mDateRangeGroup->layout()->setMargin( 11 );
00046 mDateRangeGroupLayout = new QGridLayout( mDateRangeGroup->layout() );
00047 mDateRangeGroupLayout->setAlignment( Qt::AlignTop );
00048 spacer1 = new QSpacerItem( 121, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
00049 mDateRangeGroupLayout->addItem( spacer1, 0, 4 );
00050 spacer2 = new QSpacerItem( 121, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
00051 mDateRangeGroupLayout->addItem( spacer2, 1, 4 );
00052
00053 mFromDateLabel = new QLabel( mDateRangeGroup, "mFromDateLabel" );
00054
00055 mDateRangeGroupLayout->addWidget( mFromDateLabel, 0, 0 );
00056
00057 mToTimeLabel = new QLabel( mDateRangeGroup, "mToTimeLabel" );
00058
00059 mDateRangeGroupLayout->addWidget( mToTimeLabel, 1, 2 );
00060
00061 mToTime = new QTimeEdit( mDateRangeGroup, "mToTime" );
00062 mToTime->setTime( QTime( 18, 0, 0 ) );
00063 mToTime->setDisplay( int( QTimeEdit::Minutes | QTimeEdit::Hours ) );
00064
00065 mDateRangeGroupLayout->addWidget( mToTime, 1, 3 );
00066
00067 mIncludeAllEvents = new QCheckBox( mDateRangeGroup, "mIncludeAllEvents" );
00068
00069 mDateRangeGroupLayout->addMultiCellWidget( mIncludeAllEvents, 2, 2, 0, 4 );
00070
00071 mFromDate = new KDateEdit( mDateRangeGroup, "mFromDate" );
00072 mFromDate->setFocusPolicy( KDateEdit::StrongFocus );
00073
00074 mDateRangeGroupLayout->addWidget( mFromDate, 0, 1 );
00075
00076 mFromTime = new QTimeEdit( mDateRangeGroup, "mFromTime" );
00077 mFromTime->setTime( QTime( 8, 0, 0 ) );
00078 mFromTime->setDisplay( int( QTimeEdit::Minutes | QTimeEdit::Hours ) );
00079
00080 mDateRangeGroupLayout->addWidget( mFromTime, 0, 3 );
00081
00082 mFromTimeLabel = new QLabel( mDateRangeGroup, "mFromTimeLabel" );
00083
00084 mDateRangeGroupLayout->addWidget( mFromTimeLabel, 0, 2 );
00085
00086 mToDate = new KDateEdit( mDateRangeGroup, "mToDate" );
00087 mToDate->setFocusPolicy( KDateEdit::StrongFocus );
00088
00089 mDateRangeGroupLayout->addWidget( mToDate, 1, 1 );
00090
00091 mToDateLabel = new QLabel( mDateRangeGroup, "mToDateLabel" );
00092
00093 mDateRangeGroupLayout->addWidget( mToDateLabel, 1, 0 );
00094
00095 CalPrintDay_BaseLayout->addWidget( mDateRangeGroup, 0, 0 );
00096
00097 mColors = new QCheckBox( this, "mColors" );
00098
00099 CalPrintDay_BaseLayout->addWidget( mColors, 2, 0 );
00100 spacer3 = new QSpacerItem( 21, 201, QSizePolicy::Minimum, QSizePolicy::Expanding );
00101 CalPrintDay_BaseLayout->addItem( spacer3, 3, 0 );
00102 languageChange();
00103 resize( QSize(386, 202).expandedTo(minimumSizeHint()) );
00104 clearWState( WState_Polished );
00105
00106
00107 setTabOrder( mFromDate, mFromTime );
00108 setTabOrder( mFromTime, mToDate );
00109 setTabOrder( mToDate, mToTime );
00110 setTabOrder( mToTime, mIncludeAllEvents );
00111 setTabOrder( mIncludeAllEvents, mIncludeTodos );
00112 setTabOrder( mIncludeTodos, mColors );
00113
00114
00115 mFromDateLabel->setBuddy( mFromDate );
00116 mToTimeLabel->setBuddy( mToTime );
00117 mFromTimeLabel->setBuddy( mFromTime );
00118 mToDateLabel->setBuddy( mToDate );
00119 }
00120
00121
00122
00123
00124 CalPrintDayConfig_Base::~CalPrintDayConfig_Base()
00125 {
00126
00127 }
00128
00129
00130
00131
00132
00133 void CalPrintDayConfig_Base::languageChange()
00134 {
00135 mIncludeTodos->setText( tr2i18n( "Include to-&dos that are due on the printed day(s)" ) );
00136 QWhatsThis::add( mIncludeTodos, tr2i18n( "You should check this option if you want to print to-dos which are due on one of the dates which are in the supplied date range." ) );
00137 mDateRangeGroup->setTitle( tr2i18n( "Date && Time Range" ) );
00138 mFromDateLabel->setText( tr2i18n( "&Start date:" ) );
00139 QWhatsThis::add( mFromDateLabel, tr2i18n( "If you want to print more days at once, you can define a range of dates with this option and the <i>End date</i> option. This option is used to define the start date." ) );
00140 mToTimeLabel->setText( tr2i18n( "End ti&me:" ) );
00141 QWhatsThis::add( mToTimeLabel, tr2i18n( "It is possible to print only those events which are inside a given timerange. With this time selection box you can define the end of this time range. The start time should be defined with the <i>Start time</i> option. Note you can automatically modify these settings if you check <i>Extend time range to include all events</i>." ) );
00142 QWhatsThis::add( mToTime, tr2i18n( "It's possible to print only those events which are inside a given timerange. With this time selection box you can define the end of this time range. The start time should be defined with the <i>Start time</i> option. Note you can automatically modify these settings if you check <i>Extend time range to include all events</i>." ) );
00143 mIncludeAllEvents->setText( tr2i18n( "E&xtend time range to include all events" ) );
00144 QWhatsThis::add( mIncludeAllEvents, tr2i18n( "Check this option to automatically determine the required time range, so all events will be shown." ) );
00145 QWhatsThis::add( mFromDate, tr2i18n( "If you want to print more days at once, you can define a range of dates with this option and the <i>End date</i> option. This option is used to define the start date." ) );
00146 QWhatsThis::add( mFromTime, tr2i18n( "It's possible to print only those events which are inside a given timerange. With this time selection box you can define the start of this time range. The end time should be defined with the <i>End time</i> option. Note you can automatically modify these settings if you check <i>Extend time range to include all events</i>." ) );
00147 mFromTimeLabel->setText( tr2i18n( "Start &time:" ) );
00148 QWhatsThis::add( mFromTimeLabel, tr2i18n( "It is possible to print only those events which are inside a given timerange. With this time selection box you can define the start of this time range. The end time should be defined with the <i>End time</i> option. Note you can automatically modify these settings if you check <i>Extend time range to include all events</i>." ) );
00149 QWhatsThis::add( mToDate, tr2i18n( "If you want to print more days at once, you can define a range of dates with this option and the <i>Start date</i> option. This option is used to define the end date." ) );
00150 mToDateLabel->setText( tr2i18n( "&End date:" ) );
00151 QWhatsThis::add( mToDateLabel, tr2i18n( "If you want to print more days at once, you can define a range of dates with this option and the <i>Start date</i> option. This option is used to define the end date." ) );
00152 mColors->setText( tr2i18n( "&Use colors" ) );
00153 QWhatsThis::add( mColors, tr2i18n( "If you want to use colors to distinguish certain categories on the print, check this option." ) );
00154 }
00155
00156 #include "calprintdayconfig_base.moc"