summaryrefslogtreecommitdiff
path: root/core/pim/todo
Unidiff
Diffstat (limited to 'core/pim/todo') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp9
-rw-r--r--core/pim/todo/mainwindow.h2
-rw-r--r--core/pim/todo/tableview.cpp21
-rw-r--r--core/pim/todo/tableview.h1
-rw-r--r--core/pim/todo/textviewshow.cpp17
-rw-r--r--core/pim/todo/textviewshow.h5
-rw-r--r--core/pim/todo/todoshow.cpp9
-rw-r--r--core/pim/todo/todoshow.h7
8 files changed, 58 insertions, 13 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index c90166b..d328558 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -88,3 +88,3 @@ void MainWindow::initTemplate() {
88void MainWindow::initActions() { 88void MainWindow::initActions() {
89 89
90 // Data menu 90 // Data menu
@@ -92,3 +92,3 @@ void MainWindow::initActions() {
92 -1, 0 ); 92 -1, 0 );
93 93
94 QAction* a = new QAction( QWidget::tr("New Task" ), Resource::loadPixmap( "new" ), 94 QAction* a = new QAction( QWidget::tr("New Task" ), Resource::loadPixmap( "new" ),
@@ -253,3 +253,3 @@ void MainWindow::initEditor() {
253void MainWindow::initShow() { 253void MainWindow::initShow() {
254 m_curShow = new TextViewShow(this); 254 m_curShow = new TextViewShow(this, this);
255 m_stack->addWidget( m_curShow->widget() , m_counter++ ); 255 m_stack->addWidget( m_curShow->widget() , m_counter++ );
@@ -815 +815,4 @@ void MainWindow::add( const OPimRecord& rec) {
815} 815}
816void MainWindow::slotReturnFromView() {
817 raiseCurrentView();
818}
diff --git a/core/pim/todo/mainwindow.h b/core/pim/todo/mainwindow.h
index d756d64..f880505 100644
--- a/core/pim/todo/mainwindow.h
+++ b/core/pim/todo/mainwindow.h
@@ -62,2 +62,3 @@ namespace Todo {
62 friend class TodoView; // avoid QObject here.... 62 friend class TodoView; // avoid QObject here....
63 friend class TodoShow; // avoid QObject
63 public: 64 public:
@@ -185,2 +186,3 @@ private slots:
185 void slotShowDue( bool ); 186 void slotShowDue( bool );
187 void slotReturnFromView(); // for TodoShow...
186 /* reimplementation from opimmainwindow */ 188 /* reimplementation from opimmainwindow */
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp
index 61d1edd..cec8b5e 100644
--- a/core/pim/todo/tableview.cpp
+++ b/core/pim/todo/tableview.cpp
@@ -61,3 +61,3 @@ TableView::TableView( MainWindow* window, QWidget* wid )
61 : QTable( wid ), TodoView( window ) { 61 : QTable( wid ), TodoView( window ) {
62 62
63 // Load icons 63 // Load icons
@@ -85,6 +85,6 @@ TableView::TableView( MainWindow* window, QWidget* wid )
85 setShowDeadline( todoWindow()->showDeadline() ); 85 setShowDeadline( todoWindow()->showDeadline() );
86 86
87 setSorting( TRUE ); 87 setSorting( TRUE );
88 setSelectionMode( NoSelection ); 88 setSelectionMode( NoSelection );
89 89
90 setLeftMargin( 0 ); 90 setLeftMargin( 0 );
@@ -370,3 +370,3 @@ void TableView::paintCell(QPainter* p, int row, int col, const QRect& cr, bool
370 p->drawPixmap( x + marg, y, m_pic_completed ); 370 p->drawPixmap( x + marg, y, m_pic_completed );
371 } 371 }
372 } 372 }
@@ -471,3 +471,3 @@ void TableView::slotPriority() {
471 */ 471 */
472void TableView::timerEvent( QTimerEvent* ev ) { 472void TableView::timerEvent( QTimerEvent* ) {
473// qWarning("sorted %d", sorted().count() ); 473// qWarning("sorted %d", sorted().count() );
@@ -532 +532,12 @@ void TableView::contentsMouseMoveEvent( QMouseEvent* e ) {
532} 532}
533void TableView::keyPressEvent( QKeyEvent* event) {
534 switch( event->key() ) {
535 case Qt::Key_F33:
536 case Qt::Key_Enter:
537 case Qt::Key_Return:
538 showTodo( sorted().uidAt( currentRow() ) );
539 break;
540 default:
541 QTable::keyPressEvent( event );
542 }
543}
diff --git a/core/pim/todo/tableview.h b/core/pim/todo/tableview.h
index 2b6ea2b..689c496 100644
--- a/core/pim/todo/tableview.h
+++ b/core/pim/todo/tableview.h
@@ -87,2 +87,3 @@ namespace Todo {
87 protected: 87 protected:
88 void keyPressEvent( QKeyEvent* );
88 void contentsMouseReleaseEvent( QMouseEvent* ); 89 void contentsMouseReleaseEvent( QMouseEvent* );
diff --git a/core/pim/todo/textviewshow.cpp b/core/pim/todo/textviewshow.cpp
index 24c8c0e..fe8a9c8 100644
--- a/core/pim/todo/textviewshow.cpp
+++ b/core/pim/todo/textviewshow.cpp
@@ -1 +1,2 @@
1#include "mainwindow.h"
1#include "textviewshow.h" 2#include "textviewshow.h"
@@ -4,4 +5,4 @@ using namespace Todo;
4 5
5TextViewShow::TextViewShow( QWidget* parent) 6TextViewShow::TextViewShow( QWidget* parent, MainWindow* win)
6 : QTextView( parent ), TodoShow() { 7 : QTextView( parent ), TodoShow(win) {
7 8
@@ -19 +20,13 @@ QWidget* TextViewShow::widget() {
19} 20}
21void TextViewShow::keyPressEvent( QKeyEvent* event ) {
22 switch( event->key() ) {
23 case Qt::Key_F33:
24 case Qt::Key_Enter:
25 case Qt::Key_Return:
26 escapeView();
27 break;
28 default:
29 QTextView::keyPressEvent( event );
30 break;
31 }
32}
diff --git a/core/pim/todo/textviewshow.h b/core/pim/todo/textviewshow.h
index f58026b..498de81 100644
--- a/core/pim/todo/textviewshow.h
+++ b/core/pim/todo/textviewshow.h
@@ -8,3 +8,3 @@ namespace Todo {
8 public: 8 public:
9 TextViewShow( QWidget* parent ); 9 TextViewShow( QWidget* parent, MainWindow* );
10 ~TextViewShow(); 10 ~TextViewShow();
@@ -15,2 +15,5 @@ namespace Todo {
15 15
16 protected:
17 void keyPressEvent( QKeyEvent* );
18
16 }; 19 };
diff --git a/core/pim/todo/todoshow.cpp b/core/pim/todo/todoshow.cpp
index c84a08f..4dbc9aa 100644
--- a/core/pim/todo/todoshow.cpp
+++ b/core/pim/todo/todoshow.cpp
@@ -1 +1,3 @@
1
2#include "mainwindow.h"
1#include "todoshow.h" 3#include "todoshow.h"
@@ -4,3 +6,4 @@ using namespace Todo;
4 6
5TodoShow::TodoShow() { 7TodoShow::TodoShow(MainWindow* win) {
8 m_win = win;
6} 9}
@@ -8,2 +11,6 @@ TodoShow::~TodoShow() {
8} 11}
12void TodoShow::escapeView() {
13 if (m_win )
14 m_win->slotReturnFromView();
15}
9 16
diff --git a/core/pim/todo/todoshow.h b/core/pim/todo/todoshow.h
index 198e9ae..7267b13 100644
--- a/core/pim/todo/todoshow.h
+++ b/core/pim/todo/todoshow.h
@@ -36,2 +36,3 @@
36namespace Todo { 36namespace Todo {
37 class MainWindow;
37 /** 38 /**
@@ -44,3 +45,3 @@ namespace Todo {
44 public: 45 public:
45 TodoShow(); 46 TodoShow( MainWindow* win);
46 virtual ~TodoShow(); 47 virtual ~TodoShow();
@@ -49,2 +50,6 @@ namespace Todo {
49 virtual QWidget* widget() = 0; 50 virtual QWidget* widget() = 0;
51 protected:
52 void escapeView();
53 private:
54 MainWindow *m_win;
50 }; 55 };