Changeset 692:eea9d6135944 for src/mlx/gui/flight.py
- Timestamp:
- 10/22/15 18:43:58 (9 years ago)
- Branch:
- cef
- hg-Phase:
- (<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r691 r692 1543 1543 self._cruiseLevel.set_text("") 1544 1544 self._route.get_buffer().set_text(self._wizard._bookedFlight.route) 1545 self._alternate.set_text("") 1545 1546 self._updateForwardButton() 1546 1547 … … 1594 1595 def _forwardClicked(self, button): 1595 1596 """Called when the Forward button is clicked.""" 1596 if self._wizard.gui.config.useSimBrief: 1597 if self._wizard.gui.config.useSimBrief and \ 1598 self._wizard.usingSimBrief is not False: 1597 1599 self._wizard.nextPage() 1598 1600 else: … … 1618 1620 ] 1619 1621 1622 progress2Message = { 1623 cef.SIMBRIEF_PROGRESS_SEARCHING_BROWSER: "simbrief_progress_searching_browser", 1624 cef.SIMBRIEF_PROGRESS_LOADING_FORM: "simbrief_progress_loading_form", 1625 cef.SIMBRIEF_PROGRESS_FILLING_FORM: "simbrief_progress_filling_form", 1626 cef.SIMBRIEF_PROGRESS_WAITING_LOGIN: "simbrief_progress_waiting_login", 1627 cef.SIMBRIEF_PROGRESS_LOGGING_IN: "simbrief_progress_logging_in", 1628 cef.SIMBRIEF_PROGRESS_WAITING_RESULT: "simbrief_progress_waiting_result", 1629 cef.SIMBRIEF_PROGRESS_RETRIEVING_BRIEFING: "simbrief_progress_retrieving_briefing" 1630 } 1631 1632 result2Message = { 1633 cef.SIMBRIEF_RESULT_ERROR_OTHER: "simbrief_result_error_other", 1634 cef.SIMBRIEF_RESULT_ERROR_NO_FORM: "simbrief_result_error_no_form", 1635 cef.SIMBRIEF_RESULT_ERROR_NO_POPUP: "simbrief_result_error_no_popup", 1636 cef.SIMBRIEF_RESULT_ERROR_LOGIN_FAILED: "simbrief_result_error_login_failed" 1637 } 1638 1620 1639 @staticmethod 1621 1640 def getHTMLFilePath(): … … 1738 1757 startSound(const.SOUND_NOTAM) 1739 1758 1740 def _simBriefProgressCallback(self, message, done):1759 def _simBriefProgressCallback(self, progress, result, flightInfo): 1741 1760 """Called by the SimBrief handling thread.""" 1742 gobject.idle_add(self._simBriefProgress, message, done)1743 1744 def _simBriefProgress(self, message, done):1761 gobject.idle_add(self._simBriefProgress, progress, result, flightInfo) 1762 1763 def _simBriefProgress(self, progress, result, flightInfo): 1745 1764 """The real SimBrief progress handler.""" 1746 if done: 1765 print "_simBriefProgress", progress, result, flightInfo 1766 if result==cef.SIMBRIEF_RESULT_NONE: 1767 message = SimBriefSetupPage.progress2Message.get(progress, 1768 "simbrief_progress_unknown") 1769 self._wizard.gui.updateBusyState(xstr(message)) 1770 else: 1747 1771 self._wizard.gui.endBusy() 1748 self._wizard.nextPage() 1749 else: 1750 self._wizard.gui.updateBusyState(message) 1772 1773 if result==cef.SIMBRIEF_RESULT_OK: 1774 self._wizard.nextPage() 1775 else: 1776 message = SimBriefSetupPage.result2Message.get(result, 1777 "simbrief_result_unknown") 1778 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow, 1779 type = MESSAGETYPE_ERROR, 1780 message_format = 1781 xstr(message) + "\n"+ 1782 xstr("simbrief_cancelled")) 1783 1784 dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK) 1785 dialog.set_title(WINDOW_TITLE_BASE) 1786 secondary = xstr("flightsel_save_failed_sec") 1787 dialog.format_secondary_markup(secondary) 1788 dialog.run() 1789 dialog.hide() 1790 1791 self._wizard.usingSimBrief = False 1792 self._wizard.jumpPage(2, fromPageShift = 1) 1751 1793 1752 1794 def _getPlan(self): … … 3951 3993 return self._loginResult 3952 3994 3953 def setCurrentPage(self, index, finalize = False): 3954 """Set the current page to the one with the given index.""" 3995 def setCurrentPage(self, index, finalize = False, fromPageShift = None): 3996 """Set the current page to the one with the given index. 3997 3998 @param fromPageShift if given, the relative index of one of the 3999 previous pages that should be used as the from-page of the next 4000 page. E.g. if fromPageShift is 1, the previous page will be the 4001 from-page.""" 3955 4002 assert index < len(self._pages) 3956 4003 … … 3961 4008 page.complete() 3962 4009 self.remove(page) 4010 if fromPageShift is not None: 4011 fromPage -= fromPageShift 3963 4012 3964 4013 self._currentPage = index … … 4157 4206 self.jumpPage(1, finalize) 4158 4207 4159 def jumpPage(self, count, finalize = True ):4208 def jumpPage(self, count, finalize = True, fromPageShift = None): 4160 4209 """Go to the page which is 'count' pages after the current one.""" 4161 self.setCurrentPage(self._currentPage + count, finalize = finalize) 4210 self.setCurrentPage(self._currentPage + count, 4211 finalize = finalize, fromPageShift = fromPageShift) 4162 4212 4163 4213 def grabDefault(self): … … 4208 4258 self._arrivalNOTAMs = None 4209 4259 self._arrivalMETAR = None 4210 self._usingSimBrief = False4260 self._usingSimBrief = None 4211 4261 4212 4262 firstPage = 0 if self._loginResult is None else 1
Note:
See TracChangeset
for help on using the changeset viewer.