branchpropwindow.cpp
changeset 787 c6bb4fdcc55f
parent 785 5987f9f15bac
child 801 16a8ef1d82b2
     1.1 --- a/branchpropwindow.cpp	Thu Aug 06 10:42:17 2009 +0000
     1.2 +++ b/branchpropwindow.cpp	Sat Aug 08 21:58:26 2009 +0000
     1.3 @@ -46,10 +46,6 @@
     1.4  		show();
     1.5  	else	
     1.6  		hide();
     1.7 -
     1.8 -	// FIXME-2 for now remove attribute tab
     1.9 -	ui.tabWidget->removeTab (3);
    1.10 -
    1.11  }
    1.12  
    1.13  BranchPropertyWindow::~BranchPropertyWindow ()
    1.14 @@ -59,17 +55,22 @@
    1.15  	settings.setValue( "/satellite/propertywindow/showWithMain",isVisible() );
    1.16  }
    1.17  
    1.18 -void BranchPropertyWindow::setBranch (BranchItem *bi)	
    1.19 +void BranchPropertyWindow::setItem (TreeItem *ti)	
    1.20  {
    1.21  	disconnectSignals();
    1.22 -	branchItem=bi;
    1.23 -	if (branchItem)
    1.24 +	if (!ti)
    1.25 +		ui.tabWidget->setEnabled (false);
    1.26 +	else if (ti->isBranchLikeType() )
    1.27  	{
    1.28 +		branchItem=(BranchItem*)ti;
    1.29  
    1.30  		branch=(BranchObj*)(branchItem->getLMO());
    1.31 -		if (branch)		// FIXME-3 move to branchItem later, when Frame is ported...
    1.32 +		if (branch)		// FIXME-3 replace by branchItem later, when Frame is ported...
    1.33  		{
    1.34  			ui.tabWidget->setEnabled (true);
    1.35 +			for (int i=0; i<3;++i)
    1.36 +				ui.tabWidget->setTabEnabled (i,true);
    1.37 +			ui.tabWidget->setTabEnabled (3,false);
    1.38  
    1.39  			// Frame
    1.40  			FrameObj::FrameType t=branch->getFrameType();
    1.41 @@ -153,7 +154,13 @@
    1.42  
    1.43  			// Finally activate signals
    1.44  			connectSignals();
    1.45 -		} // BranchObj	
    1.46 +		} // BranchItem
    1.47 +	} else if (ti->getType()==TreeItem::Attribute)
    1.48 +	{
    1.49 +		ui.tabWidget->setEnabled (true);
    1.50 +		for (int i=0; i<3;++i)
    1.51 +			ui.tabWidget->setTabEnabled (i,false);
    1.52 +		ui.tabWidget->setTabEnabled (3,true);
    1.53  	} else
    1.54  	{
    1.55  		ui.tabWidget->setEnabled (false);
    1.56 @@ -164,7 +171,7 @@
    1.57  {
    1.58  	model=m;
    1.59  	if (model) 
    1.60 -		setBranch (model->getSelectedBranchItem() );
    1.61 +		setItem (model->getSelectedItem() );
    1.62  	else
    1.63  		ui.tabWidget->setEnabled (false);
    1.64  		
    1.65 @@ -185,7 +192,7 @@
    1.66  				model->setFramePadding (5); 
    1.67  				break;
    1.68  		}
    1.69 -		setBranch (branchItem);
    1.70 +		setItem (branchItem);
    1.71  	}	
    1.72  }
    1.73