Ignore:
Timestamp:
04/22/12 14:21:23 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The dialogs now have a proper parent window and title

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/gui.py

    r99 r105  
    5757       
    5858        window = gtk.Window()
    59         window.set_title("MAVA Logger X " + const.VERSION)
     59        window.set_title(WINDOW_TITLE_BASE)
    6060        window.set_icon_from_file(os.path.join(iconDirectory, "logo.ico"))
    6161        window.connect("delete-event",
     
    119119                                      else gdk.WATCH)
    120120
     121    @property
     122    def mainWindow(self):
     123        """Get the main window of the GUI."""
     124        return self._mainWindow
     125       
    121126    @property
    122127    def logger(self):
     
    286291        self._statusbar.updateConnection(self._connecting, self._connected)
    287292
    288         dialog = gtk.MessageDialog(type = MESSAGETYPE_ERROR,
     293        dialog = gtk.MessageDialog(parent = self._mainWindow,
     294                                   type = MESSAGETYPE_ERROR,
    289295                                   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)
    292298        dialog.format_secondary_markup("Rectify the situation, and press <b>Try again</b> "
    293299                                       "to try the connection again, "
     
    321327                                   "The connection to the simulator failed unexpectedly.",
    322328                                   parent = self._mainWindow)
     329        dialog.set_title(WINDOW_TITLE_BASE)
    323330        dialog.format_secondary_markup("If the simulator has crashed, restart it "
    324331                                       "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. "
    326333                                       "Then press <b>Reconnect</b> to reconnect.\n\n"
    327334                                       "If you want to cancel the flight, press <b>Cancel</b>.")
     
    674681            result=RESPONSETYPE_YES
    675682        else:
    676             dialog = gtk.MessageDialog(type = MESSAGETYPE_QUESTION,
     683            dialog = gtk.MessageDialog(parent = self._mainWindow,
     684                                       type = MESSAGETYPE_QUESTION,
    677685                                       buttons = BUTTONSTYPE_YES_NO,
    678686                                       message_format =
    679687                                       "Are you sure to quit the logger?")
     688            dialog.set_title(WINDOW_TITLE_BASE)
    680689            result = dialog.run()
    681690            dialog.hide()
Note: See TracChangeset for help on using the changeset viewer.