Index: locale/en/mlx.po
===================================================================
--- locale/en/mlx.po	(revision 691)
+++ locale/en/mlx.po	(revision 692)
@@ -741,4 +741,46 @@
 "your files will be able to read it."
 
+msgid "simbrief_progress_searching_browser"
+msgstr "Searching browser..."
+
+msgid "simbrief_progress_loading_form"
+msgstr "Loading form..."
+
+msgid "simbrief_progress_filling_form"
+msgstr "Filling form..."
+
+msgid "simbrief_progress_waiting_login"
+msgstr "Waiting login..."
+
+msgid "simbrief_progress_logging_in"
+msgstr "Logging in..."
+
+msgid "simbrief_progress_waiting_result"
+msgstr "Waiting for the result..."
+
+msgid "simbrief_progress_retrieving_briefing"
+msgstr "Retrieving briefing..."
+
+msgid "simbrief_progress_unknown"
+msgstr "?????"
+
+msgid "simbrief_result_error_other"
+msgstr "Some error occured, see debug logs."
+
+msgid "simbrief_result_error_no_form"
+msgstr "No form could be loaded."
+
+msgid "simbrief_result_error_no_popup"
+msgstr "No login window appeared."
+
+msgid "simbrief_result_login_failed"
+msgstr "Login failed."
+
+msgid "simbrief_result_unknown"
+msgstr "Unknown error occured."
+
+msgid "simbrief_cancelled"
+msgstr "Reverting to the old-style briefing."
+
 msgid "briefing_title"
 msgstr "Briefing (%d/2): %s"
Index: locale/hu/mlx.po
===================================================================
--- locale/hu/mlx.po	(revision 691)
+++ locale/hu/mlx.po	(revision 692)
@@ -739,4 +739,46 @@
 "tároljuk, ezért bárki elolvashatja, aki hozzáfér a fájljaidhoz."
 
+msgid "simbrief_progress_searching_browser"
+msgstr "Böngésző keresése..."
+
+msgid "simbrief_progress_loading_form"
+msgstr "Űrlap letöltése..."
+
+msgid "simbrief_progress_filling_form"
+msgstr "Űrlap kitöltése..."
+
+msgid "simbrief_progress_waiting_login"
+msgstr "Várakozás a bejelentkező ablakra..."
+
+msgid "simbrief_progress_logging_in"
+msgstr "Bejelentkezés..."
+
+msgid "simbrief_progress_waiting_result"
+msgstr "Várakozás az eredményre..."
+
+msgid "simbrief_progress_retrieving_briefing"
+msgstr "Az eligazítás letöltése..."
+
+msgid "simbrief_progress_unknown"
+msgstr "?????"
+
+msgid "simbrief_result_error_other"
+msgstr "Valamilyen hiba történt, lásd a hibanaplót."
+
+msgid "simbrief_result_error_no_form"
+msgstr "Nem sikerült letölteni az űrlapot."
+
+msgid "simbrief_result_error_no_popup"
+msgstr "Nem jelent meg a bejelentkező ablak."
+
+msgid "simbrief_result_login_failed"
+msgstr "A bejelentkezés nem sikerült."
+
+msgid "simbrief_result_unknown"
+msgstr "Ismeretlen hiba történt."
+
+msgid "simbrief_cancelled"
+msgstr "Áttérünk a régi eligazításra."
+
 msgid "briefing_title"
 msgstr "Eligazítás (%d/2): %s"
Index: src/mlx/gui/cef.py
===================================================================
--- src/mlx/gui/cef.py	(revision 685)
+++ src/mlx/gui/cef.py	(revision 692)
@@ -77,4 +77,23 @@
 #------------------------------------------------------------------------------
 
