00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include "options.h"
00032
00033
00034 #include <qlayout.h>
00035 #include <qdir.h>
00036 #include <qpushbutton.h>
00037
00038 #include <klistview.h>
00039 #include <kdatepicker.h>
00040 #include <kmessagebox.h>
00041
00042 #include "datebookWidget.moc"
00043
00044 DatebookWidget::DatebookWidget(QWidget *parent, const QString &dbpath) :
00045 PilotComponent(parent,"component_generic",dbpath)
00046 {
00047 FUNCTIONSETUP;
00048
00049 QGridLayout *g = new QGridLayout(this,1,1,SPACING);
00050
00051 fDatePicker = new KDatePicker( this, "fDatePicker" );
00052 fDatePicker->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)4, (QSizePolicy::SizeType)5, 0, 0, fDatePicker->sizePolicy().hasHeightForWidth() ) );
00053 g->addMultiCellWidget(fDatePicker,0,0,0,2);
00054
00055 QSpacerItem* spacer = new QSpacerItem( 20, 180, QSizePolicy::Minimum, QSizePolicy::Expanding );
00056 g->addItem( spacer, 1, 1 );
00057
00058 fAddButton = new QPushButton( i18n( "&Add..." ), this, "pushButton1" );
00059 g->addWidget( fAddButton, 2, 0 );
00060
00061 fEditButton = new QPushButton( i18n( "&Edit..." ), this, "pushButton2" );
00062 g->addWidget( fEditButton, 2, 1 );
00063
00064 fDeleteButton = new QPushButton( i18n( "&Delete..." ), this, "pushButton3" );
00065 g->addWidget( fDeleteButton, 2, 2 );
00066
00067 fEventList = new KListView( this, "kListView1" );
00068 fEventList->addColumn( i18n( "Time" ) );
00069 fEventList->addColumn( i18n( "Al" ) );
00070 fEventList->addColumn( i18n( "Rec" ) );
00071 fEventList->addColumn( i18n( "Description" ) );
00072
00073 fEventList->setAllColumnsShowFocus( TRUE );
00074 fEventList->setShowSortIndicator( TRUE );
00075 fEventList->setResizeMode( KListView::AllColumns );
00076 fEventList->setFullWidth( TRUE );
00077
00078 g->addMultiCellWidget(fEventList, 0, 2, 3, 3);
00079
00080 connect(fDatePicker, SIGNAL(dateChanged()), SLOT(slotDayChanged()));
00081 connect(fAddButton, SIGNAL(clicked()), SLOT(slotAddEvent()));
00082 connect(fEditButton, SIGNAL(clicked()), SLOT(slotEditEvent()));
00083 connect(fDeleteButton, SIGNAL(clicked()), SLOT(slotDeleteEvent()));
00084 }
00085
00086 DatebookWidget::~DatebookWidget()
00087 {
00088 FUNCTIONSETUP;
00089 }
00090
00091
00092 void DatebookWidget::showComponent()
00093 {
00094 FUNCTIONSETUP;
00095
00096
00097
00098
00099 }
00100
00101 void DatebookWidget::hideComponent()
00102 {
00103 FUNCTIONSETUP;
00104
00105
00106
00107 }
00108
00109 void DatebookWidget::slotDayChanged()
00110 {
00111 FUNCTIONSETUP;
00112 KMessageBox::information(this, CSL1("slotDayChanged"));
00113 }
00114
00115 void DatebookWidget::slotAddEvent()
00116 {
00117 FUNCTIONSETUP;
00118 KMessageBox::information(this, CSL1("slotAddEvent"));
00119 }
00120
00121 void DatebookWidget::slotEditEvent()
00122 {
00123 FUNCTIONSETUP;
00124 KMessageBox::information(this, CSL1("slotEditEvent"));
00125 }
00126
00127 void DatebookWidget::slotDeleteEvent()
00128 {
00129 FUNCTIONSETUP;
00130 KMessageBox::information(this, CSL1("slotDeleteEvent"));
00131 }
00132
00133