[Gpredict-svn] SF.net SVN: gpredict:[930] trunk
Real time satellite tracking and orbit prediction
Status: Beta
Brought to you by:
csete
|
From: <aa...@us...> - 2011-10-13 11:01:55
|
Revision: 930
http://gpredict.svn.sourceforge.net/gpredict/?rev=930&view=rev
Author: aa1vs
Date: 2011-10-13 11:01:45 +0000 (Thu, 13 Oct 2011)
Log Message:
-----------
Add currently shown file name in title.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/sat-log-browser.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2011-10-13 10:46:24 UTC (rev 929)
+++ trunk/ChangeLog 2011-10-13 11:01:45 UTC (rev 930)
@@ -6,6 +6,10 @@
* src/gtk-polar-view-popup.c
Eliminate unused variables to clean compiler output.
+ * ChangeLog
+ * src/sat-log-browser.c
+ Add currently shown file name in title.
+
2011-10-12 Charles Suprin <hamaa1vs at gmail.com>
* ChangeLog
Modified: trunk/src/sat-log-browser.c
===================================================================
--- trunk/src/sat-log-browser.c 2011-10-13 10:46:24 UTC (rev 929)
+++ trunk/src/sat-log-browser.c 2011-10-13 11:01:45 UTC (rev 930)
@@ -134,6 +134,8 @@
GtkWidget *hbox;
gchar *fname;
gchar *confdir;
+ gchar *title;
+ gint error; /* error code returned by by read_debug_file */
if (!initialised) {
@@ -185,12 +187,22 @@
"logs", G_DIR_SEPARATOR_S,
"gpredict.log", NULL);
- read_debug_file (fname);
+ error = read_debug_file (fname);
+
+ if (error == 0) {
+ /* update window title if file read cleanly */
+ title = g_strdup_printf ( _("Log Browser: %s"), fname);
+ gtk_window_set_title (GTK_WINDOW(window), title);
+
+ g_free(title);
+ } else {
+ /* Remove filename if file not read */
+ gtk_window_set_title (GTK_WINDOW(window), _("Log Browser"));
+ }
+
g_free (fname);
g_free (confdir);
- /*** FIXME: add currently shown file name in title; chech read_debug_file status */
-
initialised = TRUE;
}
}
@@ -376,6 +388,7 @@
{
gchar *confdir;
gchar *filename;
+ gchar *title;
gint error; /* error code returned by by read_debug_file */
@@ -404,9 +417,16 @@
/* sanity check of filename will be performed
in read_debug_file */
error = read_debug_file (filename);
+ if (error == 0){
+ /* Update title with filename */
+ title = g_strdup_printf ( _("Log Browser: %s"), filename);
+ gtk_window_set_title (GTK_WINDOW(window), title);
+ g_free(title);
+ } else {
+ /* clear filename from title if unable to read file */
+ gtk_window_set_title (GTK_WINDOW(window), _("Log Browser"));
+ }
- /*** FIXME: add currently shown file name in title; chech read_debug_file status */
-
g_free (filename);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|