Index: src/mlx/gui/flight.py
===================================================================
--- src/mlx/gui/flight.py	(revision 391)
+++ src/mlx/gui/flight.py	(revision 393)
@@ -15,4 +15,5 @@
 import datetime
 import time
+import os
 
 #-----------------------------------------------------------------------------
@@ -2872,4 +2873,14 @@
                      self._gate.get_active()>=0)
 
+        wasSensitive = self._saveButton.get_sensitive()
+
+        gui = self._wizard.gui
+        config = gui.config
+        if config.pirepAutoSave and sensitive and not wasSensitive:
+            self._lastSavePath = os.path.join(config.pirepDirectory,
+                                              self._getDefaultPIREPName())
+            self._lastSavePath = text2unicode(self._lastSavePath)
+            self._savePIREP(automatic = True)
+
         self._saveButton.set_sensitive(sensitive)
         self._sendButton.set_sensitive(sensitive and
@@ -2903,18 +2914,24 @@
         gui.reset()
 
+    def _getDefaultPIREPName(self):
+        """Get the default name of the PIREP."""
+        gui = self._wizard.gui
+
+        bookedFlight = gui.bookedFlight
+        tm = time.gmtime()
+
+        pilotID = self._wizard.pilotID
+        if pilotID: pilotID += " "
+        return "%s%s %02d%02d %s-%s.pirep" % \
+               (pilotID, str(bookedFlight.departureTime.date()),
+                tm.tm_hour, tm.tm_min,
+                bookedFlight.departureICAO, bookedFlight.arrivalICAO)
+
+
     def _saveClicked(self, button):
         """Called when the Save PIREP button is clicked."""
         gui = self._wizard.gui
 
-        bookedFlight = gui.bookedFlight
-        tm = time.gmtime()
-
-        pilotID = self._wizard.pilotID
-        if pilotID: pilotID += " "
-        fileName = "%s%s %02d%02d %s-%s.pirep" % \
-                   (pilotID, str(bookedFlight.departureTime.date()),
-                    tm.tm_hour, tm.tm_min,
-                    bookedFlight.departureICAO,
-                    bookedFlight.arrivalICAO)
+        fileName = self._getDefaultPIREPName()
 
         dialog = self._getSaveDialog()
@@ -2932,27 +2949,43 @@
 
         if result==RESPONSETYPE_OK:
-            pirep = PIREP(gui.flight)
-
             self._lastSavePath = text2unicode(dialog.get_filename())
-
-            if pirep.save(self._lastSavePath):
-                type = MESSAGETYPE_INFO
-                message = xstr("finish_save_done")
+            self._savePIREP()
+
+    def _savePIREP(self, automatic = False):
+        """Perform the saving of the PIREP."""
+
+        gui = self._wizard.gui
+
+        if automatic:
+            gui.beginBusy(xstr("finish_autosave_busy"))
+
+        pirep = PIREP(gui.flight)
+        error = pirep.save(self._lastSavePath)
+
+        if automatic:
+            gui.endBusy()
+
+        if error:
+            type = MESSAGETYPE_ERROR
+            message = xstr("finish_save_failed")
+            secondary = xstr("finish_save_failed_sec") % (text2unicode(error),)
+        else:
+            type = MESSAGETYPE_INFO
+            message = xstr("finish_save_done")
+            if automatic:
+                secondary = xstr("finish_save_done_sec") % (self._lastSavePath,)
+            else:
                 secondary = None
-                self._pirepSaved = True
-            else:
-                type = MESSAGETYPE_ERROR
-                message = xstr("finish_save_failed")
-                secondary = xstr("finish_save_failed_sec")
-
-            dialog = gtk.MessageDialog(parent = gui.mainWindow,
-                                       type = type, message_format = message)
-            dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
-            dialog.set_title(WINDOW_TITLE_BASE)
-            if secondary is not None:
-                dialog.format_secondary_markup(secondary)
-
-            dialog.run()
-            dialog.hide()
+            self._pirepSaved = True
+
+        dialog = gtk.MessageDialog(parent = gui.mainWindow,
+                                   type = type, message_format = message)
+        dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+        dialog.set_title(WINDOW_TITLE_BASE)
+        if secondary is not None:
+            dialog.format_secondary_markup(secondary)
+
+        dialog.run()
+        dialog.hide()
 
     def _getSaveDialog(self):
