anjuta r3434 - in trunk: . libanjuta plugins/file-loader src



Author: naba
Date: Mon Jan  7 22:09:56 2008
New Revision: 3434
URL: http://svn.gnome.org/viewvc/anjuta?rev=3434&view=rev

Log:
	* libanjuta/anjuta-plugin-handle.c: (anjuta_plugin_handle_new):
	* libanjuta/anjuta-plugin-manager.c:
	(anjuta_plugin_manager_select),
	(anjuta_plugin_manager_activate_plugins):
	* libanjuta/anjuta-profile.c: (anjuta_profile_to_xml):
	* plugins/file-loader/plugin.c: (sort_wizards), (open_with_dialog),
	(on_create_submenu), (create_open_with_submenu):
	* src/about.c: (on_about_plugin_activate),
	(about_create_plugins_submenu): Use translated version of get_string()
	API in AnjutaDescription for translatable properties. Fixes bug #496833
	comment #18.


Modified:
   trunk/ChangeLog
   trunk/libanjuta/anjuta-plugin-handle.c
   trunk/libanjuta/anjuta-plugin-manager.c
   trunk/libanjuta/anjuta-profile.c
   trunk/plugins/file-loader/plugin.c
   trunk/src/about.c

Modified: trunk/libanjuta/anjuta-plugin-handle.c
==============================================================================
--- trunk/libanjuta/anjuta-plugin-handle.c	(original)
+++ trunk/libanjuta/anjuta-plugin-handle.c	Mon Jan  7 22:09:56 2008
@@ -506,16 +506,16 @@
 		success = FALSE;
 	}
 	
-	if (anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
-											  "Name", &str)) {
+	if (anjuta_plugin_description_get_locale_string (desc, "Anjuta Plugin",
+													 "Name", &str)) {
 		plugin_handle->priv->name = str;
 	} else {
 		g_warning ("couldn't find 'Name' attribute.");
 		success = FALSE;
 	}
 
-	if (anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
-											  "Description", &str)) {
+	if (anjuta_plugin_description_get_locale_string (desc, "Anjuta Plugin",
+													 "Description", &str)) {
 		plugin_handle->priv->about = str;
 	} else {
 		g_warning ("Couldn't find 'Description' attribute.");

Modified: trunk/libanjuta/anjuta-plugin-manager.c
==============================================================================
--- trunk/libanjuta/anjuta-plugin-manager.c	(original)
+++ trunk/libanjuta/anjuta-plugin-manager.c	Mon Jan  7 22:09:56 2008
@@ -1877,17 +1877,17 @@
 		{
 			g_warning ("Plugin does not define Icon attribute");
 		}
-		if (!anjuta_plugin_description_get_string (desc,
-												  "Anjuta Plugin",
-												  "Name",
-												  &plugin_name))
+		if (!anjuta_plugin_description_get_locale_string (desc,
+														  "Anjuta Plugin",
+														  "Name",
+														  &plugin_name))
 		{
 			g_warning ("Plugin does not define Name attribute");
 		}
-		if (!anjuta_plugin_description_get_string (desc,
-												  "Anjuta Plugin",
-												  "Description",
-												  &plugin_desc))
+		if (!anjuta_plugin_description_get_locale_string (desc,
+														  "Anjuta Plugin",
+														  "Description",
+														  &plugin_desc))
 		{
 			g_warning ("Plugin does not define Description attribute");
 		}
@@ -2343,12 +2343,12 @@
 											  &icon_filename))
 		{
 			gchar *title, *description;
-			anjuta_plugin_description_get_string (d, "Anjuta Plugin",
-												  "Name",
-												  &title);
-			anjuta_plugin_description_get_string (d, "Anjuta Plugin",
-												  "Description",
-												  &description);
+			anjuta_plugin_description_get_locale_string (d, "Anjuta Plugin",
+														 "Name",
+														 &title);
+			anjuta_plugin_description_get_locale_string (d, "Anjuta Plugin",
+														 "Description",
+														 &description);
 			icon_path = g_strconcat (PACKAGE_PIXMAPS_DIR"/",
 									 icon_filename, NULL);
 			/* DEBUG_PRINT ("Icon: %s", icon_path); */

Modified: trunk/libanjuta/anjuta-profile.c
==============================================================================
--- trunk/libanjuta/anjuta-profile.c	(original)
+++ trunk/libanjuta/anjuta-profile.c	Mon Jan  7 22:09:56 2008
@@ -843,7 +843,7 @@
 				continue;
 			}
 			g_free (user_activatable);
-			
+			/* Do not use the _locale_ version because it's not in UI */
 			anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
 												  "Name", &name);
 			DEBUG_PRINT("Saving plugin: %s", name);
