SF.net SVN: geany: [1324] trunk
ntrel at users.sourceforge.net
ntrel at xxxxx
Fri Feb 23 15:36:22 UTC 2007
Revision: 1324
http://svn.sourceforge.net/geany/?rev=1324&view=rev
Author: ntrel
Date: 2007-02-23 07:36:21 -0800 (Fri, 23 Feb 2007)
Log Message:
-----------
Fixed switching to the wrong tab when showing the unsaved dialog.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/dialogs.c
trunk/src/document.c
trunk/src/document.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-02-23 13:26:06 UTC (rev 1323)
+++ trunk/ChangeLog 2007-02-23 15:36:21 UTC (rev 1324)
@@ -7,6 +7,8 @@
Also prevent re-colourising C-like documents after saving a file
unless the list of typenames has changed.
Add document_delay_colourise(), document_colourise_all().
+ * src/dialogs.c, src/document.c, src/document.h:
+ Fixed switching to the wrong tab when showing the unsaved dialog.
2007-02-20 Enrico Troeger <enrico.troeger at uvena.de>
Modified: trunk/src/dialogs.c
===================================================================
--- trunk/src/dialogs.c 2007-02-23 13:26:06 UTC (rev 1323)
+++ trunk/src/dialogs.c 2007-02-23 15:36:21 UTC (rev 1324)
@@ -343,7 +343,7 @@
// display the file tab to remind the user of the document
gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook),
- document_find_by_sci(doc_list[idx].sci));
+ document_get_notebook_page(idx));
if (doc_list[idx].file_name != NULL)
{
Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c 2007-02-23 13:26:06 UTC (rev 1323)
+++ trunk/src/document.c 2007-02-23 15:36:21 UTC (rev 1324)
@@ -80,7 +80,7 @@
static gboolean update_type_keywords(ScintillaObject *sci);
-/* returns the index of the notebook page which has the given filename
+/* returns the document index which has the given filename.
* is_tm_filename is needed when passing TagManager filenames because they are
* dereferenced, and would not match the link filename. */
gint document_find_by_filename(const gchar *filename, gboolean is_tm_filename)
@@ -104,7 +104,7 @@
}
-/* returns the index of the notebook page which has sci */
+/* returns the document index which has sci */
gint document_find_by_sci(ScintillaObject *sci)
{
guint i;
@@ -119,6 +119,16 @@
}
+/* returns the index of the notebook page from the document index */
+gint document_get_notebook_page(gint doc_idx)
+{
+ if (! DOC_IDX_VALID(doc_idx)) return -1;
+
+ return gtk_notebook_page_num(GTK_NOTEBOOK(app->notebook),
+ GTK_WIDGET(doc_list[doc_idx].sci));
+}
+
+
/* returns the index of the given notebook page in the document list */
gint document_get_n_idx(guint page_num)
{
Modified: trunk/src/document.h
===================================================================
--- trunk/src/document.h 2007-02-23 13:26:06 UTC (rev 1323)
+++ trunk/src/document.h 2007-02-23 15:36:21 UTC (rev 1324)
@@ -88,14 +88,19 @@
(doc_list[doc_idx].file_name) : GEANY_STRING_UNTITLED)
-/* returns the index of the notebook page which has the given filename */
-gint document_find_by_filename(const gchar*, gboolean is_tm_filename);
+/* returns the document index which has the given filename.
+ * is_tm_filename is needed when passing TagManager filenames because they are
+ * dereferenced, and would not match the link filename. */
+gint document_find_by_filename(const gchar *filename, gboolean is_tm_filename);
-/* returns the index of the notebook page which has sci */
-gint document_find_by_sci(ScintillaObject*);
+/* returns the document index which has sci */
+gint document_find_by_sci(ScintillaObject *sci);
+/* returns the index of the notebook page from the document index */
+gint document_get_notebook_page(gint doc_idx);
+
/* returns the index of the given notebook page in the document list */
gint document_get_n_idx(guint page_num);
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