diff options
author | David Robillard <d@drobilla.net> | 2011-11-25 22:01:07 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-11-25 22:01:07 +0000 |
commit | e0d452db27924fbef0d6d02000bb893c67879763 (patch) | |
tree | 4fda1fe22955bcfa904fc076ce19df84af11763a /src/Patchage.cpp | |
parent | 650e5f4450772b62856b8f84038d16c74e9b19c9 (diff) | |
download | patchage-e0d452db27924fbef0d6d02000bb893c67879763.tar.gz patchage-e0d452db27924fbef0d6d02000bb893c67879763.tar.bz2 patchage-e0d452db27924fbef0d6d02000bb893c67879763.zip |
Move more logging into the messages window.
Make View->Messages a plain menu item.
Pop up messages window on error.
git-svn-id: http://svn.drobilla.net/lad/trunk/patchage@3632 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/Patchage.cpp')
-rw-r--r-- | src/Patchage.cpp | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/Patchage.cpp b/src/Patchage.cpp index 706b1d2..0b77244 100644 --- a/src/Patchage.cpp +++ b/src/Patchage.cpp @@ -175,7 +175,7 @@ Patchage::Patchage(int argc, char** argv) sigc::mem_fun(this, &Patchage::refresh)); _menu_view_arrange->signal_activate().connect( sigc::mem_fun(this, &Patchage::on_arrange)); - _menu_view_messages->signal_toggled().connect( + _menu_view_messages->signal_activate().connect( sigc::mem_fun(this, &Patchage::on_show_messages)); _menu_help_about->signal_activate().connect( sigc::mem_fun(this, &Patchage::on_help_about)); @@ -190,8 +190,6 @@ Patchage::Patchage(int argc, char** argv) sigc::mem_fun(this, &Patchage::on_messages_clear)); _messages_close_but->signal_clicked().connect( sigc::mem_fun(this, &Patchage::on_messages_close)); - _messages_win->signal_delete_event().connect( - sigc::mem_fun(this, &Patchage::on_messages_delete)); _error_tag = Gtk::TextTag::create(); _error_tag->property_foreground() = "#FF0000"; @@ -373,6 +371,7 @@ Patchage::error_msg(const std::string& msg) Glib::RefPtr<Gtk::TextBuffer> buffer = _status_text->get_buffer(); buffer->insert_with_tag(buffer->end(), msg + "\n", _error_tag); _status_text->scroll_to_mark(buffer->get_insert(), 0); + _messages_win->present(); } void @@ -453,14 +452,14 @@ Patchage::show_open_session_dialog() const std::string dir = dialog.get_filename(); if (g_chdir(dir.c_str())) { - Raul::error << "Failed to switch to session directory " << dir << endl; + error_msg("Failed to switch to session directory " + dir); return; } if (system("./jack-session") < 0) { - Raul::error << "Error executing `./jack-session' in " << dir << endl; + error_msg("Error executing `./jack-session' in " + dir); } else { - Raul::info << "Loaded session " << dir << endl; + info_msg("Loaded session " + dir); } } @@ -480,7 +479,7 @@ Patchage::save_session(bool close) std::string path = dialog.get_filename(); if (g_mkdir_with_parents(path.c_str(), 0740)) { - Raul::error << "Failed to create session directory " << path << endl; + error_msg("Failed to create session directory " + path); return; } @@ -601,14 +600,7 @@ Patchage::on_messages_clear() void Patchage::on_messages_close() { - _menu_view_messages->set_active(false); -} - -bool -Patchage::on_messages_delete(GdkEventAny*) -{ - _menu_view_messages->set_active(false); - return true; + _messages_win->hide(); } void @@ -627,10 +619,7 @@ Patchage::on_quit() void Patchage::on_show_messages() { - if (_menu_view_messages->get_active()) - _messages_win->present(); - else - _messages_win->hide(); + _messages_win->present(); } void |