- Textual simulation is now brought up only if requested
by the -N switch given at the cmdline git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@754 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
3612d20ae0
commit
db34232e72
3 changed files with 142 additions and 134 deletions
15
src/main.cc
15
src/main.cc
|
@ -24,8 +24,6 @@
|
|||
#include "main.hh"
|
||||
|
||||
#include "parse_opts.hh"
|
||||
#include "text_simulation.hh"
|
||||
#include "io_manager.hh"
|
||||
|
||||
#include <glibmm/module.h>
|
||||
#include <glibmm/thread.h>
|
||||
|
@ -55,17 +53,6 @@ main(int argc, char* argv[])
|
|||
// Parses options and prepares vector with
|
||||
// filenames of documents to be opened
|
||||
parse_options(argc, argv);
|
||||
|
||||
TextSimulation sim;
|
||||
|
||||
while(1)
|
||||
{
|
||||
string str;
|
||||
getline(cin, str);
|
||||
|
||||
TextSimulation::parse_command(sim, str);
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,13 +23,15 @@
|
|||
|
||||
#include "backend/global_preferences.hh"
|
||||
#include "backend/plugin_manager.hh"
|
||||
#include "text_simulation.hh"
|
||||
#include "io_manager.hh"
|
||||
#include "gui_builder.hh"
|
||||
#include "parse_opts.hh"
|
||||
|
||||
#include <glibmm/optioncontext.h>
|
||||
#include <gtkmm/main.h>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
using namespace sgpem;
|
||||
|
@ -49,7 +51,7 @@ parse_options(int argc, char** argv)
|
|||
OptionEntry no_gui;
|
||||
OptionEntry policies_dir;
|
||||
OptionEntry modules_dir;
|
||||
OptionEntry filename;
|
||||
OptionEntry filename;
|
||||
|
||||
no_gui.set_short_name('N');
|
||||
policies_dir.set_short_name('P');
|
||||
|
@ -114,10 +116,16 @@ parse_options(int argc, char** argv)
|
|||
{
|
||||
// We don't return to main, instead we
|
||||
// initialize the command line version
|
||||
// of sgpemv2 (?)
|
||||
throw Glib::OptionError(Glib::OptionError::FAILED, _("The `No-GUI' option isn't active yet."));
|
||||
// of sgpemv2
|
||||
TextSimulation sim;
|
||||
|
||||
// FIXME : to be written!
|
||||
while(1)
|
||||
{
|
||||
std::string str;
|
||||
getline(std::cin, str);
|
||||
|
||||
TextSimulation::parse_command(sim, str);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -126,7 +134,8 @@ parse_options(int argc, char** argv)
|
|||
gui->open_file(*fnames.begin());
|
||||
main_loop.run(gui->get_initial_window());
|
||||
delete gui;
|
||||
}
|
||||
}
|
||||
|
||||
} // ~ try
|
||||
catch(Glib::OptionError e)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue