00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "calprinttodoconfig_base.h"
00013
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <qlabel.h>
00017 #include <qlineedit.h>
00018 #include <qbuttongroup.h>
00019 #include <qradiobutton.h>
00020 #include <qcheckbox.h>
00021 #include <qgroupbox.h>
00022 #include <qcombobox.h>
00023 #include <qlayout.h>
00024 #include <qtooltip.h>
00025 #include <qwhatsthis.h>
00026 #include "libkdepim/kdateedit.h"
00027
00028
00029
00030
00031
00032 CalPrintTodoConfig_Base::CalPrintTodoConfig_Base( QWidget* parent, const char* name, WFlags fl )
00033 : QWidget( parent, name, fl )
00034 {
00035 if ( !name )
00036 setName( "CalPrintTodoConfig_Base" );
00037 CalPrintTodoConfig_BaseLayout = new QGridLayout( this, 1, 1, 0, 6, "CalPrintTodoConfig_BaseLayout");
00038
00039 mTitleLabel = new QLabel( this, "mTitleLabel" );
00040
00041 CalPrintTodoConfig_BaseLayout->addWidget( mTitleLabel, 0, 0 );
00042
00043 mTitle = new QLineEdit( this, "mTitle" );
00044
00045 CalPrintTodoConfig_BaseLayout->addWidget( mTitle, 0, 1 );
00046
00047 mPrintType = new QButtonGroup( this, "mPrintType" );
00048 mPrintType->setColumnLayout(0, Qt::Vertical );
00049 mPrintType->layout()->setSpacing( 6 );
00050 mPrintType->layout()->setMargin( 11 );
00051 mPrintTypeLayout = new QVBoxLayout( mPrintType->layout() );
00052 mPrintTypeLayout->setAlignment( Qt::AlignTop );
00053
00054 mPrintAll = new QRadioButton( mPrintType, "mPrintAll" );
00055 mPrintAll->setChecked( TRUE );
00056 mPrintTypeLayout->addWidget( mPrintAll );
00057
00058 mPrintUnfinished = new QRadioButton( mPrintType, "mPrintUnfinished" );
00059 mPrintUnfinished->setEnabled( TRUE );
00060 mPrintTypeLayout->addWidget( mPrintUnfinished );
00061
00062 mPrintDueRange = new QRadioButton( mPrintType, "mPrintDueRange" );
00063 mPrintDueRange->setEnabled( TRUE );
00064 mPrintTypeLayout->addWidget( mPrintDueRange );
00065
00066 layout2 = new QHBoxLayout( 0, 0, 6, "layout2");
00067 spacer2 = new QSpacerItem( 16, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
00068 layout2->addItem( spacer2 );
00069
00070 mFromDateLabel = new QLabel( mPrintType, "mFromDateLabel" );
00071 mFromDateLabel->setEnabled( FALSE );
00072 mFromDateLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)5, 0, 0, mFromDateLabel->sizePolicy().hasHeightForWidth() ) );
00073 layout2->addWidget( mFromDateLabel );
00074
00075 mFromDate = new KDateEdit( mPrintType, "mFromDate" );
00076 mFromDate->setEnabled( FALSE );
00077 mFromDate->setFocusPolicy( KDateEdit::StrongFocus );
00078 layout2->addWidget( mFromDate );
00079
00080 mToDateLabel = new QLabel( mPrintType, "mToDateLabel" );
00081 mToDateLabel->setEnabled( FALSE );
00082 mToDateLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)5, 0, 0, mToDateLabel->sizePolicy().hasHeightForWidth() ) );
00083 layout2->addWidget( mToDateLabel );
00084
00085 mToDate = new KDateEdit( mPrintType, "mToDate" );
00086 mToDate->setEnabled( FALSE );
00087 mToDate->setFocusPolicy( KDateEdit::StrongFocus );
00088 layout2->addWidget( mToDate );
00089 spacer1 = new QSpacerItem( 16, 21, QSizePolicy::Expanding, QSizePolicy::Minimum );
00090 layout2->addItem( spacer1 );
00091 mPrintTypeLayout->addLayout( layout2 );
00092
00093 CalPrintTodoConfig_BaseLayout->addMultiCellWidget( mPrintType, 1, 1, 0, 1 );
00094
00095 includeInfoBox = new QButtonGroup( this, "includeInfoBox" );
00096 includeInfoBox->setCheckable( FALSE );
00097 includeInfoBox->setColumnLayout(0, Qt::Vertical );
00098 includeInfoBox->layout()->setSpacing( 6 );
00099 includeInfoBox->layout()->setMargin( 11 );
00100 includeInfoBoxLayout = new QGridLayout( includeInfoBox->layout() );
00101 includeInfoBoxLayout->setAlignment( Qt::AlignTop );
00102
00103 mPriority = new QCheckBox( includeInfoBox, "mPriority" );
00104 mPriority->setChecked( TRUE );
00105
00106 includeInfoBoxLayout->addWidget( mPriority, 1, 0 );
00107
00108 mDescription = new QCheckBox( includeInfoBox, "mDescription" );
00109 mDescription->setChecked( TRUE );
00110
00111 includeInfoBoxLayout->addWidget( mDescription, 0, 0 );
00112
00113 mDueDate = new QCheckBox( includeInfoBox, "mDueDate" );
00114 mDueDate->setChecked( TRUE );
00115
00116 includeInfoBoxLayout->addWidget( mDueDate, 0, 1 );
00117
00118 mPercentComplete = new QCheckBox( includeInfoBox, "mPercentComplete" );
00119 mPercentComplete->setChecked( TRUE );
00120
00121 includeInfoBoxLayout->addWidget( mPercentComplete, 1, 1 );
00122
00123 CalPrintTodoConfig_BaseLayout->addMultiCellWidget( includeInfoBox, 2, 2, 0, 1 );
00124 spacer3 = new QSpacerItem( 20, 16, QSizePolicy::Minimum, QSizePolicy::Expanding );
00125 CalPrintTodoConfig_BaseLayout->addItem( spacer3, 5, 1 );
00126
00127 sortingOptionsBox = new QGroupBox( this, "sortingOptionsBox" );
00128 sortingOptionsBox->setColumnLayout(0, Qt::Vertical );
00129 sortingOptionsBox->layout()->setSpacing( 6 );
00130 sortingOptionsBox->layout()->setMargin( 11 );
00131 sortingOptionsBoxLayout = new QGridLayout( sortingOptionsBox->layout() );
00132 sortingOptionsBoxLayout->setAlignment( Qt::AlignTop );
00133
00134 sortFieldLabel = new QLabel( sortingOptionsBox, "sortFieldLabel" );
00135 sortFieldLabel->setEnabled( TRUE );
00136
00137 sortingOptionsBoxLayout->addWidget( sortFieldLabel, 0, 0 );
00138
00139 mSortField = new QComboBox( FALSE, sortingOptionsBox, "mSortField" );
00140 mSortField->setEnabled( TRUE );
00141
00142 sortingOptionsBoxLayout->addWidget( mSortField, 0, 1 );
00143
00144 sortDirectionLabel = new QLabel( sortingOptionsBox, "sortDirectionLabel" );
00145 sortDirectionLabel->setEnabled( TRUE );
00146
00147 sortingOptionsBoxLayout->addWidget( sortDirectionLabel, 1, 0 );
00148
00149 mSortDirection = new QComboBox( FALSE, sortingOptionsBox, "mSortDirection" );
00150 mSortDirection->setEnabled( TRUE );
00151
00152 sortingOptionsBoxLayout->addWidget( mSortDirection, 1, 1 );
00153 spacer4 = new QSpacerItem( 121, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00154 sortingOptionsBoxLayout->addItem( spacer4, 0, 2 );
00155 spacer5 = new QSpacerItem( 121, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00156 sortingOptionsBoxLayout->addItem( spacer5, 1, 2 );
00157
00158 CalPrintTodoConfig_BaseLayout->addMultiCellWidget( sortingOptionsBox, 3, 3, 0, 1 );
00159
00160 otherOptionsBox = new QButtonGroup( this, "otherOptionsBox" );
00161 otherOptionsBox->setColumnLayout(0, Qt::Vertical );
00162 otherOptionsBox->layout()->setSpacing( 6 );
00163 otherOptionsBox->layout()->setMargin( 11 );
00164 otherOptionsBoxLayout = new QVBoxLayout( otherOptionsBox->layout() );
00165 otherOptionsBoxLayout->setAlignment( Qt::AlignTop );
00166
00167 mConnectSubTodos = new QCheckBox( otherOptionsBox, "mConnectSubTodos" );
00168 mConnectSubTodos->setChecked( TRUE );
00169 otherOptionsBoxLayout->addWidget( mConnectSubTodos );
00170
00171 mStrikeOutCompleted = new QCheckBox( otherOptionsBox, "mStrikeOutCompleted" );
00172 mStrikeOutCompleted->setChecked( TRUE );
00173 otherOptionsBoxLayout->addWidget( mStrikeOutCompleted );
00174
00175 CalPrintTodoConfig_BaseLayout->addMultiCellWidget( otherOptionsBox, 4, 4, 0, 1 );
00176 languageChange();
00177 resize( QSize(410, 459).expandedTo(minimumSizeHint()) );
00178 clearWState( WState_Polished );
00179
00180
00181 connect( mPrintDueRange, SIGNAL( toggled(bool) ), mFromDateLabel, SLOT( setEnabled(bool) ) );
00182 connect( mPrintDueRange, SIGNAL( toggled(bool) ), mFromDate, SLOT( setEnabled(bool) ) );
00183 connect( mPrintDueRange, SIGNAL( toggled(bool) ), mToDate, SLOT( setEnabled(bool) ) );
00184 connect( mPrintDueRange, SIGNAL( toggled(bool) ), mToDateLabel, SLOT( setEnabled(bool) ) );
00185
00186
00187 setTabOrder( mTitle, mPrintAll );
00188 setTabOrder( mPrintAll, mFromDate );
00189 setTabOrder( mFromDate, mToDate );
00190 setTabOrder( mToDate, mDescription );
00191 setTabOrder( mDescription, mDueDate );
00192 setTabOrder( mDueDate, mPriority );
00193 setTabOrder( mPriority, mPercentComplete );
00194 setTabOrder( mPercentComplete, mSortField );
00195 setTabOrder( mSortField, mSortDirection );
00196 setTabOrder( mSortDirection, mConnectSubTodos );
00197 setTabOrder( mConnectSubTodos, mStrikeOutCompleted );
00198
00199
00200 mTitleLabel->setBuddy( mTitle );
00201 mFromDateLabel->setBuddy( mFromDate );
00202 mToDateLabel->setBuddy( mToDate );
00203 }
00204
00205
00206
00207
00208 CalPrintTodoConfig_Base::~CalPrintTodoConfig_Base()
00209 {
00210
00211 }
00212
00213
00214
00215
00216
00217 void CalPrintTodoConfig_Base::languageChange()
00218 {
00219 mTitleLabel->setText( tr2i18n( "&Title:" ) );
00220 mTitle->setText( tr2i18n( "To-do List" ) );
00221 mPrintType->setTitle( tr2i18n( "To-dos to Print" ) );
00222 mPrintAll->setText( tr2i18n( "Print &all to-dos" ) );
00223 mPrintUnfinished->setText( tr2i18n( "Print &unfinished to-dos only" ) );
00224 mPrintDueRange->setText( tr2i18n( "Print only to-dos due in the &range:" ) );
00225 mFromDateLabel->setText( tr2i18n( "&Start date:" ) );
00226 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." ) );
00227 mToDateLabel->setText( tr2i18n( "&End date:" ) );
00228 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." ) );
00229 includeInfoBox->setTitle( tr2i18n( "Include Information" ) );
00230 mPriority->setText( tr2i18n( "&Priority" ) );
00231 mDescription->setText( tr2i18n( "&Description" ) );
00232 mDueDate->setText( tr2i18n( "Due date" ) );
00233 mDueDate->setAccel( QKeySequence( QString::null ) );
00234 mPercentComplete->setText( tr2i18n( "Per¢age completed" ) );
00235 sortingOptionsBox->setTitle( tr2i18n( "Sorting Options" ) );
00236 sortFieldLabel->setText( tr2i18n( "Sort field:" ) );
00237 sortDirectionLabel->setText( tr2i18n( "Sort direction:" ) );
00238 otherOptionsBox->setTitle( tr2i18n( "Other Options" ) );
00239 mConnectSubTodos->setText( tr2i18n( "Co&nnect sub-to-dos with its parent" ) );
00240 mStrikeOutCompleted->setText( tr2i18n( "Strike &out completed to-do summaries" ) );
00241 }
00242
00243 #include "calprinttodoconfig_base.moc"