diff -r 2d4cc445a86a -r ee6b0f3a4c2f vymview.cpp --- a/vymview.cpp Mon Mar 23 09:06:51 2009 +0000 +++ b/vymview.cpp Thu Mar 26 07:49:17 2009 +0000 @@ -35,15 +35,19 @@ selModel, SIGNAL (currentChanged(const QModelIndex &, const QModelIndex &)), me,SLOT (updateCurrent(const QModelIndex &,const QModelIndex &))); - // VymModel may want to update selection, e.g. during animation + // VymModel may want to update selection or other data, e.g. during animation connect ( model, SIGNAL (selectionChanged(const QItemSelection &, const QItemSelection &)), me,SLOT (updateSelection(const QItemSelection &,const QItemSelection &))); connect ( model, SIGNAL (newChildObject(QModelIndex) ), this,SLOT (updateChilds (QModelIndex) ) ); + connect ( + model, SIGNAL (contentHasChanged(QModelIndex) ), + mainWindow, SLOT (updateContent(QModelIndex) ) ); + - //me->viewport()->setFocus(); //FIXME needed? + //me->viewport()->setFocus(); //FIXME-3 needed? me->setAntiAlias (mainWindow->isAliased()); me->setSmoothPixmap(mainWindow->hasSmoothPixmapTransform()); @@ -72,23 +76,19 @@ treeview->setExpanded (ix,true); } -void VymView::changeSelection (const QItemSelection &, const QItemSelection &) +void VymView::changeSelection (const QItemSelection &newsel, const QItemSelection &oldsel) { - cout << "VymView::changeSelection (newsel,delsel)\n"; - //treeview->expandAll(); //FIXME only for testing + /* + cout <<"VymView::changeSelection ("; + if (!newsel.indexes().isEmpty() ) + cout << model->getItem(newsel.indexes().first() )->getHeading().toStdString(); + cout << " <- "; + if (!oldsel.indexes().isEmpty() ) + cout << model->getItem(oldsel.indexes().first() )->getHeading().toStdString(); + cout << ")\n"; + */ - // Show URL and link in statusbar - QString status; - QString s=model->getURL(); - if (!s.isEmpty() ) status+="URL: "+s+" "; - s=model->getVymLink(); - if (!s.isEmpty() ) status+="Link: "+s; - if (!status.isEmpty() ) mainWindow->statusMessage (status); - - // Update Toolbar // FIXME, was so far in BranchObj - //updateFlagsToolbar(); - - // Update actions - mainWindow->updateActions(); + // Notify mainwindow to update satellites like NoteEditor, if needed (model==currenModel...) + mainWindow->changeSelection (model,newsel,oldsel); // FIXME-3 maybe connect VymModel <-> MainWindow directly? }