mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Desktop: Add Meaningful Error Messages for libdivecomputer Dump.
Add meaningful error messages when creating a libdivecomputer dump. In particular show if creating a dump is not supported on the dive computer that is used. Signed-off-by: Michael Keller <github@ike.ch>
This commit is contained in:
		
							parent
							
								
									a0cb6ad6d7
								
							
						
					
					
						commit
						b0d5b23227
					
				
					 1 changed files with 14 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -1138,14 +1138,24 @@ static const char *do_device_import(device_data_t *data)
 | 
			
		|||
		}
 | 
			
		||||
 | 
			
		||||
		dc_buffer_free(buffer);
 | 
			
		||||
	} else {
 | 
			
		||||
		rc = dc_device_foreach(device, dive_cb, data);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
		if (rc != DC_STATUS_SUCCESS) {
 | 
			
		||||
			progress_bar_fraction = 0.0;
 | 
			
		||||
 | 
			
		||||
			if (rc == DC_STATUS_UNSUPPORTED)
 | 
			
		||||
				return translate("gettextFromC", "Dumping not supported on this device");
 | 
			
		||||
 | 
			
		||||
			return translate("gettextFromC", "Dive data dumping error");
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		rc = dc_device_foreach(device, dive_cb, data);
 | 
			
		||||
 | 
			
		||||
		if (rc != DC_STATUS_SUCCESS) {
 | 
			
		||||
			progress_bar_fraction = 0.0;
 | 
			
		||||
 | 
			
		||||
			return translate("gettextFromC", "Dive data import error");
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	/* All good */
 | 
			
		||||
	return NULL;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue