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();
217 depth=parObj->getDepth()+1;
219 // setLinkStyle calls updateLink, only set it once
220 if (style!=getDefLinkStyle() ) setLinkStyle (getDefLinkStyle());
222 // Move temporary to new position at destination
223 // Usually the positioning would be done by reposition(),
224 // but then also the destination branch would "Jump" around...
225 // Better just do it approximately
227 { // new parent is the mapcenter itself
229 QPoint p= normalise ( QPoint (m.x() - o->getChildPos().x(),
230 m.y() - o->getChildPos().y() ));
231 if (p.x()<0) p.setX( p.x()-bbox.width() );
238 // new parent is just a branch, link to it
239 QRect t=o->getBBoxSizeWithChilds();
240 if (o->getLastBranch())
241 y=t.y() + t.height() ;
248 // we want to link above lmo
249 y=o->y() - height() + 5;
251 // we want to link below lmo
252 // Bottom of sel should be 5 pixels above
253 // the bottom of the branch _below_ the target:
254 // Don't try to find that branch, guess 12 pixels
255 y=o->getChildPos().y() -height() + 12;
257 if (o->getOrientation()==OrientLeftOfCenter)
258 move ( o->getChildPos().x() - linkwidth, y );
260 move (o->getChildPos().x() + linkwidth, y );
263 // updateLink is called implicitly in move
264 reposition(); // FIXME shouldn't be this a request?
267 void BranchObj::unsetParObjTmp()
274 depth=parObj->getDepth()+1;
275 setLinkStyle (getDefLinkStyle() );
279 void BranchObj::unScroll()
281 if (tmpUnscrolled) resetTmpUnscroll();
282 if (scrolled) toggleScroll();
285 void BranchObj::toggleScroll()
291 systemFlags->deactivate("scrolledright");
292 for (bo=branch.first(); bo; bo=branch.next() )
294 bo->setVisibility(true);
299 systemFlags->activate("scrolledright");
300 for (bo=branch.first(); bo; bo=branch.next() )
302 bo->setVisibility(false);
307 move (absPos.x(), absPos.y() );
311 bool BranchObj::isScrolled()
316 bool BranchObj::hasScrolledParent(BranchObj *start)
318 // Calls parents recursivly to
319 // find out, if we are scrolled at all.
320 // But ignore myself, just look at parents.
322 if (this !=start && scrolled) return true;
324 BranchObj* bo=(BranchObj*)(parObj);
326 return bo->hasScrolledParent(start);
331 void BranchObj::tmpUnscroll()
333 // Unscroll parent (recursivly)
334 BranchObj* bo=(BranchObj*)(parObj);
335 if (bo) bo->tmpUnscroll();
341 systemFlags->activate("tmpUnscrolledright");
346 void BranchObj::resetTmpUnscroll()
348 // Unscroll parent (recursivly)
349 BranchObj* bo=(BranchObj*)(parObj);
351 bo->resetTmpUnscroll();
357 systemFlags->deactivate("tmpUnscrolledright");
362 void BranchObj::setVisibility(bool v, int toDepth)
364 if (depth <= toDepth)
366 frame->setVisibility(v);
367 heading->setVisibility(v);
368 systemFlags->setVisibility(v);
369 standardFlags->setVisibility(v);
370 LinkableMapObj::setVisibility (v);
372 if (!scrolled && (depth < toDepth))
374 // Now go recursivly through all childs
376 for (b=branch.first(); b;b=branch.next() )
377 b->setVisibility (v,toDepth);
379 for (fio=floatimage.first(); fio; fio=floatimage.next())
380 fio->setVisibility (v);
382 } // depth <= toDepth
383 move (absPos.x(), absPos.y() );
387 void BranchObj::setVisibility(bool v)
389 setVisibility (v,MAX_DEPTH);
393 void BranchObj::setLinkColor ()
395 // Overloaded from LinkableMapObj
396 // BranchObj can use color of heading
398 if (mapEditor->getLinkColorHint()==HeadingColor)
399 LinkableMapObj::setLinkColor (heading->getColor() );
401 LinkableMapObj::setLinkColor ();
404 void BranchObj::setColor (QColor col, bool colorChilds)
406 heading->setColor(col);
411 for (bo=branch.first(); bo; bo=branch.next() )
412 bo->setColor(col,colorChilds);
417 BranchObj* BranchObj::first()
423 BranchObj* BranchObj::next()
426 BranchObj *bo=branch.first();
427 BranchObj *po=(BranchObj*)(parObj);
430 { // We are just beginning at the mapCenter
444 { // We come from above
447 // there are childs, go there
452 { // no childs, try to go up again
464 // can't go up, I am mapCenter
471 // Try to find last child, we came from, in my own childs
473 while (bo && searching)
475 if (itLast==bo) searching=false;
479 { // found lastLMO in my childs
482 // found a brother of lastLMO
498 // can't go up, I am mapCenter
505 // couldn't find last child, it must be a nephew of mine
509 // proceed with my first child
515 // or go back to my parents
526 // can't go up, I am mapCenter
533 BranchObj* BranchObj::getLastIterator()
538 void BranchObj::setLastIterator(BranchObj* it)
544 void BranchObj::move (double x, double y)
546 OrnamentedObj::move (x,y);
550 void BranchObj::move (QPoint p)
555 void BranchObj::moveBy (double x, double y)
557 OrnamentedObj::moveBy (x,y);
560 for (b=branch.first(); b;b=branch.next() )
564 void BranchObj::moveBy (QPoint p)
566 moveBy (p.x(), p.y());
570 void BranchObj::positionBBox()
574 QString h=getHeading();
576 cout << "BO::positionBBox("<<h<<")\n";
578 cout << "BO::positionBBox (noHeading)\n";
581 heading->positionBBox();
582 systemFlags->positionBBox();
583 standardFlags->positionBBox();
584 // It seems that setting x,y also affects width,height
585 int w_old=bbox.width();
586 int h_old=bbox.height();
587 bbox.setX (absPos.x() );
588 bbox.setY (absPos.y() );
589 bbox.setWidth(w_old);
590 bbox.setHeight(h_old);
595 frame->setRect(QRect(bbox.x(),bbox.y(),bbox.width(),bbox.height() ) );
597 // Update links to other branches
599 for (l=link.first(); l; l=link.next() )
603 void BranchObj::calcBBoxSize()
605 QSize heading_r=heading->getSize();
606 int heading_w=static_cast <int> (heading_r.width() );
607 int heading_h=static_cast <int> (heading_r.height() );
608 QSize sysflags_r=systemFlags->getSize();
609 int sysflags_h=sysflags_r.height();
610 int sysflags_w=sysflags_r.width();
611 QSize stanflags_r=standardFlags->getSize();
612 int stanflags_h=stanflags_r.height();
613 int stanflags_w=stanflags_r.width();
617 // set width to sum of all widths
618 w=heading_w + sysflags_w + stanflags_w;
619 // set height to maximum needed height
620 h=max (sysflags_h,stanflags_h);
623 w+=frame->getBorder();
624 h+=frame->getBorder();
625 bbox.setSize (QSize (w,h));
628 LinkableMapObj* BranchObj::findMapObj(QPoint p, LinkableMapObj* excludeLMO)
633 for (b=branch.first(); b; b=branch.next() )
635 lmo=b->findMapObj(p, excludeLMO);
636 if (lmo != NULL) return lmo;
640 if (inBBox (p) && (this != excludeLMO) && isVisibleObj() )
643 // Search float images
645 for (foi=floatimage.first(); foi; foi=floatimage.next() )
646 if (foi->inBBox(p) && (foi != excludeLMO) && foi->getParObj()!= excludeLMO) return foi;
651 void BranchObj::setHeading(QString s)
653 // Adjusting font size
654 QFont font=heading->getFont();
656 font.setPointSize(16);
659 font.setPointSize(10);
661 font.setPointSize(12);
662 heading->setFont(font);
663 heading->setText(s); // set new heading
664 calcBBoxSize(); // recalculate bbox
665 positionBBox(); // rearrange contents
669 void BranchObj::setURL(QString s)
673 systemFlags->activate("url");
675 systemFlags->deactivate("url");
676 calcBBoxSize(); // recalculate bbox
677 positionBBox(); // rearrange contents
681 QString BranchObj::getURL()
686 void BranchObj::setVymLink(QString s)
690 // We need the relative (from loading)
691 // or absolute path (from User event)
692 // and build the absolute path.
693 // Note: If we have relative, use path of
694 // current map to build absolute path
696 if (!d.path().startsWith ("/"))
698 QString p=mapEditor->getDestPath();
699 int i=p.findRev("/",-1);
700 d.setPath(p.left(i)+"/"+s);
704 systemFlags->activate("vymLink");
708 systemFlags->deactivate("vymLink");
711 calcBBoxSize(); // recalculate bbox
712 positionBBox(); // rearrange contents
716 QString BranchObj::getVymLink()
721 QString BranchObj::saveToDir (const QString &tmpdir,const QString &prefix, const QPoint& offset)
724 QString scrolledAttr;
726 scrolledAttr=attribut ("scrolled","yes");
731 if (depth<2) posAttr=
732 attribut("absPosX",QString().setNum(absPos.x(),10)) +
733 attribut("absPosY",QString().setNum(absPos.y(),10));
739 urlAttr=attribut ("url",url);
742 if (!vymLink.isEmpty())
743 vymLinkAttr=attribut ("vymLink",convertToRel(mapEditor->getDestPath(),vymLink) );
746 if (frame->getFrameType()!=NoFrame)
747 frameAttr=attribut ("frameType",frame->getFrameTypeName());
751 // save area, if not scrolled
753 if (!((BranchObj*)(parObj))->isScrolled() )
756 attribut("x1",QString().setNum(absPos.x()-offset.x(),10)) +
757 attribut("y1",QString().setNum(absPos.y()-offset.y(),10)) +
758 attribut("x2",QString().setNum(absPos.x()+width()-offset.x(),10)) +
759 attribut("y2",QString().setNum(absPos.y()+height()-offset.y(),10));
764 s=beginElement ("branch" +scrolledAttr +posAttr +urlAttr +vymLinkAttr +frameAttr +areaAttr);
768 s=s+valueElement("heading", getHeading(),
769 attribut ("textColor",QColor(heading->getColor()).name()));
771 // save names of flags set
772 s+=standardFlags->saveToDir(tmpdir,prefix,0);
775 if (!note.isEmpty() )
780 for (bo=branch.first(); bo; bo=branch.next() )
781 s+=bo->saveToDir(tmpdir,prefix,offset);
786 for (fio=floatimage.first(); fio; fio=floatimage.next() )
787 s+=fio->saveToDir (tmpdir,prefix);
789 s+=endElement ("branch");
793 void BranchObj::addLink (LinkObj *lo)
799 void BranchObj::removeLink (LinkObj *lo)
804 void BranchObj::deleteLink(LinkObj *lo)
807 if (!lo->isUsed()) delete (lo);
810 int BranchObj::countLink()
815 BranchObj* BranchObj::linkTargetAt (int i)
818 return link.at(i)->otherBranch (this);
823 LinkableMapObj* BranchObj::addFloatImage ()
825 FloatImageObj *newfi=new FloatImageObj (canvas,this);
826 floatimage.append (newfi);
827 if (hasScrolledParent(this) )
828 newfi->setVisibility (false);
830 newfi->setVisibility(visible);
835 LinkableMapObj* BranchObj::addFloatImage (FloatImageObj *fio)
837 FloatImageObj *newfi=new FloatImageObj (canvas,this);
838 floatimage.append (newfi);
840 if (hasScrolledParent(this) )
841 newfi->setVisibility (false);
843 newfi->setVisibility(visible);
848 FloatImageObj* BranchObj::getFirstFloatImage ()
850 return floatimage.first();
853 FloatImageObj* BranchObj::getLastFloatImage ()
855 return floatimage.last();
858 FloatImageObj* BranchObj::getFloatImageNum (const uint &i)
860 return floatimage.at(i);
863 void BranchObj::removeFloatImage (FloatImageObj *fio)
865 floatimage.remove (fio);
869 void BranchObj::savePosInAngle ()
871 // Save position in angle
874 for (b=branch.first(); b; b=branch.next() )
881 BranchObj* BranchObj::addBranch()
883 BranchObj* newbo=new BranchObj(canvas,this);
884 branch.append (newbo);
885 newbo->setParObj(this);
886 newbo->setColor(getColor(),false);
887 newbo->setLinkColor();
888 newbo->setHeading ("new");
889 newbo->setLinkStyle (newbo->getDefLinkStyle());
891 newbo->setVisibility (false);
893 newbo->setVisibility(visible);
898 BranchObj* BranchObj::addBranch(BranchObj* bo)
900 BranchObj* newbo=new BranchObj(canvas,this);
901 branch.append (newbo);
903 newbo->setParObj(this);
904 newbo->setHeading (newbo->getHeading()); // adjust fontsize to depth
905 newbo->setLinkStyle (newbo->getDefLinkStyle());
907 newbo->setVisibility (false);
909 newbo->setVisibility(bo->visible);
914 BranchObj* BranchObj::addBranchPtr(BranchObj* bo)
917 bo->setParObj (this);
919 bo->setLinkStyle (bo->getDefLinkStyle() );
920 if (scrolled) tmpUnscroll();
921 setLastSelectedBranch (bo);
925 BranchObj* BranchObj::insertBranch(int pos)
928 // Add new bo and resort branches
929 BranchObj *newbo=addBranch ();
930 newbo->angle=pos-0.5;
935 BranchObj* BranchObj::insertBranch(BranchObj* bo, int pos)
938 // Add new bo and resort branches
940 BranchObj *newbo=addBranch (bo);
945 BranchObj* BranchObj::insertBranchPtr (BranchObj* bo, int pos)
948 // Add new bo and resort branches
951 bo->setParObj (this);
953 bo->setLinkStyle (bo->getDefLinkStyle() );
954 if (scrolled) tmpUnscroll();
955 setLastSelectedBranch (bo);
960 void BranchObj::removeBranch(BranchObj* bo)
962 // if bo is not in branch remove returns false, we
965 if (branch.remove (bo))
968 qWarning ("BranchObj::removeBranch tried to remove non existing branch?!\n");
972 void BranchObj::removeBranchPtr(BranchObj* bo)
978 void BranchObj::setLastSelectedBranch (BranchObj* bo)
980 lastSelectedBranch=branch.find(bo);
983 BranchObj* BranchObj::getLastSelectedBranch ()
985 if (lastSelectedBranch>=0)
987 BranchObj* bo=branch.at(lastSelectedBranch);
990 return branch.first();
993 BranchObj* BranchObj::getFirstBranch ()
995 return branch.first();
998 BranchObj* BranchObj::getLastBranch ()
1000 return branch.last();
1003 BranchObj* BranchObj::getBranchNum (const uint &i)
1005 return branch.at(i);
1009 BranchObj* BranchObj::moveBranchUp(BranchObj* bo1) // move a branch up (modify myself)
1012 int i=branch.find(bo1);
1014 { // -1 if bo1 not found
1015 branch.at(i)->angle--;
1016 branch.at(i-1)->angle++;
1018 return branch.at(i-1);
1020 return branch.at(i);
1023 BranchObj* BranchObj::moveBranchDown(BranchObj* bo1)
1026 int i=branch.find(bo1);
1031 branch.at(i)->angle++;
1032 branch.at(j)->angle--;
1034 return branch.at(j);
1036 return branch.at(i);
1039 BranchObj* BranchObj::moveBranchTo (BranchObj* dst, int pos)
1041 // Find current parent and
1042 // remove pointer to myself there
1043 BranchObj *par=(BranchObj*)(parObj);
1045 par->removeBranchPtr (this);
1051 // links adds myself as last branch at dst
1052 dst->addBranchPtr (this);
1056 // inserts me at pos in parent of dst
1057 par=(BranchObj*)(dst->getParObj());
1059 return par->insertBranchPtr (this,pos);
1065 void BranchObj::alignRelativeTo (QPoint ref)
1068 if (!getHeading().isEmpty())
1069 cout << "BO::alignRelTo "<<getHeading()<<endl;
1071 cout << "BO::alignRelTo ???"<<endl;
1072 cout << " d="<<depth<<endl;
1074 int th = bboxTotal.height();
1076 // If I am the mapcenter or a mainbranch, reposition heading
1079 move (absPos.x(),absPos.y());
1082 // Calc angle to mapCenter if I am a mainbranch
1083 // needed for reordering the mainbranches clockwise
1085 angle=getAngle (QPoint ((int)(x() - parObj->getChildPos().x() ),
1086 (int)(y() - parObj->getChildPos().y() ) ) );
1091 // Align myself depending on orientation and parent, but
1092 // only if I am not the mainbranch or mapcenter itself
1093 switch (orientation)
1095 case OrientLeftOfCenter:
1096 move (ref.x()-bbox.width(), ref.y() + (th-bbox.height())/2 );
1098 case OrientRightOfCenter:
1099 move (ref.x(), ref.y() + (th-bbox.height())/2 );
1102 cout <<"LMO::alignRelativeTo: oops, no orientation given...\n";
1108 for (fio=floatimage.first(); fio; fio=floatimage.next() )
1111 if (scrolled) return;
1113 // Set reference point for alignment of childs
1115 if (orientation==OrientLeftOfCenter)
1116 ref2.setX(childPos.x() - linkwidth);
1118 ref2.setX(childPos.x() + linkwidth);
1121 ref2.setY(absPos.y()-(bboxTotal.height()-bbox.height())/2);
1123 ref2.setY(ref.y() );
1125 // Align the childs depending on reference point
1127 for (b=branch.first(); b; b=branch.next() )
1129 b->alignRelativeTo (ref2);
1130 ref2.setY(ref2.y() + b->getBBoxSizeWithChilds().height() );
1135 void BranchObj::reposition()
1138 if (!getHeading().isEmpty())
1139 cout << "BO::reposition "<<getHeading()<<endl;
1141 cout << "BO::reposition ???"<<endl;
1145 // only calculate the sizes once. If the deepest LMO
1146 // changes its height,
1147 // all upper LMOs have to change, too.
1148 calcBBoxSizeWithChilds();
1149 alignRelativeTo ( QPoint (absPos.x(),
1150 absPos.y()-(bboxTotal.height()-bbox.height())/2) );
1154 // This is only important for moving branches:
1155 // For editing a branch it isn't called...
1156 alignRelativeTo ( QPoint (absPos.x(),
1157 absPos.y()-(bboxTotal.height()-bbox.height())/2) );
1162 QRect BranchObj::getTotalBBox()
1166 if (scrolled) return r;
1169 for (b=branch.first();b ;b=branch.next() )
1170 r=addBBox(b->getTotalBBox(),r);
1173 for (fio=floatimage.first();fio ;fio=floatimage.next() )
1174 r=addBBox(fio->getTotalBBox(),r);
1179 QRect BranchObj::getBBoxSizeWithChilds()
1184 void BranchObj::calcBBoxSizeWithChilds()
1186 // This is called only from reposition and
1187 // and only for mapcenter. So it won't be
1188 // called more than once for a single user
1191 // Calculate size of LMO including all childs (to align them later)
1193 bboxTotal.setX(bbox.x() );
1194 bboxTotal.setY(bbox.y() );
1196 // if branch is scrolled, ignore childs, but still consider floatimages
1199 bboxTotal.setWidth (bbox.width());
1200 bboxTotal.setHeight(bbox.height());
1206 // Now calculate recursivly
1208 // maximum of widths
1211 for (b=branch.first();b ;b=branch.next() )
1213 b->calcBBoxSizeWithChilds();
1214 br=b->getBBoxSizeWithChilds();
1215 r.setWidth( max (br.width(), r.width() ));
1216 r.setHeight(br.height() + r.height() );
1217 if (br.y()<bboxTotal.y()) bboxTotal.setY(br.y());
1219 // Add myself and also
1220 // add width of link to sum if necessary
1221 if (branch.isEmpty())
1222 bboxTotal.setWidth (bbox.width() + r.width() );
1224 bboxTotal.setWidth (bbox.width() + r.width() + linkwidth);
1225 bboxTotal.setHeight(max (r.height(), bbox.height() ) );
1226 // frame->setRect(QRect(bbox.x(),bbox.y(),bbox.width(),bbox.height() ) );
1229 void BranchObj::select()
1231 LinkableMapObj::select();
1232 // Tell parent that I am selected now:
1233 BranchObj* po=(BranchObj*)(parObj);
1234 if (po) // TODO Try to get rid of this cast...
1235 po->setLastSelectedBranch(this);
1237 // temporary unscroll, if we have scrolled parents somewhere
1238 if (parObj) ((BranchObj*)(parObj))->tmpUnscroll();
1240 // set Text in Editor
1241 textEditor->setText(note.getNote() );
1242 textEditor->setFilename(note.getFilenameHint() );
1243 textEditor->setFontHint (note.getFontHint() );
1244 connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag() ) );
1245 connect (textEditor, SIGNAL (fontSizeHasChanged() ), this, SLOT (updateNoteFlag() ) );
1247 // Show URL and link in statusbar
1249 if (!url.isEmpty()) status+="URL: "+url+" ";
1250 if (!vymLink.isEmpty()) status+="Link: "+vymLink;
1251 if (!status.isEmpty()) mainWindow->statusMessage (status);
1254 standardFlags->updateToolBar();
1256 // Update Browserbutton
1258 actionEditOpenURL->setEnabled (true);
1260 actionEditOpenURL->setEnabled (false);
1262 // Update actions in mapeditor
1263 mapEditor->updateActions();
1266 void BranchObj::unselect()
1268 LinkableMapObj::unselect();
1269 // Delete any messages like vymLink in StatusBar
1270 mainWindow->statusMessage ("");
1272 // save note from editor and set flag
1273 // text is done by updateNoteFlag(), just save
1275 note.setFilenameHint (textEditor->getFilename());
1277 // reset temporary unscroll, if we have scrolled parents somewhere
1278 if (parObj) ((BranchObj*)(parObj))->resetTmpUnscroll();
1280 // Disconnect textEditor from this LMO
1281 disconnect( textEditor, SIGNAL(textHasChanged()), 0, 0 );
1282 disconnect( textEditor, SIGNAL (fontSizeHasChanged()),0,0 );
1284 // Erase content of editor
1285 textEditor->setInactive();
1287 // unselect all buttons in toolbar
1288 standardFlagsDefault->updateToolBar();
1291 QString BranchObj::getSelectString()
1296 if (parObj->getDepth()==0)
1297 s= "bo:" + QString("%1").arg(getNum());
1299 s= ((BranchObj*)(parObj))->getSelectString() + ",bo:" + QString("%1").arg(getNum());