Index: src/mlx/gui/gui.py
===================================================================
--- src/mlx/gui/gui.py	(revision 997)
+++ src/mlx/gui/gui.py	(revision 999)
@@ -502,5 +502,5 @@
 
         dialog = Gtk.MessageDialog(parent = self._mainWindow,
-                                   type = MESSAGETYPE_ERROR,
+                                   type = Gtk.MessageType.ERROR,
                                    message_format = xstr("conn_failed"))
 
@@ -533,5 +533,5 @@
         self._statusbar.updateConnection(self._connecting, self._connected)
 
-        dialog = Gtk.MessageDialog(type = MESSAGETYPE_ERROR,
+        dialog = Gtk.MessageDialog(type = Gtk.MessageType.ERROR,
                                    message_format = xstr("conn_broken"),
                                    parent = self._mainWindow)
@@ -592,9 +592,9 @@
         """Cancel the current file, if the user confirms it."""
         dialog = Gtk.MessageDialog(parent = self._mainWindow,
-                                   type = MESSAGETYPE_QUESTION,
+                                   type = Gtk.MessageType.QUESTION,
                                    message_format = xstr("cancelFlight_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)
@@ -602,5 +602,5 @@
         dialog.hide()
 
-        if result==RESPONSETYPE_YES:
+        if result==Gtk.ResponseType.YES:
             self.reset()
 
@@ -741,12 +741,12 @@
         iconified = Gdk.WindowState.ICONIFIED
 
-        if (event.changed_mask&WINDOW_STATE_WITHDRAWN)!=0:
-            if (event.new_window_state&WINDOW_STATE_WITHDRAWN)!=0:
+        if (event.changed_mask&Gdk.WindowState.WITHDRAWN)!=0:
+            if (event.new_window_state&Gdk.WindowState.WITHDRAWN)!=0:
                 self._statusIcon.mainWindowHidden()
             else:
                 self._statusIcon.mainWindowShown()
 
-        if (event.changed_mask&WINDOW_STATE_ICONIFIED)!=0 and \
-           (event.new_window_state&WINDOW_STATE_ICONIFIED)==0:
+        if (event.changed_mask&Gdk.WindowState.ICONIFIED)!=0 and \
+           (event.new_window_state&Gdk.WindowState.ICONIFIED)==0:
             self._mainWindow.present()
 
@@ -931,7 +931,7 @@
 
             dialog = Gtk.MessageDialog(parent = self.mainWindow,
-                                       type = MESSAGETYPE_ERROR,
+                                       type = Gtk.MessageType.ERROR,
                                        message_format = xstr("fleet_failed"))
-            dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+            dialog.add_button(xstr("button_ok"), Gtk.ResponseType.OK)
             dialog.set_title(WINDOW_TITLE_BASE)
             dialog.run()
@@ -976,7 +976,7 @@
         else:
             dialog = Gtk.MessageDialog(parent = self.mainWindow,
-                                       type = MESSAGETYPE_ERROR,
+                                       type = Gtk.MessageType.ERROR,
                                        message_format = xstr("fleet_update_failed"))
-            dialog.add_button(xstr("button_ok"), RESPONSETYPE_ACCEPT)
+            dialog.add_button(xstr("button_ok"), Gtk.ResponseType.ACCEPT)
             dialog.set_title(WINDOW_TITLE_BASE)
             dialog.run()
@@ -1077,5 +1077,6 @@
         loadPIREPMenuItem.add_accelerator("activate", accelGroup,
                                           ord(xstr("menu_file_loadPIREP_key")),
-                                          CONTROL_MASK, ACCEL_VISIBLE)
+                                          Gdk.ModifierType.CONTROL_MASK,
+                                          Gtk.AccelFlags.VISIBLE)
         loadPIREPMenuItem.connect("activate", self._loadPIREP)
         fileMenu.append(loadPIREPMenuItem)
@@ -1088,5 +1089,6 @@
         quitMenuItem.add_accelerator("activate", accelGroup,
                                      ord(xstr("menu_file_quit_key")),
-                                     CONTROL_MASK, ACCEL_VISIBLE)
+                                     Gdk.ModifierType.CONTROL_MASK,
+                                     Gtk.AccelFlags.VISIBLE)
         quitMenuItem.connect("activate", self._quit)
         fileMenu.append(quitMenuItem)
@@ -1103,5 +1105,6 @@
         timetableMenuItem.add_accelerator("activate", accelGroup,
                                           ord(xstr("menu_tools_timetable_key")),
-                                          CONTROL_MASK, ACCEL_VISIBLE)
+                                          Gdk.ModifierType.CONTROL_MASK,
+                                          Gtk.AccelFlags.VISIBLE)
         timetableMenuItem.connect("activate", self.showTimetable)
         self._timetableMenuItem.set_sensitive(False)
