gtranslator r3743 - trunk/src



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

Log:
2008-08-28  Ignacio Casal Quinteiro  <nacho resa gmail com>

	* history-entry.c (gtranslator_history_entry_class_init),
	(gtranslator_history_entry_save_history), (remove_item),
	(gtranslator_history_entry_load_history):
	* message-area.c:
	* message-area.h:
	Sync with gedit to get the docs I added.

Modified:
   trunk/src/ChangeLog
   trunk/src/history-entry.c
   trunk/src/message-area.c
   trunk/src/message-area.h

Modified: trunk/src/history-entry.c
==============================================================================
--- trunk/src/history-entry.c	(original)
+++ trunk/src/history-entry.c	Mon Sep 22 09:46:13 2008
@@ -25,7 +25,7 @@
  * list of people on the gtranslator Team.  
  * See the ChangeLog files for a list of changes. 
  *
- * $Id: history-entry.c 5931 2007-09-25 20:05:40Z pborelli $
+ * $Id: history-entry.c 6377 2008-08-10 14:45:44Z pborelli $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -158,7 +158,8 @@
 							      "History ID",
 							      "History ID",
 							      NULL,
-							      G_PARAM_READWRITE));
+							      G_PARAM_READWRITE |
+							      G_PARAM_STATIC_STRINGS));
 
 	g_object_class_install_property (object_class,
 					 PROP_HISTORY_LENGTH,
@@ -168,7 +169,8 @@
 							    0,
 							    G_MAXUINT,
 							    GTR_HISTORY_ENTRY_HISTORY_LENGTH_DEFAULT,
-							    G_PARAM_READWRITE));
+							    G_PARAM_READWRITE |
+							    G_PARAM_STATIC_STRINGS));
 
 	/* TODO: Add enable-completion property */
 
@@ -258,6 +260,7 @@
 			      gconf_items,
 			      NULL);
 
+	g_slist_foreach (gconf_items, (GFunc) g_free, NULL);
 	g_slist_free (gconf_items);
 	g_free (key);
 }
@@ -287,9 +290,12 @@
 		    strcmp (item_text, text) == 0)
 		{
 			gtk_list_store_remove (store, &iter);
+			g_free (item_text);
 			return TRUE;
 		}
 
+		g_free (item_text);
+
 	} while (gtk_tree_model_iter_next (GTK_TREE_MODEL (store), &iter));
 
 	return FALSE;
@@ -406,8 +412,9 @@
 				    -1);
 	}
 
-	g_free (key);
+	g_slist_foreach (gconf_items, (GFunc) g_free, NULL);
 	g_slist_free (gconf_items);
+	g_free (key);
 }
 
 void

Modified: trunk/src/message-area.c
==============================================================================
--- trunk/src/message-area.c	(original)
+++ trunk/src/message-area.c	Mon Sep 22 09:46:13 2008
@@ -25,7 +25,7 @@
  * list of people on the gtranslator Team.
  * See the ChangeLog files for a list of changes.
  *
- * $Id: message-area.c 5887 2007-09-07 07:20:19Z pborelli $
+ * $Id: message-area.c 6468 2008-08-28 08:23:00Z icq $
  */
 
 /* TODO: Style properties */
@@ -335,6 +335,13 @@
 				    0);
 }
 
+/**
+ * gtranslator_message_area_set_contents:
+ * @message_area: a #GtranslatorMessageArea
+ * @contents: widget you want to add to the contents area
+ *
+ * Adds the @contents widget to the contents area of #GtranslatorMessageArea.
+ */
 void
 gtranslator_message_area_set_contents	(GtranslatorMessageArea *message_area,
 				 GtkWidget        *contents)
@@ -350,6 +357,19 @@
 			    0);
 }
 
+/**
+ * gtranslator_message_area_add_button:
+ * @message_area: a #GtranslatorMessageArea
+ * @button_text: text of button, or stock ID
+ * @response_id: response ID for the button
+ * 
+ * Adds a button with the given text (or a stock button, if button_text is a stock ID)
+ * and sets things up so that clicking the button will emit the "response" signal
+ * with the given response_id. The button is appended to the end of the message area's
+ * action area. The button widget is returned, but usually you don't need it.
+ *
+ * Returns: the button widget that was added
+ */
 GtkWidget*
 gtranslator_message_area_add_button (GtranslatorMessageArea *message_area,
 			       const gchar      *button_text,
@@ -403,6 +423,16 @@
 	}
 }
 
