[gnome-control-center] wacom: Add icon-name property to styli
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] wacom: Add icon-name property to styli
- Date: Fri, 25 Nov 2011 14:12:16 +0000 (UTC)
commit e999a08a4e422518832e7fd5d68e8d6f1f69f49c
Author: Bastien Nocera <hadess hadess net>
Date: Fri Nov 25 14:06:07 2011 +0000
wacom: Add icon-name property to styli
panels/wacom/gsd-wacom-device.c | 25 ++++++++++++++++++++-----
panels/wacom/gsd-wacom-device.h | 1 +
2 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/panels/wacom/gsd-wacom-device.c b/panels/wacom/gsd-wacom-device.c
index ced57d0..96087cb 100644
--- a/panels/wacom/gsd-wacom-device.c
+++ b/panels/wacom/gsd-wacom-device.c
@@ -39,6 +39,7 @@ struct GsdWacomStylusPrivate
{
GsdWacomDevice *device;
char *name;
+ char *icon_name;
GSettings *settings;
};
@@ -87,13 +88,17 @@ gsd_wacom_stylus_finalize (GObject *object)
g_free (p->name);
p->name = NULL;
+ g_free (p->icon_name);
+ p->icon_name = NULL;
+
G_OBJECT_CLASS (gsd_wacom_stylus_parent_class)->finalize (object);
}
static GsdWacomStylus *
gsd_wacom_stylus_new (GsdWacomDevice *device,
GSettings *settings,
- const char *name)
+ const char *name,
+ const char *icon_name)
{
GsdWacomStylus *stylus;
@@ -105,6 +110,7 @@ gsd_wacom_stylus_new (GsdWacomDevice *device,
stylus->priv->device = device;
stylus->priv->name = g_strdup (name);
stylus->priv->settings = settings;
+ stylus->priv->icon_name = g_strdup (icon_name);
return stylus;
}
@@ -125,6 +131,14 @@ gsd_wacom_stylus_get_name (GsdWacomStylus *stylus)
return stylus->priv->name;
}
+const char *
+gsd_wacom_stylus_get_icon_name (GsdWacomStylus *stylus)
+{
+ g_return_val_if_fail (GSD_IS_WACOM_STYLUS (stylus), NULL);
+
+ return stylus->priv->icon_name;
+}
+
GsdWacomDevice *
gsd_wacom_stylus_get_device (GsdWacomStylus *stylus)
{
@@ -293,12 +307,13 @@ gsd_wacom_device_constructor (GType type,
GsdWacomStylus *stylus;
GSettings *settings;
- if (device->priv->type == WACOM_TYPE_STYLUS)
+ if (device->priv->type == WACOM_TYPE_STYLUS) {
settings = g_settings_new (SETTINGS_WACOM_DIR "." SETTINGS_STYLUS_DIR);
- else
+ stylus = gsd_wacom_stylus_new (device, settings, _("Stylus"), "wacom-stylus");
+ } else {
settings = g_settings_new (SETTINGS_WACOM_DIR "." SETTINGS_ERASER_DIR);
-
- stylus = gsd_wacom_stylus_new (device, settings, _("Stylus"));
+ stylus = gsd_wacom_stylus_new (device, settings, NULL, NULL);
+ }
device->priv->styli = g_list_append (NULL, stylus);
}
diff --git a/panels/wacom/gsd-wacom-device.h b/panels/wacom/gsd-wacom-device.h
index adc8891..3b701b8 100644
--- a/panels/wacom/gsd-wacom-device.h
+++ b/panels/wacom/gsd-wacom-device.h
@@ -69,6 +69,7 @@ typedef struct
GType gsd_wacom_stylus_get_type (void);
GSettings * gsd_wacom_stylus_get_settings (GsdWacomStylus *stylus);
const char * gsd_wacom_stylus_get_name (GsdWacomStylus *stylus);
+const char * gsd_wacom_stylus_get_icon_name(GsdWacomStylus *stylus);
GsdWacomDevice * gsd_wacom_stylus_get_device (GsdWacomStylus *stylus);
/* Device types to apply a setting to */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]