From f1a23af603dfb250c10f8a4ec6a6f9acbd80d972 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Sun, 28 Jun 2009 16:38:39 +0100 Subject: Restructure the class inheritance a bit. This just shuffles around the streamwidget a bit. The RoleWidget child class is the exception, so try and gear things around SinkInput/SourceOutput widgets more to save repeating the same code too much. --- src/streamwidget.cc | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/streamwidget.cc') diff --git a/src/streamwidget.cc b/src/streamwidget.cc index 3a76d1a..8817515 100644 --- a/src/streamwidget.cc +++ b/src/streamwidget.cc @@ -23,11 +23,15 @@ #endif #include "streamwidget.h" +#include "mainwindow.h" #include "channelwidget.h" +#include "i18n.h" + /*** StreamWidget ***/ StreamWidget::StreamWidget(BaseObjectType* cobject, const Glib::RefPtr& x) : - MinimalStreamWidget(cobject, x) { + MinimalStreamWidget(cobject, x), + mpMainWindow(NULL) { x->get_widget("lockToggleButton", lockToggleButton); x->get_widget("muteToggleButton", muteToggleButton); @@ -38,12 +42,25 @@ StreamWidget::StreamWidget(BaseObjectType* cobject, const Glib::RefPtrsignal_clicked().connect(sigc::mem_fun(*this, &StreamWidget::onMuteToggleButton)); deviceButton->signal_clicked().connect(sigc::mem_fun(*this, &StreamWidget::onDeviceChangePopup)); + terminate.set_label(_("Terminate")); + terminate.signal_activate().connect(sigc::mem_fun(*this, &StreamWidget::onKill)); + contextMenu.append(terminate); + contextMenu.show_all(); + for (unsigned i = 0; i < PA_CHANNELS_MAX; i++) channelWidgets[i] = NULL; } -bool StreamWidget::onContextTriggerEvent(GdkEventButton*) { +void StreamWidget::init(MainWindow* mainWindow) { + mpMainWindow = mainWindow; +} + +bool StreamWidget::onContextTriggerEvent(GdkEventButton* event) { + if (GDK_BUTTON_PRESS == event->type && 3 == event->button) { + contextMenu.popup(event->button, event->time); + return true; + } return false; } @@ -111,3 +128,6 @@ void StreamWidget::executeVolumeUpdate() { void StreamWidget::onDeviceChangePopup() { } + +void StreamWidget::onKill() { +} -- cgit