- 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:
tchernobog 2006-07-12 08:31:25 +00:00
parent 3612d20ae0
commit db34232e72
3 changed files with 142 additions and 134 deletions

View File

@ -4,12 +4,12 @@
<glade-interface>
<widget class="GtkWindow" id="MainWindow">
<property name="width_request">300</property>
<property name="height_request">200</property>
<property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="default_width">800</property>
<property name="default_height">600</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
@ -18,6 +18,7 @@
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
<child>
<widget class="GtkVBox" id="MainBox">
@ -28,6 +29,8 @@
<child>
<widget class="GtkMenuBar" id="MenuBar">
<property name="visible">True</property>
<property name="pack_direction">GTK_PACK_DIRECTION_LTR</property>
<property name="child_pack_direction">GTK_PACK_DIRECTION_LTR</property>
<child>
<widget class="GtkMenuItem" id="MenuItem.File">
@ -282,133 +285,140 @@
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkVBox" id="ExpandersBox">
<property name="border_width">3</property>
<widget class="GtkViewport" id="ExpandersViewport">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<child>
<widget class="GtkExpander" id="SchedulablesExpander">
<widget class="GtkVBox" id="ExpandersBox">
<property name="border_width">3</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="expanded">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<placeholder/>
<widget class="GtkExpander" id="SchedulablesExpander">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="expanded">True</property>
<property name="spacing">0</property>
<child>
<placeholder/>
</child>
<child>
<widget class="GtkLabel" id="SchedulablesExpander.Label">
<property name="visible">True</property>
<property name="label" translatable="yes">Schedulables</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="SchedulablesExpander.Label">
<widget class="GtkExpander" id="ResourcesExpander">
<property name="visible">True</property>
<property name="label" translatable="yes">Schedulables</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
<property name="can_focus">True</property>
<property name="expanded">True</property>
<property name="spacing">0</property>
<child>
<placeholder/>
</child>
<child>
<widget class="GtkLabel" id="ResourcesExpander.Label">
<property name="visible">True</property>
<property name="label" translatable="yes">Resources</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="type">label_item</property>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkExpander" id="RequestsExpander">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="expanded">False</property>
<property name="spacing">0</property>
<child>
<placeholder/>
</child>
<child>
<widget class="GtkLabel" id="RequestsExpander.Label">
<property name="visible">True</property>
<property name="label" translatable="yes">Requests</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkExpander" id="ResourcesExpander">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="expanded">True</property>
<property name="spacing">0</property>
<child>
<placeholder/>
</child>
<child>
<widget class="GtkLabel" id="ResourcesExpander.Label">
<property name="visible">True</property>
<property name="label" translatable="yes">Resources</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkExpander" id="RequestsExpander">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="expanded">True</property>
<property name="spacing">0</property>
<child>
<placeholder/>
</child>
<child>
<widget class="GtkLabel" id="RequestsExpander.Label">
<property name="visible">True</property>
<property name="label" translatable="yes">Requests</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
@ -463,9 +473,11 @@
<widget class="GtkAboutDialog" id="AboutDialog">
<property name="destroy_with_parent">False</property>
<property name="name" translatable="yes">Application Name</property>
<property name="name" translatable="yes">SGPEMv2</property>
<property name="copyright">University of Padova, dept. of Pure and Applied Mathematics</property>
<property name="comments" translatable="yes">An educational simulator for process scheduling policies in a monoprocessor computer.</property>
<property name="license">SGPEMv2 comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under the terms of the GNU General Public License; for details see file COPYING contained in the source package.</property>
<property name="wrap_license">False</property>
<property name="authors">Giovanni Giacobbi &lt;ggiacobb@studenti.math.unipd.it&gt;
Filippo Paparella &lt;ironpipp@gmail.com&gt;
Paolo Santi &lt;psanti@studenti.math.unipd.it&gt;

View File

@ -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>
@ -56,16 +54,5 @@ main(int argc, char* argv[])
// 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;
}

View File

@ -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)
{