# HG changeset patch # User insilmaril # Date 1217846586 0 # Node ID 11f9124c1ccaff5fa62f9d98cc67ede6127f9fa3 # Parent 462d3950227337b6b6c460280e174afec93189c2 Adding/moving MCO works again diff -r 462d39502273 -r 11f9124c1cca branchobj.cpp --- a/branchobj.cpp Wed Jul 16 11:56:44 2008 +0000 +++ b/branchobj.cpp Mon Aug 04 10:43:06 2008 +0000 @@ -813,7 +813,7 @@ // Providing an ID for a branch makes export to XHTML easier QString idAttr; if (countXLinks()>0) - idAttr=attribut ("id",mapEditor->getModel()->getSelectString(this)); //TODO directly access model + idAttr=attribut ("id",model->getSelectString(this)); //TODO directly access model else idAttr=""; @@ -1611,7 +1611,7 @@ QString BranchObj::getSelectString() { - return mapEditor->getModel()->getSelectString (this); + return model->getSelectString (this); } void BranchObj::setAnimation(const AnimPoint &ap) @@ -1627,6 +1627,7 @@ setRelPos (anim); return true; } + parObj->reposition(); // we might have been relinked meanwhile return false; } diff -r 462d39502273 -r 11f9124c1cca demos/vym-projectplan.vym Binary file demos/vym-projectplan.vym has changed diff -r 462d39502273 -r 11f9124c1cca exports.cpp --- a/exports.cpp Wed Jul 16 11:56:44 2008 +0000 +++ b/exports.cpp Mon Aug 04 10:43:06 2008 +0000 @@ -59,8 +59,6 @@ bool ExportBase::execDialog() { - //MapEditor *me=model.getMapEditor(); FIXME needed? - // if (model->mapCenters.count() && me) { QFileDialog *fd=new QFileDialog( 0, caption); fd->setFilter (filter); diff -r 462d39502273 -r 11f9124c1cca linkablemapobj.cpp --- a/linkablemapobj.cpp Wed Jul 16 11:56:44 2008 +0000 +++ b/linkablemapobj.cpp Mon Aug 04 10:43:06 2008 +0000 @@ -133,7 +133,7 @@ { parObj=o; mapEditor=parObj->getMapEditor(); - model=parObj->getModel(); // FIXME makes painting slow, but that's obvious because there are no links to paint, hmmm.... + model=parObj->getModel(); } void LinkableMapObj::setParObjTmp(LinkableMapObj*,QPointF,int) // FIXME make pure virtual @@ -669,7 +669,7 @@ // we want to block expensive repositioning, but just do it once at // the end, thus check first: - if (mapEditor->getModel()->isRepositionBlocked()) return; // FIXME better go to model directly, maybe via a signal + if (model->isRepositionBlocked()) return; // FIXME better go to model directly, maybe via a signal // Pass on the request to parental objects, if this hasn't been done yet diff -r 462d39502273 -r 11f9124c1cca mainwindow.cpp --- a/mainwindow.cpp Wed Jul 16 11:56:44 2008 +0000 +++ b/mainwindow.cpp Mon Aug 04 10:43:06 2008 +0000 @@ -456,7 +456,7 @@ a->setEnabled (false); tb->addAction (a); editMenu->addAction (a); - actionEditUndo=a; + actionUndo=a; a = new QAction( QPixmap( iconPath+"redo.png"), tr( "&Redo","Edit menu" ), this); a->setStatusTip (tr( "Redo" )); @@ -464,7 +464,7 @@ tb->addAction (a); editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editRedo() ) ); - actionEditRedo=a; + actionRedo=a; editMenu->addSeparator(); a = new QAction(QPixmap( iconPath+"editcopy.png"), tr( "&Copy","Edit menu" ), this); @@ -474,7 +474,7 @@ tb->addAction (a); editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editCopy() ) ); - actionEditCopy=a; + actionCopy=a; a = new QAction(QPixmap( iconPath+"editcut.png" ), tr( "Cu&t","Edit menu" ), this); a->setStatusTip ( tr( "Cut" ) ); @@ -482,7 +482,7 @@ a->setEnabled (false); tb->addAction (a); editMenu->addAction (a); - actionEditCut=a; + actionCut=a; connect( a, SIGNAL( triggered() ), this, SLOT( editCut() ) ); a = new QAction(QPixmap( iconPath+"editpaste.png"), tr( "&Paste","Edit menu" ),this); @@ -492,7 +492,7 @@ a->setEnabled (false); tb->addAction (a); editMenu->addAction (a); - actionEditPaste=a; + actionPaste=a; /* // Shortcuts to modify heading: @@ -511,9 +511,8 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) ); actionListBranches.append(a); editMenu->addAction (a); - actionEditHeading=a; - -*/ + actionHeading=a; + a = new QAction( tr( "Edit heading","Edit menu" ), this); a->setStatusTip (tr( "edit Heading" )); //a->setShortcut ( Qt::Key_F2 ); //Edit heading @@ -521,6 +520,7 @@ addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editHeading() ) ); actionListBranches.append(a); +*/ // Shortcut to delete selection a = new QAction( tr( "Delete Selection","Edit menu" ),this); @@ -529,12 +529,12 @@ a->setShortcutContext (Qt::WindowShortcut); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteSelection() ) ); - actionEditDelete=a; + actionDelete=a; // Shortcut to add mapcenter a= new QAction(tr( "Add mapcenter","Canvas context menu" ), this); connect( a, SIGNAL( triggered() ), this, SLOT( editAddMapCenter() ) ); - actionEditAddMapCenter = a; + actionAddMapCenter = a; // Shortcut to add branch @@ -551,12 +551,12 @@ actionListBranches.append(a); #if defined (Q_OS_MACX) // In OSX show different shortcut in menues, the keys work indepently always - actionEditAddBranch=alt; + actionAddBranch=alt; #else - actionEditAddBranch=a; + actionAddBranch=a; #endif - editMenu->addAction (actionEditAddBranch); - tb->addAction (actionEditAddBranch); + editMenu->addAction (actionAddBranch); + tb->addAction (actionAddBranch); // Add branch by inserting it at selection @@ -568,7 +568,7 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBefore() ) ); a->setEnabled (false); actionListBranches.append(a); - actionEditAddBranchBefore=a; + actionAddBranchBefore=a; a = new QAction(tr( "Add branch (insert)","Edit menu" ),this); a->setStatusTip ( tr( "Add a branch by inserting and making selection its child" )); a->setShortcut ( Qt::ALT + Qt::Key_A ); //Insert branch @@ -586,7 +586,7 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchAbove() ) ); a->setEnabled (false); actionListBranches.append(a); - actionEditAddBranchAbove=a; + actionAddBranchAbove=a; a = new QAction(tr( "Add branch above","Edit menu" ), this); a->setStatusTip ( tr( "Add a branch above selection" )); a->setShortcut (Qt::SHIFT+Qt::Key_A ); //Add branch above @@ -604,7 +604,7 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editNewBranchBelow() ) ); a->setEnabled (false); actionListBranches.append(a); - actionEditAddBranchBelow=a; + actionAddBranchBelow=a; a = new QAction(tr( "Add branch below","Edit menu" ), this); a->setStatusTip ( tr( "Add a branch below selection" )); a->setShortcut (Qt::CTRL +Qt::Key_A ); // Add branch below @@ -620,7 +620,7 @@ tb->addAction (a); editMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( editMoveUp() ) ); - actionEditMoveUp=a; + actionMoveUp=a; a = new QAction( QPixmap( iconPath+"down.png"), tr( "Move down","Edit menu" ),this); connect( a, SIGNAL( triggered() ), this, SLOT( editMoveDown() ) ); @@ -629,14 +629,14 @@ a->setEnabled (false); tb->addAction (a); editMenu->addAction (a); - actionEditMoveDown=a; + actionMoveDown=a; a = new QAction( QPixmap(iconPath+"editsort.png" ), tr( "Sort children","Edit menu" ), this ); connect( a, SIGNAL( activated() ), this, SLOT( editSortChildren() ) ); a->setEnabled (true); a->addTo( tb ); editMenu->addAction (a); - actionEditSortChildren=a; + actionSortChildren=a; a = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch","Edit menu" ),this); a->setShortcut ( Qt::Key_ScrollLock ); @@ -648,18 +648,18 @@ alt->setStatusTip (tr( "Scroll branch" )); connect( alt, SIGNAL( triggered() ), this, SLOT( editToggleScroll() ) ); #if defined(Q_OS_MACX) - actionEditToggleScroll=alt; + actionToggleScroll=alt; #else - actionEditToggleScroll=a; + actionToggleScroll=a; #endif - actionEditToggleScroll->setEnabled (false); - actionEditToggleScroll->setToggleAction(true); - tb->addAction (actionEditToggleScroll); - editMenu->addAction ( actionEditToggleScroll); - editMenu->addAction (actionEditToggleScroll); + actionToggleScroll->setEnabled (false); + actionToggleScroll->setToggleAction(true); + tb->addAction (actionToggleScroll); + editMenu->addAction ( actionToggleScroll); + editMenu->addAction (actionToggleScroll); addAction (a); addAction (alt); - actionListBranches.append(actionEditToggleScroll); + actionListBranches.append(actionToggleScroll); a = new QAction( tr( "Unscroll children","Edit menu" ), this); a->setStatusTip (tr( "Unscroll all scrolled branches in selected subtree" )); @@ -682,21 +682,21 @@ tb->addAction (a); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURL() ) ); - actionEditOpenURL=a; + actionOpenURL=a; a = new QAction( tr( "Open URL in new tab","Edit menu" ), this); a->setStatusTip (tr( "Open URL in new tab" )); //a->setShortcut (Qt::CTRL+Qt::Key_U ); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenURLTab() ) ); - actionEditOpenURLTab=a; + actionOpenURLTab=a; a = new QAction( tr( "Open all URLs in subtree","Edit menu" ), this); a->setStatusTip (tr( "Open all URLs in subtree" )); addAction(a); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleURLTabs() ) ); - actionEditOpenMultipleURLTabs=a; + actionOpenMultipleURLTabs=a; a = new QAction(QPixmap(), tr( "Edit URL...","Edit menu"), this); a->setStatusTip ( tr( "Edit URL" ) ); @@ -705,7 +705,7 @@ actionListBranches.append(a); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editURL() ) ); - actionEditURL=a; + actionURL=a; a = new QAction(QPixmap(), tr( "Edit local URL...","Edit menu"), this); a->setStatusTip ( tr( "Edit local URL" ) ); @@ -714,42 +714,42 @@ actionListBranches.append(a); addAction(a); connect( a, SIGNAL( triggered() ), this, SLOT( editLocalURL() ) ); - actionEditLocalURL=a; + actionLocalURL=a; a = new QAction( tr( "Use heading for URL","Edit menu" ), this); a->setStatusTip ( tr( "Use heading of selected branch as URL" )); a->setEnabled (false); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editHeading2URL() ) ); - actionEditHeading2URL=a; + actionHeading2URL=a; a = new QAction(tr( "Create URL to Novell Bugzilla","Edit menu" ), this); a->setStatusTip ( tr( "Create URL to Novell Bugzilla" )); a->setEnabled (false); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editBugzilla2URL() ) ); - actionEditBugzilla2URL=a; + actionBugzilla2URL=a; a = new QAction(tr( "Create URL to Novell FATE","Edit menu" ), this); a->setStatusTip ( tr( "Create URL to Novell FATE" )); a->setEnabled (false); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editFATE2URL() ) ); - actionEditFATE2URL=a; + actionFATE2URL=a; a = new QAction(QPixmap(flagsPath+"flag-vymlink.png"), tr( "Open linked map","Edit menu" ), this); a->setStatusTip ( tr( "Jump to another vym map, if needed load it first" )); tb->addAction (a); a->setEnabled (false); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenVymLink() ) ); - actionEditOpenVymLink=a; + actionOpenVymLink=a; a = new QAction(QPixmap(), tr( "Open all vym links in subtree","Edit menu" ), this); a->setStatusTip ( tr( "Open all vym links in subtree" )); a->setEnabled (false); actionListBranches.append(a); connect( a, SIGNAL( triggered() ), this, SLOT( editOpenMultipleVymLinks() ) ); - actionEditOpenMultipleVymLinks=a; + actionOpenMultipleVymLinks=a; a = new QAction(tr( "Edit vym link...","Edit menu" ), this); @@ -757,13 +757,13 @@ a->setStatusTip ( tr( "Edit link to another vym map" )); connect( a, SIGNAL( triggered() ), this, SLOT( editVymLink() ) ); actionListBranches.append(a); - actionEditVymLink=a; + actionVymLink=a; a = new QAction(tr( "Delete vym link","Edit menu" ),this); a->setStatusTip ( tr( "Delete link to another vym map" )); a->setEnabled (false); connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteVymLink() ) ); - actionEditDeleteVymLink=a; + actionDeleteVymLink=a; a = new QAction(QPixmap(flagsPath+"flag-hideexport.png"), tr( "Hide in exports","Edit menu" ), this); a->setStatusTip ( tr( "Hide object in exports" ) ); @@ -772,13 +772,13 @@ tb->addAction (a); a->setEnabled (false); connect( a, SIGNAL( triggered() ), this, SLOT( editToggleHideExport() ) ); - actionEditToggleHideExport=a; + actionToggleHideExport=a; a = new QAction(tr( "Edit Map Info...","Edit menu" ),this); a->setStatusTip ( tr( "Edit Map Info" )); a->setEnabled (true); connect( a, SIGNAL( triggered() ), this, SLOT( editMapInfo() ) ); - actionEditMapInfo=a; + actionMapInfo=a; // Import at selection (adding to selection) a = new QAction( tr( "Add map (insert)","Edit menu" ),this); @@ -786,7 +786,7 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editImportAdd() ) ); a->setEnabled (false); actionListBranches.append(a); - actionEditImportAdd=a; + actionImportAdd=a; // Import at selection (replacing selection) a = new QAction( tr( "Add map (replace)","Edit menu" ), this); @@ -794,7 +794,7 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editImportReplace() ) ); a->setEnabled (false); actionListBranches.append(a); - actionEditImportReplace=a; + actionImportReplace=a; // Save selection a = new QAction( tr( "Save selection","Edit menu" ), this); @@ -802,7 +802,7 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editSaveBranch() ) ); a->setEnabled (false); actionListBranches.append(a); - actionEditSaveBranch=a; + actionSaveBranch=a; // Only remove branch, not its children a = new QAction(tr( "Remove only branch ","Edit menu" ), this); @@ -812,7 +812,7 @@ a->setEnabled (false); addAction (a); actionListBranches.append(a); - actionEditDeleteKeepChildren=a; + actionDeleteKeepChildren=a; // Only remove children of a branch a = new QAction( tr( "Remove children","Edit menu" ), this); @@ -821,7 +821,7 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editDeleteChildren() ) ); a->setEnabled (false); actionListBranches.append(a); - actionEditDeleteChildren=a; + actionDeleteChildren=a; // Shortcuts for navigating with cursor: a = new QAction(tr( "Select upper branch","Edit menu" ), this); @@ -856,7 +856,7 @@ a->setEnabled (false); editMenu->addAction (a); actionListBranches.append(a); - actionEditSelectFirst=a; + actionSelectFirst=a; connect( a, SIGNAL( triggered() ), this, SLOT( editFirstBranch() ) ); a = new QAction( tr( "Select last branch","Edit menu" ),this); a->setStatusTip (tr( "Select last branch" )); @@ -867,12 +867,12 @@ a->setEnabled (false); editMenu->addAction (a); actionListBranches.append(a); - actionEditSelectLast=a; + actionSelectLast=a; a = new QAction( tr( "Add Image...","Edit menu" ), this); a->setStatusTip (tr( "Add Image" )); connect( a, SIGNAL( triggered() ), this, SLOT( editLoadImage() ) ); - actionEditLoadImage=a; + actionLoadImage=a; a = new QAction( tr( "Property window","Dialog to edit properties of selection" )+QString ("..."), this); a->setStatusTip (tr( "Set properties for selection" )); @@ -1542,50 +1542,50 @@ // Submenu "Add" branchAddContextMenu =branchContextMenu->addMenu (tr("Add")); - branchAddContextMenu->addAction (actionEditPaste ); - branchAddContextMenu->addAction ( actionEditAddBranch ); - branchAddContextMenu->addAction ( actionEditAddBranchBefore ); - branchAddContextMenu->addAction ( actionEditAddBranchAbove); - branchAddContextMenu->addAction ( actionEditAddBranchBelow ); + branchAddContextMenu->addAction (actionPaste ); + branchAddContextMenu->addAction ( actionAddBranch ); + branchAddContextMenu->addAction ( actionAddBranchBefore ); + branchAddContextMenu->addAction ( actionAddBranchAbove); + branchAddContextMenu->addAction ( actionAddBranchBelow ); branchAddContextMenu->addSeparator(); - branchAddContextMenu->addAction ( actionEditImportAdd ); - branchAddContextMenu->addAction ( actionEditImportReplace ); + branchAddContextMenu->addAction ( actionImportAdd ); + branchAddContextMenu->addAction ( actionImportReplace ); // Submenu "Remove" branchRemoveContextMenu =branchContextMenu->addMenu (tr ("Remove","Context menu name")); - branchRemoveContextMenu->addAction (actionEditCut); - branchRemoveContextMenu->addAction ( actionEditDelete ); - branchRemoveContextMenu->addAction ( actionEditDeleteKeepChildren ); - branchRemoveContextMenu->addAction ( actionEditDeleteChildren ); + branchRemoveContextMenu->addAction (actionCut); + branchRemoveContextMenu->addAction ( actionDelete ); + branchRemoveContextMenu->addAction ( actionDeleteKeepChildren ); + branchRemoveContextMenu->addAction ( actionDeleteChildren ); - actionEditSaveBranch->addTo( branchContextMenu ); + actionSaveBranch->addTo( branchContextMenu ); actionFileNewCopy->addTo (branchContextMenu ); branchContextMenu->addSeparator(); - branchContextMenu->addAction ( actionEditLoadImage); + branchContextMenu->addAction ( actionLoadImage); // Submenu for Links (URLs, vymLinks) branchLinksContextMenu =new QMenu (this); branchContextMenu->addSeparator(); branchLinksContextMenu=branchContextMenu->addMenu(tr("References (URLs, vymLinks, ...)","Context menu name")); - branchLinksContextMenu->addAction ( actionEditOpenURL ); - branchLinksContextMenu->addAction ( actionEditOpenURLTab ); - branchLinksContextMenu->addAction ( actionEditOpenMultipleURLTabs ); - branchLinksContextMenu->addAction ( actionEditURL ); - branchLinksContextMenu->addAction ( actionEditLocalURL ); - branchLinksContextMenu->addAction ( actionEditHeading2URL ); - branchLinksContextMenu->addAction ( actionEditBugzilla2URL ); + branchLinksContextMenu->addAction ( actionOpenURL ); + branchLinksContextMenu->addAction ( actionOpenURLTab ); + branchLinksContextMenu->addAction ( actionOpenMultipleURLTabs ); + branchLinksContextMenu->addAction ( actionURL ); + branchLinksContextMenu->addAction ( actionLocalURL ); + branchLinksContextMenu->addAction ( actionHeading2URL ); + branchLinksContextMenu->addAction ( actionBugzilla2URL ); if (settings.value( "/mainwindow/showTestMenu",false).toBool() ) { - branchLinksContextMenu->addAction ( actionEditFATE2URL ); + branchLinksContextMenu->addAction ( actionFATE2URL ); } branchLinksContextMenu->addSeparator(); - branchLinksContextMenu->addAction ( actionEditOpenVymLink ); - branchLinksContextMenu->addAction ( actionEditOpenMultipleVymLinks ); - branchLinksContextMenu->addAction ( actionEditVymLink ); - branchLinksContextMenu->addAction ( actionEditDeleteVymLink ); + branchLinksContextMenu->addAction ( actionOpenVymLink ); + branchLinksContextMenu->addAction ( actionOpenMultipleVymLinks ); + branchLinksContextMenu->addAction ( actionVymLink ); + branchLinksContextMenu->addAction ( actionDeleteVymLink ); // Context Menu for XLinks in a branch menu @@ -1604,8 +1604,8 @@ floatimageContextMenu->addAction (a); floatimageContextMenu->addSeparator(); - actionEditCopy->addTo( floatimageContextMenu ); - actionEditCut->addTo( floatimageContextMenu ); + actionCopy->addTo( floatimageContextMenu ); + actionCut->addTo( floatimageContextMenu ); floatimageContextMenu->addSeparator(); floatimageContextMenu->addAction ( actionFormatHideLinkUnselected ); @@ -1613,9 +1613,9 @@ // Context menu for canvas canvasContextMenu =new QMenu (this); - actionEditMapInfo->addTo( canvasContextMenu ); if (settings.value( "/mainwindow/showTestMenu",false).toBool() ) - actionEditAddMapCenter->addTo( canvasContextMenu ); + actionAddMapCenter->addTo( canvasContextMenu ); + actionMapInfo->addTo( canvasContextMenu ); canvasContextMenu->insertSeparator(); actionGroupFormatLinkStyles->addTo( canvasContextMenu ); canvasContextMenu->insertSeparator(); @@ -3412,10 +3412,10 @@ { if (actionSettingsUseDelKey->isOn()) { - actionEditDelete->setAccel (QKeySequence (Qt::Key_Delete)); + actionDelete->setAccel (QKeySequence (Qt::Key_Delete)); } else { - actionEditDelete->setAccel (QKeySequence ("")); + actionDelete->setAccel (QKeySequence ("")); } } @@ -3482,9 +3482,9 @@ if (m) m->updateNoteFlag(); } -void Main::updateSatellites(MapEditor *me) +void Main::updateSatellites(VymModel* model) { - branchPropertyWindow->setModel (me->getModel() ); + branchPropertyWindow->setModel (model ); } void Main::updateActions() @@ -3534,14 +3534,14 @@ actionFileSave->setEnabled( m->hasChanged() ); if (m->isUndoAvailable()) - actionEditUndo->setEnabled( true); + actionUndo->setEnabled( true); else - actionEditUndo->setEnabled( false); + actionUndo->setEnabled( false); if (m->isRedoAvailable()) - actionEditRedo->setEnabled( true); + actionRedo->setEnabled( true); else - actionEditRedo->setEnabled( false); + actionRedo->setEnabled( false); LinkableMapObj *selection=m->getSelection(); if (selection) @@ -3577,54 +3577,54 @@ standardFlagsDefault->setEnabled (true); - actionEditToggleScroll->setEnabled (true); + actionToggleScroll->setEnabled (true); if ( bo->isScrolled() ) - actionEditToggleScroll->setOn(true); + actionToggleScroll->setOn(true); else - actionEditToggleScroll->setOn(false); + actionToggleScroll->setOn(false); if ( bo->getURL().isEmpty() ) { - actionEditOpenURL->setEnabled (false); - actionEditOpenURLTab->setEnabled (false); + actionOpenURL->setEnabled (false); + actionOpenURLTab->setEnabled (false); } else { - actionEditOpenURL->setEnabled (true); - actionEditOpenURLTab->setEnabled (true); + actionOpenURL->setEnabled (true); + actionOpenURLTab->setEnabled (true); } if ( bo->getVymLink().isEmpty() ) { - actionEditOpenVymLink->setEnabled (false); - actionEditDeleteVymLink->setEnabled (false); + actionOpenVymLink->setEnabled (false); + actionDeleteVymLink->setEnabled (false); } else { - actionEditOpenVymLink->setEnabled (true); - actionEditDeleteVymLink->setEnabled (true); + actionOpenVymLink->setEnabled (true); + actionDeleteVymLink->setEnabled (true); } if (bo->canMoveBranchUp()) - actionEditMoveUp->setEnabled (true); + actionMoveUp->setEnabled (true); else - actionEditMoveUp->setEnabled (false); + actionMoveUp->setEnabled (false); if (bo->canMoveBranchDown()) - actionEditMoveDown->setEnabled (true); + actionMoveDown->setEnabled (true); else - actionEditMoveDown->setEnabled (false); - - - actionEditToggleHideExport->setEnabled (true); - actionEditToggleHideExport->setOn (bo->hideInExport() ); - - actionEditCopy->setEnabled (true); - actionEditCut->setEnabled (true); + actionMoveDown->setEnabled (false); + + + actionToggleHideExport->setEnabled (true); + actionToggleHideExport->setOn (bo->hideInExport() ); + + actionCopy->setEnabled (true); + actionCut->setEnabled (true); if (!clipboardEmpty) - actionEditPaste->setEnabled (true); + actionPaste->setEnabled (true); else - actionEditPaste->setEnabled (false); + actionPaste->setEnabled (false); for (int i=0; isetEnabled(true); - actionEditDelete->setEnabled (true); + actionDelete->setEnabled (true); actionFormatHideLinkUnselected->setOn (selection->getHideLinkUnselected()); } @@ -3632,42 +3632,42 @@ { FloatObj *fo=(FloatImageObj*)selection; - actionEditOpenURL->setEnabled (false); - actionEditOpenVymLink->setEnabled (false); - actionEditDeleteVymLink->setEnabled (false); - actionEditToggleHideExport->setEnabled (true); - actionEditToggleHideExport->setOn (fo->hideInExport() ); - - - actionEditCopy->setEnabled (true); - actionEditCut->setEnabled (true); - actionEditPaste->setEnabled (false); + actionOpenURL->setEnabled (false); + actionOpenVymLink->setEnabled (false); + actionDeleteVymLink->setEnabled (false); + actionToggleHideExport->setEnabled (true); + actionToggleHideExport->setOn (fo->hideInExport() ); + + + actionCopy->setEnabled (true); + actionCut->setEnabled (true); + actionPaste->setEnabled (false); for (int i=0; isetEnabled(false); - actionEditDelete->setEnabled (true); + actionDelete->setEnabled (true); actionFormatHideLinkUnselected->setOn ( selection->getHideLinkUnselected()); - actionEditMoveUp->setEnabled (false); - actionEditMoveDown->setEnabled (false); + actionMoveUp->setEnabled (false); + actionMoveDown->setEnabled (false); } } else { - actionEditCopy->setEnabled (false); - actionEditCut->setEnabled (false); - actionEditPaste->setEnabled (false); + actionCopy->setEnabled (false); + actionCut->setEnabled (false); + actionPaste->setEnabled (false); for (int i=0; isetEnabled(false); - actionEditToggleScroll->setEnabled (false); - actionEditOpenURL->setEnabled (false); - actionEditOpenVymLink->setEnabled (false); - actionEditDeleteVymLink->setEnabled (false); - actionEditHeading2URL->setEnabled (false); - actionEditDelete->setEnabled (false); - actionEditMoveUp->setEnabled (false); - actionEditMoveDown->setEnabled (false); - actionEditToggleHideExport->setEnabled (false); + actionToggleScroll->setEnabled (false); + actionOpenURL->setEnabled (false); + actionOpenVymLink->setEnabled (false); + actionDeleteVymLink->setEnabled (false); + actionHeading2URL->setEnabled (false); + actionDelete->setEnabled (false); + actionMoveUp->setEnabled (false); + actionMoveDown->setEnabled (false); + actionToggleHideExport->setEnabled (false); } } diff -r 462d39502273 -r 11f9124c1cca mainwindow.h --- a/mainwindow.h Wed Jul 16 11:56:44 2008 +0000 +++ b/mainwindow.h Mon Aug 04 10:43:06 2008 +0000 @@ -196,7 +196,7 @@ void windowToggleAntiAlias(); void windowToggleSmoothPixmap(); void updateNoteFlag(); - void updateSatellites(MapEditor *); + void updateSatellites(VymModel*); void updateActions(); ModMode getModMode(); bool autoEditNewBranch(); @@ -258,44 +258,48 @@ QAction* actionFileNewCopy; QAction* actionFileSave; QAction* actionFilePrint; - QAction* actionEditUndo; - QAction* actionEditRedo; - QAction *actionEditCopy; - QAction *actionEditCut; - QAction *actionEditPaste; - QAction *actionEditMoveUp; - QAction *actionEditMoveDown; - QAction *actionEditSortChildren; - QAction *actionEditToggleScroll; - QAction* actionEditOpenURL; - QAction* actionEditOpenURLTab; - QAction* actionEditOpenMultipleURLTabs; - QAction* actionEditURL; - QAction* actionEditLocalURL; - QAction* actionEditHeading2URL; - QAction* actionEditBugzilla2URL; - QAction* actionEditFATE2URL; - QAction *actionEditOpenVymLink; - QAction *actionEditOpenMultipleVymLinks; - QAction *actionEditVymLink; - QAction *actionEditDeleteVymLink; - QAction *actionEditToggleHideExport; - QAction *actionEditMapInfo; - QAction *actionEditHeading; - QAction *actionEditDelete; - QAction *actionEditAddMapCenter; - QAction *actionEditAddBranch; - QAction *actionEditAddBranchBefore; - QAction *actionEditAddBranchAbove; - QAction *actionEditAddBranchBelow; - QAction *actionEditDeleteKeepChildren; - QAction *actionEditDeleteChildren; - QAction *actionEditImportAdd; - QAction *actionEditImportReplace; - QAction *actionEditSaveBranch; - QAction *actionEditSelectFirst; - QAction *actionEditSelectLast; - QAction *actionEditLoadImage; + QAction* actionUndo; + QAction* actionRedo; + QAction *actionCopy; + QAction *actionCut; + QAction *actionPaste; + QAction *actionMoveUp; + QAction *actionMoveDown; + QAction *actionSortChildren; + QAction *actionToggleScroll; + QAction* actionOpenURL; + QAction* actionOpenURLTab; + QAction* actionOpenMultipleURLTabs; + QAction* actionURL; + QAction* actionLocalURL; + QAction* actionHeading2URL; + QAction* actionBugzilla2URL; + QAction* actionFATE2URL; + QAction *actionOpenVymLink; + QAction *actionOpenMultipleVymLinks; + QAction *actionVymLink; + QAction *actionDeleteVymLink; + QAction *actionToggleHideExport; + QAction *actionMapInfo; + QAction *actionHeading; + QAction *actionDelete; + +public: + QAction *actionAddMapCenter; + +private: + QAction *actionAddBranch; + QAction *actionAddBranchBefore; + QAction *actionAddBranchAbove; + QAction *actionAddBranchBelow; + QAction *actionDeleteKeepChildren; + QAction *actionDeleteChildren; + QAction *actionImportAdd; + QAction *actionImportReplace; + QAction *actionSaveBranch; + QAction *actionSelectFirst; + QAction *actionSelectLast; + QAction *actionLoadImage; QAction* actionFormatColor; QAction* actionFormatPickColor; diff -r 462d39502273 -r 11f9124c1cca mapeditor.cpp --- a/mapeditor.cpp Wed Jul 16 11:56:44 2008 +0000 +++ b/mapeditor.cpp Mon Aug 04 10:43:06 2008 +0000 @@ -42,7 +42,6 @@ model=vm; model->setScene (mapScene); - model->setMapEditor (this); model->registerEditor(this); model->addMapCenter(); // FIXME create this in MapEditor until BO and MCO are independent of scene model->makeDefault(); @@ -71,7 +70,7 @@ setAcceptDrops (true); - model->reposition(); //FIXME really still needed? + //model->reposition(); //FIXME really still needed? // Action to embed LineEdit for heading in Scene @@ -287,10 +286,30 @@ void MapEditor::testFunction1() { - BranchObj *bo=model->getSelectedBranch(); + //BranchObj *bo=model->getSelectedBranch(); //if (bo) model->moveAway (bo); - if (bo) bo->setLinkStyle (LinkableMapObj::Line); + //if (bo) bo->setLinkStyle (LinkableMapObj::Line); + + // Displacement and animation of all non-mainbranches + QPointF p; + QPointF q; + BranchObj *bo; + bo=model->first(); + while (bo) + { + if (bo->getDepth() >0 && !bo->hasScrolledParent(bo) ) + { + p=QPointF (qrand() %600-300, qrand () %600-300); + bo->setRelPos(); + q=bo->getRelPos(); + model->startAnimation (bo,p, q); + } + bo=model->next(bo); + } + + + /* TODO Hide hidden stuff temporary, maybe add this as regular function somewhere if (hidemode==HideNone) { @@ -400,8 +419,11 @@ { // No MapObj found, we are on the Canvas itself // Context Menu on scene model->updateActions(); - contextMenuPos=p; - canvasContextMenu->popup(e->globalPos() ); + + // Open context menu synchronously to position new mapcenter + model->setContextPos (p); + canvasContextMenu->exec(e->globalPos() ); + model->unsetContextPos (); } e->accept(); } @@ -796,9 +818,9 @@ QString pold=qpointfToString(movingObj_orgPos); QString pnow=qpointfToString(bo->getAbsPos()); model->saveState( - fo, + bo, "move "+pold, - fo, + bo, "move "+pnow, QString("Move mapcenter %1 to position %2").arg(getName(bo)).arg(pnow)); } @@ -890,6 +912,7 @@ // if (lmosel->getOrientation()==LinkableMapObj::LeftOfCenter) dst.setX (dst.x()+lmosel->width() ); model->startAnimation( + (BranchObj*)lmosel, lmosel->getRelPos(), movingObj_orgRelPos // QPointF (movingObj_orgPos.x() - dst.x(), movingObj_orgPos.y() - dst.y() ) diff -r 462d39502273 -r 11f9124c1cca mapeditor.h --- a/mapeditor.h Wed Jul 16 11:56:44 2008 +0000 +++ b/mapeditor.h Mon Aug 04 10:43:06 2008 +0000 @@ -28,12 +28,11 @@ public: void toggleStandardFlag(QString); - void updateSelection(); // update geometry of selection + void updateSelection(); // update geometry of selection AttributeTable* attributeTable(); - void testFunction1(); // just testing new stuff - void testFunction2(); // just testing new stuff - // set /mainwindo/showTestMenu=true... + void testFunction1(); // just testing new stuff + void testFunction2(); // just testing new stuff public slots: void editHeading(); @@ -60,7 +59,7 @@ private: QGraphicsScene *mapScene; - VymModel *model; // Vym Map, includding several mapCenters + VymModel *model; //!< Vym Map, includding several mapCenters bool adjustCanvasRequested; // collect requests until end of user event BranchObj *editingBO; // entering Text into BO diff -r 462d39502273 -r 11f9124c1cca selection.cpp --- a/selection.cpp Wed Jul 16 11:56:44 2008 +0000 +++ b/selection.cpp Mon Aug 04 10:43:06 2008 +0000 @@ -77,7 +77,7 @@ selboxList.append (sb); lmo->select(); update(); - mainWindow->updateSatellites (model->getMapEditor() ); + mainWindow->updateSatellites (model); return true; } diff -r 462d39502273 -r 11f9124c1cca tex/vym.changelog --- a/tex/vym.changelog Wed Jul 16 11:56:44 2008 +0000 +++ b/tex/vym.changelog Mon Aug 04 10:43:06 2008 +0000 @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sun Jul 27 16:37:24 CEST 2008 - uwe + +- Bugfix: Animation timer didn't stop after animation was done, which + caused high load + ------------------------------------------------------------------- Wed Jul 16 13:47:01 CEST 2008 - uwedr@suse.de diff -r 462d39502273 -r 11f9124c1cca version.h --- a/version.h Wed Jul 16 11:56:44 2008 +0000 +++ b/version.h Mon Aug 04 10:43:06 2008 +0000 @@ -7,7 +7,7 @@ #define __VYM_VERSION "1.13.0" //#define __VYM_CODENAME "Codename: RC-1" #define __VYM_CODENAME "Codename: development version" -#define __VYM_BUILD_DATE "2008-07-02" +#define __VYM_BUILD_DATE "2008-07-18" bool checkVersion(const QString &); diff -r 462d39502273 -r 11f9124c1cca vymmodel.cpp --- a/vymmodel.cpp Wed Jul 16 11:56:44 2008 +0000 +++ b/vymmodel.cpp Mon Aug 04 10:43:06 2008 +0000 @@ -156,14 +156,7 @@ } -void VymModel::setMapEditor(MapEditor *me) -{ - mapEditor=me; - for (int i=0; isetMapEditor(mapEditor); -} - -MapEditor* VymModel::getMapEditor() +MapEditor* VymModel::getMapEditor() // FIXME better return favourite editor here { return mapEditor; } @@ -1962,7 +1955,7 @@ MapCenterObj* VymModel::addMapCenter () { - MapCenterObj *mco=addMapCenter (QPointF(0,0)); + MapCenterObj *mco=addMapCenter (contextPos); selection.select (mco); updateActions(); ensureSelectionVisible(); @@ -1970,11 +1963,8 @@ mco, "delete()", NULL, - // FIXME how to position LineEdit without contextMenuPos ? - // QString ("addMapCenter (%1,%2)").arg (contextMenuPos.x()).arg(contextMenuPos.y()), - // QString ("Adding MapCenter to (%1,%2").arg (contextMenuPos.x()).arg(contextMenuPos.y()) - QString ("addMapCenter (%1,%2)").arg (0).arg(0), - QString ("Adding MapCenter to (%1,%2").arg (0).arg(0) + QString ("addMapCenter (%1,%2)").arg (contextPos.x()).arg(contextPos.y()), + QString ("Adding MapCenter to (%1,%2)").arg (contextPos.x()).arg(contextPos.y()) ); return mco; } @@ -1990,7 +1980,7 @@ return mapCenter; } -MapCenterObj *VymModel::removeMapCenter(MapCenterObj* mco) +MapCenterObj* VymModel::removeMapCenter(MapCenterObj* mco) { int i=mapCenters.indexOf (mco); if (i>=0) @@ -2002,6 +1992,15 @@ return NULL; } +MapCenterObj* VymModel::getLastMapCenter() +{ + if (mapCenters.size()>0) + return mapCenters.last(); + else + return NULL; + +} + BranchObj* VymModel::addNewBranchInt(int num) { @@ -3674,12 +3673,26 @@ // View related ////////////////////////////////////////////// -void VymModel::registerEditor(QWidget *) +void VymModel::registerEditor(QWidget *me) { + mapEditor=(MapEditor*)me; + for (int i=0; isetMapEditor(mapEditor); } void VymModel::unregisterEditor(QWidget *) { + mapEditor=NULL; +} + +void VymModel::setContextPos(QPointF p) +{ + contextPos=p; +} + +void VymModel::unsetContextPos() +{ + contextPos=QPointF(); } void VymModel::updateNoteFlag() @@ -4043,13 +4056,12 @@ } mapEditor->updateSelection(); mapScene->update(); - animationTimer->start(); + if (!animObjList.isEmpty()) animationTimer->start(); } -void VymModel::startAnimation(const QPointF &start, const QPointF &dest) +void VymModel::startAnimation(BranchObj *bo, const QPointF &start, const QPointF &dest) { - BranchObj *bo=getSelectedBranch(); if (bo && bo->getDepth()>0) { AnimPoint ap; diff -r 462d39502273 -r 11f9124c1cca vymmodel.h --- a/vymmodel.h Wed Jul 16 11:56:44 2008 +0000 +++ b/vymmodel.h Mon Aug 04 10:43:06 2008 +0000 @@ -36,7 +36,6 @@ void init(); void makeTmpDirectories(); //!< create temporary directories e.g. for history - void setMapEditor(MapEditor *me); // FIXME should not be necessary in Model/View MapEditor* getMapEditor(); // FIXME not necessary bool isRepositionBlocked(); //!< While load or undo there is no need to update graphicsview @@ -303,6 +302,8 @@ 0..n insert at a specific position in selections parent (needed for free relinking) */ + MapCenterObj* getLastMapCenter(); //!< get last added MapCenter, used for context menu + private: BranchObj* addNewBranchInt(int); // pos allows to add above/below selection public: @@ -396,6 +397,13 @@ public: void registerEditor (QWidget *); void unregisterEditor (QWidget *); + +private: + QPointF contextPos; //!< local position during context menu +public: + void setContextPos (QPointF); //!< local position during context menu + void unsetContextPos (); //!< forget local position after context menu + void updateNoteFlag(); //!< Signal origination in TextEditor void updateRelPositions(); @@ -461,7 +469,7 @@ private slots: void animate(); //!< Called by timer to animate stuff public: - void startAnimation(const QPointF &start, const QPointF &dest); + void startAnimation(BranchObj *bo, const QPointF &start, const QPointF &dest); void stopAnimation(MapObj *mo); //////////////////////////////////////////// diff -r 462d39502273 -r 11f9124c1cca xml-vym.cpp --- a/xml-vym.cpp Wed Jul 16 11:56:44 2008 +0000 +++ b/xml-vym.cpp Mon Aug 04 10:43:06 2008 +0000 @@ -150,8 +150,8 @@ // Treat the found mapcenter as a branch // in an existing map LinkableMapObj* lmo=model->getSelection(); - if (lmo && (typeid(*lmo) == typeid(BranchObj) ) - || (typeid(*lmo) == typeid(MapCenterObj) ) ) + if (lmo && ( (typeid(*lmo) == typeid(BranchObj) ) + || (typeid(*lmo) == typeid(MapCenterObj) ) ) ) { lastBranch=(BranchObj*)lmo; if (loadMode==ImportAdd) @@ -207,8 +207,8 @@ loadMode=ImportAdd; lmo=model->first(); } - if (lmo && (typeid(*lmo) == typeid(BranchObj) ) - || (typeid(*lmo) == typeid(MapCenterObj) ) ) + if (lmo && ( (typeid(*lmo) == typeid(BranchObj) ) + || (typeid(*lmo) == typeid(MapCenterObj) ) ) ) { lastBranch=(BranchObj*)(lmo); if (eName=="branch")