# HG changeset patch # User insilmaril # Date 1242304978 0 # Node ID 382a444f5b0cb56768c4131a87e0cd3ad98a3d4b # Parent 6d2b32f305f94bb2017992b3771a36eaf9152394 flag of NoteEditor works again diff -r 6d2b32f305f9 -r 382a444f5b0c branchitem.cpp --- a/branchitem.cpp Wed May 13 08:26:27 2009 +0000 +++ b/branchitem.cpp Thu May 14 12:42:58 2009 +0000 @@ -54,9 +54,8 @@ QString s,a; BranchObj *bo=(BranchObj*)lmo; - /* // Update of note is usually done while unselecting a branch - if (isNoteInEditor) getNoteFromTextEditor(); + // if (isNoteInEditor) getNoteFromTextEditor(); // FIXME-0 check that this still works... QString scrolledAttr; if (scrolled) @@ -64,7 +63,9 @@ else scrolledAttr=""; - // save area, if not scrolled + /* + // save area, if not scrolled // FIXME-3 not needed if HTML is rewritten... + // also we should check if _any_ of parents is scrolled QString areaAttr; if (!((BranchObj*)(parObj))->isScrolled() ) { @@ -88,7 +89,7 @@ s=beginElement ("branch" +getAttr() // +getOrnXMLAttr() - // +scrolledAttr + +scrolledAttr // +areaAttr // +idAttr // +getIncludeImageAttr() @@ -103,10 +104,12 @@ // Save frame if (frame->getFrameType()!=FrameObj::NoFrame) s+=frame->saveToDir (); +*/ // save names of flags set - s+=standardFlags->saveToDir(tmpdir,prefix,0); + s+=standardFlags.saveToDir(tmpdir,prefix,0); +/* // Save FloatImages for (int i=0; isaveToDir (tmpdir,prefix); diff -r 6d2b32f305f9 -r 382a444f5b0c mainwindow.cpp --- a/mainwindow.cpp Wed May 13 08:26:27 2009 +0000 +++ b/mainwindow.cpp Thu May 14 12:42:58 2009 +0000 @@ -3364,7 +3364,7 @@ void Main::changeSelection (VymModel *model, const QItemSelection &newsel, const QItemSelection &oldsel) { - //branchPropertyWindow->setModel (model ); //FIXME-2 this used to be called from BranchObj::select() + //branchPropertyWindow->setModel (model ); //FIXME-2 this used to be called from BranchObj::select(). Maybe use signal now... if (model && model==currentModel() ) { @@ -3373,33 +3373,32 @@ if (!oldsel.indexes().isEmpty() ) { ti=model->getItem(oldsel.indexes().first()); - //cout << "Main::changeSel getting note from "<getHeading().toStdString()<<": \""<getNote().toStdString()<<"\""<setNoteObj (textEditor->getNoteObj(),false ); + + // Don't update note if both treeItem and textEditor are empty + //if (! (ti->hasEmptyNote() && textEditor->isEmpty() )) + // ti->setNoteObj (textEditor->getNoteObj(),false ); } if (!newsel.indexes().isEmpty() ) { ti=model->getItem(newsel.indexes().first()); - if (!ti->getNoteObj().isEmpty() ) - { - //cout << "Main::changeSel setting note of "<getHeading().toStdString()<<" m=("<getModel()<<") to \""<getNote().toStdString()<<"\""<hasEmptyNote() ) textEditor->setNote(ti->getNoteObj() ); - } else - textEditor->setNote(NoteObj() ); + else + textEditor->setNote(NoteObj() ); //FIXME-4 maybe add a clear() to TE } else textEditor->setInactive(); - // Show URL and link in statusbar // FIXME-2 - /* + // Show URL and link in statusbar QString status; QString s=model->getURL(); if (!s.isEmpty() ) status+="URL: "+s+" "; s=model->getVymLink(); if (!s.isEmpty() ) status+="Link: "+s; if (!status.isEmpty() ) statusMessage (status); -*/ - - // Update Toolbar // FIXME-0, was so far in BranchObj - //updateFlagsToolbar(); + + // Update Toolbar + //updateFlagsToolbar(); // FIXME-0, was so far in BranchObj + updateActions(); } diff -r 6d2b32f305f9 -r 382a444f5b0c treeitem.cpp --- a/treeitem.cpp Wed May 13 08:26:27 2009 +0000 +++ b/treeitem.cpp Thu May 14 12:42:58 2009 +0000 @@ -337,9 +337,10 @@ systemFlags.deactivate ("system-note"); } -void TreeItem::setNoteObj(const NoteObj &n, bool updateNoteEditor) +void TreeItem::setNoteObj(const NoteObj &n, bool updateNoteEditor) //FIXME-1 setNoteObj is called for every select or so??? { note=n; + cout << "TI::setNoteObj of "<