00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <core/exception.h>
00024 #include <tools/plugin_gui/plugin_gui.h>
00025 #ifdef HAVE_GCONFMM
00026 # include <gconfmm.h>
00027 #endif
00028 #include <libglademm/xml.h>
00029 #include <iostream>
00030
00031 using namespace std;
00032
00033 int main(int argc, char** argv)
00034 {
00035 try
00036 {
00037 Gtk::Main kit(argc, argv);
00038 #ifdef HAVE_GCONFMM
00039 Gnome::Conf::init();
00040 #endif
00041
00042 #ifdef GLIBMM_EXCEPTIONS_ENABLED
00043 Glib::RefPtr<Gnome::Glade::Xml> refxml = Gnome::Glade::Xml::create(RESDIR"/guis/plugin_tool/plugin_tool.glade");
00044 #else
00045 std::auto_ptr<Gnome::Glade::XmlError> error;
00046 Glib::RefPtr<Gnome::Glade::Xml> refxml = Gnome::Glade::Xml::create(RESDIR"/guis/plugin_tool/plugin_tool.glade", "", "", error);
00047 if (error.get()) {
00048 throw fawkes::Exception("Failed to load Glade file: %s", error->what().c_str());
00049 }
00050 #endif
00051
00052 PluginGuiGtkWindow *window = NULL;
00053 refxml->get_widget_derived("wndMain", window);
00054
00055 kit.run( *window );
00056
00057 delete window;
00058 }
00059 catch (std::exception const& e)
00060 {
00061 std::cerr << "Error: " << e.what() << std::endl;
00062 }
00063
00064 return 0;
00065 }