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