[gnome-control-center] region: Remove useless level of indirection
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] region: Remove useless level of indirection
- Date: Fri, 21 Jan 2011 18:07:02 +0000 (UTC)
commit a7519f8340099383a0adff2c844965851eb7e2e2
Author: Bastien Nocera <hadess hadess net>
Date: Fri Jan 21 18:06:26 2011 +0000
region: Remove useless level of indirection
Clean up that mess of a code somewhat.
panels/region/Makefile.am | 2 -
panels/region/cc-region-panel.c | 29 ++++++++++++--
panels/region/gnome-region-panel.c | 77 ------------------------------------
panels/region/gnome-region-panel.h | 28 -------------
4 files changed, 25 insertions(+), 111 deletions(-)
---
diff --git a/panels/region/Makefile.am b/panels/region/Makefile.am
index 81da171..7ca4992 100644
--- a/panels/region/Makefile.am
+++ b/panels/region/Makefile.am
@@ -17,8 +17,6 @@ libregion_la_SOURCES = \
region-module.c \
cc-region-panel.c \
cc-region-panel.h \
- gnome-region-panel.c \
- gnome-region-panel.h \
gnome-region-panel-xkb.c \
gnome-region-panel-xkbmc.c \
gnome-region-panel-xkblt.c \
diff --git a/panels/region/cc-region-panel.c b/panels/region/cc-region-panel.c
index bc0721c..6f34a59 100644
--- a/panels/region/cc-region-panel.c
+++ b/panels/region/cc-region-panel.c
@@ -22,9 +22,14 @@
#include "cc-region-panel.h"
#include <gtk/gtk.h>
+#include "gnome-region-panel-xkb.h"
+
+#define WID(s) GTK_WIDGET (gtk_builder_get_object (dialog, s))
+
G_DEFINE_DYNAMIC_TYPE (CcRegionPanel, cc_region_panel, CC_TYPE_PANEL)
-#define REGION_PANEL_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((o), CC_TYPE_REGION_PANEL, CcRegionPanelPrivate))
+
+#define REGION_PANEL_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CC_TYPE_REGION_PANEL, CcRegionPanelPrivate))
+
struct _CcRegionPanelPrivate {
GtkBuilder *builder;
};
@@ -91,7 +96,21 @@ cc_region_panel_class_finalize (CcRegionPanelClass * klass)
{
}
-GtkWidget *gnome_region_properties_init (GtkBuilder * dialog);
+static void
+setup_images (GtkBuilder * dialog)
+{
+ GtkWidget *image;
+
+ image =
+ gtk_image_new_from_stock (GTK_STOCK_ADD, GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_image (GTK_BUTTON (WID ("xkb_layouts_add")), image);
+
+ image =
+ gtk_image_new_from_stock (GTK_STOCK_REFRESH,
+ GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_image (GTK_BUTTON (WID ("xkb_reset_to_defaults")),
+ image);
+}
static void
cc_region_panel_init (CcRegionPanel * self)
@@ -113,10 +132,12 @@ cc_region_panel_init (CcRegionPanel * self)
return;
}
- gnome_region_properties_init (priv->builder);
+ setup_images (priv->builder);
+ setup_xkb_tabs (priv->builder);
prefs_widget = (GtkWidget *) gtk_builder_get_object (priv->builder,
"region_notebook");
+ gtk_widget_set_size_request (GTK_WIDGET (prefs_widget), -1, 400);
gtk_widget_reparent (prefs_widget, GTK_WIDGET (self));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]