From 47ea36b68b6c7f12ae3bb777c89d813b4e1360a3 Mon Sep 17 00:00:00 2001 From: zecke Date: Sat, 19 Oct 2002 02:32:30 +0000 Subject: Fix crash if todolist is empty Fix paint update bugs.. knewly created items did not show up. an sort() QTable::update() is and was not enough A new feature. It's a quick entering method. It lacks icons and some more stuff but I like it Now redoing the Editor Dialog --- (limited to 'core/pim/todo/mainwindow.cpp') 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 @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include @@ -44,6 +46,7 @@ #include +#include "quickeditimpl.h" #include "todotemplatemanager.h" #include "templateeditor.h" #include "todoentryimpl.h" @@ -198,8 +201,15 @@ void MainWindow::initConfig() { m_overdue = config.readBoolEntry("ShowOverDue", TRUE ); } void MainWindow::initUI() { - m_stack = new QWidgetStack(this, "main stack"); - setCentralWidget( m_stack ); + m_mainBox = new QVBox(this, "main box "); + m_curQuick = new QuickEditImpl(this, m_mainBox ); + m_curQuick->signal()->connect( this, SLOT(slotQuickEntered() ) ); + m_quickEdit.append( m_curQuick ); + + + + m_stack = new QWidgetStack(m_mainBox, "main stack"); + setCentralWidget( m_mainBox ); setToolBarsMovable( FALSE ); @@ -224,7 +234,7 @@ void MainWindow::initUI() { this, SLOT(slotNewFromTemplate(int) ) ); } void MainWindow::initViews() { - TableView* tableView = new TableView( this, this ); + TableView* tableView = new TableView( this, m_stack ); m_stack->addWidget( tableView, m_counter++ ); m_views.append( tableView ); m_curView = tableView; @@ -681,3 +691,16 @@ void MainWindow::setReadAhead( uint count ) { if (m_todoMgr.todoDB() ) m_todoMgr.todoDB()->setReadAhead( count ); } +void MainWindow::slotQuickEntered() { + qWarning("entered"); + OTodo todo = quickEditor()->todo(); + if (todo.isEmpty() ) + return; + + m_todoMgr.add( todo ); + currentView()->addEvent( todo ); + raiseCurrentView(); +} +QuickEditBase* MainWindow::quickEditor() { + return m_curQuick; +} -- cgit v0.9.0.2