mainwindow.cpp
changeset 432 f867269ab8a1
parent 428 9ae68208e2ff
child 434 c585be63ec69
     1.1 --- a/mainwindow.cpp	Sat Feb 24 12:32:53 2007 +0000
     1.2 +++ b/mainwindow.cpp	Mon Mar 05 23:22:51 2007 +0000
     1.3 @@ -98,6 +98,13 @@
     1.4  	branchPropertyWindow = new BranchPropertyWindow();
     1.5  	branchPropertyWindow->move (20,20);
     1.6  
     1.7 +	// Initialize script editor
     1.8 +	scriptEditor = new SimpleScriptEditor();
     1.9 +	scriptEditor->move (50,50);
    1.10 +
    1.11 +	connect( scriptEditor, SIGNAL( runScript ( QString ) ), 
    1.12 +		this, SLOT( runScript( QString ) ) );
    1.13 +	
    1.14  	// Initialize some settings, which are platform dependant
    1.15  	QString p,s;
    1.16  
    1.17 @@ -187,6 +194,9 @@
    1.18  	settings.setValue( "/mapeditor/editmode/useFlagGroups",actionSettingsUseFlagGroups->isOn() );
    1.19  	settings.setValue( "/export/useHideExport",actionSettingsUseHideExport->isOn() );
    1.20  
    1.21 +	//FIXME save branchPropWindow settings
    1.22 +	//FIXME save scriptEditor settings
    1.23 +
    1.24  	// call the destructors
    1.25  	delete (textEditor);
    1.26  	delete historyWindow;
    1.27 @@ -3419,6 +3429,14 @@
    1.28  	actionViewToggleNoteEditor->setOn (false);
    1.29  }
    1.30  
    1.31 +void Main::runScript (QString script)
    1.32 +{
    1.33 +	if (currentMapEditor())
    1.34 +		currentMapEditor()->runScript (script);
    1.35 +		
    1.36 +	
    1.37 +}
    1.38 +
    1.39  void Main::showPropertyDialog()
    1.40  {
    1.41  	if(currentMapEditor())
    1.42 @@ -3464,10 +3482,13 @@
    1.43  void Main::testCommand()
    1.44  {
    1.45  	if (!currentMapEditor()) return;
    1.46 +	scriptEditor->show();
    1.47 +	/*
    1.48  	bool ok;
    1.49  	QString com = QInputDialog::getText(
    1.50  			vymName, "Enter Command:", QLineEdit::Normal,"command", &ok, this );
    1.51  	if (ok) currentMapEditor()->parseAtom(com);
    1.52 +	*/
    1.53  }
    1.54  
    1.55  void Main::helpDoc()