summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp10
-rw-r--r--core/pim/todo/mainwindow.h5
-rw-r--r--core/pim/todo/todo.pro28
3 files changed, 15 insertions, 28 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index 6725951..ecb4e40 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -45,38 +45,41 @@
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 56
57#include <opie/oapplicationfactory.h>
58
57#include "quickeditimpl.h" 59#include "quickeditimpl.h"
58#include "todotemplatemanager.h" 60#include "todotemplatemanager.h"
59#include "templateeditor.h" 61#include "templateeditor.h"
60#include "tableview.h" 62#include "tableview.h"
61 63
62#include "textviewshow.h" 64#include "textviewshow.h"
63#include "todoeditor.h" 65#include "todoeditor.h"
64#include "mainwindow.h" 66#include "mainwindow.h"
65 67
68OPIE_EXPORT_APP( OApplicationFactory<Todo::MainWindow> )
66 69
67using namespace Todo; 70using namespace Todo;
68 71
69MainWindow::MainWindow( QWidget* parent, 72MainWindow::MainWindow( QWidget* parent,
70 const char* name ) 73 const char* name, WFlags )
71 : OPimMainWindow( "Todolist", parent, name, WType_TopLevel | WStyle_ContextHelp ) 74 : OPimMainWindow( "Todolist", parent, name, WType_TopLevel | WStyle_ContextHelp )
72{ 75{
73 m_syncing = false; 76 m_syncing = false;
74 m_showing = false; 77 m_showing = false;
75 m_counter = 0; 78 m_counter = 0;
76 m_tempManager = new TemplateManager(); 79 m_tempManager = new TemplateManager();
77 m_tempManager->load(); 80 m_tempManager->load();
78 81
79 initUI(); 82 initUI();
80 initConfig(); 83 initConfig();
81 initViews(); 84 initViews();
82 initActions(); 85 initActions();
@@ -341,24 +344,25 @@ bool MainWindow::isSyncing()const {
341 return m_syncing; 344 return m_syncing;
342} 345}
343TemplateManager* MainWindow::templateManager() { 346TemplateManager* MainWindow::templateManager() {
344 return m_tempManager; 347 return m_tempManager;
345} 348}
346Editor* MainWindow::currentEditor() { 349Editor* MainWindow::currentEditor() {
347 return m_curEdit; 350 return m_curEdit;
348} 351}
349TodoShow* MainWindow::currentShow() { 352TodoShow* MainWindow::currentShow() {
350 return m_curShow; 353 return m_curShow;
351} 354}
352void MainWindow::slotReload() { 355void MainWindow::slotReload() {
356 m_syncing = FALSE;
353 m_todoMgr.reload(); 357 m_todoMgr.reload();
354 currentView()->updateView( ); 358 currentView()->updateView( );
355 raiseCurrentView(); 359 raiseCurrentView();
356} 360}
357void MainWindow::closeEvent( QCloseEvent* e ) { 361void MainWindow::closeEvent( QCloseEvent* e ) {
358 if (m_stack->visibleWidget() == currentShow()->widget() ) { 362 if (m_stack->visibleWidget() == currentShow()->widget() ) {
359 m_showing = false; 363 m_showing = false;
360 raiseCurrentView(); 364 raiseCurrentView();
361 e->ignore(); 365 e->ignore();
362 return; 366 return;
363 } 367 }
364 /* 368 /*
@@ -595,32 +599,32 @@ void MainWindow::receiveFile( const QString& filename ) {
595 OTodoAccess::List list = acc.allRecords(); 599 OTodoAccess::List list = acc.allRecords();
596 600
597 if (list.count()){ 601 if (list.count()){
598 602
599 QString message = QWidget::tr("<P>%1 new tasks arrived.<p>Would you like to add them to your Todolist?").arg(list.count() ); 603 QString message = QWidget::tr("<P>%1 new tasks arrived.<p>Would you like to add them to your Todolist?").arg(list.count() );
600 604
601 if ( QMessageBox::information(this, QWidget::tr("New Tasks"), 605 if ( QMessageBox::information(this, QWidget::tr("New Tasks"),
602 message, QMessageBox::Ok, 606 message, QMessageBox::Ok,
603 QMessageBox::Cancel ) == QMessageBox::Ok ) { 607 QMessageBox::Cancel ) == QMessageBox::Ok ) {
604 OTodoAccess::List::Iterator it; 608 OTodoAccess::List::Iterator it;
605 for ( it = list.begin(); it != list.end(); ++it ) 609 for ( it = list.begin(); it != list.end(); ++it )
606 m_todoMgr.add( (*it) ); 610 m_todoMgr.add( (*it) );
607 611
608 currentView()->updateView(); 612 currentView()->updateView();
609 } 613 }
610 } 614 }
611} 615}
612 616
613void MainWindow::slotFlush() { 617void MainWindow::slotFlush() {
614 m_syncing = FALSE; 618 m_syncing = TRUE;
615 m_todoMgr.save(); 619 m_todoMgr.save();
616} 620}
617void MainWindow::slotShowDetails() { 621void MainWindow::slotShowDetails() {
618 slotShow( currentView()->current() ); 622 slotShow( currentView()->current() );
619} 623}
620/* 624/*
621 * populate the Categories 625 * populate the Categories
622 * Menu 626 * Menu
623 */ 627 */
624void MainWindow::populateCategories() { 628void MainWindow::populateCategories() {
625 m_todoMgr.load(); 629 m_todoMgr.load();
626 630
diff --git a/core/pim/todo/mainwindow.h b/core/pim/todo/mainwindow.h
index b04a958..bd341c2 100644
--- a/core/pim/todo/mainwindow.h
+++ b/core/pim/todo/mainwindow.h
@@ -53,26 +53,29 @@ namespace 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 */
66 static QString appName() { return QString::fromLatin1("todolist"); }
67
65 MainWindow( QWidget *parent = 0, 68 MainWindow( QWidget *parent = 0,
66 const char* name = 0 ); 69 const char* name = 0, WFlags fl = 0 );
67 ~MainWindow(); 70 ~MainWindow();
68 71
69 /** return a context menu for an OTodo */ 72 /** return a context menu for an OTodo */
70 QPopupMenu* contextMenu(int uid, bool doesRecur = FALSE ); 73 QPopupMenu* contextMenu(int uid, bool doesRecur = FALSE );
71 QPopupMenu* options(); 74 QPopupMenu* options();
72 QPopupMenu* edit(); 75 QPopupMenu* edit();
73 QToolBar* toolbar(); 76 QToolBar* toolbar();
74 77
75 78
76 void updateList(); 79 void updateList();
77 OTodoAccess::List list()const; 80 OTodoAccess::List list()const;
78 OTodoAccess::List sorted( bool asc, int sortOrder ); 81 OTodoAccess::List sorted( bool asc, int sortOrder );
diff --git a/core/pim/todo/todo.pro b/core/pim/todo/todo.pro
index 4a63770..51cfde7 100644
--- a/core/pim/todo/todo.pro
+++ b/core/pim/todo/todo.pro
@@ -1,69 +1,49 @@
1 TEMPLATE= app 1 #TEMPLATE= app
2 CONFIG = qt warn_on release 2 CONFIG = qt warn_on release quick-app
3 DESTDIR = $(OPIEDIR)/bin 3 #DESTDIR = $(OPIEDIR)/bin
4 4
5 HEADERS= smalltodo.h \ 5 HEADERS= smalltodo.h \
6 todomanager.h \ 6 todomanager.h \
7 mainwindow.h \ 7 mainwindow.h \
8 todoview.h \ 8 todoview.h \
9 tableview.h \ 9 tableview.h \
10 todotemplatemanager.h \ 10 todotemplatemanager.h \
11 todoeditor.h \ 11 todoeditor.h \
12 todoshow.h \ 12 todoshow.h \
13 textviewshow.h \ 13 textviewshow.h \
14 templateeditor.h \ 14 templateeditor.h \
15 templatedialog.h \ 15 templatedialog.h \
16 templatedialogimpl.h \ 16 templatedialogimpl.h \
17 quickedit.h \ 17 quickedit.h \
18 quickeditimpl.h \ 18 quickeditimpl.h \
19 otaskeditor.h \ 19 otaskeditor.h \
20 taskeditoroverview.h \ 20 taskeditoroverview.h \
21 taskeditorstatus.h \ 21 taskeditorstatus.h \
22 taskeditoralarms.h 22 taskeditoralarms.h
23 23
24 SOURCES= smalltodo.cpp \ 24 SOURCES= smalltodo.cpp \
25 todomanager.cpp \ 25 todomanager.cpp \
26 mainwindow.cpp \ 26 mainwindow.cpp \
27 main.cpp \ 27 # main.cpp \
28 tableview.cpp \ 28 tableview.cpp \
29 todoview.cpp \ 29 todoview.cpp \
30 todotemplatemanager.cpp \ 30 todotemplatemanager.cpp \
31 todoeditor.cpp \ 31 todoeditor.cpp \
32 todoshow.cpp \ 32 todoshow.cpp \
33 textviewshow.cpp \ 33 textviewshow.cpp \
34 templateeditor.cpp \ 34 templateeditor.cpp \
35 templatedialog.cpp \ 35 templatedialog.cpp \
36 templatedialogimpl.cpp \ 36 templatedialogimpl.cpp \
37 quickeditimpl.cpp \ 37 quickeditimpl.cpp \
38 quickedit.cpp \ 38 quickedit.cpp \
39 otaskeditor.cpp \ 39 otaskeditor.cpp \
40 taskeditoroverview.cpp \ 40 taskeditoroverview.cpp \
41 taskeditorstatus.cpp \ 41 taskeditorstatus.cpp \
42 taskeditoralarms.cpp 42 taskeditoralarms.cpp
43 43
44 TARGET = todolist 44 TARGET = todolist
45INCLUDEPATH += $(OPIEDIR)/include 45INCLUDEPATH += $(OPIEDIR)/include
46 DEPENDPATH+= $(OPIEDIR)/include 46 DEPENDPATH+= $(OPIEDIR)/include
47LIBS += -lqpe -lopie 47LIBS += -lqpe -lopie
48 48
49TRANSLATIONS = ../../../i18n/de/todolist.ts \
50 ../../../i18n/nl/todolist.ts \
51 ../../../i18n/da/todolist.ts \
52 ../../../i18n/xx/todolist.ts \
53 ../../../i18n/en/todolist.ts \
54 ../../../i18n/es/todolist.ts \
55 ../../../i18n/fr/todolist.ts \
56 ../../../i18n/hu/todolist.ts \
57 ../../../i18n/ja/todolist.ts \
58 ../../../i18n/ko/todolist.ts \
59 ../../../i18n/no/todolist.ts \
60 ../../../i18n/pl/todolist.ts \
61 ../../../i18n/pt/todolist.ts \
62 ../../../i18n/pt_BR/todolist.ts \
63 ../../../i18n/sl/todolist.ts \
64 ../../../i18n/zh_CN/todolist.ts \
65 ../../../i18n/zh_TW/todolist.ts
66
67
68
69include ( $(OPIEDIR)/include.pro ) 49include ( $(OPIEDIR)/include.pro )