author | zecke <zecke> | 2002-10-19 02:32:30 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-19 02:32:30 (UTC) |
commit | 47ea36b68b6c7f12ae3bb777c89d813b4e1360a3 (patch) (unidiff) | |
tree | d25ec05f1ccf0db36194d5f2879fe543a34620c2 /core/pim/todo/mainwindow.cpp | |
parent | 7871e87fbd796c57374b23ec91890962b2ef1fe9 (diff) | |
download | opie-47ea36b68b6c7f12ae3bb777c89d813b4e1360a3.zip opie-47ea36b68b6c7f12ae3bb777c89d813b4e1360a3.tar.gz opie-47ea36b68b6c7f12ae3bb777c89d813b4e1360a3.tar.bz2 |
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
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 | |||
@@ -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 | ||
57 | using namespace Todo; | 60 | using 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 */ |
192 | void MainWindow::initConfig() { | 195 | void 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 | } |
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 | ||
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 | } |
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 |
234 | * and subdirs for multiple views | 244 | * and subdirs for multiple views |
235 | */ | 245 | */ |
236 | } | 246 | } |
237 | void MainWindow::initEditor() { | 247 | void 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 | */ |
674 | void MainWindow::slotUpdate3( QWidget* ) { | 684 | void MainWindow::slotUpdate3( QWidget* ) { |
675 | 685 | ||
676 | } | 686 | } |
677 | void MainWindow::updateList() { | 687 | 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 | } | ||