summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp7
-rw-r--r--core/pim/todo/mainwindow.h4
-rw-r--r--core/pim/todo/tableview.cpp1
3 files changed, 9 insertions, 3 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index ecb4e40..ad7899f 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -24,84 +24,88 @@
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 <qmenubar.h> 31#include <qmenubar.h>
32#include <qmessagebox.h> 32#include <qmessagebox.h>
33#include <qtoolbar.h> 33#include <qtoolbar.h>
34#include <qpopupmenu.h> 34#include <qpopupmenu.h>
35#include <qpushbutton.h> 35#include <qpushbutton.h>
36#include <qwidgetstack.h> 36#include <qwidgetstack.h>
37#include <qaction.h> 37#include <qaction.h>
38#include <qtimer.h> 38#include <qtimer.h>
39#include <qvbox.h> 39#include <qvbox.h>
40#include <qlayout.h> 40#include <qlayout.h>
41#include <qlineedit.h> 41#include <qlineedit.h>
42#include <qwhatsthis.h> 42#include <qwhatsthis.h>
43 43
44#include <qpe/applnk.h> 44#include <qpe/applnk.h>
45#include <qpe/config.h> 45#include <qpe/config.h>
46#include <qpe/ir.h> 46#include <qpe/ir.h>
47#include <qpe/resource.h> 47#include <qpe/resource.h>
48#include <qpe/qpemessagebox.h> 48#include <qpe/qpemessagebox.h>
49#include <qpe/alarmserver.h> 49#include <qpe/alarmserver.h>
50#include <qpe/timestring.h> 50#include <qpe/timestring.h>
51#include <qpe/qpeapplication.h> 51#include <qpe/qpeapplication.h>
52 52
53#include <opie/orecur.h> 53#include <opie/orecur.h>
54#include <opie/opimnotifymanager.h> 54#include <opie/opimnotifymanager.h>
55#include <opie/otodoaccessvcal.h> 55#include <opie/otodoaccessvcal.h>
56#include <opie/owidgetstack.h>
56 57
57#include <opie/oapplicationfactory.h> 58#include <opie/oapplicationfactory.h>
58 59
59#include "quickeditimpl.h" 60#include "quickeditimpl.h"
60#include "todotemplatemanager.h" 61#include "todotemplatemanager.h"
61#include "templateeditor.h" 62#include "templateeditor.h"
62#include "tableview.h" 63#include "tableview.h"
63 64
64#include "textviewshow.h" 65#include "textviewshow.h"
65#include "todoeditor.h" 66#include "todoeditor.h"
66#include "mainwindow.h" 67#include "mainwindow.h"
67 68
68OPIE_EXPORT_APP( OApplicationFactory<Todo::MainWindow> ) 69OPIE_EXPORT_APP( OApplicationFactory<Todo::MainWindow> )
69 70
70using namespace Todo; 71using namespace Todo;
71 72
72MainWindow::MainWindow( QWidget* parent, 73MainWindow::MainWindow( QWidget* parent,
73 const char* name, WFlags ) 74 const char* name, WFlags )
74 : OPimMainWindow( "Todolist", parent, name, WType_TopLevel | WStyle_ContextHelp ) 75 : OPimMainWindow( "Todolist", parent, name, WType_TopLevel | WStyle_ContextHelp )
75{ 76{
77 if (!name)
78 setName("todo window");
79
76 m_syncing = false; 80 m_syncing = false;
77 m_showing = false; 81 m_showing = false;
78 m_counter = 0; 82 m_counter = 0;
79 m_tempManager = new TemplateManager(); 83 m_tempManager = new TemplateManager();
80 m_tempManager->load(); 84 m_tempManager->load();
81 85
82 initUI(); 86 initUI();
83 initConfig(); 87 initConfig();
84 initViews(); 88 initViews();
85 initActions(); 89 initActions();
86 initEditor(); 90 initEditor();
87 initShow(); 91 initShow();
88 initTemplate(); 92 initTemplate();
89 93
90 populateTemplates(); 94 populateTemplates();
91 raiseCurrentView(); 95 raiseCurrentView();
92 QTimer::singleShot(0, this, SLOT(populateCategories() ) ); 96 QTimer::singleShot(0, this, SLOT(populateCategories() ) );
93} 97}
94void MainWindow::initTemplate() { 98void MainWindow::initTemplate() {
95 m_curTempEd = new TemplateEditor( this, templateManager() ); 99 m_curTempEd = new TemplateEditor( this, templateManager() );
96} 100}
97void MainWindow::initActions() { 101void MainWindow::initActions() {
98 102
99 // Data menu 103 // Data menu
100 m_edit->insertItem(QWidget::tr("New from template"), m_template, 104 m_edit->insertItem(QWidget::tr("New from template"), m_template,
101 -1, 0 ); 105 -1, 0 );
102 106
103 QAction* a = new QAction( QWidget::tr("New Task" ), Resource::loadPixmap( "new" ), 107 QAction* a = new QAction( QWidget::tr("New Task" ), Resource::loadPixmap( "new" ),
104 QString::null, 0, this, 0 ); 108 QString::null, 0, this, 0 );
105 connect(a, SIGNAL( activated() ), 109 connect(a, SIGNAL( activated() ),
106 this, SLOT( slotNew() ) ); 110 this, SLOT( slotNew() ) );
107 a->setWhatsThis( QWidget::tr( "Click here to create a new task." ) ); 111 a->setWhatsThis( QWidget::tr( "Click here to create a new task." ) );
@@ -195,65 +199,65 @@ void MainWindow::initActions() {
195 m_showDeadLineAction->setOn( showDeadline() ); 199 m_showDeadLineAction->setOn( showDeadline() );
196 connect(m_showDeadLineAction, SIGNAL(toggled(bool) ), this, SLOT( slotShowDeadLine( bool ) ) ); 200 connect(m_showDeadLineAction, SIGNAL(toggled(bool) ), this, SLOT( slotShowDeadLine( bool ) ) );
197 201
198 m_showQuickTaskAction = new QAction( QString::null, QWidget::tr("Show quick task bar"), 202 m_showQuickTaskAction = new QAction( QString::null, QWidget::tr("Show quick task bar"),
199 0, this, 0, TRUE ); 203 0, this, 0, TRUE );
200 m_showQuickTaskAction->addTo( m_options ); 204 m_showQuickTaskAction->addTo( m_options );
201 m_showQuickTaskAction->setOn( showQuickTask() ); 205 m_showQuickTaskAction->setOn( showQuickTask() );
202 connect(m_showQuickTaskAction, SIGNAL( toggled(bool) ), this, SLOT(slotShowQuickTask(bool) ) ); 206 connect(m_showQuickTaskAction, SIGNAL( toggled(bool) ), this, SLOT(slotShowQuickTask(bool) ) );
203 207
204 m_options->insertSeparator(); 208 m_options->insertSeparator();
205 209
206 m_bar->insertItem( QWidget::tr("Data") ,m_edit ); 210 m_bar->insertItem( QWidget::tr("Data") ,m_edit );
207 m_bar->insertItem( QWidget::tr("Category"), m_catMenu ); 211 m_bar->insertItem( QWidget::tr("Category"), m_catMenu );
208 m_bar->insertItem( QWidget::tr("Options"), m_options ); 212 m_bar->insertItem( QWidget::tr("Options"), m_options );
209 213
210 m_curQuick = new QuickEditImpl( this, m_quicktask ); 214 m_curQuick = new QuickEditImpl( this, m_quicktask );
211 addToolBar( (QPEToolBar *)m_curQuick->widget(), QWidget::tr( "QuickEdit" ), QMainWindow::Top, TRUE ); 215 addToolBar( (QPEToolBar *)m_curQuick->widget(), QWidget::tr( "QuickEdit" ), QMainWindow::Top, TRUE );
212 m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) ); 216 m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) );
213 217
214} 218}
215/* m_curCat from Config */ 219/* m_curCat from Config */
216void MainWindow::initConfig() { 220void MainWindow::initConfig() {
217 Config config( "todo" ); 221 Config config( "todo" );
218 config.setGroup( "View" ); 222 config.setGroup( "View" );
219 m_completed = config.readBoolEntry( "ShowComplete", TRUE ); 223 m_completed = config.readBoolEntry( "ShowComplete", TRUE );
220 m_curCat = config.readEntry( "Category", QString::null ); 224 m_curCat = config.readEntry( "Category", QString::null );
221 m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE); 225 m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE);
222 m_overdue = config.readBoolEntry("ShowOverDue", FALSE ); 226 m_overdue = config.readBoolEntry("ShowOverDue", FALSE );
223 m_quicktask = config.readBoolEntry("ShowQuickTask", TRUE); 227 m_quicktask = config.readBoolEntry("ShowQuickTask", TRUE);
224} 228}
225void MainWindow::initUI() { 229void MainWindow::initUI() {
226 230
227 m_stack = new QWidgetStack(this, "main stack"); 231 m_stack = new OWidgetStack(this, "main stack");
228 232
229 setCentralWidget( m_stack ); 233 setCentralWidget( m_stack );
230 234
231 setToolBarsMovable( FALSE ); 235 setToolBarsMovable( FALSE );
232 236
233 QToolBar *menubarholder = new QToolBar( this ); 237 QToolBar *menubarholder = new QToolBar( this );
234 menubarholder->setHorizontalStretchable( TRUE ); 238 menubarholder->setHorizontalStretchable( TRUE );
235 m_bar = new QMenuBar( menubarholder ); 239 m_bar = new QMenuBar( menubarholder );
236 240
237 m_tool = new QToolBar( this ); 241 m_tool = new QToolBar( this );
238 242
239 /** QPopupMenu */ 243 /** QPopupMenu */
240 m_edit = new QPopupMenu( this ); 244 m_edit = new QPopupMenu( this );
241 m_options = new QPopupMenu( this ); 245 m_options = new QPopupMenu( this );
242 m_catMenu = new QPopupMenu( this ); 246 m_catMenu = new QPopupMenu( this );
243 m_template = new QPopupMenu( this ); 247 m_template = new QPopupMenu( this );
244 248
245 m_catMenu->setCheckable( TRUE ); 249 m_catMenu->setCheckable( TRUE );
246 m_template->setCheckable( TRUE ); 250 m_template->setCheckable( TRUE );
247 251
248 connect(m_catMenu, SIGNAL(activated(int) ), 252 connect(m_catMenu, SIGNAL(activated(int) ),
249 this, SLOT(setCategory(int) ) ); 253 this, SLOT(setCategory(int) ) );
250 connect(m_template, SIGNAL(activated(int) ), 254 connect(m_template, SIGNAL(activated(int) ),
251 this, SLOT(slotNewFromTemplate(int) ) ); 255 this, SLOT(slotNewFromTemplate(int) ) );
252} 256}
253void MainWindow::initViews() { 257void MainWindow::initViews() {
254 258
255 TableView* tableView = new TableView( this, m_stack ); 259 TableView* tableView = new TableView( this, m_stack );
256 QWhatsThis::add( tableView, QWidget::tr( "This is a listing of all current tasks.\n\nThe list displays the following information:\n1. Completed - A green checkmark indicates task is completed. Click here to complete a task.\n2. Priority - a graphical representation of task priority. Double-click here to modify.\n3. Description - description of task. Click here to select the task.\n4. Deadline - shows when task is due. This column can be shown or hidden by selecting Options->'Show task deadlines' from the menu above." ) ); 260 QWhatsThis::add( tableView, QWidget::tr( "This is a listing of all current tasks.\n\nThe list displays the following information:\n1. Completed - A green checkmark indicates task is completed. Click here to complete a task.\n2. Priority - a graphical representation of task priority. Double-click here to modify.\n3. Description - description of task. Click here to select the task.\n4. Deadline - shows when task is due. This column can be shown or hidden by selecting Options->'Show task deadlines' from the menu above." ) );
257 m_stack->addWidget( tableView, m_counter++ ); 261 m_stack->addWidget( tableView, m_counter++ );
258 m_views.append( tableView ); 262 m_views.append( tableView );
259 m_curView = tableView; 263 m_curView = tableView;
@@ -376,64 +380,65 @@ void MainWindow::closeEvent( QCloseEvent* e ) {
376 bool quit = false; 380 bool quit = false;
377 if ( m_todoMgr.saveAll() ){ 381 if ( m_todoMgr.saveAll() ){
378 qWarning("saved"); 382 qWarning("saved");
379 quit = true; 383 quit = true;
380 }else { 384 }else {
381 if ( QMessageBox::critical( this, QWidget::tr("Out of space"), 385 if ( QMessageBox::critical( this, QWidget::tr("Out of space"),
382 QWidget::tr("Todo was unable\n" 386 QWidget::tr("Todo was unable\n"
383 "to save your changes.\n" 387 "to save your changes.\n"
384 "Free up some space\n" 388 "Free up some space\n"
385 "and try again.\n" 389 "and try again.\n"
386 "\nQuit Anyway?"), 390 "\nQuit Anyway?"),
387 QMessageBox::Yes|QMessageBox::Escape, 391 QMessageBox::Yes|QMessageBox::Escape,
388 QMessageBox::No|QMessageBox::Default) 392 QMessageBox::No|QMessageBox::Default)
389 != QMessageBox::No ) { 393 != QMessageBox::No ) {
390 e->accept(); 394 e->accept();
391 quit = true; 395 quit = true;
392 }else 396 }else
393 e->ignore(); 397 e->ignore();
394 398
395 } 399 }
396 400
397 if (quit ) { 401 if (quit ) {
398 Config config( "todo" ); 402 Config config( "todo" );
399 config.setGroup( "View" ); 403 config.setGroup( "View" );
400 config.writeEntry( "ShowComplete", showCompleted() ); 404 config.writeEntry( "ShowComplete", showCompleted() );
401 config.writeEntry( "Category", currentCategory() ); 405 config.writeEntry( "Category", currentCategory() );
402 config.writeEntry( "ShowDeadLine", showDeadline()); 406 config.writeEntry( "ShowDeadLine", showDeadline());
403 config.writeEntry( "ShowOverDue", showOverDue() ); 407 config.writeEntry( "ShowOverDue", showOverDue() );
404 config.writeEntry( "ShowQuickTask", showQuickTask() ); 408 config.writeEntry( "ShowQuickTask", showQuickTask() );
405 /* save templates */ 409 /* save templates */
406 templateManager()->save(); 410 templateManager()->save();
407 e->accept(); 411 e->accept();
412 qApp->quit();
408 } 413 }
409} 414}
410void MainWindow::populateTemplates() { 415void MainWindow::populateTemplates() {
411 m_template->clear(); 416 m_template->clear();
412 QStringList list = templateManager()->templates(); 417 QStringList list = templateManager()->templates();
413 QStringList::Iterator it; 418 QStringList::Iterator it;
414 for ( it = list.begin(); it != list.end(); ++it ) { 419 for ( it = list.begin(); it != list.end(); ++it ) {
415 m_template->insertItem( (*it) ); 420 m_template->insertItem( (*it) );
416 } 421 }
417} 422}
418/* 423/*
419 * slotNewFromTemplate 424 * slotNewFromTemplate
420 * We use the edit widget to do 425 * We use the edit widget to do
421 * the config but we setUid(1) 426 * the config but we setUid(1)
422 * to get a new uid 427 * to get a new uid
423 */ 428 */
424/* 429/*
425 * first we get the name of the template 430 * first we get the name of the template
426 * then we will use the TemplateManager 431 * then we will use the TemplateManager
427 */ 432 */
428void MainWindow::slotNewFromTemplate( int id ) { 433void MainWindow::slotNewFromTemplate( int id ) {
429 QString name = m_template->text( id ); 434 QString name = m_template->text( id );
430 435
431 OTodo event = templateManager()->templateEvent( name ); 436 OTodo event = templateManager()->templateEvent( name );
432 event = currentEditor()->edit(this, 437 event = currentEditor()->edit(this,
433 event ); 438 event );
434 439
435 if ( currentEditor()->accepted() ) { 440 if ( currentEditor()->accepted() ) {
436 /* assign new todo */ 441 /* assign new todo */
437 event.setUid( 1 ); 442 event.setUid( 1 );
438 handleAlarms( OTodo(), event ); 443 handleAlarms( OTodo(), event );
439 m_todoMgr.add( event ); 444 m_todoMgr.add( event );
diff --git a/core/pim/todo/mainwindow.h b/core/pim/todo/mainwindow.h
index bd341c2..fd0e1bd 100644
--- a/core/pim/todo/mainwindow.h
+++ b/core/pim/todo/mainwindow.h
@@ -15,65 +15,65 @@
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 <opie/otodoaccess.h> 34#include <opie/otodoaccess.h>
35#include <opie/otodo.h> 35#include <opie/otodo.h>
36#include <opie/opimmainwindow.h> 36#include <opie/opimmainwindow.h>
37 37
38#include "smalltodo.h" 38#include "smalltodo.h"
39#include "todoview.h" 39#include "todoview.h"
40#include "quickedit.h" 40#include "quickedit.h"
41#include "todomanager.h" 41#include "todomanager.h"
42 42
43class QPopupMenu; 43class QPopupMenu;
44class QMenuBar; 44class QMenuBar;
45class QToolBar; 45class QToolBar;
46class QAction; 46class QAction;
47class QWidgetStack; 47class OWidgetStack;
48class Ir; 48class Ir;
49class QVBox; 49class QVBox;
50class QLineEdit; 50class QLineEdit;
51 51
52namespace Todo { 52namespace Todo {
53 typedef TodoView View; 53 typedef TodoView View;
54 class TemplateManager; 54 class TemplateManager;
55 class Editor; 55 class Editor;
56 class TodoShow; 56 class TodoShow;
57 class TemplateEditor; 57 class TemplateEditor;
58 struct QuickEditBase; 58 struct QuickEditBase;
59 59
60 class MainWindow : public OPimMainWindow { 60 class MainWindow : public OPimMainWindow {
61 Q_OBJECT 61 Q_OBJECT
62 friend class TodoView; // avoid QObject here.... 62 friend class TodoView; // avoid QObject here....
63 friend class TodoShow; // avoid QObject 63 friend class TodoShow; // avoid QObject
64 public: 64 public:
65 /* OApplicationFactory application Name */ 65 /* OApplicationFactory application Name */
66 static QString appName() { return QString::fromLatin1("todolist"); } 66 static QString appName() { return QString::fromLatin1("todolist"); }
67 67
68 MainWindow( QWidget *parent = 0, 68 MainWindow( QWidget *parent = 0,
69 const char* name = 0, WFlags fl = 0 ); 69 const char* name = 0, WFlags fl = 0 );
70 ~MainWindow(); 70 ~MainWindow();
71 71
72 /** return a context menu for an OTodo */ 72 /** return a context menu for an OTodo */
73 QPopupMenu* contextMenu(int uid, bool doesRecur = FALSE ); 73 QPopupMenu* contextMenu(int uid, bool doesRecur = FALSE );
74 QPopupMenu* options(); 74 QPopupMenu* options();
75 QPopupMenu* edit(); 75 QPopupMenu* edit();
76 QToolBar* toolbar(); 76 QToolBar* toolbar();
77 77
78 78
79 void updateList(); 79 void updateList();
@@ -113,65 +113,65 @@ private slots:
113 void connectBase( ViewBase* ); 113 void connectBase( ViewBase* );
114 void initUI(); 114 void initUI();
115 void initActions(); 115 void initActions();
116 void initConfig(); 116 void initConfig();
117 void initViews(); 117 void initViews();
118 void initEditor(); 118 void initEditor();
119 void initShow(); 119 void initShow();
120 void initTemplate(); 120 void initTemplate();
121 void raiseCurrentView(); 121 void raiseCurrentView();
122 ViewBase* currentView(); 122 ViewBase* currentView();
123 ViewBase* m_curView; 123 ViewBase* m_curView;
124 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
125 QuickEditBase* m_curQuick; 125 QuickEditBase* m_curQuick;
126 Editor* m_curEdit; 126 Editor* m_curEdit;
127 TodoShow* currentShow(); 127 TodoShow* currentShow();
128 TodoShow* m_curShow; 128 TodoShow* m_curShow;
129 TemplateEditor* currentTemplateEditor(); 129 TemplateEditor* currentTemplateEditor();
130 TemplateEditor* m_curTempEd; 130 TemplateEditor* m_curTempEd;
131 131
132 QMenuBar* m_bar; 132 QMenuBar* m_bar;
133 QToolBar* m_tool; 133 QToolBar* m_tool;
134 QAction* m_editAction, 134 QAction* m_editAction,
135 *m_deleteAction, 135 *m_deleteAction,
136 *m_findAction, 136 *m_findAction,
137 *m_completedAction, 137 *m_completedAction,
138 *m_showDeadLineAction, 138 *m_showDeadLineAction,
139 *m_deleteAllAction, 139 *m_deleteAllAction,
140 *m_deleteCompleteAction, 140 *m_deleteCompleteAction,
141 *m_duplicateAction, 141 *m_duplicateAction,
142 *m_showOverDueAction, 142 *m_showOverDueAction,
143 *m_showQuickTaskAction, 143 *m_showQuickTaskAction,
144 *m_effectiveAction; 144 *m_effectiveAction;
145 QWidgetStack *m_stack; 145 OWidgetStack *m_stack;
146 QPopupMenu* m_catMenu, 146 QPopupMenu* m_catMenu,
147 *m_edit, 147 *m_edit,
148 *m_options, 148 *m_options,
149 *m_template; 149 *m_template;
150 150
151 bool m_syncing:1; 151 bool m_syncing:1;
152 bool m_deadline:1; 152 bool m_deadline:1;
153 bool m_completed:1; 153 bool m_completed:1;
154 bool m_overdue:1; 154 bool m_overdue:1;
155 bool m_quicktask:1; 155 bool m_quicktask:1;
156 TodoManager m_todoMgr; 156 TodoManager m_todoMgr;
157 QString m_curCat; 157 QString m_curCat;
158 QList<ViewBase> m_views; 158 QList<ViewBase> m_views;
159 uint m_counter; 159 uint m_counter;
160 TemplateManager* m_tempManager; 160 TemplateManager* m_tempManager;
161 161
162 162
163 private slots: 163 private slots:
164 void slotShow(int); 164 void slotShow(int);
165 void slotEdit(int); 165 void slotEdit(int);
166 void slotUpdate3( QWidget* ); 166 void slotUpdate3( QWidget* );
167 void slotComplete( int uid ); 167 void slotComplete( int uid );
168 void slotComplete( const OTodo& ev ); 168 void slotComplete( const OTodo& ev );
169 void slotNewFromTemplate(int id ); 169 void slotNewFromTemplate(int id );
170 void slotNew(); 170 void slotNew();
171 void slotDuplicate(); 171 void slotDuplicate();
172 172
173 void slotDelete(); 173 void slotDelete();
174 void slotDelete(int uid ); 174 void slotDelete(int uid );
175 void slotDeleteAll(); 175 void slotDeleteAll();
176 void slotDeleteCompleted(); 176 void slotDeleteCompleted();
177 177
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp
index 2e252d5..def0efb 100644
--- a/core/pim/todo/tableview.cpp
+++ b/core/pim/todo/tableview.cpp
@@ -56,64 +56,65 @@ void TableView::EditorWidget::setCellWidget(QWidget* wid, int row, int col ) {
56 m_wid = wid; 56 m_wid = wid;
57 m_row = row; 57 m_row = row;
58 m_col = col; 58 m_col = col;
59} 59}
60void TableView::EditorWidget::releaseCellWidget() { 60void TableView::EditorWidget::releaseCellWidget() {
61 m_wid = 0; 61 m_wid = 0;
62 m_row = m_col = -1; 62 m_row = m_col = -1;
63} 63}
64QWidget* TableView::EditorWidget::cellWidget()const { 64QWidget* TableView::EditorWidget::cellWidget()const {
65 return m_wid; 65 return m_wid;
66} 66}
67int TableView::EditorWidget::cellRow()const { 67int TableView::EditorWidget::cellRow()const {
68 return m_row; 68 return m_row;
69} 69}
70int TableView::EditorWidget::cellCol()const { 70int TableView::EditorWidget::cellCol()const {
71 return m_col; 71 return m_col;
72} 72}
73 73
74 74
75void TableView::initConfig() { 75void TableView::initConfig() {
76 Config config( "todo" ); 76 Config config( "todo" );
77 config.setGroup( "Options" ); 77 config.setGroup( "Options" );
78 m_completeStrokeWidth = config.readNumEntry( "CompleteStrokeWidth", 8 ); 78 m_completeStrokeWidth = config.readNumEntry( "CompleteStrokeWidth", 8 );
79 for (int i = 0; i < numCols(); i++ ) { 79 for (int i = 0; i < numCols(); i++ ) {
80 int width = config.readNumEntry("Width"+QString::number(i), -1 ); 80 int width = config.readNumEntry("Width"+QString::number(i), -1 );
81 setColumnWidth(i, width == -1 ? columnWidth(i) : width ); 81 setColumnWidth(i, width == -1 ? columnWidth(i) : width );
82 } 82 }
83} 83}
84 84
85TableView::TableView( MainWindow* window, QWidget* wid ) 85TableView::TableView( MainWindow* window, QWidget* wid )
86 : QTable( wid ), TodoView( window ) { 86 : QTable( wid ), TodoView( window ) {
87 87
88 setName("TableView");
88 // Load icons 89 // Load icons
89 // TODO - probably should be done globally somewhere else, 90 // TODO - probably should be done globally somewhere else,
90 // see also quickeditimpl.cpp/h, taskeditoroverview.cpp/h 91 // see also quickeditimpl.cpp/h, taskeditoroverview.cpp/h
91 m_pic_completed = Resource::loadPixmap( "todo/completed" ); 92 m_pic_completed = Resource::loadPixmap( "todo/completed" );
92 QString namestr; 93 QString namestr;
93 for ( unsigned int i = 1; i < 6; i++ ) { 94 for ( unsigned int i = 1; i < 6; i++ ) {
94 namestr = "todo/priority"; 95 namestr = "todo/priority";
95 namestr.append( QString::number( i ) ); 96 namestr.append( QString::number( i ) );
96 m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr ); 97 m_pic_priority[ i - 1 ] = Resource::loadPixmap( namestr );
97 } 98 }
98 99
99 setUpdatesEnabled( false ); 100 setUpdatesEnabled( false );
100 viewport()->setUpdatesEnabled( false ); 101 viewport()->setUpdatesEnabled( false );
101 m_enablePaint = false; 102 m_enablePaint = false;
102 setNumRows(0); 103 setNumRows(0);
103 setNumCols(4); 104 setNumCols(4);
104 105
105 horizontalHeader()->setLabel( 0, QWidget::tr("C.") ); 106 horizontalHeader()->setLabel( 0, QWidget::tr("C.") );
106 horizontalHeader()->setLabel( 1, QWidget::tr("Priority") ); 107 horizontalHeader()->setLabel( 1, QWidget::tr("Priority") );
107 horizontalHeader()->setLabel( 2, QWidget::tr("Description" ) ); 108 horizontalHeader()->setLabel( 2, QWidget::tr("Description" ) );
108 horizontalHeader()->setLabel( 3, QWidget::tr("Deadline") ); 109 horizontalHeader()->setLabel( 3, QWidget::tr("Deadline") );
109 110
110 setShowDeadline( todoWindow()->showDeadline() ); 111 setShowDeadline( todoWindow()->showDeadline() );
111 112
112 setSorting( TRUE ); 113 setSorting( TRUE );
113 setSelectionMode( NoSelection ); 114 setSelectionMode( NoSelection );
114 115
115 setLeftMargin( 0 ); 116 setLeftMargin( 0 );
116 verticalHeader()->hide(); 117 verticalHeader()->hide();
117 118
118 connect((QTable*)this, SIGNAL( clicked( int, int, int, const QPoint& ) ), 119 connect((QTable*)this, SIGNAL( clicked( int, int, int, const QPoint& ) ),
119 this, SLOT( slotClicked(int, int, int, const QPoint& ) ) ); 120 this, SLOT( slotClicked(int, int, int, const QPoint& ) ) );