+SIMBRIEF_PROGRESS_SEARCHING_BROWSER = MavaSimbriefIntegrator.PROGRESS_SEARCHING_BROWSER
+SIMBRIEF_PROGRESS_LOADING_FORM = MavaSimbriefIntegrator.PROGRESS_LOADING_FORM
+SIMBRIEF_PROGRESS_FILLING_FORM = MavaSimbriefIntegrator.PROGRESS_FILLING_FORM
+SIMBRIEF_PROGRESS_WAITING_LOGIN = MavaSimbriefIntegrator.PROGRESS_WAITING_LOGIN
+SIMBRIEF_PROGRESS_LOGGING_IN = MavaSimbriefIntegrator.PROGRESS_LOGGING_IN
+SIMBRIEF_PROGRESS_WAITING_RESULT = MavaSimbriefIntegrator.PROGRESS_WAITING_RESULT
+
+SIMBRIEF_PROGRESS_RETRIEVING_BRIEFING = MavaSimbriefIntegrator.PROGRESS_MAX + 1
+SIMBRIEF_PROGRESS_DONE = 1000
+
+SIMBRIEF_RESULT_NONE = MavaSimbriefIntegrator.RESULT_NONE
+SIMBRIEF_RESULT_OK = MavaSimbriefIntegrator.RESULT_OK
+SIMBRIEF_RESULT_ERROR_OTHER = MavaSimbriefIntegrator.RESULT_ERROR_OTHER
+SIMBRIEF_RESULT_ERROR_NO_FORM = MavaSimbriefIntegrator.RESULT_ERROR_NO_FORM
+SIMBRIEF_RESULT_ERROR_NO_POPUP = MavaSimbriefIntegrator.RESULT_ERROR_NO_POPUP
+SIMBRIEF_RESULT_ERROR_LOGIN_FAILED = MavaSimbriefIntegrator.RESULT_ERROR_LOGIN_FAILED
+
+#------------------------------------------------------------------------------
+
 class SeleniumHandler(threading.Thread):
     """Thread to handle Selenium operations."""
@@ -158,10 +177,19 @@
                                        local_html_debug = False)
 
-        updateProgress("Retrieving briefing...", False)
-
-        flight_info = integrator.get_results(link,
-                                             html_file_path = htmlFilePath)
-
-        updateProgress("Done", True)
+        if link is not None:
+            updateProgress(SIMBRIEF_PROGRESS_RETRIEVING_BRIEFING,
+                           SIMBRIEF_RESULT_NONE, None)
+
+            try:
+                flight_info = integrator.get_results(link,
+                                                     html_file_path =
+                                                     htmlFilePath)
+
+                updateProgress(SIMBRIEF_PROGRESS_DONE,
+                               SIMBRIEF_RESULT_OK, flight_info)
+            except Exception, e:
+                print "Failed retrieving the briefing:", e
+                updateProgress(SIMBRIEF_PROGRESS_RETRIEVING_BRIEFING,
+                               SIMBRIEF_RESULT_ERROR_OTHER, None)
 
     def _quit(self):
Index: src/mlx/gui/flight.py
===================================================================
--- src/mlx/gui/flight.py	(revision 691)
+++ src/mlx/gui/flight.py	(revision 692)
@@ -1543,4 +1543,5 @@
         self._cruiseLevel.set_text("")
         self._route.get_buffer().set_text(self._wizard._bookedFlight.route)
+        self._alternate.set_text("")
         self._updateForwardButton()
 
@@ -1594,5 +1595,6 @@
     def _forwardClicked(self, button):
         """Called when the Forward button is clicked."""
-        if self._wizard.gui.config.useSimBrief:
+        if self._wizard.gui.config.useSimBrief and \
+           self._wizard.usingSimBrief is not False:
             self._wizard.nextPage()
         else:
@@ -1618,4 +1620,21 @@
         ]
 
+    progress2Message = {
+        cef.SIMBRIEF_PROGRESS_SEARCHING_BROWSER: "simbrief_progress_searching_browser",
+        cef.SIMBRIEF_PROGRESS_LOADING_FORM: "simbrief_progress_loading_form",
+        cef.SIMBRIEF_PROGRESS_FILLING_FORM: "simbrief_progress_filling_form",
+        cef.SIMBRIEF_PROGRESS_WAITING_LOGIN: "simbrief_progress_waiting_login",
+        cef.SIMBRIEF_PROGRESS_LOGGING_IN: "simbrief_progress_logging_in",
+        cef.SIMBRIEF_PROGRESS_WAITING_RESULT: "simbrief_progress_waiting_result",
+        cef.SIMBRIEF_PROGRESS_RETRIEVING_BRIEFING: "simbrief_progress_retrieving_briefing"
+        }
+
+    result2Message = {
+        cef.SIMBRIEF_RESULT_ERROR_OTHER: "simbrief_result_error_other",
+        cef.SIMBRIEF_RESULT_ERROR_NO_FORM: "simbrief_result_error_no_form",
+        cef.SIMBRIEF_RESULT_ERROR_NO_POPUP: "simbrief_result_error_no_popup",
+        cef.SIMBRIEF_RESULT_ERROR_LOGIN_FAILED: "simbrief_result_error_login_failed"
+        }
+
     @staticmethod
     def getHTMLFilePath():
