author | leseb <leseb> | 2002-07-10 17:45:15 (UTC) |
---|---|---|
committer | leseb <leseb> | 2002-07-10 17:45:15 (UTC) |
commit | 6456ddb2be2a874e858ee25d8463e446b7af58d5 (patch) (unidiff) | |
tree | c2354188cea6176ed1959dfd304f701428da1ce7 | |
parent | 46110a78dd0646d972f238e295ee016f3e78fb85 (diff) | |
download | opie-6456ddb2be2a874e858ee25d8463e446b7af58d5.zip opie-6456ddb2be2a874e858ee25d8463e446b7af58d5.tar.gz opie-6456ddb2be2a874e858ee25d8463e446b7af58d5.tar.bz2 |
Fix "view" menu item
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 6 | ||||
-rw-r--r-- | core/pim/todo/mainwindow.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index d419166..27e76d9 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -145,32 +145,33 @@ TodoWindow::TodoWindow( QWidget *parent, const char *name, WFlags f ) : | |||
145 | 145 | ||
146 | a = new QAction( tr( "Edit Task" ), Resource::loadIconSet( "edit" ), | 146 | a = new QAction( tr( "Edit Task" ), Resource::loadIconSet( "edit" ), |
147 | QString::null, 0, this, 0 ); | 147 | QString::null, 0, this, 0 ); |
148 | connect( a, SIGNAL( activated() ), | 148 | connect( a, SIGNAL( activated() ), |
149 | this, SLOT( slotEdit() ) ); | 149 | this, SLOT( slotEdit() ) ); |
150 | a->addTo( bar ); | 150 | a->addTo( bar ); |
151 | a->addTo( edit ); | 151 | a->addTo( edit ); |
152 | a->addTo( contextMenu ); | 152 | a->addTo( contextMenu ); |
153 | a->setEnabled( FALSE ); | 153 | a->setEnabled( FALSE ); |
154 | editAction = a; | 154 | editAction = a; |
155 | 155 | ||
156 | a = new QAction( QString::null, tr("View Task"), 0, this, 0 ); | 156 | a = new QAction( QString::null, tr("View Task"), 0, this, 0 ); |
157 | a->addTo( edit ); | 157 | a->addTo( edit ); |
158 | a->addTo( contextMenu ); | 158 | a->addTo( contextMenu ); |
159 | connect( a, SIGNAL( activated() ), | 159 | connect( a, SIGNAL( activated() ), |
160 | this, SLOT(slotShowDetails() ) ); | 160 | this, SLOT(slotShowDetails() ) ); |
161 | viewAction = a; | ||
161 | 162 | ||
162 | edit->insertSeparator(); | 163 | edit->insertSeparator(); |
163 | 164 | ||
164 | a = new QAction( tr( "Delete..." ), Resource::loadIconSet( "trash" ), | 165 | a = new QAction( tr( "Delete..." ), Resource::loadIconSet( "trash" ), |
165 | QString::null, 0, this, 0 ); | 166 | QString::null, 0, this, 0 ); |
166 | connect( a, SIGNAL( activated() ), | 167 | connect( a, SIGNAL( activated() ), |
167 | this, SLOT( slotDelete() ) ); | 168 | this, SLOT( slotDelete() ) ); |
168 | a->addTo( bar ); | 169 | a->addTo( bar ); |
169 | a->addTo( edit ); | 170 | a->addTo( edit ); |
170 | a->addTo( contextMenu ); | 171 | a->addTo( contextMenu ); |
171 | a->setEnabled( FALSE ); | 172 | a->setEnabled( FALSE ); |
172 | deleteAction = a; | 173 | deleteAction = a; |
173 | 174 | ||
174 | // delete All in category is missing.... | 175 | // delete All in category is missing.... |
175 | // set All Done | 176 | // set All Done |
176 | // set All Done in category | 177 | // set All Done in category |
@@ -423,37 +424,39 @@ void TodoWindow::slotShowPopup( const QPoint &p ) | |||
423 | } | 424 | } |
424 | 425 | ||
425 | void TodoWindow::showCompleted( bool s ) | 426 | void TodoWindow::showCompleted( bool s ) |
426 | { | 427 | { |
427 | if ( !table->isUpdatesEnabled() ) | 428 | if ( !table->isUpdatesEnabled() ) |
428 | return; | 429 | return; |
429 | table->setPaintingEnabled( false ); | 430 | table->setPaintingEnabled( false ); |
430 | table->setShowCompleted( s ); | 431 | table->setShowCompleted( s ); |
431 | table->setPaintingEnabled( true ); | 432 | table->setPaintingEnabled( true ); |
432 | mStack->raiseWidget( 1 ); | 433 | mStack->raiseWidget( 1 ); |
433 | } | 434 | } |
434 | 435 | ||
435 | void TodoWindow::currentEntryChanged( int r, int ) | 436 | void TodoWindow::currentEntryChanged( int r, int ) |
436 | { | 437 | { |
437 | if ( r != -1 && table->rowHeight( r ) > 0 ) { | 438 | if ( r != -1 && table->rowHeight( r ) > 0 ) { |
438 | editAction->setEnabled( TRUE ); | 439 | editAction->setEnabled( TRUE ); |
440 | viewAction->setEnabled( TRUE ); | ||
439 | deleteAction->setEnabled( TRUE ); | 441 | deleteAction->setEnabled( TRUE ); |
440 | duplicateAction->setEnabled( TRUE ); | 442 | duplicateAction->setEnabled( TRUE ); |
441 | deleteAllAction->setEnabled( TRUE ); | 443 | deleteAllAction->setEnabled( TRUE ); |
442 | } else { | 444 | } else { |
443 | editAction->setEnabled( FALSE ); | 445 | editAction->setEnabled( FALSE ); |
446 | viewAction->setEnabled( FALSE ); | ||
444 | deleteAction->setEnabled( FALSE ); | 447 | deleteAction->setEnabled( FALSE ); |
445 | duplicateAction->setEnabled( FALSE ); | 448 | duplicateAction->setEnabled( FALSE ); |
446 | deleteAllAction->setEnabled( FALSE ); | 449 | deleteAllAction->setEnabled( FALSE ); |
447 | } | 450 | } |
448 | } | 451 | } |
449 | 452 | ||
450 | void TodoWindow::setCategory( int c ) | 453 | void TodoWindow::setCategory( int c ) |
451 | { | 454 | { |
452 | if ( c <= 0 ) return; | 455 | if ( c <= 0 ) return; |
453 | if ( !table->isUpdatesEnabled() ) | 456 | if ( !table->isUpdatesEnabled() ) |
454 | return; | 457 | return; |
455 | table->setPaintingEnabled( false ); | 458 | table->setPaintingEnabled( false ); |
456 | for ( unsigned int i = 1; i < catMenu->count(); i++ ) | 459 | for ( unsigned int i = 1; i < catMenu->count(); i++ ) |
457 | catMenu->setItemChecked( i, c == (int)i ); | 460 | catMenu->setItemChecked( i, c == (int)i ); |
458 | if ( c == 1 ) { | 461 | if ( c == 1 ) { |
459 | table->setShowCategory( QString::null ); | 462 | table->setShowCategory( QString::null ); |
@@ -594,35 +597,38 @@ void TodoWindow::slotBeam() | |||
594 | todoDB.addEvent( c ); | 597 | todoDB.addEvent( c ); |
595 | todoDB.save(); | 598 | todoDB.save(); |
596 | Ir *ir = new Ir( this ); | 599 | Ir *ir = new Ir( this ); |
597 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); | 600 | connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); |
598 | QString description = c.summary(); | 601 | QString description = c.summary(); |
599 | ir->send( beamfile, description, "text/x-vCalendar" ); | 602 | ir->send( beamfile, description, "text/x-vCalendar" ); |
600 | } | 603 | } |
601 | 604 | ||
602 | void TodoWindow::beamDone( Ir *ir ) | 605 | void TodoWindow::beamDone( Ir *ir ) |
603 | { | 606 | { |
604 | delete ir; | 607 | delete ir; |
605 | unlink( beamfile ); | 608 | unlink( beamfile ); |
606 | } | 609 | } |
607 | 610 | ||
608 | void TodoWindow::showDeadline( bool s ) | 611 | void TodoWindow::showDeadline( bool s ) |
609 | { | 612 | { |
613 | if ( !table->isUpdatesEnabled() ) | ||
614 | return; | ||
610 | table->setPaintingEnabled( false ); | 615 | table->setPaintingEnabled( false ); |
611 | table->setShowDeadline( s ); | 616 | table->setShowDeadline( s ); |
612 | table->setPaintingEnabled( true ); | 617 | table->setPaintingEnabled( true ); |
618 | mStack->raiseWidget( 1 ); | ||
613 | } | 619 | } |
614 | void TodoWindow::slotShowDetails() | 620 | void TodoWindow::slotShowDetails() |
615 | { | 621 | { |
616 | ToDoEvent event = table->currentEntry(); | 622 | ToDoEvent event = table->currentEntry(); |
617 | slotShowDetails( event ); | 623 | slotShowDetails( event ); |
618 | } | 624 | } |
619 | void TodoWindow::slotShowDetails( const ToDoEvent &event ) | 625 | void TodoWindow::slotShowDetails( const ToDoEvent &event ) |
620 | { | 626 | { |
621 | if( mView == 0l ){ | 627 | if( mView == 0l ){ |
622 | mView = new TodoLabel(mStack); | 628 | mView = new TodoLabel(mStack); |
623 | mStack->addWidget( mView, 2 ); | 629 | mStack->addWidget( mView, 2 ); |
624 | } | 630 | } |
625 | mView->init( event ); | 631 | mView->init( event ); |
626 | mView->sync(); | 632 | mView->sync(); |
627 | mStack->raiseWidget( 2); | 633 | mStack->raiseWidget( 2); |
628 | } | 634 | } |
diff --git a/core/pim/todo/mainwindow.h b/core/pim/todo/mainwindow.h index f62ec6e..7e8445c 100644 --- a/core/pim/todo/mainwindow.h +++ b/core/pim/todo/mainwindow.h | |||
@@ -66,31 +66,32 @@ protected slots: | |||
66 | void slotBeam(); | 66 | void slotBeam(); |
67 | void beamDone( Ir * ); | 67 | void beamDone( Ir * ); |
68 | void slotDeleteAll(); | 68 | void slotDeleteAll(); |
69 | void slotDuplicate(); | 69 | void slotDuplicate(); |
70 | 70 | ||
71 | protected: | 71 | protected: |
72 | void closeEvent( QCloseEvent *e ); | 72 | void closeEvent( QCloseEvent *e ); |
73 | 73 | ||
74 | private: | 74 | private: |
75 | void populateCategories(); | 75 | void populateCategories(); |
76 | //inline void switchToTable(); // move back to the normal view | 76 | //inline void switchToTable(); // move back to the normal view |
77 | 77 | ||
78 | private: | 78 | private: |
79 | TodoTable *table; | 79 | TodoTable *table; |
80 | TodoLabel *mView; | 80 | TodoLabel *mView; |
81 | QAction *editAction, | 81 | QAction *editAction, |
82 | *viewAction, | ||
82 | *deleteAction, | 83 | *deleteAction, |
83 | *findAction, | 84 | *findAction, |
84 | *completedAction, | 85 | *completedAction, |
85 | *showdeadlineAction, | 86 | *showdeadlineAction, |
86 | *deleteAllAction, | 87 | *deleteAllAction, |
87 | *duplicateAction; | 88 | *duplicateAction; |
88 | QPopupMenu *contextMenu, *catMenu; | 89 | QPopupMenu *contextMenu, *catMenu; |
89 | QWidgetStack *mStack; | 90 | QWidgetStack *mStack; |
90 | 91 | ||
91 | bool syncing; | 92 | bool syncing; |
92 | }; | 93 | }; |
93 | 94 | ||
94 | #endif | 95 | #endif |
95 | 96 | ||
96 | 97 | ||