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).


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1913 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Nick Treleaven 2007-09-27 11:39:21 +00:00
parent 86adc018ba
commit 6e4fa68d94
5 changed files with 35 additions and 24 deletions

View File

@ -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>

3
NEWS
View File

@ -48,7 +48,8 @@ Geany 0.12 (TBA)
* 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.

View File

@ -80,6 +80,8 @@ GArray *doc_array;
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 @@ gboolean document_remove(guint page_num)
}
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 @@ gint document_new_file(const gchar *filename, filetype *ft, const gchar *text)
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 @@ gint document_open_file_full(gint idx, const gchar *filename, gint pos, gboolean
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 @@ gboolean document_save_file(gint idx, gboolean force)
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

View File

@ -290,6 +290,27 @@ void msgwin_msg_add(gint msg_color, gint line, gint idx, const gchar *string)
}
/* 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, ...)
{

View File

@ -168,27 +168,10 @@ static SupportFuncs support_funcs = {
};
/* 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;
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;
}
void msgwin_status_add_new(const gchar *format, ...) G_GNUC_PRINTF(1, 2); // temporary for v0.12
static MsgWinFuncs msgwin_funcs = {
&plugin_msgwin_status_add,
&msgwin_status_add_new,
&msgwin_compiler_add_fmt
};