1.1 --- a/mapeditor.cpp Tue Mar 14 14:27:08 2006 +0000
1.2 +++ b/mapeditor.cpp Thu Mar 23 12:38:54 2006 +0000
1.3 @@ -80,7 +80,6 @@
1.4 extern QAction *actionEditSelectFirst;
1.5 extern QAction *actionEditSelectLast;
1.6 extern QAction *actionEditLoadImage;
1.7 -extern QAction *actionEditToggleFloatExport;
1.8
1.9 extern QAction* actionFormatPickColor;
1.10 extern QAction* actionFormatColorBranch;
1.11 @@ -339,11 +338,6 @@
1.12 d.mkdir (tmpMapDir,true);
1.13 }
1.14
1.15 -void MapEditor::delTmpDirs()
1.16 -{
1.17 - removeDir (QDir(tmpMapDir));
1.18 -}
1.19 -
1.20 QString MapEditor::saveToDir(const QString &tmpdir, const QString &prefix, bool writeflags, const QPoint &offset, LinkableMapObj *saveSelection)
1.21 {
1.22 // tmpdir temporary directory to which data will be written
1.23 @@ -2297,16 +2291,37 @@
1.24 }
1.25 }
1.26
1.27 +void MapEditor::setHideExport()
1.28 +{
1.29 + if (selection && (typeid(*selection) == typeid(BranchObj) ||
1.30 + typeid(*selection) == typeid(MapCenterObj)) ||
1.31 + (typeid(*selection)==typeid(FloatImageObj))
1.32 + )
1.33 + {
1.34 + saveState(); //TODO undoCommand
1.35 + OrnamentedObj *oo=(OrnamentedObj*)selection;
1.36 + oo->setHideInExport(actionEditToggleHideExport->isOn());
1.37 + updateActions();
1.38 + mapCenter->reposition();
1.39 + adjustCanvasSize();
1.40 + canvas()->update();
1.41 + }
1.42 +}
1.43 +
1.44 void MapEditor::toggleHideExport()
1.45 {
1.46 if (selection && (typeid(*selection) == typeid(BranchObj) ||
1.47 - typeid(*selection) == typeid(MapCenterObj)) //||
1.48 -// (typeid(*selection)==typeid(FloatImageObj))
1.49 + typeid(*selection) == typeid(MapCenterObj)) ||
1.50 + (typeid(*selection)==typeid(FloatImageObj))
1.51 )
1.52 {
1.53 saveState(); //TODO undoCommand
1.54 - BranchObj *bo=(BranchObj*)selection;
1.55 - bo->setHideInExport(actionEditToggleHideExport->isOn());
1.56 + OrnamentedObj *oo=(OrnamentedObj*)selection;
1.57 + if (oo->hideInExport())
1.58 + oo->setHideInExport(false);
1.59 + else
1.60 + oo->setHideInExport(true);
1.61 + actionEditToggleHideExport->setOn (oo->hideInExport());
1.62 updateActions();
1.63 mapCenter->reposition();
1.64 adjustCanvasSize();
1.65 @@ -2468,6 +2483,12 @@
1.66
1.67 standardFlagsDefault->setEnabled (true);
1.68
1.69 + actionEditToggleScroll->setEnabled (true);
1.70 + if ( bo->isScrolled() )
1.71 + actionEditToggleScroll->setOn(true);
1.72 + else
1.73 + actionEditToggleScroll->setOn(false);
1.74 +
1.75 if ( bo->getURL().isEmpty() )
1.76 actionEditOpenURL->setEnabled (false);
1.77 else
1.78 @@ -2494,7 +2515,6 @@
1.79 for (a=actionListBranches.first();a;a=actionListBranches.next())
1.80 a->setEnabled(true);
1.81 actionEditDelete->setEnabled (true);
1.82 - actionEditToggleFloatExport->setEnabled (false);
1.83 switch (selection->getFrameType())
1.84 {
1.85 case NoFrame:
1.86 @@ -2515,12 +2535,15 @@
1.87 }
1.88 if ( (typeid(*selection) == typeid(FloatImageObj)) )
1.89 {
1.90 + FloatObj *fo=(FloatImageObj*)selection;
1.91 standardFlagsDefault->setEnabled (false);
1.92
1.93 actionEditOpenURL->setEnabled (false);
1.94 actionEditOpenVymLink->setEnabled (false);
1.95 actionEditDeleteVymLink->setEnabled (false);
1.96 - actionEditToggleHideExport->setEnabled (false);
1.97 + actionEditToggleHideExport->setEnabled (true);
1.98 + actionEditToggleHideExport->setOn (fo->hideInExport() );
1.99 +
1.100
1.101 actionEditCopy->setEnabled (true);
1.102 actionEditCut->setEnabled (true);
1.103 @@ -2528,8 +2551,6 @@
1.104 for (a=actionListBranches.first();a;a=actionListBranches.next())
1.105 a->setEnabled(false);
1.106 actionEditDelete->setEnabled (true);
1.107 - actionEditToggleFloatExport->setOn
1.108 - ( ((FloatImageObj*)selection)->getFloatExport() );
1.109 actionFormatHideLinkUnselected->setOn
1.110 ( selection->getHideLinkUnselected());
1.111 }
1.112 @@ -2544,12 +2565,12 @@
1.113 for (a=actionListBranches.first();a;a=actionListBranches.next())
1.114 a->setEnabled(false);
1.115
1.116 + actionEditToggleScroll->setEnabled (true);
1.117 actionEditOpenURL->setEnabled (false);
1.118 actionEditOpenVymLink->setEnabled (false);
1.119 actionEditDeleteVymLink->setEnabled (false);
1.120 actionEditHeading2URL->setEnabled (false);
1.121 actionEditDelete->setEnabled (false);
1.122 - actionEditToggleFloatExport->setEnabled (false);
1.123 }
1.124 }
1.125
1.126 @@ -2786,17 +2807,6 @@
1.127 }
1.128 }
1.129
1.130 -void MapEditor::toggleFloatExport()
1.131 -{
1.132 - if (selection &&
1.133 - (typeid(*selection) == typeid(FloatImageObj))||
1.134 - (typeid(*selection) == typeid(FloatObj)) )
1.135 - {
1.136 - FloatImageObj *fio=((FloatImageObj*)selection);
1.137 - fio->setFloatExport (actionEditToggleFloatExport->isOn() );
1.138 - }
1.139 -}
1.140 -
1.141 void MapEditor::setFrame(const FrameType &t)
1.142 {
1.143 if (selection &&
1.144 @@ -2960,6 +2970,7 @@
1.145 void MapEditor::testFunction()
1.146 {
1.147 cout << "MapEditor::testFunction() called\n";
1.148 + mapCenter->reposition();
1.149 adjustCanvasSize();
1.150
1.151 /*
1.152 @@ -3106,18 +3117,16 @@
1.153 // Do not move, if systemFlag clicked
1.154 if (foname=="url")
1.155 openURL();
1.156 - else
1.157 - if (foname=="vymLink")
1.158 - {
1.159 - mainWindow->editOpenVymLink();
1.160 - // tabWidget may change, better return now
1.161 - // before segfaulting...
1.162 - return;
1.163 - } else
1.164 - if (foname=="note")
1.165 - mainWindow->windowToggleNoteEditor();
1.166 - else
1.167 - if (foname=="hideInExport") toggleHideExport();
1.168 + else if (foname=="vymLink")
1.169 + {
1.170 + mainWindow->editOpenVymLink();
1.171 + // tabWidget may change, better return now
1.172 + // before segfaulting...
1.173 + return;
1.174 + } else if (foname=="note")
1.175 + mainWindow->windowToggleNoteEditor();
1.176 + else if (foname=="hideInExport")
1.177 + toggleHideExport();
1.178 }
1.179 }
1.180