diff -r 18f824bd3070 -r 053b8645e3e9 mainwindow.cpp --- a/mainwindow.cpp Mon Oct 16 12:42:54 2006 +0000 +++ b/mainwindow.cpp Wed Oct 18 10:45:00 2006 +0000 @@ -161,7 +161,7 @@ // Connect TextEditor, so that we can update flags if text changes connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag())); - connect (textEditor, SIGNAL (textClosed() ), this, SLOT (updateActions())); + connect (textEditor, SIGNAL (textEditorClosed() ), this, SLOT (updateActions())); updateGeometry(); } @@ -681,8 +681,6 @@ connect( a, SIGNAL( triggered() ), this, SLOT( editMapInfo() ) ); actionEditMapInfo=a; - editMenu->addSeparator(); - // Import at selection (adding to selection) a = new QAction( tr( "Add map (insert)" ),this); a->setStatusTip (tr( "Add map at selection" )); @@ -1393,10 +1391,16 @@ QMenu *testMenu = menuBar()->addMenu( tr( "&Test" )); QAction *a; - a = new QAction( tr( "test flag" ), this); + a = new QAction( tr( "Test function" ), this); a->setStatusTip( tr( "Call test function" )); + a->setShortcut (Qt::Key_F4 ); connect( a, SIGNAL( triggered() ), this, SLOT( testFunction() ) ); testMenu->addAction (a); + a = new QAction( tr( "Command" ), this); + a->setStatusTip( tr( "Enter command to call in editor" )); + a->setShortcut (Qt::Key_F5 ); + connect( a, SIGNAL( triggered() ), this, SLOT( testCommand() ) ); + testMenu->addAction (a); } // Help Actions @@ -3090,7 +3094,7 @@ if (!me) return; // updateActions is also called when NoteEditor is closed - actionViewToggleNoteEditor->setOn (textEditor->isVisible()); + actionViewToggleNoteEditor->setOn (textEditor->showWithMain()); QAction *a; if (me->getLinkColorHint()==HeadingColor) @@ -3333,9 +3337,19 @@ void Main::testFunction() { + if (!currentMapEditor()) return; currentMapEditor()->testFunction(); } +void Main::testCommand() +{ + if (!currentMapEditor()) return; + bool ok; + QString com = QInputDialog::getText( + __VYM, "Enter Command:", QLineEdit::Normal,"command", &ok, this ); + if (ok) currentMapEditor()->parseAtom(com); +} + void Main::helpDoc() { QString docpath;