[Xfce4-commits] [apps/xfdashboard] 01/01: Set title in plugin preferences dialog to let user know which plugin he will configure now ; )

noreply at xfce.org noreply at xfce.org
Sat Feb 27 14:37:27 CET 2016


This is an automated email from the git hooks/post-receive script.

nomad pushed a commit to branch master
in repository apps/xfdashboard.

commit 06ba2e2dd4c5cddf84118139e181090642464a58
Author: Stephan Haller <nomad at froevel.de>
Date:   Sat Feb 27 14:36:48 2016 +0100

    Set title in plugin preferences dialog to let user know which plugin he will configure now ;)
---
 settings/plugins.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/settings/plugins.c b/settings/plugins.c
index 52e90d1..efad89c 100644
--- a/settings/plugins.c
+++ b/settings/plugins.c
@@ -62,6 +62,7 @@ struct _XfdashboardSettingsPluginsPrivate
 	GtkWidget		*widgetPluginDescription;
 	GtkWidget		*widgetPluginPreferencesDialog;
 	GtkWidget		*widgetPluginPreferencesWidgetBox;
+	GtkWidget		*widgetPluginPreferencesDialogTitle;
 };
 
 /* Properties */
@@ -211,10 +212,19 @@ static gboolean _xfdashboard_settings_plugins_call_preferences(XfdashboardSettin
 	if(pluginPreferencesWidget)
 	{
 		gint								response;
+		gchar								*name;
+		gchar								*title;
 
 		/* Add returned widget from plugin to dialog */
 		gtk_container_add(GTK_CONTAINER(priv->widgetPluginPreferencesWidgetBox), pluginPreferencesWidget);
 
+		/* Set title of dialog */
+		g_object_get(plugin, "name", &name, NULL);
+		title=g_strdup_printf(_("Configure plugin: %s"), name);
+		gtk_label_set_text(GTK_LABEL(priv->widgetPluginPreferencesDialogTitle), title);
+		if(title) g_free(title);
+		if(name) g_free(name);
+
 		/* Show dialog in modal mode but do not care about dialog's response code
 		 * as "close" is the only action.
 		 */
@@ -890,6 +900,7 @@ static void _xfdashboard_settings_plugins_set_builder(XfdashboardSettingsPlugins
 
 	priv->widgetPluginPreferencesDialog=GTK_WIDGET(gtk_builder_get_object(priv->builder, "plugin-preferences-dialog"));
 	priv->widgetPluginPreferencesWidgetBox=GTK_WIDGET(gtk_builder_get_object(priv->builder, "plugin-preferences-widget-box"));
+	priv->widgetPluginPreferencesDialogTitle=GTK_WIDGET(gtk_builder_get_object(priv->builder, "configure-plugin-title-label"));
 
 	/* Set up theme list */
 	if(priv->widgetPlugins)
@@ -1022,6 +1033,7 @@ static void _xfdashboard_settings_plugins_dispose(GObject *inObject)
 	priv->widgetPluginDescription=NULL;
 	priv->widgetPluginPreferencesDialog=NULL;
 	priv->widgetPluginPreferencesWidgetBox=NULL;
+	priv->widgetPluginPreferencesDialogTitle=NULL;
 
 	if(priv->builder)
 	{
@@ -1133,6 +1145,7 @@ static void xfdashboard_settings_plugins_init(XfdashboardSettingsPlugins *self)
 
 	priv->widgetPluginPreferencesDialog=NULL;
 	priv->widgetPluginPreferencesWidgetBox=NULL;
+	priv->widgetPluginPreferencesDialogTitle=NULL;
 }
 
 /* IMPLEMENTATION: Public API */

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list