diff -r 7a651cb19690 -r 4e2c9394c7da branchpropwindow.cpp --- a/branchpropwindow.cpp Wed Apr 25 16:02:55 2007 +0000 +++ b/branchpropwindow.cpp Wed May 02 15:31:17 2007 +0000 @@ -7,7 +7,7 @@ extern Settings settings; -BranchPropertyWindow::BranchPropertyWindow (QWidget *parent):QDialog(parent) +BranchPropertyWindow::BranchPropertyWindow (QWidget *parent): QDialog (parent) { ui.setupUi (this); @@ -22,13 +22,25 @@ pix.fill (penColor); ui.framePenColorButton->setPixmap (pix); ui.frameBrushColorButton->setPixmap (pix); + + + // Load Settings + //FIXME setSatelliteName ( "propertyWindow" ); + resize (settings.value ( "/satellite/propertywindow/geometry/size", QSize(450,600)).toSize()); + move (settings.value ( "/satellite/propertywindow/geometry/pos", QPoint (250,50)).toPoint()); + + if (settings.value ( "/satellite/propertywindow/showWithMain",true).toBool()) + show(); + else + hide(); + } BranchPropertyWindow::~BranchPropertyWindow () { - settings.setValue( "/branchpropertywindow/geometry/size", size() ); - settings.setValue( "/branchpropertywindow/geometry/pos", pos() ); - //settings.setValue( "/branchpropertywindow/showWithMain",showWithMain()); //FIXME add this! + settings.setValue( "/satellite/propertywindow/geometry/size", size() ); + settings.setValue( "/satellite/propertywindow/geometry/pos", pos() ); + } void BranchPropertyWindow::setBranch (BranchObj *bo) @@ -49,13 +61,15 @@ ui.colorGroupBox->setEnabled (false); ui.framePaddingSpinBox->setEnabled (false); ui.frameWidthSpinBox->setEnabled (false); + ui.framePaddingLabel->setEnabled (false); + ui.frameBorderLabel->setEnabled (false); } else { penColor=bo->getFramePenColor(); brushColor=bo->getFrameBrushColor(); QPixmap pix( 16,16); pix.fill (penColor); - ui.frameBrushColorButton->setPixmap (pix); + ui.framePenColorButton->setPixmap (pix); pix.fill (brushColor); ui.frameBrushColorButton->setPixmap (pix); ui.colorGroupBox->setEnabled (true); @@ -63,6 +77,8 @@ ui.framePaddingSpinBox->setValue (bo->getFramePadding()); ui.frameWidthSpinBox->setEnabled (true); ui.frameWidthSpinBox->setValue (bo->getFrameBorderWidth()); + ui.framePaddingLabel->setEnabled (true); + ui.frameBorderLabel->setEnabled (true); switch (t) { @@ -114,12 +130,15 @@ void BranchPropertyWindow::frameTypeChanged (int i) { if (mapEditor) + { switch (i) { case 0: mapEditor->setFrameType (FrameObj::NoFrame); break; case 1: mapEditor->setFrameType (FrameObj::Rectangle); break; case 2: mapEditor->setFrameType (FrameObj::Ellipse); break; } + setBranch (branch); + } } void BranchPropertyWindow::framePenColorClicked() @@ -174,6 +193,15 @@ if (mapEditor) mapEditor->setIncludeImagesHor (i); } +void BranchPropertyWindow::closeEvent( QCloseEvent* ce ) +{ + ce->accept(); // can be reopened with show() + hide(); + emit (windowClosed() ); + return; +} + + void BranchPropertyWindow::connectSignals() { // Frame @@ -211,7 +239,7 @@ void BranchPropertyWindow::disconnectSignals() { - // Frame + // Frame disconnect ( ui.frameTypeCombo, 0,0,0); disconnect ( ui.framePenColorButton, 0,0,0); disconnect ( ui.framePaddingSpinBox, 0,0,0);