summaryrefslogtreecommitdiff
path: root/capplets/accessibility/at-properties/main.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-03-04 08:12:44 +0100
committerraveit65 <[email protected]>2021-03-19 08:20:21 +0100
commit3b7aaa17df85cd00bb76db17442a40214c6abdd8 (patch)
treeb4384049463baf7e79b30092a91a95827d5511ae /capplets/accessibility/at-properties/main.c
parent6ec06b42400b73f07e7b46841717b9a62a7e5bbb (diff)
downloadmate-control-center-3b7aaa17df85cd00bb76db17442a40214c6abdd8.tar.bz2
mate-control-center-3b7aaa17df85cd00bb76db17442a40214c6abdd8.tar.xz
accessibility: use gtk_builder_new_from_resource
Diffstat (limited to 'capplets/accessibility/at-properties/main.c')
-rw-r--r--capplets/accessibility/at-properties/main.c42
1 files changed, 16 insertions, 26 deletions
diff --git a/capplets/accessibility/at-properties/main.c b/capplets/accessibility/at-properties/main.c
index 0bc6eea0..aaa71d8a 100644
--- a/capplets/accessibility/at-properties/main.c
+++ b/capplets/accessibility/at-properties/main.c
@@ -40,35 +40,25 @@ static GtkBuilder *
create_builder (void)
{
GtkBuilder *builder;
- GError *error = NULL;
+ GObject *object;
+ GDesktopAppInfo *app_info = NULL;
- builder = gtk_builder_new ();
-
- if (gtk_builder_add_from_resource (builder, "/org/mate/mcc/accessibility/at/at-enable-dialog.ui", &error)) {
- GObject *object;
- GDesktopAppInfo *app_info = NULL;
-
- object = gtk_builder_get_object (builder, "at_enable_image");
- gtk_image_set_from_file (GTK_IMAGE (object),
- PIXMAPDIR "/at-startup.png");
-
- object = gtk_builder_get_object (builder,
- "at_applications_image");
- gtk_image_set_from_file (GTK_IMAGE (object),
- PIXMAPDIR "/at-support.png");
- app_info = get_desktop_app_info_from_dm ();
- if (app_info == NULL) {
- object = gtk_builder_get_object (builder, "login_button");
- gtk_widget_hide (GTK_WIDGET (object));
- } else {
- g_object_unref (app_info);
- }
+ builder = gtk_builder_new_from_resource ("/org/mate/mcc/accessibility/at/at-enable-dialog.ui");
+
+ object = gtk_builder_get_object (builder, "at_enable_image");
+ gtk_image_set_from_file (GTK_IMAGE (object),
+ PIXMAPDIR "/at-startup.png");
+ object = gtk_builder_get_object (builder,
+ "at_applications_image");
+ gtk_image_set_from_file (GTK_IMAGE (object),
+ PIXMAPDIR "/at-support.png");
+ app_info = get_desktop_app_info_from_dm ();
+ if (app_info == NULL) {
+ object = gtk_builder_get_object (builder, "login_button");
+ gtk_widget_hide (GTK_WIDGET (object));
} else {
- g_warning ("Could not load UI: %s", error->message);
- g_error_free (error);
- g_object_unref (builder);
- builder = NULL;
+ g_object_unref (app_info);
}
return builder;