[pulseaudio-commits] 5 commits - configure.ac src/cardwidget.cc src/devicewidget.cc src/devicewidget.h src/mainwindow.cc src/minimalstreamwidget.cc src/minimalstreamwidget.h src/pavucontrol.glade src/streamwidget.cc
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Nov 23 02:53:55 UTC 2018
configure.ac | 21 ------
src/cardwidget.cc | 4 -
src/devicewidget.cc | 19 +++--
src/devicewidget.h | 4 -
src/mainwindow.cc | 4 -
src/minimalstreamwidget.cc | 18 ++++-
src/minimalstreamwidget.h | 11 +++
src/pavucontrol.glade | 145 ++++++++++++++++++++++-----------------------
src/streamwidget.cc | 14 +++-
9 files changed, 122 insertions(+), 118 deletions(-)
New commits:
commit dfeabf086c1222790add7e949effe7e9f2703eb2
Author: Tanu Kaskinen <tanuk at iki.fi>
Date: Wed Nov 21 12:31:56 2018 +0200
drop gtk2 support
When opening pavucontrol.glade with Glade 3.22.1, this message was
shown:
pavucontrol.glade targets Gtk+ 2.16
But this version of Glade is for GTK+ 3 only.
Make sure you can run this project with Glade 3.8 with no deprecated
widgets first.
I think it's best to just drop the gtk2 support.
diff --git a/configure.ac b/configure.ac
index ee8a0e9..9790fd5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,26 +41,7 @@ AC_TYPE_SIGNAL
AC_HEADER_STDC
AX_CXX_COMPILE_STDCXX_11
-AC_ARG_ENABLE(gtk3,
- [AS_HELP_STRING([--disable-gtk3],
- [Whether to build or not against gtk3 [default=yes]])],
- [enable_gtk3=$enableval],
- [enable_gtk3="yes"])
-
-if test "x$enable_gtk3" = "xyes"; then
- gtkmm_ver="3.0"
- gtkmm_min_ver="2.99"
- canberra_ver="3"
- AC_DEFINE([HAVE_GTK3], [1], [Define if we are building against gtk3])
- echo "***"
- echo "*** Attempting build in GTK3 mode. Use --disable-gtk3 to build for GTK2"
- echo "***"
-else
- gtkmm_ver="2.4"
- gtkmm_min_ver="2.16"
- canberra_ver=""
-fi
-PKG_CHECK_MODULES(GUILIBS, [ gtkmm-$gtkmm_ver >= $gtkmm_min_ver sigc++-2.0 libcanberra-gtk$canberra_ver >= 0.16 ])
+PKG_CHECK_MODULES(GUILIBS, [ gtkmm-3.0 >= 3.0 sigc++-2.0 libcanberra-gtk3 >= 0.16 ])
AC_SUBST(GUILIBS_CFLAGS)
AC_SUBST(GUILIBS_LIBS)
diff --git a/src/devicewidget.cc b/src/devicewidget.cc
index ce9850f..0a51bc0 100644
--- a/src/devicewidget.cc
+++ b/src/devicewidget.cc
@@ -70,13 +70,8 @@ DeviceWidget::DeviceWidget(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Buil
for (unsigned i = 0; i < PA_CHANNELS_MAX; i++)
channelWidgets[i] = NULL;
-#ifdef HAVE_GTK3
offsetAdjustment = Gtk::Adjustment::create(0.0, -2000.0, 5000.0, 10.0, 50.0, 0.0);
offsetButton->configure(offsetAdjustment, 0, 2);
-#else
- offsetAdjustment = new Gtk::Adjustment(0.0, -2000.0, 5000.0, 10.0, 50.0, 0.0);
- offsetButton->configure(*offsetAdjustment, 0.0, 2);
-#endif /* HAVE_GTK3 */
}
void DeviceWidget::init(MainWindow* mainWindow, Glib::ustring deviceType) {
diff --git a/src/devicewidget.h b/src/devicewidget.h
index 3bff264..30a6672 100644
--- a/src/devicewidget.h
+++ b/src/devicewidget.h
@@ -101,11 +101,7 @@ protected:
Gtk::HBox *portSelect, *offsetSelect;
Gtk::ComboBox *portList;
Glib::RefPtr<Gtk::ListStore> treeModel;
-#ifdef HAVE_GTK3
Glib::RefPtr<Gtk::Adjustment> offsetAdjustment;
-#else
- Gtk::Adjustment *offsetAdjustment;
-#endif /* HAVE_GTK3 */
private:
Glib::ustring mDeviceType;
diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index da598fd..3f5bf2b 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -196,11 +196,7 @@ MainWindow* MainWindow::create(bool maximize) {
void MainWindow::on_realize() {
Gtk::Window::on_realize();
-#ifdef HAVE_GTK3
get_window()->set_cursor(Gdk::Cursor::create(Gdk::WATCH));
-#else
- get_window()->set_cursor(Gdk::Cursor(Gdk::WATCH));
-#endif /* HAVE_GTK3 */
}
bool MainWindow::on_key_press_event(GdkEventKey* event) {
diff --git a/src/pavucontrol.glade b/src/pavucontrol.glade
index 03e4fb0..3602d5b 100644
--- a/src/pavucontrol.glade
+++ b/src/pavucontrol.glade
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <requires lib="gtk+" version="2.16"/>
+ <requires lib="gtk+" version="3.0"/>
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">100</property>
<property name="value">44.2408370972</property>
commit 577246f15ae99aeb50581638d35fed6e3c3434d5
Author: Tanu Kaskinen <tanuk at iki.fi>
Date: Wed Nov 21 12:25:02 2018 +0200
pavucontrol.glade: changes automatically done by Glade
When opening pavucontrol.glade in Glade 3.22.1 and saving the file
without doing any manual changes, these changes are made to the file.
The changes seem harmless, so let's apply them to avoid unnecessary
clutter appearing when doing more important changes in the future.
diff --git a/src/pavucontrol.glade b/src/pavucontrol.glade
index 0694010..03e4fb0 100644
--- a/src/pavucontrol.glade
+++ b/src/pavucontrol.glade
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="2.16"/>
- <!-- interface-naming-policy toplevel-contextual -->
<object class="GtkAdjustment" id="adjustment1">
<property name="upper">100</property>
<property name="value">44.2408370972</property>
@@ -12,6 +11,9 @@
<property name="can_focus">False</property>
<property name="title" translatable="yes">window2</property>
<child>
+ <placeholder/>
+ </child>
+ <child>
<object class="GtkHBox" id="channelWidget">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -20,11 +22,11 @@
<object class="GtkLabel" id="channelLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0</property>
<property name="label" translatable="yes"><b>left-front</b></property>
<property name="use_markup">True</property>
<property name="width_chars">15</property>
+ <property name="xalign">0</property>
+ <property name="yalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -50,13 +52,13 @@
<object class="GtkLabel" id="volumeLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">1</property>
- <property name="yalign">0</property>
<property name="xpad">8</property>
<property name="label" translatable="yes"><small>50%</small></property>
<property name="use_markup">True</property>
<property name="justify">right</property>
<property name="width_chars">9</property>
+ <property name="xalign">1</property>
+ <property name="yalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -72,6 +74,9 @@
<property name="can_focus">False</property>
<property name="title" translatable="yes">window1</property>
<child>
+ <placeholder/>
+ </child>
+ <child>
<object class="GtkEventBox" id="cardWidgetBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -112,10 +117,10 @@
<object class="GtkLabel" id="cardNameLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">Card Name</property>
<property name="use_markup">True</property>
<property name="ellipsize">middle</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">True</property>
@@ -146,9 +151,9 @@
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes"><b>Profile:</b></property>
<property name="use_markup">True</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -202,6 +207,9 @@
<property name="can_focus">False</property>
<property name="title" translatable="yes">window1</property>
<child>
+ <placeholder/>
+ </child>
+ <child>
<object class="GtkEventBox" id="deviceWidgetBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -253,10 +261,10 @@
<object class="GtkLabel" id="deviceNameLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">Device Title</property>
<property name="use_markup">True</property>
<property name="ellipsize">end</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -288,7 +296,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">audio-volume-muted</property>
- <property name="icon-size">1</property>
+ <property name="icon_size">1</property>
</object>
</child>
</object>
@@ -311,7 +319,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">changes-prevent</property>
- <property name="icon-size">1</property>
+ <property name="icon_size">1</property>
</object>
</child>
</object>
@@ -364,9 +372,9 @@
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes"><b>Port:</b></property>
<property name="use_markup">True</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -520,9 +528,9 @@
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes"><b>Latency offset:</b></property>
<property name="use_markup">True</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -537,8 +545,6 @@
<property name="invisible_char">•</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
</object>
<packing>
<property name="expand">True</property>
@@ -686,6 +692,9 @@
<property name="default_height">400</property>
<property name="icon_name">multimedia-volume-control</property>
<child>
+ <placeholder/>
+ </child>
+ <child>
<object class="GtkVBox" id="vbox20">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -705,8 +714,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">0</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkViewport" id="viewport1">
<property name="visible">True</property>
@@ -771,10 +778,10 @@
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">1</property>
<property name="label" translatable="yes"><b>_Show:</b></property>
<property name="use_markup">True</property>
<property name="use_underline">True</property>
+ <property name="xalign">1</property>
</object>
<packing>
<property name="expand">True</property>
@@ -831,8 +838,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">0</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkViewport" id="viewport5">
<property name="visible">True</property>
@@ -897,10 +902,10 @@
<object class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">1</property>
<property name="label" translatable="yes"><b>_Show:</b></property>
<property name="use_markup">True</property>
<property name="use_underline">True</property>
+ <property name="xalign">1</property>
</object>
<packing>
<property name="expand">True</property>
@@ -961,8 +966,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">0</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkViewport" id="viewport4">
<property name="visible">True</property>
@@ -1027,11 +1030,11 @@
<object class="GtkLabel" id="label4826">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">1</property>
<property name="label" translatable="yes"><b>S_how:</b></property>
<property name="use_markup">True</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">sinkTypeComboBox</property>
+ <property name="xalign">1</property>
</object>
<packing>
<property name="expand">True</property>
@@ -1092,8 +1095,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">0</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkViewport" id="viewport3">
<property name="visible">True</property>
@@ -1159,11 +1160,11 @@
<object class="GtkLabel" id="label4827">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">1</property>
<property name="label" translatable="yes"><b>Sho_w:</b></property>
<property name="use_markup">True</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">sourceTypeComboBox</property>
+ <property name="xalign">1</property>
</object>
<packing>
<property name="expand">True</property>
@@ -1224,8 +1225,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">0</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkViewport" id="viewport2">
<property name="visible">True</property>
@@ -1353,13 +1352,16 @@
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="type_hint">normal</property>
+ <child>
+ <placeholder/>
+ </child>
<child internal-child="vbox">
- <object class="GtkVBox" id="dialog-vbox1">
+ <object class="GtkBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>
<child internal-child="action_area">
- <object class="GtkHButtonBox" id="dialog-action_area1">
+ <object class="GtkButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="layout_style">end</property>
@@ -1381,9 +1383,9 @@
<object class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes"><b>Rename device to:</b></property>
<property name="use_markup">True</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">True</property>
@@ -1400,8 +1402,6 @@
<property name="width_chars">60</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
</object>
<packing>
<property name="expand">True</property>
@@ -1417,6 +1417,9 @@
<property name="can_focus">False</property>
<property name="title" translatable="yes">window1</property>
<child>
+ <placeholder/>
+ </child>
+ <child>
<object class="GtkEventBox" id="streamWidgetBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -1469,10 +1472,10 @@
<object class="GtkLabel" id="streamNameLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="label" translatable="yes">Stream Title</property>
<property name="use_markup">True</property>
<property name="ellipsize">end</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -1484,10 +1487,10 @@
<object class="GtkLabel" id="directionLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="xalign">0</property>
<property name="xpad">4</property>
<property name="label" translatable="yes">direction</property>
<property name="use_markup">True</property>
+ <property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@@ -1535,7 +1538,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">audio-volume-muted</property>
- <property name="icon-size">1</property>
+ <property name="icon_size">1</property>
</object>
</child>
</object>
@@ -1558,7 +1561,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">changes-prevent</property>
- <property name="icon-size">1</property>
+ <property name="icon_size">1</property>
</object>
</child>
</object>
commit 0fa1969108e58aea2abe4456658b5147c9880a95
Author: Tanu Kaskinen <tanuk at iki.fi>
Date: Wed Nov 21 12:17:55 2018 +0200
pavucontrol.glade: object renames automatically done by Glade
When opening pavucontrol.glade with Glade and saving it without any
manual changes, Glade does these object rename to get rid of duplicate
IDs. None of these are referenced by the code, so the renames are
harmless.
diff --git a/src/pavucontrol.glade b/src/pavucontrol.glade
index 8a6a17e..0694010 100644
--- a/src/pavucontrol.glade
+++ b/src/pavucontrol.glade
@@ -217,7 +217,7 @@
<property name="border_width">12</property>
<property name="spacing">6</property>
<child>
- <object class="GtkHBox" id="hbox1">
+ <object class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
@@ -361,7 +361,7 @@
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <object class="GtkLabel" id="label1">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
@@ -744,7 +744,7 @@
</packing>
</child>
<child>
- <object class="GtkHSeparator" id="hseparator2">
+ <object class="GtkHSeparator" id="hseparator1">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
@@ -768,7 +768,7 @@
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <object class="GtkLabel" id="label1">
+ <object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">1</property>
@@ -941,7 +941,7 @@
</packing>
</child>
<child type="tab">
- <object class="GtkLabel" id="label2">
+ <object class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Recording</property>
@@ -1132,7 +1132,7 @@
</packing>
</child>
<child>
- <object class="GtkHSeparator" id="hseparator5">
+ <object class="GtkHSeparator" id="hseparator6">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
@@ -1216,7 +1216,7 @@
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox1">
+ <object class="GtkVBox" id="vbox3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
@@ -1232,7 +1232,7 @@
<property name="can_focus">False</property>
<property name="shadow_type">none</property>
<child>
- <object class="GtkVBox" id="vbox3">
+ <object class="GtkVBox" id="vbox4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
@@ -1263,11 +1263,11 @@
</packing>
</child>
<child>
- <object class="GtkVBox" id="vbox4">
+ <object class="GtkVBox" id="vbox5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkHSeparator" id="hseparator1">
+ <object class="GtkHSeparator" id="hseparator7">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
@@ -1316,7 +1316,7 @@
</packing>
</child>
<child type="tab">
- <object class="GtkLabel" id="label5">
+ <object class="GtkLabel" id="label7">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Configuration</property>
@@ -1378,7 +1378,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="label1">
+ <object class="GtkLabel" id="label9">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
@@ -1426,13 +1426,13 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkVBox" id="vbox26">
+ <object class="GtkVBox" id="vbox6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">12</property>
<property name="spacing">6</property>
<child>
- <object class="GtkHBox" id="hbox1">
+ <object class="GtkHBox" id="hbox6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
@@ -1449,7 +1449,7 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox12">
+ <object class="GtkHBox" id="hbox8">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">2</property>
@@ -1519,7 +1519,7 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox10">
+ <object class="GtkHBox" id="hbox13">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">3</property>
@@ -1531,7 +1531,7 @@
<property name="tooltip_text" translatable="yes">Mute audio</property>
<property name="relief">none</property>
<child>
- <object class="GtkImage" id="image20">
+ <object class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">audio-volume-muted</property>
@@ -1554,7 +1554,7 @@
<property name="relief">none</property>
<property name="active">True</property>
<child>
- <object class="GtkImage" id="image18">
+ <object class="GtkImage" id="image3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">changes-prevent</property>
@@ -1608,7 +1608,7 @@
</packing>
</child>
<child>
- <object class="GtkHSeparator" id="hseparator2">
+ <object class="GtkHSeparator" id="hseparator8">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
commit 0047261f23b44f56d5046b2fe392a7d4c57f1db9
Author: Tanu Kaskinen <tanuk at iki.fi>
Date: Wed Nov 21 11:59:15 2018 +0200
rename more objects in the quest to get rid of duplicate IDs
Continuing from the previous patch, this patch renames more objects in
pavucontrol.glade to get rid of duplicate IDs. nameLabel and iconImage
actually weren't any more duplicates, because the previous patch renamed
the corresponding IDs for devices and streams, but the card related
objects were renamed nevertheless to be more descriptive and consistent
with the IDs used by the device and stream widgets.
diff --git a/src/cardwidget.cc b/src/cardwidget.cc
index 28c558d..bcd53fa 100644
--- a/src/cardwidget.cc
+++ b/src/cardwidget.cc
@@ -30,9 +30,9 @@
CardWidget::CardWidget(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& x) :
Gtk::VBox(cobject) {
- x->get_widget("nameLabel", nameLabel);
+ x->get_widget("cardNameLabel", nameLabel);
x->get_widget("profileList", profileList);
- x->get_widget("iconImage", iconImage);
+ x->get_widget("cardIconImage", iconImage);
treeModel = Gtk::ListStore::create(profileModel);
profileList->set_model(treeModel);
diff --git a/src/devicewidget.cc b/src/devicewidget.cc
index b4cf9dd..ce9850f 100644
--- a/src/devicewidget.cc
+++ b/src/devicewidget.cc
@@ -41,8 +41,8 @@ DeviceWidget::DeviceWidget(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Buil
x->get_widget("deviceBoldNameLabel", boldNameLabel);
x->get_widget("deviceIconImage", iconImage);
- x->get_widget("lockToggleButton", lockToggleButton);
- x->get_widget("muteToggleButton", muteToggleButton);
+ x->get_widget("deviceLockToggleButton", lockToggleButton);
+ x->get_widget("deviceMuteToggleButton", muteToggleButton);
x->get_widget("defaultToggleButton", defaultToggleButton);
x->get_widget("portSelect", portSelect);
x->get_widget("portList", portList);
diff --git a/src/pavucontrol.glade b/src/pavucontrol.glade
index c8497a1..8a6a17e 100644
--- a/src/pavucontrol.glade
+++ b/src/pavucontrol.glade
@@ -92,7 +92,7 @@
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <object class="GtkImage" id="iconImage">
+ <object class="GtkImage" id="cardIconImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
@@ -109,7 +109,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkLabel" id="nameLabel">
+ <object class="GtkLabel" id="cardNameLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
@@ -277,7 +277,7 @@
<property name="can_focus">False</property>
<property name="spacing">3</property>
<child>
- <object class="GtkToggleButton" id="muteToggleButton">
+ <object class="GtkToggleButton" id="deviceMuteToggleButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -299,7 +299,7 @@
</packing>
</child>
<child>
- <object class="GtkToggleButton" id="lockToggleButton">
+ <object class="GtkToggleButton" id="deviceLockToggleButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -1524,7 +1524,7 @@
<property name="can_focus">False</property>
<property name="spacing">3</property>
<child>
- <object class="GtkToggleButton" id="muteToggleButton">
+ <object class="GtkToggleButton" id="streamMuteToggleButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -1546,7 +1546,7 @@
</packing>
</child>
<child>
- <object class="GtkToggleButton" id="lockToggleButton">
+ <object class="GtkToggleButton" id="streamLockToggleButton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
diff --git a/src/streamwidget.cc b/src/streamwidget.cc
index 1682a70..8aab675 100644
--- a/src/streamwidget.cc
+++ b/src/streamwidget.cc
@@ -39,8 +39,8 @@ StreamWidget::StreamWidget(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Buil
x->get_widget("streamBoldNameLabel", boldNameLabel);
x->get_widget("streamIconImage", iconImage);
- x->get_widget("lockToggleButton", lockToggleButton);
- x->get_widget("muteToggleButton", muteToggleButton);
+ x->get_widget("streamLockToggleButton", lockToggleButton);
+ x->get_widget("streamMuteToggleButton", muteToggleButton);
x->get_widget("directionLabel", directionLabel);
x->get_widget("deviceButton", deviceButton);
commit c760edaf24263c5f7772e4c32c064ec4ac5d1e4b
Author: Tanu Kaskinen <tanuk at iki.fi>
Date: Wed Nov 21 11:06:51 2018 +0200
move some widget initializations from MinimalStreamWidget to subclasses
Current Glade versions want object IDs to be unique, but currently
pavucontrol.glade shares some IDs between the top-level windows. I guess
this used to be OK in the past, and the "interface-naming-policy
toplevel-contextual" comment in the beginning of the .glade file
probably has something to do with this. I want to update the .glade file
to be easy to work with current Glade versions, so I will remove the
duplicated object IDs.
The first IDs to change are the "channelsVBox", "nameLabel",
"boldNameLabel" and "iconImage" IDs. These were used by
MinimalStreamWidget to create widgets for both devices and streams, but
now that the IDs are different for devices and streams, the widgets have
to be created by the subclasses.
MinimalStreamWidget doesn't need the Gtk::Builder in its constructor any
more, so remove that parameter to avoid warnings about an unused
variable.
diff --git a/src/devicewidget.cc b/src/devicewidget.cc
index 18d6714..b4cf9dd 100644
--- a/src/devicewidget.cc
+++ b/src/devicewidget.cc
@@ -32,9 +32,15 @@
/*** DeviceWidget ***/
DeviceWidget::DeviceWidget(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& x) :
- MinimalStreamWidget(cobject, x),
+ MinimalStreamWidget(cobject),
offsetButtonEnabled(false) {
+ /* MinimalStreamWidget member variables. */
+ x->get_widget("deviceChannelsVBox", channelsVBox);
+ x->get_widget("deviceNameLabel", nameLabel);
+ x->get_widget("deviceBoldNameLabel", boldNameLabel);
+ x->get_widget("deviceIconImage", iconImage);
+
x->get_widget("lockToggleButton", lockToggleButton);
x->get_widget("muteToggleButton", muteToggleButton);
x->get_widget("defaultToggleButton", defaultToggleButton);
@@ -76,6 +82,8 @@ DeviceWidget::DeviceWidget(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Buil
void DeviceWidget::init(MainWindow* mainWindow, Glib::ustring deviceType) {
mpMainWindow = mainWindow;
mDeviceType = deviceType;
+
+ MinimalStreamWidget::init();
}
void DeviceWidget::setChannelMap(const pa_channel_map &m, bool can_decibel) {
diff --git a/src/minimalstreamwidget.cc b/src/minimalstreamwidget.cc
index 02c6e4a..017b2ed 100644
--- a/src/minimalstreamwidget.cc
+++ b/src/minimalstreamwidget.cc
@@ -25,23 +25,31 @@
#include "minimalstreamwidget.h"
/*** MinimalStreamWidget ***/
-MinimalStreamWidget::MinimalStreamWidget(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& x) :
+MinimalStreamWidget::MinimalStreamWidget(BaseObjectType* cobject) :
Gtk::VBox(cobject),
+ channelsVBox(NULL),
+ nameLabel(NULL),
+ boldNameLabel(NULL),
+ iconImage(NULL),
peakProgressBar(),
lastPeak(0),
peak(NULL),
updating(false),
volumeMeterEnabled(false),
volumeMeterVisible(true) {
+}
- x->get_widget("channelsVBox", channelsVBox);
- x->get_widget("nameLabel", nameLabel);
- x->get_widget("boldNameLabel", boldNameLabel);
- x->get_widget("iconImage", iconImage);
+void MinimalStreamWidget::init() {
+ /* Set up the peak meter. This is not done in the constructor, because
+ * channelsVBox is initialized by the subclasses, so it's not yet available
+ * in the constructor. */
peakProgressBar.set_size_request(-1, 10);
channelsVBox->pack_end(peakProgressBar, false, false);
+ /* XXX: Why is the peak meter hidden by default? Maybe the idea is that if
+ * setting up the monitoring stream fails for whatever reason, then we
+ * shouldn't show the peak meter at all. */
peakProgressBar.hide();
}
diff --git a/src/minimalstreamwidget.h b/src/minimalstreamwidget.h
index e4f7e19..e5d774c 100644
--- a/src/minimalstreamwidget.h
+++ b/src/minimalstreamwidget.h
@@ -25,11 +25,15 @@
class MinimalStreamWidget : public Gtk::VBox {
public:
- MinimalStreamWidget(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& x);
+ MinimalStreamWidget(BaseObjectType* cobject);
+ /* Subclass constructors are expected to initialize these variables.
+ * MinimalStreamWidget can't initialize these, because the glade object
+ * id's depend on the subclass type. */
Gtk::VBox *channelsVBox;
Gtk::Label *nameLabel, *boldNameLabel;
Gtk::Image *iconImage;
+
Gtk::ProgressBar peakProgressBar;
double lastPeak;
pa_stream *peak;
@@ -45,6 +49,11 @@ public:
void updatePeak(double v);
void setVolumeMeterVisible(bool v);
+protected:
+ /* Subclasses must call this after the constructor to finalize the initial
+ * layout. */
+ virtual void init();
+
private :
bool volumeMeterVisible;
diff --git a/src/pavucontrol.glade b/src/pavucontrol.glade
index a9c86b2..c8497a1 100644
--- a/src/pavucontrol.glade
+++ b/src/pavucontrol.glade
@@ -222,7 +222,7 @@
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <object class="GtkImage" id="iconImage">
+ <object class="GtkImage" id="deviceIconImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
@@ -238,7 +238,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkLabel" id="boldNameLabel">
+ <object class="GtkLabel" id="deviceBoldNameLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_markup">True</property>
@@ -250,7 +250,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="nameLabel">
+ <object class="GtkLabel" id="deviceNameLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
@@ -393,7 +393,7 @@
</packing>
</child>
<child>
- <object class="GtkVBox" id="channelsVBox">
+ <object class="GtkVBox" id="deviceChannelsVBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
@@ -1437,7 +1437,7 @@
<property name="can_focus">False</property>
<property name="spacing">6</property>
<child>
- <object class="GtkImage" id="iconImage">
+ <object class="GtkImage" id="streamIconImage">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="stock">gtk-missing-image</property>
@@ -1454,7 +1454,7 @@
<property name="can_focus">False</property>
<property name="spacing">2</property>
<child>
- <object class="GtkLabel" id="boldNameLabel">
+ <object class="GtkLabel" id="streamBoldNameLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="use_markup">True</property>
@@ -1466,7 +1466,7 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="nameLabel">
+ <object class="GtkLabel" id="streamNameLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
@@ -1583,7 +1583,7 @@
</packing>
</child>
<child>
- <object class="GtkVBox" id="channelsVBox">
+ <object class="GtkVBox" id="streamChannelsVBox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">6</property>
diff --git a/src/streamwidget.cc b/src/streamwidget.cc
index 6085550..1682a70 100644
--- a/src/streamwidget.cc
+++ b/src/streamwidget.cc
@@ -30,9 +30,15 @@
/*** StreamWidget ***/
StreamWidget::StreamWidget(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>& x) :
- MinimalStreamWidget(cobject, x),
+ MinimalStreamWidget(cobject),
mpMainWindow(NULL) {
+ /* MinimalStreamWidget member variables. */
+ x->get_widget("streamChannelsVBox", channelsVBox);
+ x->get_widget("streamNameLabel", nameLabel);
+ x->get_widget("streamBoldNameLabel", boldNameLabel);
+ x->get_widget("streamIconImage", iconImage);
+
x->get_widget("lockToggleButton", lockToggleButton);
x->get_widget("muteToggleButton", muteToggleButton);
x->get_widget("directionLabel", directionLabel);
@@ -55,6 +61,8 @@ StreamWidget::StreamWidget(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Buil
void StreamWidget::init(MainWindow* mainWindow) {
mpMainWindow = mainWindow;
+
+ MinimalStreamWidget::init();
}
bool StreamWidget::onContextTriggerEvent(GdkEventButton* event) {
More information about the pulseaudio-commits
mailing list