changeset 117:c4225dc8e056

Code cleanup and fix whitespace issues caused by my unix editor.
author Brian Smith <brian@dbsoft.org>
date Thu, 14 May 2020 23:55:47 -0500
parents f08240bf90ef
children 4be7ec1391fb
files src/handyftp.c
diffstat 1 files changed, 19 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/handyftp.c	Thu May 14 22:21:44 2020 -0500
+++ b/src/handyftp.c	Thu May 14 23:55:47 2020 -0500
@@ -2181,7 +2181,7 @@
 	dw_box_pack_start(buttonbox, logo, 337, 131, FALSE, FALSE, 2);
 	dw_box_pack_start(buttonbox, 0, 50, 30, TRUE, FALSE, 0);
 
-	stext = dw_text_new("HandyFTP © 2000-2019 Brian Smith", 0);
+	stext = dw_text_new("HandyFTP © 2000-2020 Brian Smith", 0);
 	dw_window_set_style(stext, DW_DT_CENTER | DW_DT_VCENTER, DW_DT_CENTER | DW_DT_VCENTER);
 	dw_box_pack_start(mainbox, stext, 10, 20, TRUE, TRUE, 0);
 
@@ -3240,8 +3240,8 @@
 		{
 			if(threadsite->status != STATUSTRANSMIT && ftd->received >= threadsite->sent)
 			{
-			   HWND notification;
-			   
+				HWND notification;
+
 				if(strcasecmp(threadsite->hostname, "local") == 0)
 				{
 					time_t curtime = time(NULL);
@@ -3263,9 +3263,11 @@
 					ftd->originalcommand = -1;
 					if(curtime-ftd->mytimer == 0)
 						curtime++;
+					/* Update the console with the transfer details */
 					writeconsole(threadsite, locale_string("Transfer completed. %lld bytes received in %d seconds (%.2fK/s).", 101), ftd->received, (int)(curtime - ftd->mytimer), (double)((ftd->received-ftd->filesize)/1024)/((long)curtime-ftd->mytimer));
-					notification = dw_notification_new("Transfer completed.", NULL, locale_string("Transfer completed. %lld bytes received in %d seconds (%.2fK/s).", 101), ftd->received, (int)(curtime - ftd->mytimer), (double)((ftd->received-ftd->filesize)/1024)/((long)curtime-ftd->mytimer));
-					dw_notification_send(notification);
+					/* Also send a system notication that it is complete if possible as well */
+					if((notification = dw_notification_new("Transfer completed.", NULL, locale_string("Transfer completed. %lld bytes received in %d seconds (%.2fK/s).", 101), ftd->received, (int)(curtime - ftd->mytimer), (double)((ftd->received-ftd->filesize)/1024)/((long)curtime-ftd->mytimer))))
+						dw_notification_send(notification);
 					ftd->currentqueuesize = 0;
 					setstatustext(threadsite, locale_string("Local directory, connected.", 44));
 				}
@@ -4801,8 +4803,8 @@
 			
 			if(ftd->transferdone == TRUE && ftd->transmitted >= threadsite->sent)
 			{
-			   HWND notification;
-			   
+				HWND notification;
+
 				if(threadsite->datafd)
 					sockclose(threadsite->datafd);
 				if(ftd->listenfd)
@@ -4811,10 +4813,13 @@
 				set_status(threadsite, STATUSIDLE);
 				if(curtime-ftd->mytimer == 0)
 					curtime++;
+				/* Update the console with the transfer details */
 				writeconsole(threadsite, locale_string("Transfer completed. %lld bytes sent in %d seconds (%.2fK/s).", 138), threadsite->sent, (int)(curtime - ftd->mytimer), (double)((threadsite->sent-ftd->filesize)/1024)/((long)(curtime-ftd->mytimer)));
-			   notification = dw_notification_new("Transfer completed.", NULL, locale_string("Transfer completed. %lld bytes sent in %d seconds (%.2fK/s).", 138), threadsite->sent, (int)(curtime - ftd->mytimer), (double)((threadsite->sent-ftd->filesize)/1024)/((long)(curtime-ftd->mytimer)));
-			   dw_notification_send(notification);
-				
+
+				/* Also send a system notication that it is complete if possible as well */
+				if((notification = dw_notification_new("Transfer completed.", NULL, locale_string("Transfer completed. %lld bytes sent in %d seconds (%.2fK/s).", 138), threadsite->sent, (int)(curtime - ftd->mytimer), (double)((threadsite->sent-ftd->filesize)/1024)/((long)(curtime-ftd->mytimer)))))
+					dw_notification_send(notification);
+
 				setstatustext(threadsite, locale_string("Remote directory, connected.", 38));
 				dw_percent_set_pos(threadsite->percent, 0);
 			}
@@ -6962,10 +6967,10 @@
 {
 	int cx, cy;
 
-   /* Set the application ID so notifications will work */
-   dw_app_id_set("org.dbsoft.handyftp", NULL);
-   
-   /* Then initialize Dynamic Windows */
+	/* Set the application ID so notifications will work */
+	dw_app_id_set("org.dbsoft.handyftp", NULL);
+
+	/* Then initialize Dynamic Windows */
 	dw_init(TRUE, argc, argv);
 
 #ifdef __MAC__