anjuta r3735 - in trunk: . plugins/message-view



Author: jhs
Date: Sun Mar  2 09:55:49 2008
New Revision: 3735
URL: http://svn.gnome.org/viewvc/anjuta?rev=3735&view=rev

Log:
2008-03-02  Johannes Schmid  <jhs gnome org>

	* plugins/message-view/anjuta-msgman.c
	(anjuta_msgman_instance_init), (anjuta_msgman_append_view),
	(anjuta_msgman_get_current_view), (anjuta_msgman_set_current_view):
	* plugins/message-view/anjuta-msgman.h:
	
	Fixed anjuta_msgman_get_current_view() to access the notebook directly and
	get rid of the cached current_view member.
	Fixes #518469 â Save message buffer not working good

Modified:
   trunk/ChangeLog
   trunk/plugins/message-view/anjuta-msgman.c
   trunk/plugins/message-view/anjuta-msgman.h

Modified: trunk/plugins/message-view/anjuta-msgman.c
==============================================================================
--- trunk/plugins/message-view/anjuta-msgman.c	(original)
+++ trunk/plugins/message-view/anjuta-msgman.c	Sun Mar  2 09:55:49 2008
@@ -29,7 +29,6 @@
 	AnjutaPreferences *preferences;
 	GtkWidget* popup_menu;
 	GtkWidget* tab_popup;
-	MessageView *current_view;
 	GList *views;
 };
 
@@ -207,7 +206,6 @@
 	gtk_notebook_set_scrollable (GTK_NOTEBOOK (msgman), TRUE);
 	msgman->priv = g_new0(AnjutaMsgmanPriv, 1);
 	msgman->priv->views = NULL;
-	msgman->priv->current_view = NULL;
 	msgman->priv->tab_popup = create_tab_popup_menu(msgman);
 	g_signal_connect(GTK_OBJECT(msgman), "popup-menu", 
                        G_CALLBACK(on_msgman_popup_menu), msgman);
@@ -357,7 +355,6 @@
 	g_signal_handlers_block_by_func (GTK_OBJECT (msgman),
 									 GTK_SIGNAL_FUNC
 									 (on_notebook_switch_page), msgman);
-	msgman->priv->current_view = MESSAGE_VIEW (mv);
 	msgman->priv->views =
 		g_list_prepend (msgman->priv->views, (gpointer) page);
 
@@ -440,7 +437,9 @@
 MessageView *
 anjuta_msgman_get_current_view (AnjutaMsgman * msgman)
 {
-	return msgman->priv->current_view;
+	gint current_page = gtk_notebook_get_current_page (GTK_NOTEBOOK(msgman));
+	return MESSAGE_VIEW (gtk_notebook_get_nth_page (GTK_NOTEBOOK(msgman),
+													current_page));
 }
 
 MessageView *
@@ -474,20 +473,7 @@
 	AnjutaMsgmanPage *page;
 	gint page_num;
 
-	if (mv == NULL)
-	{
-		if (gtk_notebook_get_n_pages(GTK_NOTEBOOK(msgman)) == 0)
-		{
-			msgman->priv->current_view = NULL;
-		}
-		else
-		{
-			msgman->priv->current_view = 
-				MESSAGE_VIEW(gtk_notebook_get_nth_page(GTK_NOTEBOOK(msgman),
-													   gtk_notebook_get_current_page(GTK_NOTEBOOK(msgman))));
-		}
-	}
-	else
+	if (mv)
 	{
 		page = anjuta_msgman_page_from_widget (msgman, mv);
 		page_num =

Modified: trunk/plugins/message-view/anjuta-msgman.h
==============================================================================
--- trunk/plugins/message-view/anjuta-msgman.h	(original)
+++ trunk/plugins/message-view/anjuta-msgman.h	Sun Mar  2 09:55:49 2008
@@ -49,7 +49,7 @@
 };
 
 GType anjuta_msgman_get_type (void);
-GtkWidget *anjuta_msgman_new (AnjutaPreferences * pref, GtkWidget* popup_menu);
+GtkWidget *anjuta_msgman_new (AnjutaPreference * pref, GtkWidget* popup_menu);
 
 MessageView *anjuta_msgman_add_view (AnjutaMsgman * msgman,
 									 const gchar * name,



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