- Pardon my italian, but "'affanculo" is the only thing that
crosses my mind seeing what was the correct fix. git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@738 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
933d814ddc
commit
483cf2815d
|
@ -53,6 +53,6 @@ main(int argc, char* argv[])
|
||||||
// Parses options and prepares vector with
|
// Parses options and prepares vector with
|
||||||
// filenames of documents to be opened
|
// filenames of documents to be opened
|
||||||
parse_options(argc, argv);
|
parse_options(argc, argv);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,7 +93,7 @@ parse_options(int argc, char** argv)
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Parse options, initialising the Gtk::Main at the same time
|
// Parse options, initialising the Gtk::Main at the same time
|
||||||
Gtk::Main(argc, argv, context);
|
Gtk::Main main_loop(argc, argv, context);
|
||||||
|
|
||||||
GlobalPreferences& prefs = GlobalPreferences::get_instance();
|
GlobalPreferences& prefs = GlobalPreferences::get_instance();
|
||||||
|
|
||||||
|
@ -118,11 +118,15 @@ parse_options(int argc, char** argv)
|
||||||
throw Glib::OptionError(Glib::OptionError::FAILED, _("The `No-GUI' option isn't active yet."));
|
throw Glib::OptionError(Glib::OptionError::FAILED, _("The `No-GUI' option isn't active yet."));
|
||||||
|
|
||||||
// FIXME : to be written!
|
// FIXME : to be written!
|
||||||
} else {
|
}
|
||||||
if(fnames.begin() != fnames.end())
|
else
|
||||||
start_gui(*fnames.begin());
|
{
|
||||||
else
|
Gtk::Window* main_window;
|
||||||
start_gui("");
|
if(fnames.begin() != fnames.end())
|
||||||
|
main_window = start_gui(*fnames.begin());
|
||||||
|
else
|
||||||
|
main_window = start_gui("");
|
||||||
|
main_loop.run(*main_window);
|
||||||
}
|
}
|
||||||
} // ~ try
|
} // ~ try
|
||||||
catch(Glib::OptionError e)
|
catch(Glib::OptionError e)
|
||||||
|
|
|
@ -28,12 +28,11 @@
|
||||||
#include <gtkmm/aboutdialog.h>
|
#include <gtkmm/aboutdialog.h>
|
||||||
#include <gtkmm/main.h>
|
#include <gtkmm/main.h>
|
||||||
#include <gtkmm/menuitem.h>
|
#include <gtkmm/menuitem.h>
|
||||||
#include <gtkmm/window.h>
|
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
void
|
Gtk::Window*
|
||||||
start_gui(const std::string& filename)
|
start_gui(const std::string& filename)
|
||||||
{
|
{
|
||||||
using namespace Gnome;
|
using namespace Gnome;
|
||||||
|
@ -54,19 +53,21 @@ start_gui(const std::string& filename)
|
||||||
// Glade::Xml::get_widget_derived -- better --)
|
// Glade::Xml::get_widget_derived -- better --)
|
||||||
MenuItem* file_quit = NULL;
|
MenuItem* file_quit = NULL;
|
||||||
refXml->get_widget("MenuItem.File.Quit", file_quit);
|
refXml->get_widget("MenuItem.File.Quit", file_quit);
|
||||||
file_quit->signal_activate().connect(sigc::ptr_fun(&Main::quit));
|
assert(file_quit != NULL);
|
||||||
|
file_quit->signal_activate().connect(sigc::ptr_fun(&Main::quit));
|
||||||
|
|
||||||
// About dialog
|
// About dialog
|
||||||
MenuItem* help_about = NULL;
|
MenuItem* help_about = NULL;
|
||||||
refXml->get_widget("MenuItem.Help.About", help_about);
|
refXml->get_widget("MenuItem.Help.About", help_about);
|
||||||
|
assert(help_about != NULL);
|
||||||
AboutDialog* about_dialog = NULL;
|
AboutDialog* about_dialog = NULL;
|
||||||
refXml->get_widget("AboutDialog", about_dialog);
|
refXml->get_widget("AboutDialog", about_dialog);
|
||||||
|
assert(about_dialog != NULL);
|
||||||
help_about->signal_activate().connect(sigc::mem_fun(*about_dialog, &Window::show));
|
help_about->signal_activate().connect(sigc::mem_fun(*about_dialog, &Window::show));
|
||||||
|
|
||||||
// FIXME: Here open filename if != ""
|
// FIXME: Here open filename if != ""
|
||||||
|
|
||||||
main_window->show_all_children();
|
main_window->show_all_children();
|
||||||
|
return main_window;
|
||||||
Main::run(*main_window);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,12 +23,14 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include <gtkmm/window.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
/** \brief This function initialize and starts the whole GUI
|
/** \brief This function initialize and starts the whole GUI
|
||||||
|
|
||||||
*/
|
*/
|
||||||
void SG_DLLEXPORT start_gui(const std::string& filename);
|
Gtk::Window* start_gui(const std::string& filename);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue