added modifier modes (color,link,copy). Not fully functional yet
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 int BranchObj::countLinks()
189 void BranchObj::setParObjTmp(LinkableMapObj* lmo, QPoint m, int off)
191 // Temporary link to lmo
192 // m is position of mouse pointer
193 // offset 0: default 1: below lmo -1 above lmo (if possible)
196 BranchObj* o=(BranchObj*)(lmo);
200 // ignore mapcenter and mainbranch
201 if (lmo->getDepth()<2) off=0;
211 // parObj=o->getParObj();
213 // parObj=o->getParObj();
218 depth=parObj->getDepth()+1;
220 // setLinkStyle calls updateLink, only set it once
221 if (style!=getDefLinkStyle() ) setLinkStyle (getDefLinkStyle());
223 // Move temporary to new position at destination
224 // Usually the positioning would be done by reposition(),
225 // but then also the destination branch would "Jump" around...
226 // Better just do it approximately
228 { // new parent is the mapcenter itself
230 QPoint p= normalise ( QPoint (m.x() - o->getChildPos().x(),
231 m.y() - o->getChildPos().y() ));
232 if (p.x()<0) p.setX( p.x()-bbox.width() );
239 // new parent is just a branch, link to it
240 QRect t=o->getBBoxSizeWithChilds();
241 if (o->getLastBranch())
242 y=t.y() + t.height() ;
249 // we want to link above lmo
250 y=o->y() - height() + 5;
252 // we want to link below lmo
253 // Bottom of sel should be 5 pixels above
254 // the bottom of the branch _below_ the target:
255 // Don't try to find that branch, guess 12 pixels
256 y=o->getChildPos().y() -height() + 12;
258 if (o->getOrientation()==OrientLeftOfCenter)
259 move ( o->getChildPos().x() - linkwidth, y );
261 move (o->getChildPos().x() + linkwidth, y );
264 // updateLink is called implicitly in move
265 reposition(); // FIXME shouldn't be this a request?
268 void BranchObj::unsetParObjTmp()
275 depth=parObj->getDepth()+1;
276 setLinkStyle (getDefLinkStyle() );
281 void BranchObj::unScroll()
283 if (tmpUnscrolled) resetTmpUnscroll();
284 if (scrolled) toggleScroll();
287 void BranchObj::toggleScroll()
293 systemFlags->deactivate("scrolledright");
294 for (bo=branch.first(); bo; bo=branch.next() )
296 bo->setVisibility(true);
301 systemFlags->activate("scrolledright");
302 for (bo=branch.first(); bo; bo=branch.next() )
304 bo->setVisibility(false);
309 move (absPos.x(), absPos.y() );
313 bool BranchObj::isScrolled()
318 bool BranchObj::hasScrolledParent(BranchObj *start)
320 // Calls parents recursivly to
321 // find out, if we are scrolled at all.
322 // But ignore myself, just look at parents.
324 if (this !=start && scrolled) return true;
326 BranchObj* bo=(BranchObj*)(parObj);
328 return bo->hasScrolledParent(start);
333 void BranchObj::tmpUnscroll()
335 // Unscroll parent (recursivly)
336 BranchObj* bo=(BranchObj*)(parObj);
337 if (bo) bo->tmpUnscroll();
343 systemFlags->activate("tmpUnscrolledright");
348 void BranchObj::resetTmpUnscroll()
350 // Unscroll parent (recursivly)
351 BranchObj* bo=(BranchObj*)(parObj);
353 bo->resetTmpUnscroll();
359 systemFlags->deactivate("tmpUnscrolledright");
364 void BranchObj::setVisibility(bool v, int toDepth)
366 if (depth <= toDepth)
368 frame->setVisibility(v);
369 heading->setVisibility(v);
370 systemFlags->setVisibility(v);
371 standardFlags->setVisibility(v);
372 LinkableMapObj::setVisibility (v);
374 if (!scrolled && (depth < toDepth))
376 // Now go recursivly through all childs
378 for (b=branch.first(); b;b=branch.next() )
379 b->setVisibility (v,toDepth);
381 for (fio=floatimage.first(); fio; fio=floatimage.next())
382 fio->setVisibility (v);
384 } // depth <= toDepth
385 //FIXME move (absPos.x(), absPos.y() );
389 void BranchObj::setVisibility(bool v)
391 setVisibility (v,MAX_DEPTH);
395 void BranchObj::setLinkColor ()
397 // Overloaded from LinkableMapObj
398 // BranchObj can use color of heading
400 if (mapEditor->getLinkColorHint()==HeadingColor)
401 LinkableMapObj::setLinkColor (heading->getColor() );
403 LinkableMapObj::setLinkColor ();
406 void BranchObj::setColor (QColor col, bool colorChilds)
408 heading->setColor(col);
413 for (bo=branch.first(); bo; bo=branch.next() )
414 bo->setColor(col,colorChilds);
419 BranchObj* BranchObj::first()
425 BranchObj* BranchObj::next()
428 BranchObj *bo=branch.first();
429 BranchObj *po=(BranchObj*)(parObj);
432 { // We are just beginning at the mapCenter
446 { // We come from above
449 // there are childs, go there
454 { // no childs, try to go up again
466 // can't go up, I am mapCenter
473 // Try to find last child, we came from, in my own childs
475 while (bo && searching)
477 if (itLast==bo) searching=false;
481 { // found lastLMO in my childs
484 // found a brother of lastLMO
500 // can't go up, I am mapCenter
507 // couldn't find last child, it must be a nephew of mine
511 // proceed with my first child
517 // or go back to my parents
528 // can't go up, I am mapCenter
535 BranchObj* BranchObj::getLastIterator()
540 void BranchObj::setLastIterator(BranchObj* it)
546 void BranchObj::move (double x, double y)
548 OrnamentedObj::move (x,y);
552 void BranchObj::move (QPoint p)
557 void BranchObj::moveBy (double x, double y)
559 OrnamentedObj::moveBy (x,y);
562 for (b=branch.first(); b;b=branch.next() )
566 void BranchObj::moveBy (QPoint p)
568 moveBy (p.x(), p.y());
572 void BranchObj::positionBBox()
574 // FIXME testing (optimization)
576 QString h=getHeading();
578 cout << "BO::positionBBox("<<h<<")\n";
580 cout << "BO::positionBBox (noHeading)\n";
583 heading->positionBBox();
584 systemFlags->positionBBox();
585 standardFlags->positionBBox();
586 // It seems that setting x,y also affects width,height
587 int w_old=bbox.width();
588 int h_old=bbox.height();
589 bbox.setX (absPos.x() );
590 bbox.setY (absPos.y() );
591 bbox.setWidth(w_old);
592 bbox.setHeight(h_old);
597 frame->setRect(QRect(bbox.x(),bbox.y(),bbox.width(),bbox.height() ) );
599 // Update links to other branches
601 for (l=link.first(); l; l=link.next() )
605 void BranchObj::calcBBoxSize()
607 QSize heading_r=heading->getSize();
608 int heading_w=static_cast <int> (heading_r.width() );
609 int heading_h=static_cast <int> (heading_r.height() );
610 QSize sysflags_r=systemFlags->getSize();
611 int sysflags_h=sysflags_r.height();
612 int sysflags_w=sysflags_r.width();
613 QSize stanflags_r=standardFlags->getSize();
614 int stanflags_h=stanflags_r.height();
615 int stanflags_w=stanflags_r.width();
619 // set width to sum of all widths
620 w=heading_w + sysflags_w + stanflags_w;
621 // set height to maximum needed height
622 h=max (sysflags_h,stanflags_h);
625 w+=frame->getBorder();
626 h+=frame->getBorder();
627 bbox.setSize (QSize (w,h));
630 LinkableMapObj* BranchObj::findMapObj(QPoint p, LinkableMapObj* excludeLMO)
635 for (b=branch.first(); b; b=branch.next() )
637 lmo=b->findMapObj(p, excludeLMO);
638 if (lmo != NULL) return lmo;
642 if (inBBox (p) && (this != excludeLMO) && isVisibleObj() )
645 // Search float images
647 for (foi=floatimage.first(); foi; foi=floatimage.next() )
648 if (foi->inBBox(p) && (foi != excludeLMO) && foi->getParObj()!= excludeLMO) return foi;
653 void BranchObj::setHeading(QString s)
655 // Adjusting font size
656 QFont font=heading->getFont();
658 font.setPointSize(16);
661 font.setPointSize(10);
663 font.setPointSize(12);
664 heading->setFont(font);
665 heading->setText(s); // set new heading
666 calcBBoxSize(); // recalculate bbox
667 positionBBox(); // rearrange contents
671 void BranchObj::setURL(QString s)
675 systemFlags->activate("url");
677 systemFlags->deactivate("url");
678 calcBBoxSize(); // recalculate bbox
679 positionBBox(); // rearrange contents
683 QString BranchObj::getURL()
688 void BranchObj::setVymLink(QString s)
692 // We need the relative (from loading)
693 // or absolute path (from User event)
694 // and build the absolute path.
695 // Note: If we have relative, use path of
696 // current map to build absolute path
698 if (!d.path().startsWith ("/"))
700 QString p=mapEditor->getDestPath();
701 int i=p.findRev("/",-1);
702 d.setPath(p.left(i)+"/"+s);
706 systemFlags->activate("vymLink");
710 systemFlags->deactivate("vymLink");
713 calcBBoxSize(); // recalculate bbox
714 positionBBox(); // rearrange contents
718 QString BranchObj::getVymLink()
723 QString BranchObj::saveToDir (const QString &tmpdir,const QString &prefix, const QPoint& offset)
726 QString scrolledAttr;
728 scrolledAttr=attribut ("scrolled","yes");
733 if (depth<2) posAttr=
734 attribut("absPosX",QString().setNum(absPos.x(),10)) +
735 attribut("absPosY",QString().setNum(absPos.y(),10));
741 urlAttr=attribut ("url",url);
744 if (!vymLink.isEmpty())
745 vymLinkAttr=attribut ("vymLink",convertToRel(mapEditor->getDestPath(),vymLink) );
748 if (frame->getFrameType()!=NoFrame)
749 frameAttr=attribut ("frameType",frame->getFrameTypeName());
753 // save area, if not scrolled
755 if (!((BranchObj*)(parObj))->isScrolled() )
758 attribut("x1",QString().setNum(absPos.x()-offset.x(),10)) +
759 attribut("y1",QString().setNum(absPos.y()-offset.y(),10)) +
760 attribut("x2",QString().setNum(absPos.x()+width()-offset.x(),10)) +
761 attribut("y2",QString().setNum(absPos.y()+height()-offset.y(),10));
766 s=beginElement ("branch" +scrolledAttr +posAttr +urlAttr +vymLinkAttr +frameAttr +areaAttr );
770 s=s+valueElement("heading", getHeading(),
771 attribut ("textColor",QColor(heading->getColor()).name()));
773 // save names of flags set
774 s+=standardFlags->saveToDir(tmpdir,prefix,0);
777 if (!note.isEmpty() )
782 for (bo=branch.first(); bo; bo=branch.next() )
783 s+=bo->saveToDir(tmpdir,prefix,offset);
788 for (fio=floatimage.first(); fio; fio=floatimage.next() )
789 s+=fio->saveToDir (tmpdir,prefix);
791 s+=endElement ("branch");
795 void BranchObj::addLink (LinkObj *lo)
801 void BranchObj::removeLink (LinkObj *lo)
806 void BranchObj::deleteLink(LinkObj *lo)
809 if (!lo->isUsed()) delete (lo);
812 int BranchObj::countLink()
817 BranchObj* BranchObj::linkTargetAt (int i)
820 return link.at(i)->otherBranch (this);
825 LinkableMapObj* BranchObj::addFloatImage ()
827 FloatImageObj *newfi=new FloatImageObj (canvas,this);
828 floatimage.append (newfi);
829 if (hasScrolledParent(this) )
830 newfi->setVisibility (false);
832 newfi->setVisibility(visible);
837 LinkableMapObj* BranchObj::addFloatImage (FloatImageObj *fio)
839 FloatImageObj *newfi=new FloatImageObj (canvas,this);
840 floatimage.append (newfi);
842 if (hasScrolledParent(this) )
843 newfi->setVisibility (false);
845 newfi->setVisibility(visible);
850 FloatImageObj* BranchObj::getFirstFloatImage ()
852 return floatimage.first();
855 FloatImageObj* BranchObj::getLastFloatImage ()
857 return floatimage.last();
860 FloatImageObj* BranchObj::getFloatImageNum (const uint &i)
862 return floatimage.at(i);
865 void BranchObj::removeFloatImage (FloatImageObj *fio)
867 floatimage.remove (fio);
871 void BranchObj::savePosInAngle ()
873 // Save position in angle
876 for (b=branch.first(); b; b=branch.next() )
883 BranchObj* BranchObj::addBranch()
885 BranchObj* newbo=new BranchObj(canvas,this);
886 branch.append (newbo);
887 newbo->setParObj(this);
888 newbo->setColor(getColor(),false);
889 newbo->setLinkColor();
890 newbo->setHeading ("new");
891 newbo->setLinkStyle (newbo->getDefLinkStyle());
893 newbo->setVisibility (false);
895 newbo->setVisibility(visible);
901 BranchObj* BranchObj::addBranch(BranchObj* bo)
903 BranchObj* newbo=new BranchObj(canvas,this);
904 branch.append (newbo);
906 newbo->setParObj(this);
907 newbo->setHeading (newbo->getHeading()); // adjust fontsize to depth
908 newbo->setLinkStyle (newbo->getDefLinkStyle());
910 newbo->setVisibility (false);
912 newbo->setVisibility(bo->visible);
918 BranchObj* BranchObj::addBranchPtr(BranchObj* bo)
921 bo->setParObj (this);
923 bo->setLinkStyle (bo->getDefLinkStyle() );
924 if (scrolled) tmpUnscroll();
925 setLastSelectedBranch (bo);
929 BranchObj* BranchObj::insertBranch(int pos)
932 // Add new bo and resort branches
933 BranchObj *newbo=addBranch ();
934 newbo->angle=pos-0.5;
939 BranchObj* BranchObj::insertBranch(BranchObj* bo, int pos)
942 // Add new bo and resort branches
944 BranchObj *newbo=addBranch (bo);
949 BranchObj* BranchObj::insertBranchPtr (BranchObj* bo, int pos)
952 // Add new bo and resort branches
955 bo->setParObj (this);
957 bo->setLinkStyle (bo->getDefLinkStyle() );
958 if (scrolled) tmpUnscroll();
959 setLastSelectedBranch (bo);
964 void BranchObj::removeBranch(BranchObj* bo)
966 // if bo is not in branch remove returns false, we
969 if (branch.remove (bo))
972 qWarning ("BranchObj::removeBranch tried to remove non existing branch?!\n");
976 void BranchObj::removeBranchPtr(BranchObj* bo)
982 void BranchObj::setLastSelectedBranch (BranchObj* bo)
984 lastSelectedBranch=branch.find(bo);
987 BranchObj* BranchObj::getLastSelectedBranch ()
989 if (lastSelectedBranch>=0)
991 BranchObj* bo=branch.at(lastSelectedBranch);
994 return branch.first();
997 BranchObj* BranchObj::getFirstBranch ()
999 return branch.first();
1002 BranchObj* BranchObj::getLastBranch ()
1004 return branch.last();
1007 BranchObj* BranchObj::getBranchNum (const uint &i)
1009 return branch.at(i);
1013 BranchObj* BranchObj::moveBranchUp(BranchObj* bo1) // move a branch up (modify myself)
1016 int i=branch.find(bo1);
1018 { // -1 if bo1 not found
1019 branch.at(i)->angle--;
1020 branch.at(i-1)->angle++;
1022 return branch.at(i-1);
1024 return branch.at(i);
1027 BranchObj* BranchObj::moveBranchDown(BranchObj* bo1)
1030 int i=branch.find(bo1);
1035 branch.at(i)->angle++;
1036 branch.at(j)->angle--;
1038 return branch.at(j);
1040 return branch.at(i);
1043 BranchObj* BranchObj::moveBranchTo (BranchObj* dst, int pos)
1045 // Find current parent and
1046 // remove pointer to myself there
1047 BranchObj *par=(BranchObj*)(parObj);
1049 par->removeBranchPtr (this);
1055 // links adds myself as last branch at dst
1056 dst->addBranchPtr (this);
1060 // inserts me at pos in parent of dst
1061 par=(BranchObj*)(dst->getParObj());
1063 return par->insertBranchPtr (this,pos);
1069 void BranchObj::alignRelativeTo (QPoint ref)
1072 if (!getHeading().isEmpty())
1073 cout << "BO::alignRelTo "<<getHeading()<<endl;
1075 cout << "BO::alignRelTo ???"<<endl;
1076 cout << " d="<<depth<<endl;
1078 int th = bboxTotal.height();
1080 // If I am the mapcenter or a mainbranch, reposition heading
1083 move (absPos.x(),absPos.y());
1086 // Calc angle to mapCenter if I am a mainbranch
1087 // needed for reordering the mainbranches clockwise
1089 angle=getAngle (QPoint ((int)(x() - parObj->getChildPos().x() ),
1090 (int)(y() - parObj->getChildPos().y() ) ) );
1095 // Align myself depending on orientation and parent, but
1096 // only if I am not the mainbranch or mapcenter itself
1097 switch (orientation)
1099 case OrientLeftOfCenter:
1100 move (ref.x()-bbox.width(), ref.y() + (th-bbox.height())/2 );
1102 case OrientRightOfCenter:
1103 move (ref.x(), ref.y() + (th-bbox.height())/2 );
1106 cout <<"LMO::alignRelativeTo: oops, no orientation given...\n";
1112 for (fio=floatimage.first(); fio; fio=floatimage.next() )
1115 if (scrolled) return;
1117 // Set reference point for alignment of childs
1119 if (orientation==OrientLeftOfCenter)
1120 ref2.setX(childPos.x() - linkwidth);
1122 ref2.setX(childPos.x() + linkwidth);
1125 ref2.setY(absPos.y()-(bboxTotal.height()-bbox.height())/2);
1127 ref2.setY(ref.y() );
1129 // Align the childs depending on reference point
1131 for (b=branch.first(); b; b=branch.next() )
1133 b->alignRelativeTo (ref2);
1134 ref2.setY(ref2.y() + b->getBBoxSizeWithChilds().height() );
1139 void BranchObj::reposition()
1142 if (!getHeading().isEmpty())
1143 cout << "BO::reposition "<<getHeading()<<endl;
1145 cout << "BO::reposition ???"<<endl;
1149 // only calculate the sizes once. If the deepest LMO
1150 // changes its height,
1151 // all upper LMOs have to change, too.
1152 calcBBoxSizeWithChilds();
1153 alignRelativeTo ( QPoint (absPos.x(),
1154 absPos.y()-(bboxTotal.height()-bbox.height())/2) );
1158 // This is only important for moving branches:
1159 // For editing a branch it isn't called...
1160 alignRelativeTo ( QPoint (absPos.x(),
1161 absPos.y()-(bboxTotal.height()-bbox.height())/2) );
1166 QRect BranchObj::getTotalBBox()
1170 if (scrolled) return r;
1173 for (b=branch.first();b ;b=branch.next() )
1174 r=addBBox(b->getTotalBBox(),r);
1177 for (fio=floatimage.first();fio ;fio=floatimage.next() )
1178 r=addBBox(fio->getTotalBBox(),r);
1183 QRect BranchObj::getBBoxSizeWithChilds()
1188 void BranchObj::calcBBoxSizeWithChilds()
1190 // This is called only from reposition and
1191 // and only for mapcenter. So it won't be
1192 // called more than once for a single user
1195 // Calculate size of LMO including all childs (to align them later)
1197 bboxTotal.setX(bbox.x() );
1198 bboxTotal.setY(bbox.y() );
1200 // if branch is scrolled, ignore childs, but still consider floatimages
1203 bboxTotal.setWidth (bbox.width());
1204 bboxTotal.setHeight(bbox.height());
1210 // Now calculate recursivly
1212 // maximum of widths
1215 for (b=branch.first();b ;b=branch.next() )
1217 b->calcBBoxSizeWithChilds();
1218 br=b->getBBoxSizeWithChilds();
1219 r.setWidth( max (br.width(), r.width() ));
1220 r.setHeight(br.height() + r.height() );
1221 if (br.y()<bboxTotal.y()) bboxTotal.setY(br.y());
1223 // Add myself and also
1224 // add width of link to sum if necessary
1225 if (branch.isEmpty())
1226 bboxTotal.setWidth (bbox.width() + r.width() );
1228 bboxTotal.setWidth (bbox.width() + r.width() + linkwidth);
1229 bboxTotal.setHeight(max (r.height(), bbox.height() ) );
1230 // frame->setRect(QRect(bbox.x(),bbox.y(),bbox.width(),bbox.height() ) );
1233 void BranchObj::select()
1235 LinkableMapObj::select();
1236 // Tell parent that I am selected now:
1237 BranchObj* po=(BranchObj*)(parObj);
1238 if (po) // TODO Try to get rid of this cast...
1239 po->setLastSelectedBranch(this);
1241 // temporary unscroll, if we have scrolled parents somewhere
1242 if (parObj) ((BranchObj*)(parObj))->tmpUnscroll();
1244 // set Text in Editor
1245 textEditor->setText(note.getNote() );
1246 textEditor->setFilename(note.getFilenameHint() );
1247 textEditor->setFontHint (note.getFontHint() );
1248 connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag() ) );
1249 connect (textEditor, SIGNAL (fontSizeHasChanged() ), this, SLOT (updateNoteFlag() ) );
1251 // Show URL and link in statusbar
1253 if (!url.isEmpty()) status+="URL: "+url+" ";
1254 if (!vymLink.isEmpty()) status+="Link: "+vymLink;
1255 if (!status.isEmpty()) mainWindow->statusMessage (status);
1258 standardFlags->updateToolBar();
1260 // Update Browserbutton
1262 actionEditOpenURL->setEnabled (true);
1264 actionEditOpenURL->setEnabled (false);
1266 // Update actions in mapeditor
1267 mapEditor->updateActions();
1270 void BranchObj::unselect()
1272 LinkableMapObj::unselect();
1273 // Delete any messages like vymLink in StatusBar
1274 mainWindow->statusMessage ("");
1276 // save note from editor and set flag
1277 // text is done by updateNoteFlag(), just save
1279 note.setFilenameHint (textEditor->getFilename());
1281 // reset temporary unscroll, if we have scrolled parents somewhere
1282 if (parObj) ((BranchObj*)(parObj))->resetTmpUnscroll();
1284 // Disconnect textEditor from this LMO
1285 disconnect( textEditor, SIGNAL(textHasChanged()), 0, 0 );
1286 disconnect( textEditor, SIGNAL (fontSizeHasChanged()),0,0 );
1288 // Erase content of editor
1289 textEditor->setInactive();
1291 // unselect all buttons in toolbar
1292 standardFlagsDefault->updateToolBar();
1295 QString BranchObj::getSelectString()
1300 if (parObj->getDepth()==0)
1301 s= "bo:" + QString("%1").arg(getNum());
1303 s= ((BranchObj*)(parObj))->getSelectString() + ",bo:" + QString("%1").arg(getNum());