SF.net SVN: geany: [606] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sat Jul 22 14:36:33 UTC 2006


Revision: 606
Author:   eht16
Date:     2006-07-22 07:36:20 -0700 (Sat, 22 Jul 2006)
ViewCVS:  http://svn.sourceforge.net/geany/?rev=606&view=rev

Log Message:
-----------
Keep the list of open files in sync when reordering notebook tabs.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/notebook.c
    trunk/src/treeviews.c
    trunk/src/treeviews.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-07-22 14:06:33 UTC (rev 605)
+++ trunk/ChangeLog	2006-07-22 14:36:20 UTC (rev 606)
@@ -8,6 +8,8 @@
    encoding(both were patches from Stefan Oltmanns).
  * src/callbacks.c: Fixed two issues when showing / hiding the sidebar.
  * src/filetypes.c: Added *.cfg as extension for config files.
+ * src/treeviews.c, src/notebook.c:
+   Keep the list of open files in sync when reordering notebook tabs.
 
 
 2006-07-21  Nick Treleaven  <nick.treleaven at btinternet.com>

Modified: trunk/src/notebook.c
===================================================================
--- trunk/src/notebook.c	2006-07-22 14:06:33 UTC (rev 605)
+++ trunk/src/notebook.c	2006-07-22 14:36:20 UTC (rev 606)
@@ -24,6 +24,7 @@
 #include "notebook.h"
 #include "document.h"
 #include "utils.h"
+#include "treeviews.h"
 
 #define GEANY_DND_NOTEBOOK_TAB_TYPE	"geany_dnd_notebook_tab"
 
@@ -142,8 +143,12 @@
 		break;
 		}
 
-		if (ok) gtk_notebook_reorder_child(notebook,
-			gtk_notebook_get_nth_page(notebook, ncurr), ndest);
+		if (ok)
+		{
+			gtk_notebook_reorder_child(notebook,
+							gtk_notebook_get_nth_page(notebook, ncurr), ndest);
+			treeviews_openfiles_update_all();
+		}
 	}
 
 	oldx = x; oldy = y;

Modified: trunk/src/treeviews.c
===================================================================
--- trunk/src/treeviews.c	2006-07-22 14:06:33 UTC (rev 605)
+++ trunk/src/treeviews.c	2006-07-22 14:36:20 UTC (rev 606)
@@ -27,6 +27,7 @@
 #include "callbacks.h"
 #include "utils.h"
 #include "treeviews.h"
+#include "document.h"
 
 
 /* the following two functions are document-related, but I think they fit better here than in document.c*/
@@ -245,6 +246,26 @@
 }
 
 
+void treeviews_openfiles_update_all(void)
+{
+	guint i;
+	gint idx;
+	gchar *basename;
+
+	gtk_list_store_clear(tv.store_openfiles);
+	for (i = 0; i < gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)); i++)
+	{
+		idx = document_get_n_idx(i);
+		if (! doc_list[idx].is_valid) continue;
+
+		basename = g_path_get_basename(doc_list[idx].file_name);
+		doc_list[idx].iter = treeviews_openfiles_add(idx, basename);
+		g_free(basename);
+	}
+
+}
+
+
 void treeviews_create_taglist_popup_menu(void)
 {
 	GtkWidget *item;

Modified: trunk/src/treeviews.h
===================================================================
--- trunk/src/treeviews.h	2006-07-22 14:06:33 UTC (rev 605)
+++ trunk/src/treeviews.h	2006-07-22 14:36:20 UTC (rev 606)
@@ -58,6 +58,8 @@
 
 void treeviews_openfiles_update(GtkTreeIter iter, const gchar *string);
 
+void treeviews_openfiles_update_all(void);
+
 void treeviews_openfiles_remove(GtkTreeIter iter);
 
 void treeviews_create_openfiles_popup_menu(void);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Commits mailing list