aboutsummaryrefslogtreecommitdiffstats
path: root/src/gui/MachinaGUI.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/MachinaGUI.cpp')
-rw-r--r--src/gui/MachinaGUI.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gui/MachinaGUI.cpp b/src/gui/MachinaGUI.cpp
index db5e70c..592001f 100644
--- a/src/gui/MachinaGUI.cpp
+++ b/src/gui/MachinaGUI.cpp
@@ -242,8 +242,8 @@ MachinaGUI::attach()
bool
MachinaGUI::idle_callback()
{
- for (ItemMap::iterator i = _canvas->items().begin(); i != _canvas->items().end(); ++i) {
- SharedPtr<NodeView> nv = PtrCast<NodeView>(i->second);
+ for (ItemList::iterator i = _canvas->items().begin(); i != _canvas->items().end(); ++i) {
+ const SharedPtr<NodeView> nv = PtrCast<NodeView>(*i);
if (nv)
nv->update_state();
}
@@ -465,12 +465,13 @@ MachinaGUI::menu_import_midi()
SharedPtr<Machina::Machine> machine = file_driver->learn(dialog.get_uri());
if (machine) {
+ dialog.hide();
machine->activate();
machine->reset();
- _engine->driver()->set_machine(machine);
_canvas->build(machine);
+ _engine->driver()->set_machine(machine);
} else {
- Gtk::MessageDialog msg_dialog(*_main_window, "Error loading MIDI file",
+ Gtk::MessageDialog msg_dialog(dialog, "Error loading MIDI file",
false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
msg_dialog.run();
}