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