Changeset 995:ad90726834d4 for src/mlx/gui
- Timestamp:
- 07/04/19 17:39:03 (5 years ago)
- Branch:
- python3
- Phase:
- public
- Location:
- src/mlx/gui
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/callouts.py
r994 r995 239 239 Makes the treeview to edit the altitude in the given row.""" 240 240 if self._addingFile: 241 gobject.idle_add(self._selectFile)241 GObject.idle_add(self._selectFile) 242 242 self._fileList.grab_focus() 243 243 self.grab_focus() -
src/mlx/gui/cef.py
r945 r995 101 101 def call(self, plan, getCredentials, updateProgress, htmlFilePath): 102 102 """Call SimBrief with the given plan.""" 103 self._timeoutID = gobject.timeout_add(120*1000, self._timedOut)103 self._timeoutID = GObject.timeout_add(120*1000, self._timedOut) 104 104 105 105 self._plan = plan … … 196 196 if results!=SIMBRIEF_RESULT_NONE: 197 197 if self._timeoutID is not None: 198 gobject.source_remove(self._timeoutID)198 GObject.source_remove(self._timeoutID) 199 199 self._plan = None 200 200 … … 251 251 f.write(availableInfo["plan_html"]) 252 252 253 gobject.idle_add(self._resultsAvailable, flightInfo)253 GObject.idle_add(self._resultsAvailable, flightInfo) 254 254 255 255 #------------------------------------------------------------------------------ … … 260 260 _toQuit = False 261 261 262 gobject.threads_init()262 GObject.threads_init() 263 263 264 264 _simBriefHandler = SimBriefHandler() … … 297 297 cefpython.Initialize(settings, switches) 298 298 299 gobject.timeout_add(10, _handleTimeout)299 GObject.timeout_add(10, _handleTimeout) 300 300 301 301 print("Initialized, executing callback...") -
src/mlx/gui/common.py
r994 r995 416 416 #------------------------------------------------------------------------------ 417 417 418 gobject.signal_new("integer-changed", IntegerEntry, gobject.SIGNAL_RUN_FIRST,418 GObject.signal_new("integer-changed", IntegerEntry, GObject.SIGNAL_RUN_FIRST, 419 419 None, (object,)) 420 420 -
src/mlx/gui/delaycodes.py
r994 r995 43 43 "The vertical scrolling policy", 44 44 gtk.ScrollablePolicy.MINIMUM, 45 gobject.PARAM_READWRITE ),45 GObject.PARAM_READWRITE ), 46 46 "vadjustment" : ( gtk.Adjustment, 47 47 "vadjustment", 48 48 "The vertical adjustment", 49 gobject.PARAM_READWRITE ),49 GObject.PARAM_READWRITE ), 50 50 "hscroll-policy" : ( gtk.ScrollablePolicy, 51 51 "hscroll-policy", 52 52 "The horizontal scrolling policy", 53 53 gtk.ScrollablePolicy.MINIMUM, 54 gobject.PARAM_READWRITE ),54 GObject.PARAM_READWRITE ), 55 55 "hadjustment" : ( gtk.Adjustment, 56 56 "hadjustment", 57 57 "The horizontal adjustment", 58 gobject.PARAM_READWRITE ) }58 GObject.PARAM_READWRITE ) } 59 59 60 60 -
src/mlx/gui/faultexplain.py
r994 r995 114 114 #------------------------------------------------------------------------------- 115 115 116 gobject.signal_new("explanation-changed", FaultFrame, gobject.SIGNAL_RUN_FIRST,116 GObject.signal_new("explanation-changed", FaultFrame, GObject.SIGNAL_RUN_FIRST, 117 117 None, (bool,)) 118 118 … … 297 297 #------------------------------------------------------------------------------- 298 298 299 gobject.signal_new("explanations-changed", FaultExplainWidget,300 gobject.SIGNAL_RUN_FIRST, None, (bool,))299 GObject.signal_new("explanations-changed", FaultExplainWidget, 300 GObject.SIGNAL_RUN_FIRST, None, (bool,)) -
src/mlx/gui/flight.py
r994 r995 57 57 #----------------------------------------------------------------------------- 58 58 59 comboModel = gtk.ListStore( gobject.TYPE_STRING)59 comboModel = gtk.ListStore(GObject.TYPE_STRING) 60 60 comboModel.append(("N/A",)) 61 61 comboModel.append(("VECTORS",)) … … 878 878 def _deleteResultCallback(self, returned, result): 879 879 """Called when the deletion result is available.""" 880 gobject.idle_add(self._handleDeleteResult, returned, result)880 GObject.idle_add(self._handleDeleteResult, returned, result) 881 881 882 882 def _handleDeleteResult(self, returned, result): … … 1632 1632 def _registerResultCallback(self, returned, result): 1633 1633 """Called when the registration result is available.""" 1634 gobject.idle_add(self._handleRegisterResult, returned, result)1634 GObject.idle_add(self._handleRegisterResult, returned, result) 1635 1635 1636 1636 def _handleRegisterResult(self, returned, result): … … 1841 1841 """Initiate the query of the entry exam status after the interval.""" 1842 1842 if not self._getEntryExamStatusCancelled: 1843 gobject.timeout_add(StudentPage._entryExamStatusQueryInterval,1843 GObject.timeout_add(StudentPage._entryExamStatusQueryInterval, 1844 1844 lambda: self._wizard.gui.webHandler. \ 1845 1845 getEntryExamStatus(self._entryExamStatusCallback)) … … 1847 1847 def _entryExamStatusCallback(self, returned, result): 1848 1848 """Called when the entry exam status is available.""" 1849 gobject.idle_add(self._handleEntryExamStatus, returned, result)1849 GObject.idle_add(self._handleEntryExamStatus, returned, result) 1850 1850 1851 1851 def _handleEntryExamStatus(self, returned, result): … … 2298 2298 def _handleZFW(self, zfw): 2299 2299 """Called when the ZFW value is retrieved.""" 2300 gobject.idle_add(self._processZFW, zfw)2300 GObject.idle_add(self._processZFW, zfw) 2301 2301 2302 2302 def _processZFW(self, zfw): … … 2388 2388 def _handleTime(self, timestamp): 2389 2389 """Handle the result of a time retrieval.""" 2390 gobject.idle_add(self._processTime, timestamp)2390 GObject.idle_add(self._processTime, timestamp) 2391 2391 2392 2392 def _processTime(self, timestamp): … … 2432 2432 def _handleFuel(self, fuelData): 2433 2433 """Callback for the fuel query operation.""" 2434 gobject.idle_add(self._processFuel, fuelData)2434 GObject.idle_add(self._processFuel, fuelData) 2435 2435 2436 2436 def _processFuel(self, fuelData): … … 3547 3547 self._wizard.gui.simulator.setFuelLevel([(fuelTank.fuelTank, 3548 3548 currentLevel)]) 3549 gobject.timeout_add(50, self._pump)3549 GObject.timeout_add(50, self._pump) 3550 3550 3551 3551 def _notamsCallback(self, returned, result): 3552 3552 """Callback for the NOTAMs.""" 3553 gobject.idle_add(self._handleNOTAMs, returned, result)3553 GObject.idle_add(self._handleNOTAMs, returned, result) 3554 3554 3555 3555 def _handleNOTAMs(self, returned, result): … … 3570 3570 def _metarsCallback(self, returned, result): 3571 3571 """Callback for the METARs.""" 3572 gobject.idle_add(self._handleMETARs, returned, result)3572 GObject.idle_add(self._handleMETARs, returned, result) 3573 3573 3574 3574 def _handleMETARs(self, returned, result): … … 5338 5338 def _checkFlightPassedSetCallback(self, returned, result): 5339 5339 """Called when the check flight status has been set.""" 5340 gobject.idle_add(self._checkFlightPassedSet, returned, result)5340 GObject.idle_add(self._checkFlightPassedSet, returned, result) 5341 5341 5342 5342 def _checkFlightPassedSet(self, returned, result): … … 5864 5864 def _loginResultCallback(self, returned, result): 5865 5865 """The login result callback, called in the web handler's thread.""" 5866 gobject.idle_add(self._handleLoginResult, returned, result)5866 GObject.idle_add(self._handleLoginResult, returned, result) 5867 5867 5868 5868 def _handleLoginResult(self, returned, result): … … 5964 5964 def _arrivalMETARCallback(self, returned, result): 5965 5965 """Called when the METAR of the arrival airport is retrieved.""" 5966 gobject.idle_add(self._handleArrivalMETAR, returned, result)5966 GObject.idle_add(self._handleArrivalMETAR, returned, result) 5967 5967 5968 5968 def _handleArrivalMETAR(self, returned, result): -
src/mlx/gui/flightlist.py
r994 r995 227 227 #------------------------------------------------------------------------------- 228 228 229 gobject.signal_new("row-activated", FlightList, gobject.SIGNAL_RUN_FIRST,229 GObject.signal_new("row-activated", FlightList, GObject.SIGNAL_RUN_FIRST, 230 230 None, (int,)) 231 231 232 gobject.signal_new("selection-changed", FlightList, gobject.SIGNAL_RUN_FIRST,232 GObject.signal_new("selection-changed", FlightList, GObject.SIGNAL_RUN_FIRST, 233 233 None, (object,)) 234 234 … … 355 355 def _pirepResultCallback(self, returned, result): 356 356 """Called when the PIREP query result is available.""" 357 gobject.idle_add(self._handlePIREPResult, returned, result)357 GObject.idle_add(self._handlePIREPResult, returned, result) 358 358 359 359 def _handlePIREPResult(self, returned, result): … … 387 387 def _reflyResultCallback(self, returned, result): 388 388 """Called when the refly result is available.""" 389 gobject.idle_add(self._handleReflyResult, returned, result)389 GObject.idle_add(self._handleReflyResult, returned, result) 390 390 391 391 def _handleReflyResult(self, returned, result): … … 430 430 def _deleteResultCallback(self, returned, result): 431 431 """Called when the deletion result is available.""" 432 gobject.idle_add(self._handleDeleteResult, returned, result)432 GObject.idle_add(self._handleDeleteResult, returned, result) 433 433 434 434 def _handleDeleteResult(self, returned, result): … … 741 741 def _pirepResultCallback(self, returned, result): 742 742 """Called when the PIREP query result is available.""" 743 gobject.idle_add(self._handlePIREPResult, returned, result)743 GObject.idle_add(self._handlePIREPResult, returned, result) 744 744 745 745 def _handlePIREPResult(self, returned, result): -
src/mlx/gui/gui.py
r994 r995 63 63 def __init__(self, programDirectory, config): 64 64 """Construct the GUI.""" 65 gobject.threads_init()65 GObject.threads_init() 66 66 67 67 self._programDirectory = programDirectory … … 360 360 def takeoffAntiIceOn(self, value): 361 361 """Set the anti-ice on indicator.""" 362 gobject.idle_add(self._setTakeoffAntiIceOn, value)362 GObject.idle_add(self._setTakeoffAntiIceOn, value) 363 363 364 364 @property … … 400 400 def landingAntiIceOn(self, value): 401 401 """Set the anti-ice on indicator.""" 402 gobject.idle_add(self._setLandingAntiIceOn, value)402 GObject.idle_add(self._setLandingAntiIceOn, value) 403 403 404 404 @property … … 470 470 def updateDone(self): 471 471 """Called when the update is done (and there is no need to restart).""" 472 gobject.idle_add(self._updateDone)472 GObject.idle_add(self._updateDone) 473 473 474 474 def connected(self, fsType, descriptor): … … 479 479 fs.sendMessage(const.MESSAGETYPE_INFORMATION, 480 480 "Welcome to MAVA Logger X " + const.VERSION) 481 gobject.idle_add(self._handleConnected, fsType, descriptor)481 GObject.idle_add(self._handleConnected, fsType, descriptor) 482 482 483 483 def _handleConnected(self, fsType, descriptor): … … 494 494 """Called when the connection failed.""" 495 495 self._logger.untimedMessage("Connection to the simulator failed") 496 gobject.idle_add(self._connectionFailed)496 GObject.idle_add(self._connectionFailed) 497 497 498 498 def _connectionFailed(self): … … 527 527 self._flight.disconnected() 528 528 529 gobject.idle_add(self._disconnected)529 GObject.idle_add(self._disconnected) 530 530 531 531 def _disconnected(self): … … 572 572 def _bookFlightsCallback(self, returned, result): 573 573 """Called when the booking of flights has finished.""" 574 gobject.idle_add(self._handleBookFlightsResult, returned, result)574 GObject.idle_add(self._handleBookFlightsResult, returned, result) 575 575 576 576 def _handleBookFlightsResult(self, returned, result): … … 653 653 def insertFlightLogLine(self, index, timestampString, text, isFault): 654 654 """Insert the flight log line with the given data.""" 655 gobject.idle_add(self._insertFlightLogLine, index,655 GObject.idle_add(self._insertFlightLogLine, index, 656 656 formatFlightLogLine(timestampString, text), 657 657 isFault) … … 668 668 def removeFlightLogLine(self, index): 669 669 """Remove the flight log line with the given index.""" 670 gobject.idle_add(self._removeFlightLogLine, index)670 GObject.idle_add(self._removeFlightLogLine, index) 671 671 672 672 def addFault(self, id, timestampString, text): 673 673 """Add a fault to the list of faults.""" 674 674 faultText = formatFlightLogLine(timestampString, text).strip() 675 gobject.idle_add(self._flightInfo.addFault, id, faultText)675 GObject.idle_add(self._flightInfo.addFault, id, faultText) 676 676 677 677 def updateFault(self, id, timestampString, text): 678 678 """Update a fault in the list of faults.""" 679 679 faultText = formatFlightLogLine(timestampString, text).strip() 680 gobject.idle_add(self._flightInfo.updateFault, id, faultText)680 GObject.idle_add(self._flightInfo.updateFault, id, faultText) 681 681 682 682 def clearFault(self, id): 683 683 """Clear a fault in the list of faults.""" 684 gobject.idle_add(self._flightInfo.clearFault, id)684 GObject.idle_add(self._flightInfo.clearFault, id) 685 685 686 686 def _removeFlightLogLine(self, index): … … 694 694 def check(self, flight, aircraft, logger, oldState, state): 695 695 """Update the data.""" 696 gobject.idle_add(self._monitorWindow.setData, state)697 gobject.idle_add(self._statusbar.updateTime, state.timestamp)696 GObject.idle_add(self._monitorWindow.setData, state) 697 GObject.idle_add(self._statusbar.updateTime, state.timestamp) 698 698 699 699 def resetFlightStatus(self): … … 705 705 def setStage(self, stage): 706 706 """Set the stage of the flight.""" 707 gobject.idle_add(self._setStage, stage)707 GObject.idle_add(self._setStage, stage) 708 708 709 709 def _setStage(self, stage): … … 721 721 def setRating(self, rating): 722 722 """Set the rating of the flight.""" 723 gobject.idle_add(self._setRating, rating)723 GObject.idle_add(self._setRating, rating) 724 724 725 725 def _setRating(self, rating): … … 730 730 def setNoGo(self, reason): 731 731 """Set the rating of the flight to No-Go with the given reason.""" 732 gobject.idle_add(self._setNoGo, reason)732 GObject.idle_add(self._setNoGo, reason) 733 733 734 734 def _setNoGo(self, reason): … … 760 760 def raiseCallback(self): 761 761 """Callback for the singleton handling code.""" 762 gobject.idle_add(self.raiseMainWindow)762 GObject.idle_add(self.raiseMainWindow) 763 763 764 764 def raiseMainWindow(self): … … 848 848 self._stdioText += text 849 849 850 gobject.idle_add(self._writeStdIO)850 GObject.idle_add(self._writeStdIO) 851 851 852 852 def beginBusy(self, message): … … 875 875 def getFleetAsync(self, callback = None, force = None): 876 876 """Get the fleet asynchronously.""" 877 gobject.idle_add(self.getFleet, callback, force)877 GObject.idle_add(self.getFleet, callback, force) 878 878 879 879 def getFleet(self, callback = None, force = False, busyCallback = None): … … 910 910 self._wizard.updateRTO() 911 911 else: 912 gobject.idle_add(self.updateRTO, True)912 GObject.idle_add(self.updateRTO, True) 913 913 914 914 def rtoToggled(self, indicated): … … 918 918 def _fleetResultCallback(self, returned, result): 919 919 """Called when the fleet has been queried.""" 920 gobject.idle_add(self._handleFleetResult, returned, result)920 GObject.idle_add(self._handleFleetResult, returned, result) 921 921 922 922 def _handleFleetResult(self, returned, result): … … 961 961 def _updatePlaneResultCallback(self, returned, result): 962 962 """Called when the status of a plane has been updated.""" 963 gobject.idle_add(self._handleUpdatePlaneResult, returned, result)963 GObject.idle_add(self._handleUpdatePlaneResult, returned, result) 964 964 965 965 def _handleUpdatePlaneResult(self, returned, result): … … 1274 1274 """Called when the current page of the notebook has changed.""" 1275 1275 if page_num==0: 1276 gobject.idle_add(self._wizard.grabDefault)1276 GObject.idle_add(self._wizard.grabDefault) 1277 1277 else: 1278 1278 self._mainWindow.set_default(None) … … 1310 1310 def _timetableCallback(self, returned, result): 1311 1311 """Called when the timetable has been received.""" 1312 gobject.idle_add(self._handleTimetable, returned, result)1312 GObject.idle_add(self._handleTimetable, returned, result) 1313 1313 1314 1314 def _handleTimetable(self, returned, result): … … 1342 1342 def _acceptedFlightsCallback(self, returned, result): 1343 1343 """Called when the accepted flights have been received.""" 1344 gobject.idle_add(self._handleAcceptedFlights, returned, result)1344 GObject.idle_add(self._handleAcceptedFlights, returned, result) 1345 1345 1346 1346 def _handleAcceptedFlights(self, returned, result): … … 1428 1428 def _pirepUpdatedCallback(self, returned, result): 1429 1429 """Callback for the PIREP updating result.""" 1430 gobject.idle_add(self._handlePIREPUpdated, returned, result)1430 GObject.idle_add(self._handlePIREPUpdated, returned, result) 1431 1431 1432 1432 def _handlePIREPUpdated(self, returned, result): … … 1650 1650 def _pirepSentCallback(self, returned, result): 1651 1651 """Callback for the PIREP sending result.""" 1652 gobject.idle_add(self._handlePIREPSent, returned, result)1652 GObject.idle_add(self._handlePIREPSent, returned, result) 1653 1653 1654 1654 def _handlePIREPSent(self, returned, result): … … 1717 1717 def _bugReportSentCallback(self, returned, result): 1718 1718 """Callback function for the bug report sending result.""" 1719 gobject.idle_add(self._handleBugReportSent, returned, result)1719 GObject.idle_add(self._handleBugReportSent, returned, result) 1720 1720 1721 1721 def _handleBugReportSent(self, returned, result): … … 1859 1859 self._credentialsAvailable = False 1860 1860 1861 gobject.idle_add(self._getCredentials)1861 GObject.idle_add(self._getCredentials) 1862 1862 1863 1863 while not self._credentialsAvailable: -
src/mlx/gui/prefs.py
r954 r995 161 161 #------------------------------------------------------------------------------ 162 162 163 gobject.signal_new("hotkey-changed", Hotkey, gobject.SIGNAL_RUN_FIRST,163 GObject.signal_new("hotkey-changed", Hotkey, GObject.SIGNAL_RUN_FIRST, 164 164 None, (int,)) 165 165 -
src/mlx/gui/timetable.py
r994 r995 244 244 #----------------------------------------------------------------------------- 245 245 246 gobject.signal_new("row-activated", Timetable, gobject.SIGNAL_RUN_FIRST,246 GObject.signal_new("row-activated", Timetable, GObject.SIGNAL_RUN_FIRST, 247 247 None, (int,)) 248 248 249 gobject.signal_new("selection-changed", Timetable, gobject.SIGNAL_RUN_FIRST,249 GObject.signal_new("selection-changed", Timetable, GObject.SIGNAL_RUN_FIRST, 250 250 None, (object,)) 251 251 … … 300 300 return True 301 301 302 gobject.signal_new("date-selected", CalendarWindow, gobject.SIGNAL_RUN_FIRST,302 GObject.signal_new("date-selected", CalendarWindow, GObject.SIGNAL_RUN_FIRST, 303 303 None, ()) 304 304 -
src/mlx/gui/update.py
r994 r995 117 117 def run(self): 118 118 """Execute the thread's operation.""" 119 gobject.idle_add(self._startUpdate)119 GObject.idle_add(self._startUpdate) 120 120 update(self._programDirectory, self._updateURL, self, fromGUI = True) 121 121 if not self._waitAfterFinish: 122 gobject.idle_add(self._progressWindow.hide)122 GObject.idle_add(self._progressWindow.hide) 123 123 self._gui.updateDone() 124 124 125 125 def downloadingManifest(self): 126 126 """Called when the downloading of the manifest has started.""" 127 gobject.idle_add(self._downloadingManifest)127 GObject.idle_add(self._downloadingManifest) 128 128 129 129 def _downloadingManifest(self): … … 134 134 def downloadedManifest(self): 135 135 """Called when the downloading of the manifest has finished.""" 136 gobject.idle_add(self._downloadedManifest)136 GObject.idle_add(self._downloadedManifest) 137 137 138 138 def _downloadedManifest(self): … … 144 144 """Called when the program is interested in whether we want to run a 145 145 program with administrator rights to do the update.""" 146 gobject.idle_add(self._needSudo)146 GObject.idle_add(self._needSudo) 147 147 with self._sudoCondition: 148 148 while self._sudoReply is None: … … 184 184 """Called when a certain number of bytes are downloaded.""" 185 185 self._downloaded = downloaded 186 gobject.idle_add(self._setDownloaded, downloaded)186 GObject.idle_add(self._setDownloaded, downloaded) 187 187 188 188 def _setDownloaded(self, downloaded): … … 194 194 def startRenaming(self): 195 195 """Called when the renaming of files has started.""" 196 gobject.idle_add(self._startRenaming)196 GObject.idle_add(self._startRenaming) 197 197 198 198 def _startRenaming(self): … … 203 203 """Called when a file has been renamed.""" 204 204 self._numModifiedOrNew = count 205 gobject.idle_add(self._renamed, path, count)205 GObject.idle_add(self._renamed, path, count) 206 206 207 207 def _renamed(self, path, count): … … 212 212 def startRemoving(self): 213 213 """Called when the removing of files has started.""" 214 gobject.idle_add(self._startRemoving)214 GObject.idle_add(self._startRemoving) 215 215 216 216 def _startRemoving(self): … … 221 221 """Called when a file has been removed.""" 222 222 self._numRemoved = count 223 gobject.idle_add(self._removed, path, count)223 GObject.idle_add(self._removed, path, count) 224 224 225 225 def _removed(self, path, count): … … 230 230 def writingManifest(self): 231 231 """Called when the writing of the new manifest file has started.""" 232 gobject.idle_add(self._writingManifest)232 GObject.idle_add(self._writingManifest) 233 233 234 234 def _writingManifest(self): … … 238 238 def done(self): 239 239 """Called when the update has been done.""" 240 gobject.idle_add(self._done)240 GObject.idle_add(self._done) 241 241 self._restart = self._waitAfterFinish 242 242 … … 261 261 """Called when the downloading has failed.""" 262 262 self._waitAfterFinish = True 263 gobject.idle_add(self._failed, what)263 GObject.idle_add(self._failed, what) 264 264 265 265 def _failed(self, what): -
src/mlx/gui/weighthelp.py
r994 r995 466 466 def _handleWeights(self, dow, payload, zfw, grossWeight): 467 467 """Handle the given weights.""" 468 gobject.idle_add(self._processWeights, dow, payload, zfw, grossWeight)468 GObject.idle_add(self._processWeights, dow, payload, zfw, grossWeight) 469 469 470 470 def _processWeights(self, dow, payload, zfw, grossWeight):
Note:
See TracChangeset
for help on using the changeset viewer.