Index: locale/en/mlx.po
===================================================================
--- locale/en/mlx.po	(revision 391)
+++ locale/en/mlx.po	(revision 392)
@@ -1360,4 +1360,10 @@
 msgstr "Select PIREP directory"
 
+msgid "prefs_pirepAutoSave"
+msgstr "Sav_e PIREP automatically"
+
+msgid "prefs_pirepAutoSave_tooltip"
+msgstr "If this is enabled, the PIREP will be automatically saved at the end of the flight, when all mandatory data are present. You can still modify the data later, and save it again manually."
+
 msgid "prefs_frame_gui"
 msgstr "GUI"
Index: locale/hu/mlx.po
===================================================================
--- locale/hu/mlx.po	(revision 391)
+++ locale/hu/mlx.po	(revision 392)
@@ -1402,4 +1402,10 @@
 msgstr "Válaszd ki a PIREP-ek könyvtárát"
 
+msgid "prefs_pirepAutoSave"
+msgstr "PIREP men_tése automatikusan"
+
+msgid "prefs_pirepAutoSave_tooltip"
+msgstr "Ha bekapcsolod, a program automatikusan elmenti a PIREP-et a repülés végén, ha már minden kötelezően megadandó adat ki van töltve. Az adatok a későbbiek során is módosíthatók, és a PIREP kézzel is elmenthető."
+
 msgid "prefs_frame_gui"
 msgstr "Grafikus felület"
Index: src/mlx/config.py
===================================================================
--- src/mlx/config.py	(revision 373)
+++ src/mlx/config.py	(revision 392)
@@ -234,4 +234,5 @@
 
         self._pirepDirectory = None
+        self._pirepAutoSave = False
 
         self._enableSounds = not secondaryInstallation
@@ -453,4 +454,21 @@
             self._pirepDirectory = None if pirepDirectory=="" \
                                    else pirepDirectory
+            if self._pirepDirectory is None:
+                self._pirepAutoSave = False
+            self._modified = True
+
+    @property
+    def pirepAutoSave(self):
+        """Get whether the PIREP should be saved automatically when it becomes
+        saveable."""
+        return self._pirepAutoSave
+
+    @pirepAutoSave.setter
+    def pirepAutoSave(self, pirepAutoSave):
+        """Set whether the PIREP should be saved automatically when it becomes
+        saveable."""
+        pirepAutoSave = pirepAutoSave and self._pirepDirectory is not None
+        if pirepAutoSave!=self._pirepAutoSave:
+            self._pirepAutoSave = pirepAutoSave
             self._modified = True
 
@@ -649,4 +667,9 @@
                                          "pirepDirectory", None)
 
+        self._pirepAutoSave = self._get(config, "general",
+                                        "pirepAutoSave", False)
+        self._pirepAutoSave = self._pirepAutoSave and \
+                              self._pirepAutoSave is not None
+
         self._messageTypeLevels = {}
         for messageType in const.messageTypes:
@@ -720,4 +743,6 @@
         if self._pirepDirectory is not None:
             config.set("general", "pirepDirectory", self._pirepDirectory)
+        config.set("general", "pirepAutoSave",
+                   "yes" if self._pirepAutoSave else "no")
 
         config.add_section(Config._messageTypesSection)
Index: src/mlx/gui/prefs.py
===================================================================
--- src/mlx/gui/prefs.py	(revision 300)
+++ src/mlx/gui/prefs.py	(revision 392)
@@ -25,11 +25,11 @@
     # Constant to denote that the status of the Ctrl modifier is changed
     CHANGED_CTRL = 1
-    
+
     # Constant to denote that the status of the Shift modifier is changed
     CHANGED_SHIFT = 2
-    
+
     # Constant to denote that the value of the key is changed
     CHANGED_KEY = 3
-    
+
     def __init__(self, labelText, tooltips):
         """Construct the hotkey widget.
@@ -42,5 +42,5 @@
         - the shift check box."""
         super(Hotkey, self).__init__()
-        
+
         label = gtk.Label(labelText)
         label.set_use_underline(True)
@@ -56,5 +56,5 @@
         self._ctrl.connect("toggled", self._ctrlToggled)
         self.pack_start(self._ctrl, False, False, 4)
-            
+
         self._shift = gtk.CheckButton("Shift")
         self._shift.set_tooltip_text(tooltips[2])
