From 6a6dc2c2454a8cad1899c1e4e81c7d0ab63751b6 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 2 Jun 2006 21:09:00 +0000 Subject: do not show the polypaudio error code if we terminate ourselves due to a reason that is unrelated to polypaudio git-svn-id: file:///home/lennart/svn/public/pavumeter/trunk@39 c62a5a7b-6fe3-0310-9d5a-afe6de46906b --- src/vumeter.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/vumeter.cc b/src/vumeter.cc index ab05334..deb40eb 100644 --- a/src/vumeter.cc +++ b/src/vumeter.cc @@ -325,12 +325,13 @@ static struct pa_sample_spec sample_spec = { (enum pa_sample_format) 0, 0, 0 }; static struct pa_channel_map channel_map; static char* source_name = NULL; -void show_error(const char *txt) { +void show_error(const char *txt, bool show_pa_error = true) { char buf[256]; - snprintf(buf, sizeof(buf), "%s: %s", txt, pa_strerror(pa_context_errno(context))); + if (show_pa_error) + snprintf(buf, sizeof(buf), "%s: %s", txt, pa_strerror(pa_context_errno(context))); - Gtk::MessageDialog dialog(buf, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true); + Gtk::MessageDialog dialog(show_pa_error ? buf : txt, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true); dialog.run(); Gtk::Main::quit(); @@ -435,7 +436,7 @@ static void context_get_server_info_callback(struct pa_context *c, const struct } if (!*si->default_source_name) { - show_error("No default source set."); + show_error("No default source set.", false); return; } -- cgit