-rw-r--r-- | core/pim/todo/mainwindow.cpp | 2 | ||||
-rw-r--r-- | core/pim/todo/mainwindow.h | 8 | ||||
-rw-r--r-- | core/pim/todo/quickeditimpl.cpp | 2 |
3 files changed, 5 insertions, 7 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index a244e58..c2f422d 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -1,163 +1,163 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 <> | 3 | .=l. Copyright (c) 2002 <> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This program is free software; you can | 5 | _;:, .> :=|. This program is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This program is distributed in the hope that | 12 | .i_,=:_. -<s. This program is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: details. |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = General Public License along with | 21 | -_. . . )=. = General Public License along with |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <unistd.h> | 29 | #include <unistd.h> |
30 | 30 | ||
31 | #include <opie2/opimrecurrence.h> | 31 | #include <opie2/opimrecurrence.h> |
32 | #include <opie2/opimnotifymanager.h> | 32 | #include <opie2/opimnotifymanager.h> |
33 | #include <opie2/otodoaccessvcal.h> | 33 | #include <opie2/otodoaccessvcal.h> |
34 | #include <opie2/oapplicationfactory.h> | 34 | #include <opie2/oapplicationfactory.h> |
35 | 35 | ||
36 | #include <qpe/applnk.h> | 36 | #include <qpe/applnk.h> |
37 | #include <qpe/config.h> | 37 | #include <qpe/config.h> |
38 | #include <qpe/ir.h> | 38 | #include <qpe/ir.h> |
39 | #include <qpe/resource.h> | 39 | #include <qpe/resource.h> |
40 | #include <qpe/qpemessagebox.h> | 40 | #include <qpe/qpemessagebox.h> |
41 | #include <qpe/alarmserver.h> | 41 | #include <qpe/alarmserver.h> |
42 | #include <qpe/qpeapplication.h> | 42 | #include <qpe/qpeapplication.h> |
43 | 43 | ||
44 | #include <qmenubar.h> | 44 | #include <qmenubar.h> |
45 | #include <qmessagebox.h> | 45 | #include <qmessagebox.h> |
46 | #include <qpushbutton.h> | 46 | #include <qpushbutton.h> |
47 | #include <qaction.h> | 47 | #include <qaction.h> |
48 | #include <qtimer.h> | 48 | #include <qtimer.h> |
49 | #include <qlayout.h> | 49 | #include <qlayout.h> |
50 | #include <qwhatsthis.h> | 50 | #include <qwhatsthis.h> |
51 | 51 | ||
52 | #include "quickeditimpl.h" | 52 | #include "quickeditimpl.h" |
53 | #include "todotemplatemanager.h" | 53 | #include "todotemplatemanager.h" |
54 | #include "templateeditor.h" | 54 | #include "templateeditor.h" |
55 | #include "tableview.h" | 55 | #include "tableview.h" |
56 | 56 | ||
57 | #include "textviewshow.h" | 57 | #include "textviewshow.h" |
58 | #include "todoeditor.h" | 58 | #include "todoeditor.h" |
59 | #include "mainwindow.h" | 59 | #include "mainwindow.h" |
60 | 60 | ||
61 | OPIE_EXPORT_APP( OApplicationFactory<Todo::MainWindow> ) | 61 | OPIE_EXPORT_APP( OApplicationFactory<Todo::MainWindow> ) |
62 | 62 | ||
63 | using namespace Todo; | 63 | using namespace Todo; |
64 | 64 | ||
65 | MainWindow::MainWindow( QWidget* parent, | 65 | MainWindow::MainWindow( QWidget* parent, |
66 | const char* name, WFlags ) | 66 | const char* name, WFlags ) |
67 | : OPimMainWindow( "Todolist", parent, name, WType_TopLevel | WStyle_ContextHelp ) | 67 | : Opie::OPimMainWindow( "Todolist", parent, name, WType_TopLevel | WStyle_ContextHelp ) |
68 | { | 68 | { |
69 | if (!name) | 69 | if (!name) |
70 | setName("todo window"); | 70 | setName("todo window"); |
71 | 71 | ||
72 | m_syncing = false; | 72 | m_syncing = false; |
73 | m_showing = false; | 73 | m_showing = false; |
74 | m_counter = 0; | 74 | m_counter = 0; |
75 | m_tempManager = new TemplateManager(); | 75 | m_tempManager = new TemplateManager(); |
76 | m_tempManager->load(); | 76 | m_tempManager->load(); |
77 | 77 | ||
78 | initUI(); | 78 | initUI(); |
79 | initConfig(); | 79 | initConfig(); |
80 | initViews(); | 80 | initViews(); |
81 | initActions(); | 81 | initActions(); |
82 | initEditor(); | 82 | initEditor(); |
83 | initShow(); | 83 | initShow(); |
84 | initTemplate(); | 84 | initTemplate(); |
85 | 85 | ||
86 | populateTemplates(); | 86 | populateTemplates(); |
87 | raiseCurrentView(); | 87 | raiseCurrentView(); |
88 | QTimer::singleShot(0, this, SLOT(populateCategories() ) ); | 88 | QTimer::singleShot(0, this, SLOT(populateCategories() ) ); |
89 | } | 89 | } |
90 | void MainWindow::initTemplate() { | 90 | void MainWindow::initTemplate() { |
91 | m_curTempEd = new TemplateEditor( this, templateManager() ); | 91 | m_curTempEd = new TemplateEditor( this, templateManager() ); |
92 | } | 92 | } |
93 | void MainWindow::initActions() { | 93 | void MainWindow::initActions() { |
94 | 94 | ||
95 | // Data menu | 95 | // Data menu |
96 | m_edit->insertItem(QWidget::tr("New from template"), m_template, | 96 | m_edit->insertItem(QWidget::tr("New from template"), m_template, |
97 | -1, 0 ); | 97 | -1, 0 ); |
98 | 98 | ||
99 | QAction* a = new QAction( QWidget::tr("New Task" ), Resource::loadPixmap( "new" ), | 99 | QAction* a = new QAction( QWidget::tr("New Task" ), Resource::loadPixmap( "new" ), |
100 | QString::null, 0, this, 0 ); | 100 | QString::null, 0, this, 0 ); |
101 | connect(a, SIGNAL( activated() ), | 101 | connect(a, SIGNAL( activated() ), |
102 | this, SLOT( slotNew() ) ); | 102 | this, SLOT( slotNew() ) ); |
103 | a->setWhatsThis( QWidget::tr( "Click here to create a new task." ) ); | 103 | a->setWhatsThis( QWidget::tr( "Click here to create a new task." ) ); |
104 | a->addTo(m_tool ); | 104 | a->addTo(m_tool ); |
105 | a->addTo(m_edit ); | 105 | a->addTo(m_edit ); |
106 | 106 | ||
107 | a = new QAction( QWidget::tr("Edit Task"), Resource::loadIconSet( "edit" ), | 107 | a = new QAction( QWidget::tr("Edit Task"), Resource::loadIconSet( "edit" ), |
108 | QString::null, 0, this, 0 ); | 108 | QString::null, 0, this, 0 ); |
109 | connect(a, SIGNAL(activated() ), | 109 | connect(a, SIGNAL(activated() ), |
110 | this, SLOT( slotEdit() ) ); | 110 | this, SLOT( slotEdit() ) ); |
111 | a->setWhatsThis( QWidget::tr( "Click here to modify the current task." ) ); | 111 | a->setWhatsThis( QWidget::tr( "Click here to modify the current task." ) ); |
112 | a->addTo( m_tool ); | 112 | a->addTo( m_tool ); |
113 | a->addTo( m_edit ); | 113 | a->addTo( m_edit ); |
114 | m_editAction = a; | 114 | m_editAction = a; |
115 | 115 | ||
116 | a = new QAction( QString::null, QWidget::tr("View Task"), 0, this, 0 ); | 116 | a = new QAction( QString::null, QWidget::tr("View Task"), 0, this, 0 ); |
117 | connect(a, SIGNAL( activated() ), | 117 | connect(a, SIGNAL( activated() ), |
118 | this, SLOT( slotShowDetails() ) ); | 118 | this, SLOT( slotShowDetails() ) ); |
119 | a->addTo( m_edit ); | 119 | a->addTo( m_edit ); |
120 | 120 | ||
121 | m_edit->insertSeparator(); | 121 | m_edit->insertSeparator(); |
122 | 122 | ||
123 | a = new QAction( QWidget::tr("Delete..."), Resource::loadIconSet( "trash" ), | 123 | a = new QAction( QWidget::tr("Delete..."), Resource::loadIconSet( "trash" ), |
124 | QString::null, 0, this, 0 ); | 124 | QString::null, 0, this, 0 ); |
125 | connect(a, SIGNAL(activated() ), | 125 | connect(a, SIGNAL(activated() ), |
126 | this, SLOT(slotDelete() ) ); | 126 | this, SLOT(slotDelete() ) ); |
127 | a->setWhatsThis( QWidget::tr( "Click here to remove the current task." ) ); | 127 | a->setWhatsThis( QWidget::tr( "Click here to remove the current task." ) ); |
128 | a->addTo( m_tool ); | 128 | a->addTo( m_tool ); |
129 | a->addTo( m_edit ); | 129 | a->addTo( m_edit ); |
130 | m_deleteAction = a; | 130 | m_deleteAction = a; |
131 | 131 | ||
132 | a = new QAction( QString::null, QWidget::tr("Delete all..."), 0, this, 0 ); | 132 | a = new QAction( QString::null, QWidget::tr("Delete all..."), 0, this, 0 ); |
133 | connect(a, SIGNAL( activated() ), | 133 | connect(a, SIGNAL( activated() ), |
134 | this, SLOT( slotDeleteAll() ) ); | 134 | this, SLOT( slotDeleteAll() ) ); |
135 | a->addTo(m_edit ); | 135 | a->addTo(m_edit ); |
136 | m_deleteAllAction = a; | 136 | m_deleteAllAction = a; |
137 | 137 | ||
138 | a = new QAction( QString::null, QWidget::tr("Delete completed"), | 138 | a = new QAction( QString::null, QWidget::tr("Delete completed"), |
139 | 0, this, 0 ); | 139 | 0, this, 0 ); |
140 | connect(a, SIGNAL( activated() ), | 140 | connect(a, SIGNAL( activated() ), |
141 | this, SLOT( slotDeleteCompleted() ) ); | 141 | this, SLOT( slotDeleteCompleted() ) ); |
142 | a->addTo(m_edit ); | 142 | a->addTo(m_edit ); |
143 | a->setEnabled( TRUE ); | 143 | a->setEnabled( TRUE ); |
144 | m_deleteCompleteAction = a; | 144 | m_deleteCompleteAction = a; |
145 | 145 | ||
146 | m_edit->insertSeparator(); | 146 | m_edit->insertSeparator(); |
147 | 147 | ||
148 | a = new QAction( QString::null, QWidget::tr("Duplicate"), 0, this, 0 ); | 148 | a = new QAction( QString::null, QWidget::tr("Duplicate"), 0, this, 0 ); |
149 | connect(a, SIGNAL( activated() ), | 149 | connect(a, SIGNAL( activated() ), |
150 | this, SLOT( slotDuplicate() ) ); | 150 | this, SLOT( slotDuplicate() ) ); |
151 | a->addTo(m_edit ); | 151 | a->addTo(m_edit ); |
152 | m_duplicateAction = a; | 152 | m_duplicateAction = a; |
153 | 153 | ||
154 | m_edit->insertSeparator(); | 154 | m_edit->insertSeparator(); |
155 | 155 | ||
156 | if ( Ir::supported() ) { | 156 | if ( Ir::supported() ) { |
157 | a = new QAction( QWidget::tr( "Beam" ), Resource::loadPixmap( "beam" ), QString::null, 0, this, 0 ); | 157 | a = new QAction( QWidget::tr( "Beam" ), Resource::loadPixmap( "beam" ), QString::null, 0, this, 0 ); |
158 | connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) ); | 158 | connect( a, SIGNAL( activated() ), this, SLOT( slotBeam() ) ); |
159 | a->setWhatsThis( QWidget::tr( "Click here to send the current task to another device." ) ); | 159 | a->setWhatsThis( QWidget::tr( "Click here to send the current task to another device." ) ); |
160 | a->addTo( m_edit ); | 160 | a->addTo( m_edit ); |
161 | a->addTo( m_tool ); | 161 | a->addTo( m_tool ); |
162 | } | 162 | } |
163 | 163 | ||
diff --git a/core/pim/todo/mainwindow.h b/core/pim/todo/mainwindow.h index 6a7296b..b35a42b 100644 --- a/core/pim/todo/mainwindow.h +++ b/core/pim/todo/mainwindow.h | |||
@@ -1,213 +1,211 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> | 3 | .=l. Copyright (c) 2002 Holger Freyther <zecke@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This program is free software; you can | 5 | _;:, .> :=|. This program is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This program is distributed in the hope that | 12 | .i_,=:_. -<s. This program is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. .` .: details. | 18 | ++= -. .` .: details. |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = Library General Public License along with |
22 | -- :-=` this library; see the file COPYING.LIB. | 22 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #ifndef TODO_MAIN_WINDOW_H | 29 | #ifndef TODO_MAIN_WINDOW_H |
30 | #define TODO_MAIN_WINDOW_H | 30 | #define TODO_MAIN_WINDOW_H |
31 | 31 | ||
32 | #include <qlist.h> | 32 | #include <qlist.h> |
33 | 33 | ||
34 | #include <opie2/otodoaccess.h> | 34 | #include <opie2/otodoaccess.h> |
35 | #include <opie2/opimtodo.h> | 35 | #include <opie2/opimtodo.h> |
36 | #include <opie2/opimmainwindow.h> | 36 | #include <opie2/opimmainwindow.h> |
37 | #include <opie2/owidgetstack.h> | 37 | #include <opie2/owidgetstack.h> |
38 | 38 | ||
39 | #include "smalltodo.h" | 39 | #include "smalltodo.h" |
40 | #include "todoview.h" | 40 | #include "todoview.h" |
41 | #include "quickedit.h" | 41 | #include "quickedit.h" |
42 | #include "todomanager.h" | 42 | #include "todomanager.h" |
43 | 43 | ||
44 | class QPopupMenu; | 44 | class QPopupMenu; |
45 | class QMenuBar; | 45 | class QMenuBar; |
46 | class QToolBar; | 46 | class QToolBar; |
47 | class QAction; | 47 | class QAction; |
48 | class Ir; | 48 | class Ir; |
49 | class QVBox; | 49 | class QVBox; |
50 | class QLineEdit; | 50 | class QLineEdit; |
51 | 51 | ||
52 | using namespace Opie; | ||
53 | |||
54 | namespace Todo { | 52 | namespace Todo { |
55 | typedef TodoView View; | 53 | typedef TodoView View; |
56 | class TemplateManager; | 54 | class TemplateManager; |
57 | class Editor; | 55 | class Editor; |
58 | class TodoShow; | 56 | class TodoShow; |
59 | class TemplateEditor; | 57 | class TemplateEditor; |
60 | struct QuickEditBase; | 58 | struct QuickEditBase; |
61 | 59 | ||
62 | class MainWindow : public OPimMainWindow { | 60 | class MainWindow : public Opie::OPimMainWindow { |
63 | Q_OBJECT | 61 | Q_OBJECT |
64 | friend class TodoView; // avoid QObject here.... | 62 | friend class TodoView; // avoid QObject here.... |
65 | friend class TodoShow; // avoid QObject | 63 | friend class TodoShow; // avoid QObject |
66 | public: | 64 | public: |
67 | /* OApplicationFactory application Name */ | 65 | /* OApplicationFactory application Name */ |
68 | static QString appName() { return QString::fromLatin1("todolist"); } | 66 | static QString appName() { return QString::fromLatin1("todolist"); } |
69 | 67 | ||
70 | MainWindow( QWidget *parent = 0, | 68 | MainWindow( QWidget *parent = 0, |
71 | const char* name = 0, WFlags fl = 0 ); | 69 | const char* name = 0, WFlags fl = 0 ); |
72 | ~MainWindow(); | 70 | ~MainWindow(); |
73 | 71 | ||
74 | /** return a context menu for an OPimTodo */ | 72 | /** return a context menu for an OPimTodo */ |
75 | QPopupMenu* contextMenu(int uid, bool doesRecur = FALSE ); | 73 | QPopupMenu* contextMenu(int uid, bool doesRecur = FALSE ); |
76 | QPopupMenu* options(); | 74 | QPopupMenu* options(); |
77 | QPopupMenu* edit(); | 75 | QPopupMenu* edit(); |
78 | QToolBar* toolbar(); | 76 | QToolBar* toolbar(); |
79 | 77 | ||
80 | 78 | ||
81 | void updateList(); | 79 | void updateList(); |
82 | OPimTodoAccess::List list()const; | 80 | OPimTodoAccess::List list()const; |
83 | OPimTodoAccess::List sorted( bool asc, int sortOrder ); | 81 | OPimTodoAccess::List sorted( bool asc, int sortOrder ); |
84 | OPimTodoAccess::List sorted( bool asc, int sortOrder, int addFilter ); | 82 | OPimTodoAccess::List sorted( bool asc, int sortOrder, int addFilter ); |
85 | 83 | ||
86 | OPimTodo event(int uid ); | 84 | OPimTodo event(int uid ); |
87 | 85 | ||
88 | bool isSyncing()const; | 86 | bool isSyncing()const; |
89 | bool showCompleted()const; | 87 | bool showCompleted()const; |
90 | bool showDeadline()const; | 88 | bool showDeadline()const; |
91 | bool showOverDue()const; | 89 | bool showOverDue()const; |
92 | bool showQuickTask()const; | 90 | bool showQuickTask()const; |
93 | QString currentCategory()const; | 91 | QString currentCategory()const; |
94 | int currentCatId(); | 92 | int currentCatId(); |
95 | TemplateManager* templateManager(); | 93 | TemplateManager* templateManager(); |
96 | QuickEditBase* quickEditor(); | 94 | QuickEditBase* quickEditor(); |
97 | 95 | ||
98 | void updateTodo( const OPimTodo& ); | 96 | void updateTodo( const OPimTodo& ); |
99 | void populateTemplates(); | 97 | void populateTemplates(); |
100 | Editor* currentEditor(); | 98 | Editor* currentEditor(); |
101 | void setReadAhead(uint count ); | 99 | void setReadAhead(uint count ); |
102 | private slots: | 100 | private slots: |
103 | void slotQuickEntered(); | 101 | void slotQuickEntered(); |
104 | void populateCategories(); | 102 | void populateCategories(); |
105 | void slotReload(); | 103 | void slotReload(); |
106 | void slotFlush(); | 104 | void slotFlush(); |
107 | 105 | ||
108 | protected: | 106 | protected: |
109 | void closeEvent( QCloseEvent* e ); | 107 | void closeEvent( QCloseEvent* e ); |
110 | 108 | ||
111 | private: | 109 | private: |
112 | /* handle setting and removing alarms */ | 110 | /* handle setting and removing alarms */ |
113 | void handleAlarms( const OPimTodo& oldTodo, const OPimTodo& newTodo ); | 111 | void handleAlarms( const OPimTodo& oldTodo, const OPimTodo& newTodo ); |
114 | void receiveFile( const QString& filename ); | 112 | void receiveFile( const QString& filename ); |
115 | void connectBase( ViewBase* ); | 113 | void connectBase( ViewBase* ); |
116 | void initUI(); | 114 | void initUI(); |
117 | void initActions(); | 115 | void initActions(); |
118 | void initConfig(); | 116 | void initConfig(); |
119 | void initViews(); | 117 | void initViews(); |
120 | void initEditor(); | 118 | void initEditor(); |
121 | void initShow(); | 119 | void initShow(); |
122 | void initTemplate(); | 120 | void initTemplate(); |
123 | void raiseCurrentView(); | 121 | void raiseCurrentView(); |
124 | ViewBase* currentView(); | 122 | ViewBase* currentView(); |
125 | ViewBase* m_curView; | 123 | ViewBase* m_curView; |
126 | bool m_showing : 1; // used to see if we show a todo in the cases we shouldn't change the table | 124 | bool m_showing : 1; // used to see if we show a todo in the cases we shouldn't change the table |
127 | QuickEditBase* m_curQuick; | 125 | QuickEditBase* m_curQuick; |
128 | Editor* m_curEdit; | 126 | Editor* m_curEdit; |
129 | TodoShow* currentShow(); | 127 | TodoShow* currentShow(); |
130 | TodoShow* m_curShow; | 128 | TodoShow* m_curShow; |
131 | TemplateEditor* currentTemplateEditor(); | 129 | TemplateEditor* currentTemplateEditor(); |
132 | TemplateEditor* m_curTempEd; | 130 | TemplateEditor* m_curTempEd; |
133 | 131 | ||
134 | QMenuBar* m_bar; | 132 | QMenuBar* m_bar; |
135 | QToolBar* m_tool; | 133 | QToolBar* m_tool; |
136 | QAction* m_editAction, | 134 | QAction* m_editAction, |
137 | *m_deleteAction, | 135 | *m_deleteAction, |
138 | *m_findAction, | 136 | *m_findAction, |
139 | *m_completedAction, | 137 | *m_completedAction, |
140 | *m_showDeadLineAction, | 138 | *m_showDeadLineAction, |
141 | *m_deleteAllAction, | 139 | *m_deleteAllAction, |
142 | *m_deleteCompleteAction, | 140 | *m_deleteCompleteAction, |
143 | *m_duplicateAction, | 141 | *m_duplicateAction, |
144 | *m_showOverDueAction, | 142 | *m_showOverDueAction, |
145 | *m_showQuickTaskAction, | 143 | *m_showQuickTaskAction, |
146 | *m_effectiveAction; | 144 | *m_effectiveAction; |
147 | OWidgetStack *m_stack; | 145 | Opie::OWidgetStack *m_stack; |
148 | QPopupMenu* m_catMenu, | 146 | QPopupMenu* m_catMenu, |
149 | *m_edit, | 147 | *m_edit, |
150 | *m_options, | 148 | *m_options, |
151 | *m_template; | 149 | *m_template; |
152 | 150 | ||
153 | bool m_syncing:1; | 151 | bool m_syncing:1; |
154 | bool m_deadline:1; | 152 | bool m_deadline:1; |
155 | bool m_completed:1; | 153 | bool m_completed:1; |
156 | bool m_overdue:1; | 154 | bool m_overdue:1; |
157 | bool m_quicktask:1; | 155 | bool m_quicktask:1; |
158 | TodoManager m_todoMgr; | 156 | TodoManager m_todoMgr; |
159 | QString m_curCat; | 157 | QString m_curCat; |
160 | QList<ViewBase> m_views; | 158 | QList<ViewBase> m_views; |
161 | uint m_counter; | 159 | uint m_counter; |
162 | TemplateManager* m_tempManager; | 160 | TemplateManager* m_tempManager; |
163 | 161 | ||
164 | 162 | ||
165 | private slots: | 163 | private slots: |
166 | void slotShow(int); | 164 | void slotShow(int); |
167 | void slotEdit(int); | 165 | void slotEdit(int); |
168 | void slotUpdate3( QWidget* ); | 166 | void slotUpdate3( QWidget* ); |
169 | void slotComplete( int uid ); | 167 | void slotComplete( int uid ); |
170 | void slotComplete( const OPimTodo& ev ); | 168 | void slotComplete( const OPimTodo& ev ); |
171 | void slotNewFromTemplate(int id ); | 169 | void slotNewFromTemplate(int id ); |
172 | void slotNew(); | 170 | void slotNew(); |
173 | void slotDuplicate(); | 171 | void slotDuplicate(); |
174 | 172 | ||
175 | void slotDelete(); | 173 | void slotDelete(); |
176 | void slotDelete(int uid ); | 174 | void slotDelete(int uid ); |
177 | void slotDeleteAll(); | 175 | void slotDeleteAll(); |
178 | void slotDeleteCompleted(); | 176 | void slotDeleteCompleted(); |
179 | 177 | ||
180 | void slotEdit(); | 178 | void slotEdit(); |
181 | void slotFind(); | 179 | void slotFind(); |
182 | 180 | ||
183 | void setCategory( int ); | 181 | void setCategory( int ); |
184 | 182 | ||
185 | void slotShowDeadLine( bool ); | 183 | void slotShowDeadLine( bool ); |
186 | void slotShowCompleted( bool ); | 184 | void slotShowCompleted( bool ); |
187 | void slotShowQuickTask( bool ); | 185 | void slotShowQuickTask( bool ); |
188 | 186 | ||
189 | void setDocument( const QString& ); | 187 | void setDocument( const QString& ); |
190 | 188 | ||
191 | 189 | ||
192 | void slotBeam(); | 190 | void slotBeam(); |
193 | void beamDone( Ir* ); | 191 | void beamDone( Ir* ); |
194 | void slotShowDetails(); | 192 | void slotShowDetails(); |
195 | void slotShowNext(); | 193 | void slotShowNext(); |
196 | void slotShowPrev(); | 194 | void slotShowPrev(); |
197 | void slotShowDue( bool ); | 195 | void slotShowDue( bool ); |
198 | void slotReturnFromView(); // for TodoShow... | 196 | void slotReturnFromView(); // for TodoShow... |
199 | /* reimplementation from opimmainwindow */ | 197 | /* reimplementation from opimmainwindow */ |
200 | protected slots: | 198 | protected slots: |
201 | void flush(); | 199 | void flush(); |
202 | void reload(); | 200 | void reload(); |
203 | int create(); | 201 | int create(); |
204 | bool remove( int uid ); | 202 | bool remove( int uid ); |
205 | void beam(int uid); | 203 | void beam(int uid); |
206 | void show( int uid ); | 204 | void show( int uid ); |
207 | void edit( int uid ); | 205 | void edit( int uid ); |
208 | void add( const OPimRecord& ); | 206 | void add( const Opie::OPimRecord& ); |
209 | void doAlarm( const QDateTime& dt, int uid ); | 207 | void doAlarm( const QDateTime& dt, int uid ); |
210 | }; | 208 | }; |
211 | } | 209 | } |
212 | 210 | ||
213 | #endif | 211 | #endif |
diff --git a/core/pim/todo/quickeditimpl.cpp b/core/pim/todo/quickeditimpl.cpp index cd0684f..94ae97e 100644 --- a/core/pim/todo/quickeditimpl.cpp +++ b/core/pim/todo/quickeditimpl.cpp | |||
@@ -1,116 +1,116 @@ | |||
1 | #include <qaction.h> | 1 | #include <qaction.h> |
2 | #include <qlineedit.h> | 2 | #include <qlineedit.h> |
3 | #include <qwhatsthis.h> | 3 | #include <qwhatsthis.h> |
4 | 4 | ||
5 | #include <qpe/resource.h> | 5 | #include <qpe/resource.h> |
6 | 6 | ||
7 | #include <opie2/oclickablelabel.h> | 7 | #include <opie2/oclickablelabel.h> |
8 | 8 | ||
9 | #include "mainwindow.h" | 9 | #include "mainwindow.h" |
10 | #include "quickeditimpl.h" | 10 | #include "quickeditimpl.h" |
11 | 11 | ||
12 | 12 | ||
13 | QuickEditImpl::QuickEditImpl( QWidget* parent, bool visible ) | 13 | QuickEditImpl::QuickEditImpl( QWidget* parent, bool visible ) |
14 | : QToolBar( (QMainWindow *)parent ), Todo::QuickEdit( (Todo::MainWindow *)parent ) { | 14 | : QToolBar( (QMainWindow *)parent ), Todo::QuickEdit( (Todo::MainWindow *)parent ) { |
15 | setHorizontalStretchable( TRUE ); | 15 | setHorizontalStretchable( TRUE ); |
16 | 16 | ||
17 | // Load priority icons | 17 | // Load priority icons |
18 | // TODO - probably should be done globally somewhere else, | 18 | // TODO - probably should be done globally somewhere else, |
19 | // see also tableview.cpp/h, taskeditoroverview.cpp/h | 19 | // see also tableview.cpp/h, taskeditoroverview.cpp/h |
20 | priority1 = Resource::loadPixmap( "todo/priority1" ); | 20 | priority1 = Resource::loadPixmap( "todo/priority1" ); |
21 | priority3 = Resource::loadPixmap( "todo/priority3" ); | 21 | priority3 = Resource::loadPixmap( "todo/priority3" ); |
22 | priority5 = Resource::loadPixmap( "todo/priority5" ); | 22 | priority5 = Resource::loadPixmap( "todo/priority5" ); |
23 | 23 | ||
24 | m_lbl = new OClickableLabel( this ); | 24 | m_lbl = new Opie::OClickableLabel( this ); |
25 | m_lbl->setMinimumWidth( 15 ); | 25 | m_lbl->setMinimumWidth( 15 ); |
26 | m_lbl->setPixmap( priority3 ); | 26 | m_lbl->setPixmap( priority3 ); |
27 | connect(m_lbl, SIGNAL(clicked() ), this, SLOT(slotPrio()) ); | 27 | connect(m_lbl, SIGNAL(clicked() ), this, SLOT(slotPrio()) ); |
28 | QWhatsThis::add( m_lbl, QWidget::tr( "Click here to set the priority of new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); | 28 | QWhatsThis::add( m_lbl, QWidget::tr( "Click here to set the priority of new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); |
29 | 29 | ||
30 | m_edit = new QLineEdit( this ); | 30 | m_edit = new QLineEdit( this ); |
31 | setStretchableWidget( m_edit ); | 31 | setStretchableWidget( m_edit ); |
32 | QWhatsThis::add( m_edit, QWidget::tr( "Enter description of new task here.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); | 32 | QWhatsThis::add( m_edit, QWidget::tr( "Enter description of new task here.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); |
33 | 33 | ||
34 | /* | 34 | /* |
35 | * it's not implemented and won't be implemented for 1.0 | 35 | * it's not implemented and won't be implemented for 1.0 |
36 | */ | 36 | */ |
37 | #if 0 | 37 | #if 0 |
38 | QAction *a = new QAction( QWidget::tr( "More" ), Resource::loadPixmap( "todo/more" ), QString::null, 0, this, 0 ); | 38 | QAction *a = new QAction( QWidget::tr( "More" ), Resource::loadPixmap( "todo/more" ), QString::null, 0, this, 0 ); |
39 | connect( a, SIGNAL( activated() ), this, SLOT( slotMore() ) ); | 39 | connect( a, SIGNAL( activated() ), this, SLOT( slotMore() ) ); |
40 | a->addTo( this ); | 40 | a->addTo( this ); |
41 | a->setWhatsThis( QWidget::tr( "Click here to enter additional information for new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); | 41 | a->setWhatsThis( QWidget::tr( "Click here to enter additional information for new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | QAction *a = new QAction( QWidget::tr( "Enter" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 ); | 44 | QAction *a = new QAction( QWidget::tr( "Enter" ), Resource::loadPixmap( "enter" ), QString::null, 0, this, 0 ); |
45 | connect( a, SIGNAL( activated() ), this, SLOT( slotEnter() ) ); | 45 | connect( a, SIGNAL( activated() ), this, SLOT( slotEnter() ) ); |
46 | a->addTo( this ); | 46 | a->addTo( this ); |
47 | a->setWhatsThis( QWidget::tr( "Click here to add new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); | 47 | a->setWhatsThis( QWidget::tr( "Click here to add new task.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); |
48 | 48 | ||
49 | a = new QAction( QWidget::tr( "Cancel" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); | 49 | a = new QAction( QWidget::tr( "Cancel" ), Resource::loadPixmap( "close" ), QString::null, 0, this, 0 ); |
50 | connect( a, SIGNAL( activated() ), this, SLOT( slotCancel() ) ); | 50 | connect( a, SIGNAL( activated() ), this, SLOT( slotCancel() ) ); |
51 | a->addTo( this ); | 51 | a->addTo( this ); |
52 | a->setWhatsThis( QWidget::tr( "Click here to reset new task information.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); | 52 | a->setWhatsThis( QWidget::tr( "Click here to reset new task information.\n\nThis area is called the quick task bar.\n\nIt allows you to quickly add a new task to your list. This area can be shown or hidden by selecting Options->'Show quick task bar' from the menu above." ) ); |
53 | 53 | ||
54 | m_visible = visible; | 54 | m_visible = visible; |
55 | if ( !m_visible ) { | 55 | if ( !m_visible ) { |
56 | hide(); | 56 | hide(); |
57 | } | 57 | } |
58 | 58 | ||
59 | m_menu = 0l; | 59 | m_menu = 0l; |
60 | reinit(); | 60 | reinit(); |
61 | } | 61 | } |
62 | QuickEditImpl::~QuickEditImpl() { | 62 | QuickEditImpl::~QuickEditImpl() { |
63 | 63 | ||
64 | } | 64 | } |
65 | OPimTodo QuickEditImpl::todo()const { | 65 | OPimTodo QuickEditImpl::todo()const { |
66 | return m_todo; | 66 | return m_todo; |
67 | } | 67 | } |
68 | QWidget* QuickEditImpl::widget() { | 68 | QWidget* QuickEditImpl::widget() { |
69 | return this; | 69 | return this; |
70 | } | 70 | } |
71 | void QuickEditImpl::slotEnter() { | 71 | void QuickEditImpl::slotEnter() { |
72 | OPimTodo todo; | 72 | OPimTodo todo; |
73 | 73 | ||
74 | 74 | ||
75 | if (!m_edit->text().isEmpty() ) { | 75 | if (!m_edit->text().isEmpty() ) { |
76 | todo.setUid(1 ); // new uid | 76 | todo.setUid(1 ); // new uid |
77 | todo.setPriority( m_state ); | 77 | todo.setPriority( m_state ); |
78 | todo.setSummary( m_edit->text() ); | 78 | todo.setSummary( m_edit->text() ); |
79 | if ( ((Todo::MainWindow *)parent())->currentCatId() != 0 ) | 79 | if ( ((Todo::MainWindow *)parent())->currentCatId() != 0 ) |
80 | todo.setCategories( ((Todo::MainWindow *)parent())->currentCatId() ); | 80 | todo.setCategories( ((Todo::MainWindow *)parent())->currentCatId() ); |
81 | 81 | ||
82 | m_todo = todo; | 82 | m_todo = todo; |
83 | commit(); | 83 | commit(); |
84 | } | 84 | } |
85 | m_todo = todo; | 85 | m_todo = todo; |
86 | reinit(); | 86 | reinit(); |
87 | } | 87 | } |
88 | void QuickEditImpl::slotPrio() { | 88 | void QuickEditImpl::slotPrio() { |
89 | m_state -= 2; | 89 | m_state -= 2; |
90 | if ( m_state < 1 ) | 90 | if ( m_state < 1 ) |
91 | m_state = 5; | 91 | m_state = 5; |
92 | 92 | ||
93 | switch( m_state ) { | 93 | switch( m_state ) { |
94 | case 1: | 94 | case 1: |
95 | m_lbl->setPixmap( priority1 ); | 95 | m_lbl->setPixmap( priority1 ); |
96 | break; | 96 | break; |
97 | case 5: | 97 | case 5: |
98 | m_lbl->setPixmap( priority5 ); | 98 | m_lbl->setPixmap( priority5 ); |
99 | break; | 99 | break; |
100 | case 3: | 100 | case 3: |
101 | default: | 101 | default: |
102 | m_lbl->setPixmap( priority3 ); | 102 | m_lbl->setPixmap( priority3 ); |
103 | break; | 103 | break; |
104 | } | 104 | } |
105 | } | 105 | } |
106 | void QuickEditImpl::slotMore() { | 106 | void QuickEditImpl::slotMore() { |
107 | // TODO - implement | 107 | // TODO - implement |
108 | } | 108 | } |
109 | void QuickEditImpl::slotCancel() { | 109 | void QuickEditImpl::slotCancel() { |
110 | reinit(); | 110 | reinit(); |
111 | } | 111 | } |
112 | void QuickEditImpl::reinit() { | 112 | void QuickEditImpl::reinit() { |
113 | m_state = 3; | 113 | m_state = 3; |
114 | m_lbl->setPixmap( priority3 ); | 114 | m_lbl->setPixmap( priority3 ); |
115 | m_edit->clear(); | 115 | m_edit->clear(); |
116 | } | 116 | } |