diff src/gtk/transfer.c @ 320:853981bbd4d7

2003-11-30 Brian Masney <masneyb@gftp.org> * src/gtk/transfer.c - shows status information in title bar. (patch from Jamil Geor <jamil_geor@yahoo.co.nz>, cleaned up by me some) * lib/options.h - added show_trans_in_title option. 2003-11-25 Brian Masney <masneyb@gftp.org> * lib/misc.c (gftp_locale_init) - call bindtextdomain() so that the directory is setup properly * lib/misc.c lib/gftp.h lib/config_file.c - move copyfile() to config_file.c and declare it to be static. On the destination file, set the flag O_EXCL
author masneyb
date Sun, 30 Nov 2003 19:35:24 +0000
parents 2ad0b9a00fdd
children cdabbe5c9a95
line wrap: on
line diff
--- a/src/gtk/transfer.c	Sun Nov 23 15:52:22 2003 +0000
+++ b/src/gtk/transfer.c	Sun Nov 30 19:35:24 2003 +0000
@@ -1275,6 +1275,8 @@
 
   pthread_mutex_lock (&transfer_mutex);
   gftp_file_transfers = g_list_remove_link (gftp_file_transfers, node);
+  gdk_window_set_title (gtk_widget_get_parent_window (GTK_WIDGET(dlwdw)),
+                        gftp_version);
   pthread_mutex_unlock (&transfer_mutex);
 
   free_tdata (tdata);
@@ -1317,12 +1319,12 @@
 static void
 update_file_status (gftp_transfer * tdata)
 {
-  char totstr[100], dlstr[100], gotstr[50], ofstr[50];
-  int hours, mins, secs, pcent, st;
+  char totstr[100], dlstr[100], winstr[150], gotstr[50], ofstr[50];
+  int hours, mins, secs, pcent, st, show_trans_in_title;
   unsigned long remaining_secs, lkbs;
   gftp_file * tempfle;
   struct timeval tv;
-
+  
   g_static_mutex_lock (&tdata->statmutex);
   tempfle = tdata->curfle->data;
 
@@ -1399,6 +1401,14 @@
   g_static_mutex_unlock (&tdata->statmutex);
 
   gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tdata->user_data, 1, totstr);
+  
+  gftp_lookup_global_option ("show_trans_in_title", &show_trans_in_title);
+  if (gftp_file_transfers->data == tdata && show_trans_in_title)
+    {
+      g_snprintf (winstr, sizeof(winstr),  "%s: %s", gftp_version, totstr);
+      gdk_window_set_title (gtk_widget_get_parent_window (GTK_WIDGET(dlwdw)),
+                            winstr);
+    }
 
   if (*dlstr != '\0')
     gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tempfle->user_data, 1, dlstr);