Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 29 |
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 | |||
@@ -32,21 +32,24 @@ | |||
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" |
@@ -195,14 +198,21 @@ void MainWindow::initConfig() { | |||
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 | } |
200 | void MainWindow::initUI() { | 203 | void 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 | ||
@@ -221,13 +231,13 @@ void MainWindow::initUI() { | |||
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 | } |
226 | void MainWindow::initViews() { | 236 | void 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 |
@@ -678,6 +688,19 @@ void MainWindow::updateList() { | |||
678 | m_todoMgr.updateList(); | 688 | m_todoMgr.updateList(); |
679 | } | 689 | } |
680 | void MainWindow::setReadAhead( uint count ) { | 690 | void 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 | } |
694 | void 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 | } | ||
704 | QuickEditBase* MainWindow::quickEditor() { | ||
705 | return m_curQuick; | ||
706 | } | ||