- Added a best-effort preferences dialog:
the user may now add plugin directories, policy directories, and set the simulation speed. - Added some menu voice to the main window. git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@872 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
047f0b8f86
commit
cfd7a025db
8 changed files with 1449 additions and 633 deletions
|
@ -25,6 +25,7 @@
|
|||
#include "simulation_widget.hh"
|
||||
|
||||
#include "gui_builder.hh"
|
||||
#include "graphical_preferences_editor.hh"
|
||||
|
||||
#include "backend/history.hh"
|
||||
#include "backend/simulation.hh"
|
||||
|
@ -49,13 +50,19 @@ test_me()
|
|||
sim.get_history().add_process("goofy", 0, 0);
|
||||
}
|
||||
|
||||
void
|
||||
GuiBuilder::on_edit_preferences_activate()
|
||||
{
|
||||
new PreferencesEditor(); //FIXME: are we leaking this way?
|
||||
}
|
||||
|
||||
|
||||
GuiBuilder::GuiBuilder(const std::string& gladefile)
|
||||
: _refXml(Xml::create(gladefile))
|
||||
{
|
||||
using namespace Gtk;
|
||||
|
||||
Window& main_window = get_initial_window();
|
||||
//Window& main_window = get_initial_window();
|
||||
|
||||
// Connect extra signals (decide where to do this...
|
||||
// here -- ugly -- derive widgets and then use
|
||||
|
@ -64,13 +71,29 @@ GuiBuilder::GuiBuilder(const std::string& gladefile)
|
|||
_refXml->get_widget("MenuItem.File.Quit", file_quit);
|
||||
file_quit->signal_activate().connect(sigc::ptr_fun(&Main::quit));
|
||||
|
||||
// preferences dialog
|
||||
MenuItem* edit_preferences = NULL;
|
||||
_refXml->get_widget("MenuItem.Edit.Preferences", edit_preferences);
|
||||
edit_preferences->signal_activate().connect(sigc::mem_fun(*this, &GuiBuilder::on_edit_preferences_activate));
|
||||
|
||||
|
||||
// About dialog
|
||||
MenuItem* help_about = NULL;
|
||||
_refXml->get_widget("MenuItem.Help.About", help_about);
|
||||
AboutDialog* about_dialog = NULL;
|
||||
_refXml->get_widget("AboutDialog", about_dialog);
|
||||
//help_about->signal_activate().connect(sigc::mem_fun(*about_dialog, &Window::show));
|
||||
help_about->signal_activate().connect(sigc::ptr_fun(test_me));
|
||||
help_about->signal_activate().connect(sigc::mem_fun(*about_dialog, &Window::show));
|
||||
|
||||
|
||||
|
||||
|
||||
// Random Error Generator
|
||||
MenuItem* debug_error = NULL;
|
||||
_refXml->get_widget("MenuItem.Debug.Error", debug_error);
|
||||
debug_error->signal_activate().connect(sigc::ptr_fun(test_me));
|
||||
|
||||
|
||||
|
||||
|
||||
// Temporary code to test the Schedulables custom widget
|
||||
Expander* scheds_expander = NULL;
|
||||
|
@ -82,6 +105,8 @@ GuiBuilder::GuiBuilder(const std::string& gladefile)
|
|||
scheds_widget->show();
|
||||
|
||||
|
||||
|
||||
|
||||
// Main simulation widget
|
||||
ScrolledWindow* simulation_window = NULL;
|
||||
_refXml->get_widget("SimulationScrolledWindow", simulation_window);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue