mainwindow.cpp
changeset 393 053b8645e3e9
parent 390 0e1aeb21cb78
child 394 67cfa6e6b863
     1.1 --- a/mainwindow.cpp	Mon Oct 16 12:42:54 2006 +0000
     1.2 +++ b/mainwindow.cpp	Wed Oct 18 10:45:00 2006 +0000
     1.3 @@ -161,7 +161,7 @@
     1.4  
     1.5  	// Connect TextEditor, so that we can update flags if text changes
     1.6  	connect (textEditor, SIGNAL (textHasChanged() ), this, SLOT (updateNoteFlag()));
     1.7 -	connect (textEditor, SIGNAL (textClosed() ), this, SLOT (updateActions()));
     1.8 +	connect (textEditor, SIGNAL (textEditorClosed() ), this, SLOT (updateActions()));
     1.9  
    1.10  	updateGeometry();
    1.11  }
    1.12 @@ -681,8 +681,6 @@
    1.13      connect( a, SIGNAL( triggered() ), this, SLOT( editMapInfo() ) );
    1.14  	actionEditMapInfo=a;
    1.15  
    1.16 -	editMenu->addSeparator();
    1.17 -
    1.18  	// Import at selection (adding to selection)
    1.19      a = new QAction( tr( "Add map (insert)" ),this);
    1.20  	a->setStatusTip (tr( "Add map at selection" ));
    1.21 @@ -1393,10 +1391,16 @@
    1.22      QMenu *testMenu = menuBar()->addMenu( tr( "&Test" ));
    1.23  
    1.24      QAction *a;
    1.25 -    a = new QAction( tr( "test flag" ), this);
    1.26 +    a = new QAction( tr( "Test function" ), this);
    1.27      a->setStatusTip( tr( "Call test function" ));
    1.28 +	a->setShortcut (Qt::Key_F4 );
    1.29      connect( a, SIGNAL( triggered() ), this, SLOT( testFunction() ) );
    1.30  	testMenu->addAction (a);
    1.31 +    a = new QAction( tr( "Command" ), this);
    1.32 +    a->setStatusTip( tr( "Enter command to call in editor" ));
    1.33 +	a->setShortcut (Qt::Key_F5 );
    1.34 +    connect( a, SIGNAL( triggered() ), this, SLOT( testCommand() ) );
    1.35 +	testMenu->addAction (a);
    1.36  }
    1.37  
    1.38  // Help Actions
    1.39 @@ -3090,7 +3094,7 @@
    1.40  	if (!me) return;
    1.41  
    1.42  	// updateActions is also called when NoteEditor is closed
    1.43 -	actionViewToggleNoteEditor->setOn (textEditor->isVisible());
    1.44 +	actionViewToggleNoteEditor->setOn (textEditor->showWithMain());
    1.45  
    1.46  	QAction *a;
    1.47  	if (me->getLinkColorHint()==HeadingColor) 
    1.48 @@ -3333,9 +3337,19 @@
    1.49  
    1.50  void Main::testFunction()
    1.51  {
    1.52 +	if (!currentMapEditor()) return;
    1.53  	currentMapEditor()->testFunction();
    1.54  }
    1.55  
    1.56 +void Main::testCommand()
    1.57 +{
    1.58 +	if (!currentMapEditor()) return;
    1.59 +	bool ok;
    1.60 +	QString com = QInputDialog::getText(
    1.61 +			__VYM, "Enter Command:", QLineEdit::Normal,"command", &ok, this );
    1.62 +	if (ok) currentMapEditor()->parseAtom(com);
    1.63 +}
    1.64 +
    1.65  void Main::helpDoc()
    1.66  {
    1.67  	QString docpath;