Revision: 1913 http://geany.svn.sourceforge.net/geany/?rev=1913&view=rev Author: ntrel Date: 2007-09-27 04:39:21 -0700 (Thu, 27 Sep 2007)
Log Message: ----------- Don't show file opened/saved/closed messages on the status bar. Add temporary function msgwin_status_add_new() for v0.12 (to avoid many code changes updating msgwin_status_add() before the release).
Modified Paths: -------------- trunk/ChangeLog trunk/NEWS trunk/src/document.c trunk/src/msgwindow.c trunk/src/plugins.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2007-09-27 11:29:54 UTC (rev 1912) +++ trunk/ChangeLog 2007-09-27 11:39:21 UTC (rev 1913) @@ -9,6 +9,10 @@ * src/keybindings.c: Add enable_vte_bash_keys keybindings.conf hidden pref in [Settings]. Refactor keybindings_init(). + * src/msgwindow.c, src/document.c, src/plugins.c, NEWS: + Don't show file opened/saved/closed messages on the status bar. + Add temporary function msgwin_status_add_new() for v0.12 (to avoid + many code changes updating msgwin_status_add() before the release).
2007-09-26 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
Modified: trunk/NEWS =================================================================== --- trunk/NEWS 2007-09-27 11:29:54 UTC (rev 1912) +++ trunk/NEWS 2007-09-27 11:39:21 UTC (rev 1913) @@ -48,7 +48,8 @@ * Added hidden editor preference 'use_gtk_word_boundaries'. * Added auto_complete_whilst_editing hidden preference. * Speed up Save All for C-like files. - Thanks also to Christoph Berg for updating the main window icon. + * Don't show file opened/saved/closed messages on the status bar. + (Thanks also to Christoph Berg for updating the icon code).
Docs: * Added Plugins section.
Modified: trunk/src/document.c =================================================================== --- trunk/src/document.c 2007-09-27 11:29:54 UTC (rev 1912) +++ trunk/src/document.c 2007-09-27 11:39:21 UTC (rev 1913) @@ -80,6 +80,8 @@ static gboolean delay_colourise = FALSE;
+void msgwin_status_add_new(const gchar *format, ...) G_GNUC_PRINTF(1, 2); // temporary for v0.12 + static void document_undo_clear(gint idx); static void document_redo_add(gint idx, guint type, gpointer data);
@@ -464,7 +466,7 @@ } notebook_remove_page(page_num); treeviews_remove_document(idx); - msgwin_status_add(_("File %s closed."), DOC_FILENAME(idx)); + msgwin_status_add_new(_("File %s closed."), DOC_FILENAME(idx)); g_free(doc_list[idx].encoding); g_free(doc_list[idx].saved_encoding.encoding); g_free(doc_list[idx].file_name); @@ -562,7 +564,7 @@ g_signal_emit_by_name(geany_object, "document-new", idx); }
- msgwin_status_add(_("New file "%s" opened."), + msgwin_status_add_new(_("New file "%s" opened."), (doc_list[idx].file_name != NULL) ? doc_list[idx].file_name : GEANY_STRING_UNTITLED);
return idx; @@ -962,7 +964,7 @@ if (reload) msgwin_status_add(_("File %s reloaded."), utf8_filename); else - msgwin_status_add(_("File %s opened(%d%s)."), + msgwin_status_add_new(_("File %s opened(%d%s)."), utf8_filename, gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)), (readonly) ? _(", read-only") : "");
@@ -1218,7 +1220,7 @@ tm_workspace_update(TM_WORK_OBJECT(app->tm_workspace), TRUE, TRUE, FALSE); gtk_label_set_text(GTK_LABEL(doc_list[idx].tab_label), base_name); gtk_label_set_text(GTK_LABEL(doc_list[idx].tabmenu_label), base_name); - msgwin_status_add(_("File %s saved."), doc_list[idx].file_name); + msgwin_status_add_new(_("File %s saved."), doc_list[idx].file_name); ui_update_statusbar(idx, -1); g_free(base_name); #ifdef HAVE_VTE
Modified: trunk/src/msgwindow.c =================================================================== --- trunk/src/msgwindow.c 2007-09-27 11:29:54 UTC (rev 1912) +++ trunk/src/msgwindow.c 2007-09-27 11:39:21 UTC (rev 1913) @@ -290,6 +290,27 @@ }
+/* Log a status message *without* setting the status bar. + * This is a temporary function for the plugin API for Geany 0.12. + * In future, msgwin_status_add() will act like this. */ +void msgwin_status_add_new(const gchar *format, ...) +{ + gchar string[512]; + va_list args; + gboolean suppress; + + va_start(args, format); + g_vsnprintf(string, 512, format, args); + va_end(args); + + // hack to prevent setting the status bar + suppress = prefs.suppress_status_messages; + prefs.suppress_status_messages = TRUE; + msgwin_status_add("%s", string); + prefs.suppress_status_messages = suppress; +} + + // logs a status message (use ui_set_statusbar() to just display text on the statusbar) void msgwin_status_add(const gchar *format, ...) {
Modified: trunk/src/plugins.c =================================================================== --- trunk/src/plugins.c 2007-09-27 11:29:54 UTC (rev 1912) +++ trunk/src/plugins.c 2007-09-27 11:39:21 UTC (rev 1913) @@ -168,27 +168,10 @@ };
-/* This is a temporary function for the plugin API for Geany 0.12. - * In future, msgwin_status_add() will act like this. */ -static void plugin_msgwin_status_add(const gchar *format, ...) -{ - gchar string[512]; - va_list args; - gboolean suppress; +void msgwin_status_add_new(const gchar *format, ...) G_GNUC_PRINTF(1, 2); // temporary for v0.12
- va_start(args, format); - g_vsnprintf(string, 512, format, args); - va_end(args); - - // hack to prevent setting the status bar - suppress = prefs.suppress_status_messages; - prefs.suppress_status_messages = TRUE; - msgwin_status_add("%s", string); - prefs.suppress_status_messages = suppress; -} - static MsgWinFuncs msgwin_funcs = { - &plugin_msgwin_status_add, + &msgwin_status_add_new, &msgwin_compiler_add_fmt };
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.