summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp10
-rw-r--r--core/pim/todo/mainwindow.h1
-rw-r--r--core/pim/todo/tableview.cpp4
-rw-r--r--core/pim/todo/todoeditor.cpp2
4 files changed, 5 insertions, 12 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index b2b3b8f..0ab6230 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -40,49 +40,49 @@
40 40
41#include <qpe/applnk.h> 41#include <qpe/applnk.h>
42#include <qpe/config.h> 42#include <qpe/config.h>
43#include <qpe/ir.h> 43#include <qpe/ir.h>
44#include <qpe/resource.h> 44#include <qpe/resource.h>
45#include <qpe/qpemessagebox.h> 45#include <qpe/qpemessagebox.h>
46 46
47#include <opie/orecur.h> 47#include <opie/orecur.h>
48#include <opie/otodoaccessvcal.h> 48#include <opie/otodoaccessvcal.h>
49 49
50#include "quickeditimpl.h" 50#include "quickeditimpl.h"
51#include "todotemplatemanager.h" 51#include "todotemplatemanager.h"
52#include "templateeditor.h" 52#include "templateeditor.h"
53#include "tableview.h" 53#include "tableview.h"
54 54
55#include "textviewshow.h" 55#include "textviewshow.h"
56#include "todoeditor.h" 56#include "todoeditor.h"
57#include "mainwindow.h" 57#include "mainwindow.h"
58 58
59 59
60using namespace Todo; 60using namespace Todo;
61 61
62MainWindow::MainWindow( QWidget* parent, 62MainWindow::MainWindow( QWidget* parent,
63 const char* name ) 63 const char* name )
64 : OPimMainWindow("Todolist") 64 : OPimMainWindow("Todolist", parent, name)
65{ 65{
66 66
67 m_syncing = false; 67 m_syncing = false;
68 m_counter = 0; 68 m_counter = 0;
69 m_tempManager = new TemplateManager(); 69 m_tempManager = new TemplateManager();
70 m_tempManager->load(); 70 m_tempManager->load();
71 71
72 initUI(); 72 initUI();
73 initConfig(); 73 initConfig();
74 initViews(); 74 initViews();
75 initActions(); 75 initActions();
76 initEditor(); 76 initEditor();
77 initShow(); 77 initShow();
78 initTemplate(); 78 initTemplate();
79 79
80 populateTemplates(); 80 populateTemplates();
81 raiseCurrentView(); 81 raiseCurrentView();
82 QTimer::singleShot(0, this, SLOT(populateCategories() ) ); 82 QTimer::singleShot(0, this, SLOT(populateCategories() ) );
83} 83}
84void MainWindow::initTemplate() { 84void MainWindow::initTemplate() {
85 m_curTempEd = new TemplateEditor( this, templateManager() ); 85 m_curTempEd = new TemplateEditor( this, templateManager() );
86} 86}
87void MainWindow::initActions() { 87void MainWindow::initActions() {
88 QAction* a = new QAction( tr("New Task" ), Resource::loadPixmap( "new" ), 88 QAction* a = new QAction( tr("New Task" ), Resource::loadPixmap( "new" ),
@@ -231,49 +231,49 @@ void MainWindow::initUI() {
231 connect(m_template, SIGNAL(activated(int) ), 231 connect(m_template, SIGNAL(activated(int) ),
232 this, SLOT(slotNewFromTemplate(int) ) ); 232 this, SLOT(slotNewFromTemplate(int) ) );
233} 233}
234void MainWindow::initViews() { 234void MainWindow::initViews() {
235 TableView* tableView = new TableView( this, m_stack ); 235 TableView* tableView = new TableView( this, m_stack );
236 m_stack->addWidget( tableView, m_counter++ ); 236 m_stack->addWidget( tableView, m_counter++ );
237 m_views.append( tableView ); 237 m_views.append( tableView );
238 m_curView = tableView; 238 m_curView = tableView;
239 connectBase( tableView ); 239 connectBase( tableView );
240 /* add QString type + QString configname to 240 /* add QString type + QString configname to
241 * the View menu 241 * the View menu
242 * and subdirs for multiple views 242 * and subdirs for multiple views
243 */ 243 */
244} 244}
245void MainWindow::initEditor() { 245void MainWindow::initEditor() {
246 m_curEdit = new Editor(); 246 m_curEdit = new Editor();
247} 247}
248void MainWindow::initShow() { 248void MainWindow::initShow() {
249 m_curShow = new TextViewShow(this); 249 m_curShow = new TextViewShow(this);
250 m_stack->addWidget( m_curShow->widget() , m_counter++ ); 250 m_stack->addWidget( m_curShow->widget() , m_counter++ );
251} 251}
252MainWindow::~MainWindow() { 252MainWindow::~MainWindow() {
253 delete templateManager(); 253 delete templateManager();
254} 254}
255void MainWindow::connectBase( ViewBase* base) { 255void MainWindow::connectBase( ViewBase* ) {
256 // once templates and signals mix we'll use it again 256 // once templates and signals mix we'll use it again
257} 257}
258QPopupMenu* MainWindow::contextMenu( int , bool recur ) { 258QPopupMenu* MainWindow::contextMenu( int , bool recur ) {
259 QPopupMenu* menu = new QPopupMenu(); 259 QPopupMenu* menu = new QPopupMenu();
260 260
261 m_editAction->addTo( menu ); 261 m_editAction->addTo( menu );
262 m_deleteAction->addTo( menu ); 262 m_deleteAction->addTo( menu );
263 m_duplicateAction->addTo( menu ); 263 m_duplicateAction->addTo( menu );
264 264
265 menu->insertSeparator(); 265 menu->insertSeparator();
266 266
267 /* 267 /*
268 * if this event recurs we allow 268 * if this event recurs we allow
269 * to detach it. 269 * to detach it.
270 * remove all 270 * remove all
271 */ 271 */
272 if ( recur ) { 272 if ( recur ) {
273 ; // FIXME 273 ; // FIXME
274 } 274 }
275 275
276 return menu; 276 return menu;
277} 277}
278QPopupMenu* MainWindow::options() { 278QPopupMenu* MainWindow::options() {
279 qWarning("Options"); 279 qWarning("Options");
@@ -776,30 +776,24 @@ void MainWindow::beam( int uid, int ) {
776 connect(ir, SIGNAL(done(Ir*) ), 776 connect(ir, SIGNAL(done(Ir*) ),
777 this, SLOT(beamDone(Ir*) ) ); 777 this, SLOT(beamDone(Ir*) ) );
778 ir->send( beamfile, todo.summary(), "text/x-vCalendar" ); 778 ir->send( beamfile, todo.summary(), "text/x-vCalendar" );
779} 779}
780void MainWindow::show( int uid ) { 780void MainWindow::show( int uid ) {
781 slotShow( uid ); 781 slotShow( uid );
782} 782}
783void MainWindow::edit( int uid ) { 783void MainWindow::edit( int uid ) {
784 slotEdit( uid ); 784 slotEdit( uid );
785} 785}
786void MainWindow::add( const OPimRecord& rec) { 786void MainWindow::add( const OPimRecord& rec) {
787 if ( rec.rtti() != OTodo::rtti() ) return; 787 if ( rec.rtti() != OTodo::rtti() ) return;
788 788
789 const OTodo& todo = static_cast<const OTodo&>(rec); 789 const OTodo& todo = static_cast<const OTodo&>(rec);
790 790
791 m_todoMgr.add(todo ); 791 m_todoMgr.add(todo );
792 currentView()->addEvent( todo ); 792 currentView()->addEvent( todo );
793 793
794 794
795 // I'm afraid we must call this every time now, otherwise 795 // I'm afraid we must call this every time now, otherwise
796 // spend expensive time comparing all these strings... 796 // spend expensive time comparing all these strings...
797 // but only call if we changed something -zecke 797 // but only call if we changed something -zecke
798 populateCategories(); 798 populateCategories();
799} 799}
800/* todo does not have the QDataStream<< and >> operators implemented :(
801 * FIXME
802 */
803OPimRecord* MainWindow::record( int rtti, const QByteArray& ) {
804 return 0l;
805}
diff --git a/core/pim/todo/mainwindow.h b/core/pim/todo/mainwindow.h
index 14cfa82..87a9133 100644
--- a/core/pim/todo/mainwindow.h
+++ b/core/pim/todo/mainwindow.h
@@ -175,29 +175,28 @@ private slots:
175 void slotFind(); 175 void slotFind();
176 176
177 void setCategory( int ); 177 void setCategory( int );
178 178
179 void slotShowDeadLine( bool ); 179 void slotShowDeadLine( bool );
180 void slotShowCompleted( bool ); 180 void slotShowCompleted( bool );
181 181
182 void setDocument( const QString& ); 182 void setDocument( const QString& );
183 183
184 184
185 void slotBeam(); 185 void slotBeam();
186 void beamDone( Ir* ); 186 void beamDone( Ir* );
187 void slotShowDetails(); 187 void slotShowDetails();
188 void slotShowDue( bool ); 188 void slotShowDue( bool );
189 /* reimplementation from opimmainwindow */ 189 /* reimplementation from opimmainwindow */
190 protected slots: 190 protected slots:
191 void flush(); 191 void flush();
192 void reload(); 192 void reload();
193 int create(); 193 int create();
194 bool remove( int uid ); 194 bool remove( int uid );
195 void beam(int uid, int transport = IrDa ); 195 void beam(int uid, int transport = IrDa );
196 void show( int uid ); 196 void show( int uid );
197 void edit( int uid ); 197 void edit( int uid );
198 void add( const OPimRecord& ); 198 void add( const OPimRecord& );
199 OPimRecord* record( int rtti, const QByteArray& );
200 }; 199 };
201}; 200};
202 201
203#endif 202#endif
diff --git a/core/pim/todo/tableview.cpp b/core/pim/todo/tableview.cpp
index 0f683c9..2434150 100644
--- a/core/pim/todo/tableview.cpp
+++ b/core/pim/todo/tableview.cpp
@@ -149,55 +149,55 @@ void TableView::updateView( ) {
149 m_row = false; 149 m_row = false;
150 static int id; 150 static int id;
151 id = startTimer(4000 ); 151 id = startTimer(4000 );
152 /* FIXME we want one page to be read! 152 /* FIXME we want one page to be read!
153 * 153 *
154 * Calculate that screensize 154 * Calculate that screensize
155 */ 155 */
156 todoWindow()->setReadAhead( 4 ); 156 todoWindow()->setReadAhead( 4 );
157 sort(); 157 sort();
158 OTodoAccess::List::Iterator it, end; 158 OTodoAccess::List::Iterator it, end;
159 it = sorted().begin(); 159 it = sorted().begin();
160 end = sorted().end(); 160 end = sorted().end();
161 161
162 qWarning("setTodos"); 162 qWarning("setTodos");
163 QTime time; 163 QTime time;
164 time.start(); 164 time.start();
165 m_enablePaint = false; 165 m_enablePaint = false;
166 setUpdatesEnabled( false ); 166 setUpdatesEnabled( false );
167 viewport()->setUpdatesEnabled( false ); 167 viewport()->setUpdatesEnabled( false );
168 168
169 setNumRows( it.count() ); 169 setNumRows( it.count() );
170 if ( it.count() == 0 ) 170 if ( it.count() == 0 )
171 killTimer(id); 171 killTimer(id);
172 172
173 int elc = time.elapsed(); 173// int elc = time.elapsed();
174 setUpdatesEnabled( true ); 174 setUpdatesEnabled( true );
175 viewport()->setUpdatesEnabled( true ); 175 viewport()->setUpdatesEnabled( true );
176 viewport()->update(); 176 viewport()->update();
177 177
178 m_enablePaint = true; 178 m_enablePaint = true;
179 int el = time.elapsed(); 179// int el = time.elapsed();
180} 180}
181void TableView::setTodo( int, const OTodo&) { 181void TableView::setTodo( int, const OTodo&) {
182 sort(); 182 sort();
183 183
184 /* repaint */ 184 /* repaint */
185 repaint(); 185 repaint();
186} 186}
187void TableView::addEvent( const OTodo&) { 187void TableView::addEvent( const OTodo&) {
188 188
189 /* fix problems of not showing the 'Haken' */ 189 /* fix problems of not showing the 'Haken' */
190 updateView(); 190 updateView();
191} 191}
192/* 192/*
193 * find the event 193 * find the event
194 * and then replace the complete row 194 * and then replace the complete row
195 */ 195 */
196void TableView::replaceEvent( const OTodo& ev) { 196void TableView::replaceEvent( const OTodo& ev) {
197 addEvent( ev ); 197 addEvent( ev );
198} 198}
199/* 199/*
200 * re aligning table can be slow too 200 * re aligning table can be slow too
201 * FIXME: look what performs better 201 * FIXME: look what performs better
202 * either this or the old align table 202 * either this or the old align table
203 */ 203 */
diff --git a/core/pim/todo/todoeditor.cpp b/core/pim/todo/todoeditor.cpp
index 9b8c5cb..5aa7097 100644
--- a/core/pim/todo/todoeditor.cpp
+++ b/core/pim/todo/todoeditor.cpp
@@ -16,49 +16,49 @@ OTodo Editor::newTodo( int cur,
16 QWidget*) { 16 QWidget*) {
17 17
18 OTaskEditor *e = self(); 18 OTaskEditor *e = self();
19 e->setCaption( QObject::tr("Enter Task") ); 19 e->setCaption( QObject::tr("Enter Task") );
20 e->init( cur ); 20 e->init( cur );
21 21
22 22
23#if defined(Q_WS_QWS) || defined(_WS_QWS_) 23#if defined(Q_WS_QWS) || defined(_WS_QWS_)
24 e->showMaximized(); 24 e->showMaximized();
25#endif 25#endif
26 26
27 int ret = e->exec(); 27 int ret = e->exec();
28 if ( QDialog::Accepted == ret ) { 28 if ( QDialog::Accepted == ret ) {
29 m_accepted = true; 29 m_accepted = true;
30 }else 30 }else
31 m_accepted = false; 31 m_accepted = false;
32 32
33 OTodo ev = e->todo(); 33 OTodo ev = e->todo();
34 qWarning("Todo uid"); 34 qWarning("Todo uid");
35 qWarning("Todo %s %d %d", ev.summary().latin1(), ev.progress(), ev.isCompleted() ); 35 qWarning("Todo %s %d %d", ev.summary().latin1(), ev.progress(), ev.isCompleted() );
36 ev.setUid(1); 36 ev.setUid(1);
37 37
38 return ev; 38 return ev;
39} 39}
40OTodo Editor::edit( QWidget *wid, 40OTodo Editor::edit( QWidget *,
41 const OTodo& todo ) { 41 const OTodo& todo ) {
42 OTaskEditor *e = self(); 42 OTaskEditor *e = self();
43 e->init( todo ); 43 e->init( todo );
44 e->setCaption( QObject::tr( "Edit Task" ) ); 44 e->setCaption( QObject::tr( "Edit Task" ) );
45 45
46#if defined(Q_WS_QWS) || defined(_WS_QWS_) 46#if defined(Q_WS_QWS) || defined(_WS_QWS_)
47 e->showMaximized(); 47 e->showMaximized();
48#endif 48#endif
49 int ret = e->exec(); 49 int ret = e->exec();
50 50
51 OTodo ev = e->todo(); 51 OTodo ev = e->todo();
52 if ( ret == QDialog::Accepted ) 52 if ( ret == QDialog::Accepted )
53 m_accepted = true; 53 m_accepted = true;
54 else 54 else
55 m_accepted = false; 55 m_accepted = false;
56 56
57 return ev; 57 return ev;
58} 58}
59bool Editor::accepted()const { 59bool Editor::accepted()const {
60 return m_accepted; 60 return m_accepted;
61} 61}
62OTaskEditor* Editor::self() { 62OTaskEditor* Editor::self() {
63 if (!m_self ) 63 if (!m_self )
64 m_self = new OTaskEditor(0); 64 m_self = new OTaskEditor(0);