Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 70 |
1 files changed, 43 insertions, 27 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index 0ab6230..f0aa455 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -29,2 +29,3 @@ | |||
29 | #include <unistd.h> | 29 | #include <unistd.h> |
30 | #include <stdio.h> | ||
30 | 31 | ||
@@ -45,2 +46,3 @@ | |||
45 | #include <qpe/qpemessagebox.h> | 46 | #include <qpe/qpemessagebox.h> |
47 | #include <qpe/qpetoolbar.h> | ||
46 | 48 | ||
@@ -87,2 +89,7 @@ void MainWindow::initTemplate() { | |||
87 | void MainWindow::initActions() { | 89 | void MainWindow::initActions() { |
90 | |||
91 | // Data menu | ||
92 | m_edit->insertItem(tr("New from template"), m_template, | ||
93 | -1, 0 ); | ||
94 | |||
88 | QAction* a = new QAction( tr("New Task" ), Resource::loadPixmap( "new" ), | 95 | QAction* a = new QAction( tr("New Task" ), Resource::loadPixmap( "new" ), |
@@ -150,6 +157,6 @@ void MainWindow::initActions() { | |||
150 | 157 | ||
158 | // Options menu | ||
151 | a = new QAction( tr("Find"), Resource::loadIconSet( "mag" ), | 159 | a = new QAction( tr("Find"), Resource::loadIconSet( "mag" ), |
152 | QString::null, 0, this, 0 ); | 160 | QString::null, 0, this, 0 ); |
153 | connect(a, SIGNAL( activated() ), | 161 | connect(a, SIGNAL( activated() ), this, SLOT( slotFind() ) ); |
154 | this, SLOT( slotFind() ) ); | ||
155 | a->addTo( m_options ); | 162 | a->addTo( m_options ); |
@@ -159,3 +166,3 @@ void MainWindow::initActions() { | |||
159 | 166 | ||
160 | m_completedAction = new QAction( QString::null, tr("Completed tasks"), | 167 | m_completedAction = new QAction( QString::null, tr("Show completed tasks"), |
161 | 0, this, 0, TRUE ); | 168 | 0, this, 0, TRUE ); |
@@ -163,6 +170,11 @@ void MainWindow::initActions() { | |||
163 | m_completedAction->setOn( showCompleted() ); | 170 | m_completedAction->setOn( showCompleted() ); |
164 | connect(m_completedAction, SIGNAL( toggled(bool) ), | 171 | connect(m_completedAction, SIGNAL( toggled(bool) ), this, SLOT(slotShowCompleted(bool) ) ); |
165 | this, SLOT(slotShowCompleted(bool) ) ); | ||
166 | 172 | ||
167 | m_showDeadLineAction = new QAction( QString::null, tr("Show Deadline"), | 173 | a = new QAction( QString::null, tr("Show only over-due tasks"), |
174 | 0, this, 0, TRUE ); | ||
175 | a->addTo( m_options ); | ||
176 | a->setOn( showOverDue() ); | ||
177 | connect(a, SIGNAL(toggled(bool)), this, SLOT(slotShowDue(bool) ) ); | ||
178 | |||
179 | m_showDeadLineAction = new QAction( QString::null, tr("Show task deadlines"), | ||
168 | 0, this, 0, TRUE ); | 180 | 0, this, 0, TRUE ); |
@@ -170,4 +182,9 @@ void MainWindow::initActions() { | |||
170 | m_showDeadLineAction->setOn( showDeadline() ); | 182 | m_showDeadLineAction->setOn( showDeadline() ); |
171 | connect(m_showDeadLineAction, SIGNAL(toggled(bool) ), | 183 | connect(m_showDeadLineAction, SIGNAL(toggled(bool) ), this, SLOT( slotShowDeadLine( bool ) ) ); |
172 | this, SLOT( slotShowDeadLine( bool ) ) ); | 184 | |
185 | m_showQuickTaskAction = new QAction( QString::null, tr("Show quick task bar"), | ||
186 | 0, this, 0, TRUE ); | ||
187 | m_showQuickTaskAction->addTo( m_options ); | ||
188 | m_showQuickTaskAction->setOn( showQuickTask() ); | ||
189 | connect(m_showQuickTaskAction, SIGNAL( toggled(bool) ), this, SLOT(slotShowQuickTask(bool) ) ); | ||
173 | 190 | ||
@@ -179,13 +196,5 @@ void MainWindow::initActions() { | |||
179 | 196 | ||
180 | /* initialize the view menu */ | 197 | m_curQuick = new QuickEditImpl( this, m_quicktask ); |
181 | a = new QAction( QString::null, tr("Show only over due"), | 198 | addToolBar( (QPEToolBar *)m_curQuick->widget(), tr( "QuickEdit" ), QMainWindow::Top, TRUE ); |
182 | 0, this, 0, TRUE ); | 199 | m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) ); |
183 | a->addTo( m_options ); | ||
184 | a->setOn( showOverDue() ); | ||
185 | connect(a, SIGNAL(toggled(bool)), | ||
186 | this, SLOT(slotShowDue(bool) ) ); | ||
187 | |||
188 | /* templates */ | ||
189 | m_edit->insertItem(tr("New from template"), m_template, | ||
190 | -1, 0 ); | ||
191 | 200 | ||
@@ -199,3 +208,4 @@ void MainWindow::initConfig() { | |||
199 | m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE); | 208 | m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE); |
200 | m_overdue = config.readBoolEntry("ShowOverDue", TRUE ); | 209 | m_overdue = config.readBoolEntry("ShowOverDue", FALSE ); |
210 | m_quicktask = config.readBoolEntry("ShowQuickTask", TRUE); | ||
201 | } | 211 | } |
@@ -203,7 +213,2 @@ void MainWindow::initUI() { | |||
203 | m_mainBox = new QVBox(this, "main box "); | 213 | m_mainBox = new QVBox(this, "main box "); |
204 | m_curQuick = new QuickEditImpl(this, m_mainBox ); | ||
205 | m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) ); | ||
206 | m_quickEdit.append( m_curQuick ); | ||
207 | |||
208 | |||
209 | 214 | ||
@@ -214,3 +219,3 @@ void MainWindow::initUI() { | |||
214 | 219 | ||
215 | m_tool = new QToolBar( this ); | 220 | m_tool = new QPEToolBar( this ); |
216 | m_tool->setHorizontalStretchable( TRUE ); | 221 | m_tool->setHorizontalStretchable( TRUE ); |
@@ -373,3 +378,4 @@ void MainWindow::closeEvent( QCloseEvent* e ) { | |||
373 | config.writeEntry( "ShowOverDue", showOverDue() ); | 378 | config.writeEntry( "ShowOverDue", showOverDue() ); |
374 | /* svae templates */ | 379 | config.writeEntry( "ShowQuickTask", showQuickTask() ); |
380 | /* save templates */ | ||
375 | templateManager()->save(); | 381 | templateManager()->save(); |
@@ -517,2 +523,9 @@ void MainWindow::slotShowCompleted( bool show) { | |||
517 | } | 523 | } |
524 | void MainWindow::slotShowQuickTask( bool show ) { | ||
525 | m_quicktask = show; | ||
526 | if ( m_quicktask ) | ||
527 | m_curQuick->widget()->show(); | ||
528 | else | ||
529 | m_curQuick->widget()->hide(); | ||
530 | } | ||
518 | bool MainWindow::showOverDue()const { | 531 | bool MainWindow::showOverDue()const { |
@@ -593,2 +606,5 @@ bool MainWindow::showDeadline()const { | |||
593 | } | 606 | } |
607 | bool MainWindow::showQuickTask()const { | ||
608 | return m_quicktask; | ||
609 | } | ||
594 | QString MainWindow::currentCategory()const { | 610 | QString MainWindow::currentCategory()const { |