- Re-enable loading of saved files

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@954 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-08-28 21:48:55 +00:00
parent 9e61332a12
commit 73c66c12d3
1 changed files with 11 additions and 8 deletions

View File

@ -46,6 +46,7 @@
#include <gtkmm/main.h>
#include <gtkmm/menuitem.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/statusbar.h>
#include <gtkmm/stock.h>
#include <cassert>
@ -103,9 +104,9 @@ GuiBuilder::on_file_open_activate()
int result = dialog.run();
if(result==Gtk::RESPONSE_OK)
{
// DISABLED - Actually locks computer
// serializer.restore_snapshot("prova1.xgp", history);
msg = "File: " + dialog.get_filename() + " loaded.";
Glib::ustring filename = dialog.get_filename();
serializer.restore_snapshot(filename, history);
msg = "File: " + filename + " loaded.";
} // end - if(result==Gtk::RESPONSE_OK)
}
@ -119,8 +120,8 @@ GuiBuilder::on_file_open_activate()
}
if(!msg.empty())
{
Gtk::MessageDialog msg_dialog(get_initial_window(), msg);
msg_dialog.run();
Gtk::Statusbar* sbar = _refXml->get_widget("MainStatusBar", sbar);
sbar->push(msg);
}
}
@ -168,7 +169,6 @@ GuiBuilder::on_file_saveas_activate()
int result = dialog.run();
if(result==Gtk::RESPONSE_OK)
{
// DISABLED - Actually locks computer
serializer.save_snapshot(dialog.get_filename(), history);
msg = "File: " + dialog.get_filename() + " saved.";
} // end - if(result==Gtk::RESPONSE_OK)
@ -182,11 +182,14 @@ GuiBuilder::on_file_saveas_activate()
{
msg = _("ERROR: ") + Glib::ustring(e.what());
}
if(!msg.empty())
{
Gtk::MessageDialog msg_dialog(get_initial_window(), msg);
msg_dialog.run();
Gtk::Statusbar* sbar = _refXml->get_widget("MainStatusBar", sbar);
sbar->push(msg);
}
}
GuiBuilder::GuiBuilder(const std::string& gladefile)