00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "todoEditor_base.h"
00013
00014 #include <qvariant.h>
00015 #include <qlabel.h>
00016 #include <qcombobox.h>
00017 #include <qtextedit.h>
00018 #include <qcheckbox.h>
00019 #include <kdatewidget.h>
00020 #include <qlayout.h>
00021 #include <qtooltip.h>
00022 #include <qwhatsthis.h>
00023 #include "kdatewidget.h"
00024
00025
00026
00027
00028
00029 TodoEditorBase::TodoEditorBase( QWidget* parent, const char* name, WFlags fl )
00030 : QWidget( parent, name, fl )
00031 {
00032 if ( !name )
00033 setName( "TodoEditorBase" );
00034 TodoEditorBaseLayout = new QGridLayout( this, 1, 1, 11, 6, "TodoEditorBaseLayout");
00035
00036 fDescriptionLabel = new QLabel( this, "fDescriptionLabel" );
00037 fDescriptionLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)5, 0, 0, fDescriptionLabel->sizePolicy().hasHeightForWidth() ) );
00038 fDescriptionLabel->setAlignment( int( QLabel::AlignTop ) );
00039
00040 TodoEditorBaseLayout->addWidget( fDescriptionLabel, 0, 0 );
00041
00042 fNoteLabel = new QLabel( this, "fNoteLabel" );
00043 fNoteLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)5, 0, 0, fNoteLabel->sizePolicy().hasHeightForWidth() ) );
00044 fNoteLabel->setAlignment( int( QLabel::AlignTop ) );
00045
00046 TodoEditorBaseLayout->addWidget( fNoteLabel, 4, 0 );
00047
00048 fCategoryLabel = new QLabel( this, "fCategoryLabel" );
00049 fCategoryLabel->setEnabled( FALSE );
00050
00051 TodoEditorBaseLayout->addWidget( fCategoryLabel, 2, 2 );
00052
00053 fCategory = new QComboBox( FALSE, this, "fCategory" );
00054 fCategory->setEnabled( FALSE );
00055
00056 TodoEditorBaseLayout->addWidget( fCategory, 2, 3 );
00057
00058 fPriorityLabel = new QLabel( this, "fPriorityLabel" );
00059
00060 TodoEditorBaseLayout->addWidget( fPriorityLabel, 1, 2 );
00061
00062 fPriority = new QComboBox( FALSE, this, "fPriority" );
00063
00064 TodoEditorBaseLayout->addWidget( fPriority, 1, 3 );
00065
00066 fDescription = new QTextEdit( this, "fDescription" );
00067 fDescription->setMaximumSize( QSize( 32767, 80 ) );
00068
00069 TodoEditorBaseLayout->addMultiCellWidget( fDescription, 0, 0, 1, 3 );
00070
00071 fNote = new QTextEdit( this, "fNote" );
00072
00073 TodoEditorBaseLayout->addMultiCellWidget( fNote, 4, 4, 1, 3 );
00074
00075 fCompleted = new QCheckBox( this, "fCompleted" );
00076
00077 TodoEditorBaseLayout->addMultiCellWidget( fCompleted, 1, 1, 0, 1 );
00078
00079 fHasEndDate = new QCheckBox( this, "fHasEndDate" );
00080
00081 TodoEditorBaseLayout->addMultiCellWidget( fHasEndDate, 2, 2, 0, 1 );
00082
00083 fEndDate = new KDateWidget( this, "fEndDate" );
00084 fEndDate->setEnabled( FALSE );
00085
00086 TodoEditorBaseLayout->addMultiCellWidget( fEndDate, 3, 3, 0, 1 );
00087 languageChange();
00088 resize( QSize(399, 263).expandedTo(minimumSizeHint()) );
00089 clearWState( WState_Polished );
00090
00091
00092 connect( fHasEndDate, SIGNAL( toggled(bool) ), fEndDate, SLOT( setEnabled(bool) ) );
00093
00094
00095 fDescriptionLabel->setBuddy( fDescription );
00096 fNoteLabel->setBuddy( fNote );
00097 fCategoryLabel->setBuddy( fCategory );
00098 fPriorityLabel->setBuddy( fPriority );
00099 }
00100
00101
00102
00103
00104 TodoEditorBase::~TodoEditorBase()
00105 {
00106
00107 }
00108
00109
00110
00111
00112
00113 void TodoEditorBase::languageChange()
00114 {
00115 fDescriptionLabel->setText( tr2i18n( "&Description:" ) );
00116 fNoteLabel->setText( tr2i18n( "&Note:" ) );
00117 fCategoryLabel->setText( tr2i18n( "Ca&tegory:" ) );
00118 fPriorityLabel->setText( tr2i18n( "&Priority:" ) );
00119 fPriority->clear();
00120 fPriority->insertItem( tr2i18n( "1" ) );
00121 fPriority->insertItem( tr2i18n( "2" ) );
00122 fPriority->insertItem( tr2i18n( "3" ) );
00123 fPriority->insertItem( tr2i18n( "4" ) );
00124 fPriority->insertItem( tr2i18n( "5" ) );
00125 fCompleted->setText( tr2i18n( "&Completed" ) );
00126 fHasEndDate->setText( tr2i18n( "Has &end date:" ) );
00127 }
00128
00129 #include "todoEditor_base.moc"