summaryrefslogtreecommitdiff
path: root/core/pim/todo/mainwindow.cpp
Unidiff
Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index a6d657c..8377573 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -26,33 +26,36 @@
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 <qwidgetstack.h> 35#include <qwidgetstack.h>
36#include <qaction.h> 36#include <qaction.h>
37#include <qtimer.h> 37#include <qtimer.h>
38#include <qvbox.h>
39#include <qlineedit.h>
38 40
39#include <qpe/applnk.h> 41#include <qpe/applnk.h>
40#include <qpe/config.h> 42#include <qpe/config.h>
41#include <qpe/ir.h> 43#include <qpe/ir.h>
42#include <qpe/resource.h> 44#include <qpe/resource.h>
43#include <qpe/qpemessagebox.h> 45#include <qpe/qpemessagebox.h>
44 46
45#include <opie/otodoaccessvcal.h> 47#include <opie/otodoaccessvcal.h>
46 48
49#include "quickeditimpl.h"
47#include "todotemplatemanager.h" 50#include "todotemplatemanager.h"
48#include "templateeditor.h" 51#include "templateeditor.h"
49#include "todoentryimpl.h" 52#include "todoentryimpl.h"
50#include "tableview.h" 53#include "tableview.h"
51 54
52#include "textviewshow.h" 55#include "textviewshow.h"
53#include "todoeditor.h" 56#include "todoeditor.h"
54#include "mainwindow.h" 57#include "mainwindow.h"
55 58
56 59
57using namespace Todo; 60using namespace Todo;
58 61
@@ -189,51 +192,58 @@ void MainWindow::initActions() {
189 192
190} 193}
191/* m_curCat from Config */ 194/* m_curCat from Config */
192void MainWindow::initConfig() { 195void MainWindow::initConfig() {
193 Config config( "todo" ); 196 Config config( "todo" );
194 config.setGroup( "View" ); 197 config.setGroup( "View" );
195 m_completed = config.readBoolEntry( "ShowComplete", TRUE ); 198 m_completed = config.readBoolEntry( "ShowComplete", TRUE );
196 m_curCat = config.readEntry( "Category", QString::null ); 199 m_curCat = config.readEntry( "Category", QString::null );
197 m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE); 200 m_deadline = config.readBoolEntry( "ShowDeadLine", TRUE);
198 m_overdue = config.readBoolEntry("ShowOverDue", TRUE ); 201 m_overdue = config.readBoolEntry("ShowOverDue", TRUE );
199} 202}
200void MainWindow::initUI() { 203void MainWindow::initUI() {
201 m_stack = new QWidgetStack(this, "main stack"); 204 m_mainBox = new QVBox(this, "main box ");
202 setCentralWidget( m_stack ); 205 m_curQuick = new QuickEditImpl(this, m_mainBox );
206 m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) );
207 m_quickEdit.append( m_curQuick );
208
209
210
211 m_stack = new QWidgetStack(m_mainBox, "main stack");
212 setCentralWidget( m_mainBox );
203 213
204 setToolBarsMovable( FALSE ); 214 setToolBarsMovable( FALSE );
205 215
206 m_tool = new QToolBar( this ); 216 m_tool = new QToolBar( this );
207 m_tool->setHorizontalStretchable( TRUE ); 217 m_tool->setHorizontalStretchable( TRUE );
208 218
209 m_bar = new QMenuBar( m_tool ); 219 m_bar = new QMenuBar( m_tool );
210 220
211 /** QPopupMenu */ 221 /** QPopupMenu */
212 m_edit = new QPopupMenu( this ); 222 m_edit = new QPopupMenu( this );
213 m_options = new QPopupMenu( this ); 223 m_options = new QPopupMenu( this );
214 m_view = new QPopupMenu( this ); 224 m_view = new QPopupMenu( this );
215 m_catMenu = new QPopupMenu( this ); 225 m_catMenu = new QPopupMenu( this );
216 m_template = new QPopupMenu( this ); 226 m_template = new QPopupMenu( this );
217 227
218 m_catMenu->setCheckable( TRUE ); 228 m_catMenu->setCheckable( TRUE );
219 m_template->setCheckable( TRUE ); 229 m_template->setCheckable( TRUE );
220 230
221 connect(m_catMenu, SIGNAL(activated(int) ), 231 connect(m_catMenu, SIGNAL(activated(int) ),
222 this, SLOT(setCategory(int) ) ); 232 this, SLOT(setCategory(int) ) );
223 connect(m_template, SIGNAL(activated(int) ), 233 connect(m_template, SIGNAL(activated(int) ),
224 this, SLOT(slotNewFromTemplate(int) ) ); 234 this, SLOT(slotNewFromTemplate(int) ) );
225} 235}
226void MainWindow::initViews() { 236void MainWindow::initViews() {
227 TableView* tableView = new TableView( this, this ); 237 TableView* tableView = new TableView( this, m_stack );
228 m_stack->addWidget( tableView, m_counter++ ); 238 m_stack->addWidget( tableView, m_counter++ );
229 m_views.append( tableView ); 239 m_views.append( tableView );
230 m_curView = tableView; 240 m_curView = tableView;
231 connectBase( tableView ); 241 connectBase( tableView );
232 /* add QString type + QString configname to 242 /* add QString type + QString configname to
233 * the View menu 243 * the View menu
234 * and subdirs for multiple views 244 * and subdirs for multiple views
235 */ 245 */
236} 246}
237void MainWindow::initEditor() { 247void MainWindow::initEditor() {
238 m_curEdit = new Editor(); 248 m_curEdit = new Editor();
239} 249}
@@ -672,12 +682,25 @@ void MainWindow::updateTodo( const OTodo& ev) {
672 * update the view menu 682 * update the view menu
673 */ 683 */
674void MainWindow::slotUpdate3( QWidget* ) { 684void MainWindow::slotUpdate3( QWidget* ) {
675 685
676} 686}
677void MainWindow::updateList() { 687void MainWindow::updateList() {
678 m_todoMgr.updateList(); 688 m_todoMgr.updateList();
679} 689}
680void MainWindow::setReadAhead( uint count ) { 690void MainWindow::setReadAhead( uint count ) {
681 if (m_todoMgr.todoDB() ) 691 if (m_todoMgr.todoDB() )
682 m_todoMgr.todoDB()->setReadAhead( count ); 692 m_todoMgr.todoDB()->setReadAhead( count );
683} 693}
694void MainWindow::slotQuickEntered() {
695 qWarning("entered");
696 OTodo todo = quickEditor()->todo();
697 if (todo.isEmpty() )
698 return;
699
700 m_todoMgr.add( todo );
701 currentView()->addEvent( todo );
702 raiseCurrentView();
703}
704QuickEditBase* MainWindow::quickEditor() {
705 return m_curQuick;
706}