2 #include "texteditor.h"
4 #include "mainwindow.h"
6 extern TextEditor *textEditor;
7 extern Main *mainWindow;
8 extern FlagRowObj *standardFlagsDefault;
9 extern QAction *actionEditOpenURL;
12 /////////////////////////////////////////////////////////////////
14 /////////////////////////////////////////////////////////////////
16 BranchObj* BranchObj::itLast=NULL;
19 BranchObj::BranchObj () :OrnamentedObj()
21 // cout << "Const BranchObj ()\n";
27 BranchObj::BranchObj (QCanvas* c):OrnamentedObj (c)
29 // cout << "Const BranchObj (c) called from MapCenterObj (c)\n";
34 BranchObj::BranchObj (QCanvas* c, LinkableMapObj* p):OrnamentedObj (c)
36 // cout << "Const BranchObj (c,p)\n";
39 depth=p->getDepth()+1;
41 // Calc angle to mapCenter if I am a mainbranch
42 // needed for reordering the mainbranches clockwise
44 angle=getAngle (QPoint ((int)(x() - parObj->getChildPos().x() ),
45 (int)(y() - parObj->getChildPos().y() ) ) );
49 BranchObj::~BranchObj ()
51 // cout << "Destr BranchObj of "<<this<<endl;
52 // Check, if this branch was the last child to be deleted
53 // If so, unset the scrolled flags
55 BranchObj *po=(BranchObj*)(parObj);
59 bo=((BranchObj*)(parObj))->getLastBranch();
60 if (!bo) po->unScroll();
65 bool BranchObj::operator< ( const BranchObj & other )
67 return angle < other.angle;
70 bool BranchObj::operator== ( const BranchObj & other )
72 return angle == other.angle;
75 int BranchObjPtrList::compareItems ( QPtrCollection::Item i, QPtrCollection::Item j)
77 // Make sure PtrList::find works
80 if ( ((BranchObj*)(i))->angle > ((BranchObj*)(j))->angle )
86 void BranchObj::init ()
88 branch.setAutoDelete (false);
89 floatimage.setAutoDelete (true);
90 link.setAutoDelete (false);
95 absPos+=parObj->getChildPos();
98 // TODO This should be done in TextObj later
99 QFont font("Sans Serif,8,-1,5,50,0,0,0,0,0");
100 heading->setFont(font );
102 lastSelectedBranch=-1;
113 void BranchObj::copy (BranchObj* other)
115 OrnamentedObj::copy(other);
119 for (b=other->branch.first(); b;b=other->branch.next() )
120 // Make deep copy of b
121 // Because addBranch again calls copy for the childs,
122 // Those will get a deep copy, too
126 for (fi=other->floatimage.first(); fi;fi=other->floatimage.next() )
129 scrolled=other->scrolled;
130 tmpUnscrolled=other->tmpUnscrolled;
131 setVisibility (other->visible);
134 vymLink=other->vymLink;
141 void BranchObj::clear()
144 while (!link.isEmpty())
145 deleteLink (link.first() );
148 while (!branch.isEmpty())
151 branch.removeFirst();
156 int BranchObj::getNum()
159 return ((BranchObj*)(parObj))->getNum ((BranchObj*)(this));
164 int BranchObj::getNum(BranchObj *bo)
166 return branch.findRef (bo);
169 int BranchObj::getFloatImageNum(FloatImageObj *fio)
171 return floatimage.findRef (fio);
174 int BranchObj::countBranches()
176 return branch.count();
179 int BranchObj::countFloatImages()
181 return floatimage.count();
184 void BranchObj::setParObjTmp(LinkableMapObj* lmo, QPoint m, int off)
186 // Temporary link to lmo
187 // m is position of mouse pointer
188 // offset 0: default 1: below lmo -1 above lmo (if possible)
191 BranchObj* o=(BranchObj*)(lmo);
195 // ignore mapcenter and mainbranch
196 if (lmo->getDepth()<2) off=0;
206 parObj=o->getParObj();
208 parObj=o->getParObj();
212 depth=parObj->getDepth()+1;
214 // setLinkStyle calls updateLink, only set it once
215 if (style!=getDefLinkStyle() ) setLinkStyle (getDefLinkStyle());
217 // Move temporary to new position at destination
218 // Usually the positioning would be done by reposition(),
219 // but then also the destination branch would "Jump" around...
220 // Better just do it approximately
222 { // new parent is the mapcenter itself
224 QPoint p= normalise ( QPoint (m.x() - o->getChildPos().x(),
225 m.y() - o->getChildPos().y() ));
226 if (p.x()<0) p.setX( p.x()-bbox.width() );
233 // new parent is just a branch, link to it
234 QRect t=o->getBBoxSizeWithChilds();
235 if (o->getLastBranch())
236 y=t.y() + t.height() ;
243 // we want to link above lmo
244 y=o->y() - height() + 5;
246 // we want to link below lmo
247 // Bottom of sel should be 5 pixels above
248 // the bottom of the branch _below_ the target:
249 // Don't try to find that branch, guess 12 pixels
250 y=o->getChildPos().y() -height() + 12;
252 if (o->getOrientation()==OrientLeftOfCenter)
253 move ( o->getChildPos().x() - linkwidth, y );
255 move (o->getChildPos().x() + linkwidth, y );
258 // updateLink is called implicitly in move
259 reposition(); // FIXME shouldn't be this a request?
262 void BranchObj::unsetParObjTmp()
269 depth=parObj->getDepth()+1;
270 setLinkStyle (getDefLinkStyle() );
274 void BranchObj::unScroll()
276 if (tmpUnscrolled) resetTmpUnscroll();
277 if (scrolled) toggleScroll();
280 void BranchObj::toggleScroll()
286 systemFlags->deactivate("scrolledright");
287 for (bo=branch.first(); bo; bo=branch.next() )
289 bo->setVisibility(true);
294 systemFlags->activate("scrolledright");
295 for (bo=branch.first(); bo; bo=branch.next() )
297 bo->setVisibility(false);
302 move (absPos.x(), absPos.y() );
306 bool BranchObj::isScrolled()
311 bool BranchObj::hasScrolledParent(BranchObj *start)
313 // Calls parents recursivly to
314 // find out, if we are scrolled at all.
315 // But ignore myself, just look at parents.
317 if (this !=start && scrolled) return true;
319 BranchObj* bo=(BranchObj*)(parObj);
321 return bo->hasScrolledParent(start);
326 void BranchObj::tmpUnscroll()
328 // Unscroll parent (recursivly)
329 BranchObj* bo=(BranchObj*)(parObj);
330 if (bo) bo->tmpUnscroll();
336 systemFlags->activate("tmpUnscrolledright");
341 void BranchObj::resetTmpUnscroll()
343 // Unscroll parent (recursivly)
344 BranchObj* bo=(BranchObj*)(parObj);
346 bo->resetTmpUnscroll();
352 systemFlags->deactivate("tmpUnscrolledright");
357 void BranchObj::setVisibility(bool v, int toDepth)
359 if (depth <= toDepth)
361 frame->setVisibility(v);
362 heading->setVisibility(v);
363 systemFlags->setVisibility(v);
364 standardFlags->setVisibility(v);
365 LinkableMapObj::setVisibility (v);
367 if (!scrolled && (depth < toDepth))
369 // Now go recursivly through all childs
371 for (b=branch.first(); b;b=branch.next() )
372 b->setVisibility (v,toDepth);
374 for (fio=floatimage.first(); fio; fio=floatimage.next())
375 fio->setVisibility (v);
377 } // depth <= toDepth
378 move (absPos.x(), absPos.y() );
382 void BranchObj::setVisibility(bool v)
384 setVisibility (v,MAX_DEPTH);
388 void BranchObj::setLinkColor ()
390 // Overloaded from LinkableMapObj
391 // BranchObj can use color of heading
393 if (mapEditor->getLinkColorHint()==HeadingColor)
394 LinkableMapObj::setLinkColor (heading->getColor() );
396 LinkableMapObj::setLinkColor ();
399 void BranchObj::setColor (QColor col, bool colorChilds)
401 heading->setColor(col);
406 for (bo=branch.first(); bo; bo=branch.next() )
407 bo->setColor(col,colorChilds);
412 BranchObj* BranchObj::first()
418 BranchObj* BranchObj::next()
421 BranchObj *bo=branch.first();
422 BranchObj *po=(BranchObj*)(parObj);
425 { // We are just beginning at the mapCenter
439 { // We come from above
442 // there are childs, go there
447 { // no childs, try to go up again
459 // can't go up, I am mapCenter
466 // Try to find last child, we came from, in my own childs
468 while (bo && searching)
470 if (itLast==bo) searching=false;
474 { // found lastLMO in my childs
477 // found a brother of lastLMO
493 // can't go up, I am mapCenter
500 // couldn't find last child, it must be a nephew of mine
504 // proceed with my first child
510 // or go back to my parents
521 // can't go up, I am mapCenter
528 BranchObj* BranchObj::getLastIterator()
533 void BranchObj::setLastIterator(BranchObj* it)
539 void BranchObj::move (double x, double y)
541 OrnamentedObj::move (x,y);
545 void BranchObj::move (QPoint p)
550 void BranchObj::moveBy (double x, double y)
552 OrnamentedObj::moveBy (x,y);
555 for (b=branch.first(); b;b=branch.next() )
559 void BranchObj::moveBy (QPoint p)
561 moveBy (p.x(), p.y());
565 void BranchObj::positionBBox()
569 QString h=getHeading();
571 cout << "BO::positionBBox("<<h<<")\n";
573 cout << "BO::positionBBox (noHeading)\n";
576 heading->positionBBox();
577 systemFlags->positionBBox();
578 standardFlags->positionBBox();
579 // It seems that setting x,y also affects width,height
580 int w_old=bbox.width();
581 int h_old=bbox.height();
582 bbox.setX (absPos.x() );
583 bbox.setY (absPos.y() );
584 bbox.setWidth(w_old);
585 bbox.setHeight(h_old);
590 frame->setRect(QRect(bbox.x(),bbox.y(),bbox.width(),bbox.height() ) );
592 // Update links to other branches
594 for (l=link.first(); l; l=link.next() )
598 void BranchObj::calcBBoxSize()
600 QSize heading_r=heading->getSize();
601 int heading_w=static_cast <int> (heading_r.width() );
602 int heading_h=static_cast <int> (heading_r.height() );
603 QSize sysflags_r=systemFlags->getSize();
604 int sysflags_h=sysflags_r.height();
605 int sysflags_w=sysflags_r.width();
606 QSize stanflags_r=standardFlags->getSize();
607 int stanflags_h=stanflags_r.height();
608 int stanflags_w=stanflags_r.width();
612 // set width to sum of all widths
613 w=heading_w + sysflags_w + stanflags_w;
614 // set height to maximum needed height
615 h=max (sysflags_h,stanflags_h);
618 w+=frame->getBorder();
619 h+=frame->getBorder();
620 bbox.setSize (QSize (w,h));
623 LinkableMapObj* BranchObj::findMapObj(QPoint p, LinkableMapObj* excludeLMO)
628 for (b=branch.first(); b; b=branch.next() )
630 lmo=b->findMapObj(p, excludeLMO);
631 if (lmo != NULL) return lmo;
635 if (inBBox (p) && (this != excludeLMO) && isVisibleObj() )
638 // Search float images
640 for (foi=floatimage.first(); foi; foi=floatimage.next() )
641 if (foi->inBBox(p) && (foi != excludeLMO) && foi->getParObj()!= excludeLMO) return foi;
646 void BranchObj::setHeading(QString s)
648 // Adjusting font size
649 QFont font=heading->getFont();
651 font.setPointSize(16);
654 font.setPointSize(10);
656 font.setPointSize(12);
657 heading->setFont(font);
658 heading->setText(s); // set new heading
659 calcBBoxSize(); // recalculate bbox
660 positionBBox(); // rearrange contents
664 void BranchObj::setURL(QString s)
668 systemFlags->activate("url");
670 systemFlags->deactivate("url");
671 calcBBoxSize(); // recalculate bbox
672 positionBBox(); // rearrange contents
676 QString BranchObj::getURL()
681 void BranchObj::setVymLink(QString s)
685 // We need the relative (from loading)
686 // or absolute path (from User event)
687 // and build the absolute path.
688 // Note: If we have relative, use path of
689 // current map to build absolute path
691 if (!d.path().startsWith ("/"))
693 QString p=mapEditor->getDestPath();
694 int i=p.findRev("/",-1);
695 d.setPath(p.left(i)+"/"+s);
699 systemFlags->activate("vymLink");
703 systemFlags->deactivate("vymLink");
706 calcBBoxSize(); // recalculate bbox
707 positionBBox(); // rearrange contents
711 QString BranchObj::getVymLink()
716 QString BranchObj::saveToDir (const QString &tmpdir,const QString &prefix, const QPoint& offset)
719 QString scrolledAttr;
721 scrolledAttr=attribut ("scrolled","yes");
726 if (depth<2) posAttr=
727 attribut("absPosX",QString().setNum(absPos.x(),10)) +
728 attribut("absPosY",QString().setNum(absPos.y(),10));
734 urlAttr=attribut ("url",url);
737 if (!vymLink.isEmpty())
738 vymLinkAttr=attribut ("vymLink",convertToRel(mapEditor->getDestPath(),vymLink) );
741 if (frame->getFrameType()!=NoFrame)
742 frameAttr=attribut ("frameType",frame->getFrameTypeName());
746 // save area, if not scrolled
748 if (!((BranchObj*)(parObj))->isScrolled() )
751 attribut("x1",QString().setNum(absPos.x()-offset.x(),10)) +
752 attribut("y1",QString().setNum(absPos.y()-offset.y(),10)) +
753 attribut("x2",QString().setNum(absPos.x()+width()-offset.x(),10)) +
754 attribut("y2",QString().setNum(absPos.y()+height()-offset.y(),10));
759 s=beginElement ("branch" +scrolledAttr +posAttr +urlAttr +vymLinkAttr +frameAttr +areaAttr);
763 s=s+valueElement("heading", getHeading(),
764 attribut ("textColor",QColor(heading->getColor()).name()));
766 // save names of flags set
767 s+=standardFlags->saveToDir(tmpdir,prefix,0);
770 if (!note.isEmpty() )
775 for (bo=branch.first(); bo; bo=branch.next() )
776 s+=bo->saveToDir(tmpdir,prefix,offset);
781 for (fio=floatimage.first(); fio; fio=floatimage.next() )
782 s+=fio->saveToDir (tmpdir,prefix);
784 s+=endElement ("branch");
788 void BranchObj::addLink (LinkObj *lo)
794 void BranchObj::removeLink (LinkObj *lo)
799 void BranchObj::deleteLink(LinkObj *lo)
802 if (!lo->isUsed()) delete (lo);
805 int BranchObj::countLink()
810 LinkableMapObj* BranchObj::addFloatImage ()
812 FloatImageObj *newfi=new FloatImageObj (canvas,this);
813 floatimage.append (newfi);
814 if (hasScrolledParent(this) )
815 newfi->setVisibility (false);
817 newfi->setVisibility(visible);
822 LinkableMapObj* BranchObj::addFloatImage (FloatImageObj *fio)
824 FloatImageObj *newfi=new FloatImageObj (canvas,this);
825 floatimage.append (newfi);
827 if (hasScrolledParent(this) )
828 newfi->setVisibility (false);
830 newfi->setVisibility(visible);
835 FloatImageObj* BranchObj::getFirstFloatImage ()
837 return floatimage.first();
840 FloatImageObj* BranchObj::getLastFloatImage ()
842 return floatimage.last();
845 FloatImageObj* BranchObj::getFloatImageNum (const uint &i)
847 return floatimage.at(i);
850 void BranchObj::removeFloatImage (FloatImageObj *fio)
852 floatimage.remove (fio);
856 void BranchObj::savePosInAngle ()
858 // Save position in angle
861 for (b=branch.first(); b; b=branch.next() )
868 BranchObj* BranchObj::addBranch()
870 BranchObj* newbo=new BranchObj(canvas,this);
871 branch.append (newbo);
872 newbo->setParObj(this);
873 newbo->setColor(getColor(),false);
874 newbo->setLinkColor();
875 newbo->setHeading ("new");
876 newbo->setLinkStyle (newbo->getDefLinkStyle());
878 newbo->setVisibility (false);
880 newbo->setVisibility(visible);
885 BranchObj* BranchObj::addBranch(BranchObj* bo)
887 BranchObj* newbo=new BranchObj(canvas,this);
888 branch.append (newbo);
890 newbo->setParObj(this);
891 newbo->setHeading (newbo->getHeading()); // adjust fontsize to depth
892 newbo->setLinkStyle (newbo->getDefLinkStyle());
894 newbo->setVisibility (false);
896 newbo->setVisibility(bo->visible);
901 BranchObj* BranchObj::addBranchPtr(BranchObj* bo)
904 bo->setParObj (this);
906 bo->setLinkStyle (bo->getDefLinkStyle() );
907 if (scrolled) tmpUnscroll();
908 setLastSelectedBranch (bo);
912 BranchObj* BranchObj::insertBranch(int pos)
915 // Add new bo and resort branches
916 BranchObj *newbo=addBranch ();
917 newbo->angle=pos-0.5;
922 BranchObj* BranchObj::insertBranch(BranchObj* bo, int pos)
925 // Add new bo and resort branches
927 BranchObj *newbo=addBranch (bo);
932 BranchObj* BranchObj::insertBranchPtr (BranchObj* bo, int pos)
935 // Add new bo and resort branches
938 bo->setParObj (this);
940 bo->setLinkStyle (bo->getDefLinkStyle() );
941 if (scrolled) tmpUnscroll();
942 setLastSelectedBranch (bo);
947 void BranchObj::removeBranch(BranchObj* bo)
949 // if bo is not in branch remove returns false, we
952 if (branch.remove (bo))
955 qWarning ("BranchObj::removeBranch tried to remove non existing branch?!\n");
959 void BranchObj::removeBranchPtr(BranchObj* bo)
965 void BranchObj::setLastSelectedBranch (BranchObj* bo)
967 lastSelectedBranch=branch.find(bo);
970 BranchObj* BranchObj::getLastSelectedBranch ()
972 if (lastSelectedBranch>=0)
974 BranchObj* bo=branch.at(lastSelectedBranch);
977 return branch.first();
980 BranchObj* BranchObj::getFirstBranch ()
982 return branch.first();
985 BranchObj* BranchObj::getLastBranch ()
987 return branch.last();
990 BranchObj* BranchObj::getBranchNum (const uint &i)
996 BranchObj* BranchObj::moveBranchUp(BranchObj* bo1) // move a branch up (modify myself)
999 int i=branch.find(bo1);
1001 { // -1 if bo1 not found
1002 branch.at(i)->angle--;
1003 branch.at(i-1)->angle++;
1005 return branch.at(i-1);
1007 return branch.at(i);
1010 BranchObj* BranchObj::moveBranchDown(BranchObj* bo1)
1013 int i=branch.find(bo1);
1018 branch.at(i)->angle++;
1019 branch.at(j)->angle--;
1021 return branch.at(j);
1023 return branch.at(i);
1026 BranchObj* BranchObj::moveBranchTo (BranchObj* dst, int pos)
1028 // Find current parent and
1029 // remove pointer to myself there
1030 BranchObj *par=(BranchObj*)(parObj);
1032 par->removeBranchPtr (this);
1038 // links adds myself as last branch at dst
1039 dst->addBranchPtr (this);
1043 // inserts me at pos in parent of dst
1044 par=(BranchObj*)(dst->getParObj());
1046 return par->insertBranchPtr (this,pos);
1052 void BranchObj::alignRelativeTo (QPoint ref)
1055 if (!getHeading().isEmpty())
1056 cout << "BO::alignRelTo "<<getHeading()<<endl;
1058 cout << "BO::alignRelTo ???"<<endl;
1059 cout << " d="<<depth<<endl;
1061 int th = bboxTotal.height();
1063 // If I am the mapcenter or a mainbranch, reposition heading
1066 move (absPos.x(),absPos.y());
1069 // Calc angle to mapCenter if I am a mainbranch
1070 // needed for reordering the mainbranches clockwise
1072 angle=getAngle (QPoint ((int)(x() - parObj->getChildPos().x() ),
1073 (int)(y() - parObj->getChildPos().y() ) ) );
1078 // Align myself depending on orientation and parent, but
1079 // only if I am not the mainbranch or mapcenter itself
1080 switch (orientation)
1082 case OrientLeftOfCenter:
1083 move (ref.x()-bbox.width(), ref.y() + (th-bbox.height())/2 );
1085 case OrientRightOfCenter:
1086 move (ref.x(), ref.y() + (th-bbox.height())/2 );
1089 cout <<"LMO::alignRelativeTo: oops, no orientation given...\n";
1095 for (fio=floatimage.first(); fio; fio=floatimage.next() )
1098 if (scrolled) return;
1100 // Set reference point for alignment of childs
1102 if (orientation==OrientLeftOfCenter)
1103 ref2.setX(childPos.x() - linkwidth);
1105 ref2.setX(childPos.x() + linkwidth);
1108 ref2.setY(absPos.y()-(bboxTotal.height()-bbox.height())/2);
1110 ref2.setY(ref.y() );
1112 // Align the childs depending on reference point
1114 for (b=branch.first(); b; b=branch.next() )
1116 b->alignRelativeTo (ref2);
1117 ref2.setY(ref2.y() + b->getBBoxSizeWithChilds().height() );
1122 void BranchObj::reposition()
1125 if (!getHeading().isEmpty())
1126 cout << "BO::reposition "<<getHeading()<<endl;
1128 cout << "BO::reposition ???"<<endl;
1132 // only calculate the sizes once. If the deepest LMO
1133 // changes its height,
1134 // all upper LMOs have to change, too.
1135 calcBBoxSizeWithChilds();
1136 alignRelativeTo ( QPoint (absPos.x(),
1137 absPos.y()-(bboxTotal.height()-bbox.height())/2) );
1141 // This is only important for moving branches:
1142 // For editing a branch it isn't called...
1143 alignRelativeTo ( QPoint (absPos.x(),
1144 absPos.y()-(bboxTotal.height()-bbox.height())/2) );
1149 QRect BranchObj::getTotalBBox()
1153 if (scrolled) return r;
1156 for (b=branch.first();b ;b=branch.next() )
1157 r=addBBox(b->getTotalBBox(),r);
1160 for (fio=floatimage.first();fio ;fio=floatimage.next() )
1161 r=addBBox(fio->getTotalBBox(),r);
1166 QRect BranchObj::getBBoxSizeWithChilds()
1171 void BranchObj::calcBBoxSizeWithChilds()
1173 // This is called only from reposition and
1174 // and only for mapcenter. So it won't be
1175 // called more than once for a single user
1178 // Calculate size of LMO including all childs (to align them later)
1180 bboxTotal.setX(bbox.x() );
1181 bboxTotal.setY(bbox.y() );
1183 // if branch is scrolled, ignore childs, but still consider floatimages
1186 bboxTotal.setWidth (bbox.width());
1187 bboxTotal.setHeight(bbox.height());
1193 // Now calculate recursivly
1195 // maximum of widths
1198 for (b=branch.first();b ;b=branch.next() )
1200 b->calcBBoxSizeWithChilds();
1201 br=b->getBBoxSizeWithChilds();
1202 r.setWidth( max (br.width(), r.width() ));
1203 r.setHeight(br.height() + r.height() );
1204 if (br.y()<bboxTotal.y()) bboxTotal.setY(br.y());
1206 // Add myself and also
1207 // add width of link to sum if necessary
1208 if (branch.isEmpty())
1209 bboxTotal.setWidth (bbox.width() + r.width() );
1211 bboxTotal.setWidth (bbox.width() + r.width() + linkwidth);
1212 bboxTotal.setHeight(max (r.height(), bbox.height() ) );
1213 // frame->setRect(QRect(bbox.x(),bbox.y(),bbox.width(),bbox.height() ) );
1216 void BranchObj::select()
1218 LinkableMapObj::select();
1219 // Tell parent that I am selected now:
1220 BranchObj* po=(BranchObj*)(parObj);
1221 if (po) // TODO Try to get rid of this cast...
1222 po->setLastSelectedBranch(this);
1224 // temporary unscroll, if we have scrolled parents somewhere
1225 if (parObj) ((BranchObj*)(parObj))->tmpUnscroll();
1227 // set Text in Editor
1228 textEditor->setText(note.getNote() );
1229 textEditor->setFilename(note.getFilenameHint() );
1230 textEditor->setFontHint (note.getFontHint() );
1231 connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag() ) );
1232 connect (textEditor, SIGNAL (fontSizeHasChanged() ), this, SLOT (updateNoteFlag() ) );
1234 // Show URL and link in statusbar
1236 if (!url.isEmpty()) status+="URL: "+url+" ";
1237 if (!vymLink.isEmpty()) status+="Link: "+vymLink;
1238 if (!status.isEmpty()) mainWindow->statusMessage (status);
1241 standardFlags->updateToolBar();
1243 // Update Browserbutton
1245 actionEditOpenURL->setEnabled (true);
1247 actionEditOpenURL->setEnabled (false);
1249 // Update actions in mapeditor
1250 mapEditor->updateActions();
1253 void BranchObj::unselect()
1255 LinkableMapObj::unselect();
1256 // Delete any messages like vymLink in StatusBar
1257 mainWindow->statusMessage ("");
1259 // save note from editor and set flag
1260 // text is done by updateNoteFlag(), just save
1262 note.setFilenameHint (textEditor->getFilename());
1264 // reset temporary unscroll, if we have scrolled parents somewhere
1265 if (parObj) ((BranchObj*)(parObj))->resetTmpUnscroll();
1267 // Disconnect textEditor from this LMO
1268 disconnect( textEditor, SIGNAL(textHasChanged()), 0, 0 );
1269 disconnect( textEditor, SIGNAL (fontSizeHasChanged()),0,0 );
1271 // Erase content of editor
1272 textEditor->setInactive();
1274 // unselect all buttons in toolbar
1275 standardFlagsDefault->updateToolBar();
1278 QString BranchObj::getSelectString()
1283 if (parObj->getDepth()==0)
1284 s= "bo:" + QString("%1").arg(getNum());
1286 s= ((BranchObj*)(parObj))->getSelectString() + ",bo:" + QString("%1").arg(getNum());