First commit will fix a crash in the GUI when "Export G-code" is selected but there are no objects on the plater.
I've also done some very simple improvements in retraction handling - to allow specifying retraction length for layer changes specifically, and to make retraction for travel moves shorter than retract_before_travel proportional to travel length. Shorter retraction means less melting of surrounding plastic, so it would be best to retract only just enough.
Fix crash when g-code generation is triggered but no objects are loaded.
Allow specifying retraction length for layer changes.
Implement retraction proportional to travel length
don't wipe when it's disabled
The "Export G-code" button is not clickable when there are no objects on the plater. Is it clickable for you? If so, it's a bug and it needs to be fixed. What operating system and wxWidgets version are you running?
Gentoo Linux, wxGTK-188.8.131.52, wxperl-0.991.700, perl-5.16.3. This may be related to issue #1078. Yes, I know that "Running Slic3r under Perl >= 5.16 is not supported nor recommended", but if this has something to do with that, please consider this a request to add that support :)
I can't reproduce that bug on my Linux machines, but I only use the more recent wxWidgets 2.9.x. If it happens to be clickable for you, that problem must be addressed either by fixing the bug if it's in Slic3r or by reporting the issue to the wxWidgets developers. The proposed workaround is not the right solution for the problem, as the button is not supposed to be clickable when no objects are on plater.
Regarding the other ideas, they would break existing behavior. Making shorter retractions is an interesting idea and might need some testing, but it can't be implemented in this way – you have no idea about what my mailbox could be if I merged this. :)