Revision: 469
Author: ntrel
Date: 2006-06-20 07:54:09 -0700 (Tue, 20 Jun 2006)
ViewCVS: http://svn.sourceforge.net/geany/?rev=469&view=rev
Log Message:
-----------
Also show status messages on the status bar
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/document.c
trunk/src/msgwindow.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-06-20 11:55:34 UTC (rev 468)
+++ trunk/ChangeLog 2006-06-20 14:54:09 UTC (rev 469)
@@ -4,6 +4,8 @@
src/document.h: Go back to the same line when reloading.
Fix start selection bug when clicking in the
current file if it has changed.
+ * src/msgwindow.c, src/document.c:
+ Also show status messages on the status bar.
2006-06-19 Enrico Troeger <enrico.troeger(a)uvena.de>
Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c 2006-06-20 11:55:34 UTC (rev 468)
+++ trunk/src/document.c 2006-06-20 14:54:09 UTC (rev 469)
@@ -529,12 +529,8 @@
sci_goto_pos(doc_list[idx].sci, pos, TRUE);
- if (reload)
+ if (! reload)
{
- msgwin_status_add(_("File %s reloaded."), utf8_filename);
- }
- else
- {
filetype *use_ft = (ft != NULL) ? ft : filetypes_get_from_filename(utf8_filename);
if (readonly) gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
@@ -555,10 +551,18 @@
document_set_filetype(idx, use_ft);
utils_build_show_hide(idx);
+ }
+
+ // update sci to send SCN_UPDATEUI before we set status messages
+ while (gtk_events_pending())
+ gtk_main_iteration();
+ if (reload)
+ msgwin_status_add(_("File %s reloaded."), utf8_filename);
+ else
msgwin_status_add(_("File %s opened(%d%s)."),
utf8_filename, gtk_notebook_get_n_pages(GTK_NOTEBOOK(app->notebook)),
(readonly) ? _(", read-only") : "");
- }
+
document_set_text_changed(idx);
g_free(data);
Modified: trunk/src/msgwindow.c
===================================================================
--- trunk/src/msgwindow.c 2006-06-20 11:55:34 UTC (rev 468)
+++ trunk/src/msgwindow.c 2006-06-20 14:54:09 UTC (rev 469)
@@ -174,6 +174,10 @@
g_vsnprintf(string, 511, format, args);
va_end(args);
+ // display status message in status bar
+ gtk_statusbar_pop(GTK_STATUSBAR(app->statusbar), 1);
+ gtk_statusbar_push(GTK_STATUSBAR(app->statusbar), 1, string);
+
gtk_list_store_append(msgwindow.store_status, &iter);
//gtk_list_store_insert(msgwindow.store_status, &iter, 0);
//gtk_list_store_set(msgwindow.store_status, &iter, 0, (state > 0) ? &white : &dark, 1, string, -1);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
Revision: 462
Author: ntrel
Date: 2006-06-19 06:27:09 -0700 (Mon, 19 Jun 2006)
ViewCVS: http://svn.sourceforge.net/geany/?rev=462&view=rev
Log Message:
-----------
Don't open files or go to errors automatically whilst compiling. Rename utils_goto_workspace_tag to utils_goto_file_line
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/build.c
trunk/src/callbacks.c
trunk/src/utils.c
trunk/src/utils.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2006-06-18 20:21:19 UTC (rev 461)
+++ trunk/ChangeLog 2006-06-19 13:27:09 UTC (rev 462)
@@ -1,3 +1,10 @@
+2006-06-19 Nick Treleaven <nick.treleaven(a)btinternet.com>
+
+ * src/build.c, src/utils.c, src/utils.h, src/callbacks.c:
+ Don't open files or go to errors automatically whilst compiling.
+ Rename utils_goto_workspace_tag to utils_goto_file_line.
+
+
2006-06-18 Enrico Troeger <enrico.troeger(a)uvena.de>
* src/keybindings.c: Fixed a segfault when pressing shortcut for
Modified: trunk/src/build.c
===================================================================
--- trunk/src/build.c 2006-06-18 20:21:19 UTC (rev 461)
+++ trunk/src/build.c 2006-06-19 13:27:09 UTC (rev 462)
@@ -449,7 +449,6 @@
//GIOStatus s;
gchar *msg;
guint x = 1;
- gint line, idx;
while (g_io_channel_read_line(ioc, &msg, NULL, NULL, NULL) && msg)
{
@@ -459,8 +458,16 @@
msgwin_compiler_add(COLOR_RED, FALSE, g_strstrip(msg));
if (app->pref_editor_use_indicators)
{
- utils_parse_compiler_error_line(g_strstrip(msg), &idx, &line);
- if (line != -1) document_set_indicator(idx, line - 1);
+ gchar *filename;
+ gint line;
+ utils_parse_compiler_error_line(g_strstrip(msg), &filename, &line);
+ if (line != -1)
+ {
+ gint idx = document_find_by_filename(filename, FALSE);
+ // document_set_indicator will check valid idx
+ document_set_indicator(idx, line - 1);
+ }
+ g_free(filename);
}
}
else
Modified: trunk/src/callbacks.c
===================================================================
--- trunk/src/callbacks.c 2006-06-18 20:21:19 UTC (rev 461)
+++ trunk/src/callbacks.c 2006-06-19 13:27:09 UTC (rev 462)
@@ -1304,7 +1304,7 @@
{
if (utils_strcmp(TM_TAG(tags->pdata[i])->name, current_word))
{
- if (! utils_goto_workspace_tag(
+ if (! utils_goto_file_line(
TM_TAG(tags->pdata[i])->atts.entry.file->work_object.file_name,
TRUE,
TM_TAG(tags->pdata[i])->atts.entry.line))
@@ -1361,7 +1361,7 @@
gtk_tree_model_get(model, &iter, 0, &line, 1, &file, -1);
if (file && strlen (file) > 0)
{
- utils_goto_workspace_tag(file, FALSE, line);
+ utils_goto_file_line(file, FALSE, line);
}
g_free(file);
}
@@ -1383,8 +1383,18 @@
{
gint line;
gint idx;
- utils_parse_compiler_error_line(string, &idx, &line);
- if (idx != -1 && line != -1) utils_goto_line(idx, line);
+ gchar *filename;
+ utils_parse_compiler_error_line(string, &filename, &line);
+ if (filename != NULL && line > -1)
+ {
+ // use document_open_file to find an already open file, or open it in place
+ idx = document_open_file(-1, filename, 0, FALSE, NULL);
+ // document_set_indicator will check valid idx
+ document_set_indicator(idx, line - 1);
+ // utils_goto_file_line will check valid filename.
+ utils_goto_file_line(filename, FALSE, line);
+ }
+ g_free(filename);
}
g_free(string);
}
Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c 2006-06-18 20:21:19 UTC (rev 461)
+++ trunk/src/utils.c 2006-06-19 13:27:09 UTC (rev 462)
@@ -447,7 +447,7 @@
}
-gboolean utils_goto_workspace_tag(const gchar *file, gboolean is_tm_filename, gint line)
+gboolean utils_goto_file_line(const gchar *file, gboolean is_tm_filename, gint line)
{
gint page_num;
gint file_idx = document_find_by_filename(file, is_tm_filename);
@@ -2299,22 +2299,22 @@
/* try to parse the file and line number where the error occured described in line
- * and when something useful is found, it stores the line number in *line and the index of
- * the file in *idx_of_error_file. */
-void utils_parse_compiler_error_line(const gchar *string, gint *idx_of_error_file, gint *line)
+ * and when something useful is found, it stores the line number in *line and the
+ * relevant file with the error in *filename.
+ * *line will be -1 if no error was found in string.
+ * *filename must be freed unless it is NULL. */
+void utils_parse_compiler_error_line(const gchar *string, gchar **filename, gint *line)
{
- gint idx = document_get_cur_idx();
gchar *end = NULL;
gchar *path;
- gchar *filename;
gchar **fields;
gchar *pattern; // pattern to split the error message into some fields
guint field_min_len; // used to detect errors after parsing
guint field_idx_line; // idx of the field where the line is
guint field_idx_file; // idx of the field where the filename is
+ *filename = NULL;
*line = -1;
- *idx_of_error_file = -1;
if (string == NULL || ! doc_list[app->cur_idx].is_valid ||
doc_list[app->cur_idx].file_type == NULL)
@@ -2399,20 +2399,8 @@
// get the basename of the built file to get the path to look for other files
path = g_path_get_dirname(doc_list[app->cur_idx].file_name);
- filename = g_strconcat(path, G_DIR_SEPARATOR_S, fields[field_idx_file], NULL);
-
- // use document_open_file to find an already opened file, or to open it in place
- *idx_of_error_file = document_open_file(-1, filename, 0, FALSE, NULL);
-
+ *filename = g_strconcat(path, G_DIR_SEPARATOR_S, fields[field_idx_file], NULL);
g_free(path);
- g_free(filename);
- if (*idx_of_error_file != -1 && doc_list[*idx_of_error_file].is_valid &&
- *line == -1 && idx != *idx_of_error_file)
- {
- gtk_notebook_set_current_page(GTK_NOTEBOOK(app->notebook),
- gtk_notebook_page_num(GTK_NOTEBOOK(app->notebook),
- GTK_WIDGET(doc_list[*idx_of_error_file].sci)));
- }
g_strfreev(fields);
}
Modified: trunk/src/utils.h
===================================================================
--- trunk/src/utils.h 2006-06-18 20:21:19 UTC (rev 461)
+++ trunk/src/utils.h 2006-06-19 13:27:09 UTC (rev 462)
@@ -59,7 +59,7 @@
gint utils_get_local_tag(gint idx, const gchar *qual_name);
-gboolean utils_goto_workspace_tag(const gchar *file, gboolean is_tm_filename, gint line);
+gboolean utils_goto_file_line(const gchar *file, gboolean is_tm_filename, gint line);
gboolean utils_goto_line(gint idx, gint line);
@@ -207,8 +207,10 @@
double utils_strtod(const char *source, char **end);
/* try to parse the file and line number where the error occured described in line
- * and when something useful is found, it stores the line number in *line and the index of
- * the file in *idx_of_error_file. */
-void utils_parse_compiler_error_line(const gchar *string, gint *idx_of_error_file, gint *line);
+ * and when something useful is found, it stores the line number in *line and the
+ * relevant file with the error in filename.
+ * *line will be -1 if no error was found in string.
+ * filename must be freed unless it is NULL. */
+void utils_parse_compiler_error_line(const gchar *string, gchar **filename, gint *line);
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.