@@ -121,5 +121,5 @@
             iter = hotkeyModel.get_iter_first()
 
-        self._hotkey.set_active_iter(iter)            
+        self._hotkey.set_active_iter(iter)
 
         self._setting = False
@@ -178,5 +178,5 @@
         self.add_button(xstr("button_ok"), RESPONSETYPE_ACCEPT)
         self.set_resizable(False)
-        
+
         self._gui = gui
         self._settingFromConfig = False
@@ -238,5 +238,5 @@
         self._syncFSTime.set_active(config.syncFSTime)
         self._usingFS2Crew.set_active(config.usingFS2Crew)
-        
+
         self._setSmoothing(self._iasSmoothingEnabled, self._iasSmoothingLength,
                            config.iasSmoothingLength)
@@ -247,4 +247,7 @@
         self._pirepDirectory.set_text("" if pirepDirectory is None
                                       else pirepDirectory)
+        self._pirepAutoSave.set_active(config.pirepAutoSave)
+        if not pirepDirectory:
+            self._pirepAutoSave.set_sensitive(False)
 
         for messageType in const.messageTypes:
@@ -263,5 +266,5 @@
         self._speedbrakeAtTD.set_active(config.speedbrakeAtTD)
 
-        self._enableChecklists.set_active(config.enableChecklists)        
+        self._enableChecklists.set_active(config.enableChecklists)
         self._checklistHotkey.set(config.checklistHotkey)
 
@@ -289,4 +292,5 @@
                                                        self._vsSmoothingLength)
         config.pirepDirectory = text2unicode(self._pirepDirectory.get_text())
+        config.pirepAutoSave = self._pirepAutoSave.get_active()
 
         for messageType in const.messageTypes:
@@ -324,5 +328,5 @@
 
         guiBox = self._createFrame(mainBox, xstr("prefs_frame_gui"))
-        
+
         languageBox = gtk.HBox()
         guiBox.pack_start(languageBox, False, False, 4)
@@ -339,5 +343,5 @@
 
         self._languageComboBox = languageComboBox = \
-            gtk.ComboBox(model = self._languageList)                   
+            gtk.ComboBox(model = self._languageList)
         cell = gtk.CellRendererText()
         languageComboBox.pack_start(cell, True)
@@ -362,5 +366,5 @@
         guiBox.pack_start(self._quitOnClose, False, False, 4)
 
-        onlineBox = self._createFrame(mainBox, xstr("prefs_frame_online"))        
+        onlineBox = self._createFrame(mainBox, xstr("prefs_frame_online"))
 
         self._onlineGateSystem = gtk.CheckButton(xstr("prefs_onlineGateSystem"))
@@ -380,5 +384,5 @@
         self._flareTimeFromFS.set_tooltip_text(xstr("prefs_flaretimeFromFS_tooltip"))
         simulatorBox.pack_start(self._flareTimeFromFS, False, False, 4)
-                                       
+
         self._syncFSTime = gtk.CheckButton(xstr("prefs_syncFSTime"))
         self._syncFSTime.set_use_underline(True)
@@ -390,5 +394,5 @@
         self._usingFS2Crew.set_tooltip_text(xstr("prefs_usingFS2Crew_tooltip"))
         simulatorBox.pack_start(self._usingFS2Crew, False, False, 4)
-        
+
         (iasSmoothingBox, self._iasSmoothingEnabled,
          self._iasSmoothingLength) = \
@@ -412,4 +416,5 @@
         self._pirepDirectory = gtk.Entry()
         self._pirepDirectory.set_tooltip_text(xstr("prefs_pirepDirectory_tooltip"))
+        self._pirepDirectory.connect("changed", self._pirepDirectoryChanged)
         label.set_mnemonic_widget(self._pirepDirectory)
         pirepBox.pack_start(self._pirepDirectory, True, True, 4)
@@ -419,5 +424,10 @@
                                            self._pirepDirectoryButtonClicked)
         pirepBox.pack_start(self._pirepDirectoryButton, False, False, 4)
-        
+
+        self._pirepAutoSave = gtk.CheckButton(xstr("prefs_pirepAutoSave"))
+        self._pirepAutoSave.set_use_underline(True)
+        self._pirepAutoSave.set_tooltip_text(xstr("prefs_pirepAutoSave_tooltip"))
+        mainBox.pack_start(self._pirepAutoSave, False, False, 0)
+
         return mainAlignment
 
