1.1 --- a/vymview.cpp Mon Mar 23 09:06:51 2009 +0000
1.2 +++ b/vymview.cpp Thu Mar 26 07:49:17 2009 +0000
1.3 @@ -35,15 +35,19 @@
1.4 selModel, SIGNAL (currentChanged(const QModelIndex &, const QModelIndex &)),
1.5 me,SLOT (updateCurrent(const QModelIndex &,const QModelIndex &)));
1.6
1.7 - // VymModel may want to update selection, e.g. during animation
1.8 + // VymModel may want to update selection or other data, e.g. during animation
1.9 connect (
1.10 model, SIGNAL (selectionChanged(const QItemSelection &, const QItemSelection &)),
1.11 me,SLOT (updateSelection(const QItemSelection &,const QItemSelection &)));
1.12 connect (
1.13 model, SIGNAL (newChildObject(QModelIndex) ),
1.14 this,SLOT (updateChilds (QModelIndex) ) );
1.15 + connect (
1.16 + model, SIGNAL (contentHasChanged(QModelIndex) ),
1.17 + mainWindow, SLOT (updateContent(QModelIndex) ) );
1.18 +
1.19
1.20 - //me->viewport()->setFocus(); //FIXME needed?
1.21 + //me->viewport()->setFocus(); //FIXME-3 needed?
1.22 me->setAntiAlias (mainWindow->isAliased());
1.23 me->setSmoothPixmap(mainWindow->hasSmoothPixmapTransform());
1.24
1.25 @@ -72,23 +76,19 @@
1.26 treeview->setExpanded (ix,true);
1.27 }
1.28
1.29 -void VymView::changeSelection (const QItemSelection &, const QItemSelection &)
1.30 +void VymView::changeSelection (const QItemSelection &newsel, const QItemSelection &oldsel)
1.31 {
1.32 - cout << "VymView::changeSelection (newsel,delsel)\n";
1.33 - //treeview->expandAll(); //FIXME only for testing
1.34 + /*
1.35 + cout <<"VymView::changeSelection (";
1.36 + if (!newsel.indexes().isEmpty() )
1.37 + cout << model->getItem(newsel.indexes().first() )->getHeading().toStdString();
1.38 + cout << " <- ";
1.39 + if (!oldsel.indexes().isEmpty() )
1.40 + cout << model->getItem(oldsel.indexes().first() )->getHeading().toStdString();
1.41 + cout << ")\n";
1.42 + */
1.43
1.44 - // Show URL and link in statusbar
1.45 - QString status;
1.46 - QString s=model->getURL();
1.47 - if (!s.isEmpty() ) status+="URL: "+s+" ";
1.48 - s=model->getVymLink();
1.49 - if (!s.isEmpty() ) status+="Link: "+s;
1.50 - if (!status.isEmpty() ) mainWindow->statusMessage (status);
1.51 -
1.52 - // Update Toolbar // FIXME, was so far in BranchObj
1.53 - //updateFlagsToolbar();
1.54 -
1.55 - // Update actions
1.56 - mainWindow->updateActions();
1.57 + // Notify mainwindow to update satellites like NoteEditor, if needed (model==currenModel...)
1.58 + mainWindow->changeSelection (model,newsel,oldsel); // FIXME-3 maybe connect VymModel <-> MainWindow directly?
1.59 }
1.60