summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebook.cpp
Unidiff
Diffstat (limited to 'core/pim/datebook/datebook.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp106
1 files changed, 41 insertions, 65 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index cf1eeca..b7e89b0 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -102,15 +102,13 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
102 102
103 QPEToolBar *bar = new QPEToolBar( this ); 103// QPEToolBar *bar = new QPEToolBar( this );
104 bar->setHorizontalStretchable( TRUE ); 104// bar->setHorizontalStretchable( TRUE );
105 105
106 QPEMenuBar *mb = new QPEMenuBar( bar ); 106// QPEMenuBar *mb = new QPEMenuBar( bar );
107 mb->setMargin( 0 ); 107// mb->setMargin( 0 );
108 108
109 QPEToolBar *sub_bar = new QPEToolBar(this); 109// QPopupMenu *view = new QPopupMenu( this );
110 110// mb->insertItem( tr( "View" ), view );
111 QPopupMenu *view = new QPopupMenu( this );
112 QPopupMenu *settings = new QPopupMenu( this );
113 111
114 mb->insertItem( tr( "View" ), view ); 112 QPEToolBar *sub_bar = new QPEToolBar(this);
115 mb->insertItem( tr( "Settings" ), settings ); 113 sub_bar->setHorizontalStretchable(TRUE);
116 114
@@ -119,4 +117,3 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
119 117
120 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), 118 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
121 QString::null, 0, this, 0 );
122 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); 119 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
@@ -124,2 +121,4 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
124 121
122 sub_bar->addSeparator();
123
125 a = new QAction( tr( "Today" ), Resource::loadPixmap( "datebook/to_day" ), QString::null, 0, g, 0 ); 124 a = new QAction( tr( "Today" ), Resource::loadPixmap( "datebook/to_day" ), QString::null, 0, g, 0 );
@@ -127,3 +126,5 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
127 a->addTo( sub_bar ); 126 a->addTo( sub_bar );
128 a->addTo( view ); 127 //a->addTo( view );
128
129 sub_bar->addSeparator();
129 130
@@ -132,3 +133,3 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
132 a->addTo( sub_bar ); 133 a->addTo( sub_bar );
133 a->addTo( view ); 134// a->addTo( view );
134 a->setToggleAction( TRUE ); 135 a->setToggleAction( TRUE );
@@ -140,3 +141,3 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
140 a->addTo( sub_bar ); 141 a->addTo( sub_bar );
141 a->addTo( view ); 142// a->addTo( view );
142 a->setToggleAction( TRUE ); 143 a->setToggleAction( TRUE );
@@ -147,3 +148,3 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
147 a->addTo( sub_bar ); 148 a->addTo( sub_bar );
148 a->addTo( view ); 149// a->addTo( view );
149 a->setToggleAction( TRUE ); 150 a->setToggleAction( TRUE );
@@ -154,3 +155,3 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
154 a->addTo( sub_bar ); 155 a->addTo( sub_bar );
155 a->addTo( view ); 156// a->addTo( view );
156 a->setToggleAction( TRUE ); 157 a->setToggleAction( TRUE );
@@ -158,3 +159,5 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
158 159
159 a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), QString::null, 0, g, 0 ); 160 sub_bar->addSeparator();
161
162 a = new QAction( tr( "Find" ), Resource::loadPixmap( "mag" ), QString::null, 0, this, 0 );
160 connect( a, SIGNAL(activated()), this, SLOT(slotFind()) ); 163 connect( a, SIGNAL(activated()), this, SLOT(slotFind()) );
@@ -162,5 +165,5 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
162 165
163 a = new QAction( tr( "Edit..." ), QString::null, 0, 0 ); 166 a = new QAction( tr( "Edit..." ), Resource::loadPixmap("SettingsIcon"), QString::null, 0, this, 0 );
164 connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); 167 connect( a, SIGNAL( activated() ), this, SLOT( slotSettings() ) );
165 a->addTo( settings ); 168 a->addTo( sub_bar );
166 169
@@ -375,9 +378,2 @@ void DateBook::view(int v, const QDate &d) {
375void DateBook::viewDefault(const QDate &d) { 378void DateBook::viewDefault(const QDate &d) {
376/*
377 Config config("DateBook");
378 config.setGroup("Main");
379 int current=config.readNumEntry("defaultview", DAY);
380
381 view(current,d);
382*/
383 view(defaultView,d); 379 view(defaultView,d);
@@ -528,16 +524,9 @@ void DateBook::initDay()
528 dayView->setRowStyle( rowStyle ); 524 dayView->setRowStyle( rowStyle );
529 connect( this, SIGNAL( newEvent() ), 525 connect( this, SIGNAL( newEvent() ), dayView, SLOT( redraw() ) );
530 dayView, SLOT( redraw() ) ); 526 connect( dayView, SIGNAL( newEvent() ), this, SLOT( fileNew() ) );
531 connect( dayView, SIGNAL( newEvent() ), 527 connect( dayView, SIGNAL( removeEvent( const Event & ) ), this, SLOT( removeEvent( const Event & ) ) );
532 this, SLOT( fileNew() ) ); 528 connect( dayView, SIGNAL( editEvent( const Event & ) ), this, SLOT( editEvent( const Event & ) ) );
533 connect( dayView, SIGNAL( removeEvent( const Event & ) ), 529 connect( dayView, SIGNAL( duplicateEvent( const Event & ) ), this, SLOT( duplicateEvent( const Event & ) ) );
534 this, SLOT( removeEvent( const Event & ) ) ); 530 connect( dayView, SIGNAL( beamEvent( const Event & ) ), this, SLOT( beamEvent( const Event & ) ) );
535 connect( dayView, SIGNAL( editEvent( const Event & ) ), 531 connect( dayView, SIGNAL(sigNewEvent(const QString &)), this, SLOT(slotNewEventFromKey(const QString &)) );
536 this, SLOT( editEvent( const Event & ) ) );
537 connect( dayView, SIGNAL( duplicateEvent( const Event & ) ),
538 this, SLOT( duplicateEvent( const Event & ) ) );
539 connect( dayView, SIGNAL( beamEvent( const Event & ) ),
540 this, SLOT( beamEvent( const Event & ) ) );
541 connect( dayView, SIGNAL(sigNewEvent(const QString &)),
542 this, SLOT(slotNewEventFromKey(const QString &)) );
543 } 532 }
@@ -551,6 +540,4 @@ void DateBook::initWeek()
551 views->addWidget( weekView, WEEK ); 540 views->addWidget( weekView, WEEK );
552 connect( weekView, SIGNAL( showDate( int, int, int ) ), 541 connect( weekView, SIGNAL( showDate( int, int, int ) ), this, SLOT( showDay( int, int, int ) ) );
553 this, SLOT( showDay( int, int, int ) ) ); 542 connect( this, SIGNAL( newEvent() ), weekView, SLOT( redraw() ) );
554 connect( this, SIGNAL( newEvent() ),
555 weekView, SLOT( redraw() ) );
556 } 543 }
@@ -570,4 +557,2 @@ void DateBook::initWeek()
570 } 557 }
571 if ( totWeeks != weekView->totalWeeks() )
572 weekView->setTotalWeeks( totWeeks );
573} 558}
@@ -576,4 +561,3 @@ void DateBook::initWeekLst() {
576 if ( !weekLstView ) { 561 if ( !weekLstView ) {
577 weekLstView = new DateBookWeekLst( ampm, onMonday, db, 562 weekLstView = new DateBookWeekLst( ampm, onMonday, db, views, "weeklst view" );
578 views, "weeklst view" );
579 views->addWidget( weekLstView, WEEKLST ); 563 views->addWidget( weekLstView, WEEKLST );
@@ -581,14 +565,7 @@ void DateBook::initWeekLst() {
581 //weekLstView->setStartViewTime( startTime ); 565 //weekLstView->setStartViewTime( startTime );
582 connect( weekLstView, SIGNAL( showDate( int, int, int ) ), 566 connect( weekLstView, SIGNAL( showDate( int, int, int ) ), this, SLOT( showDay( int, int, int ) ) );
583 this, SLOT( showDay( int, int, int ) ) ); 567 connect( weekLstView, SIGNAL( addEvent( const QDateTime &, const QDateTime &, const QString & , const QString &) ),
584 connect( weekLstView, SIGNAL( addEvent( const QDateTime &, 568 this, SLOT( slotNewEntry( const QDateTime &, const QDateTime &, const QString & , const QString &) ) );
585 const QDateTime &, 569 connect( this, SIGNAL( newEvent() ), weekLstView, SLOT( redraw() ) );
586 const QString & , const QString &) ), 570 connect( weekLstView, SIGNAL( editEvent( const Event & ) ), this, SLOT( editEvent( const Event & ) ) );
587 this, SLOT( slotNewEntry( const QDateTime &,
588 const QDateTime &,
589 const QString & , const QString &) ) );
590 connect( this, SIGNAL( newEvent() ),
591 weekLstView, SLOT( redraw() ) );
592 connect( weekLstView, SIGNAL( editEvent( const Event & ) ),
593 this, SLOT( editEvent( const Event & ) ) );
594 } 571 }
@@ -602,6 +579,4 @@ void DateBook::initMonth()
602 views->addWidget( monthView, MONTH ); 579 views->addWidget( monthView, MONTH );
603 connect( monthView, SIGNAL( dateClicked( int, int, int ) ), 580 connect( monthView, SIGNAL( dateClicked( int, int, int ) ), this, SLOT( showDay( int, int, int ) ) );
604 this, SLOT( showDay( int, int, int ) ) ); 581 connect( this, SIGNAL( newEvent() ), monthView, SLOT( redraw() ) );
605 connect( this, SIGNAL( newEvent() ),
606 monthView, SLOT( redraw() ) );
607 qApp->processEvents(); 582 qApp->processEvents();
@@ -631,2 +606,3 @@ void DateBook::loadSettings()
631 defaultCategories.truncate(0); 606 defaultCategories.truncate(0);
607
632 for( QStringList::Iterator i=tmpStringList.begin(); i!=tmpStringList.end(); i++) { 608 for( QStringList::Iterator i=tmpStringList.begin(); i!=tmpStringList.end(); i++) {