[gnome-control-center] region: Move callbacks into .ui file
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] region: Move callbacks into .ui file
- Date: Sun, 3 Jun 2018 00:54:46 +0000 (UTC)
commit 9a7850a7aaacdc9cbd41426ada6ef5ca4f167780
Author: Robert Ancell <robert ancell canonical com>
Date: Wed May 30 08:59:11 2018 +1200
region: Move callbacks into .ui file
panels/region/cc-region-panel.c | 92 +++++++++++++++++++----------------------
panels/region/region.ui | 8 ++++
2 files changed, 50 insertions(+), 50 deletions(-)
---
diff --git a/panels/region/cc-region-panel.c b/panels/region/cc-region-panel.c
index 46959ad95..d5848e57b 100644
--- a/panels/region/cc-region-panel.c
+++ b/panels/region/cc-region-panel.c
@@ -186,39 +186,6 @@ cc_region_panel_get_help_uri (CcPanel *panel)
return "help:gnome-help/prefs-language";
}
-static void
-cc_region_panel_class_init (CcRegionPanelClass * klass)
-{
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- CcPanelClass *panel_class = CC_PANEL_CLASS (klass);
-
- panel_class->get_help_uri = cc_region_panel_get_help_uri;
-
- object_class->constructed = cc_region_panel_constructed;
- object_class->finalize = cc_region_panel_finalize;
-
- gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/control-center/region/region.ui");
-
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, language_row);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, language_label);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, formats_row);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, formats_label);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, restart_revealer);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, input_section);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, options_button);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, input_list);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, add_input);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, remove_input);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, move_up_input);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, move_down_input);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, show_config);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, show_layout);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, restart_button);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, login_label);
- gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, language_list);
-}
-
static void
restart_now (CcRegionPanel *self)
{
@@ -635,8 +602,6 @@ setup_language_section (CcRegionPanel *self)
g_signal_connect_swapped (self->locale_settings, "changed::" KEY_REGION,
G_CALLBACK (update_region_from_setting), self);
- g_signal_connect_swapped (self->restart_button, "clicked", G_CALLBACK (restart_now), self);
-
gtk_list_box_set_selection_mode (GTK_LIST_BOX (self->language_list),
GTK_SELECTION_NONE);
gtk_list_box_set_header_func (GTK_LIST_BOX (self->language_list),
@@ -1357,21 +1322,6 @@ setup_input_section (CcRegionPanel *self)
maybe_start_ibus ();
#endif
- g_signal_connect_swapped (self->options_button, "clicked",
- G_CALLBACK (show_input_options), self);
- g_signal_connect_swapped (self->add_input, "clicked",
- G_CALLBACK (add_input), self);
- g_signal_connect_swapped (self->remove_input, "clicked",
- G_CALLBACK (remove_selected_input), self);
- g_signal_connect_swapped (self->move_up_input, "clicked",
- G_CALLBACK (move_selected_input_up), self);
- g_signal_connect_swapped (self->move_down_input, "clicked",
- G_CALLBACK (move_selected_input_down), self);
- g_signal_connect_swapped (self->show_config, "clicked",
- G_CALLBACK (show_selected_settings), self);
- g_signal_connect_swapped (self->show_layout, "clicked",
- G_CALLBACK (show_selected_layout), self);
-
cc_list_box_setup_scrolling (GTK_LIST_BOX (self->input_list), 5);
gtk_list_box_set_selection_mode (GTK_LIST_BOX (self->input_list),
@@ -1685,6 +1635,48 @@ session_proxy_ready (GObject *source,
self->session = proxy;
}
+static void
+cc_region_panel_class_init (CcRegionPanelClass * klass)
+{
+ GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ CcPanelClass *panel_class = CC_PANEL_CLASS (klass);
+
+ panel_class->get_help_uri = cc_region_panel_get_help_uri;
+
+ object_class->constructed = cc_region_panel_constructed;
+ object_class->finalize = cc_region_panel_finalize;
+
+ gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/control-center/region/region.ui");
+
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, language_row);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, language_label);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, formats_row);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, formats_label);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, restart_revealer);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, input_section);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, options_button);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, input_list);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, add_input);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, remove_input);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, move_up_input);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, move_down_input);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, show_config);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, show_layout);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, restart_button);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, login_label);
+ gtk_widget_class_bind_template_child (widget_class, CcRegionPanel, language_list);
+
+ gtk_widget_class_bind_template_callback (widget_class, restart_now);
+ gtk_widget_class_bind_template_callback (widget_class, show_input_options);
+ gtk_widget_class_bind_template_callback (widget_class, add_input);
+ gtk_widget_class_bind_template_callback (widget_class, remove_selected_input);
+ gtk_widget_class_bind_template_callback (widget_class, move_selected_input_up);
+ gtk_widget_class_bind_template_callback (widget_class, move_selected_input_down);
+ gtk_widget_class_bind_template_callback (widget_class, show_selected_settings);
+ gtk_widget_class_bind_template_callback (widget_class, show_selected_layout);
+}
+
static void
cc_region_panel_init (CcRegionPanel *self)
{
diff --git a/panels/region/region.ui b/panels/region/region.ui
index 906327dfe..db3aff58a 100644
--- a/panels/region/region.ui
+++ b/panels/region/region.ui
@@ -139,6 +139,7 @@
<style>
<class name="suggested-action"/>
</style>
+ <signal name="clicked" handler="restart_now" object="CcRegionPanel"
swapped="yes"/>
</object>
<packing>
<property name="expand">False</property>
@@ -251,6 +252,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
+ <signal name="clicked" handler="show_input_options" object="CcRegionPanel"
swapped="yes"/>
</object>
<packing>
<property name="expand">False</property>
@@ -310,6 +312,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <signal name="clicked" handler="add_input" object="CcRegionPanel"
swapped="yes"/>
<child internal-child="accessible">
<object class="AtkObject">
<property name="accessible-name" translatable="yes">Add input
source</property>
@@ -335,6 +338,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <signal name="clicked" handler="remove_selected_input"
object="CcRegionPanel" swapped="yes"/>
<child internal-child="accessible">
<object class="AtkObject">
<property name="accessible-name" translatable="yes">Remove input
source</property>
@@ -385,6 +389,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <signal name="clicked" handler="move_selected_input_up"
object="CcRegionPanel" swapped="yes"/>
<child internal-child="accessible">
<object class="AtkObject">
<property name="accessible-name" translatable="yes">Move input source
up</property>
@@ -410,6 +415,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <signal name="clicked" handler="move_selected_input_down"
object="CcRegionPanel" swapped="yes"/>
<child internal-child="accessible">
<object class="AtkObject">
<property name="accessible-name" translatable="yes">Move input source
down</property>
@@ -460,6 +466,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <signal name="clicked" handler="show_selected_settings"
object="CcRegionPanel" swapped="yes"/>
<child internal-child="accessible">
<object class="AtkObject">
<property name="accessible-name" translatable="yes">Configure input
source</property>
@@ -485,6 +492,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <signal name="clicked" handler="show_selected_layout" object="CcRegionPanel"
swapped="yes"/>
<child internal-child="accessible">
<object class="AtkObject">
<property name="accessible-name" translatable="yes">Show input source
keyboard layout</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]