gui/mapstorage.cc
changeset 1867 15cf1fd6a505
parent 1860 27a9a75b957b
child 1878 409a31271efd
equal deleted inserted replaced
18:3fd60fea15e5 19:38999920764a
   210   try {
   210   try {
   211     LemonReader lreader(filename);
   211     LemonReader lreader(filename);
   212     ContentReader content(lreader);
   212     ContentReader content(lreader);
   213     lreader.run();
   213     lreader.run();
   214 
   214 
       
   215     if (content.nodeSetNum() < 1)
       
   216     {
       
   217       Gtk::MessageDialog mdialog("No nodeset found in file.");
       
   218       mdialog.run();
       
   219       clear();
       
   220       return 1;
       
   221     }
       
   222 
       
   223     if (content.edgeSetNum() < 1)
       
   224     {
       
   225       Gtk::MessageDialog mdialog("No edgeset found in file.");
       
   226       mdialog.run();
       
   227       clear();
       
   228       return 1;
       
   229     }
       
   230 
   215     const std::vector<std::string>& nodeMapNames = content.nodeSetMaps(0);
   231     const std::vector<std::string>& nodeMapNames = content.nodeSetMaps(0);
   216     const std::vector<std::string>& edgeMapNames = content.edgeSetMaps(0);
   232     const std::vector<std::string>& edgeMapNames = content.edgeSetMaps(0);
   217 
   233 
   218     GraphReader<Graph> greader(filename, graph);
   234     GraphReader<Graph> greader(filename, graph);
   219     for (std::vector<std::string>::const_iterator it = nodeMapNames.begin();
   235     for (std::vector<std::string>::const_iterator it = nodeMapNames.begin();
   254       }
   270       }
   255       greader.readEdgeMap(*it, *edgemap_storage[*it]);
   271       greader.readEdgeMap(*it, *edgemap_storage[*it]);
   256     }
   272     }
   257     GuiReader gui_reader(greader, this);
   273     GuiReader gui_reader(greader, this);
   258     greader.run();
   274     greader.run();
   259   } catch (DataFormatError& error) {
   275   } catch (Exception& error) {
   260     Gtk::MessageDialog mdialog(error.what());
   276     Gtk::MessageDialog mdialog(error.what());
   261     mdialog.run();
   277     mdialog.run();
   262     clear();
   278     clear();
   263     return 1;
   279     return 1;
   264   }
   280   }