Revision: 3055 http://geany.svn.sourceforge.net/geany/?rev=3055&view=rev Author: ntrel Date: 2008-10-07 17:31:17 +0000 (Tue, 07 Oct 2008)
Log Message: ----------- Add filename label. Fix Gtk warning when resplitting.
Modified Paths: -------------- trunk/ChangeLog trunk/plugins/splitwindow.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2008-10-07 17:12:33 UTC (rev 3054) +++ trunk/ChangeLog 2008-10-07 17:31:17 UTC (rev 3055) @@ -13,6 +13,9 @@ document. * plugins/splitwindow.c: Refactor with set_editor(). + * plugins/splitwindow.c: + Add filename label. + Fix Gtk warning when resplitting.
2008-10-06 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/plugins/splitwindow.c =================================================================== --- trunk/plugins/splitwindow.c 2008-10-07 17:12:33 UTC (rev 3054) +++ trunk/plugins/splitwindow.c 2008-10-07 17:31:17 UTC (rev 3055) @@ -185,14 +185,16 @@
/* first destroy any widget, otherwise its signals will have an * invalid document as user_data */ - if (edit_window.sci != NULL) - gtk_widget_destroy(GTK_WIDGET(edit_window.sci)); + if (editwin->sci != NULL) + gtk_widget_destroy(GTK_WIDGET(editwin->sci));
editwin->sci = p_editor->create_widget(editor); gtk_widget_show(GTK_WIDGET(editwin->sci)); gtk_container_add(GTK_CONTAINER(editwin->vbox), GTK_WIDGET(editwin->sci));
sync_to_current(editwin->sci, editor->sci); + + gtk_label_set_text(GTK_LABEL(editwin->name_label), DOC_FILENAME(editor->document)); }
@@ -262,6 +264,7 @@ gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(tool_item));
item = gtk_label_new(NULL); + gtk_label_set_ellipsize(GTK_LABEL(item), PANGO_ELLIPSIZE_START); gtk_container_add(GTK_CONTAINER(tool_item), item); edit_window.name_label = item;
@@ -325,6 +328,7 @@
gtk_widget_destroy(pane); edit_window.editor = NULL; + edit_window.sci = NULL; gtk_widget_reparent(notebook, parent); }
@@ -364,9 +368,18 @@ on_unsplit(NULL, NULL); }
+ +static void on_document_save(GObject *obj, GeanyDocument *doc, gpointer user_data) +{ + /* update filename */ + gtk_label_set_text(GTK_LABEL(edit_window.name_label), DOC_FILENAME(doc)); +} + + PluginCallback plugin_callbacks[] = { { "document-close", (GCallback) &on_document_close, FALSE, NULL }, + { "document-save", (GCallback) &on_document_save, FALSE, NULL }, { NULL, NULL, FALSE, NULL } };
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.