comparison 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
comparison
equal deleted inserted replaced
319:2ad0b9a00fdd 320:853981bbd4d7
1273 gtk_ctree_remove_node (GTK_CTREE (dlwdw), tdata->user_data); 1273 gtk_ctree_remove_node (GTK_CTREE (dlwdw), tdata->user_data);
1274 } 1274 }
1275 1275
1276 pthread_mutex_lock (&transfer_mutex); 1276 pthread_mutex_lock (&transfer_mutex);
1277 gftp_file_transfers = g_list_remove_link (gftp_file_transfers, node); 1277 gftp_file_transfers = g_list_remove_link (gftp_file_transfers, node);
1278 gdk_window_set_title (gtk_widget_get_parent_window (GTK_WIDGET(dlwdw)),
1279 gftp_version);
1278 pthread_mutex_unlock (&transfer_mutex); 1280 pthread_mutex_unlock (&transfer_mutex);
1279 1281
1280 free_tdata (tdata); 1282 free_tdata (tdata);
1281 } 1283 }
1282 1284
1315 1317
1316 1318
1317 static void 1319 static void
1318 update_file_status (gftp_transfer * tdata) 1320 update_file_status (gftp_transfer * tdata)
1319 { 1321 {
1320 char totstr[100], dlstr[100], gotstr[50], ofstr[50]; 1322 char totstr[100], dlstr[100], winstr[150], gotstr[50], ofstr[50];
1321 int hours, mins, secs, pcent, st; 1323 int hours, mins, secs, pcent, st, show_trans_in_title;
1322 unsigned long remaining_secs, lkbs; 1324 unsigned long remaining_secs, lkbs;
1323 gftp_file * tempfle; 1325 gftp_file * tempfle;
1324 struct timeval tv; 1326 struct timeval tv;
1325 1327
1326 g_static_mutex_lock (&tdata->statmutex); 1328 g_static_mutex_lock (&tdata->statmutex);
1327 tempfle = tdata->curfle->data; 1329 tempfle = tdata->curfle->data;
1328 1330
1329 gettimeofday (&tv, NULL); 1331 gettimeofday (&tv, NULL);
1330 1332
1397 } 1399 }
1398 1400
1399 g_static_mutex_unlock (&tdata->statmutex); 1401 g_static_mutex_unlock (&tdata->statmutex);
1400 1402
1401 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tdata->user_data, 1, totstr); 1403 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tdata->user_data, 1, totstr);
1404
1405 gftp_lookup_global_option ("show_trans_in_title", &show_trans_in_title);
1406 if (gftp_file_transfers->data == tdata && show_trans_in_title)
1407 {
1408 g_snprintf (winstr, sizeof(winstr), "%s: %s", gftp_version, totstr);
1409 gdk_window_set_title (gtk_widget_get_parent_window (GTK_WIDGET(dlwdw)),
1410 winstr);
1411 }
1402 1412
1403 if (*dlstr != '\0') 1413 if (*dlstr != '\0')
1404 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tempfle->user_data, 1, dlstr); 1414 gtk_ctree_node_set_text (GTK_CTREE (dlwdw), tempfle->user_data, 1, dlstr);
1405 } 1415 }
1406 1416