00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "calprintweekconfig_base.h"
00013
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <qgroupbox.h>
00017 #include <qlabel.h>
00018 #include <qdatetimeedit.h>
00019 #include <qcheckbox.h>
00020 #include <qbuttongroup.h>
00021 #include <qradiobutton.h>
00022 #include <qlayout.h>
00023 #include <qtooltip.h>
00024 #include <qwhatsthis.h>
00025 #include "libkdepim/kdateedit.h"
00026
00027
00028
00029
00030
00031 CalPrintWeekConfig_Base::CalPrintWeekConfig_Base( QWidget* parent, const char* name, WFlags fl )
00032 : QWidget( parent, name, fl )
00033 {
00034 if ( !name )
00035 setName( "CalPrintWeek_Base" );
00036 CalPrintWeek_BaseLayout = new QGridLayout( this, 1, 1, 0, 6, "CalPrintWeek_BaseLayout");
00037 spacer3 = new QSpacerItem( 21, 27, QSizePolicy::Minimum, QSizePolicy::Expanding );
00038 CalPrintWeek_BaseLayout->addItem( spacer3, 4, 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( 16, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
00047 mDateRangeGroupLayout->addItem( spacer1, 0, 4 );
00048
00049 mFromDateLabel = new QLabel( mDateRangeGroup, "mFromDateLabel" );
00050
00051 mDateRangeGroupLayout->addWidget( mFromDateLabel, 0, 0 );
00052
00053 mFromDate = new KDateEdit( mDateRangeGroup, "mFromDate" );
00054 mFromDate->setFocusPolicy( KDateEdit::StrongFocus );
00055
00056 mDateRangeGroupLayout->addWidget( mFromDate, 0, 1 );
00057
00058 mToTimeLabel = new QLabel( mDateRangeGroup, "mToTimeLabel" );
00059
00060 mDateRangeGroupLayout->addWidget( mToTimeLabel, 1, 2 );
00061 spacer4 = new QSpacerItem( 110, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00062 mDateRangeGroupLayout->addItem( spacer4, 1, 4 );
00063
00064 mToTime = new QTimeEdit( mDateRangeGroup, "mToTime" );
00065 mToTime->setTime( QTime( 18, 0, 0 ) );
00066 mToTime->setDisplay( int( QTimeEdit::Minutes | QTimeEdit::Hours ) );
00067
00068 mDateRangeGroupLayout->addWidget( mToTime, 1, 3 );
00069
00070 mFromTimeLabel = new QLabel( mDateRangeGroup, "mFromTimeLabel" );
00071
00072 mDateRangeGroupLayout->addWidget( mFromTimeLabel, 0, 2 );
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 mToDate = new KDateEdit( mDateRangeGroup, "mToDate" );
00081 mToDate->setFocusPolicy( KDateEdit::StrongFocus );
00082
00083 mDateRangeGroupLayout->addWidget( mToDate, 1, 1 );
00084
00085 mToDateLabel = new QLabel( mDateRangeGroup, "mToDateLabel" );
00086
00087 mDateRangeGroupLayout->addWidget( mToDateLabel, 1, 0 );
00088
00089 CalPrintWeek_BaseLayout->addWidget( mDateRangeGroup, 0, 0 );
00090
00091 mColors = new QCheckBox( this, "mColors" );
00092
00093 CalPrintWeek_BaseLayout->addWidget( mColors, 3, 0 );
00094
00095 mPrintType = new QButtonGroup( this, "mPrintType" );
00096 mPrintType->setColumnLayout(0, Qt::Vertical );
00097 mPrintType->layout()->setSpacing( 6 );
00098 mPrintType->layout()->setMargin( 11 );
00099 mPrintTypeLayout = new QGridLayout( mPrintType->layout() );
00100 mPrintTypeLayout->setAlignment( Qt::AlignTop );
00101
00102 mPrintTypeButton1 = new QRadioButton( mPrintType, "mPrintTypeButton1" );
00103 mPrintTypeButton1->setChecked( TRUE );
00104
00105 mPrintTypeLayout->addMultiCellWidget( mPrintTypeButton1, 0, 0, 0, 4 );
00106
00107 mPrintTypeButton2 = new QRadioButton( mPrintType, "mPrintTypeButton2" );
00108
00109 mPrintTypeLayout->addMultiCellWidget( mPrintTypeButton2, 1, 1, 0, 4 );
00110
00111 mPrintTypeButton3 = new QRadioButton( mPrintType, "mPrintTypeButton3" );
00112
00113 mPrintTypeLayout->addMultiCellWidget( mPrintTypeButton3, 2, 2, 0, 2 );
00114
00115 CalPrintWeek_BaseLayout->addWidget( mPrintType, 1, 0 );
00116
00117 mIncludeTodos = new QCheckBox( this, "mIncludeTodos" );
00118 mIncludeTodos->setEnabled( FALSE );
00119
00120 CalPrintWeek_BaseLayout->addWidget( mIncludeTodos, 2, 0 );
00121 languageChange();
00122 resize( QSize(386, 262).expandedTo(minimumSizeHint()) );
00123 clearWState( WState_Polished );
00124
00125
00126 setTabOrder( mFromDate, mFromTime );
00127 setTabOrder( mFromTime, mToDate );
00128 setTabOrder( mToDate, mToTime );
00129 setTabOrder( mToTime, mPrintTypeButton1 );
00130 setTabOrder( mPrintTypeButton1, mIncludeTodos );
00131 setTabOrder( mIncludeTodos, mColors );
00132
00133
00134 mFromDateLabel->setBuddy( mFromDate );
00135 mToTimeLabel->setBuddy( mToTime );
00136 mFromTimeLabel->setBuddy( mFromTime );
00137 mToDateLabel->setBuddy( mToDate );
00138 }
00139
00140
00141
00142
00143 CalPrintWeekConfig_Base::~CalPrintWeekConfig_Base()
00144 {
00145
00146 }
00147
00148
00149
00150
00151
00152 void CalPrintWeekConfig_Base::languageChange()
00153 {
00154 setCaption( tr2i18n( "CalPrintWeek_Base" ) );
00155 mDateRangeGroup->setTitle( tr2i18n( "Date && Time Range" ) );
00156 mFromDateLabel->setText( tr2i18n( "&Start date:" ) );
00157 QWhatsThis::add( mFromDateLabel, tr2i18n( "Here you can choose which events should be printed based on their date. This check enables you to enter the start date of the date range. Use the <i>End date</i> to enter the end date of the daterange." ) );
00158 QWhatsThis::add( mFromDate, tr2i18n( "Here you can choose which events should be printed based on their date. This check enables you to enter the start date of the date range. Use the <i>End date</i> to enter the end date of the daterange." ) );
00159 mToTimeLabel->setText( tr2i18n( "End ti&me:" ) );
00160 QWhatsThis::add( mToTimeLabel, tr2i18n( "All events which start later than the given time will not be printed." ) );
00161 QWhatsThis::add( mToTime, tr2i18n( "All events which start later than the given time will not be printed." ) );
00162 mFromTimeLabel->setText( tr2i18n( "Start &time:" ) );
00163 QWhatsThis::add( mFromTimeLabel, tr2i18n( "All events which start earlier than the given time will not be printed." ) );
00164 QWhatsThis::add( mFromTime, tr2i18n( "All events which start earlier than the given time will not be printed." ) );
00165 QWhatsThis::add( mToDate, tr2i18n( "Here you can choose which events should be printed based on their date. This check enables you to enter the end date of the date range. Use the <i>Start date</i> to enter the start date of the daterange." ) );
00166 mToDateLabel->setText( tr2i18n( "&End date:" ) );
00167 QWhatsThis::add( mToDateLabel, tr2i18n( "Here you can choose which events should be printed based on their date. This check enables you to enter the end date of the date range. Use the <i>Start date</i> to enter the start date of the daterange." ) );
00168 mColors->setText( tr2i18n( "&Use colors" ) );
00169 QWhatsThis::add( mColors, tr2i18n( "The timetable view supports colors. If you want to make use of colors you should check this option. The category colors will be used." ) );
00170 mPrintType->setTitle( tr2i18n( "Print Layout" ) );
00171 mPrintTypeButton1->setText( tr2i18n( "Print as &Filofax page" ) );
00172 QWhatsThis::add( mPrintTypeButton1, tr2i18n( "The Filofax view prints one week per page, so all days have a large surface." ) );
00173 mPrintTypeButton2->setText( tr2i18n( "Print as &timetable view" ) );
00174 QWhatsThis::add( mPrintTypeButton2, tr2i18n( "This view is similar to the weekview in KOrganizer. The week is printed in landscape layout. You can even use the same colors for the items if you check <i>Use Colors</i>." ) );
00175 mPrintTypeButton3->setText( tr2i18n( "Print as split week view" ) );
00176 QWhatsThis::add( mPrintTypeButton3, tr2i18n( "This view is similar to the week view in KOrganizer. The only difference with the timetable view is the page layout. Timetables are printed in landscape, the split week view in portrait." ) );
00177 mIncludeTodos->setText( tr2i18n( "Include to-&dos that are due on the printed day(s)" ) );
00178 QWhatsThis::add( mIncludeTodos, tr2i18n( "Check this option if you want to have to-dos on the print, placed by their due date." ) );
00179 }
00180
00181 #include "calprintweekconfig_base.moc"