Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/todo/mainwindow.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index 48954ce..c9c43d4 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp @@ -417,13 +417,12 @@ void MainWindow::slotNew() { // I'm afraid we must call this every time now, otherwise // spend expensive time comparing all these strings... // but only call if we changed something -zecke populateCategories(); } - raiseCurrentView( ); } void MainWindow::slotDuplicate() { if(m_syncing) { QMessageBox::warning(this, tr("Todo"), tr("Can not edit data, currently syncing")); @@ -494,12 +493,13 @@ void MainWindow::slotEdit() { /* * set the category */ void MainWindow::setCategory( int c) { if ( c <= 0 ) return; + qWarning("Iterating over cats %d", c ); for ( unsigned int i = 1; i < m_catMenu->count(); i++ ) m_catMenu->setItemChecked(i, c == (int)i ); if (c == 1 ) { m_curCat = QString::null; @@ -510,12 +510,13 @@ void MainWindow::setCategory( int c) { setCaption( tr("Todo") + " - " + tr("Unfiled") ); }else { m_curCat = m_todoMgr.categories()[c-2]; setCaption( tr("Todo") + " - " + m_curCat ); } m_catMenu->setItemChecked( c, true ); + currentView()->setShowCategory( m_curCat ); raiseCurrentView(); } void MainWindow::slotShowDeadLine( bool dead) { m_deadline = dead; currentView()->setShowDeadline( dead ); @@ -546,14 +547,13 @@ void MainWindow::slotShowDetails() { } /* * populate the Categories * Menu */ void MainWindow::populateCategories() { - if (m_todoMgr.isLoaded() ) - m_todoMgr.load(); + m_todoMgr.load(); m_catMenu->clear(); int id, rememberId; id = 1; rememberId = 1; @@ -611,12 +611,13 @@ void MainWindow::slotEdit( int uid ) { /* if completed */ if ( currentEditor()->accepted() ) { qWarning("Replacing now" ); m_todoMgr.update( todo.uid(), todo ); currentView()->replaceEvent( todo ); + /* a Category might have changed */ populateCategories(); } raiseCurrentView(); } /* |