+/**
+ * gtranslator_message_area_add_buttons:
+ * @message_area: a #GtranslatorMessageArea
+ * @first_button_text: button text or stock ID
+ * @...: response ID for first button, then more text-response_id pairs
+ *
+ * Adds more buttons, same as calling gtranslator_message_area_add_button() repeatedly.
+ * The variable argument list should be NULL-terminated as with
+ * gtranslator_message_area_new_with_buttons(). Each button must have both text and response ID.
+ */
 void
 gtranslator_message_area_add_buttons (GtranslatorMessageArea *message_area,
 				const gchar      *first_button_text,
@@ -419,12 +449,33 @@
 	va_end (args);
 }
 
+/**
+ * gtranslator_message_area_new:
+ * 
+ * Creates a new #GtranslatorMessageArea object.
+ * 
+ * Returns: a new #GtranslatorMessageArea object
+ */
 GtkWidget *
 gtranslator_message_area_new (void)
 {
 	return g_object_new (GTR_TYPE_MESSAGE_AREA, NULL);
 }
 
+/**
+ * gtranslator_message_area_new_with_buttons:
+ * @first_button_text: stock ID or text to go in first button, or NULL
+ * @...: response ID for first button, then additional buttons, ending with NULL
+ * 
+ * Creates a new #GtranslatorMessageArea with buttons. Button text/response ID pairs 
+ * should be listed, with a NULL pointer ending the list. Button text can be either
+ * a stock ID such as GTK_STOCK_OK, or some arbitrary text. A response ID can be any
+ * positive number, or one of the values in the GtkResponseType enumeration. If 
+ * the user clicks one of these dialog buttons, GtranslatorMessageArea will emit the "response"
+ * signal with the corresponding response ID.
+ *
+ * Returns: a new #GtranslatorMessageArea
+ */
 GtkWidget *
 gtranslator_message_area_new_with_buttons (const gchar *first_button_text,
                                      ...)
@@ -445,6 +496,16 @@
 	return GTK_WIDGET (message_area);
 }
 
+/**
+ * gtranslator_message_area_set_response_sensitive:
+ * @message_area: a #GtranslatorMessageArea
+ * @response_id: a response ID
+ * @setting: TRUE for sensitive
+ *
+ * Calls gtk_widget_set_sensitive (widget, setting) for each widget in the dialog's
+ * action area with the given response_id. A convenient way to sensitize/desensitize
+ * dialog buttons.
+ */
 void
 gtranslator_message_area_set_response_sensitive (GtranslatorMessageArea *message_area,
 					   gint              response_id,
@@ -472,6 +533,15 @@
 	g_list_free (children);
 }
 
+/**
+ * gtranslator_message_area_set_default_response:
+ * @message_area: a #GtranslatorMessageArea
+ * @response_id: a response ID
+ *
+ * Sets the last widget in the message area's action area with the given response_id
+ * as the default widget for the dialog. Pressing "Enter" normally activates the
+ * default widget.
+ */
 void
 gtranslator_message_area_set_default_response (GtranslatorMessageArea *message_area,
 					 gint              response_id)
@@ -498,6 +568,13 @@
 	g_list_free (children);
 }
 
+/**
+ * gtranslator_message_area_set_default_response:
+ * @message_area: a #GtranslatorMessageArea
+ * @response_id: a response ID
+ *
+ * Emits the 'response' signal with the given @response_id.
+ */
 void
 gtranslator_message_area_response (GtranslatorMessageArea *message_area,
 			     gint              response_id)
@@ -510,6 +587,15 @@
 		       response_id);
 }
 
+/**
+ * gtranslator_message_area_add_stock_button_with_text:
+ * @message_area: a #GtranslatorMessageArea
+ * @text: the text to visualize in the button
+ * @stock_id: the stock ID of the button
+ * @response_id: a response ID
+ *
+ * Same as gtranslator_message_area_add_button() but with a specific text.
+ */
 GtkWidget *
 gtranslator_message_area_add_stock_button_with_text (GtranslatorMessageArea *message_area,
 				    	       const gchar      *text,

Modified: trunk/src/message-area.h
==============================================================================
--- trunk/src/message-area.h	(original)
+++ trunk/src/message-area.h	Mon Sep 22 09:46:13 2008
@@ -25,7 +25,7 @@
  * list of people on the gtranslator Team.  
  * See the ChangeLog files for a list of changes. 
  *
- * $Id: message-area.h 5666 2007-06-29 19:52:25Z sfre $
+ * $Id: message-area.h 6138 2008-02-01 14:32:22Z icq $
  */
 
 #ifndef __GTR_MESSAGE_AREA_H__



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