diff options
author | Colin Guthrie <cguthrie@mandriva.org> | 2009-06-28 16:38:39 +0100 |
---|---|---|
committer | Colin Guthrie <cguthrie@mandriva.org> | 2009-06-28 16:38:39 +0100 |
commit | f1a23af603dfb250c10f8a4ec6a6f9acbd80d972 (patch) | |
tree | 09cf272b4870b6d33085d2d4b1d9b4ad3dd5aec3 /src/streamwidget.cc | |
parent | ac052e1a30d1aeb7c514f9dd4eb8e6fb50382185 (diff) |
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.
Diffstat (limited to 'src/streamwidget.cc')
-rw-r--r-- | src/streamwidget.cc | 24 |
1 files changed, 22 insertions, 2 deletions
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<Gnome::Glade::Xml>& 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::RefPtr<Gnome::Gl muteToggleButton->signal_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() { +} |