Changeset 105:d1c3dd71da77 for src/mlx
- Timestamp:
- 04/22/12 14:21:23 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/common.py
r97 r105 1 1 # Common things for the GUI 2 3 import mlx.const as _const 2 4 3 5 import os … … 148 150 149 151 #------------------------------------------------------------------------------ 152 153 WINDOW_TITLE_BASE = "MAVA Logger X " + _const.VERSION 154 155 #------------------------------------------------------------------------------ -
src/mlx/gui/flight.py
r102 r105 289 289 self._wizard.nextPage() 290 290 else: 291 dialog = gtk.MessageDialog(type = MESSAGETYPE_ERROR, 291 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow, 292 type = MESSAGETYPE_ERROR, 292 293 buttons = BUTTONSTYPE_OK, 293 294 message_format = 294 295 "Invalid pilot's ID or password.") 296 dialog.set_title(WINDOW_TITLE_BASE) 295 297 dialog.format_secondary_markup("Check the ID and try to reenter" 296 298 " the password.") … … 298 300 dialog.hide() 299 301 else: 300 dialog = gtk.MessageDialog(type = MESSAGETYPE_ERROR, 302 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow, 303 type = MESSAGETYPE_ERROR, 301 304 buttons = BUTTONSTYPE_OK, 302 305 message_format = 303 306 "Failed to connect to the MAVA website.") 307 dialog.set_title(WINDOW_TITLE_BASE) 304 308 dialog.format_secondary_markup("Try again in a few minutes.") 305 309 dialog.run() … … 516 520 self._wizard.nextPage() 517 521 else: 518 dialog = gtk.MessageDialog(type = MESSAGETYPE_ERROR, 522 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow, 523 type = MESSAGETYPE_ERROR, 519 524 buttons = BUTTONSTYPE_OK, 520 525 message_format = "Gate conflict detected again") 526 dialog.set_title(WINDOW_TITLE_BASE) 521 527 dialog.format_secondary_markup("Try to select a different gate.") 522 528 dialog.run() … … 1892 1898 type = MESSAGETYPE_INFO 1893 1899 messageFormat = "The PIREP was sent successfully." 1894 secondaryMarkup = "Await the thorough scrutiny from ourPIREP correctors! :)"1900 secondaryMarkup = "Await the thorough scrutiny by our fearless PIREP correctors! :)" 1895 1901 elif result.alreadyFlown: 1896 1902 messageFormat = "The PIREP for this flight has already been sent!" … … 1908 1914 "see the debug log for more information." 1909 1915 1910 dialog = gtk.MessageDialog(type = type, buttons = BUTTONSTYPE_OK, 1916 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow, 1917 type = type, buttons = BUTTONSTYPE_OK, 1911 1918 message_format = messageFormat) 1919 dialog.set_title(WINDOW_TITLE_BASE) 1912 1920 if secondaryMarkup is not None: 1913 1921 dialog.format_secondary_markup(secondaryMarkup) … … 2163 2171 self._fleet = None 2164 2172 2165 dialog = gtk.MessageDialog(type = MESSAGETYPE_ERROR, 2173 dialog = gtk.MessageDialog(parent = self.gui.mainWindow, 2174 type = MESSAGETYPE_ERROR, 2166 2175 buttons = BUTTONSTYPE_OK, 2167 2176 message_format = 2168 2177 "Failed to retrieve the information on " 2169 2178 "the fleet.") 2179 dialog.set_title(WINDOW_TITLE_BASE) 2170 2180 dialog.run() 2171 2181 dialog.hide() … … 2192 2202 success = None 2193 2203 2194 dialog = gtk.MessageDialog(type = MESSAGETYPE_ERROR, 2204 dialog = gtk.MessageDialog(parent = self.gui.mainWindow, 2205 type = MESSAGETYPE_ERROR, 2195 2206 buttons = BUTTONSTYPE_OK, 2196 2207 message_format = 2197 2208 "Failed to update the statuis of " 2198 2209 "the airplane.") 2210 dialog.set_title(WINDOW_TITLE_BASE) 2199 2211 dialog.run() 2200 2212 dialog.hide() -
src/mlx/gui/gui.py
r99 r105 57 57 58 58 window = gtk.Window() 59 window.set_title( "MAVA Logger X " + const.VERSION)59 window.set_title(WINDOW_TITLE_BASE) 60 60 window.set_icon_from_file(os.path.join(iconDirectory, "logo.ico")) 61 61 window.connect("delete-event", … … 119 119 else gdk.WATCH) 120 120 121 @property 122 def mainWindow(self): 123 """Get the main window of the GUI.""" 124 return self._mainWindow 125 121 126 @property 122 127 def logger(self): … … 286 291 self._statusbar.updateConnection(self._connecting, self._connected) 287 292 288 dialog = gtk.MessageDialog(type = MESSAGETYPE_ERROR, 293 dialog = gtk.MessageDialog(parent = self._mainWindow, 294 type = MESSAGETYPE_ERROR, 289 295 message_format = 290 "Cannot connect to the simulator." ,291 parent = self._mainWindow)296 "Cannot connect to the simulator.") 297 dialog.set_title(WINDOW_TITLE_BASE) 292 298 dialog.format_secondary_markup("Rectify the situation, and press <b>Try again</b> " 293 299 "to try the connection again, " … … 321 327 "The connection to the simulator failed unexpectedly.", 322 328 parent = self._mainWindow) 329 dialog.set_title(WINDOW_TITLE_BASE) 323 330 dialog.format_secondary_markup("If the simulator has crashed, restart it " 324 331 "and restore your flight as much as possible " 325 "to the state it was in before the crash. \n"332 "to the state it was in before the crash. " 326 333 "Then press <b>Reconnect</b> to reconnect.\n\n" 327 334 "If you want to cancel the flight, press <b>Cancel</b>.") … … 674 681 result=RESPONSETYPE_YES 675 682 else: 676 dialog = gtk.MessageDialog(type = MESSAGETYPE_QUESTION, 683 dialog = gtk.MessageDialog(parent = self._mainWindow, 684 type = MESSAGETYPE_QUESTION, 677 685 buttons = BUTTONSTYPE_YES_NO, 678 686 message_format = 679 687 "Are you sure to quit the logger?") 688 dialog.set_title(WINDOW_TITLE_BASE) 680 689 result = dialog.run() 681 690 dialog.hide() -
src/mlx/gui/update.py
r38 r105 39 39 40 40 Updater._progressWindow = window = gtk.Window() 41 window.set_title( "MAVA Logger X " + const.VERSION+ " Update")41 window.set_title(WINDOW_TITLE_BASE + " Update") 42 42 window.set_transient_for(parentWindow) 43 43 #win.set_icon_from_file(os.path.join(iconDirectory, "logo.ico")) … … 72 72 73 73 Updater._sudoDialog = sudoDialog = \ 74 gtk.Dialog( "MAVA Logger X " + const.VERSION+ " Update",74 gtk.Dialog(WINDOW_TITLE_BASE + " Update", 75 75 parentWindow, 76 76 gtk.DialogFlags.MODAL if pygobject else gtk.DIALOG_MODAL,
Note:
See TracChangeset
for help on using the changeset viewer.