mainwindow.cpp
changeset 629 92bebad145d2
parent 625 22955004d512
child 632 f4282e4db9f7
     1.1 --- a/mainwindow.cpp	Fri Nov 09 12:07:22 2007 +0000
     1.2 +++ b/mainwindow.cpp	Wed Dec 05 14:58:02 2007 +0000
     1.3 @@ -1395,7 +1395,7 @@
     1.4      a = new QAction( tr( "Autosave","Settings action"), this);
     1.5      a->setStatusTip( tr( "Autosave"));
     1.6  	a->setToggleAction(true);
     1.7 -	a->setOn ( settings.value ("/mapeditor/autosave/use",true).toBool());
     1.8 +	a->setOn ( settings.value ("/mapeditor/autosave/use",false).toBool());
     1.9      connect( a, SIGNAL( triggered() ), this, SLOT( settingsAutosaveToggle() ) );
    1.10  	settingsMenu->addAction (a);
    1.11  	actionSettingsAutosaveToggle=a;
    1.12 @@ -1406,8 +1406,8 @@
    1.13  	settingsMenu->addAction (a);
    1.14  	actionSettingsAutosaveTime=a;
    1.15  
    1.16 -    a = new QAction( tr( "Backup file","Settings action"), this);
    1.17 -    a->setStatusTip( tr( "Write backup file"));
    1.18 +    a = new QAction( tr( "Write backup file on save","Settings action"), this);
    1.19 +    a->setStatusTip( tr( "Write backup file on save"));
    1.20  	a->setToggleAction(true);
    1.21  	a->setOn ( settings.value ("/mainwindow/writeBackupFile",false).toBool());
    1.22      connect( a, SIGNAL( triggered() ), this, SLOT( settingsWriteBackupFileToggle() ) );
    1.23 @@ -2845,11 +2845,22 @@
    1.24  	*/
    1.25  }
    1.26  
    1.27 +#include "attribute.h"
    1.28  #include "attributedialog.h"
    1.29  void Main::editAttribute()
    1.30  {
    1.31 -	AttributeDialog dia;
    1.32 -	dia.exec();
    1.33 +	MapEditor *me=currentMapEditor();
    1.34 +	if (me)
    1.35 +	{
    1.36 +		BranchObj *bo=me->getSelectedBranch();
    1.37 +		if (bo)
    1.38 +		{
    1.39 +			AttributeDialog dia(this);
    1.40 +			dia.setTable (me->attributeTable() );
    1.41 +			dia.setBranch (bo);
    1.42 +			dia.exec();
    1.43 +		}
    1.44 +	}	
    1.45  	/*
    1.46  	if (currentMapEditor())
    1.47  	{
    1.48 @@ -3472,12 +3483,11 @@
    1.49  
    1.50  	if(currentMapEditor())
    1.51  	{
    1.52 -		LinkableMapObj *sel=currentMapEditor()->getSelection();
    1.53 -		if (sel && (typeid(*sel) == typeid(BranchObj) ||
    1.54 -		           typeid(*sel) == typeid(MapCenterObj)))
    1.55 +		BranchObj *bo=currentMapEditor()->getSelectedBranch();
    1.56 +		if (bo) 
    1.57  		{
    1.58  			branchPropertyWindow->setMapEditor(currentMapEditor());
    1.59 -			branchPropertyWindow->setBranch((BranchObj*)sel);
    1.60 +			branchPropertyWindow->setBranch(bo);
    1.61  			return;
    1.62  		}
    1.63