branchpropwindow.cpp
changeset 480 4e2c9394c7da
parent 462 494a5b8c131e
child 487 8fca3a710dc4
     1.1 --- a/branchpropwindow.cpp	Wed Apr 25 16:02:55 2007 +0000
     1.2 +++ b/branchpropwindow.cpp	Wed May 02 15:31:17 2007 +0000
     1.3 @@ -7,7 +7,7 @@
     1.4  
     1.5  extern Settings settings;
     1.6  
     1.7 -BranchPropertyWindow::BranchPropertyWindow (QWidget *parent):QDialog(parent)
     1.8 +BranchPropertyWindow::BranchPropertyWindow (QWidget *parent): QDialog (parent)
     1.9  {
    1.10  	ui.setupUi (this);
    1.11  
    1.12 @@ -22,13 +22,25 @@
    1.13      pix.fill (penColor);
    1.14  	ui.framePenColorButton->setPixmap (pix);
    1.15  	ui.frameBrushColorButton->setPixmap (pix);
    1.16 +
    1.17 +
    1.18 +	// Load Settings
    1.19 +	//FIXME setSatelliteName ( "propertyWindow" );
    1.20 +	resize (settings.value ( "/satellite/propertywindow/geometry/size", QSize(450,600)).toSize());
    1.21 +	move   (settings.value ( "/satellite/propertywindow/geometry/pos", QPoint (250,50)).toPoint());
    1.22 +	
    1.23 +	if (settings.value ( "/satellite/propertywindow/showWithMain",true).toBool())
    1.24 +		show();
    1.25 +	else	
    1.26 +		hide();
    1.27 +
    1.28  }
    1.29  
    1.30  BranchPropertyWindow::~BranchPropertyWindow ()
    1.31  {
    1.32 -	settings.setValue( "/branchpropertywindow/geometry/size", size() );
    1.33 -	settings.setValue( "/branchpropertywindow/geometry/pos", pos() );
    1.34 -	//settings.setValue( "/branchpropertywindow/showWithMain",showWithMain());	//FIXME add this!
    1.35 +	settings.setValue( "/satellite/propertywindow/geometry/size", size() );
    1.36 +	settings.setValue( "/satellite/propertywindow/geometry/pos", pos() );
    1.37 +
    1.38  }
    1.39  
    1.40  void BranchPropertyWindow::setBranch (BranchObj *bo)
    1.41 @@ -49,13 +61,15 @@
    1.42  			ui.colorGroupBox->setEnabled (false);
    1.43  			ui.framePaddingSpinBox->setEnabled (false);
    1.44  			ui.frameWidthSpinBox->setEnabled (false);
    1.45 +			ui.framePaddingLabel->setEnabled (false);
    1.46 +			ui.frameBorderLabel->setEnabled (false);
    1.47  		} else	
    1.48  		{
    1.49  			penColor=bo->getFramePenColor();
    1.50  			brushColor=bo->getFrameBrushColor();
    1.51  			QPixmap pix( 16,16);
    1.52  			pix.fill (penColor);
    1.53 -			ui.frameBrushColorButton->setPixmap (pix);
    1.54 +			ui.framePenColorButton->setPixmap (pix);
    1.55  			pix.fill (brushColor);
    1.56  			ui.frameBrushColorButton->setPixmap (pix);
    1.57  			ui.colorGroupBox->setEnabled (true);
    1.58 @@ -63,6 +77,8 @@
    1.59  			ui.framePaddingSpinBox->setValue (bo->getFramePadding());
    1.60  			ui.frameWidthSpinBox->setEnabled (true);
    1.61  			ui.frameWidthSpinBox->setValue (bo->getFrameBorderWidth());
    1.62 +			ui.framePaddingLabel->setEnabled (true);
    1.63 +			ui.frameBorderLabel->setEnabled (true);
    1.64  
    1.65  			switch (t)
    1.66  			{
    1.67 @@ -114,12 +130,15 @@
    1.68  void BranchPropertyWindow::frameTypeChanged (int i)
    1.69  {
    1.70  	if (mapEditor)
    1.71 +	{
    1.72  		switch (i)
    1.73  		{
    1.74  			case 0: mapEditor->setFrameType (FrameObj::NoFrame); break;
    1.75  			case 1: mapEditor->setFrameType (FrameObj::Rectangle); break;
    1.76  			case 2: mapEditor->setFrameType (FrameObj::Ellipse); break;
    1.77  		}
    1.78 +		setBranch (branch);
    1.79 +	}	
    1.80  }
    1.81  
    1.82  void BranchPropertyWindow::framePenColorClicked()
    1.83 @@ -174,6 +193,15 @@
    1.84  	if (mapEditor) mapEditor->setIncludeImagesHor (i);
    1.85  }
    1.86  
    1.87 +void BranchPropertyWindow::closeEvent( QCloseEvent* ce )
    1.88 +{
    1.89 +    ce->accept();	// can be reopened with show()
    1.90 +	hide();
    1.91 +	emit (windowClosed() );
    1.92 +    return;
    1.93 +}
    1.94 +
    1.95 +
    1.96  void BranchPropertyWindow::connectSignals()
    1.97  {
    1.98  	// Frame
    1.99 @@ -211,7 +239,7 @@
   1.100  
   1.101  void BranchPropertyWindow::disconnectSignals()
   1.102  {
   1.103 -	// Frame
   1.104 +	// Frame 
   1.105  	disconnect ( ui.frameTypeCombo, 0,0,0);
   1.106  	disconnect ( ui.framePenColorButton, 0,0,0);
   1.107  	disconnect ( ui.framePaddingSpinBox, 0,0,0);