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