| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
#include <gtk/gtk.h> |
| 5 |
|
| 6 |
#include "alsa.h" |
| 7 |
#include "config-helpers.h" |
| 8 |
#include "optional-controls.h" |
| 9 |
#include "widget-text-entry.h" |
| 10 |
#include "window-configuration.h" |
| 11 |
#include "config-device-name.h" |
| 12 |
|
| 13 |
void add_device_name_tab(GtkWidget *notebook, struct alsa_card *card) { |
| 14 |
struct alsa_elem *name_elem = optional_controls_get_name_elem(card); |
| 15 |
if (!name_elem) |
| 16 |
return; |
| 17 |
|
| 18 |
GtkWidget *content = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10); |
| 19 |
gtk_widget_set_margin_top(content, 20); |
| 20 |
|
| 21 |
gtk_box_append(GTK_BOX(content), config_help_label( |
| 22 |
"This name will appear in the window title and can help you\n" |
| 23 |
"identify this device if you have multiple interfaces." |
| 24 |
)); |
| 25 |
|
| 26 |
GtkWidget *entry = make_text_entry_alsa_elem(name_elem); |
| 27 |
gtk_widget_set_hexpand(entry, TRUE); |
| 28 |
gtk_box_append(GTK_BOX(content), entry); |
| 29 |
|
| 30 |
g_object_set_data(G_OBJECT(content), PAGE_ID_KEY, (gpointer)"device-name"); |
| 31 |
gtk_notebook_append_page( |
| 32 |
GTK_NOTEBOOK(notebook), content, gtk_label_new("Device Name") |
| 33 |
); |
| 34 |
} |