1.1 --- a/vymmodel.cpp Mon Mar 15 15:32:37 2010 +0000
1.2 +++ b/vymmodel.cpp Thu Mar 18 11:31:02 2010 +0000
1.3 @@ -139,6 +139,7 @@
1.4 linkstyle=LinkableMapObj::PolyParabel;
1.5 defXLinkWidth=1;
1.6 defXLinkColor=QColor (230,230,230);
1.7 + zoomFactor=1;
1.8
1.9 hidemode=TreeItem::HideNone;
1.10
1.11 @@ -226,6 +227,7 @@
1.12 xml.attribut("linkColor", defLinkColor.name() ) +
1.13 xml.attribut("defXLinkColor", defXLinkColor.name() ) +
1.14 xml.attribut("defXLinkWidth", QString().setNum(defXLinkWidth,10) ) +
1.15 + xml.attribut("mapZoomFactor", QString().setNum(mapEditor->getZoomFactorTarget()) ) +
1.16 colhint;
1.17 s+=xml.beginElement("vymmap",mapAttr);
1.18 xml.incIndent();
1.19 @@ -499,6 +501,8 @@
1.20 zipped=zipped_org;
1.21
1.22 updateActions();
1.23 +
1.24 + if (mapEditor) mapEditor->setZoomFactorTarget (zoomFactor);
1.25 return err;
1.26 }
1.27
1.28 @@ -1646,7 +1650,6 @@
1.29 void VymModel::findAll (FindResultModel *rmodel, QString s, Qt::CaseSensitivity cs)
1.30 {
1.31 rmodel->clear();
1.32 - int i=0;
1.33 BranchItem *cur=NULL;
1.34 BranchItem *prev=NULL;
1.35 nextBranch(cur,prev);
1.36 @@ -1656,12 +1659,15 @@
1.37 {
1.38 rmodel->addItem (cur);
1.39 }
1.40 - //if (cur->getNote().contains (s,cs)) //FIXME-2 does not detect multiple occurences yet
1.41 + int i=0;
1.42 while (i>=0)
1.43 {
1.44 - i=cur->getNote().indexOf (s,i,cs);
1.45 - if (i>=0) i++;
1.46 - //qDebug()<<"i="<<i;
1.47 + i=cur->getNote().indexOf (s,i,cs); //FIXME-2 add subitems to rmodel
1.48 + if (i>=0)
1.49 + {
1.50 + rmodel->addSubItem (cur,"Note",cur,i);
1.51 + i++;
1.52 + }
1.53 }
1.54 nextBranch(cur,prev);
1.55 }
1.56 @@ -2284,7 +2290,7 @@
1.57 QString ("addMapCenter (%1,%2)").arg (contextPos.x()).arg(contextPos.y()),
1.58 QString ("Adding MapCenter to (%1,%2)").arg (contextPos.x()).arg(contextPos.y())
1.59 );
1.60 - mapEditor->autoLayout(); //FIXME-3 testing
1.61 + emitUpdateLayout();
1.62 return bi;
1.63 }
1.64
1.65 @@ -4413,6 +4419,11 @@
1.66 mapEditor=NULL;
1.67 }
1.68
1.69 +void VymModel::setMapZoomFactor (const double &d)
1.70 +{
1.71 + zoomFactor=d;
1.72 +}
1.73 +
1.74 void VymModel::setContextPos(QPointF p)
1.75 {
1.76 contextPos=p;
1.77 @@ -5097,6 +5108,11 @@
1.78 emit (dataChanged (ix,ix) );
1.79 }
1.80
1.81 +void VymModel::emitUpdateLayout()
1.82 +{
1.83 + if (settings.value("/mainwindow/autoLayout/use","true")=="true")
1.84 + emit (updateLayout());
1.85 +}
1.86
1.87 bool VymModel::selectFirstBranch()
1.88 {