Scroll streams list to newly added; removed rename sink about dialog

This commit is contained in:
itdominator 2024-07-28 21:55:56 -05:00
parent c70cdeed74
commit 43f8a30d69
5 changed files with 6 additions and 20 deletions

View File

@ -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<Gtk::Builder> 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<RenameWindow>(x, "renameDialog", description.c_str(), key);

View File

@ -80,6 +80,7 @@ MainWindow::MainWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder>
ca_context_create(&canberraContext);
ca_context_set_driver(canberraContext, "pulse");
#endif
streamsScrolledWindow = x->get_widget<Gtk::ScrolledWindow>("streamsScrolledWindow");
cardsVBox = x->get_widget<Gtk::Box>("cardsVBox");
streamsVBox = x->get_widget<Gtk::Box>("streamsVBox");
recsVBox = x->get_widget<Gtk::Box>("recsVBox");
@ -1266,6 +1267,9 @@ void MainWindow::reallyUpdateDeviceVisibility() {
recsVBox->show();
cardsVBox->hide();
cardsVBox->show();
Glib::RefPtr<Gtk::Adjustment> vAjustmnt = streamsScrolledWindow->get_vadjustment();
vAjustmnt->set_value(vAjustmnt->get_upper() + 500);
}
void MainWindow::removeCard(uint32_t index) {

View File

@ -79,6 +79,7 @@ public:
void setConnectingMessage(const char *string = NULL);
Gtk::ScrolledWindow *streamsScrolledWindow;
Gtk::Notebook *notebook;
Gtk::Box *streamsVBox, *recsVBox, *sinksVBox, *sourcesVBox, *cardsVBox;
Gtk::Label *noStreamsLabel, *noRecsLabel, *noSinksLabel, *noSourcesLabel, *noCardsLabel, *connectingLabel;

View File

@ -25,7 +25,7 @@
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GtkScrolledWindow">
<object class="GtkScrolledWindow" id="streamsScrolledWindow">
<property name="vexpand">1</property>
<property name="focusable">1</property>
<property name="child">

View File

@ -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) {