@@ -482,5 +492,5 @@
 
     def _getLanguage(self):
-        """Get the language selected by the user."""        
+        """Get the language selected by the user."""
         iter = self._languageComboBox.get_active_iter()
         (lang,) = self._languageList.get(iter, 1)
@@ -514,5 +524,5 @@
         smoothingEnabled.set_active(smoothing>=2)
         smoothingLength.set_value(abs(smoothing))
-        
+
     def _getSmoothing(self, smoothingEnabled, smoothingLength):
         """Get the smoothing value from the given controls.
@@ -524,5 +534,5 @@
             value *= -1
         return value
-        
+
     def _pirepDirectoryButtonClicked(self, button):
         """Called when the PIREP directory button is clicked."""
@@ -539,5 +549,5 @@
         if directory:
             dialog.select_filename(directory)
-        
+
         result = dialog.run()
         dialog.hide()
@@ -545,5 +555,13 @@
         if result==RESPONSETYPE_OK:
             self._pirepDirectory.set_text(text2unicode(dialog.get_filename()))
-        
+
+    def _pirepDirectoryChanged(self, entry):
+        """Called when the PIREP directory is changed."""
+        if self._pirepDirectory.get_text():
+            self._pirepAutoSave.set_sensitive(True)
+        else:
+            self._pirepAutoSave.set_active(False)
+            self._pirepAutoSave.set_sensitive(False)
+
     def _buildMessages(self):
         """Build the page for the message settings."""
@@ -561,10 +579,10 @@
         table.set_homogeneous(False)
         mainBox.pack_start(table, False, False, 4)
-        
+
         label = gtk.Label(xstr("prefs_msgs_fs"))
         label.set_justify(JUSTIFY_CENTER)
         label.set_alignment(0.5, 1.0)
         table.attach(label, 1, 2, 0, 1)
-        
+
         label = gtk.Label(xstr("prefs_msgs_sound"))
         label.set_justify(JUSTIFY_CENTER)
@@ -573,5 +591,5 @@
 
         self._msgFSCheckButtons = {}
-        self._msgSoundCheckButtons = {}        
+        self._msgSoundCheckButtons = {}
         row = 1
         for messageType in const.messageTypes:
@@ -589,10 +607,10 @@
             table.attach(alignment, 1, 2, row, row+1)
             self._msgFSCheckButtons[messageType] = fsCheckButton
-            
+
             soundCheckButton = gtk.CheckButton()
             alignment = gtk.Alignment(xscale = 0.0, yscale = 0.0,
                                       xalign = 0.5, yalign = 0.5)
             alignment.add(soundCheckButton)
-            table.attach(alignment, 2, 3, row, row+1)            
+            table.attach(alignment, 2, 3, row, row+1)
             self._msgSoundCheckButtons[messageType] = soundCheckButton
 
@@ -665,5 +683,5 @@
                                     xstr("prefs_sounds_pilotHotkeyCtrl_tooltip"),
                                     xstr("prefs_sounds_pilotHotkeyShift_tooltip")])
-        
+
         backgroundBox.pack_start(self._pilotHotkey, False, False, 4)
 
@@ -672,5 +690,5 @@
         self._enableApproachCallouts.set_tooltip_text(xstr("prefs_sounds_approachCallouts_tooltip"))
         backgroundBox.pack_start(self._enableApproachCallouts, False, False, 4)
-        
+
         self._speedbrakeAtTD = gtk.CheckButton(xstr("prefs_sounds_speedbrakeAtTD"))
         self._speedbrakeAtTD.set_use_underline(True)
@@ -689,5 +707,5 @@
         checklistBox = gtk.VBox()
         checklistAlignment.add(checklistBox)
-        
+
         self._enableChecklists = gtk.CheckButton(xstr("prefs_sounds_enableChecklists"))
         self._enableChecklists.set_use_underline(True)
@@ -774,5 +792,5 @@
         self._autoUpdate.set_tooltip_text(xstr("prefs_update_auto_tooltip"))
         self._warnedAutoUpdate = False
-        
+
         updateURLBox = gtk.HBox()
         mainBox.pack_start(updateURLBox, False, False, 4)
@@ -814,5 +832,5 @@
             dialog.hide()
             self._warnedAutoUpdate = True
-            
+
     def _updateURLChanged(self, entry):
         """Called when the update URL is changed."""