@@ -1738,15 +1757,38 @@
             startSound(const.SOUND_NOTAM)
 
-    def _simBriefProgressCallback(self, message, done):
+    def _simBriefProgressCallback(self, progress, result, flightInfo):
         """Called by the SimBrief handling thread."""
-        gobject.idle_add(self._simBriefProgress, message, done)
-
-    def _simBriefProgress(self, message, done):
+        gobject.idle_add(self._simBriefProgress, progress, result, flightInfo)
+
+    def _simBriefProgress(self, progress, result, flightInfo):
         """The real SimBrief progress handler."""
-        if done:
+        print "_simBriefProgress", progress, result, flightInfo
+        if result==cef.SIMBRIEF_RESULT_NONE:
+            message = SimBriefSetupPage.progress2Message.get(progress,
+                                                             "simbrief_progress_unknown")
+            self._wizard.gui.updateBusyState(xstr(message))
+        else:
             self._wizard.gui.endBusy()
-            self._wizard.nextPage()
-        else:
-            self._wizard.gui.updateBusyState(message)
+
+            if result==cef.SIMBRIEF_RESULT_OK:
+                self._wizard.nextPage()
+            else:
+                message = SimBriefSetupPage.result2Message.get(result,
+                                                               "simbrief_result_unknown")
+                dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
+                                           type = MESSAGETYPE_ERROR,
+                                           message_format =
+                                           xstr(message) + "\n"+
+                                           xstr("simbrief_cancelled"))
+
+                dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+                dialog.set_title(WINDOW_TITLE_BASE)
+                secondary = xstr("flightsel_save_failed_sec")
+                dialog.format_secondary_markup(secondary)
+                dialog.run()
+                dialog.hide()
+
+                self._wizard.usingSimBrief = False
+                self._wizard.jumpPage(2, fromPageShift = 1)
 
     def _getPlan(self):
@@ -3951,6 +3993,11 @@
         return self._loginResult
 
-    def setCurrentPage(self, index, finalize = False):
-        """Set the current page to the one with the given index."""
+    def setCurrentPage(self, index, finalize = False, fromPageShift = None):
+        """Set the current page to the one with the given index.
+
+        @param fromPageShift if given, the relative index of one of the
+        previous pages that should be used as the from-page of the next
+        page. E.g. if fromPageShift is 1, the previous page will be the
+        from-page."""
         assert index < len(self._pages)
 
@@ -3961,4 +4008,6 @@
                 page.complete()
             self.remove(page)
+            if fromPageShift is not None:
+                fromPage -= fromPageShift
 
         self._currentPage = index
@@ -4157,7 +4206,8 @@
         self.jumpPage(1, finalize)
 
-    def jumpPage(self, count, finalize = True):
+    def jumpPage(self, count, finalize = True, fromPageShift = None):
         """Go to the page which is 'count' pages after the current one."""
-        self.setCurrentPage(self._currentPage + count, finalize = finalize)
+        self.setCurrentPage(self._currentPage + count,
+                            finalize = finalize, fromPageShift = fromPageShift)
 
     def grabDefault(self):
@@ -4208,5 +4258,5 @@
         self._arrivalNOTAMs = None
         self._arrivalMETAR = None
-        self._usingSimBrief = False
+        self._usingSimBrief = None
 
         firstPage = 0 if self._loginResult is None else 1
Index: src/mlx/gui/mava_simbrief.py
===================================================================
--- src/mlx/gui/mava_simbrief.py	(revision 685)
+++ src/mlx/gui/mava_simbrief.py	(revision 692)
@@ -21,4 +21,46 @@
     """Implements the integration with the excellent Simbrief pilot briefing
     system for MALEV Virtual."""
