gtranslator r3597 - in trunk: . plugins/charmap src



Author: icq
Date: Mon Sep 22 09:38:26 2008
New Revision: 3597
URL: http://svn.gnome.org/viewvc/gtranslator?rev=3597&view=rev

Log:
Merge charmap into the master branch to fix statusbar warnings on charmap plugin

Modified:
   trunk/ChangeLog
   trunk/plugins/charmap/charmap-plugin.c
   trunk/src/statusbar.c
   trunk/src/statusbar.h

Modified: trunk/plugins/charmap/charmap-plugin.c
==============================================================================
--- trunk/plugins/charmap/charmap-plugin.c	(original)
+++ trunk/plugins/charmap/charmap-plugin.c	Mon Sep 22 09:38:26 2008
@@ -27,6 +27,7 @@
 
 #include <glib/gi18n-lib.h>
 #include "application.h"
+#include "statusbar.h"
 #include "window.h"
 #include <gucharmap/gucharmap-table.h>
 #include <gucharmap/gucharmap-unicode-info.h>
@@ -75,18 +76,18 @@
 			 const gchar    *message,
 			 GtranslatorWindow    *window)
 {
-	GtkStatusbar *statusbar;
+	GtranslatorStatusbar *statusbar;
 	WindowData *data;
 
-	statusbar = GTK_STATUSBAR (gtranslator_window_get_statusbar (window));
+	statusbar = GTR_STATUSBAR (gtranslator_window_get_statusbar (window));
 	data = (WindowData *) g_object_get_data (G_OBJECT (window),
 						 WINDOW_DATA_KEY);
 	g_return_if_fail (data != NULL);
 
-	gtk_statusbar_pop (statusbar, data->context_id);
+	gtranslator_statusbar_pop (statusbar, data->context_id);
 
 	if (message)
-		gtk_statusbar_push (statusbar, data->context_id, message);
+		gtranslator_statusbar_push (statusbar, data->context_id, message);
 }
 
 static void
@@ -217,24 +218,13 @@
 impl_activate (GtranslatorPlugin *plugin,
 	       GtranslatorWindow *window)
 {
-	/*GtkWidget *image;
-	GtkIconTheme *theme;*/
-	GtkStatusbar *statusbar;
+	GtranslatorStatusbar *statusbar;
 	WindowData *data;
 
 	//gtranslator_debug (DEBUG_PLUGINS);
 
 	data = g_new (WindowData, 1);
 
-	/*theme = gtk_icon_theme_get_default ();
-	
-	if (gtk_icon_theme_has_icon (theme, "accessories-character-map"))
-		image = gtk_image_new_from_icon_name ("accessories-character-map",
-						      GTK_ICON_SIZE_MENU);
-	else
-		image = gtk_image_new_from_icon_name ("gucharmap",
-						      GTK_ICON_SIZE_MENU);*/
-
 	gtranslator_application_register_icon (GTR_APP, "gucharmap.ico",
 					       "charmap-plugin-icon");
 	
@@ -247,11 +237,9 @@
 				       "charmap-plugin-icon",
 				       GTR_WINDOW_PLACEMENT_LEFT);
 
-	//gtk_object_sink (GTK_OBJECT (image));
-
-	statusbar = GTK_STATUSBAR (gtranslator_window_get_statusbar (window));
-	data->context_id = gtk_statusbar_get_context_id (statusbar,
-							 "Character Description");
+	statusbar = GTR_STATUSBAR (gtranslator_window_get_statusbar (window));
+	data->context_id = gtranslator_statusbar_get_context_id (statusbar,
+								 "Character Description");
 
 	g_object_set_data_full (G_OBJECT (window),
 				WINDOW_DATA_KEY,

Modified: trunk/src/statusbar.c
==============================================================================
--- trunk/src/statusbar.c	(original)
+++ trunk/src/statusbar.c	Mon Sep 22 09:38:26 2008
@@ -205,6 +205,24 @@
 }
 
 /**
+ * gtranslator_statusbar_get_context_id:
+ * @statusbar: a #GtranslatorStatusbar
+ * @context_description: textual description of what context the new message is being used in
+ *
+ * Returns a new context identifier, given a description of the actual context.
+ * Note that the description is not shown in the UI.
+ * 
+ * Returns: an integer id
+ */
+guint
+gtranslator_statusbar_get_context_id (GtranslatorStatusbar *statusbar,
+				      const gchar *context_description)
+{
+	return gtk_statusbar_get_context_id (statusbar->priv->statusbar,
+					     context_description);
+}
+
+/**
  * gtranslator_statusbar_set_overwrite:
  * @statusbar: a #GtranslatorStatusbar
  * @overwrite: if the overwrite mode is set

Modified: trunk/src/statusbar.h
==============================================================================
--- trunk/src/statusbar.h	(original)
+++ trunk/src/statusbar.h	Mon Sep 22 09:38:26 2008
@@ -64,6 +64,9 @@
 
 void             gtranslator_statusbar_pop                      (GtranslatorStatusbar *statusbar,
 								 guint context_id);
+								 
+guint            gtranslator_statusbar_get_context_id           (GtranslatorStatusbar *statusbar,
+								 const gchar *context_description);
 
 void		 gtranslator_statusbar_set_overwrite		(GtranslatorStatusbar   *statusbar,
 								 gboolean          overwrite);



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