@@ -870,10 +870,11 @@
 		else
 		{
 			gchar* name;
+			/* Do not use the _locale_ version because it's debugging */
 			anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
 												  "Name", &name);
-			DEBUG_PRINT("excluding plugin: %s", name);
-			g_free(name);
+			DEBUG_PRINT ("excluding plugin: %s", name);
+			g_free (name);
 		}
 		node = g_list_next (node);
 	}

Modified: trunk/plugins/file-loader/plugin.c
==============================================================================
--- trunk/plugins/file-loader/plugin.c	(original)
+++ trunk/plugins/file-loader/plugin.c	Mon Jan  7 22:09:56 2008
@@ -50,14 +50,14 @@
 	AnjutaPluginDescription* desc1 = (AnjutaPluginDescription*) wizard1;
 	AnjutaPluginDescription* desc2 = (AnjutaPluginDescription*) wizard2;
 	
-	if ((anjuta_plugin_description_get_string (desc1, "Wizard",
-												  "Title", &name1) ||
-			anjuta_plugin_description_get_string (desc1, "Anjuta Plugin",
-												  "Name", &name1)) &&
-		(anjuta_plugin_description_get_string (desc2, "Wizard",
-												  "Title", &name2) ||
-			anjuta_plugin_description_get_string (desc2, "Anjuta Plugin",
-												  "Name", &name2)))
+	if ((anjuta_plugin_description_get_locale_string (desc1, "Wizard",
+													  "Title", &name1) ||
+			anjuta_plugin_description_get_locale_string (desc1, "Anjuta Plugin",
+														 "Name", &name1)) &&
+		(anjuta_plugin_description_get_locale_string (desc2, "Wizard",
+													  "Title", &name2) ||
+			anjuta_plugin_description_get_locale_string (desc2, "Anjuta Plugin",
+														 "Name", &name2)))
 	{
 		return strcmp(name1, name2);
 	}
@@ -184,13 +184,13 @@
 		
 		name = NULL;
 		
-		anjuta_plugin_description_get_string (desc, "File Loader",
-											  "Title", &name);
+		anjuta_plugin_description_get_locale_string (desc, "File Loader",
+													 "Title", &name);
 		
 		if (!name)
 		{
-			anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
-												  "Name", &name);
+			anjuta_plugin_description_get_locale_string (desc, "Anjuta Plugin",
+														 "Name", &name);
 		}
 		if (!name)
 		{
@@ -593,10 +593,10 @@
 		
 		icon = NULL;
 		name = NULL;
-		if (anjuta_plugin_description_get_string (desc, "Wizard",
-												  "Title", &str) ||
-			anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
-												  "Name", &str))
+		if (anjuta_plugin_description_get_locale_string (desc, "Wizard",
+														 "Title", &str) ||
+			anjuta_plugin_description_get_locale_string (desc, "Anjuta Plugin",
+														 "Name", &str))
 		{
 			count++;
 			if (count < 10)
@@ -836,12 +836,12 @@
 		
 		desc = (AnjutaPluginDescription *)(snode->data);
 		name = NULL;
-		anjuta_plugin_description_get_string (desc, "File Loader",
-											  "Title", &name);
+		anjuta_plugin_description_get_locale_string (desc, "File Loader",
+													 "Title", &name);
 		if (!name)
 		{
-			anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
-												  "Name", &name);
+			anjuta_plugin_description_get_locale_string (desc, "Anjuta Plugin",
+														 "Name", &name);
 		}
 		if (!name)
 		{

Modified: trunk/src/about.c
==============================================================================
--- trunk/src/about.c	(original)
+++ trunk/src/about.c	Mon Jan  7 22:09:56 2008
@@ -212,10 +212,10 @@
 	GdkPixbuf *pix = NULL;
 	GtkWidget *dialog;
 	
-	anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
-										  "Name", &name);
-	anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
-										  "Description", &d);
+	anjuta_plugin_description_get_locale_string (desc, "Anjuta Plugin",
+												 "Name", &name);
+	anjuta_plugin_description_get_locale_string (desc, "Anjuta Plugin",
+												 "Description", &d);
 	anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
 										  "Icon", &icon);
 	anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
@@ -274,8 +274,8 @@
 		gchar *label;
 		GtkWidget *item;
 		AnjutaPluginDescription *desc = node->data;
-		if (anjuta_plugin_description_get_string (desc, "Anjuta Plugin",
-												  "Name", &label))
+		if (anjuta_plugin_description_get_locale_string (desc, "Anjuta Plugin",
+														 "Name", &label))
 		{
 			gchar *authors;
 			if (anjuta_plugin_description_get_string (desc, "Anjuta Plugin",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]