Widgets (unlike Windows and Dialogs) returned by Gtk::Builder::get_widget*
start owned by the GtkBuilder object, the idea being that they will get
added to a container before the scope of the GtkBuilder object ends, and it
thus automatically gets destroyed.
But in the various ::create methods in pavucontrol, a pointer to the widget
gets returned, so that it can be added to a cointainer by the caller.
However as soon as the ::create method exits the GtkBuilder object owning
the widget, and thus also the widget gets destroyed, and we end up returning
free-ed memory.
This commit fixes this by making all ::create methods take a reference on
the widget before returning it, and having all the callers unreference the
widget after adding it to a container.
https://bugs.freedesktop.org/show_bug.cgi?id=83144https://bugzilla.redhat.com/show_bug.cgi?id=1133339
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Currently this module only really allows for devices to be renamed, so we add a new
dialog that can be activated by right clicking on devices (i.e. sinks/sources).
This dialog allows you to enter a new name which will be set via the extension
provided by the device-manager module.
Future work will allow you to manage (i.e. rename, delete etc) offline devices too.
This commit adds a combo box for selecting ports.
Overall this implementation could have taken two paths:
* Implement port selection as combo box.
* Implement port selection as a button.
I went for the first option as is done in selecting card profiles over the
second method used for selecting devices for streams. This seems more like
how a config option should be presented as opposed to a runtime type thing.
I reworked the way this was done so we can easily re-enable this as I think it's clearer when it's inactive
(the difference between toggled and not toggled is pretty minor).
With this abstraction we could reset the tooltip etc. too.
This makes the default button work on sinks/sources, allows the drop
down to actually change the sink/source and removes the old menu code.
Some names and such are fixed in the glade file too.