diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/NodeModule.cpp | 5 | ||||
-rw-r--r-- | src/gui/Port.cpp | 5 | ||||
-rw-r--r-- | src/gui/WindowFactory.cpp | 12 |
3 files changed, 22 insertions, 0 deletions
diff --git a/src/gui/NodeModule.cpp b/src/gui/NodeModule.cpp index 0bacb70b..722cfa83 100644 --- a/src/gui/NodeModule.cpp +++ b/src/gui/NodeModule.cpp @@ -93,6 +93,11 @@ bool NodeModule::show_menu(GdkEventButton* ev) { WidgetFactory::get_widget_derived("object_menu", _menu); + if (!_menu) { + app().log().error("Failed to load object menu widget\n"); + return false; + } + _menu->init(app(), _block); _menu->signal_embed_gui.connect( sigc::mem_fun(this, &NodeModule::on_embed_gui_toggled)); diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index e123a571..20f9cf90 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -141,6 +141,11 @@ Port::show_menu(GdkEventButton* ev) { PortMenu* menu = NULL; WidgetFactory::get_widget_derived("object_menu", menu); + if (!menu) { + _app.log().error("Failed to load port menu widget\n"); + return false; + } + menu->init(_app, model(), _flipped); menu->popup(ev->button, ev->time); return true; diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp index f6d07262..ebd008e6 100644 --- a/src/gui/WindowFactory.cpp +++ b/src/gui/WindowFactory.cpp @@ -14,8 +14,10 @@ along with Ingen. If not, see <http://www.gnu.org/licenses/>. */ +#include <stdexcept> #include <string> +#include "ingen/Log.hpp" #include "ingen/client/GraphModel.hpp" #include "App.hpp" @@ -51,6 +53,11 @@ WindowFactory::WindowFactory(App& app) WidgetFactory::get_widget_derived("properties_win", _properties_win); WidgetFactory::get_widget_derived("rename_win", _rename_win); + if (!(_load_plugin_win && _load_graph_win && _new_subgraph_win + && _properties_win && _rename_win)) { + throw std::runtime_error("failed to load window widgets\n"); + } + _load_plugin_win->init_window(app); _load_graph_win->init(app); _new_subgraph_win->init_window(app); @@ -157,6 +164,11 @@ WindowFactory::new_graph_window(SPtr<const GraphModel> graph, GraphWindow* win = NULL; WidgetFactory::get_widget_derived("graph_win", win); + if (!win) { + _app.log().error("Failed to load graph window widget\n"); + return NULL; + } + win->init_window(_app); win->box()->set_graph(graph, view); |