diff -r e44baadd4958 -r 72cc3873306a mainwindow.cpp --- a/mainwindow.cpp Thu Sep 01 15:35:18 2005 +0000 +++ b/mainwindow.cpp Mon Sep 05 11:56:31 2005 +0000 @@ -121,6 +121,7 @@ extern QAction *actionFormatLinkStyleParabel; extern QAction *actionFormatLinkStylePolyLine; extern QAction *actionFormatLinkStylePolyParabel; +extern QAction *actionFormatHideLinkUnselected; extern QAction *actionViewToggleNoteEditor; @@ -234,6 +235,10 @@ connect (findWindow, SIGNAL( somethingChanged() ), this, SLOT(editFindChanged() ) ); + // FIXME testing + // Connect TextEditor, so that we can update flags if text changes + connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag())); + updateGeometry(); // Creating the default map into first tab is done in main.cpp now... @@ -453,21 +458,18 @@ a = new QAction( tr( "Open URL" ), QPixmap(flag_url_xpm), tr( "Open URL" ), CTRL + Key_U, this, "url" ); connect( a, SIGNAL( activated() ), this, SLOT( editOpenURL() ) ); - a->addTo( menu ); a->addTo( tb ); a->setEnabled (false); actionEditOpenURL=a; a = new QAction( tr( "Edit URL" ), QPixmap(), tr( "Edit URL"+QString("...") ), SHIFT + CTRL + Key_U, this, "url" ); connect( a, SIGNAL( activated() ), this, SLOT( editURL() ) ); - a->addTo( menu ); a->setEnabled (false); actionListBranches.append(a); actionEditURL=a; a = new QAction( tr( "Use heading of selected branch as URL" ), QPixmap(), tr( "Use heading for URL" ), 0, this, "heading2url" ); connect( a, SIGNAL( activated() ), this, SLOT( editHeading2URL() ) ); - a->addTo( menu ); a->setEnabled (false); actionListBranches.append(a); actionEditHeading2URL=a; @@ -478,33 +480,26 @@ actionListBranches.append(a); actionEditBugzilla2URL=a; - menu->insertSeparator(); a = new QAction( tr( "Jump to another vym map, if needed load it first" ), QPixmap(flag_vymlink_xpm), tr( "Jump to map" ), 0, this, "jumpMap" ); connect( a, SIGNAL( activated() ), this, SLOT( editOpenVymLink() ) ); - a->addTo( menu ); a->addTo( tb ); a->setEnabled (false); actionEditOpenVymLink=a; a = new QAction( tr( "Edit link to another vym map" ), QPixmap(), tr( "Edit vym link"+QString("...") ), 0, this, "editLinkMap" ); connect( a, SIGNAL( activated() ), this, SLOT( editVymLink() ) ); - a->addTo( menu ); a->setEnabled (false); actionListBranches.append(a); actionEditVymLink=a; a = new QAction( tr( "Delete link to another vym map" ), QPixmap(), tr( "Delete vym link" ), 0, this, "deleteLinkMap" ); connect( a, SIGNAL( activated() ), this, SLOT( editDeleteVymLink() ) ); - a->addTo( menu ); a->setEnabled (false); actionEditDeleteVymLink=a; - menu->insertSeparator(); - a = new QAction( tr( "Edit Map Info" ), QPixmap(), tr( "Edit Map Info"+QString("...") ), 0, this, "editMapInfo" ); connect( a, SIGNAL( activated() ), this, SLOT( editMapInfo() ) ); - a->addTo( menu ); a->setEnabled (true); actionEditMapInfo=a; @@ -521,7 +516,6 @@ a = new QAction( tr( "edit Heading" ),tr( "Edit heading" ), Key_F2, this, "editHeading" ); connect( a, SIGNAL( activated() ), this, SLOT( editHeading() ) ); a->setEnabled (false); - a->addTo ( menu ); actionEditHeading=a; actionListBranches.append(a); @@ -529,7 +523,6 @@ a = new QAction( tr( "Delete Selection" ),tr( "Delete Selection" ), Key_Delete, this, "deleteBranch" ); connect( a, SIGNAL( activated() ), this, SLOT( editDeleteSelection() ) ); a->setEnabled (false); - a->addTo ( menu ); actionEditDelete=a; // Shortcut to add branch @@ -697,6 +690,11 @@ connect( a, SIGNAL( activated() ), this, SLOT( formatFrameRectangle() ) ); actionFormatFrameRectangle=a; + a = new QAction( tr( "Hide link" ),tr( "Hide link if object is not selected" ), 0, actionFormatHideLinkUnselected, "hideLinkUnselected" ); + a->setToggleAction(true); + connect( a, SIGNAL( activated() ), this, SLOT( formatHideLinkUnselected() ) ); + actionFormatHideLinkUnselected=a; + menu->insertSeparator(); a= new QAction( tr( "Use same color for links and headings" ), QPixmap(), tr( "&Use color of heading for link" ), 0, this, "formatLinkColorHint" ); a->setToggleAction(true); @@ -924,6 +922,9 @@ branchContextMenu->insertSeparator(); actionGroupFormatFrameTypes->addTo( branchContextMenu ); + branchContextMenu->insertSeparator(); + actionFormatHideLinkUnselected->addTo( branchContextMenu ); + // Context Menu for links in a branch menu // This will be populated "on demand" in MapEditor::updateActions branchContextMenu->insertSeparator(); @@ -961,7 +962,8 @@ a->addTo( floatimageContextMenu); actionEditToggleFloatExport=a; - + floatimageContextMenu->insertSeparator(); + actionFormatHideLinkUnselected->addTo( floatimageContextMenu ); // Context menu for exports exportMenu->insertItem ( tr("Export map as image"),exportImageFormatMenu); @@ -2195,6 +2197,12 @@ currentMapEditor()->setFrame(Rectangle); } +void Main::formatHideLinkUnselected() +{ + if (currentMapEditor()) + currentMapEditor()->setHideLinkUnselected(actionFormatHideLinkUnselected->isOn()); +} + void Main::viewZoomReset() { if (currentMapEditor()) @@ -2273,6 +2281,12 @@ windowShowNoteEditor(); } +void Main::updateNoteFlag() +{ + if (currentMapEditor()) + currentMapEditor()->updateNoteFlag(); +} + void Main::windowShowNoteEditor() { textEditor->setShowWithMain(true);