summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index 75da27c..9013522 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -68,11 +68,12 @@ using namespace Opie;
68using namespace Todo; 68using namespace Todo;
69 69
70MainWindow::MainWindow( QWidget* parent, 70MainWindow::MainWindow( QWidget* parent,
71 const char* name, WFlags ) 71 const char* name, WFlags )
72 : Opie::OPimMainWindow( "Todolist", tr( "Todo List" ), "Todo List", tr( "Task" ), "todo", 72 : Opie::OPimMainWindow( "Todolist", "Todo List", tr( "Task" ), "todo",
73 parent, name, WType_TopLevel | WStyle_ContextHelp ) 73 parent, name, WType_TopLevel | WStyle_ContextHelp )
74{ 74{
75 setCaption( tr( "Todo List" ) );
75 if (!name) 76 if (!name)
76 setName("todo window"); 77 setName("todo window");
77 78
78 m_syncing = false; 79 m_syncing = false;
@@ -90,26 +91,26 @@ MainWindow::MainWindow( QWidget* parent,
90 91
91 raiseCurrentView(); 92 raiseCurrentView();
92 QTimer::singleShot( 0, this, SLOT(initStuff()) ); 93 QTimer::singleShot( 0, this, SLOT(initStuff()) );
93} 94}
94void MainWindow::initStuff() { 95void MainWindow::initStuff() {
95 m_todoMgr.load(); 96 m_todoMgr.load();
96 setViewCategory( m_curCat ); 97 setViewCategory( m_curCat );
97 setCategory( m_curCat ); 98 setCategory( m_curCat );
98} 99}
99void MainWindow::initActions() { 100void MainWindow::initActions() {
100 // Insert Task menu items 101 // Insert Task menu items
101 QActionGroup *items = new QActionGroup( this, QString::null, false ); 102 QActionGroup *items = new QActionGroup( this, QString::null, false );
102 103
103 m_deleteCompleteAction = new QAction( QString::null, QWidget::tr( "Delete completed" ), 104 m_deleteCompleteAction = new QAction( QString::null, QWidget::tr( "Delete completed" ),
104 0, items, 0 ); 105 0, items, 0 );
105 connect( m_deleteCompleteAction, SIGNAL(activated()), this, SLOT(slotDeleteCompleted()) ); 106 connect( m_deleteCompleteAction, SIGNAL(activated()), this, SLOT(slotDeleteCompleted()) );
106 107
107 insertItemMenuItems( items ); 108 insertItemMenuItems( items );
108 109
109 // Insert View menu items 110 // Insert View menu items
110 items = new QActionGroup( this, QString::null, false ); 111 items = new QActionGroup( this, QString::null, false );
111 112
112 m_completedAction = new QAction( QString::null, QWidget::tr("Show completed tasks"), 113 m_completedAction = new QAction( QString::null, QWidget::tr("Show completed tasks"),
113 0, items, 0, true ); 114 0, items, 0, true );
114 m_completedAction->setOn( showCompleted() ); 115 m_completedAction->setOn( showCompleted() );
115 connect( m_completedAction, SIGNAL(toggled(bool)), this, SLOT(slotShowCompleted(bool)) ); 116 connect( m_completedAction, SIGNAL(toggled(bool)), this, SLOT(slotShowCompleted(bool)) );
@@ -127,9 +128,9 @@ void MainWindow::initActions() {
127 m_showQuickTaskAction = new QAction( QString::null, QWidget::tr("Show quick task bar"), 128 m_showQuickTaskAction = new QAction( QString::null, QWidget::tr("Show quick task bar"),
128 0, items, 0, true ); 129 0, items, 0, true );
129 m_showQuickTaskAction->setOn( showQuickTask() ); 130 m_showQuickTaskAction->setOn( showQuickTask() );
130 connect( m_showQuickTaskAction, SIGNAL(toggled(bool)), this, SLOT(slotShowQuickTask(bool)) ); 131 connect( m_showQuickTaskAction, SIGNAL(toggled(bool)), this, SLOT(slotShowQuickTask(bool)) );
131 132
132 insertViewMenuItems( items ); 133 insertViewMenuItems( items );
133} 134}
134/* m_curCat from Config */ 135/* m_curCat from Config */
135void MainWindow::initConfig() { 136void MainWindow::initConfig() {
@@ -146,9 +147,9 @@ void MainWindow::initUI() {
146 m_stack = new Opie::Ui::OWidgetStack(this, "main stack"); 147 m_stack = new Opie::Ui::OWidgetStack(this, "main stack");
147 setCentralWidget( m_stack ); 148 setCentralWidget( m_stack );
148 connect( this, SIGNAL(categorySelected(const QString&)), 149 connect( this, SIGNAL(categorySelected(const QString&)),
149 this, SLOT(setCategory(const QString&)) ); 150 this, SLOT(setCategory(const QString&)) );
150 151
151 // Create quick task toolbar 152 // Create quick task toolbar
152 m_curQuick = new QuickEditImpl( this, m_quicktask ); 153 m_curQuick = new QuickEditImpl( this, m_quicktask );
153 addToolBar( (QToolBar *)m_curQuick->widget(), QWidget::tr( "QuickEdit" ), 154 addToolBar( (QToolBar *)m_curQuick->widget(), QWidget::tr( "QuickEdit" ),
154 QMainWindow::Top, true ); 155 QMainWindow::Top, true );
@@ -198,9 +199,9 @@ OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder ) {
198 if (!m_completed ) 199 if (!m_completed )
199 filter |= OPimTodoAccess::DoNotShowCompleted; 200 filter |= OPimTodoAccess::DoNotShowCompleted;
200 if (m_overdue) 201 if (m_overdue)
201 filter |= OPimTodoAccess::OnlyOverDue; 202 filter |= OPimTodoAccess::OnlyOverDue;
202 203
203 return m_todoMgr.sorted( asc, sortOrder, filter, cat ); 204 return m_todoMgr.sorted( asc, sortOrder, filter, cat );
204} 205}
205OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) { 206OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter) {
206 int cat = 0; 207 int cat = 0;
@@ -208,9 +209,9 @@ OPimTodoAccess::List MainWindow::sorted( bool asc, int sortOrder, int addFilter)
208 cat = currentCatId(); 209 cat = currentCatId();
209 210
210 if ( m_curCat == tr( "Unfiled" ) ) 211 if ( m_curCat == tr( "Unfiled" ) )
211 cat = -1; 212 cat = -1;
212 213
213 return m_todoMgr.sorted(asc, sortOrder, addFilter, cat ); 214 return m_todoMgr.sorted(asc, sortOrder, addFilter, cat );
214} 215}
215OPimTodo MainWindow::event( int uid ) { 216OPimTodo MainWindow::event( int uid ) {
216 return m_todoMgr.event( uid ); 217 return m_todoMgr.event( uid );
@@ -297,9 +298,9 @@ void MainWindow::slotItemNew() {
297 event.setUid( 1 ); 298 event.setUid( 1 );
298 handleAlarms( OPimTodo(), event ); 299 handleAlarms( OPimTodo(), event );
299 m_todoMgr.add( event ); 300 m_todoMgr.add( event );
300 currentView()->addEvent( event ); 301 currentView()->addEvent( event );
301 302
302 reloadCategories(); 303 reloadCategories();
303 } 304 }
304 raiseCurrentView(); 305 raiseCurrentView();
305 } 306 }
@@ -404,9 +405,9 @@ void MainWindow::slotDeleteCompleted() {
404void MainWindow::setCategory( const QString &category ) { 405void MainWindow::setCategory( const QString &category ) {
405 m_curCat = category; 406 m_curCat = category;
406 if ( m_curCat == tr( "All" ) ) 407 if ( m_curCat == tr( "All" ) )
407 m_curCat = QString::null; 408 m_curCat = QString::null;
408 409
409 currentView()->setShowCategory( m_curCat ); 410 currentView()->setShowCategory( m_curCat );
410 raiseCurrentView(); 411 raiseCurrentView();
411} 412}
412void MainWindow::slotShowDeadLine( bool dead) { 413void MainWindow::slotShowDeadLine( bool dead) {