@@ -1114,5 +1117,6 @@
         flightsMenuItem.add_accelerator("activate", accelGroup,
                                         ord(xstr("menu_tools_flights_key")),
-                                        CONTROL_MASK, ACCEL_VISIBLE)
+                                        Gdk.ModifierType.CONTROL_MASK,
+                                        Gtk.AccelFlags.VISIBLE)
         flightsMenuItem.connect("activate", self.showFlights)
         self._flightsMenuItem.set_sensitive(False)
@@ -1124,5 +1128,6 @@
         checklistMenuItem.add_accelerator("activate", accelGroup,
                                           ord(xstr("menu_tools_chklst_key")),
-                                          CONTROL_MASK, ACCEL_VISIBLE)
+                                          Gdk.ModifierType.CONTROL_MASK,
+                                          Gtk.AccelFlags.VISIBLE)
         checklistMenuItem.connect("activate", self._editChecklist)
         toolsMenu.append(checklistMenuItem)
@@ -1133,5 +1138,6 @@
         approachCalloutsMenuItem.add_accelerator("activate", accelGroup,
                                                  ord(xstr("menu_tools_callouts_key")),
-                                                 CONTROL_MASK, ACCEL_VISIBLE)
+                                                 Gdk.ModifierType.CONTROL_MASK,
+                                                 Gtk.AccelFlags.VISIBLE)
         approachCalloutsMenuItem.connect("activate", self._editApproachCallouts)
         toolsMenu.append(approachCalloutsMenuItem)
@@ -1142,5 +1148,6 @@
         prefsMenuItem.add_accelerator("activate", accelGroup,
                                       ord(xstr("menu_tools_prefs_key")),
-                                      CONTROL_MASK, ACCEL_VISIBLE)
+                                      Gdk.ModifierType.CONTROL_MASK,
+                                      Gtk.AccelFlags.VISIBLE)
         prefsMenuItem.connect("activate", self._editPreferences)
         toolsMenu.append(prefsMenuItem)
@@ -1153,5 +1160,6 @@
         bugReportMenuItem.add_accelerator("activate", accelGroup,
                                           ord(xstr("menu_tools_bugreport_key")),
-                                          CONTROL_MASK, ACCEL_VISIBLE)
+                                          Gdk.ModifierType.CONTROL_MASK,
+                                          Gtk.AccelFlags.VISIBLE)
         bugReportMenuItem.connect("activate", self._reportBug)
         toolsMenu.append(bugReportMenuItem)
@@ -1168,5 +1176,6 @@
         self._showMonitorMenuItem.add_accelerator("activate", accelGroup,
                                                   ord(xstr("menu_view_monitor_key")),
-                                                  CONTROL_MASK, ACCEL_VISIBLE)
+                                                  Gdk.ModifierType.CONTROL_MASK,
+                                                  Gtk.AccelFlags.VISIBLE)
         self._showMonitorMenuItem.connect("toggled", self._toggleMonitorWindow)
         viewMenu.append(self._showMonitorMenuItem)
@@ -1178,5 +1187,6 @@
         showDebugMenuItem.add_accelerator("activate", accelGroup,
                                           ord(xstr("menu_view_debug_key")),
-                                          CONTROL_MASK, ACCEL_VISIBLE)
+                                          Gdk.ModifierType.CONTROL_MASK,
+                                          Gtk.AccelFlags.VISIBLE)
         showDebugMenuItem.connect("toggled", self._toggleDebugLog)
         viewMenu.append(showDebugMenuItem)
