diff -r 16a8ef1d82b2 -r f076fdec767d mainwindow.cpp --- a/mainwindow.cpp Fri Oct 02 09:40:57 2009 +0000 +++ b/mainwindow.cpp Fri Oct 02 13:24:55 2009 +0000 @@ -138,10 +138,6 @@ connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag())); connect (textEditor, SIGNAL (windowClosed() ), this, SLOT (updateActions())); - // Connect HistoryWindow, so that we can update flags - connect (historyWindow, SIGNAL (windowClosed() ), this, SLOT (updateActions())); - - // Initialize script editor scriptEditor = new SimpleScriptEditor(); scriptEditor->move (50,50); @@ -1066,7 +1062,7 @@ a = new QAction(tr( "Antialiasing","View action" ),this ); a->setStatusTip ( tr( "Antialiasing" )); a->setToggleAction(true); - a->setOn (settings.value("/mainwindow/view/AntiAlias",true).toBool()); + a->setChecked (settings.value("/mainwindow/view/AntiAlias",true).toBool()); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleAntiAlias() ) ); actionViewToggleAntiAlias=a; @@ -1074,7 +1070,7 @@ a = new QAction(tr( "Smooth pixmap transformations","View action" ),this ); a->setStatusTip (a->text()); a->setToggleAction(true); - a->setOn (settings.value("/mainwindow/view/SmoothPixmapTransformation",true).toBool()); + a->setChecked (settings.value("/mainwindow/view/SmoothPixmapTransformation",true).toBool()); viewMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleSmoothPixmap() ) ); actionViewToggleSmoothPixmapTransform=a; @@ -1108,7 +1104,7 @@ a->setStatusTip ( tr( "Use modifier to color branches" )); a->setToggleAction(true); a->addTo (tb); - a->setOn(true); + a->setChecked(true); actionModModeColor=a; a= new QAction( QPixmap(iconPath+"modecopy.png"), tr( "Use modifier to copy","Mode modifier" ), actionGroupModModes ); @@ -1399,7 +1395,7 @@ a = new QAction( tr( "Autosave","Settings action"), this); a->setStatusTip( tr( "Autosave")); a->setToggleAction(true); - a->setOn ( settings.value ("/mainwindow/autosave/use",false).toBool()); + a->setChecked ( settings.value ("/mainwindow/autosave/use",false).toBool()); connect( a, SIGNAL( triggered() ), this, SLOT( settingsAutosaveToggle() ) ); settingsMenu->addAction (a); actionSettingsAutosaveToggle=a; @@ -1413,7 +1409,7 @@ a = new QAction( tr( "Write backup file on save","Settings action"), this); a->setStatusTip( tr( "Write backup file on save")); a->setToggleAction(true); - a->setOn ( settings.value ("/mainwindow/writeBackupFile",false).toBool()); + a->setChecked ( settings.value ("/mainwindow/writeBackupFile",false).toBool()); connect( a, SIGNAL( triggered() ), this, SLOT( settingsWriteBackupFileToggle() ) ); settingsMenu->addAction (a); actionSettingsWriteBackupFile=a; @@ -1423,28 +1419,28 @@ a = new QAction( tr( "Edit branch after adding it","Settings action" ), this ); a->setStatusTip( tr( "Edit branch after adding it" )); a->setToggleAction(true); - a->setOn ( settings.value ("/mapeditor/editmode/autoEditNewBranch",true).toBool()); + a->setChecked ( settings.value ("/mapeditor/editmode/autoEditNewBranch",true).toBool()); settingsMenu->addAction (a); actionSettingsAutoEditNewBranch=a; a= new QAction( tr( "Select branch after adding it","Settings action" ), this ); a->setStatusTip( tr( "Select branch after adding it" )); a->setToggleAction(true); - a->setOn ( settings.value ("/mapeditor/editmode/autoSelectNewBranch",false).toBool() ); + a->setChecked ( settings.value ("/mapeditor/editmode/autoSelectNewBranch",false).toBool() ); settingsMenu->addAction (a); actionSettingsAutoSelectNewBranch=a; a= new QAction(tr( "Select existing heading","Settings action" ), this); a->setStatusTip( tr( "Select heading before editing" )); a->setToggleAction(true); - a->setOn ( settings.value ("/mapeditor/editmode/autoSelectText",true).toBool() ); + a->setChecked ( settings.value ("/mapeditor/editmode/autoSelectText",true).toBool() ); settingsMenu->addAction (a); actionSettingsAutoSelectText=a; a= new QAction( tr( "Delete key","Settings action" ), this); a->setStatusTip( tr( "Delete key for deleting branches" )); a->setToggleAction(true); - a->setOn ( settings.value ("/mapeditor/editmode/useDelKey",true).toBool() ); + a->setChecked ( settings.value ("/mapeditor/editmode/useDelKey",true).toBool() ); settingsMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( settingsToggleDelKey() ) ); actionSettingsUseDelKey=a; @@ -1452,21 +1448,21 @@ a= new QAction( tr( "Exclusive flags","Settings action" ), this); a->setStatusTip( tr( "Use exclusive flags in flag toolbars" )); a->setToggleAction(true); - a->setOn ( settings.value ("/mapeditor/editmode/useFlagGroups",true).toBool() ); + a->setChecked ( settings.value ("/mapeditor/editmode/useFlagGroups",true).toBool() ); settingsMenu->addAction (a); actionSettingsUseFlagGroups=a; a= new QAction( tr( "Use hide flags","Settings action" ), this); a->setStatusTip( tr( "Use hide flag during exports " )); a->setToggleAction(true); - a->setOn ( settings.value ("/export/useHideExport",true).toBool() ); + a->setChecked ( settings.value ("/export/useHideExport",true).toBool() ); settingsMenu->addAction (a); actionSettingsUseHideExport=a; a = new QAction( tr( "Animation","Settings action"), this); a->setStatusTip( tr( "Animation")); a->setToggleAction(true); - a->setOn (settings.value("/animation/use",false).toBool() ); + a->setChecked (settings.value("/animation/use",true).toBool() ); connect( a, SIGNAL( triggered() ), this, SLOT( settingsToggleAnimation() ) ); settingsMenu->addAction (a); actionSettingsUseAnimation=a; @@ -2992,7 +2988,7 @@ if (m) { m->setMapLinkStyle("StyleLine"); - actionFormatLinkStyleLine->setOn(true); + actionFormatLinkStyleLine->setChecked(true); } } @@ -3002,7 +2998,7 @@ if (m) { m->setMapLinkStyle("StyleParabel"); - actionFormatLinkStyleParabel->setOn(true); + actionFormatLinkStyleParabel->setChecked(true); } } @@ -3012,7 +3008,7 @@ if (m) { m->setMapLinkStyle("StylePolyLine"); - actionFormatLinkStylePolyLine->setOn(true); + actionFormatLinkStylePolyLine->setChecked(true); } } @@ -3022,7 +3018,7 @@ if (m) { m->setMapLinkStyle("StylePolyParabel"); - actionFormatLinkStylePolyParabel->setOn(true); + actionFormatLinkStylePolyParabel->setChecked(true); } } @@ -3327,6 +3323,11 @@ void Main::updateActions() { + // updateActions is also called when satellites are closed //FIXME-2 doesn't update immediatly, e.g. historyWindow is still visible, when "close" is pressed + actionViewToggleNoteEditor->setChecked (textEditor->isVisible()); + actionViewToggleHistoryWindow->setChecked (historyWindow->isVisible()); + actionViewTogglePropertyWindow->setChecked (branchPropertyWindow->isVisible()); + VymModel *m =currentModel(); if (m) { @@ -3337,16 +3338,16 @@ switch (m->getMapLinkStyle()) { case LinkableMapObj::Line: - actionFormatLinkStyleLine->setOn(true); + actionFormatLinkStyleLine->setChecked(true); break; case LinkableMapObj::Parabel: - actionFormatLinkStyleParabel->setOn(true); + actionFormatLinkStyleParabel->setChecked(true); break; case LinkableMapObj::PolyLine: - actionFormatLinkStylePolyLine->setOn(true); + actionFormatLinkStylePolyLine->setChecked(true); break; case LinkableMapObj::PolyParabel: - actionFormatLinkStylePolyParabel->setOn(true); + actionFormatLinkStylePolyParabel->setChecked(true); break; default: break; @@ -3370,15 +3371,10 @@ actionFilePrint->setEnabled (false); } - // updateActions is also called when NoteEditor is closed - actionViewToggleNoteEditor->setOn (textEditor->isVisible()); - actionViewToggleHistoryWindow->setOn (historyWindow->isVisible()); - actionViewTogglePropertyWindow->setOn (branchPropertyWindow->isVisible()); - if (m && m->getMapLinkColorHint()==LinkableMapObj::HeadingColor) - actionFormatLinkColorHint->setOn(true); + actionFormatLinkColorHint->setChecked(true); else - actionFormatLinkColorHint->setOn(false); + actionFormatLinkColorHint->setChecked(false); if (m && m->hasChanged() ) @@ -3403,7 +3399,7 @@ { if (selbi || selti->getType()==TreeItem::Image) { - actionFormatHideLinkUnselected->setOn (((MapItem*)selti)->getHideLinkUnselected()); + actionFormatHideLinkUnselected->setChecked (((MapItem*)selti)->getHideLinkUnselected()); actionFormatHideLinkUnselected->setEnabled (true); } @@ -3435,9 +3431,9 @@ // System Flags actionToggleScroll->setEnabled (true); if ( selbi->isScrolled() ) - actionToggleScroll->setOn(true); + actionToggleScroll->setChecked(true); else - actionToggleScroll->setOn(false); + actionToggleScroll->setChecked(false); if ( selti->getURL().isEmpty() ) { @@ -3471,7 +3467,7 @@ actionSortChildren->setEnabled (true); actionToggleHideExport->setEnabled (true); - actionToggleHideExport->setOn (selbi->hideInExport() ); + actionToggleHideExport->setChecked (selbi->hideInExport() ); actionCopy->setEnabled (true); actionCut->setEnabled (true); @@ -3489,7 +3485,7 @@ actionOpenVymLink->setEnabled (false); actionDeleteVymLink->setEnabled (false); actionToggleHideExport->setEnabled (true); - actionToggleHideExport->setOn (selti->hideInExport() ); + actionToggleHideExport->setChecked (selti->hideInExport() ); actionCopy->setEnabled (true); @@ -3547,14 +3543,14 @@ { textEditor->setShowWithMain(true); textEditor->show(); - actionViewToggleNoteEditor->setOn (true); + actionViewToggleNoteEditor->setChecked (true); } void Main::windowHideNoteEditor() { textEditor->setShowWithMain(false); textEditor->hide(); - actionViewToggleNoteEditor->setOn (false); + actionViewToggleNoteEditor->setChecked (false); } void Main::setScript (const QString &script)