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