1.1 --- a/branchpropwindow.cpp Wed Apr 09 07:14:13 2008 +0000
1.2 +++ b/branchpropwindow.cpp Tue Aug 05 07:36:53 2008 +0000
1.3 @@ -16,7 +16,7 @@
1.4 setCaption(vymName +" - " +tr ("Property Editor","Window caption"));
1.5
1.6 branch=NULL;
1.7 - mapEditor=NULL;
1.8 + model=NULL;
1.9
1.10 ui.tabWidget->setEnabled(false);
1.11
1.12 @@ -125,7 +125,8 @@
1.13 // Attributes
1.14 attributeModel->removeRows(0, attributeModel->rowCount(), QModelIndex());
1.15
1.16 - // FIXME some samples for testing
1.17 +/*
1.18 + // FIXME some samples for attribute testing
1.19 QStringList attrTypes=mapEditor->attributeTable()->getTypes();
1.20 for (int i=0; i<attrTypes.count()-1;i++)
1.21 {
1.22 @@ -141,7 +142,7 @@
1.23 // Initialize Delegate
1.24 delegate.setAttributeTable (mapEditor->attributeTable());
1.25 ui.attributeTableView->setItemDelegate (&delegate);
1.26 -
1.27 +*/
1.28
1.29 // Finally activate signals
1.30 connectSignals();
1.31 @@ -151,11 +152,11 @@
1.32 }
1.33 }
1.34
1.35 -void BranchPropertyWindow::setMapEditor (MapEditor *me)
1.36 +void BranchPropertyWindow::setModel (VymModel *m)
1.37 {
1.38 - mapEditor=me;
1.39 - if (mapEditor)
1.40 - setBranch (mapEditor->getSelectedBranch() );
1.41 + model=m;
1.42 + if (model)
1.43 + setBranch (model->getSelectedBranch() );
1.44 else
1.45 ui.tabWidget->setEnabled (false);
1.46
1.47 @@ -163,17 +164,17 @@
1.48
1.49 void BranchPropertyWindow::frameTypeChanged (int i)
1.50 {
1.51 - if (mapEditor)
1.52 + if (model)
1.53 {
1.54 switch (i)
1.55 {
1.56 - case 0: mapEditor->setFrameType (FrameObj::NoFrame); break;
1.57 + case 0: model->setFrameType (FrameObj::NoFrame); break;
1.58 case 1:
1.59 - mapEditor->setFrameType (FrameObj::Rectangle);
1.60 + model->setFrameType (FrameObj::Rectangle);
1.61 break;
1.62 case 2:
1.63 - mapEditor->setFrameType (FrameObj::Ellipse);
1.64 - mapEditor->setFramePadding (5);
1.65 + model->setFrameType (FrameObj::Ellipse);
1.66 + model->setFramePadding (5);
1.67 break;
1.68 }
1.69 setBranch (branch);
1.70 @@ -182,54 +183,54 @@
1.71
1.72 void BranchPropertyWindow::framePenColorClicked()
1.73 {
1.74 - if (mapEditor)
1.75 + if (model)
1.76 {
1.77 QColor col = QColorDialog::getColor( penColor, this );
1.78 if ( col.isValid() )
1.79 {
1.80 penColor=col;
1.81 - mapEditor->setFramePenColor (penColor);
1.82 + model->setFramePenColor (penColor);
1.83 }
1.84 }
1.85 }
1.86
1.87 void BranchPropertyWindow::frameBrushColorClicked()
1.88 {
1.89 - if (mapEditor)
1.90 + if (model)
1.91 {
1.92 QColor col = QColorDialog::getColor( brushColor, this );
1.93 if ( col.isValid() )
1.94 {
1.95 brushColor=col;
1.96 - mapEditor->setFrameBrushColor (brushColor);
1.97 + model->setFrameBrushColor (brushColor);
1.98 }
1.99 }
1.100 }
1.101
1.102 void BranchPropertyWindow::framePaddingChanged(int i)
1.103 {
1.104 - if (mapEditor) mapEditor->setFramePadding (i);
1.105 + if (model) model->setFramePadding (i);
1.106 }
1.107
1.108 void BranchPropertyWindow::frameBorderWidthChanged(int i)
1.109 {
1.110 - if (mapEditor) mapEditor->setFrameBorderWidth(i);
1.111 + if (model) model->setFrameBorderWidth(i);
1.112 }
1.113
1.114 void BranchPropertyWindow::linkHideUnselectedChanged (int i)
1.115 {
1.116 if (!branch) return;
1.117 - mapEditor->setHideLinkUnselected(i);
1.118 + model->setHideLinkUnselected(i);
1.119 }
1.120
1.121 void BranchPropertyWindow::incImgVerChanged (int i)
1.122 {
1.123 - if (mapEditor) mapEditor->setIncludeImagesVer (i);
1.124 + if (model) model->setIncludeImagesVer (i);
1.125 }
1.126
1.127 void BranchPropertyWindow::incImgHorChanged (int i)
1.128 {
1.129 - if (mapEditor) mapEditor->setIncludeImagesHor (i);
1.130 + if (model) model->setIncludeImagesHor (i);
1.131 }
1.132
1.133 void BranchPropertyWindow::closeEvent( QCloseEvent* ce )
1.134 @@ -262,7 +263,7 @@
1.135
1.136 void BranchPropertyWindow::deleteAttributeClicked()
1.137 {
1.138 - cout << "BPW::delete\n";
1.139 + //FIXME cout << "BPW::delete\n";
1.140 }
1.141
1.142 void BranchPropertyWindow::connectSignals()