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