1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/save_details_widget.cc Mon Jul 07 08:10:39 2008 -0500
1.3 @@ -0,0 +1,616 @@
1.4 +#include "save_details_widget.h"
1.5 +#include "mapstorage.h"
1.6 +
1.7 +SaveDetailsWidget::SaveDetailsWidget(MapStorage* ms) :
1.8 + pMapStorage(ms)
1.9 +{
1.10 + Gtk::Notebook* nb = Gtk::manage(new Gtk::Notebook);
1.11 + pack_start(*nb, Gtk::PACK_EXPAND_WIDGET);
1.12 +
1.13 + nb->set_tab_pos(Gtk::POS_TOP);
1.14 +
1.15 + Gtk::VBox* vblueMaps = Gtk::manage(new Gtk::VBox(false, 18));
1.16 + vblueMaps->set_border_width(12);
1.17 +
1.18 + Gtk::VBox* vbArcMaps = Gtk::manage(new Gtk::VBox(false, 18));
1.19 + vbArcMaps->set_border_width(12);
1.20 +
1.21 + Gtk::VBox* vbSpecMaps = Gtk::manage(new Gtk::VBox(false, 18));
1.22 + vbSpecMaps->set_border_width(12);
1.23 +
1.24 + Gtk::VBox* vbGuiSect = Gtk::manage(new Gtk::VBox(false, 18));
1.25 + vbGuiSect->set_border_width(12);
1.26 +
1.27 + nb->append_page(*vbSpecMaps, "Special Maps");
1.28 + nb->append_page(*vblueMaps, "Node Maps");
1.29 + nb->append_page(*vbArcMaps, "Arc Maps");
1.30 + nb->append_page(*vbGuiSect, "GUI Section");
1.31 +
1.32 + // child widgets of vbSpecMaps
1.33 +
1.34 + {
1.35 + Gtk::VBox* box1 = Gtk::manage(new Gtk::VBox(false, 6));
1.36 + vbSpecMaps->pack_start(*box1, Gtk::PACK_SHRINK);
1.37 +
1.38 + Gtk::Label* lblNodeCoordMap =
1.39 + Gtk::manage(new Gtk::Label("<b>Node Coordinates</b>"));
1.40 + lblNodeCoordMap->set_alignment(Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER);
1.41 + lblNodeCoordMap->set_use_markup();
1.42 + box1->pack_start(*lblNodeCoordMap, Gtk::PACK_SHRINK);
1.43 +
1.44 + Gtk::HBox* box2 = Gtk::manage(new Gtk::HBox);
1.45 + box1->pack_start(*box2, Gtk::PACK_SHRINK);
1.46 +
1.47 + Gtk::Label* fill1 = Gtk::manage(new Gtk::Label(" "));
1.48 + box2->pack_start(*fill1, Gtk::PACK_SHRINK);
1.49 +
1.50 + Gtk::VBox* box3 = Gtk::manage(new Gtk::VBox);
1.51 + box2->pack_start(*box3, Gtk::PACK_SHRINK);
1.52 +
1.53 + rblueCoordGuiSection.set_label("Save to GUI section");
1.54 + rblueCoordNodesetSection.set_label("Save to Nodeset section");
1.55 + Gtk::RadioButtonGroup group = rblueCoordGuiSection.get_group();
1.56 + rblueCoordNodesetSection.set_group(group);
1.57 +
1.58 + box3->pack_start(rblueCoordGuiSection, Gtk::PACK_SHRINK);
1.59 + box3->pack_start(rblueCoordNodesetSection, Gtk::PACK_SHRINK);
1.60 +
1.61 + Gtk::HBox* box4 = Gtk::manage(new Gtk::HBox);
1.62 + box3->pack_start(*box4, Gtk::PACK_SHRINK);
1.63 +
1.64 + Gtk::Label* fill2 = Gtk::manage(new Gtk::Label(" "));
1.65 + box4->pack_start(*fill2, Gtk::PACK_SHRINK);
1.66 +
1.67 + Gtk::Table* table1 = Gtk::manage(new Gtk::Table(3, 2));
1.68 + box4->pack_start(*table1, Gtk::PACK_SHRINK);
1.69 +
1.70 + rblueCoordOneMap.set_label("As one map");
1.71 + rblueCoordTwoMaps.set_label("As two maps");
1.72 + group = rblueCoordOneMap.get_group();
1.73 + rblueCoordTwoMaps.set_group(group);
1.74 +
1.75 + table1->attach(rblueCoordOneMap, 0, 1, 0, 1);
1.76 + table1->attach(rblueCoordTwoMaps, 0, 1, 1, 2);
1.77 + table1->attach(entNodeCoordsOneMap, 1, 2, 0, 1);
1.78 + table1->attach(entNodeCoordsTwoMaps1, 1, 2, 1, 2);
1.79 + table1->attach(entNodeCoordsTwoMaps2, 1, 2, 2, 3);
1.80 +
1.81 + switch (pMapStorage->getNodeCoordsSaveDest())
1.82 + {
1.83 + case MapStorage::SpecMapSaveOpts::GUI_SECT:
1.84 + rblueCoordGuiSection.set_active();
1.85 + rblueCoordOneMap.set_sensitive(false);
1.86 + rblueCoordTwoMaps.set_sensitive(false);
1.87 + entNodeCoordsOneMap.set_sensitive(false);
1.88 + entNodeCoordsTwoMaps1.set_sensitive(false);
1.89 + entNodeCoordsTwoMaps2.set_sensitive(false);
1.90 + break;
1.91 + case MapStorage::SpecMapSaveOpts::NESET_SECT:
1.92 + rblueCoordNodesetSection.set_active();
1.93 + rblueCoordOneMap.set_sensitive(true);
1.94 + rblueCoordTwoMaps.set_sensitive(true);
1.95 + switch (pMapStorage->getNodeCoordsSaveMapNum())
1.96 + {
1.97 + case MapStorage::SpecMapSaveOpts::ONE_MAP:
1.98 + rblueCoordOneMap.set_active();
1.99 + entNodeCoordsOneMap.set_sensitive(true);
1.100 + entNodeCoordsTwoMaps1.set_sensitive(false);
1.101 + entNodeCoordsTwoMaps2.set_sensitive(false);
1.102 + break;
1.103 + case MapStorage::SpecMapSaveOpts::TWO_MAPS:
1.104 + rblueCoordTwoMaps.set_active();
1.105 + entNodeCoordsOneMap.set_sensitive(false);
1.106 + entNodeCoordsTwoMaps1.set_sensitive(true);
1.107 + entNodeCoordsTwoMaps2.set_sensitive(true);
1.108 + break;
1.109 + }
1.110 + break;
1.111 + }
1.112 +
1.113 + entNodeCoordsOneMap.set_text(pMapStorage->getNodeCoordsOneMapName());
1.114 + entNodeCoordsTwoMaps1.set_text(pMapStorage->getNodeCoordsTwoMaps1Name());
1.115 + entNodeCoordsTwoMaps2.set_text(pMapStorage->getNodeCoordsTwoMaps2Name());
1.116 +
1.117 + entNodeCoordsOneMap.signal_changed().connect(
1.118 + sigc::mem_fun(*this, &SaveDetailsWidget::onNodeCoordsOneMapName));
1.119 + entNodeCoordsTwoMaps1.signal_changed().connect(
1.120 + sigc::mem_fun(*this, &SaveDetailsWidget::onNodeCoordsTwoMaps1Name));
1.121 + entNodeCoordsTwoMaps2.signal_changed().connect(
1.122 + sigc::mem_fun(*this, &SaveDetailsWidget::onNodeCoordsTwoMaps2Name));
1.123 +
1.124 + rblueCoordGuiSection.signal_toggled().connect(
1.125 + sigc::mem_fun(*this, &SaveDetailsWidget::onNodeCoordSaveDestChanged));
1.126 + rblueCoordNodesetSection.signal_toggled().connect(
1.127 + sigc::mem_fun(*this, &SaveDetailsWidget::onNodeCoordSaveDestChanged));
1.128 + rblueCoordOneMap.signal_toggled().connect(
1.129 + sigc::mem_fun(*this, &SaveDetailsWidget::onNodeCoordMapNumChanged));
1.130 + rblueCoordTwoMaps.signal_toggled().connect(
1.131 + sigc::mem_fun(*this, &SaveDetailsWidget::onNodeCoordMapNumChanged));
1.132 + }
1.133 +
1.134 + {
1.135 + Gtk::VBox* box1 = Gtk::manage(new Gtk::VBox(false, 6));
1.136 + vbSpecMaps->pack_start(*box1, Gtk::PACK_SHRINK);
1.137 +
1.138 + Gtk::Label* lblArrowCoordMap =
1.139 + Gtk::manage(new Gtk::Label("<b>Arrow Coordinates</b>"));
1.140 + lblArrowCoordMap->set_alignment(Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER);
1.141 + lblArrowCoordMap->set_use_markup();
1.142 + box1->pack_start(*lblArrowCoordMap, Gtk::PACK_SHRINK);
1.143 +
1.144 + Gtk::HBox* box2 = Gtk::manage(new Gtk::HBox);
1.145 + box1->pack_start(*box2, Gtk::PACK_SHRINK);
1.146 +
1.147 + Gtk::Label* fill1 = Gtk::manage(new Gtk::Label(" "));
1.148 + box2->pack_start(*fill1, Gtk::PACK_SHRINK);
1.149 +
1.150 + Gtk::VBox* box3 = Gtk::manage(new Gtk::VBox);
1.151 + box2->pack_start(*box3, Gtk::PACK_SHRINK);
1.152 +
1.153 + rbArrowCoordGuiSection.set_label("Save to GUI section");
1.154 + rbArrowCoordArcsetSection.set_label("Save to Arcset section");
1.155 + Gtk::RadioButtonGroup group = rbArrowCoordGuiSection.get_group();
1.156 + rbArrowCoordArcsetSection.set_group(group);
1.157 +
1.158 + box3->pack_start(rbArrowCoordGuiSection, Gtk::PACK_SHRINK);
1.159 + box3->pack_start(rbArrowCoordArcsetSection, Gtk::PACK_SHRINK);
1.160 +
1.161 + Gtk::HBox* box4 = Gtk::manage(new Gtk::HBox);
1.162 + box3->pack_start(*box4, Gtk::PACK_SHRINK);
1.163 +
1.164 + Gtk::Label* fill2 = Gtk::manage(new Gtk::Label(" "));
1.165 + box4->pack_start(*fill2, Gtk::PACK_SHRINK);
1.166 +
1.167 + Gtk::Table* table1 = Gtk::manage(new Gtk::Table(3, 2));
1.168 + box4->pack_start(*table1, Gtk::PACK_SHRINK);
1.169 +
1.170 + rbArrowCoordOneMap.set_label("As one map");
1.171 + rbArrowCoordTwoMaps.set_label("As two maps");
1.172 + group = rbArrowCoordOneMap.get_group();
1.173 + rbArrowCoordTwoMaps.set_group(group);
1.174 +
1.175 + table1->attach(rbArrowCoordOneMap, 0, 1, 0, 1);
1.176 + table1->attach(rbArrowCoordTwoMaps, 0, 1, 1, 2);
1.177 + table1->attach(entArrowCoordsOneMap, 1, 2, 0, 1);
1.178 + table1->attach(entArrowCoordsTwoMaps1, 1, 2, 1, 2);
1.179 + table1->attach(entArrowCoordsTwoMaps2, 1, 2, 2, 3);
1.180 +
1.181 + switch (pMapStorage->getArrowCoordsSaveDest())
1.182 + {
1.183 + case MapStorage::SpecMapSaveOpts::GUI_SECT:
1.184 + rbArrowCoordGuiSection.set_active();
1.185 + rbArrowCoordOneMap.set_sensitive(false);
1.186 + rbArrowCoordTwoMaps.set_sensitive(false);
1.187 + entArrowCoordsOneMap.set_sensitive(false);
1.188 + entArrowCoordsTwoMaps1.set_sensitive(false);
1.189 + entArrowCoordsTwoMaps2.set_sensitive(false);
1.190 + break;
1.191 + case MapStorage::SpecMapSaveOpts::NESET_SECT:
1.192 + rbArrowCoordArcsetSection.set_active();
1.193 + rbArrowCoordOneMap.set_sensitive(true);
1.194 + rbArrowCoordTwoMaps.set_sensitive(true);
1.195 + switch (pMapStorage->getArrowCoordsSaveMapNum())
1.196 + {
1.197 + case MapStorage::SpecMapSaveOpts::ONE_MAP:
1.198 + rbArrowCoordOneMap.set_active();
1.199 + entArrowCoordsOneMap.set_sensitive(true);
1.200 + entArrowCoordsTwoMaps1.set_sensitive(false);
1.201 + entArrowCoordsTwoMaps2.set_sensitive(false);
1.202 + break;
1.203 + case MapStorage::SpecMapSaveOpts::TWO_MAPS:
1.204 + rbArrowCoordTwoMaps.set_active();
1.205 + entArrowCoordsOneMap.set_sensitive(false);
1.206 + entArrowCoordsTwoMaps1.set_sensitive(true);
1.207 + entArrowCoordsTwoMaps2.set_sensitive(true);
1.208 + break;
1.209 + }
1.210 + break;
1.211 + }
1.212 +
1.213 + entArrowCoordsOneMap.set_text(pMapStorage->getArrowCoordsOneMapName());
1.214 + entArrowCoordsTwoMaps1.set_text(pMapStorage->getArrowCoordsTwoMaps1Name());
1.215 + entArrowCoordsTwoMaps2.set_text(pMapStorage->getArrowCoordsTwoMaps2Name());
1.216 +
1.217 + entArrowCoordsOneMap.signal_changed().connect(
1.218 + sigc::mem_fun(*this, &SaveDetailsWidget::onArrowCoordsOneMapName));
1.219 + entArrowCoordsTwoMaps1.signal_changed().connect(
1.220 + sigc::mem_fun(*this, &SaveDetailsWidget::onArrowCoordsTwoMaps1Name));
1.221 + entArrowCoordsTwoMaps2.signal_changed().connect(
1.222 + sigc::mem_fun(*this, &SaveDetailsWidget::onArrowCoordsTwoMaps2Name));
1.223 +
1.224 + rbArrowCoordGuiSection.signal_toggled().connect(
1.225 + sigc::mem_fun(*this, &SaveDetailsWidget::onArrowCoordSaveDestChanged));
1.226 + rbArrowCoordArcsetSection.signal_toggled().connect(
1.227 + sigc::mem_fun(*this, &SaveDetailsWidget::onArrowCoordSaveDestChanged));
1.228 + rbArrowCoordOneMap.signal_toggled().connect(
1.229 + sigc::mem_fun(*this, &SaveDetailsWidget::onArrowCoordMapNumChanged));
1.230 + rbArrowCoordTwoMaps.signal_toggled().connect(
1.231 + sigc::mem_fun(*this, &SaveDetailsWidget::onArrowCoordMapNumChanged));
1.232 + }
1.233 +
1.234 + // child widgets of vbGuiSect
1.235 +
1.236 + {
1.237 + Gtk::VBox* box1 = Gtk::manage(new Gtk::VBox(false, 6));
1.238 + vbGuiSect->pack_start(*box1, Gtk::PACK_SHRINK);
1.239 +
1.240 + Gtk::Label* lblGuiSectionSave =
1.241 + Gtk::manage(new Gtk::Label("<b>Save Destination</b>"));
1.242 + lblGuiSectionSave->set_alignment(Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER);
1.243 + lblGuiSectionSave->set_use_markup();
1.244 + box1->pack_start(*lblGuiSectionSave, Gtk::PACK_SHRINK);
1.245 +
1.246 + rbLgfFile.set_label("Lgf file");
1.247 + rbConfFile.set_label("Conf file");
1.248 +
1.249 + Gtk::RadioButtonGroup group = rbLgfFile.get_group();
1.250 + rbConfFile.set_group(group);
1.251 +
1.252 + switch (pMapStorage->getGUIDataSaveLocation())
1.253 + {
1.254 + case MapStorage::LGF_FILE:
1.255 + rbLgfFile.set_active();
1.256 + break;
1.257 + case MapStorage::CONF_FILE:
1.258 + rbConfFile.set_active();
1.259 + break;
1.260 + }
1.261 +
1.262 + Gtk::HBox* box2 = Gtk::manage(new Gtk::HBox);
1.263 + box1->pack_start(*box2, Gtk::PACK_SHRINK);
1.264 +
1.265 + Gtk::Label* fill1 = Gtk::manage(new Gtk::Label(" "));
1.266 + box2->pack_start(*fill1, Gtk::PACK_SHRINK);
1.267 +
1.268 + Gtk::VBox* box3 = Gtk::manage(new Gtk::VBox);
1.269 + box2->pack_start(*box3, Gtk::PACK_SHRINK);
1.270 +
1.271 + box3->pack_start(rbLgfFile, Gtk::PACK_SHRINK);
1.272 + box3->pack_start(rbConfFile, Gtk::PACK_SHRINK);
1.273 +
1.274 + rbLgfFile.signal_toggled().connect(
1.275 + sigc::mem_fun(*this, &SaveDetailsWidget::onGuiSectSaveDestChanged));
1.276 + rbConfFile.signal_toggled().connect(
1.277 + sigc::mem_fun(*this, &SaveDetailsWidget::onGuiSectSaveDestChanged));
1.278 + }
1.279 +
1.280 + // child widgets of vblueMaps
1.281 +
1.282 + {
1.283 + Gtk::VBox* box1 = Gtk::manage(new Gtk::VBox(false, 6));
1.284 + vblueMaps->pack_start(*box1, Gtk::PACK_SHRINK);
1.285 +
1.286 + Gtk::Label* label1 =
1.287 + Gtk::manage(new Gtk::Label("<b>Save Destination</b>"));
1.288 + label1->set_alignment(Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER);
1.289 + label1->set_use_markup();
1.290 + box1->pack_start(*label1, Gtk::PACK_SHRINK);
1.291 +
1.292 + Gtk::HBox* box2 = Gtk::manage(new Gtk::HBox);
1.293 + box1->pack_start(*box2, Gtk::PACK_SHRINK);
1.294 +
1.295 + Gtk::Label* fill1 = Gtk::manage(new Gtk::Label(" "));
1.296 + box2->pack_start(*fill1, Gtk::PACK_SHRINK);
1.297 +
1.298 + Gtk::Frame* frame = Gtk::manage(new Gtk::Frame);
1.299 + box2->pack_start(*frame, Gtk::PACK_EXPAND_WIDGET);
1.300 +
1.301 + Gtk::ScrolledWindow* swNodeMaps = Gtk::manage(new Gtk::ScrolledWindow);
1.302 + frame->add(*swNodeMaps);
1.303 +
1.304 + swNodeMaps->add(twNodeMaps);
1.305 +
1.306 + refNodeMapStore = Gtk::ListStore::create(NodeMapColumns);
1.307 +
1.308 + std::vector<std::string> node_maps = pMapStorage->getNodeMapList();
1.309 + for (std::vector<std::string>::const_iterator it = node_maps.begin();
1.310 + it != node_maps.end(); ++it)
1.311 + {
1.312 + Gtk::TreeModel::Row row = *(refNodeMapStore->append());
1.313 + row[NodeMapColumns.colName] = *it;
1.314 + switch (pMapStorage->getNodeMapSaveDest(*it))
1.315 + {
1.316 + case MapStorage::GUI_SECT:
1.317 + row[NodeMapColumns.colSaveToMainSect] = false;
1.318 + row[NodeMapColumns.colSaveToGuiSect] = true;
1.319 + break;
1.320 + case MapStorage::NESET_SECT:
1.321 + row[NodeMapColumns.colSaveToMainSect] = true;
1.322 + row[NodeMapColumns.colSaveToGuiSect] = false;
1.323 + break;
1.324 + case MapStorage::DONT_SAVE:
1.325 + row[NodeMapColumns.colSaveToMainSect] = false;
1.326 + row[NodeMapColumns.colSaveToGuiSect] = false;
1.327 + break;
1.328 + }
1.329 + }
1.330 +
1.331 + twNodeMaps.set_model(refNodeMapStore);
1.332 + twNodeMaps.append_column("Name", NodeMapColumns.colName);
1.333 + twNodeMaps.append_column_editable("Nodeset section",
1.334 + NodeMapColumns.colSaveToMainSect);
1.335 + twNodeMaps.append_column_editable("GUI section",
1.336 + NodeMapColumns.colSaveToGuiSect);
1.337 +
1.338 + swNodeMaps->set_size_request(-1, 200);
1.339 + swNodeMaps->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
1.340 +
1.341 + refNodeMapStore->signal_row_changed().connect(
1.342 + sigc::mem_fun(*this, &SaveDetailsWidget::onNodeMapRowChanged));
1.343 + }
1.344 +
1.345 + // child widgets of vbArcMaps
1.346 +
1.347 + {
1.348 + Gtk::VBox* box1 = Gtk::manage(new Gtk::VBox(false, 6));
1.349 + vbArcMaps->pack_start(*box1, Gtk::PACK_SHRINK);
1.350 +
1.351 + Gtk::Label* label1 =
1.352 + Gtk::manage(new Gtk::Label("<b>Save Destination</b>"));
1.353 + label1->set_alignment(Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER);
1.354 + label1->set_use_markup();
1.355 + box1->pack_start(*label1, Gtk::PACK_SHRINK);
1.356 +
1.357 + Gtk::HBox* box2 = Gtk::manage(new Gtk::HBox);
1.358 + box1->pack_start(*box2, Gtk::PACK_SHRINK);
1.359 +
1.360 + Gtk::Label* fill1 = Gtk::manage(new Gtk::Label(" "));
1.361 + box2->pack_start(*fill1, Gtk::PACK_SHRINK);
1.362 +
1.363 + Gtk::Frame* frame = Gtk::manage(new Gtk::Frame);
1.364 + box2->pack_start(*frame, Gtk::PACK_EXPAND_WIDGET);
1.365 +
1.366 + Gtk::ScrolledWindow* swArcMaps = Gtk::manage(new Gtk::ScrolledWindow);
1.367 + frame->add(*swArcMaps);
1.368 +
1.369 + swArcMaps->add(twArcMaps);
1.370 +
1.371 + refArcMapStore = Gtk::ListStore::create(ArcMapColumns);
1.372 +
1.373 + std::vector<std::string> arc_maps = pMapStorage->getArcMapList();
1.374 + for (std::vector<std::string>::const_iterator it = arc_maps.begin();
1.375 + it != arc_maps.end(); ++it)
1.376 + {
1.377 + Gtk::TreeModel::Row row = *(refArcMapStore->append());
1.378 + row[ArcMapColumns.colName] = *it;
1.379 + switch (pMapStorage->getArcMapSaveDest(*it))
1.380 + {
1.381 + case MapStorage::GUI_SECT:
1.382 + row[ArcMapColumns.colSaveToMainSect] = false;
1.383 + row[ArcMapColumns.colSaveToGuiSect] = true;
1.384 + break;
1.385 + case MapStorage::NESET_SECT:
1.386 + row[ArcMapColumns.colSaveToMainSect] = true;
1.387 + row[ArcMapColumns.colSaveToGuiSect] = false;
1.388 + break;
1.389 + case MapStorage::DONT_SAVE:
1.390 + row[ArcMapColumns.colSaveToMainSect] = false;
1.391 + row[ArcMapColumns.colSaveToGuiSect] = false;
1.392 + break;
1.393 + }
1.394 + }
1.395 +
1.396 + twArcMaps.set_model(refArcMapStore);
1.397 + twArcMaps.append_column("Name", ArcMapColumns.colName);
1.398 + twArcMaps.append_column_editable("Arcset section",
1.399 + ArcMapColumns.colSaveToMainSect);
1.400 + twArcMaps.append_column_editable("GUI section",
1.401 + ArcMapColumns.colSaveToGuiSect);
1.402 +
1.403 + swArcMaps->set_size_request(-1, 200);
1.404 + swArcMaps->set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
1.405 +
1.406 + refArcMapStore->signal_row_changed().connect(
1.407 + sigc::mem_fun(*this, &SaveDetailsWidget::onArcMapRowChanged));
1.408 + }
1.409 +
1.410 + show_all_children();
1.411 +}
1.412 +
1.413 +void SaveDetailsWidget::onGuiSectSaveDestChanged()
1.414 +{
1.415 + if (rbLgfFile.get_active())
1.416 + {
1.417 + pMapStorage->setGUIDataSaveLocation(MapStorage::LGF_FILE);
1.418 + }
1.419 + else if (rbConfFile.get_active())
1.420 + {
1.421 + pMapStorage->setGUIDataSaveLocation(MapStorage::CONF_FILE);
1.422 + }
1.423 +}
1.424 +
1.425 +void SaveDetailsWidget::onArcMapRowChanged(const Gtk::TreeModel::Path& path,
1.426 + const Gtk::TreeModel::iterator& iter)
1.427 +{
1.428 + Gtk::TreeModel::Row row = *iter;
1.429 + Glib::ustring map_name = row[ArcMapColumns.colName];
1.430 + if (row[ArcMapColumns.colSaveToMainSect] &&
1.431 + row[ArcMapColumns.colSaveToGuiSect])
1.432 + {
1.433 + if (pMapStorage->getArcMapSaveDest(map_name) == MapStorage::NESET_SECT)
1.434 + {
1.435 + pMapStorage->setArcMapSaveDest(map_name, MapStorage::GUI_SECT);
1.436 + row[ArcMapColumns.colSaveToMainSect] = false;
1.437 + }
1.438 + else
1.439 + {
1.440 + pMapStorage->setArcMapSaveDest(map_name, MapStorage::NESET_SECT);
1.441 + row[ArcMapColumns.colSaveToGuiSect] = false;
1.442 + }
1.443 + }
1.444 + else if (row[ArcMapColumns.colSaveToMainSect])
1.445 + {
1.446 + pMapStorage->setArcMapSaveDest(map_name, MapStorage::NESET_SECT);
1.447 + }
1.448 + else if (row[ArcMapColumns.colSaveToGuiSect])
1.449 + {
1.450 + pMapStorage->setArcMapSaveDest(map_name, MapStorage::GUI_SECT);
1.451 + }
1.452 + else
1.453 + {
1.454 + pMapStorage->setArcMapSaveDest(map_name, MapStorage::DONT_SAVE);
1.455 + }
1.456 +}
1.457 +
1.458 +void SaveDetailsWidget::onNodeMapRowChanged(const Gtk::TreeModel::Path& path,
1.459 + const Gtk::TreeModel::iterator& iter)
1.460 +{
1.461 + Gtk::TreeModel::Row row = *iter;
1.462 + Glib::ustring map_name = row[NodeMapColumns.colName];
1.463 + if (row[NodeMapColumns.colSaveToMainSect] &&
1.464 + row[NodeMapColumns.colSaveToGuiSect])
1.465 + {
1.466 + if (pMapStorage->getNodeMapSaveDest(map_name) == MapStorage::NESET_SECT)
1.467 + {
1.468 + pMapStorage->setNodeMapSaveDest(map_name, MapStorage::GUI_SECT);
1.469 + row[NodeMapColumns.colSaveToMainSect] = false;
1.470 + }
1.471 + else
1.472 + {
1.473 + pMapStorage->setNodeMapSaveDest(map_name, MapStorage::NESET_SECT);
1.474 + row[NodeMapColumns.colSaveToGuiSect] = false;
1.475 + }
1.476 + }
1.477 + else if (row[NodeMapColumns.colSaveToMainSect])
1.478 + {
1.479 + pMapStorage->setNodeMapSaveDest(map_name, MapStorage::NESET_SECT);
1.480 + }
1.481 + else if (row[NodeMapColumns.colSaveToGuiSect])
1.482 + {
1.483 + pMapStorage->setNodeMapSaveDest(map_name, MapStorage::GUI_SECT);
1.484 + }
1.485 + else
1.486 + {
1.487 + pMapStorage->setNodeMapSaveDest(map_name, MapStorage::DONT_SAVE);
1.488 + }
1.489 +}
1.490 +
1.491 +void SaveDetailsWidget::onNodeCoordSaveDestChanged()
1.492 +{
1.493 + if (rblueCoordGuiSection.get_active())
1.494 + {
1.495 + pMapStorage->setNodeCoordsSaveDest(MapStorage::SpecMapSaveOpts::GUI_SECT);
1.496 + rblueCoordOneMap.set_sensitive(false);
1.497 + rblueCoordTwoMaps.set_sensitive(false);
1.498 + entNodeCoordsOneMap.set_sensitive(false);
1.499 + entNodeCoordsTwoMaps1.set_sensitive(false);
1.500 + entNodeCoordsTwoMaps2.set_sensitive(false);
1.501 + }
1.502 + else if (rblueCoordNodesetSection.get_active())
1.503 + {
1.504 + pMapStorage->setNodeCoordsSaveDest(MapStorage::SpecMapSaveOpts::NESET_SECT);
1.505 + rblueCoordOneMap.set_sensitive(true);
1.506 + rblueCoordTwoMaps.set_sensitive(true);
1.507 + switch (pMapStorage->getNodeCoordsSaveMapNum())
1.508 + {
1.509 + case MapStorage::SpecMapSaveOpts::ONE_MAP:
1.510 + entNodeCoordsOneMap.set_sensitive(true);
1.511 + entNodeCoordsTwoMaps1.set_sensitive(false);
1.512 + entNodeCoordsTwoMaps2.set_sensitive(false);
1.513 + break;
1.514 + case MapStorage::SpecMapSaveOpts::TWO_MAPS:
1.515 + entNodeCoordsOneMap.set_sensitive(false);
1.516 + entNodeCoordsTwoMaps1.set_sensitive(true);
1.517 + entNodeCoordsTwoMaps2.set_sensitive(true);
1.518 + break;
1.519 + }
1.520 + }
1.521 +}
1.522 +
1.523 +void SaveDetailsWidget::onNodeCoordMapNumChanged()
1.524 +{
1.525 + if (rblueCoordOneMap.get_active())
1.526 + {
1.527 + pMapStorage->setNodeCoordsSaveMapNum(MapStorage::SpecMapSaveOpts::ONE_MAP);
1.528 + entNodeCoordsOneMap.set_sensitive(true);
1.529 + entNodeCoordsTwoMaps1.set_sensitive(false);
1.530 + entNodeCoordsTwoMaps2.set_sensitive(false);
1.531 + }
1.532 + else if (rblueCoordTwoMaps.get_active())
1.533 + {
1.534 + pMapStorage->setNodeCoordsSaveMapNum(MapStorage::SpecMapSaveOpts::TWO_MAPS);
1.535 + entNodeCoordsOneMap.set_sensitive(false);
1.536 + entNodeCoordsTwoMaps1.set_sensitive(true);
1.537 + entNodeCoordsTwoMaps2.set_sensitive(true);
1.538 + }
1.539 +}
1.540 +
1.541 +void SaveDetailsWidget::onNodeCoordsOneMapName()
1.542 +{
1.543 + pMapStorage->setNodeCoordsOneMapName(entNodeCoordsOneMap.get_text());
1.544 +}
1.545 +void SaveDetailsWidget::onNodeCoordsTwoMaps1Name()
1.546 +{
1.547 + pMapStorage->setNodeCoordsTwoMaps1Name(entNodeCoordsTwoMaps1.get_text());
1.548 +}
1.549 +void SaveDetailsWidget::onNodeCoordsTwoMaps2Name()
1.550 +{
1.551 + pMapStorage->setNodeCoordsTwoMaps2Name(entNodeCoordsTwoMaps2.get_text());
1.552 +}
1.553 +
1.554 +void SaveDetailsWidget::onArrowCoordSaveDestChanged()
1.555 +{
1.556 + if (rbArrowCoordGuiSection.get_active())
1.557 + {
1.558 + pMapStorage->setArrowCoordsSaveDest(MapStorage::SpecMapSaveOpts::GUI_SECT);
1.559 + rbArrowCoordOneMap.set_sensitive(false);
1.560 + rbArrowCoordTwoMaps.set_sensitive(false);
1.561 + entArrowCoordsOneMap.set_sensitive(false);
1.562 + entArrowCoordsTwoMaps1.set_sensitive(false);
1.563 + entArrowCoordsTwoMaps2.set_sensitive(false);
1.564 + }
1.565 + else if (rbArrowCoordArcsetSection.get_active())
1.566 + {
1.567 + pMapStorage->setArrowCoordsSaveDest(MapStorage::SpecMapSaveOpts::NESET_SECT);
1.568 + rbArrowCoordOneMap.set_sensitive(true);
1.569 + rbArrowCoordTwoMaps.set_sensitive(true);
1.570 + switch (pMapStorage->getArrowCoordsSaveMapNum())
1.571 + {
1.572 + case MapStorage::SpecMapSaveOpts::ONE_MAP:
1.573 + entArrowCoordsOneMap.set_sensitive(true);
1.574 + entArrowCoordsTwoMaps1.set_sensitive(false);
1.575 + entArrowCoordsTwoMaps2.set_sensitive(false);
1.576 + break;
1.577 + case MapStorage::SpecMapSaveOpts::TWO_MAPS:
1.578 + entArrowCoordsOneMap.set_sensitive(false);
1.579 + entArrowCoordsTwoMaps1.set_sensitive(true);
1.580 + entArrowCoordsTwoMaps2.set_sensitive(true);
1.581 + break;
1.582 + }
1.583 + }
1.584 +}
1.585 +
1.586 +void SaveDetailsWidget::onArrowCoordMapNumChanged()
1.587 +{
1.588 + if (rbArrowCoordOneMap.get_active())
1.589 + {
1.590 + pMapStorage->setArrowCoordsSaveMapNum(MapStorage::SpecMapSaveOpts::ONE_MAP);
1.591 + entArrowCoordsOneMap.set_sensitive(true);
1.592 + entArrowCoordsTwoMaps1.set_sensitive(false);
1.593 + entArrowCoordsTwoMaps2.set_sensitive(false);
1.594 + }
1.595 + else if (rbArrowCoordTwoMaps.get_active())
1.596 + {
1.597 + pMapStorage->setArrowCoordsSaveMapNum(MapStorage::SpecMapSaveOpts::TWO_MAPS);
1.598 + entArrowCoordsOneMap.set_sensitive(false);
1.599 + entArrowCoordsTwoMaps1.set_sensitive(true);
1.600 + entArrowCoordsTwoMaps2.set_sensitive(true);
1.601 + }
1.602 +}
1.603 +
1.604 +void SaveDetailsWidget::onArrowCoordsOneMapName()
1.605 +{
1.606 + pMapStorage->setArrowCoordsOneMapName(entArrowCoordsOneMap.get_text());
1.607 +}
1.608 +void SaveDetailsWidget::onArrowCoordsTwoMaps1Name()
1.609 +{
1.610 + pMapStorage->setArrowCoordsTwoMaps1Name(entArrowCoordsTwoMaps1.get_text());
1.611 +}
1.612 +void SaveDetailsWidget::onArrowCoordsTwoMaps2Name()
1.613 +{
1.614 + pMapStorage->setArrowCoordsTwoMaps2Name(entArrowCoordsTwoMaps2.get_text());
1.615 +}
1.616 +
1.617 +SaveDetailsWidget::~SaveDetailsWidget()
1.618 +{
1.619 +}