summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-11-25 22:01:07 +0000
committerDavid Robillard <d@drobilla.net>2011-11-25 22:01:07 +0000
commite0d452db27924fbef0d6d02000bb893c67879763 (patch)
tree4fda1fe22955bcfa904fc076ce19df84af11763a /src
parent650e5f4450772b62856b8f84038d16c74e9b19c9 (diff)
downloadpatchage-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')
-rw-r--r--src/Patchage.cpp27
-rw-r--r--src/Patchage.hpp3
-rw-r--r--src/PatchageCanvas.cpp9
-rw-r--r--src/patchage.ui7
4 files changed, 18 insertions, 28 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
diff --git a/src/Patchage.hpp b/src/Patchage.hpp
index 8ff3ff5..0027b2c 100644
--- a/src/Patchage.hpp
+++ b/src/Patchage.hpp
@@ -90,7 +90,6 @@ protected:
void on_help_about();
void on_messages_clear();
void on_messages_close();
- bool on_messages_delete(GdkEventAny*);
void on_quit();
void on_show_messages();
void on_store_positions();
@@ -141,7 +140,7 @@ protected:
Widget<Gtk::MenuItem> _menu_save_close_session;
Widget<Gtk::MenuItem> _menu_store_positions;
Widget<Gtk::MenuItem> _menu_view_arrange;
- Widget<Gtk::CheckMenuItem> _menu_view_messages;
+ Widget<Gtk::MenuItem> _menu_view_messages;
Widget<Gtk::MenuItem> _menu_view_refresh;
Widget<Gtk::ImageMenuItem> _menu_zoom_in;
Widget<Gtk::ImageMenuItem> _menu_zoom_out;
diff --git a/src/PatchageCanvas.cpp b/src/PatchageCanvas.cpp
index 148466e..070ef8c 100644
--- a/src/PatchageCanvas.cpp
+++ b/src/PatchageCanvas.cpp
@@ -14,11 +14,12 @@
* along with Patchage. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "patchage-config.h"
+#include <boost/format.hpp>
-#include "raul/log.hpp"
#include "raul/SharedPtr.hpp"
+#include "patchage-config.h"
+
#if defined(HAVE_JACK_DBUS)
#include "JackDbusDriver.hpp"
#elif defined(PATCHAGE_LIBJACK)
@@ -34,6 +35,7 @@
#include "PatchagePort.hpp"
using std::string;
+using boost::format;
PatchageCanvas::PatchageCanvas(Patchage* app, int width, int height)
: FlowCanvas::Canvas(width, height)
@@ -113,7 +115,8 @@ PatchageCanvas::remove_port(const PortID& id)
{
PatchagePort* const port = find_port(id);
if (!port) {
- Raul::error << "Failed to find port " << id << " to remove" << std::endl;
+ _app->error_msg((format("Failed to find port with ID `%1' to remove.")
+ % id).str());
}
_port_index.erase(id);
diff --git a/src/patchage.ui b/src/patchage.ui
index 68aed08..d34bcd3 100644
--- a/src/patchage.ui
+++ b/src/patchage.ui
@@ -874,14 +874,13 @@ Nedko Arnaudov &lt;nedko@arnaudov.name&gt;</property>
<object class="GtkMenu" id="view_menu_menu">
<property name="can_focus">False</property>
<child>
- <object class="GtkCheckMenuItem" id="menu_view_messages">
+ <object class="GtkMenuItem" id="menu_view_messages">
<property name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="label" translatable="yes">_Messages</property>
+ <property name="label" translatable="yes">_Messages...</property>
<property name="use_underline">True</property>
<accelerator key="M" signal="activate" modifiers="GDK_CONTROL_MASK"/>
- <signal name="activate" handler="on_messages1_activate" swapped="no"/>
</object>
</child>
<child>
@@ -898,8 +897,8 @@ Nedko Arnaudov &lt;nedko@arnaudov.name&gt;</property>
<property name="can_focus">False</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
- <accelerator key="equal" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<accelerator key="plus" signal="activate" modifiers="GDK_CONTROL_MASK"/>
+ <accelerator key="equal" signal="activate" modifiers="GDK_CONTROL_MASK"/>
</object>
</child>
<child>