@@ -1192,5 +1202,6 @@
         manualMenuItem.add_accelerator("activate", accelGroup,
                                        ord(xstr("menu_help_manual_key")),
-                                       CONTROL_MASK, ACCEL_VISIBLE)
+                                       Gdk.ModifierType.CONTROL_MASK,
+                                       Gtk.AccelFlags.VISIBLE)
         manualMenuItem.connect("activate", self._showManual)
         helpMenu.append(manualMenuItem)
@@ -1203,5 +1214,6 @@
         aboutMenuItem.add_accelerator("activate", accelGroup,
                                       ord(xstr("menu_help_about_key")),
-                                      CONTROL_MASK, ACCEL_VISIBLE)
+                                      Gdk.ModifierType.CONTROL_MASK,
+                                      Gtk.AccelFlags.VISIBLE)
         aboutMenuItem.connect("activate", self._showAbout)
         helpMenu.append(aboutMenuItem)
@@ -1254,12 +1266,12 @@
         """Quit from the application."""
         if force:
-            result=RESPONSETYPE_YES
+            result=Gtk.ResponseType.YES
         else:
             dialog = Gtk.MessageDialog(parent = self._mainWindow,
-                                       type = MESSAGETYPE_QUESTION,
+                                       type = Gtk.MessageType.QUESTION,
                                        message_format = xstr("quit_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)
@@ -1267,5 +1279,5 @@
             dialog.hide()
 
-        if result==RESPONSETYPE_YES:
+        if result==Gtk.ResponseType.YES:
             self._statusIcon.destroy()
             return Gtk.main_quit()
@@ -1324,7 +1336,7 @@
         else:
             dialog = Gtk.MessageDialog(parent = self.mainWindow,
-                                       type = MESSAGETYPE_ERROR,
+                                       type = Gtk.MessageType.ERROR,
                                        message_format = xstr("timetable_failed"))
-            dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+            dialog.add_button(xstr("button_ok"), Gtk.ResponseType.OK)
             dialog.set_title(WINDOW_TITLE_BASE)
             dialog.run()
@@ -1354,7 +1366,7 @@
         else:
             dialog = Gtk.MessageDialog(parent = self.mainWindow,
-                                       type = MESSAGETYPE_ERROR,
+                                       type = Gtk.MessageType.ERROR,
                                        message_format = xstr("acceptedflt_failed"))
-            dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+            dialog.add_button(xstr("button_ok"), Gtk.ResponseType.OK)
             dialog.set_title(WINDOW_TITLE_BASE)
             dialog.run()
@@ -1419,5 +1431,5 @@
         self._pirepEditor.setPIREP(pirep)
         self._pirepEditor.show_all()
-        if self._pirepEditor.run()==RESPONSETYPE_OK:
+        if self._pirepEditor.run()==Gtk.ResponseType.OK:
             self.beginBusy(xstr("pirepEdit_save_busy"))
             self.webHandler.sendPIREP(self._pirepUpdatedCallback, pirep,
@@ -1434,5 +1446,5 @@
         self.endBusy()
         secondaryMarkup = None
-        type = MESSAGETYPE_ERROR
+        type = Gtk.MessageType.ERROR
         if returned:
             if result.success:
@@ -1454,5 +1466,5 @@
             dialog = Gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
                                        type = type, message_format = messageFormat)
-            dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+            dialog.add_button(xstr("button_ok"), Gtk.ResponseType.OK)
             dialog.set_title(WINDOW_TITLE_BASE)
             if secondaryMarkup is not None:
@@ -1478,5 +1490,5 @@
         dialog.hide()
 
-        if result==RESPONSETYPE_OK:
+        if result==Gtk.ResponseType.OK:
             self._lastLoadedPIREP = dialog.get_filename()
 
@@ -1484,7 +1496,7 @@
             if pirep is None:
                 dialog = Gtk.MessageDialog(parent = self._mainWindow,
-                                           type = MESSAGETYPE_ERROR,
+                                           type = Gtk.MessageType.ERROR,
                                            message_format = xstr("loadPIREP_failed"))
-                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("loadPIREP_failed_sec"))
@@ -1497,5 +1509,5 @@
                     result = dialog.run()
 
-                    if result==RESPONSETYPE_OK:
+                    if result==Gtk.ResponseType.OK:
                         self.sendPIREP(pirep)
                     elif result==1:
@@ -1513,8 +1525,8 @@
             dialog = Gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +
                                            xstr("loadPIREP_browser_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 = self._mainWindow)
             dialog.set_modal(True)
@@ -1541,5 +1553,5 @@
                             xstr("loadPIREP_send_title"),
                             parent = self._mainWindow,
-                            flags = DIALOG_MODAL)
+                            flags = Gtk.DialogFlags.MODAL)
 
         contentArea = dialog.get_content_area()
