aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2009-12-20 17:11:23 -0600
committerTed Gould <ted@gould.cx>2009-12-20 17:11:23 -0600
commitc44c00bdd91e0e5bf3010b0a7ac511b60c443370 (patch)
tree06ff7a6cca6a404f6b5d244864386e5d65860806
parent2f82dde7ca1c76ffd665120ea5576c46c353b6f1 (diff)
downloadlibayatana-appindicator-c44c00bdd91e0e5bf3010b0a7ac511b60c443370.tar.gz
libayatana-appindicator-c44c00bdd91e0e5bf3010b0a7ac511b60c443370.tar.bz2
libayatana-appindicator-c44c00bdd91e0e5bf3010b0a7ac511b60c443370.zip
Making the icon-path property construct only and making a constructor to set it.
-rw-r--r--src/libappindicator/app-indicator.c34
-rw-r--r--src/libappindicator/app-indicator.h4
2 files changed, 36 insertions, 2 deletions
diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c
index 536de59..1756687 100644
--- a/src/libappindicator/app-indicator.c
+++ b/src/libappindicator/app-indicator.c
@@ -183,12 +183,12 @@ app_indicator_class_init (AppIndicatorClass *klass)
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property(object_class,
- PROP_ICON_PATH,
+ PROP_ICON_PATH,
g_param_spec_string (PROP_ICON_PATH_S,
"An additional path for custom icons.",
"An additional place to look for icon names that may be installed by the application.",
NULL,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property(object_class,
PROP_MENU,
@@ -601,6 +601,36 @@ app_indicator_new (const gchar *id,
}
/**
+ app_indicator_new_with_path:
+ @id: The unique id of the indicator to create.
+ @icon_name: The icon name for this indicator
+ @category: The category of indicator.
+ @icon_path: A custom path for finding icons.
+
+ Creates a new #AppIndicator setting the properties:
+ #AppIndicator::id with @id, #AppIndicator::category
+ with @category, #AppIndicator::icon-name with
+ @icon_name and #AppIndicator::icon-path with @icon_path.
+
+ Return value: A pointer to a new #AppIndicator object.
+ */
+AppIndicator *
+app_indicator_new_with_path (const gchar *id,
+ const gchar *icon_name,
+ AppIndicatorCategory category,
+ const gchar *icon_path)
+{
+ AppIndicator *indicator = g_object_new (APP_INDICATOR_TYPE,
+ "id", id,
+ "category", category_from_enum (category),
+ "icon-name", icon_name,
+ "icon-path", icon_path,
+ NULL);
+
+ return indicator;
+}
+
+/**
app_indicator_get_type:
Generates or returns the unique #GType for #AppIndicator.
diff --git a/src/libappindicator/app-indicator.h b/src/libappindicator/app-indicator.h
index e966a49..52438f6 100644
--- a/src/libappindicator/app-indicator.h
+++ b/src/libappindicator/app-indicator.h
@@ -202,6 +202,10 @@ GType app_indicator_get_type (void) G_GNUC_C
AppIndicator *app_indicator_new (const gchar *id,
const gchar *icon_name,
AppIndicatorCategory category);
+AppIndicator *app_indicator_new_with_path (const gchar *id,
+ const gchar *icon_name,
+ AppIndicatorCategory category,
+ const gchar *icon_path);
/* Set properties */
void app_indicator_set_status (AppIndicator *self,