+
+    # Progress stage: searching the suitable browser window
+    PROGRESS_SEARCHING_BROWSER = 1
+
+    # Progress stage: retrieving the form from the server
+    PROGRESS_LOADING_FORM = 2
+
+    # Progress stage: filling the form
+    PROGRESS_FILLING_FORM = 3
+
+    # Progress stage: waiting for the login
+    PROGRESS_WAITING_LOGIN = 4
+
+    # Progress stage: logging in
+    PROGRESS_LOGGING_IN = 5
+
+    # Progress stage: waiting for result
+    PROGRESS_WAITING_RESULT = 6
+
+    # The maximal reserved progress stage
+    PROGRESS_MAX = 16
+
+    # Result code: none (i.e. the SimBrief query is in progress).
+    RESULT_NONE = 0
+
+    # Result code: success
+    RESULT_OK = 1
+
+    # Result code: other error
+    RESULT_ERROR_OTHER = 2
+
+    # Result code: form could not be loaded
+    RESULT_ERROR_NO_FORM = 11
+
+    # Result code: no popup (i.e. login) window found
+    RESULT_ERROR_NO_POPUP = 12
+
+    # Result code: login failed
+    RESULT_ERROR_LOGIN_FAILED = 13
+
+    # The maximal reserved result code
+    RESULT_MAX = 32
 
     def __init__(self,
@@ -114,13 +156,17 @@
             is_briefing_available = True
         else:
-            update_progress("Looking for a browser...", False)
+            update_progress(MavaSimbriefIntegrator.PROGRESS_SEARCHING_BROWSER,
+                            MavaSimbriefIntegrator.RESULT_NONE, None)
             # There must be window whose title is 'SimBrief' so that we
             # could find our one among several
             if self._find_window_by_title("SimBrief") is None:
                 print "No SimBrief window was found!"
+                update_progress(MavaSimbriefIntegrator.PROGRESS_SEARCHING_BROWSER,
+                                MavaSimbriefIntegrator.RESULT_ERROR_OTHER, None)
                 return None
 
             # normal operation with a real xml file
-            update_progress("Retrieving form...", False)
+            update_progress(MavaSimbriefIntegrator.PROGRESS_LOADING_FORM,
+                            MavaSimbriefIntegrator.RESULT_NONE, None)
             if local_html_debug:
                 self.driver.get(
@@ -133,4 +179,6 @@
             if main_handle is None:
                 print "No SimBrief Integration window was found!"
+                update_progress(MavaSimbriefIntegrator.PROGRESS_LOADING_FORM,
+                                MavaSimbriefIntegrator.RESULT_ERROR_NO_FORM, None)
                 return None
 
@@ -140,5 +188,6 @@
 
             # Entering form data
-            update_progress("Filling form...", False)
+            update_progress(MavaSimbriefIntegrator.PROGRESS_FILLING_FORM,
+                            MavaSimbriefIntegrator.RESULT_NONE, None)
             self.driver.switch_to_window(main_handle)
             self.fill_form(self.plan,
@@ -149,8 +198,10 @@
             button.send_keys(Keys.RETURN)
 
-            update_progress("Waiting for login...", False)
+            update_progress(MavaSimbriefIntegrator.PROGRESS_WAITING_LOGIN,
+                            MavaSimbriefIntegrator.RESULT_NONE, None)
             popup_handle = self._find_popup(handles)
             if popup_handle is None:
-                print "No popup window was found!"
+                update_progress(MavaSimbriefIntegrator.PROGRESS_WAITING_LOGIN,
+                                MavaSimbriefIntegrator.RESULT_ERROR_NO_POPUP, None)
                 return None
 
@@ -164,6 +215,12 @@
 
                     if userElement is not None:
-                        update_progress("Logging in...", False)
+                        update_progress(MavaSimbriefIntegrator.PROGRESS_LOGGING_IN,
+                                        MavaSimbriefIntegrator.RESULT_NONE, None)
                         (userName, password) = get_credentials(login_count)
+                        if userName is None or password is None:
+                            update_progress(MavaSimbriefIntegrator.PROGRESS_WAITING_LOGIN,
+                                            MavaSimbriefIntegrator.RESULT_ERROR_LOGIN_FAILED, None)
+                            return None
+
                         userElement.send_keys(userName)
                         self.driver.find_element_by_name("pass").send_keys(password)
@@ -178,5 +235,6 @@
                     pass
 
-                update_progress("Waiting for the result...", False)
+                update_progress(MavaSimbriefIntegrator.PROGRESS_WAITING_RESULT,
+                                MavaSimbriefIntegrator.RESULT_NONE, None)
                 self.driver.switch_to.window(main_handle)
                 try:
