From 3b936a10e6c0bd744a8d2eef477e3cd9125515f8 Mon Sep 17 00:00:00 2001 From: itdominator <1itdominator@gmail.com> Date: Sun, 28 Jul 2024 21:55:56 -0500 Subject: [PATCH] Scroll streams list to newly added; removed rename sink about dialog --- README.md | 11 +++++++++++ src/devicewidget.cc | 8 -------- src/mainwindow.cc | 5 +++++ src/mainwindow.h | 2 ++ src/mainwindow.ui | 2 +- src/pavucontrol.cc | 11 ----------- 6 files changed, 19 insertions(+), 20 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..f6fcb84 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +# Pavucontrol +An audio controller to change volume, recording input, etc. + +### Build +git clone the repo and change directory/open terminal at the folder. Then run the following: +* meson build +* cd build/ +* ninja + +### Install +* After building copy from build/src the newly created 'pavucontrol' binary to /usr/sbin/pavucontrol diff --git a/src/devicewidget.cc b/src/devicewidget.cc index ba2821d..cc4b29b 100644 --- a/src/devicewidget.cc +++ b/src/devicewidget.cc @@ -253,14 +253,6 @@ void DeviceWidget::openRenamePopup(const Glib::VariantBase& parameter) { if (updating) return; - if (!mpMainWindow->canRenameDevices) { - auto dialog = Gtk::AlertDialog::create(_("Sorry, but device renaming is not supported.")); - dialog->set_modal(true); - dialog->set_detail(_("You need to load module-device-manager in the PulseAudio server in order to rename devices")); - dialog->show(*mpMainWindow); - return; - } - Glib::RefPtr x = Gtk::Builder::create_from_resource("/org/pulseaudio/pavucontrol/ui/renamedialog.ui", "renameDialog"); gchar *key = g_markup_printf_escaped("%s:%s", mDeviceType.c_str(), name.c_str()); RenameWindow* renameDialog = Gtk::Builder::get_widget_derived(x, "renameDialog", description.c_str(), key); diff --git a/src/mainwindow.cc b/src/mainwindow.cc index f834e18..58f54a9 100644 --- a/src/mainwindow.cc +++ b/src/mainwindow.cc @@ -80,6 +80,9 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr ca_context_create(&canberraContext); ca_context_set_driver(canberraContext, "pulse"); #endif + streamsScrolledWindow = x->get_widget("streamsScrolledWindow"); + vAjustmnt = streamsScrolledWindow->get_vadjustment(); + cardsVBox = x->get_widget("cardsVBox"); streamsVBox = x->get_widget("streamsVBox"); recsVBox = x->get_widget("recsVBox"); @@ -1266,6 +1269,8 @@ void MainWindow::reallyUpdateDeviceVisibility() { recsVBox->show(); cardsVBox->hide(); cardsVBox->show(); + + vAjustmnt->set_value(vAjustmnt->get_upper() + 500); } void MainWindow::removeCard(uint32_t index) { diff --git a/src/mainwindow.h b/src/mainwindow.h index dcbc2f0..e40c0b4 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -79,6 +79,8 @@ public: void setConnectingMessage(const char *string = NULL); + Gtk::ScrolledWindow *streamsScrolledWindow; + Glib::RefPtr vAjustmnt; Gtk::Notebook *notebook; Gtk::Box *streamsVBox, *recsVBox, *sinksVBox, *sourcesVBox, *cardsVBox; Gtk::Label *noStreamsLabel, *noRecsLabel, *noSinksLabel, *noSourcesLabel, *noCardsLabel, *connectingLabel; diff --git a/src/mainwindow.ui b/src/mainwindow.ui index 057aef6..2c37cda 100644 --- a/src/mainwindow.ui +++ b/src/mainwindow.ui @@ -25,7 +25,7 @@ vertical - + 1 1 diff --git a/src/pavucontrol.cc b/src/pavucontrol.cc index 86d7ddd..c98c370 100644 --- a/src/pavucontrol.cc +++ b/src/pavucontrol.cc @@ -59,17 +59,6 @@ void show_error(Gtk::Widget* widget, const char *txt) { char buf[256]; snprintf(buf, sizeof(buf), "%s: %s", txt, pa_strerror(pa_context_errno(context))); - - auto dialog = Gtk::AlertDialog::create(buf); - dialog->set_modal(true); - if (GTK_IS_WINDOW(root->gobj())) { - GtkWindow* w = (GtkWindow*) root->gobj(); - Gtk::Window* window = Glib::wrap(w); - window->present(); - dialog->choose(*window, sigc::ptr_fun(show_error_finish)); - } else { - dialog->choose(sigc::ptr_fun(show_error_finish)); - } } static void dec_outstanding(MainWindow *w) {