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