From 7a7c1fc7f2a94fea91c66e9be35e8d6d81c0c7fe Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Wed, 17 Jun 2009 22:25:19 +0100 Subject: Hide the terminate button. The terminate button is a last resort and shouldn't be promoted in the UI. This commit hides it behind a right click menu instead. This also hides the 'Set as Fallback' label in the glade file. --- src/sourceoutputwidget.cc | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) (limited to 'src/sourceoutputwidget.cc') diff --git a/src/sourceoutputwidget.cc b/src/sourceoutputwidget.cc index fb3f441..513c293 100644 --- a/src/sourceoutputwidget.cc +++ b/src/sourceoutputwidget.cc @@ -35,6 +35,11 @@ SourceOutputWidget::SourceOutputWidget(BaseObjectType* cobject, const Glib::RefP gchar *txt; directionLabel->set_label(txt = g_markup_printf_escaped("%s", _("from"))); g_free(txt); + + terminate.set_label(_("Terminate Recording")); + terminate.signal_activate().connect(sigc::mem_fun(*this, &SourceOutputWidget::onKill)); + terminateMenu.append(terminate); + terminateMenu.show_all(); } void SourceOutputWidget::init(MainWindow* mainWindow) { @@ -71,6 +76,15 @@ uint32_t SourceOutputWidget::sourceIndex() { return mSourceIndex; } +bool SourceOutputWidget::onWidgetButtonEvent(GdkEventButton* event) { + if (GDK_BUTTON_PRESS == event->type && 3 == event->button) { + terminateMenu.popup(event->button, event->time); + return true; + } + + return false; +} + void SourceOutputWidget::onKill() { pa_operation* o; if (!(o = pa_context_kill_source_output(get_context(), index, NULL, NULL))) { @@ -119,13 +133,12 @@ void SourceOutputWidget::SourceMenuItem::onToggle() { } bool SourceOutputWidget::onDeviceChangePopup(GdkEventButton* event) { - if (GDK_BUTTON_PRESS == event->type && 1 == event->button) - { - clearMenu(); - buildMenu(); - menu.popup(event->button, event->time); - return true; + if (GDK_BUTTON_PRESS == event->type && 1 == event->button) { + clearMenu(); + buildMenu(); + menu.popup(event->button, event->time); + return true; } - else - return false; + + return false; } -- cgit