mainwindow.cpp
changeset 714 3368b54c7946
parent 689 c7b1178aec77
child 721 12958f987bcf
     1.1 --- a/mainwindow.cpp	Thu Jul 03 14:42:18 2008 +0000
     1.2 +++ b/mainwindow.cpp	Fri Jul 11 12:36:38 2008 +0000
     1.3 @@ -79,6 +79,8 @@
     1.4  {
     1.5  	mainWindow=this;
     1.6  
     1.7 +	setObjectName ("MainWindow");
     1.8 +
     1.9  	setCaption ("VYM - View Your Mind");
    1.10  
    1.11  	// Load window settings
    1.12 @@ -1702,11 +1704,11 @@
    1.13  	MapEditor *me;
    1.14  	for (int i=0;i<=tabWidget->count() -1;i++)
    1.15  	{
    1.16 -		
    1.17  		me=(MapEditor*)tabWidget->page(i);
    1.18  		me->unselect();
    1.19  	}	
    1.20 -	currentMapEditor()->reselect();
    1.21 +	me=currentMapEditor();
    1.22 +	if (me) me->reselect();
    1.23  
    1.24  	// Update actions to in menus and toolbars according to editor
    1.25  	updateActions();
    1.26 @@ -1819,6 +1821,8 @@
    1.27  		
    1.28  		// Check, if file exists (important for creating new files
    1.29  		// from command line
    1.30 +		/*
    1.31 +		*/
    1.32  		if (!QFile(fn).exists() )
    1.33  		{
    1.34  			QMessageBox mb( vymName,
    1.35 @@ -1848,7 +1852,6 @@
    1.36  			}
    1.37  		}	
    1.38  
    1.39 -
    1.40  		//tabWidget->currentPage() won't be NULL here, because of above...
    1.41  		tabWidget->showPage(me);
    1.42  		me->viewport()->setFocus();
    1.43 @@ -2319,11 +2322,13 @@
    1.44  				return;
    1.45  			}
    1.46  		} 
    1.47 -		me->closeMap();
    1.48 +		//me->closeMap(); 
    1.49  		tabWidget->removePage(me);
    1.50  		if (tabWidget->count()==0)
    1.51  			actionFilePrint->setEnabled (false);
    1.52 -        delete me;
    1.53 +
    1.54 +        //delete me;
    1.55 +		me->clear();
    1.56  	}
    1.57  }
    1.58