korganizer

calprinttodoconfig_base.cpp

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