@@ -1636,7 +1648,7 @@
         table.attach(labelAlignment, 1, 2, 4, 5)
 
-        dialog.add_button(xstr("button_cancel"), RESPONSETYPE_REJECT)
+        dialog.add_button(xstr("button_cancel"), Gtk.ResponseType.REJECT)
         dialog.add_button(xstr("viewPIREP"), 1)
-        dialog.add_button(xstr("sendPIREP"), RESPONSETYPE_OK)
+        dialog.add_button(xstr("sendPIREP"), Gtk.ResponseType.OK)
 
         return dialog
@@ -1656,8 +1668,8 @@
         self.endBusy()
         secondaryMarkup = None
-        type = MESSAGETYPE_ERROR
+        type = Gtk.MessageType.ERROR
         if returned:
             if result.success:
-                type = MESSAGETYPE_INFO
+                type = Gtk.MessageType.INFO
                 messageFormat = xstr("sendPIREP_success")
                 secondaryMarkup = xstr("sendPIREP_success_sec")
@@ -1677,5 +1689,5 @@
         dialog = Gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
                                    type = type, message_format = messageFormat)
-        dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+        dialog.add_button(xstr("button_ok"), Gtk.ResponseType.OK)
         dialog.set_title(WINDOW_TITLE_BASE)
         if secondaryMarkup is not None:
@@ -1723,8 +1735,8 @@
         self.endBusy()
         secondaryMarkup = None
-        type = MESSAGETYPE_ERROR
+        type = Gtk.MessageType.ERROR
         if returned:
             if result.success:
-                type = MESSAGETYPE_INFO
+                type = Gtk.MessageType.INFO
                 messageFormat = xstr("sendBugReport_success") % (result.ticketID,)
                 secondaryMarkup = xstr("sendBugReport_success_sec")
@@ -1738,5 +1750,5 @@
         dialog = Gtk.MessageDialog(parent = self._wizard.gui._bugReportDialog,
                                    type = type, message_format = messageFormat)
-        dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
+        dialog.add_button(xstr("button_ok"), Gtk.ResponseType.OK)
         dialog.set_title(WINDOW_TITLE_BASE)
         if secondaryMarkup is not None:
@@ -1815,5 +1827,5 @@
 
             logoPath = os.path.join(self._programDirectory, "logo.png")
-            logo = pixbuf_new_from_file(logoPath)
+            logo = GdkPixbuf.Pixbuf.new_from_file(logoPath)
             dialog.set_logo(logo)
 
@@ -1887,5 +1899,5 @@
             response = dialog.run()
 
-            if response==RESPONSETYPE_OK:
+            if response==Gtk.ResponseType.OK:
                 self._credentialsUserName = dialog.userName
                 self._credentialsPassword = dialog.password
@@ -1915,5 +1927,5 @@
         if not self.config.pilotID and not self.config.password:
             dialog = Gtk.MessageDialog(parent = self._mainWindow,
-                                       type = MESSAGETYPE_QUESTION,
+                                       type = Gtk.MessageType.QUESTION,
                                        message_format = xstr("register_ask"))
 
