[Lemon-commits] [lemon_svn] ladanyi: r2123 - hugo/trunk/gui

Lemon SVN svn at lemon.cs.elte.hu
Mon Nov 6 20:50:20 CET 2006


Author: ladanyi
Date: Sun Aug  7 20:06:41 2005
New Revision: 2123

Modified:
   hugo/trunk/gui/graph-displayer.cc
   hugo/trunk/gui/main_win.cc
   hugo/trunk/gui/main_win.h

Log:
open file from command line

Modified: hugo/trunk/gui/graph-displayer.cc
==============================================================================
--- hugo/trunk/gui/graph-displayer.cc	(original)
+++ hugo/trunk/gui/graph-displayer.cc	Sun Aug  7 20:06:41 2005
@@ -43,6 +43,12 @@
   Gtk::Main app(argc, argv);
 
   MainWin mainwin("Displayed Graph");
+
+  if ((argc == 2) && (Glib::file_test(argv[1], Glib::FILE_TEST_IS_REGULAR)))
+  {
+    mainwin.readFile(argv[1]);
+  }
+  
   app.run(mainwin);
 
   return 0;

Modified: hugo/trunk/gui/main_win.cc
==============================================================================
--- hugo/trunk/gui/main_win.cc	(original)
+++ hugo/trunk/gui/main_win.cc	Sun Aug  7 20:06:41 2005
@@ -133,6 +133,15 @@
   show_all_children();
 }
 
+void MainWin::readFile(const std::string &file)
+{
+  mapstorage.readFromFile(file);
+  mapstorage.file_name = file;
+  mapstorage.modified = false;
+  gd_canvas.drawGraph();
+  mapwin.update();
+}
+
 void MainWin::newFile()
 {
   if (mapstorage.modified)

Modified: hugo/trunk/gui/main_win.h
==============================================================================
--- hugo/trunk/gui/main_win.h	(original)
+++ hugo/trunk/gui/main_win.h	Sun Aug  7 20:06:41 2005
@@ -22,6 +22,8 @@
 
   MapStorage mapstorage;
 
+  void readFile(const std::string &);
+
 protected:
   ///Window of map-showing setup. Its type is \ref MapWin
   MapWin mapwin;



More information about the Lemon-commits mailing list