diff -r 2d4cc445a86a -r ee6b0f3a4c2f mainwindow.cpp --- a/mainwindow.cpp Mon Mar 23 09:06:51 2009 +0000 +++ b/mainwindow.cpp Thu Mar 26 07:49:17 2009 +0000 @@ -122,7 +122,6 @@ procBrowser=NULL; // Satellite windows ////////////////////////////////////////// - // history window historyWindow=new HistoryWindow(); connect (historyWindow, SIGNAL (windowClosed() ), this, SLOT (updateActions())); @@ -1669,7 +1668,7 @@ actionFormatLinkColor->addTo( canvasContextMenu ); actionFormatSelectionColor->addTo( canvasContextMenu ); actionFormatBackColor->addTo( canvasContextMenu ); - // actionFormatBackImage->addTo( canvasContextMenu ); //FIXME makes vym too slow: postponed for later version + // actionFormatBackImage->addTo( canvasContextMenu ); //FIXME-4 makes vym too slow: postponed for later version // Menu for last opened files // Create actions @@ -1902,7 +1901,7 @@ //tabWidget->currentPage() won't be NULL here, because of above... tabWidget->setCurrentIndex (tabIndex); - //FIXME no me anymore... me->viewport()->setFocus(); + //FIXME-3 no me anymore... me->viewport()->setFocus(); if (err!=aborted) { @@ -2018,7 +2017,7 @@ // call fileSaveAs() now, this will call fileSave() // again. // First switch to editor - //FIXME needed??? tabWidget->setCurrentWidget (m->getMapEditor()); + //FIXME-3 needed??? tabWidget->setCurrentWidget (m->getMapEditor()); fileSaveAs(savemode); } @@ -2247,7 +2246,7 @@ if (m) m->exportASCII(); } -void Main::fileExportCSV() //FIXME not scriptable yet +void Main::fileExportCSV() //FIXME-2 not scriptable yet { VymModel *m=currentModel(); if (m) @@ -2266,7 +2265,7 @@ } } -void Main::fileExportLaTeX() //FIXME not scriptable yet +void Main::fileExportLaTeX() //FIXME-2 not scriptable yet { VymModel *m=currentModel(); if (m) @@ -2285,7 +2284,7 @@ } } -void Main::fileExportKDE3Bookmarks() //FIXME not scriptable yet +void Main::fileExportKDE3Bookmarks() //FIXME-2 not scriptable yet { ExportKDE3Bookmarks ex; VymModel *m=currentModel(); @@ -2296,7 +2295,7 @@ } } -void Main::fileExportKDE4Bookmarks() //FIXME not scriptable yet +void Main::fileExportKDE4Bookmarks() //FIXME-2 not scriptable yet { ExportKDE4Bookmarks ex; VymModel *m=currentModel(); @@ -2307,7 +2306,7 @@ } } -void Main::fileExportTaskjuggler() //FIXME not scriptable yet +void Main::fileExportTaskjuggler() //FIXME-2 not scriptable yet { ExportTaskjuggler ex; VymModel *m=currentModel(); @@ -2326,7 +2325,7 @@ } } -void Main::fileExportOOPresentation() //FIXME not scriptable yet +void Main::fileExportOOPresentation() //FIXME-2 not scriptable yet { ExportOOFileDialog *fd=new ExportOOFileDialog( this,vymName+" - "+tr("Export to")+" Open Office"); // TODO add preview in dialog @@ -2395,7 +2394,7 @@ // Better would be delete (me), but then we could have a Qt error: // "QObject: Do not delete object, 'MapEditor', during its event handler!" // So we only remove data now and call deconstructor when vym closes later - // FIXME this needs to be moved to vymview... me->clear(); + // FIXME-3 this needs to be moved to vymview... me->clear(); // some model->clear is needed to free up memory ... updateActions(); @@ -2867,7 +2866,7 @@ // Calc some stats QString stats; -/* FIXME no stats at the moment (view dependent...) +/* FIXME-2 no stats at the moment (view dependent...) stats+=tr("%1 items on map\n","Info about map").arg (mapScene->items().size(),6); uint b=0; @@ -3243,7 +3242,7 @@ } -void Main::formatHideLinkUnselected() //FIXME get rid of this with imagepropertydialog +void Main::formatHideLinkUnselected() //FIXME-3 get rid of this with imagepropertydialog { VymModel *m=currentModel(); if (m) @@ -3455,7 +3454,7 @@ historyWindow->update (undoSet); } -void Main::updateNoteFlag() +void Main::updateNoteFlag() { // this slot is connected to TextEditor::textHasChanged() @@ -3463,9 +3462,66 @@ if (m) m->updateNoteFlag(); } -void Main::updateSatellites(VymModel* model) +/* +void Main::updateNoteInEditor (VymModel *model, const NoteObj ¬e) { - branchPropertyWindow->setModel (model ); + if (model&& model==currentModel() ) + { + textEditor->setNote (note); + } +} +*/ + +void Main::updateContent (QModelIndex index ) +{ + cout << "Main::updateContent model="<getItem(index); + cout << " item="<getHeading().toStdString()<<" ("<setNote (ti->getNoteObj() ); +} + +void Main::changeSelection (VymModel *model, const QItemSelection &newsel, const QItemSelection &oldsel) +{ + //branchPropertyWindow->setModel (model ); //FIXME-1 this used to be called from BranchObj::select() + if (model && model==currentModel() ) + { + // NoteEditor + TreeItem *ti; + if (!oldsel.indexes().isEmpty() ) + { + ti=model->getItem(oldsel.indexes().first()); + //cout << "Main::changeSel getting note from "<getHeading().toStdString()<<": \""<getNote().toStdString()<<"\""<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()<<"\""<setNote(ti->getNoteObj() ); + } else + textEditor->setNote(NoteObj() ); + } else + { + textEditor->setInactive(); + } + + // 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-1, was so far in BranchObj + //updateFlagsToolbar(); + + // Update actions + updateActions(); + } } void Main::updateActions()