kpilot/kpilot

todoEditor_base.cc

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './todoEditor_base.ui'
00005 **
00006 ** Created: Fri Mar 26 11:41:34 2010
00007 **
00008 ** WARNING! All changes made in this file will be lost!
00009 ****************************************************************************/
00010 
00011 #include "todoEditor_base.h"
00012 
00013 #include <qvariant.h>
00014 #include <kdatewidget.h>
00015 #include <qlabel.h>
00016 #include <qcombobox.h>
00017 #include <qtextedit.h>
00018 #include <qcheckbox.h>
00019 #include <qlayout.h>
00020 #include <qtooltip.h>
00021 #include <qwhatsthis.h>
00022 
00023 /*
00024  *  Constructs a TodoEditorBase as a child of 'parent', with the
00025  *  name 'name' and widget flags set to 'f'.
00026  */
00027 TodoEditorBase::TodoEditorBase( QWidget* parent, const char* name, WFlags fl )
00028     : QWidget( parent, name, fl )
00029 {
00030     if ( !name )
00031     setName( "TodoEditorBase" );
00032     TodoEditorBaseLayout = new QGridLayout( this, 1, 1, 11, 6, "TodoEditorBaseLayout"); 
00033 
00034     fDescriptionLabel = new QLabel( this, "fDescriptionLabel" );
00035     fDescriptionLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)5, 0, 0, fDescriptionLabel->sizePolicy().hasHeightForWidth() ) );
00036     fDescriptionLabel->setAlignment( int( QLabel::AlignTop ) );
00037 
00038     TodoEditorBaseLayout->addWidget( fDescriptionLabel, 0, 0 );
00039 
00040     fNoteLabel = new QLabel( this, "fNoteLabel" );
00041     fNoteLabel->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)5, 0, 0, fNoteLabel->sizePolicy().hasHeightForWidth() ) );
00042     fNoteLabel->setAlignment( int( QLabel::AlignTop ) );
00043 
00044     TodoEditorBaseLayout->addWidget( fNoteLabel, 4, 0 );
00045 
00046     fCategoryLabel = new QLabel( this, "fCategoryLabel" );
00047     fCategoryLabel->setEnabled( FALSE );
00048 
00049     TodoEditorBaseLayout->addWidget( fCategoryLabel, 2, 2 );
00050 
00051     fCategory = new QComboBox( FALSE, this, "fCategory" );
00052     fCategory->setEnabled( FALSE );
00053 
00054     TodoEditorBaseLayout->addWidget( fCategory, 2, 3 );
00055 
00056     fPriorityLabel = new QLabel( this, "fPriorityLabel" );
00057 
00058     TodoEditorBaseLayout->addWidget( fPriorityLabel, 1, 2 );
00059 
00060     fPriority = new QComboBox( FALSE, this, "fPriority" );
00061 
00062     TodoEditorBaseLayout->addWidget( fPriority, 1, 3 );
00063 
00064     fDescription = new QTextEdit( this, "fDescription" );
00065     fDescription->setMaximumSize( QSize( 32767, 80 ) );
00066 
00067     TodoEditorBaseLayout->addMultiCellWidget( fDescription, 0, 0, 1, 3 );
00068 
00069     fNote = new QTextEdit( this, "fNote" );
00070 
00071     TodoEditorBaseLayout->addMultiCellWidget( fNote, 4, 4, 1, 3 );
00072 
00073     fCompleted = new QCheckBox( this, "fCompleted" );
00074 
00075     TodoEditorBaseLayout->addMultiCellWidget( fCompleted, 1, 1, 0, 1 );
00076 
00077     fHasEndDate = new QCheckBox( this, "fHasEndDate" );
00078 
00079     TodoEditorBaseLayout->addMultiCellWidget( fHasEndDate, 2, 2, 0, 1 );
00080 
00081     fEndDate = new KDateWidget( this, "fEndDate" );
00082     fEndDate->setEnabled( FALSE );
00083 
00084     TodoEditorBaseLayout->addMultiCellWidget( fEndDate, 3, 3, 0, 1 );
00085     languageChange();
00086     resize( QSize(399, 263).expandedTo(minimumSizeHint()) );
00087     clearWState( WState_Polished );
00088 
00089     // signals and slots connections
00090     connect( fHasEndDate, SIGNAL( toggled(bool) ), fEndDate, SLOT( setEnabled(bool) ) );
00091 
00092     // buddies
00093     fDescriptionLabel->setBuddy( fDescription );
00094     fNoteLabel->setBuddy( fNote );
00095     fCategoryLabel->setBuddy( fCategory );
00096     fPriorityLabel->setBuddy( fPriority );
00097 }
00098 
00099 /*
00100  *  Destroys the object and frees any allocated resources
00101  */
00102 TodoEditorBase::~TodoEditorBase()
00103 {
00104     // no need to delete child widgets, Qt does it all for us
00105 }
00106 
00107 /*
00108  *  Sets the strings of the subwidgets using the current
00109  *  language.
00110  */
00111 void TodoEditorBase::languageChange()
00112 {
00113     fDescriptionLabel->setText( tr2i18n( "&Description:" ) );
00114     fNoteLabel->setText( tr2i18n( "&Note:" ) );
00115     fCategoryLabel->setText( tr2i18n( "Ca&tegory:" ) );
00116     fPriorityLabel->setText( tr2i18n( "&Priority:" ) );
00117     fPriority->clear();
00118     fPriority->insertItem( tr2i18n( "1" ) );
00119     fPriority->insertItem( tr2i18n( "2" ) );
00120     fPriority->insertItem( tr2i18n( "3" ) );
00121     fPriority->insertItem( tr2i18n( "4" ) );
00122     fPriority->insertItem( tr2i18n( "5" ) );
00123     fCompleted->setText( tr2i18n( "&Completed" ) );
00124     fHasEndDate->setText( tr2i18n( "Has &end date:" ) );
00125 }
00126 
00127 #include "todoEditor_base.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys