Index: src/mlx/gui/flight.py
===================================================================
--- src/mlx/gui/flight.py	(revision 998)
+++ src/mlx/gui/flight.py	(revision 999)
@@ -641,5 +641,5 @@
         dialog.hide()
 
-        if response==RESPONSETYPE_OK:
+        if response==Gtk.ResponseType.OK:
             fileName = dialog.get_filename()
             print("Saving", fileName)
@@ -650,8 +650,8 @@
                 print("Failed to save flight:", util.utf2unicode(str(e)))
                 dialog = Gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
-                                           type = MESSAGETYPE_ERROR,
+                                           type = Gtk.MessageType.ERROR,
                                            message_format =
                                            xstr("flightsel_save_failed"))
-                dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+                dialog.add_button(xstr("button_ok"), Gtk.ResponseType.OK)
                 dialog.set_title(WINDOW_TITLE_BASE)
                 secondary = xstr("flightsel_save_failed_sec")
@@ -716,5 +716,5 @@
         font = Pango.FontDescription("sans")
         font.set_size(int(32 * scale * Pango.SCALE))
-        font.set_weight(Pango.WEIGHT_NORMAL)
+        font.set_weight(Pango.Weight.NORMAL)
         layout.set_font_description(font)
 
@@ -932,5 +932,5 @@
         dialog.hide()
 
-        if response==RESPONSETYPE_OK:
+        if response==Gtk.ResponseType.OK:
             fileName = dialog.get_filename()
             print("Loading", fileName)
@@ -943,8 +943,8 @@
                 print("Failed to load flight:", util.utf2unicode(str(e)))
                 dialog = Gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
-                                           type = MESSAGETYPE_ERROR,
+                                           type = Gtk.MessageType.ERROR,
                                            message_format =
                                            xstr("flightsel_load_failed"))
-                dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+                dialog.add_button(xstr("button_ok"), Gtk.ResponseType.OK)
                 dialog.set_title(WINDOW_TITLE_BASE)
                 secondary = xstr("flightsel_load_failed_sec")
@@ -1026,8 +1026,8 @@
         dialog = Gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +
                                        xstr("flightsel_save_title"),
-                                       action = FILE_CHOOSER_ACTION_SAVE,
+                                       action = Gtk.FileChooserAction.SAVE,
                                        buttons = (Gtk.STOCK_CANCEL,
-                                                  RESPONSETYPE_CANCEL,
-                                                  Gtk.STOCK_OK, RESPONSETYPE_OK),
+                                                  Gtk.ResponseType.CANCEL,
+                                                  Gtk.STOCK_OK, Gtk.ResponseType.OK),
                                        parent = gui.mainWindow)
         dialog.set_modal(True)
@@ -1056,8 +1056,8 @@
         dialog = Gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +
                                        xstr("flightsel_load_title"),
-                                       action = FILE_CHOOSER_ACTION_OPEN,
+                                       action = Gtk.FileChooserAction.OPEN,
                                        buttons = (Gtk.STOCK_CANCEL,
-                                                  RESPONSETYPE_CANCEL,
-                                                  Gtk.STOCK_OK, RESPONSETYPE_OK),
+                                                  Gtk.ResponseType.CANCEL,
+                                                  Gtk.STOCK_OK, Gtk.ResponseType.OK),
                                        parent = gui.mainWindow)
         dialog.set_modal(True)
@@ -1228,7 +1228,7 @@
         else:
             dialog = Gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
-                                       type = MESSAGETYPE_ERROR,
+                                       type = Gtk.MessageType.ERROR,
                                        message_format = xstr("gatesel_conflict"))
-            dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+            dialog.add_button(xstr("button_ok"), Gtk.ResponseType.OK)
             dialog.set_title(WINDOW_TITLE_BASE)
             dialog.format_secondary_markup(xstr("gatesel_conflict_sec"))
@@ -1660,5 +1660,5 @@
             else:
                 secondaryMessage = xstr("register_nologin") % (result.pilotID,)
-            messageType = MESSAGETYPE_INFO
+            messageType = Gtk.MessageType.INFO
 
             config = gui.config
@@ -1673,11 +1673,11 @@
         elif returned and result.emailAlreadyRegistered:
             secondaryMessage = xstr("register_email_already")
-            messageType = MESSAGETYPE_ERROR
+            messageType = Gtk.MessageType.ERROR
         elif returned and result.invalidData:
             secondaryMessage = xstr("register_invalid_data")
-            messageType = MESSAGETYPE_ERROR
+            messageType = Gtk.MessageType.ERROR
         else:
             secondaryMessage = xstr("register_error")
-            messageType = MESSAGETYPE_ERROR
+            messageType = Gtk.MessageType.ERROR
 
         dialog = Gtk.MessageDialog(parent = gui.mainWindow,
@@ -1733,5 +1733,6 @@
         labelAlignment.add(label)
         labelAlignment.resize_children()
-        table.attach(labelAlignment, 0, 1, row, row + 1, xoptions = FILL)
+        table.attach(labelAlignment, 0, 1, row, row + 1,
+                     xoptions = Gtk.AttachOptions.FILL)
 
         alignment = Gtk.Alignment(xalign=0.0, yalign = 0.5,
@@ -1753,5 +1754,6 @@
 
         buttonAlignment.add(button)
-        table.attach(buttonAlignment, 0, 4, row, row + 1, xoptions = FILL,
+        table.attach(buttonAlignment, 0, 4, row, row + 1,
+                     xoptions = Gtk.AttachOptions.FILL,
                      ypadding = 4)
 
@@ -1762,5 +1764,6 @@
         label = Gtk.Label(xstr("student_check_flight_status"))
         labelAlignment.add(label)
-        table.attach(labelAlignment, 0, 1, row, row + 1, xoptions = FILL)
+        table.attach(labelAlignment, 0, 1, row, row + 1,
+                     xoptions = Gtk.AttachOptions.FILL)
 
         alignment = Gtk.Alignment(xalign=0.0, yalign = 0.5,
@@ -1807,5 +1810,6 @@
 
         alignment.add(hbox)
-        table.attach(alignment, 0, 4, row, row + 1, xoptions = FILL)
+        table.attach(alignment, 0, 4, row, row + 1,
+                     xoptions = Gtk.AttachOptions.FILL)
 
     @property
@@ -1895,8 +1899,8 @@
 
         dialog = Gtk.MessageDialog(parent = gui.mainWindow,
-                                   type = MESSAGETYPE_INFO,
+                                   type = Gtk.MessageType.INFO,
                                    message_format = xstr("student_fo"))
 
-        dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+        dialog.add_button(xstr("button_ok"), Gtk.ResponseType.OK)
         dialog.set_title(WINDOW_TITLE_BASE)
         secondary = xstr("student_fo_secondary")
@@ -2501,5 +2505,5 @@
         self._route = Gtk.TextView()
         self._route.set_tooltip_text(xstr("route_route_tooltip"))
-        self._route.set_wrap_mode(WRAP_WORD)
+        self._route.set_wrap_mode(Gtk.WrapMode.WORD)
         self._route.get_buffer().connect("changed", self._routeChanged)
         self._route.get_buffer().connect_after("insert-text", self._routeInserted)
@@ -2626,7 +2630,7 @@
                                                         xstr("simbrief_credentials_title"),
                                                         gui.mainWindow,
-                                                        DIALOG_MODAL)
-        self.add_button(xstr("button_cancel"), RESPONSETYPE_CANCEL)
-        self.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+                                                        Gtk.DialogFlags.MODAL)
+        self.add_button(xstr("button_cancel"), Gtk.ResponseType.CANCEL)
+        self.add_button(xstr("button_ok"), Gtk.ResponseType.OK)
 
         contentArea = self.get_content_area()
@@ -3016,5 +3020,5 @@
             response = dialog.run()
 
-            if response==RESPONSETYPE_OK:
+            if response==Gtk.ResponseType.OK:
                 userName = dialog.userName
                 self._userName.set_text(userName)
@@ -3054,10 +3058,10 @@
                                                                "simbrief_result_unknown")
                 dialog = Gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
-                                           type = MESSAGETYPE_ERROR,
+                                           type = Gtk.MessageType.ERROR,
                                            message_format =
                                            xstr(message) + "\n"+
                                            xstr("simbrief_cancelled"))
 
-                dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+                dialog.add_button(xstr("button_ok"), Gtk.ResponseType.OK)
                 dialog.set_title(WINDOW_TITLE_BASE)
                 secondary = xstr("flightsel_save_failed_sec")
@@ -3239,5 +3243,5 @@
         label.set_use_markup(True)
         label.set_use_underline(True)
-        label.set_justify(JUSTIFY_CENTER)
+        label.set_justify(Gtk.Justification.CENTER)
         label.set_alignment(0.5, 1.0)
 
@@ -3379,5 +3383,5 @@
     def _motionNotify(self, tankFigure, event):
         """Called when the mouse pointer moves within the area of a tank figure."""
-        if self._enabled and event.state==BUTTON1_MASK:
+        if self._enabled and event.state==Gdk.ModifierType.BUTTON1_MASK:
             self._setExpectedFromY(event.y)
 
@@ -3385,11 +3389,11 @@
         """Called when a scroll event is received."""
         if self._enabled:
-            increment = 1 if event.state==CONTROL_MASK \
-                        else 100 if event.state==SHIFT_MASK \
+            increment = 1 if event.state==Gdk.ModifierType.CONTROL_MASK \
+                        else 100 if event.state==Gdk.ModifierType.SHIFT_MASK \
                         else 10 if event.state==0 else 0
             if increment!=0:
-                if event.direction==SCROLL_DOWN:
+                if event.direction==Gdk.ScrollDirection.DOWN:
                     increment *= -1
-                self._expectedButton.spin(SPIN_USER_DEFINED, increment)
+                self._expectedButton.spin(Gtk.SpinType.USER_DEFINED, increment)
 
     def _expectedChanged(self, spinButton):
@@ -4749,5 +4753,5 @@
         dialog.hide()
 
-        if result==RESPONSETYPE_OK:
+        if result==Gtk.ResponseType.OK:
             self._lastSavePath = dialog.get_filename()
             self._savePIREP(page)
@@ -4768,9 +4772,9 @@
 
         if error:
-            type = MESSAGETYPE_ERROR
+            type = Gtk.MessageType.ERROR
             message = xstr("finish_save_failed")
             secondary = xstr("finish_save_failed_sec") % (error,)
         else:
-            type = MESSAGETYPE_INFO
+            type = Gtk.MessageType.INFO
             message = xstr("finish_save_done")
             if automatic:
@@ -4782,5 +4786,5 @@
         dialog = Gtk.MessageDialog(parent = gui.mainWindow,
                                    type = type, message_format = message)
-        dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+        dialog.add_button(xstr("button_ok"), Gtk.ResponseType.OK)
         dialog.set_title(WINDOW_TITLE_BASE)
         if secondary is not None:
@@ -4798,8 +4802,8 @@
             dialog = Gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +
                                            xstr("finish_save_title"),
-                                           action = FILE_CHOOSER_ACTION_SAVE,
+                                           action = Gtk.FileChooserAction.SAVE,
                                            buttons = (Gtk.STOCK_CANCEL,
-                                                      RESPONSETYPE_CANCEL,
-                                                      Gtk.STOCK_OK, RESPONSETYPE_OK),
+                                                      Gtk.ResponseType.CANCEL,
+                                                      Gtk.STOCK_OK, Gtk.ResponseType.OK),
                                            parent = gui.mainWindow)
             dialog.set_modal(True)
@@ -5144,14 +5148,14 @@
         if not self._pirepSent and not self._pirepSaved:
             dialog = Gtk.MessageDialog(parent = gui.mainWindow,
-                                       type = MESSAGETYPE_QUESTION,
+                                       type = Gtk.MessageType.QUESTION,
                                        message_format = xstr("finish_newFlight_question"))
 
-            dialog.add_button(xstr("button_no"), RESPONSETYPE_NO)
-            dialog.add_button(xstr("button_yes"), RESPONSETYPE_YES)
+            dialog.add_button(xstr("button_no"), Gtk.ResponseType.NO)
+            dialog.add_button(xstr("button_yes"), Gtk.ResponseType.YES)
 
             dialog.set_title(WINDOW_TITLE_BASE)
             result = dialog.run()
             dialog.hide()
-            if result!=RESPONSETYPE_YES:
+            if result!=Gtk.ResponseType.YES:
                 return
 
@@ -5350,5 +5354,5 @@
         else:
             dialog = Gtk.MessageDialog(parent = gui.mainWindow,
-                                       type = MESSAGETYPE_ERROR,
+                                       type = Gtk.MessageType.ERROR,
                                        message_format =
                                        xstr("chkfinish_passedset_failed"))
@@ -5882,7 +5886,7 @@
                                    xstr("login_invalid"))
                 dialog = Gtk.MessageDialog(parent = self.gui.mainWindow,
-                                           type = MESSAGETYPE_ERROR,
+                                           type = Gtk.MessageType.ERROR,
                                            message_format = message)
-                dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+                dialog.add_button(xstr("button_ok"), Gtk.ResponseType.OK)
                 dialog.set_title(WINDOW_TITLE_BASE)
                 if isReload:
@@ -5899,7 +5903,7 @@
                       else xstr("login_failconn")
             dialog = Gtk.MessageDialog(parent = self.gui.mainWindow,
-                                       type = MESSAGETYPE_ERROR,
+                                       type = Gtk.MessageType.ERROR,
                                        message_format = message)
-            dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+            dialog.add_button(xstr("button_ok"), Gtk.ResponseType.OK)
             dialog.set_title(WINDOW_TITLE_BASE)
             secondary = xstr("reload_failconn_sec") if isReload \
