patches: new gnome-control-center patchset

This commit is contained in:
Max Headroom 2022-10-16 20:33:27 +02:00
parent dcd563525c
commit c2dbe644d3

View file

@ -1,9 +1,9 @@
diff --git a/panels/sound/cc-alert-chooser.c b/panels/sound/cc-alert-chooser.c
deleted file mode 100644
index 0cdae3c..0000000
index 686d8c6..0000000
--- a/panels/sound/cc-alert-chooser.c
+++ /dev/null
@@ -1,294 +0,0 @@
@@ -1,306 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
- *
- * Copyright (C) 2018 Canonical Ltd.
@ -35,10 +35,10 @@ index 0cdae3c..0000000
-{
- GtkBox parent_instance;
-
- GtkToggleButton *bark_button;
- GtkToggleButton *drip_button;
- GtkToggleButton *glass_button;
- GtkToggleButton *sonar_button;
- GtkToggleButton *click_button;
- GtkToggleButton *hum_button;
- GtkToggleButton *string_button;
- GtkToggleButton *swing_button;
-
- GSoundContext *context;
- GSettings *sound_settings;
@ -221,24 +221,24 @@ index 0cdae3c..0000000
-clicked_cb (CcAlertChooser *self,
- GtkToggleButton *button)
-{
- if (button == self->bark_button)
- select_sound (self, "bark");
- else if (button == self->drip_button)
- select_sound (self, "drip");
- else if (button == self->glass_button)
- select_sound (self, "glass");
- else if (button == self->sonar_button)
- select_sound (self, "sonar");
- if (button == self->click_button)
- select_sound (self, "click");
- else if (button == self->hum_button)
- select_sound (self, "hum");
- else if (button == self->string_button)
- select_sound (self, "string");
- else if (button == self->swing_button)
- select_sound (self, "swing");
-
- set_button (self, button, TRUE);
- if (button != self->bark_button)
- set_button (self, self->bark_button, FALSE);
- if (button != self->drip_button)
- set_button (self, self->drip_button, FALSE);
- if (button != self->glass_button)
- set_button (self, self->glass_button, FALSE);
- if (button != self->sonar_button)
- set_button (self, self->sonar_button, FALSE);
- if (button != self->click_button)
- set_button (self, self->click_button, FALSE);
- if (button != self->hum_button)
- set_button (self, self->hum_button, FALSE);
- if (button != self->string_button)
- set_button (self, self->string_button, FALSE);
- if (button != self->swing_button)
- set_button (self, self->swing_button, FALSE);
-}
-
-static void
@ -262,10 +262,10 @@ index 0cdae3c..0000000
-
- gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/sound/cc-alert-chooser.ui");
-
- gtk_widget_class_bind_template_child (widget_class, CcAlertChooser, bark_button);
- gtk_widget_class_bind_template_child (widget_class, CcAlertChooser, drip_button);
- gtk_widget_class_bind_template_child (widget_class, CcAlertChooser, glass_button);
- gtk_widget_class_bind_template_child (widget_class, CcAlertChooser, sonar_button);
- gtk_widget_class_bind_template_child (widget_class, CcAlertChooser, click_button);
- gtk_widget_class_bind_template_child (widget_class, CcAlertChooser, hum_button);
- gtk_widget_class_bind_template_child (widget_class, CcAlertChooser, string_button);
- gtk_widget_class_bind_template_child (widget_class, CcAlertChooser, swing_button);
-
- gtk_widget_class_bind_template_callback (widget_class, clicked_cb);
-}
@ -287,14 +287,26 @@ index 0cdae3c..0000000
- self->sound_settings = g_settings_new (KEY_SOUNDS_SCHEMA);
-
- alert_name = get_alert_name ();
- if (g_strcmp0 (alert_name, "bark") == 0)
- set_button (self, self->bark_button, TRUE);
- else if (g_strcmp0 (alert_name, "drip") == 0)
- set_button (self, self->drip_button, TRUE);
- else if (g_strcmp0 (alert_name, "glass") == 0)
- set_button (self, self->glass_button, TRUE);
- else if (g_strcmp0 (alert_name, "sonar") == 0)
- set_button (self, self->sonar_button, TRUE);
-
- /* If user has selected an old sound alert, migrate them to click. */
- if (g_strcmp0 (alert_name, "click") != 0 &&
- g_strcmp0 (alert_name, "hum") != 0 &&
- g_strcmp0 (alert_name, "string") != 0 &&
- g_strcmp0 (alert_name, "swing") != 0)
- {
- set_custom_theme (self, "click");
- g_free (alert_name);
- alert_name = g_strdup ("click");
- }
-
- if (g_strcmp0 (alert_name, "click") == 0)
- set_button (self, self->click_button, TRUE);
- else if (g_strcmp0 (alert_name, "hum") == 0)
- set_button (self, self->hum_button, TRUE);
- else if (g_strcmp0 (alert_name, "string") == 0)
- set_button (self, self->string_button, TRUE);
- else if (g_strcmp0 (alert_name, "swing") == 0)
- set_button (self, self->swing_button, TRUE);
- else if (alert_name != NULL)
- g_warning ("Current alert sound has unknown name %s", alert_name);
-}
@ -334,7 +346,7 @@ index c6f4b87..0000000
-G_END_DECLS
diff --git a/panels/sound/cc-alert-chooser.ui b/panels/sound/cc-alert-chooser.ui
deleted file mode 100644
index d6933f9..0000000
index 603aff9..0000000
--- a/panels/sound/cc-alert-chooser.ui
+++ /dev/null
@@ -1,41 +0,0 @@
@ -347,33 +359,33 @@ index d6933f9..0000000
- <class name="linked"/>
- </style>
- <child>
- <object class="GtkToggleButton" id="bark_button">
- <object class="GtkToggleButton" id="click_button">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Bark</property>
- <property name="label" translatable="yes">Click</property>
- <signal name="clicked" handler="clicked_cb" object="CcAlertChooser" swapped="yes"/>
- </object>
- </child>
- <child>
- <object class="GtkToggleButton" id="drip_button">
- <object class="GtkToggleButton" id="string_button">
- <property name="visible">True</property>
- <property name="group">bark_button</property>
- <property name="label" translatable="yes">Drip</property>
- <property name="group">click_button</property>
- <property name="label" translatable="yes">String</property>
- <signal name="clicked" handler="clicked_cb" object="CcAlertChooser" swapped="yes"/>
- </object>
- </child>
- <child>
- <object class="GtkToggleButton" id="glass_button">
- <object class="GtkToggleButton" id="swing_button">
- <property name="visible">True</property>
- <property name="group">bark_button</property>
- <property name="label" translatable="yes">Glass</property>
- <property name="group">click_button</property>
- <property name="label" translatable="yes">Swing</property>
- <signal name="clicked" handler="clicked_cb" object="CcAlertChooser" swapped="yes"/>
- </object>
- </child>
- <child>
- <object class="GtkToggleButton" id="sonar_button">
- <object class="GtkToggleButton" id="hum_button">
- <property name="visible">True</property>
- <property name="group">bark_button</property>
- <property name="label" translatable="yes">Sonar</property>
- <property name="group">click_button</property>
- <property name="label" translatable="yes">Hum</property>
- <signal name="clicked" handler="clicked_cb" object="CcAlertChooser" swapped="yes"/>
- </object>
- </child>
@ -400,10 +412,10 @@ index 0de1ca9..9d9b9c7 100644
g_type_ensure (CC_TYPE_DEVICE_COMBO_BOX);
g_type_ensure (CC_TYPE_FADE_SLIDER);
diff --git a/panels/sound/cc-sound-panel.ui b/panels/sound/cc-sound-panel.ui
index dadf96a..b30b954 100644
index 33b6dbb..9fab184 100644
--- a/panels/sound/cc-sound-panel.ui
+++ b/panels/sound/cc-sound-panel.ui
@@ -307,16 +307,6 @@
@@ -322,16 +322,6 @@
</child>
</object>
</child>
@ -421,7 +433,7 @@ index dadf96a..b30b954 100644
</child>
</template>
diff --git a/panels/sound/meson.build b/panels/sound/meson.build
index dd8d0b6..6367db2 100644
index 458377d..28149f6 100644
--- a/panels/sound/meson.build
+++ b/panels/sound/meson.build
@@ -30,7 +30,6 @@ cflags += [