Changeset 996:8035d80d5feb


Ignore:
Timestamp:
07/04/19 17:57:45 (5 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
Phase:
public
Message:

Using 'Gtk' instead of 'gtk' (re #347)

Location:
src/mlx/gui
Files:
21 edited

Legend:

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

    r919 r996  
    1818#------------------------------------------------------------------------------
    1919
    20 class ACARS(gtk.VBox):
     20class ACARS(Gtk.VBox):
    2121    """The flight info tab."""
    2222    # The URL of the ACARS map
  • src/mlx/gui/bugreport.py

    r954 r996  
    1818#------------------------------------------------------------------------------
    1919
    20 class BugReportDialog(gtk.Dialog):
     20class BugReportDialog(Gtk.Dialog):
    2121    """The dialog to report a bug."""
    2222    def __init__(self, gui):
     
    3333        contentArea = self.get_content_area()
    3434
    35         contentAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     35        contentAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    3636                                         xscale = 0.0, yscale = 0.0)
    3737        contentAlignment.set_padding(padding_top = 4, padding_bottom = 16,
     
    4040        contentArea.pack_start(contentAlignment, False, False, 0)
    4141
    42         contentVBox = gtk.VBox()
     42        contentVBox = Gtk.VBox()
    4343        contentAlignment.add(contentVBox)
    4444
    45         label = gtk.Label(xstr("bugreport_summary"))
     45        label = Gtk.Label(xstr("bugreport_summary"))
    4646        label.set_use_underline(True)
    4747        label.set_alignment(0.0, 0.5)
     
    4949        contentVBox.pack_start(label, False, False, 4)
    5050
    51         self._summary = summary = gtk.Entry()
     51        self._summary = summary = Gtk.Entry()
    5252        summary.connect("changed", self._summaryChanged)
    5353        summary.set_tooltip_text(xstr("bugreport_summary_tooltip"))
     
    5656        contentVBox.pack_start(summary, True, True, 4)
    5757
    58         label = gtk.Label(xstr("bugreport_description"))
     58        label = Gtk.Label(xstr("bugreport_description"))
    5959        label.set_use_underline(True)
    6060        label.set_alignment(0.0, 0.5)
     
    6262        contentVBox.pack_start(label, False, False, 4)
    6363
    64         self._description = description = gtk.TextView()
     64        self._description = description = Gtk.TextView()
    6565        description.set_tooltip_text(xstr("bugreport_description_tooltip"))
    6666        description.set_wrap_mode(WRAP_WORD)
    6767        label.set_mnemonic_widget(description)
    6868
    69         scrolledWindow = gtk.ScrolledWindow()
     69        scrolledWindow = Gtk.ScrolledWindow()
    7070        scrolledWindow.add(description)
    7171        scrolledWindow.set_size_request(-1, 200)
     
    7373        scrolledWindow.set_shadow_type(SHADOW_IN)
    7474
    75         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.0, xscale = 1.0, yscale = 1.0)
     75        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.0, xscale = 1.0, yscale = 1.0)
    7676        alignment.add(scrolledWindow)
    7777
    7878        contentVBox.pack_start(alignment, True, True, 4)
    7979
    80         emailBox = gtk.HBox()
     80        emailBox = Gtk.HBox()
    8181        contentVBox.pack_start(emailBox, False, False, 4)
    8282
    83         label = gtk.Label(xstr("bugreport_email"))
     83        label = Gtk.Label(xstr("bugreport_email"))
    8484        label.set_use_underline(True)
    8585        label.set_alignment(0.0, 0.5)
     
    8787        emailBox.pack_start(label, False, False, 0)
    8888
    89         alignment = gtk.Alignment()
     89        alignment = Gtk.Alignment()
    9090        emailBox.pack_start(alignment, False, False, 8)
    9191
    92         self._email = email = gtk.Entry()
     92        self._email = email = Gtk.Entry()
    9393        email.set_tooltip_text(xstr("bugreport_email_tooltip"))
    9494        label.set_mnemonic_widget(email)
  • src/mlx/gui/callouts.py

    r995 r996  
    2727#------------------------------------------------------------------------------
    2828
    29 class ApproachCalloutsEditor(gtk.Dialog):
     29class ApproachCalloutsEditor(Gtk.Dialog):
    3030    """The dialog to edit the approach callouts."""
    3131    integerRE = re.compile("[0-9]+")
     
    6767
    6868        # FIXME: common code with the checklist editor
    69         typeBox = gtk.HBox()
    70 
    71         label = gtk.Label(xstr("callouts_aircraftType"))
     69        typeBox = Gtk.HBox()
     70
     71        label = Gtk.Label(xstr("callouts_aircraftType"))
    7272        label.set_use_underline(True)
    7373
    7474        typeBox.pack_start(label, False, False, 4)
    7575
    76         self._aircraftTypeModel = gtk.ListStore(str, int)
     76        self._aircraftTypeModel = Gtk.ListStore(str, int)
    7777        for type in const.aircraftTypes:
    7878            name = aircraftNames[type] if type in aircraftNames \
    7979                   else "Aircraft type #%d" % (type,)
    8080            self._aircraftTypeModel.append([name, type])
    81         self._aircraftType = gtk.ComboBox(model = self._aircraftTypeModel)
    82         renderer = gtk.CellRendererText()
     81        self._aircraftType = Gtk.ComboBox(model = self._aircraftTypeModel)
     82        renderer = Gtk.CellRendererText()
    8383        self._aircraftType.pack_start(renderer, True)
    8484        self._aircraftType.add_attribute(renderer, "text", 0)
     
    9090        typeBox.pack_start(self._aircraftType, True, True, 4)
    9191
    92         typeBoxAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     92        typeBoxAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    9393                                         xscale = 0.0, yscale = 0.0)
    9494        typeBoxAlignment.set_size_request(400, -1)
     
    9898        # FIXME: common code until here, but note that some texts are different
    9999
    100         contentBox = gtk.HBox()       
    101 
    102         controlBox = gtk.VBox()
    103         controlAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     100        contentBox = Gtk.HBox()       
     101
     102        controlBox = Gtk.VBox()
     103        controlAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    104104                                         xscale = 0.0, yscale = 0.0)
    105105        controlAlignment.set_padding(padding_top = 0, padding_bottom = 0,
     
    108108        contentBox.pack_start(controlAlignment, False, False, 0)
    109109
    110         self._addButton = gtk.Button(xstr("callouts_add"))
     110        self._addButton = Gtk.Button(xstr("callouts_add"))
    111111        self._addButton.set_use_underline(True)
    112112        self._addButton.set_tooltip_text(xstr("callouts_add_tooltip"))
    113113        self._addButton.connect("clicked", self._addButtonClicked)
    114         addAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.0,
     114        addAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.0,
    115115                                     xscale = 0.0, yscale = 0.0)
    116116        addAlignment.set_padding(padding_top = 24, padding_bottom = 0,
     
    119119        controlBox.pack_start(addAlignment, False, False, 0)
    120120
    121         self._removeButton = gtk.Button(xstr("callouts_remove"))
     121        self._removeButton = Gtk.Button(xstr("callouts_remove"))
    122122        self._removeButton.set_use_underline(True)
    123123        self._removeButton.set_tooltip_text(xstr("callouts_remove_tooltip"))
     
    125125        self._removeButton.connect("clicked", self._removeButtonClicked)
    126126
    127         removeAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.0,
     127        removeAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.0,
    128128                                        xscale = 0.0, yscale = 0.0)
    129129        removeAlignment.set_padding(padding_top = 24, padding_bottom = 0,
     
    132132        controlBox.pack_start(removeAlignment, False, False, 0)
    133133
    134         self._fileListModel = gtk.ListStore(int, str, str)
     134        self._fileListModel = Gtk.ListStore(int, str, str)
    135135        self._fileListModel.set_sort_column_id(0, SORT_DESCENDING)
    136136
     
    139139        self._lastAddedAltitude = None
    140140       
    141         self._fileList = gtk.TreeView(model = self._fileListModel)
    142 
    143         renderer = gtk.CellRendererSpin()
     141        self._fileList = Gtk.TreeView(model = self._fileListModel)
     142
     143        renderer = Gtk.CellRendererSpin()
    144144        renderer.set_property("editable", True)
    145145
    146         adjustment = gtk.Adjustment(0, 0, 5000, 10, 100)
     146        adjustment = Gtk.Adjustment(0, 0, 5000, 10, 100)
    147147        renderer.set_property("adjustment", adjustment);
    148148        renderer.connect("edited", self._altitudeEdited)
    149149       
    150         column = gtk.TreeViewColumn(xstr("callouts_header_altitude"),
     150        column = Gtk.TreeViewColumn(xstr("callouts_header_altitude"),
    151151                                    renderer, text = 0)
    152152        self._fileList.append_column(column)
     
    159159        column.set_expand(False)
    160160
    161         column = gtk.TreeViewColumn(xstr("callouts_header_path"),
    162                                     gtk.CellRendererText(), text = 1)
     161        column = Gtk.TreeViewColumn(xstr("callouts_header_path"),
     162                                    Gtk.CellRendererText(), text = 1)
    163163        self._fileList.append_column(column)
    164164        column.set_expand(True)
     
    178178        self._buildFileListPopupMenu()
    179179
    180         scrolledWindow = gtk.ScrolledWindow()
     180        scrolledWindow = Gtk.ScrolledWindow()
    181181        scrolledWindow.add(self._fileList)
    182182        scrolledWindow.set_size_request(300, -1)
     
    184184        scrolledWindow.set_shadow_type(SHADOW_IN)
    185185       
    186         fileListAlignment = gtk.Alignment(xscale=1.0, yscale=1.0,
     186        fileListAlignment = Gtk.Alignment(xscale=1.0, yscale=1.0,
    187187                                          xalign=0.5, yalign=0.5)
    188188        fileListAlignment.set_padding(padding_top = 0, padding_bottom = 16,
     
    292292        otherPath = self._hasAltitude(newAltitude, ignorePath = editedPath)
    293293        if otherPath is not None:
    294             dialog = gtk.MessageDialog(parent = self,
     294            dialog = Gtk.MessageDialog(parent = self,
    295295                                       type = MESSAGETYPE_QUESTION,
    296296                                       message_format =
     
    346346        If it does not exist yet, it will be created."""
    347347        if self._fileOpenDialog is None:
    348             dialog = gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +
     348            dialog = Gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +
    349349                                           xstr("callouts_open_title"),
    350350                                           action = FILE_CHOOSER_ACTION_OPEN,
    351                                            buttons = (gtk.STOCK_CANCEL,
     351                                           buttons = (Gtk.STOCK_CANCEL,
    352352                                                      RESPONSETYPE_CANCEL,
    353                                                       gtk.STOCK_OK, RESPONSETYPE_OK),
     353                                                      Gtk.STOCK_OK, RESPONSETYPE_OK),
    354354                                           parent = self)
    355355            dialog.set_modal(True)           
     
    358358            # FIXME: create the filters in one location and use them
    359359            # from there
    360             filter = gtk.FileFilter()
     360            filter = Gtk.FileFilter()
    361361            filter.set_name(xstr("file_filter_audio"))
    362362            filter.add_pattern("*.wav")
     
    364364            dialog.add_filter(filter)
    365365
    366             filter = gtk.FileFilter()
     366            filter = Gtk.FileFilter()
    367367            filter.set_name(xstr("file_filter_all"))
    368368            filter.add_pattern("*.*")
     
    481481    def _buildFileListPopupMenu(self):
    482482        """Build the file list popup menu."""
    483         menu = gtk.Menu()
    484 
    485         menuItem = gtk.MenuItem()
     483        menu = Gtk.Menu()
     484
     485        menuItem = Gtk.MenuItem()
    486486        menuItem.set_label(xstr("callouts_remove"))
    487487        menuItem.set_use_underline(True)
  • src/mlx/gui/cef.py

    r995 r996  
    308308    within."""
    309309    if os.name=="nt":
    310         container = gtk.DrawingArea()
     310        container = Gtk.DrawingArea()
    311311        container.set_property("can-focus", True)
    312312        container.connect("size-allocate", _handleSizeAllocate)
    313313    else:
    314         container = gtk.DrawingArea()
     314        container = Gtk.DrawingArea()
    315315
    316316    container.show()
  • src/mlx/gui/checklist.py

    r994 r996  
    2222#------------------------------------------------------------------------------
    2323
    24 class ChecklistEditor(gtk.Dialog):
     24class ChecklistEditor(Gtk.Dialog):
    2525    """The dialog to edit the checklists."""
    2626    def __init__(self, gui):
     
    3939        contentArea = self.get_content_area()
    4040
    41         typeBox = gtk.HBox()
    42 
    43         label = gtk.Label(xstr("chklst_aircraftType"))
     41        typeBox = Gtk.HBox()
     42
     43        label = Gtk.Label(xstr("chklst_aircraftType"))
    4444        label.set_use_underline(True)
    4545
    4646        typeBox.pack_start(label, False, False, 4)
    4747
    48         self._aircraftTypeModel = gtk.ListStore(str, int)
     48        self._aircraftTypeModel = Gtk.ListStore(str, int)
    4949        for type in const.aircraftTypes:
    5050            name = aircraftNames[type] if type in aircraftNames \
    5151                   else "Aircraft type #%d" % (type,)
    5252            self._aircraftTypeModel.append([name, type])
    53         self._aircraftType = gtk.ComboBox(model = self._aircraftTypeModel)
    54         renderer = gtk.CellRendererText()
     53        self._aircraftType = Gtk.ComboBox(model = self._aircraftTypeModel)
     54        renderer = Gtk.CellRendererText()
    5555        self._aircraftType.pack_start(renderer, True)
    5656        self._aircraftType.add_attribute(renderer, "text", 0)
     
    6262        typeBox.pack_start(self._aircraftType, True, True, 4)
    6363
    64         typeBoxAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     64        typeBoxAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    6565                                         xscale = 0.0, yscale = 0.0)
    6666        typeBoxAlignment.set_size_request(400, -1)
     
    6969        contentArea.pack_start(typeBoxAlignment, False, False, 12)
    7070
    71         fileBox = gtk.HBox()       
    72 
    73         self._fileChooser = gtk.FileChooserWidget()
     71        fileBox = Gtk.HBox()       
     72
     73        self._fileChooser = Gtk.FileChooserWidget()
    7474        self._fileChooser.set_select_multiple(True)
    7575       
    76         filter = gtk.FileFilter()
     76        filter = Gtk.FileFilter()
    7777        filter.set_name(xstr("file_filter_audio"))
    7878        filter.add_pattern("*.wav")
     
    8080        self._fileChooser.add_filter(filter)
    8181           
    82         filter = gtk.FileFilter()
     82        filter = Gtk.FileFilter()
    8383        filter.set_name(xstr("file_filter_all"))
    8484        filter.add_pattern("*.*")
     
    9090        fileBox.pack_start(self._fileChooser, True, True, 4)
    9191
    92         controlBox = gtk.VBox()
    93         controlAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     92        controlBox = Gtk.VBox()
     93        controlAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    9494                                         xscale = 0.0, yscale = 0.0)
    9595        controlAlignment.set_padding(padding_top = 0, padding_bottom = 0,
     
    9898        fileBox.pack_start(controlAlignment, False, False, 0)
    9999
    100         self._addButton = gtk.Button(xstr("chklst_add"))
     100        self._addButton = Gtk.Button(xstr("chklst_add"))
    101101        self._addButton.set_use_underline(True)
    102102        self._addButton.set_tooltip_text(xstr("chklst_add_tooltip"))
    103103        self._addButton.connect("clicked", self._addButtonClicked)
    104         addAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.0,
     104        addAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.0,
    105105                                     xscale = 0.0, yscale = 0.0)
    106106        addAlignment.set_padding(padding_top = 64, padding_bottom = 0,
     
    109109        controlBox.pack_start(addAlignment, False, False, 0)
    110110
    111         self._removeButton = gtk.Button(xstr("chklst_remove"))
     111        self._removeButton = Gtk.Button(xstr("chklst_remove"))
    112112        self._removeButton.set_use_underline(True)
    113113        self._removeButton.set_tooltip_text(xstr("chklst_remove_tooltip"))
     
    115115        self._removeButton.connect("clicked", self._removeButtonClicked)
    116116
    117         removeAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.0,
     117        removeAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.0,
    118118                                        xscale = 0.0, yscale = 0.0)
    119119        removeAlignment.set_padding(padding_top = 64, padding_bottom = 0,
     
    122122        controlBox.pack_start(removeAlignment, False, False, 0)
    123123
    124         self._moveUpButton = gtk.Button(xstr("chklst_moveUp"))
     124        self._moveUpButton = Gtk.Button(xstr("chklst_moveUp"))
    125125        self._moveUpButton.set_use_underline(True)
    126126        self._moveUpButton.set_tooltip_text(xstr("chklst_moveUp_tooltip"))
     
    128128        self._moveUpButton.connect("clicked", self._moveUpButtonClicked)
    129129
    130         moveUpAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.0,
     130        moveUpAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.0,
    131131                                        xscale = 0.0, yscale = 0.0)
    132132        moveUpAlignment.set_padding(padding_top = 16, padding_bottom = 0,
     
    135135        controlBox.pack_start(moveUpAlignment, False, False, 0)
    136136
    137         self._moveDownButton = gtk.Button(xstr("chklst_moveDown"))
     137        self._moveDownButton = Gtk.Button(xstr("chklst_moveDown"))
    138138        self._moveDownButton.set_use_underline(True)
    139139        self._moveDownButton.set_tooltip_text(xstr("chklst_moveDown_tooltip"))
     
    141141        self._moveDownButton.connect("clicked", self._moveDownButtonClicked)
    142142
    143         moveDownAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.0,
     143        moveDownAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.0,
    144144                                        xscale = 0.0, yscale = 0.0)
    145145        moveDownAlignment.set_padding(padding_top = 4, padding_bottom = 0,
     
    148148        controlBox.pack_start(moveDownAlignment, False, False, 0)
    149149
    150         self._fileListModel = gtk.ListStore(str, str)
    151         self._fileList = gtk.TreeView(model = self._fileListModel)
     150        self._fileListModel = Gtk.ListStore(str, str)
     151        self._fileList = Gtk.TreeView(model = self._fileListModel)
    152152        self._fileList.connect("button-press-event",
    153153                               self._fileListButtonPressed)
    154         column = gtk.TreeViewColumn(xstr("chklst_header"),
    155                                     gtk.CellRendererText(), text = 0)
     154        column = Gtk.TreeViewColumn(xstr("chklst_header"),
     155                                    Gtk.CellRendererText(), text = 0)
    156156        column.set_expand(True)
    157157        column.set_clickable(False)
     
    167167        self._buildFileListPopupMenu()
    168168
    169         scrolledWindow = gtk.ScrolledWindow()
     169        scrolledWindow = Gtk.ScrolledWindow()
    170170        scrolledWindow.add(self._fileList)
    171171        scrolledWindow.set_size_request(200, -1)
     
    329329    def _buildFileListPopupMenu(self):
    330330        """Build the file list popup menu."""
    331         menu = gtk.Menu()
    332 
    333         menuItem = gtk.MenuItem()
     331        menu = Gtk.Menu()
     332
     333        menuItem = Gtk.MenuItem()
    334334        menuItem.set_label(xstr("chklst_remove"))
    335335        menuItem.set_use_underline(True)
     
    340340        menu.append(menuItem)
    341341
    342         menuItem = gtk.MenuItem()
     342        menuItem = Gtk.MenuItem()
    343343        menuItem.set_label(xstr("chklst_moveUp"))
    344344        menuItem.set_use_underline(True)
     
    349349        menu.append(menuItem)
    350350
    351         menuItem = gtk.MenuItem()
     351        menuItem = Gtk.MenuItem()
    352352        menuItem.set_label(xstr("chklst_moveDown"))
    353353        menuItem.set_use_underline(True)
  • src/mlx/gui/common.py

    r995 r996  
    2626from gi.repository import GdkPixbuf as gdkPixbuf
    2727gi.require_version("Gtk", "3.0")
    28 from gi.repository import Gtk as gtk
     28from gi.repository import Gtk
    2929try:
    3030    gi.require_version("AppIndicator3", "0.1")
     
    3636
    3737
    38 MESSAGETYPE_ERROR = gtk.MessageType.ERROR
    39 MESSAGETYPE_QUESTION = gtk.MessageType.QUESTION
    40 MESSAGETYPE_INFO = gtk.MessageType.INFO
    41 RESPONSETYPE_NONE = gtk.ResponseType.NONE
    42 RESPONSETYPE_OK = gtk.ResponseType.OK
    43 RESPONSETYPE_YES = gtk.ResponseType.YES
    44 RESPONSETYPE_NO = gtk.ResponseType.NO
    45 RESPONSETYPE_ACCEPT = gtk.ResponseType.ACCEPT
    46 RESPONSETYPE_REJECT = gtk.ResponseType.REJECT
    47 RESPONSETYPE_CANCEL = gtk.ResponseType.CANCEL
    48 ACCEL_VISIBLE = gtk.AccelFlags.VISIBLE
     38MESSAGETYPE_ERROR = Gtk.MessageType.ERROR
     39MESSAGETYPE_QUESTION = Gtk.MessageType.QUESTION
     40MESSAGETYPE_INFO = Gtk.MessageType.INFO
     41RESPONSETYPE_NONE = Gtk.ResponseType.NONE
     42RESPONSETYPE_OK = Gtk.ResponseType.OK
     43RESPONSETYPE_YES = Gtk.ResponseType.YES
     44RESPONSETYPE_NO = Gtk.ResponseType.NO
     45RESPONSETYPE_ACCEPT = Gtk.ResponseType.ACCEPT
     46RESPONSETYPE_REJECT = Gtk.ResponseType.REJECT
     47RESPONSETYPE_CANCEL = Gtk.ResponseType.CANCEL
     48ACCEL_VISIBLE = Gtk.AccelFlags.VISIBLE
    4949CONTROL_MASK = gdk.ModifierType.CONTROL_MASK
    50 DIALOG_MODAL = gtk.DialogFlags.MODAL
    51 WRAP_WORD = gtk.WrapMode.WORD
    52 JUSTIFY_CENTER = gtk.Justification.CENTER
    53 JUSTIFY_LEFT = gtk.Justification.LEFT
     50DIALOG_MODAL = Gtk.DialogFlags.MODAL
     51WRAP_WORD = Gtk.WrapMode.WORD
     52JUSTIFY_CENTER = Gtk.Justification.CENTER
     53JUSTIFY_LEFT = Gtk.Justification.LEFT
    5454
    5555CONTROL_MASK = gdk.ModifierType.CONTROL_MASK
     
    6060SCROLL_DOWN = gdk.ScrollDirection.DOWN
    6161
    62 SPIN_USER_DEFINED = gtk.SpinType.USER_DEFINED
    63 
    64 FILE_CHOOSER_ACTION_SELECT_FOLDER = gtk.FileChooserAction.SELECT_FOLDER
    65 FILE_CHOOSER_ACTION_OPEN = gtk.FileChooserAction.OPEN
    66 FILE_CHOOSER_ACTION_SAVE = gtk.FileChooserAction.SAVE
    67 
    68 SELECTION_MULTIPLE = gtk.SelectionMode.MULTIPLE
    69 
    70 SHADOW_IN = gtk.ShadowType.IN
    71 SHADOW_NONE = gtk.ShadowType.NONE
    72 
    73 POLICY_AUTOMATIC = gtk.PolicyType.AUTOMATIC
    74 POLICY_NEVER = gtk.PolicyType.NEVER
    75 POLICY_ALWAYS = gtk.PolicyType.ALWAYS
     62SPIN_USER_DEFINED = Gtk.SpinType.USER_DEFINED
     63
     64FILE_CHOOSER_ACTION_SELECT_FOLDER = Gtk.FileChooserAction.SELECT_FOLDER
     65FILE_CHOOSER_ACTION_OPEN = Gtk.FileChooserAction.OPEN
     66FILE_CHOOSER_ACTION_SAVE = Gtk.FileChooserAction.SAVE
     67
     68SELECTION_MULTIPLE = Gtk.SelectionMode.MULTIPLE
     69
     70SHADOW_IN = Gtk.ShadowType.IN
     71SHADOW_NONE = Gtk.ShadowType.NONE
     72
     73POLICY_AUTOMATIC = Gtk.PolicyType.AUTOMATIC
     74POLICY_NEVER = Gtk.PolicyType.NEVER
     75POLICY_ALWAYS = Gtk.PolicyType.ALWAYS
    7676
    7777WEIGHT_NORMAL = pango.Weight.NORMAL
     
    8181WINDOW_STATE_WITHDRAWN = gdk.WindowState.WITHDRAWN
    8282
    83 SORT_ASCENDING = gtk.SortType.ASCENDING
    84 SORT_DESCENDING = gtk.SortType.DESCENDING
     83SORT_ASCENDING = Gtk.SortType.ASCENDING
     84SORT_DESCENDING = Gtk.SortType.DESCENDING
    8585
    8686EVENT_BUTTON_PRESS = gdk.EventType.BUTTON_PRESS
    8787
    88 TREE_VIEW_COLUMN_FIXED = gtk.TreeViewColumnSizing.FIXED
    89 
    90 FILL = gtk.AttachOptions.FILL
    91 EXPAND = gtk.AttachOptions.EXPAND
    92 
    93 UPDATE_IF_VALID = gtk.SpinButtonUpdatePolicy.IF_VALID
    94 
    95 SELECTION_MULTIPLE = gtk.SelectionMode.MULTIPLE
     88TREE_VIEW_COLUMN_FIXED = Gtk.TreeViewColumnSizing.FIXED
     89
     90FILL = Gtk.AttachOptions.FILL
     91EXPAND = Gtk.AttachOptions.EXPAND
     92
     93UPDATE_IF_VALID = Gtk.SpinButtonUpdatePolicy.IF_VALID
     94
     95SELECTION_MULTIPLE = Gtk.SelectionMode.MULTIPLE
    9696
    9797pixbuf_new_from_file = gdkPixbuf.Pixbuf.new_from_file
     
    139139#------------------------------------------------------------------------------
    140140
    141 class IntegerEntry(gtk.Entry):
     141class IntegerEntry(Gtk.Entry):
    142142    """An entry that allows only either an empty value, or an integer."""
    143143    def __init__(self, defaultValue = None):
    144144        """Construct the entry."""
    145         gtk.Entry.__init__(self)
     145        Gtk.Entry.__init__(self)
    146146
    147147        self.set_alignment(1.0)
     
    191191#------------------------------------------------------------------------------
    192192
    193 class TimeEntry(gtk.Entry):
     193class TimeEntry(Gtk.Entry):
    194194    """Widget to display and edit a time value in HH:MM format."""
    195195    def __init__(self):
     
    296296            pass
    297297        else:
    298             gtk.gdk.display_get_default().beep()
     298            Gtk.gdk.display_get_default().beep()
    299299            self.stop_emission(signal)
    300300
    301301#------------------------------------------------------------------------------
    302302
    303 class CredentialsDialog(gtk.Dialog):
     303class CredentialsDialog(Gtk.Dialog):
    304304    """A dialog window to ask for a user name and a password."""
    305305    def __init__(self, gui, userName, password,
     
    320320        contentArea = self.get_content_area()
    321321
    322         contentAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     322        contentAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    323323                                         xscale = 0.0, yscale = 0.0)
    324324        contentAlignment.set_padding(padding_top = 4, padding_bottom = 16,
     
    327327        contentArea.pack_start(contentAlignment, False, False, 0)
    328328
    329         contentVBox = gtk.VBox()
     329        contentVBox = Gtk.VBox()
    330330        contentAlignment.add(contentVBox)
    331331
    332332        if infoText is not None:
    333             label = gtk.Label(infoText)
     333            label = Gtk.Label(infoText)
    334334            label.set_alignment(0.0, 0.0)
    335335
    336336            contentVBox.pack_start(label, False, False, 0)
    337337
    338         tableAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     338        tableAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    339339                                       xscale = 0.0, yscale = 0.0)
    340340        tableAlignment.set_padding(padding_top = 24, padding_bottom = 0,
    341341                                   padding_left = 0, padding_right = 0)
    342342
    343         table = gtk.Table(3, 2)
     343        table = Gtk.Table(3, 2)
    344344        table.set_row_spacings(4)
    345345        table.set_col_spacings(16)
     
    349349        contentVBox.pack_start(tableAlignment, True, True, 0)
    350350
    351         label = gtk.Label(userNameLabel)
     351        label = Gtk.Label(userNameLabel)
    352352        label.set_use_underline(True)
    353353        label.set_alignment(0.0, 0.5)
    354354        table.attach(label, 0, 1, 0, 1)
    355355
    356         self._userName = gtk.Entry()
     356        self._userName = Gtk.Entry()
    357357        self._userName.set_width_chars(16)
    358358        # FIXME: enabled the OK button only when there is something in thr
     
    365365        label.set_mnemonic_widget(self._userName)
    366366
    367         label = gtk.Label(passwordLabel)
     367        label = Gtk.Label(passwordLabel)
    368368        label.set_use_underline(True)
    369369        label.set_alignment(0.0, 0.5)
    370370        table.attach(label, 0, 1, 1, 2)
    371371
    372         self._password = gtk.Entry()
     372        self._password = Gtk.Entry()
    373373        self._password.set_visibility(False)
    374374        #self._password.connect("changed",
     
    380380
    381381        if rememberPassword is not None:
    382             self._rememberButton = gtk.CheckButton(rememberLabel)
     382            self._rememberButton = Gtk.CheckButton(rememberLabel)
    383383            self._rememberButton.set_use_underline(True)
    384384            self._rememberButton.set_tooltip_text(rememberTooltip)
     
    522522
    523523    Return a boolean indicating the answer."""
    524     dialog = gtk.MessageDialog(parent = parent,
     524    dialog = Gtk.MessageDialog(parent = parent,
    525525                               type = MESSAGETYPE_QUESTION,
    526526                               message_format = question)
     
    540540                title = WINDOW_TITLE_BASE):
    541541    """Display an error dialog box with the given message."""
    542     dialog = gtk.MessageDialog(parent = parent,
     542    dialog = Gtk.MessageDialog(parent = parent,
    543543                               type = MESSAGETYPE_ERROR,
    544544                               message_format = message)
     
    562562
    563563def createFlightTypeComboBox():
    564         flightTypeModel = gtk.ListStore(str, int)
     564        flightTypeModel = Gtk.ListStore(str, int)
    565565        for type in _const.flightTypes:
    566566            name = "flighttype_" + _const.flightType2string(type)
    567567            flightTypeModel.append([xstr(name), type])
    568568
    569         flightType = gtk.ComboBox(model = flightTypeModel)
    570         renderer = gtk.CellRendererText()
     569        flightType = Gtk.ComboBox(model = flightTypeModel)
     570        renderer = Gtk.CellRendererText()
    571571        flightType.pack_start(renderer, True)
    572572        flightType.add_attribute(renderer, "text", 0)
  • src/mlx/gui/delaycodes.py

    r995 r996  
    1111#------------------------------------------------------------------------------
    1212
    13 class Viewport(gtk.Viewport):
     13class Viewport(Gtk.Viewport):
    1414    """Viewport implementation that alleviates the problem with improper
    1515    resizing by the VBox."""
    1616    def __init__(self):
    1717        """Construct the viewport."""
    18         gtk.Viewport.__init__(self)
     18        Gtk.Viewport.__init__(self)
    1919        self._recursive = False
    2020        self._vboxHeight = None
     
    3434            allocation.height = self._vboxHeight - allocation.y
    3535            self._vboxHeight = None
    36         gtk.Viewport.do_size_allocate(self, allocation)
    37 
    38 class DelayCodeTableBase(gtk.VBox, gtk.Scrollable):
     36        Gtk.Viewport.do_size_allocate(self, allocation)
     37
     38class DelayCodeTableBase(Gtk.VBox, Gtk.Scrollable):
    3939    """PyGObject-specific base class for the delay code table."""
    4040    __gproperties__ = {
    41         "vscroll-policy" : ( gtk.ScrollablePolicy,
     41        "vscroll-policy" : ( Gtk.ScrollablePolicy,
    4242                             "vscroll-policy",
    4343                             "The vertical scrolling policy",
    44                              gtk.ScrollablePolicy.MINIMUM,
     44                             Gtk.ScrollablePolicy.MINIMUM,
    4545                             GObject.PARAM_READWRITE ),
    46         "vadjustment" : ( gtk.Adjustment,
     46        "vadjustment" : ( Gtk.Adjustment,
    4747                          "vadjustment",
    4848                          "The vertical adjustment",
    4949                          GObject.PARAM_READWRITE ),
    50         "hscroll-policy" : ( gtk.ScrollablePolicy,
     50        "hscroll-policy" : ( Gtk.ScrollablePolicy,
    5151                             "hscroll-policy",
    5252                             "The horizontal scrolling policy",
    53                              gtk.ScrollablePolicy.MINIMUM,
     53                             Gtk.ScrollablePolicy.MINIMUM,
    5454                             GObject.PARAM_READWRITE ),
    55         "hadjustment" : ( gtk.Adjustment,
     55        "hadjustment" : ( Gtk.Adjustment,
    5656                          "hadjustment",
    5757                          "The horizontal adjustment",
     
    7474        do_size_allocate() function of VBox()."""
    7575        self._viewport.setVBOXHeight(allocation.height)
    76         gtk.VBox.do_size_allocate(self, allocation)
     76        Gtk.VBox.do_size_allocate(self, allocation)
    7777        self.allocate_column_sizes(allocation)
    7878
     
    109109        """Set the style of the event box from the treeview."""
    110110
    111 class Alignment(gtk.Alignment):
     111class Alignment(Gtk.Alignment):
    112112    """An alignment that remembers the width it was given."""
    113113    def __init__(self, xalign = 0.0, yalign=0.0,
     
    121121        """Called with the new size allocation."""
    122122        self.allocatedWidth = allocation.width
    123         gtk.Alignment.do_size_allocate(self, allocation)
    124 
    125 class TreeView(gtk.TreeView):
     123        Gtk.Alignment.do_size_allocate(self, allocation)
     124
     125class TreeView(Gtk.TreeView):
    126126    def do_size_allocate(self, allocation):
    127127        allocation.height += 1
    128         gtk.TreeView.do_size_allocate(self, allocation)
    129 
    130 #------------------------------------------------------------------------------
    131 
    132 class CheckButton(gtk.CheckButton):
     128        Gtk.TreeView.do_size_allocate(self, allocation)
     129
     130#------------------------------------------------------------------------------
     131
     132class CheckButton(Gtk.CheckButton):
    133133    """A check button that contains a reference to a row in the delay code
    134134    data table."""
     
    184184        self._delayCodeData = None
    185185
    186         self._treeView = TreeView(gtk.ListStore(str, str))
     186        self._treeView = TreeView(Gtk.ListStore(str, str))
    187187        self._treeView.set_rules_hint(True)
    188188
     
    192192        self._checkButtons = []
    193193
    194         self._eventBox = gtk.EventBox()
     194        self._eventBox = Gtk.EventBox()
    195195
    196196        self._table = None
     
    254254        numRows = len(rows)
    255255
    256         column = gtk.TreeViewColumn("", gtk.CellRendererText())
     256        column = Gtk.TreeViewColumn("", Gtk.CellRendererText())
    257257        column.set_sizing(TREE_VIEW_COLUMN_FIXED)
    258258        self._treeView.append_column(column)
    259259
    260260        for header in headers:
    261             column = gtk.TreeViewColumn(header, gtk.CellRendererText())
     261            column = Gtk.TreeViewColumn(header, Gtk.CellRendererText())
    262262            column.set_sizing(TREE_VIEW_COLUMN_FIXED)
    263263            self._treeView.append_column(column)
    264264
    265         self._table = gtk.Table(numRows, numColumns)
     265        self._table = Gtk.Table(numRows, numColumns)
    266266        self._table.set_homogeneous(False)
    267267        self._table.set_col_spacings(16)
     
    276276            (type, elements) = rows[i]
    277277            if type==CAPTION:
    278                 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     278                alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    279279                                          xscale = 1.0)
    280                 label = gtk.Label("<b>" + elements + "</b>")
     280                label = Gtk.Label("<b>" + elements + "</b>")
    281281                label.set_use_markup(True)
    282282                label.set_alignment(0.0, 0.5)
     
    297297
    298298                for j in range(0, numColumns-1):
    299                     label = gtk.Label(elements[j])
     299                    label = Gtk.Label(elements[j])
    300300                    label.set_alignment(0.0, 0.5)
    301301                    alignment = Alignment(xalign = 0.5, yalign = 0.5,
  • src/mlx/gui/faultexplain.py

    r995 r996  
    1919#-------------------------------------------------------------------------------
    2020
    21 class FaultFrame(gtk.Frame):
     21class FaultFrame(Gtk.Frame):
    2222    """A frame containing the information about a single fault.
    2323
     
    2626    def __init__(self, faultText):
    2727        """Construct the frame."""
    28         gtk.Frame.__init__(self)
     28        Gtk.Frame.__init__(self)
    2929
    3030        self._faultText = faultText
    3131
    32         vbox = gtk.VBox()
    33 
    34         self._fault = fault = gtk.Label()
     32        vbox = Gtk.VBox()
     33
     34        self._fault = fault = Gtk.Label()
    3535        fault.set_xalign(0.0)
    3636        fault.set_justify(JUSTIFY_LEFT)
     
    3939        self.faultText = faultText
    4040
    41         faultAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     41        faultAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    4242                                       xscale = 1.0, yscale = 0.0)
    4343        faultAlignment.set_padding(padding_top = 0, padding_bottom = 0,
     
    4646        vbox.pack_start(faultAlignment, True, True, 4)
    4747
    48         self._explanation = explanation = gtk.TextView()
     48        self._explanation = explanation = Gtk.TextView()
    4949        explanation.set_wrap_mode(WRAP_WORD)
    5050        explanation.set_accepts_tab(False)
     
    6060
    6161        styleContext = self.get_style_context()
    62         color = styleContext.get_background_color(gtk.StateFlags.NORMAL)
     62        color = styleContext.get_background_color(Gtk.StateFlags.NORMAL)
    6363        fault.override_background_color(0, color)
    6464
     
    119119#-------------------------------------------------------------------------------
    120120
    121 class FaultExplainWidget(gtk.Frame):
     121class FaultExplainWidget(Gtk.Frame):
    122122    """The widget for the faults and their explanations."""
    123123    @staticmethod
     
    127127
    128128    def __init__(self, gui):
    129         gtk.Frame.__init__(self)
     129        Gtk.Frame.__init__(self)
    130130
    131131        self._gui = gui
     
    134134        label.set_use_underline(True)
    135135
    136         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     136        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    137137                                  xscale = 1.0, yscale = 1.0)
    138138        alignment.set_padding(padding_top = 4, padding_bottom = 4,
    139139                              padding_left = 4, padding_right = 4)
    140140
    141         self._outerBox = outerBox = gtk.EventBox()
     141        self._outerBox = outerBox = Gtk.EventBox()
    142142        outerBox.add(alignment)
    143143
    144         self._innerBox = innerBox = gtk.EventBox()
     144        self._innerBox = innerBox = Gtk.EventBox()
    145145        alignment.add(self._innerBox)
    146146
    147         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     147        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    148148                                  xscale = 1.0, yscale = 1.0)
    149149        alignment.set_padding(padding_top = 0, padding_bottom = 0,
     
    152152        innerBox.add(alignment)
    153153
    154         scroller = gtk.ScrolledWindow()
     154        scroller = Gtk.ScrolledWindow()
    155155        scroller.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
    156156        scroller.set_shadow_type(SHADOW_NONE)
    157157
    158         self._faults = gtk.VBox()
     158        self._faults = Gtk.VBox()
    159159        self._faults.set_homogeneous(False)
    160160        scroller.add(self._faults)
     
    189189        """Add a fault with the given ID and text."""
    190190
    191         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     191        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    192192                                      xscale = 1.0, yscale = 0.0)
    193193        alignment.set_padding(padding_top = 2, padding_bottom = 2,
     
    287287        else:
    288288            outerColour = \
    289                 styleContext.get_border_color(gtk.StateFlags.DROP_ACTIVE)
     289                styleContext.get_border_color(Gtk.StateFlags.DROP_ACTIVE)
    290290            innerColour = self._gui.backgroundColour
    291291
    292         self._outerBox.override_background_color(gtk.StateFlags.NORMAL,
     292        self._outerBox.override_background_color(Gtk.StateFlags.NORMAL,
    293293                                                 outerColour)
    294         self._innerBox.override_background_color(gtk.StateFlags.NORMAL,
     294        self._innerBox.override_background_color(Gtk.StateFlags.NORMAL,
    295295                                                 innerColour)
    296296
  • src/mlx/gui/flight.py

    r995 r996  
    5757#-----------------------------------------------------------------------------
    5858
    59 comboModel = gtk.ListStore(GObject.TYPE_STRING)
     59comboModel = Gtk.ListStore(GObject.TYPE_STRING)
    6060comboModel.append(("N/A",))
    6161comboModel.append(("VECTORS",))
     
    6363#-----------------------------------------------------------------------------
    6464
    65 class Page(gtk.Alignment):
     65class Page(Gtk.Alignment):
    6666    """A page in the flight wizard."""
    6767    def __init__(self, wizard, id, title, help, completedHelp = None):
     
    7272                         padding_left = 12, padding_right = 12)
    7373
    74         frame = gtk.Frame()
     74        frame = Gtk.Frame()
    7575        self.add(frame)
    7676
    77         self._vbox = gtk.VBox()
     77        self._vbox = Gtk.VBox()
    7878        self._vbox.set_homogeneous(False)
    7979        frame.add(self._vbox)
    8080
    81         eventBox = gtk.EventBox()
    82 
    83         alignment = gtk.Alignment(xalign = 0.0, xscale = 0.0)
    84 
    85         titleLabel = gtk.Label(title)
     81        eventBox = Gtk.EventBox()
     82
     83        alignment = Gtk.Alignment(xalign = 0.0, xscale = 0.0)
     84
     85        titleLabel = Gtk.Label(title)
    8686        titleLabel.modify_font(pango.FontDescription("bold 24"))
    8787        alignment.set_padding(padding_top = 4, padding_bottom = 4,
     
    9696        self._titleLabel = titleLabel
    9797
    98         mainBox = gtk.VBox()
    99 
    100         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     98        mainBox = Gtk.VBox()
     99
     100        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    101101                                  xscale = 1.0, yscale = 1.0)
    102102        alignment.set_padding(padding_top = 16, padding_bottom = 16,
     
    105105        self._vbox.pack_start(alignment, True, True, 0)
    106106
    107         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.0,
     107        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.0,
    108108                                  xscale = 0.0, yscale = 0.0)
    109109        alignment.set_padding(padding_top = 0, padding_bottom = 16,
     
    119119            longerHelp = completedHelp
    120120
    121         self._helpLabel = gtk.Label(longerHelp)
     121        self._helpLabel = Gtk.Label(longerHelp)
    122122        # FIXME: should be a constant in common
    123         self._helpLabel.set_justify(gtk.Justification.CENTER)
     123        self._helpLabel.set_justify(Gtk.Justification.CENTER)
    124124        self._helpLabel.set_use_markup(True)
    125125        alignment.add(self._helpLabel)
    126126        mainBox.pack_start(alignment, False, False, 0)
    127127
    128         self._mainAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     128        self._mainAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    129129                                            xscale = 1.0, yscale = 1.0)
    130130        mainBox.pack_start(self._mainAlignment, True, True, 0)
    131131
    132         buttonAlignment =  gtk.Alignment(xalign = 1.0, xscale=0.0, yscale = 0.0)
     132        buttonAlignment =  Gtk.Alignment(xalign = 1.0, xscale=0.0, yscale = 0.0)
    133133        buttonAlignment.set_padding(padding_top = 4, padding_bottom = 10,
    134134                                    padding_left = 16, padding_right = 16)
    135135
    136         self._buttonBox = gtk.HBox()
     136        self._buttonBox = Gtk.HBox()
    137137        self._buttonBox.set_homogeneous(False)
    138138        self._defaultButton = None
     
    175175
    176176        Return the button object created."""
    177         button = gtk.Button(label)
     177        button = Gtk.Button(label)
    178178        self._buttonBox.pack_start(button, False, False, padding)
    179179        button.set_use_underline(True)
     
    220220        """Set the styles of some of the items on the page."""
    221221        context = self.get_style_context()
    222         color = context.get_background_color(gtk.StateFlags.SELECTED)
     222        color = context.get_background_color(Gtk.StateFlags.SELECTED)
    223223        self._titleEventBox.modify_bg(0, color.to_color())
    224         color = context.get_color(gtk.StateFlags.SELECTED)
     224        color = context.get_color(Gtk.StateFlags.SELECTED)
    225225        self._titleLabel.modify_fg(0, color.to_color())
    226226
     
    299299                                        xstr("login"), xstr("loginHelp"))
    300300
    301         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     301        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    302302                                  xscale = 0.0, yscale = 0.0)
    303303
    304         table = gtk.Table(3, 2)
     304        table = Gtk.Table(3, 2)
    305305        table.set_row_spacings(4)
    306306        table.set_col_spacings(32)
     
    308308        self.setMainWidget(alignment)
    309309
    310         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     310        labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    311311                                       xscale = 0.0, yscale = 0.0)
    312         label = gtk.Label(xstr("label_pilotID"))
     312        label = Gtk.Label(xstr("label_pilotID"))
    313313        label.set_use_underline(True)
    314314        labelAlignment.add(label)
    315315        table.attach(labelAlignment, 0, 1, 0, 1)
    316316
    317         self._pilotID = gtk.Entry()
     317        self._pilotID = Gtk.Entry()
    318318        self._pilotID.connect("changed", self._pilotIDChanged)
    319319        self._pilotID.set_tooltip_text(xstr("login_pilotID_tooltip"))
     
    321321        label.set_mnemonic_widget(self._pilotID)
    322322
    323         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     323        labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    324324                                       xscale = 0.0, yscale = 0.0)
    325         label = gtk.Label(xstr("label_password"))
     325        label = Gtk.Label(xstr("label_password"))
    326326        label.set_use_underline(True)
    327327        labelAlignment.add(label)
    328328        table.attach(labelAlignment, 0, 1, 1, 2)
    329329
    330         self._password = gtk.Entry()
     330        self._password = Gtk.Entry()
    331331        self._password.set_visibility(False)
    332332        self._password.connect("changed", self._setControls)
     
    335335        label.set_mnemonic_widget(self._password)
    336336
    337         self._rememberButton = gtk.CheckButton(xstr("remember_password"))
     337        self._rememberButton = Gtk.CheckButton(xstr("remember_password"))
    338338        self._rememberButton.set_use_underline(True)
    339339        self._rememberButton.set_tooltip_text(xstr("login_remember_tooltip"))
     
    440440                                                  help, completedHelp = completedHelp)
    441441
    442         mainBox = gtk.HBox()
     442        mainBox = Gtk.HBox()
    443443        mainBox.set_homogeneous(False)
    444444
    445         leftVBox = gtk.VBox()
    446 
    447         alignment = gtk.Alignment(xscale = 1.0)
     445        leftVBox = Gtk.VBox()
     446
     447        alignment = Gtk.Alignment(xscale = 1.0)
    448448        alignment.set_size_request(100, 0)
    449449
     
    460460        mainBox.pack_start(self._flightList, False, False, 8)
    461461
    462         flightButtonBox = gtk.VBox()
    463 
    464         alignment = gtk.Alignment(xscale = 1.0)
     462        flightButtonBox = Gtk.VBox()
     463
     464        alignment = Gtk.Alignment(xscale = 1.0)
    465465        alignment.set_size_request(100, 0)
    466466        flightButtonBox.pack_start(alignment, False, False, 0)
    467467
    468         flightButtonWidthAlignment = gtk.Alignment(xscale=1.0, yscale=0.0,
     468        flightButtonWidthAlignment = Gtk.Alignment(xscale=1.0, yscale=0.0,
    469469                                                   xalign=0.0, yalign=0.0)
    470470        flightButtonWidthAlignment.set_padding(padding_top = 0,
     
    472472                                               padding_left = 8,
    473473                                               padding_right = 0)
    474         flightButtonWidthBox = gtk.VBox()
    475 
    476         self._saveButton = gtk.Button(xstr("flightsel_save"))
     474        flightButtonWidthBox = Gtk.VBox()
     475
     476        self._saveButton = Gtk.Button(xstr("flightsel_save"))
    477477        self._saveButton.set_use_underline(True)
    478478        self._saveButton.set_sensitive(False)
     
    482482        flightButtonWidthBox.pack_start(self._saveButton, True, True, 4)
    483483
    484         self._printButton = gtk.Button(xstr("flightsel_print"))
     484        self._printButton = Gtk.Button(xstr("flightsel_print"))
    485485        self._printButton.set_use_underline(True)
    486486        self._printButton.set_sensitive(False)
     
    490490        flightButtonWidthBox.pack_start(self._printButton, True, True, 4)
    491491
    492         self._deleteButton = gtk.Button(xstr("flightsel_delete"))
     492        self._deleteButton = Gtk.Button(xstr("flightsel_delete"))
    493493        self._deleteButton.set_use_underline(True)
    494494        self._deleteButton.set_sensitive(False)
     
    649649            except Exception as e:
    650650                print("Failed to save flight:", util.utf2unicode(str(e)))
    651                 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
     651                dialog = Gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
    652652                                           type = MESSAGETYPE_ERROR,
    653653                                           message_format =
     
    669669        flight = self._getSelectedFlight()
    670670
    671         printOperation = gtk.PrintOperation()
     671        printOperation = Gtk.PrintOperation()
    672672        if self._printSettings is not None:
    673673            printOperation.set_print_settings(self._printSettings)
     
    684684        printOperation.set_use_full_page(False)
    685685
    686         result = printOperation.run(gtk.PRINT_OPERATION_ACTION_PRINT_DIALOG,
     686        result = printOperation.run(Gtk.PRINT_OPERATION_ACTION_PRINT_DIALOG,
    687687                                    wizard.gui.mainWindow)
    688688
    689         if result == gtk.PRINT_OPERATION_RESULT_APPLY:
     689        if result == Gtk.PRINT_OPERATION_RESULT_APPLY:
    690690            self._printSettings = printOperation.get_print_settings()
    691         elif result == gtk.PRINT_OPERATION_RESULT_ERROR:
     691        elif result == Gtk.PRINT_OPERATION_RESULT_ERROR:
    692692            errorDialog(xstr("flightsel_print_failed",
    693693                             wizard.gui.mainWindow,
     
    942942            except Exception as e:
    943943                print("Failed to load flight:", util.utf2unicode(str(e)))
    944                 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
     944                dialog = Gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
    945945                                           type = MESSAGETYPE_ERROR,
    946946                                           message_format =
     
    10241024
    10251025        gui = self._wizard.gui
    1026         dialog = gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +
     1026        dialog = Gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +
    10271027                                       xstr("flightsel_save_title"),
    10281028                                       action = FILE_CHOOSER_ACTION_SAVE,
    1029                                        buttons = (gtk.STOCK_CANCEL,
     1029                                       buttons = (Gtk.STOCK_CANCEL,
    10301030                                                  RESPONSETYPE_CANCEL,
    1031                                                   gtk.STOCK_OK, RESPONSETYPE_OK),
     1031                                                  Gtk.STOCK_OK, RESPONSETYPE_OK),
    10321032                                       parent = gui.mainWindow)
    10331033        dialog.set_modal(True)
    10341034        dialog.set_do_overwrite_confirmation(True)
    10351035
    1036         filter = gtk.FileFilter()
     1036        filter = Gtk.FileFilter()
    10371037        filter.set_name(xstr("flightsel_filter_flights"))
    10381038        filter.add_pattern("*.vaflight")
    10391039        dialog.add_filter(filter)
    10401040
    1041         filter = gtk.FileFilter()
     1041        filter = Gtk.FileFilter()
    10421042        filter.set_name(xstr("file_filter_all"))
    10431043        filter.add_pattern("*.*")
     
    10541054
    10551055        gui = self._wizard.gui
    1056         dialog = gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +
     1056        dialog = Gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +
    10571057                                       xstr("flightsel_load_title"),
    10581058                                       action = FILE_CHOOSER_ACTION_OPEN,
    1059                                        buttons = (gtk.STOCK_CANCEL,
     1059                                       buttons = (Gtk.STOCK_CANCEL,
    10601060                                                  RESPONSETYPE_CANCEL,
    1061                                                   gtk.STOCK_OK, RESPONSETYPE_OK),
     1061                                                  Gtk.STOCK_OK, RESPONSETYPE_OK),
    10621062                                       parent = gui.mainWindow)
    10631063        dialog.set_modal(True)
    10641064
    1065         filter = gtk.FileFilter()
     1065        filter = Gtk.FileFilter()
    10661066        filter.set_name(xstr("flightsel_filter_flights"))
    10671067        filter.add_pattern("*.vaflight")
    10681068        dialog.add_filter(filter)
    10691069
    1070         filter = gtk.FileFilter()
     1070        filter = Gtk.FileFilter()
    10711071        filter.set_name(xstr("file_filter_all"))
    10721072        filter.add_pattern("*.*")
     
    10791079    def _createListPopupMenu(self):
    10801080        """Get the flight list popup menu."""
    1081         menu = gtk.Menu()
    1082 
    1083         menuItem = gtk.MenuItem()
     1081        menu = Gtk.Menu()
     1082
     1083        menuItem = Gtk.MenuItem()
    10841084        menuItem.set_label(xstr("flightsel_popup_select"))
    10851085        menuItem.set_use_underline(True)
     
    10891089        menu.append(menuItem)
    10901090
    1091         menuItem = gtk.MenuItem()
     1091        menuItem = Gtk.MenuItem()
    10921092        menuItem.set_label(xstr("flightsel_popup_save"))
    10931093        menuItem.set_use_underline(True)
     
    10971097        menu.append(menuItem)
    10981098
    1099         menuItem = gtk.MenuItem()
     1099        menuItem = Gtk.MenuItem()
    11001100        menuItem.set_label(xstr("flightsel_popup_print"))
    11011101        menuItem.set_use_underline(True)
     
    11051105        menu.append(menuItem)
    11061106
    1107         menuItem = gtk.MenuItem()
     1107        menuItem = Gtk.MenuItem()
    11081108        menuItem.set_label(xstr("flightsel_popup_delete"))
    11091109        menuItem.set_use_underline(True)
     
    11461146                                                xstr("gatesel_help"))
    11471147
    1148         self._listStore = gtk.ListStore(str)
    1149         self._gateList = gtk.TreeView(self._listStore)
    1150         column = gtk.TreeViewColumn(None, gtk.CellRendererText(),
     1148        self._listStore = Gtk.ListStore(str)
     1149        self._gateList = Gtk.TreeView(self._listStore)
     1150        column = Gtk.TreeViewColumn(None, Gtk.CellRendererText(),
    11511151                                    text = 0)
    11521152        column.set_expand(True)
     
    11581158        gateSelection.connect("changed", self._selectionChanged)
    11591159
    1160         scrolledWindow = gtk.ScrolledWindow()
     1160        scrolledWindow = Gtk.ScrolledWindow()
    11611161        scrolledWindow.add(self._gateList)
    11621162        scrolledWindow.set_size_request(50, -1)
    1163         scrolledWindow.set_policy(gtk.PolicyType.AUTOMATIC,
    1164                                   gtk.PolicyType.AUTOMATIC)
    1165         scrolledWindow.set_shadow_type(gtk.ShadowType.IN)
    1166 
    1167         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.0, xscale = 0.0, yscale = 1.0)
     1163        scrolledWindow.set_policy(Gtk.PolicyType.AUTOMATIC,
     1164                                  Gtk.PolicyType.AUTOMATIC)
     1165        scrolledWindow.set_shadow_type(Gtk.ShadowType.IN)
     1166
     1167        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.0, xscale = 0.0, yscale = 1.0)
    11681168        alignment.add(scrolledWindow)
    11691169
     
    12271227            self._wizard.jumpPage("connect")
    12281228        else:
    1229             dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
     1229            dialog = Gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
    12301230                                       type = MESSAGETYPE_ERROR,
    12311231                                       message_format = xstr("gatesel_conflict"))
     
    12651265                                           xstr("register_help"))
    12661266
    1267         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     1267        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    12681268                                  xscale = 0.0, yscale = 0.0)
    12691269
    1270         table = gtk.Table(12, 4)
     1270        table = Gtk.Table(12, 4)
    12711271        table.set_row_spacings(4)
    12721272        table.set_col_spacings(24)
     
    12761276        row = 0
    12771277
    1278         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     1278        labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    12791279                                       xscale = 0.0, yscale = 0.0)
    1280         label = gtk.Label(xstr("register_name1"))
     1280        label = Gtk.Label(xstr("register_name1"))
    12811281        label.set_use_underline(True)
    12821282        labelAlignment.add(label)
    12831283        table.attach(labelAlignment, 0, 1, row, row+1)
    12841284
    1285         self._name1 = gtk.Entry()
     1285        self._name1 = Gtk.Entry()
    12861286        self._name1.connect("changed", self._updateButtons)
    12871287        self._name1.set_tooltip_text(xstr("register_name1_tooltip"))
     
    12901290        label.set_mnemonic_widget(self._name1)
    12911291
    1292         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     1292        labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    12931293                                       xscale = 0.0, yscale = 0.0)
    1294         label = gtk.Label(xstr("register_name2"))
     1294        label = Gtk.Label(xstr("register_name2"))
    12951295        label.set_use_underline(True)
    12961296        labelAlignment.add(label)
    12971297        table.attach(labelAlignment, 2, 3, row, row+1)
    12981298
    1299         self._name2 = gtk.Entry()
     1299        self._name2 = Gtk.Entry()
    13001300        self._name2.connect("changed", self._updateButtons)
    13011301        self._name2.set_tooltip_text(xstr("register_name2_tooltip"))
     
    13061306        row += 1
    13071307
    1308         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     1308        labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    13091309                                       xscale = 0.0, yscale = 0.0)
    1310         label = gtk.Label(xstr("register_year_of_birth"))
     1310        label = Gtk.Label(xstr("register_year_of_birth"))
    13111311        label.set_use_underline(True)
    13121312        labelAlignment.add(label)
    13131313        table.attach(labelAlignment, 0, 1, row, row+1)
    13141314
    1315         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     1315        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    13161316                                  xscale = 0.0, yscale = 0.0)
    13171317
    1318         self._yearOfBirth = gtk.SpinButton()
     1318        self._yearOfBirth = Gtk.SpinButton()
    13191319        self._yearOfBirth.set_increments(step = 1, page = 10)
    13201320        self._yearOfBirth.set_range(min = RegisterPage._minYearOfBirth,
     
    13311331        row += 1
    13321332
    1333         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     1333        labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    13341334                                       xscale = 0.0, yscale = 0.0)
    1335         label = gtk.Label(xstr("register_email"))
     1335        label = Gtk.Label(xstr("register_email"))
    13361336        label.set_use_underline(True)
    13371337        labelAlignment.add(label)
    13381338        table.attach(labelAlignment, 0, 1, row, row+1)
    13391339
    1340         self._emailAddress = gtk.Entry()
     1340        self._emailAddress = Gtk.Entry()
    13411341        self._emailAddress.connect("changed", self._updateButtons)
    13421342        self._emailAddress.set_tooltip_text(xstr("register_email_tooltip"))
     
    13441344        label.set_mnemonic_widget(self._emailAddress)
    13451345
    1346         self._emailAddressPublic = gtk.CheckButton(xstr("register_email_public"))
     1346        self._emailAddressPublic = Gtk.CheckButton(xstr("register_email_public"))
    13471347        self._emailAddressPublic.set_use_underline(True)
    13481348        self._emailAddressPublic.set_tooltip_text(xstr("register_email_public_tooltip"))
     
    13511351        row += 1
    13521352
    1353         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     1353        labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    13541354                                       xscale = 0.0, yscale = 0.0)
    1355         label = gtk.Label(xstr("register_vatsim_id"))
     1355        label = Gtk.Label(xstr("register_vatsim_id"))
    13561356        label.set_use_underline(True)
    13571357        labelAlignment.add(label)
    13581358        table.attach(labelAlignment, 0, 1, row, row+1)
    13591359
    1360         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     1360        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    13611361                                  xscale = 0.0, yscale = 0.0)
    13621362        self._vatsimID = IntegerEntry()
     
    13681368        label.set_mnemonic_widget(self._vatsimID)
    13691369
    1370         labelAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     1370        labelAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    13711371                                       xscale = 0.0, yscale = 0.0)
    1372         label = gtk.Label(xstr("register_ivao_id"))
     1372        label = Gtk.Label(xstr("register_ivao_id"))
    13731373        label.set_use_underline(True)
    13741374        labelAlignment.add(label)
    13751375        table.attach(labelAlignment, 2, 3, row, row+1)
    13761376
    1377         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     1377        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    13781378                                  xscale = 0.0, yscale = 0.0)
    13791379        self._ivaoID = IntegerEntry()
     
    13871387        row += 1
    13881388
    1389         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     1389        labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    13901390                                       xscale = 0.0, yscale = 0.0)
    1391         label = gtk.Label(xstr("register_phone_num"))
     1391        label = Gtk.Label(xstr("register_phone_num"))
    13921392        label.set_use_underline(True)
    13931393        label.set_use_markup(True)
     
    13951395        table.attach(labelAlignment, 0, 1, row, row+1)
    13961396
    1397         self._phoneNumber = gtk.Entry()
     1397        self._phoneNumber = Gtk.Entry()
    13981398        self._phoneNumber.set_tooltip_text(xstr("register_phone_num_tooltip"))
    13991399        table.attach(self._phoneNumber, 1, 2, row, row+1)
     
    14021402        row += 1
    14031403
    1404         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     1404        labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    14051405                                       xscale = 0.0, yscale = 0.0)
    1406         label = gtk.Label(xstr("register_nationality"))
     1406        label = Gtk.Label(xstr("register_nationality"))
    14071407        label.set_use_underline(True)
    14081408        label.set_use_markup(True)
     
    14111411
    14121412
    1413         self._nationality = gtk.Entry()
     1413        self._nationality = Gtk.Entry()
    14141414        self._nationality.set_tooltip_text(xstr("register_nationality_tooltip"))
    14151415        table.attach(self._nationality, 1, 2, row, row+1)
    14161416        label.set_mnemonic_widget(self._nationality)
    14171417
    1418         placeholder = gtk.Label()
     1418        placeholder = Gtk.Label()
    14191419        placeholder.set_text(xstr("register_password_mismatch"))
    14201420        placeholder.set_use_markup(True)
     
    14251425        row += 1
    14261426
    1427         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     1427        labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    14281428                                       xscale = 0.0, yscale = 0.0)
    1429         label = gtk.Label(xstr("register_password"))
     1429        label = Gtk.Label(xstr("register_password"))
    14301430        label.set_use_underline(True)
    14311431        labelAlignment.add(label)
    14321432        table.attach(labelAlignment, 0, 1, row, row+1)
    14331433
    1434         self._password = gtk.Entry()
     1434        self._password = Gtk.Entry()
    14351435        self._password.set_visibility(False)
    14361436        self._password.connect("changed", self._updateButtons)
     
    14391439        label.set_mnemonic_widget(self._password)
    14401440
    1441         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     1441        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    14421442                                  xscale = 0.0, yscale = 0.0)
    1443         self._passwordStatus = gtk.Label()
     1443        self._passwordStatus = Gtk.Label()
    14441444        alignment.add(self._passwordStatus)
    14451445        table.attach(alignment, 2, 4, row, row+1)
     
    14471447        row += 1
    14481448
    1449         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     1449        labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    14501450                                       xscale = 0.0, yscale = 0.0)
    1451         label = gtk.Label(xstr("register_password2"))
     1451        label = Gtk.Label(xstr("register_password2"))
    14521452        label.set_use_underline(True)
    14531453        labelAlignment.add(label)
    14541454        table.attach(labelAlignment, 0, 1, row, row+1)
    14551455
    1456         self._password2 = gtk.Entry()
     1456        self._password2 = Gtk.Entry()
    14571457        self._password2.set_visibility(False)
    14581458        self._password2.connect("changed", self._updateButtons)
     
    14611461        label.set_mnemonic_widget(self._password2)
    14621462
    1463         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     1463        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    14641464                                  xscale = 0.0, yscale = 0.0)
    1465         self._password2Status = gtk.Label()
     1465        self._password2Status = Gtk.Label()
    14661466        alignment.add(self._password2Status)
    14671467        table.attach(alignment, 2, 4, row, row+1)
     
    14691469        row += 1
    14701470
    1471         self._rememberButton = gtk.CheckButton(xstr("remember_password"))
     1471        self._rememberButton = Gtk.CheckButton(xstr("remember_password"))
    14721472        self._rememberButton.set_use_underline(True)
    14731473        self._rememberButton.set_tooltip_text(xstr("login_remember_tooltip"))
     
    16811681            messageType = MESSAGETYPE_ERROR
    16821682
    1683         dialog = gtk.MessageDialog(parent = gui.mainWindow,
     1683        dialog = Gtk.MessageDialog(parent = gui.mainWindow,
    16841684                                   type = messageType,
    16851685                                   message_format = message)
     
    17151715        self._getEntryExamStatusCancelled = False
    17161716
    1717         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     1717        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    17181718                                  xscale = 0.5, yscale = 0.0)
    17191719
    1720         table = gtk.Table(6, 4)
     1720        table = Gtk.Table(6, 4)
    17211721        table.set_row_spacings(4)
    17221722        table.set_col_spacings(0)
     
    17271727        row = 0
    17281728
    1729         labelAlignment = gtk.Alignment(xalign=0.0, yalign = 0.5,
     1729        labelAlignment = Gtk.Alignment(xalign=0.0, yalign = 0.5,
    17301730                                       xscale=0.0, yscale = 0.0)
    1731         label = gtk.Label(xstr("student_entry_exam_status"))
     1731        label = Gtk.Label(xstr("student_entry_exam_status"))
    17321732        label.set_alignment(0.0, 0.5)
    17331733        labelAlignment.add(label)
     
    17351735        table.attach(labelAlignment, 0, 1, row, row + 1, xoptions = FILL)
    17361736
    1737         alignment = gtk.Alignment(xalign=0.0, yalign = 0.5,
     1737        alignment = Gtk.Alignment(xalign=0.0, yalign = 0.5,
    17381738                                  xscale=1.0, yscale = 0.0)
    1739         self._entryExamStatus = gtk.Label()
     1739        self._entryExamStatus = Gtk.Label()
    17401740        self._entryExamStatus.set_use_markup(True)
    17411741        self._entryExamStatus.set_alignment(0.0, 0.5)
     
    17461746        row += 1
    17471747
    1748         buttonAlignment = gtk.Alignment(xalign=0.0, xscale=1.0)
    1749         button = self._entryExamButton = gtk.Button(xstr("student_entry_exam"))
     1748        buttonAlignment = Gtk.Alignment(xalign=0.0, xscale=1.0)
     1749        button = self._entryExamButton = Gtk.Button(xstr("student_entry_exam"))
    17501750        button.set_use_underline(True)
    17511751        button.connect("clicked", self._entryExamClicked)
     
    17581758        row += 3
    17591759
    1760         labelAlignment = gtk.Alignment(xalign=0.0, yalign = 0.5,
     1760        labelAlignment = Gtk.Alignment(xalign=0.0, yalign = 0.5,
    17611761                                       xscale=0.0, yscale = 0.0)
    1762         label = gtk.Label(xstr("student_check_flight_status"))
     1762        label = Gtk.Label(xstr("student_check_flight_status"))
    17631763        labelAlignment.add(label)
    17641764        table.attach(labelAlignment, 0, 1, row, row + 1, xoptions = FILL)
    17651765
    1766         alignment = gtk.Alignment(xalign=0.0, yalign = 0.5,
     1766        alignment = Gtk.Alignment(xalign=0.0, yalign = 0.5,
    17671767                                  xscale=1.0, yscale = 0.0)
    1768         self._checkFlightStatus = gtk.Label()
     1768        self._checkFlightStatus = Gtk.Label()
    17691769        self._checkFlightStatus.set_use_markup(True)
    17701770        self._checkFlightStatus.set_alignment(0.0, 0.5)
     
    17741774        row += 1
    17751775
    1776         alignment = gtk.Alignment(xalign=0.0, xscale=1.0)
    1777 
    1778         hbox = gtk.HBox()
     1776        alignment = Gtk.Alignment(xalign=0.0, xscale=1.0)
     1777
     1778        hbox = Gtk.HBox()
    17791779        hbox.set_homogeneous(False)
    17801780        hbox.set_spacing(0)
    17811781
    1782         aircraftTypesModel = gtk.ListStore(str, int)
     1782        aircraftTypesModel = Gtk.ListStore(str, int)
    17831783        for aircraftType in web.BookedFlight.checkFlightTypes:
    17841784            aircraftTypesModel.append([aircraftNames[aircraftType],
    17851785                                       aircraftType])
    17861786
    1787         aircraftTypeAlignment = gtk.Alignment(xalign = 0.0, xscale = 1.0)
    1788 
    1789         self._aircraftType = gtk.ComboBox(model = aircraftTypesModel)
    1790         renderer = gtk.CellRendererText()
     1787        aircraftTypeAlignment = Gtk.Alignment(xalign = 0.0, xscale = 1.0)
     1788
     1789        self._aircraftType = Gtk.ComboBox(model = aircraftTypesModel)
     1790        renderer = Gtk.CellRendererText()
    17911791        self._aircraftType.pack_start(renderer, True)
    17921792        self._aircraftType.add_attribute(renderer, "text", 0)
     
    17981798        hbox.pack_start(aircraftTypeAlignment, False, False, 0)
    17991799
    1800         buttonAlignment = gtk.Alignment(xalign=0.0, xscale=1.0)
    1801         button = self._checkFlightButton = gtk.Button(xstr("student_check_flight"))
     1800        buttonAlignment = Gtk.Alignment(xalign=0.0, xscale=1.0)
     1801        button = self._checkFlightButton = Gtk.Button(xstr("student_check_flight"))
    18021802        button.set_use_underline(True)
    18031803        button.connect("clicked", self._checkFlightClicked)
     
    18941894        gui = wizard.gui
    18951895
    1896         dialog = gtk.MessageDialog(parent = gui.mainWindow,
     1896        dialog = Gtk.MessageDialog(parent = gui.mainWindow,
    18971897                                   type = MESSAGETYPE_INFO,
    18981898                                   message_format = xstr("student_fo"))
     
    19241924        self._selectSimulator = os.name=="nt" or "FORCE_SELECT_SIM" in os.environ
    19251925
    1926         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     1926        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    19271927                                  xscale = 0.0, yscale = 0.0)
    19281928
    1929         table = gtk.Table(7 if self._selectSimulator else 5, 2)
     1929        table = Gtk.Table(7 if self._selectSimulator else 5, 2)
    19301930        table.set_row_spacings(4)
    19311931        table.set_col_spacings(16)
     
    19341934        self.setMainWidget(alignment)
    19351935
    1936         labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
    1937         label = gtk.Label(xstr("connect_flightno"))
     1936        labelAlignment = Gtk.Alignment(xalign=1.0, xscale=0.0)
     1937        label = Gtk.Label(xstr("connect_flightno"))
    19381938        labelAlignment.add(label)
    19391939        table.attach(labelAlignment, 0, 1, 0, 1)
    19401940
    1941         labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
    1942         self._flightNumber = gtk.Label()
     1941        labelAlignment = Gtk.Alignment(xalign=0.0, xscale=0.0)
     1942        self._flightNumber = Gtk.Label()
    19431943        self._flightNumber.set_width_chars(9)
    19441944        self._flightNumber.set_alignment(0.0, 0.5)
     
    19461946        table.attach(labelAlignment, 1, 2, 0, 1)
    19471947
    1948         labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
    1949         label = gtk.Label(xstr("connect_acft"))
     1948        labelAlignment = Gtk.Alignment(xalign=1.0, xscale=0.0)
     1949        label = Gtk.Label(xstr("connect_acft"))
    19501950        labelAlignment.add(label)
    19511951        table.attach(labelAlignment, 0, 1, 1, 2)
    19521952
    1953         labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
    1954         self._aircraft = gtk.Label()
     1953        labelAlignment = Gtk.Alignment(xalign=0.0, xscale=0.0)
     1954        self._aircraft = Gtk.Label()
    19551955        self._aircraft.set_width_chars(25)
    19561956        self._aircraft.set_alignment(0.0, 0.5)
     
    19581958        table.attach(labelAlignment, 1, 2, 1, 2)
    19591959
    1960         labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
    1961         label = gtk.Label(xstr("connect_tailno"))
     1960        labelAlignment = Gtk.Alignment(xalign=1.0, xscale=0.0)
     1961        label = Gtk.Label(xstr("connect_tailno"))
    19621962        labelAlignment.add(label)
    19631963        table.attach(labelAlignment, 0, 1, 2, 3)
    19641964
    1965         labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
    1966         self._tailNumber = gtk.Label()
     1965        labelAlignment = Gtk.Alignment(xalign=0.0, xscale=0.0)
     1966        self._tailNumber = Gtk.Label()
    19671967        self._tailNumber.set_width_chars(10)
    19681968        self._tailNumber.set_alignment(0.0, 0.5)
     
    19701970        table.attach(labelAlignment, 1, 2, 2, 3)
    19711971
    1972         labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
    1973         label = gtk.Label(xstr("connect_airport"))
     1972        labelAlignment = Gtk.Alignment(xalign=1.0, xscale=0.0)
     1973        label = Gtk.Label(xstr("connect_airport"))
    19741974        labelAlignment.add(label)
    19751975        table.attach(labelAlignment, 0, 1, 3, 4)
    19761976
    1977         labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
    1978         self._departureICAO = gtk.Label()
     1977        labelAlignment = Gtk.Alignment(xalign=0.0, xscale=0.0)
     1978        self._departureICAO = Gtk.Label()
    19791979        self._departureICAO.set_width_chars(6)
    19801980        self._departureICAO.set_alignment(0.0, 0.5)
     
    19821982        table.attach(labelAlignment, 1, 2, 3, 4)
    19831983
    1984         labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
    1985         label = gtk.Label(xstr("connect_gate"))
     1984        labelAlignment = Gtk.Alignment(xalign=1.0, xscale=0.0)
     1985        label = Gtk.Label(xstr("connect_gate"))
    19861986        labelAlignment.add(label)
    19871987        table.attach(labelAlignment, 0, 1, 4, 5)
    19881988
    1989         labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
    1990         self._departureGate = gtk.Label()
     1989        labelAlignment = Gtk.Alignment(xalign=0.0, xscale=0.0)
     1990        self._departureGate = Gtk.Label()
    19911991        self._departureGate.set_width_chars(5)
    19921992        self._departureGate.set_alignment(0.0, 0.5)
     
    19951995
    19961996        if self._selectSimulator:
    1997             labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0, yalign=0.5)
    1998             label = gtk.Label(xstr("connect_sim"))
     1997            labelAlignment = Gtk.Alignment(xalign=1.0, xscale=0.0, yalign=0.5)
     1998            label = Gtk.Label(xstr("connect_sim"))
    19991999            labelAlignment.add(label)
    20002000            table.attach(labelAlignment, 0, 1, 5, 7)
    20012001
    2002             selectAlignment = gtk.Alignment(xalign=0.0, xscale=0.0, yalign=0.5)
    2003 
    2004             selectBox = gtk.HBox()
     2002            selectAlignment = Gtk.Alignment(xalign=0.0, xscale=0.0, yalign=0.5)
     2003
     2004            selectBox = Gtk.HBox()
    20052005            self._selectMSFS = \
    2006                 gtk.RadioButton.new_with_mnemonic_from_widget(None,
     2006                Gtk.RadioButton.new_with_mnemonic_from_widget(None,
    20072007                                                              xstr("connect_sim_msfs"))
    20082008
     
    20102010
    20112011            self._selectXPlane = \
    2012                 gtk.RadioButton.new_with_mnemonic_from_widget(self._selectMSFS,
     2012                Gtk.RadioButton.new_with_mnemonic_from_widget(self._selectMSFS,
    20132013                                                              xstr("connect_sim_xplane"))
    20142014
     
    21012101                                          completedHelp = xstr("payload_chelp"))
    21022102
    2103         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     2103        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    21042104                                  xscale = 0.0, yscale = 0.0)
    21052105
    2106         table = gtk.Table(7, 3)
     2106        table = Gtk.Table(7, 3)
    21072107        table.set_row_spacings(4)
    21082108        table.set_col_spacings(16)
     
    21112111        self.setMainWidget(alignment)
    21122112
    2113         label = gtk.Label(xstr("payload_crew"))
     2113        label = Gtk.Label(xstr("payload_crew"))
    21142114        label.set_use_underline(True)
    21152115        label.set_alignment(0.0, 0.5)
     
    21232123        label.set_mnemonic_widget(self._numCrew)
    21242124
    2125         label = gtk.Label(xstr("payload_pax"))
     2125        label = Gtk.Label(xstr("payload_pax"))
    21262126        label.set_use_underline(True)
    21272127        label.set_alignment(0.0, 0.5)
     
    21352135        label.set_mnemonic_widget(self._numPassengers)
    21362136
    2137         label = gtk.Label(xstr("payload_bag"))
     2137        label = Gtk.Label(xstr("payload_bag"))
    21382138        label.set_use_underline(True)
    21392139        label.set_alignment(0.0, 0.5)
     
    21472147        label.set_mnemonic_widget(self._bagWeight)
    21482148
    2149         table.attach(gtk.Label("kg"), 2, 3, 2, 3)
    2150 
    2151         label = gtk.Label(xstr("payload_cargo"))
     2149        table.attach(Gtk.Label("kg"), 2, 3, 2, 3)
     2150
     2151        label = Gtk.Label(xstr("payload_cargo"))
    21522152        label.set_use_underline(True)
    21532153        label.set_alignment(0.0, 0.5)
     
    21612161        label.set_mnemonic_widget(self._cargoWeight)
    21622162
    2163         table.attach(gtk.Label("kg"), 2, 3, 3, 4)
    2164 
    2165         label = gtk.Label(xstr("payload_mail"))
     2163        table.attach(Gtk.Label("kg"), 2, 3, 3, 4)
     2164
     2165        label = Gtk.Label(xstr("payload_mail"))
    21662166        label.set_use_underline(True)
    21672167        label.set_alignment(0.0, 0.5)
     
    21752175        label.set_mnemonic_widget(self._mailWeight)
    21762176
    2177         table.attach(gtk.Label("kg"), 2, 3, 4, 5)
    2178 
    2179         label = gtk.Label("<b>" + xstr("payload_zfw") + "</b>")
     2177        table.attach(Gtk.Label("kg"), 2, 3, 4, 5)
     2178
     2179        label = Gtk.Label("<b>" + xstr("payload_zfw") + "</b>")
    21802180        label.set_alignment(0.0, 0.5)
    21812181        label.set_use_markup(True)
    21822182        table.attach(label, 0, 1, 5, 6)
    21832183
    2184         self._calculatedZFW = gtk.Label()
     2184        self._calculatedZFW = Gtk.Label()
    21852185        self._calculatedZFW.set_width_chars(6)
    21862186        self._calculatedZFW.set_alignment(1.0, 0.5)
    21872187        table.attach(self._calculatedZFW, 1, 2, 5, 6)
    21882188
    2189         table.attach(gtk.Label("kg"), 2, 3, 5, 6)
    2190 
    2191         self._zfwButton = gtk.Button(xstr("payload_fszfw"))
     2189        table.attach(Gtk.Label("kg"), 2, 3, 5, 6)
     2190
     2191        self._zfwButton = Gtk.Button(xstr("payload_fszfw"))
    21922192        self._zfwButton.set_use_underline(True)
    21932193        self._zfwButton.connect("clicked", self._zfwRequested)
     
    21952195        table.attach(self._zfwButton, 0, 1, 6, 7)
    21962196
    2197         self._simulatorZFW = gtk.Label("-")
     2197        self._simulatorZFW = Gtk.Label("-")
    21982198        self._simulatorZFW.set_width_chars(6)
    21992199        self._simulatorZFW.set_alignment(1.0, 0.5)
     
    22012201        self._simulatorZFWValue = None
    22022202
    2203         table.attach(gtk.Label("kg"), 2, 3, 6, 7)
     2203        table.attach(Gtk.Label("kg"), 2, 3, 6, 7)
    22042204
    22052205        self.addCancelFlightButton()
     
    23292329                                       completedHelp = xstr("time_chelp"))
    23302330
    2331         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     2331        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    23322332                                  xscale = 0.0, yscale = 0.0)
    23332333
    2334         table = gtk.Table(3, 2)
     2334        table = Gtk.Table(3, 2)
    23352335        table.set_row_spacings(4)
    23362336        table.set_col_spacings(16)
     
    23392339        self.setMainWidget(alignment)
    23402340
    2341         label = gtk.Label(xstr("time_departure"))
     2341        label = Gtk.Label(xstr("time_departure"))
    23422342        label.set_alignment(0.0, 0.5)
    23432343        table.attach(label, 0, 1, 0, 1)
    23442344
    2345         self._departure = gtk.Label()
     2345        self._departure = Gtk.Label()
    23462346        self._departure.set_alignment(0.0, 0.5)
    23472347        table.attach(self._departure, 1, 2, 0, 1)
    23482348
    2349         label = gtk.Label(xstr("time_arrival"))
     2349        label = Gtk.Label(xstr("time_arrival"))
    23502350        label.set_alignment(0.0, 0.5)
    23512351        table.attach(label, 0, 1, 1, 2)
    23522352
    2353         self._arrival = gtk.Label()
     2353        self._arrival = Gtk.Label()
    23542354        self._arrival.set_alignment(0.0, 0.5)
    23552355        table.attach(self._arrival, 1, 2, 1, 2)
    23562356
    2357         self._timeButton = gtk.Button(xstr("time_fs"))
     2357        self._timeButton = Gtk.Button(xstr("time_fs"))
    23582358        self._timeButton.set_use_underline(True)
    23592359        self._timeButton.set_tooltip_text(xstr("time_fs_tooltip"))
     
    23612361        table.attach(self._timeButton, 0, 1, 2, 3)
    23622362
    2363         self._simulatorTime = gtk.Label("-")
     2363        self._simulatorTime = Gtk.Label("-")
    23642364        self._simulatorTime.set_alignment(0.0, 0.5)
    23652365        table.attach(self._simulatorTime, 1, 2, 2, 3)
     
    24512451                                        completedHelp = xstr("route_chelp"))
    24522452
    2453         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     2453        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    24542454                                  xscale = 0.0, yscale = 0.0)
    24552455
    2456         mainBox = gtk.VBox()
     2456        mainBox = Gtk.VBox()
    24572457        alignment.add(mainBox)
    24582458        self.setMainWidget(alignment)
    24592459
    2460         levelBox = gtk.HBox()
    2461 
    2462         label = gtk.Label(xstr("route_level"))
     2460        levelBox = Gtk.HBox()
     2461
     2462        label = Gtk.Label(xstr("route_level"))
    24632463        label.set_use_underline(True)
    24642464        levelBox.pack_start(label, True, True, 0)
    24652465
    2466         self._cruiseLevel = gtk.SpinButton()
     2466        self._cruiseLevel = Gtk.SpinButton()
    24672467        self._cruiseLevel.set_increments(step = 10, page = 100)
    24682468        self._cruiseLevel.set_range(min = 0, max = 500)
     
    24752475        levelBox.pack_start(self._cruiseLevel, False, False, 8)
    24762476
    2477         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     2477        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    24782478                                  xscale = 0.0, yscale = 0.0)
    24792479        alignment.add(levelBox)
     
    24822482
    24832483
    2484         routeBox = gtk.VBox()
    2485 
    2486         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     2484        routeBox = Gtk.VBox()
     2485
     2486        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    24872487                                  xscale = 0.0, yscale = 0.0)
    2488         label = gtk.Label(xstr("route_route"))
     2488        label = Gtk.Label(xstr("route_route"))
    24892489        label.set_use_underline(True)
    24902490        alignment.add(label)
    24912491        routeBox.pack_start(alignment, True, True, 0)
    24922492
    2493         routeWindow = gtk.ScrolledWindow()
     2493        routeWindow = Gtk.ScrolledWindow()
    24942494        routeWindow.set_size_request(400, 80)
    2495         routeWindow.set_shadow_type(gtk.ShadowType.IN)
    2496         routeWindow.set_policy(gtk.PolicyType.AUTOMATIC,
    2497                                gtk.PolicyType.AUTOMATIC)
     2495        routeWindow.set_shadow_type(Gtk.ShadowType.IN)
     2496        routeWindow.set_policy(Gtk.PolicyType.AUTOMATIC,
     2497                               Gtk.PolicyType.AUTOMATIC)
    24982498
    24992499        self._uppercasingRoute = False
    25002500
    2501         self._route = gtk.TextView()
     2501        self._route = Gtk.TextView()
    25022502        self._route.set_tooltip_text(xstr("route_route_tooltip"))
    25032503        self._route.set_wrap_mode(WRAP_WORD)
     
    25112511        mainBox.pack_start(routeBox, True, True, 8)
    25122512
    2513         alternateBox = gtk.HBox()
    2514 
    2515         label = gtk.Label(xstr("route_altn"))
     2513        alternateBox = Gtk.HBox()
     2514
     2515        label = Gtk.Label(xstr("route_altn"))
    25162516        label.set_use_underline(True)
    25172517        alternateBox.pack_start(label, True, True, 0)
    25182518
    2519         self._alternate = gtk.Entry()
     2519        self._alternate = Gtk.Entry()
    25202520        self._alternate.set_width_chars(6)
    25212521        self._alternate.connect("changed", self._alternateChanged)
     
    25252525        alternateBox.pack_start(self._alternate, False, False, 8)
    25262526
    2527         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     2527        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    25282528                                  xscale = 0.0, yscale = 0.0)
    25292529        alignment.add(alternateBox)
     
    26192619#-----------------------------------------------------------------------------
    26202620
    2621 class SimBriefCredentialsDialog(gtk.Dialog):
     2621class SimBriefCredentialsDialog(Gtk.Dialog):
    26222622    """A dialog window to ask for SimBrief credentials."""
    26232623    def __init__(self, gui, userName, password, rememberPassword):
     
    26322632        contentArea = self.get_content_area()
    26332633
    2634         contentAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     2634        contentAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    26352635                                         xscale = 0.0, yscale = 0.0)
    26362636        contentAlignment.set_padding(padding_top = 4, padding_bottom = 16,
     
    26392639        contentArea.pack_start(contentAlignment, False, False, 0)
    26402640
    2641         contentVBox = gtk.VBox()
     2641        contentVBox = Gtk.VBox()
    26422642        contentAlignment.add(contentVBox)
    26432643
    2644         label = gtk.Label(xstr("simbrief_login_failed"))
     2644        label = Gtk.Label(xstr("simbrief_login_failed"))
    26452645        label.set_alignment(0.0, 0.0)
    26462646
    26472647        contentVBox.pack_start(label, False, False, 0)
    26482648
    2649         tableAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     2649        tableAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    26502650                                       xscale = 0.0, yscale = 0.0)
    26512651        tableAlignment.set_padding(padding_top = 24, padding_bottom = 0,
    26522652                                   padding_left = 0, padding_right = 0)
    26532653
    2654         table = gtk.Table(3, 2)
     2654        table = Gtk.Table(3, 2)
    26552655        table.set_row_spacings(4)
    26562656        table.set_col_spacings(16)
     
    26602660        contentVBox.pack_start(tableAlignment, True, True, 0)
    26612661
    2662         label = gtk.Label(xstr("simbrief_username"))
     2662        label = Gtk.Label(xstr("simbrief_username"))
    26632663        label.set_use_underline(True)
    26642664        label.set_alignment(0.0, 0.5)
    26652665        table.attach(label, 0, 1, 0, 1)
    26662666
    2667         self._userName = gtk.Entry()
     2667        self._userName = Gtk.Entry()
    26682668        self._userName.set_width_chars(16)
    26692669        #self._userName.connect("changed",
     
    26742674        label.set_mnemonic_widget(self._userName)
    26752675
    2676         label = gtk.Label(xstr("simbrief_password"))
     2676        label = Gtk.Label(xstr("simbrief_password"))
    26772677        label.set_use_underline(True)
    26782678        label.set_alignment(0.0, 0.5)
    26792679        table.attach(label, 0, 1, 1, 2)
    26802680
    2681         self._password = gtk.Entry()
     2681        self._password = Gtk.Entry()
    26822682        self._password.set_visibility(False)
    26832683        #self._password.connect("changed",
     
    26882688        label.set_mnemonic_widget(self._password)
    26892689
    2690         self._rememberButton = gtk.CheckButton(xstr("simbrief_remember_password"))
     2690        self._rememberButton = Gtk.CheckButton(xstr("simbrief_remember_password"))
    26912691        self._rememberButton.set_use_underline(True)
    26922692        self._rememberButton.set_tooltip_text(xstr("simbrief_remember_tooltip"))
     
    27792779                                                xstr("simbrief_setup_chelp"))
    27802780
    2781         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     2781        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    27822782                                  xscale = 0.0, yscale = 0.0)
    27832783
    2784         table = gtk.Table(9, 3)
     2784        table = Gtk.Table(9, 3)
    27852785        table.set_row_spacings(4)
    27862786        table.set_col_spacings(16)
     
    27892789        self.setMainWidget(alignment)
    27902790
    2791         label = gtk.Label(xstr("simbrief_username"))
     2791        label = Gtk.Label(xstr("simbrief_username"))
    27922792        label.set_use_underline(True)
    27932793        label.set_alignment(0.0, 0.5)
    27942794        table.attach(label, 0, 1, 0, 1)
    27952795
    2796         self._userName = gtk.Entry()
     2796        self._userName = Gtk.Entry()
    27972797        self._userName.set_width_chars(16)
    27982798        self._userName.connect("changed",
     
    28022802        label.set_mnemonic_widget(self._userName)
    28032803
    2804         label = gtk.Label(xstr("simbrief_password"))
     2804        label = Gtk.Label(xstr("simbrief_password"))
    28052805        label.set_use_underline(True)
    28062806        label.set_alignment(0.0, 0.5)
    28072807        table.attach(label, 0, 1, 1, 2)
    28082808
    2809         self._password = gtk.Entry()
     2809        self._password = Gtk.Entry()
    28102810        self._password.set_visibility(False)
    28112811        self._password.connect("changed",
     
    28152815        label.set_mnemonic_widget(self._password)
    28162816
    2817         self._rememberButton = gtk.CheckButton(xstr("simbrief_remember_password"))
     2817        self._rememberButton = Gtk.CheckButton(xstr("simbrief_remember_password"))
    28182818        self._rememberButton.set_use_underline(True)
    28192819        self._rememberButton.set_tooltip_text(xstr("simbrief_remember_tooltip"))
    28202820        table.attach(self._rememberButton, 1, 2, 2, 3, ypadding = 8)
    28212821
    2822         label = gtk.Label(xstr("simbrief_extra_fuel"))
     2822        label = Gtk.Label(xstr("simbrief_extra_fuel"))
    28232823        label.set_use_underline(True)
    28242824        label.set_alignment(0.0, 0.5)
     
    28312831        label.set_mnemonic_widget(self._extraFuel)
    28322832
    2833         table.attach(gtk.Label("kg"), 2, 3, 3, 4)
    2834 
    2835         label = gtk.Label(xstr("simbrief_takeoff_runway"))
     2833        table.attach(Gtk.Label("kg"), 2, 3, 3, 4)
     2834
     2835        label = Gtk.Label(xstr("simbrief_takeoff_runway"))
    28362836        label.set_use_underline(True)
    28372837        label.set_alignment(0.0, 0.5)
    28382838        table.attach(label, 0, 1, 4, 5)
    28392839
    2840         self._takeoffRunway = gtk.Entry()
     2840        self._takeoffRunway = Gtk.Entry()
    28412841        self._takeoffRunway.set_width_chars(10)
    28422842        self._takeoffRunway.set_tooltip_text(xstr("simbrief_takeoff_runway_tooltip"))
     
    28452845        label.set_mnemonic_widget(self._takeoffRunway)
    28462846
    2847         label = gtk.Label(xstr("simbrief_landing_runway"))
     2847        label = Gtk.Label(xstr("simbrief_landing_runway"))
    28482848        label.set_use_underline(True)
    28492849        label.set_alignment(0.0, 0.5)
    28502850        table.attach(label, 0, 1, 5, 6)
    28512851
    2852         self._landingRunway = gtk.Entry()
     2852        self._landingRunway = Gtk.Entry()
    28532853        self._landingRunway.set_width_chars(10)
    28542854        self._landingRunway.set_tooltip_text(xstr("simbrief_takeoff_runway_tooltip"))
     
    28572857        label.set_mnemonic_widget(self._landingRunway)
    28582858
    2859         label = gtk.Label(xstr("simbrief_climb_profile"))
     2859        label = Gtk.Label(xstr("simbrief_climb_profile"))
    28602860        label.set_use_underline(True)
    28612861        label.set_alignment(0.0, 0.5)
    28622862        table.attach(label, 0, 1, 6, 7)
    28632863
    2864         self._climbProfile = gtk.ComboBox()
    2865         renderer = gtk.CellRendererText()
     2864        self._climbProfile = Gtk.ComboBox()
     2865        renderer = Gtk.CellRendererText()
    28662866        self._climbProfile.pack_start(renderer, True)
    28672867        self._climbProfile.add_attribute(renderer, "text", 0)
     
    28702870        label.set_mnemonic_widget(self._climbProfile)
    28712871
    2872         label = gtk.Label(xstr("simbrief_cruise_profile"))
     2872        label = Gtk.Label(xstr("simbrief_cruise_profile"))
    28732873        label.set_use_underline(True)
    28742874        label.set_alignment(0.0, 0.5)
    28752875        table.attach(label, 0, 1, 7, 8)
    28762876
    2877         self._cruiseProfile = gtk.ComboBox()
    2878         renderer = gtk.CellRendererText()
     2877        self._cruiseProfile = Gtk.ComboBox()
     2878        renderer = Gtk.CellRendererText()
    28792879        self._cruiseProfile.pack_start(renderer, True)
    28802880        self._cruiseProfile.add_attribute(renderer, "text", 0)
     
    28832883        label.set_mnemonic_widget(self._cruiseProfile)
    28842884
    2885         label = gtk.Label(xstr("simbrief_descent_profile"))
     2885        label = Gtk.Label(xstr("simbrief_descent_profile"))
    28862886        label.set_use_underline(True)
    28872887        label.set_alignment(0.0, 0.5)
    28882888        table.attach(label, 0, 1, 8, 9)
    28892889
    2890         self._descentProfile = gtk.ComboBox()
    2891         renderer = gtk.CellRendererText()
     2890        self._descentProfile = Gtk.ComboBox()
     2891        renderer = Gtk.CellRendererText()
    28922892        self._descentProfile.pack_start(renderer, True)
    28932893        self._descentProfile.add_attribute(renderer, "text", 0)
     
    29302930                                    (self._descentProfile,
    29312931                                     simBriefData.descentProfiles)]:
    2932             model = gtk.ListStore(str)
     2932            model = Gtk.ListStore(str)
    29332933            for profile in profiles:
    29342934                model.append([profile])
     
    30533053                message = SimBriefSetupPage.result2Message.get(result,
    30543054                                                               "simbrief_result_unknown")
    3055                 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
     3055                dialog = Gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
    30563056                                           type = MESSAGETYPE_ERROR,
    30573057                                           message_format =
     
    31553155                                              xstr("simbrief_result_title"), "")
    31563156
    3157         self._alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     3157        self._alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    31583158                                       xscale = 1.0, yscale = 1.0)
    31593159
     
    32243224#-----------------------------------------------------------------------------
    32253225
    3226 class FuelTank(gtk.VBox):
     3226class FuelTank(Gtk.VBox):
    32273227    """Widget for the fuel tank."""
    32283228    def __init__(self, fuelTank, name, capacity, currentWeight):
     
    32363236        self.expectedWeight = currentWeight
    32373237
    3238         self._label = label = gtk.Label("<b>" + name + "</b>")
     3238        self._label = label = Gtk.Label("<b>" + name + "</b>")
    32393239        label.set_use_markup(True)
    32403240        label.set_use_underline(True)
     
    32423242        label.set_alignment(0.5, 1.0)
    32433243
    3244         self._tankFigure = gtk.EventBox()
     3244        self._tankFigure = Gtk.EventBox()
    32453245        self._tankFigure.set_size_request(38, 200)
    32463246        self._tankFigure.set_visible_window(False)
     
    32523252        self._tankFigure.connect("scroll-event", self._scrolled)
    32533253
    3254         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     3254        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    32553255                                  xscale = 0.0, yscale = 1.0)
    32563256        alignment.add(self._tankFigure)
     
    32583258        self.pack_start(alignment, True, True, 4)
    32593259
    3260         self._expectedButton = gtk.SpinButton()
     3260        self._expectedButton = Gtk.SpinButton()
    32613261        self._expectedButton.set_numeric(True)
    32623262        self._expectedButton.set_range(0, self.capacity)
     
    34143414        self._fuelTanks = []
    34153415        self._fuelTable = None
    3416         self._fuelAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     3416        self._fuelAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    34173417                                            xscale = 0.0, yscale = 1.0)
    34183418        self.setMainWidget(self._fuelAlignment)
     
    34703470
    34713471        self._fuelTanks = []
    3472         self._fuelTable = gtk.Grid()
     3472        self._fuelTable = Gtk.Grid()
    34733473        self._fuelTable.set_column_homogeneous(True)
    34743474        self._fuelTable.set_row_spacing(4)
     
    34813481            self._fuelTanks.append(fuelTank)
    34823482
    3483             alignment = gtk.Alignment(xalign = 0.5, yalign = 1.0,
     3483            alignment = Gtk.Alignment(xalign = 0.5, yalign = 1.0,
    34843484                                      xscale = 1.0, yscale = 0.0)
    34853485            alignment.add(fuelTank.label)
    34863486            self._fuelTable.attach(alignment, index*2, 0, 3, 1)
    34873487
    3488             alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     3488            alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    34893489                                      xscale = 0.0, yscale = 1.0)
    34903490            alignment.add(fuelTank)
     
    34923492
    34933493
    3494             alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     3494            alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    34953495                                      xscale = 1.0, yscale = 0.0)
    34963496            alignment.add(fuelTank.expectedButton)
     
    36073607                                           completedHelp = xstr("briefing_chelp"))
    36083608
    3609         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     3609        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    36103610                                  xscale = 1.0, yscale = 1.0)
    36113611
    3612         mainBox = gtk.VBox()
     3612        mainBox = Gtk.VBox()
    36133613        alignment.add(mainBox)
    36143614        self.setMainWidget(alignment)
    36153615
    3616         self._notamsFrame = gtk.Frame()
     3616        self._notamsFrame = Gtk.Frame()
    36173617        self._notamsFrame.set_label(xstr("briefing_notams_init"))
    3618         scrolledWindow = gtk.ScrolledWindow()
     3618        scrolledWindow = Gtk.ScrolledWindow()
    36193619        scrolledWindow.set_size_request(-1, 128)
    36203620        # FIXME: these constants should be in common
    3621         scrolledWindow.set_policy(gtk.PolicyType.AUTOMATIC,
    3622                                   gtk.PolicyType.AUTOMATIC)
    3623         self._notams = gtk.TextView()
     3621        scrolledWindow.set_policy(Gtk.PolicyType.AUTOMATIC,
     3622                                  Gtk.PolicyType.AUTOMATIC)
     3623        self._notams = Gtk.TextView()
    36243624        self._notams.set_editable(False)
    36253625        self._notams.set_accepts_tab(False)
    3626         self._notams.set_wrap_mode(gtk.WrapMode.WORD)
     3626        self._notams.set_wrap_mode(Gtk.WrapMode.WORD)
    36273627        scrolledWindow.add(self._notams)
    3628         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     3628        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    36293629                                  xscale = 1.0, yscale = 1.0)
    36303630        alignment.set_padding(padding_top = 4, padding_bottom = 0,
     
    36343634        mainBox.pack_start(self._notamsFrame, True, True, 4)
    36353635
    3636         self._metarFrame = gtk.Frame()
     3636        self._metarFrame = Gtk.Frame()
    36373637        self._metarFrame.set_label(xstr("briefing_metar_init"))
    3638         scrolledWindow = gtk.ScrolledWindow()
     3638        scrolledWindow = Gtk.ScrolledWindow()
    36393639        scrolledWindow.set_size_request(-1, 32)
    3640         scrolledWindow.set_policy(gtk.PolicyType.AUTOMATIC,
    3641                                   gtk.PolicyType.AUTOMATIC)
     3640        scrolledWindow.set_policy(Gtk.PolicyType.AUTOMATIC,
     3641                                  Gtk.PolicyType.AUTOMATIC)
    36423642
    36433643        self._updatingMETAR = False
    36443644
    3645         self._metar = gtk.TextView()
     3645        self._metar = Gtk.TextView()
    36463646        self._metar.set_accepts_tab(False)
    3647         self._metar.set_wrap_mode(gtk.WrapMode.WORD)
     3647        self._metar.set_wrap_mode(Gtk.WrapMode.WORD)
    36483648        self._metar.get_buffer().connect("changed", self._metarChanged)
    36493649        self._metar.get_buffer().connect_after("insert-text", self._metarInserted)
    36503650        scrolledWindow.add(self._metar)
    3651         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     3651        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    36523652                                  xscale = 1.0, yscale = 1.0)
    36533653        alignment.set_padding(padding_top = 4, padding_bottom = 0,
     
    37943794        self._forwardAllowed = False
    37953795
    3796         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     3796        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    37973797                                  xscale = 0.0, yscale = 0.0)
    37983798
    3799         table = gtk.Table(9, 24)
     3799        table = Gtk.Table(9, 24)
    38003800        table.set_row_spacings(4)
    38013801        table.set_col_spacings(16)
     
    38063806        row = 0
    38073807
    3808         label = gtk.Label(xstr("takeoff_metar"))
     3808        label = Gtk.Label(xstr("takeoff_metar"))
    38093809        label.set_use_underline(True)
    38103810        label.set_alignment(0.0, 0.5)
    38113811        table.attach(label, 0, 1, row, row+1)
    38123812
    3813         self._metar = gtk.Entry()
     3813        self._metar = Gtk.Entry()
    38143814        self._metar.set_width_chars(40)
    38153815        self._metar.set_tooltip_text(xstr("takeoff_metar_tooltip"))
     
    38233823        row += 1
    38243824
    3825         label = gtk.Label(xstr("takeoff_runway"))
     3825        label = Gtk.Label(xstr("takeoff_runway"))
    38263826        label.set_use_underline(True)
    38273827        label.set_alignment(0.0, 0.5)
    38283828        table.attach(label, 0, 1, row, row+1)
    38293829
    3830         self._runway = gtk.Entry()
     3830        self._runway = Gtk.Entry()
    38313831        self._runway.set_width_chars(10)
    38323832        self._runway.set_tooltip_text(xstr("takeoff_runway_tooltip"))
     
    38373837        row += 1
    38383838
    3839         label = gtk.Label(xstr("takeoff_sid"))
     3839        label = Gtk.Label(xstr("takeoff_sid"))
    38403840        label.set_use_underline(True)
    38413841        label.set_alignment(0.0, 0.5)
    38423842        table.attach(label, 0, 1, row, row+1)
    38433843
    3844         self._sid = gtk.ComboBox.new_with_model_and_entry(comboModel)
     3844        self._sid = Gtk.ComboBox.new_with_model_and_entry(comboModel)
    38453845
    38463846        self._sid.set_entry_text_column(0)
     
    38533853        row += 1
    38543854
    3855         label = gtk.Label(xstr("takeoff_v1"))
     3855        label = Gtk.Label(xstr("takeoff_v1"))
    38563856        label.set_use_markup(True)
    38573857        label.set_use_underline(True)
     
    38663866        label.set_mnemonic_widget(self._v1)
    38673867
    3868         self._v1Unit = gtk.Label(xstr("label_knots"))
     3868        self._v1Unit = Gtk.Label(xstr("label_knots"))
    38693869        self._v1Unit.set_alignment(0.0, 0.5)
    38703870        table.attach(self._v1Unit, 3, 4, row, row+1)
     
    38723872        row += 1
    38733873
    3874         label = gtk.Label(xstr("takeoff_vr"))
     3874        label = Gtk.Label(xstr("takeoff_vr"))
    38753875        label.set_use_markup(True)
    38763876        label.set_use_underline(True)
     
    38853885        label.set_mnemonic_widget(self._vr)
    38863886
    3887         self._vrUnit = gtk.Label(xstr("label_knots"))
     3887        self._vrUnit = Gtk.Label(xstr("label_knots"))
    38883888        self._vrUnit.set_alignment(0.0, 0.5)
    38893889        table.attach(self._vrUnit, 3, 4, row, row+1)
     
    38913891        row += 1
    38923892
    3893         label = gtk.Label(xstr("takeoff_v2"))
     3893        label = Gtk.Label(xstr("takeoff_v2"))
    38943894        label.set_use_markup(True)
    38953895        label.set_use_underline(True)
     
    39043904        label.set_mnemonic_widget(self._v2)
    39053905
    3906         self._v2Unit = gtk.Label(xstr("label_knots"))
     3906        self._v2Unit = Gtk.Label(xstr("label_knots"))
    39073907        self._v2Unit.set_alignment(0.0, 0.5)
    39083908        table.attach(self._v2Unit, 3, 4, row, row+1)
     
    39123912        self._derateType = acft.DERATE_NONE
    39133913
    3914         self._derateLabel = gtk.Label()
     3914        self._derateLabel = Gtk.Label()
    39153915        self._derateLabel.set_use_underline(True)
    39163916        self._derateLabel.set_markup(xstr("takeoff_derate_tupolev"))
     
    39183918        table.attach(self._derateLabel, 0, 1, row, row+1)
    39193919
    3920         self._derate = gtk.Alignment()
     3920        self._derate = Gtk.Alignment()
    39213921        table.attach(self._derate, 2, 4, row, row+1)
    39223922        self._derateWidget = None
     
    39273927        row += 1
    39283928
    3929         self._antiIceOn = gtk.CheckButton(xstr("takeoff_antiice"))
     3929        self._antiIceOn = Gtk.CheckButton(xstr("takeoff_antiice"))
    39303930        self._antiIceOn.set_use_underline(True)
    39313931        self._antiIceOn.set_tooltip_text(xstr("takeoff_antiice_tooltip"))
     
    39343934        row += 1
    39353935
    3936         self._rto = gtk.CheckButton(xstr("takeoff_rto"))
     3936        self._rto = Gtk.CheckButton(xstr("takeoff_rto"))
    39373937        self._rto.set_use_underline(True)
    39383938        self._rto.set_tooltip_text(xstr("takeoff_rto_tooltip"))
     
    41684168            self._derateLabel.set_sensitive(True)
    41694169
    4170             self._derateEntry = gtk.Entry()
     4170            self._derateEntry = Gtk.Entry()
    41714171            self._derateEntry.set_width_chars(7)
    41724172            self._derateEntry.set_tooltip_text(xstr("takeoff_derate_boeing_tooltip"))
     
    41754175            self._derateLabel.set_mnemonic_widget(self._derateEntry)
    41764176
    4177             self._derateUnit = gtk.Label("%")
     4177            self._derateUnit = Gtk.Label("%")
    41784178            self._derateUnit.set_alignment(0.0, 0.5)
    41794179
    4180             self._derateWidget = gtk.Table(3, 1)
     4180            self._derateWidget = Gtk.Table(3, 1)
    41814181            self._derateWidget.set_row_spacings(4)
    41824182            self._derateWidget.set_col_spacings(16)
     
    41924192            self._derateLabel.set_sensitive(True)
    41934193
    4194             self._derateWidget = gtk.Entry()
     4194            self._derateWidget = Gtk.Entry()
    41954195            self._derateWidget.set_width_chars(7)
    41964196            self._derateWidget.set_tooltip_text(xstr("takeoff_derate_epr_tooltip"))
     
    42054205            self._derateLabel.set_sensitive(True)
    42064206
    4207             nominal = gtk.RadioButton.\
     4207            nominal = Gtk.RadioButton.\
    42084208                new_with_label_from_widget(None,
    42094209                                           xstr("takeoff_derate_tupolev_nominal"))
     
    42124212            nominal.connect("toggled", self._derateChanged)
    42134213
    4214             takeoff = gtk.RadioButton.\
     4214            takeoff = Gtk.RadioButton.\
    42154215                new_with_label_from_widget(nominal,
    42164216                                           xstr("takeoff_derate_tupolev_takeoff"))
     
    42224222            self._derateButtons = [nominal, takeoff]
    42234223
    4224             self._derateWidget = gtk.HBox()
     4224            self._derateWidget = Gtk.HBox()
    42254225            self._derateWidget.pack_start(nominal, False, False, 4)
    42264226            self._derateWidget.pack_start(takeoff, False, False, 4)
     
    42304230            self._derateLabel.set_text("")
    42314231
    4232             self._derateWidget = gtk.CheckButton(xstr("takeoff_derate_b462"))
     4232            self._derateWidget = Gtk.CheckButton(xstr("takeoff_derate_b462"))
    42334233            self._derateWidget.set_tooltip_text(xstr("takeoff_derate_b462_tooltip"))
    42344234            self._derateWidget.set_use_underline(True)
     
    42734273        self._activated = False
    42744274
    4275         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.0,
     4275        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.0,
    42764276                                  xscale = 0.0, yscale = 1.0)
    42774277
    4278         mainBox = gtk.VBox()
     4278        mainBox = Gtk.VBox()
    42794279        alignment.add(mainBox)
    42804280        self.setMainWidget(alignment)
    42814281
    4282         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     4282        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    42834283                                  xscale = 0.0, yscale = 0.0)
    42844284        mainBox.pack_start(alignment, False, False, 16)
    42854285
    4286         levelBox = gtk.HBox()
    4287 
    4288         label = gtk.Label(xstr("route_level"))
     4286        levelBox = Gtk.HBox()
     4287
     4288        label = Gtk.Label(xstr("route_level"))
    42894289        label.set_use_underline(True)
    42904290        levelBox.pack_start(label, True, True, 0)
    42914291
    4292         self._cruiseLevel = gtk.SpinButton()
     4292        self._cruiseLevel = Gtk.SpinButton()
    42934293        self._cruiseLevel.set_increments(step = 10, page = 100)
    42944294        self._cruiseLevel.set_range(min = 50, max = 500)
     
    43004300        levelBox.pack_start(self._cruiseLevel, False, False, 8)
    43014301
    4302         self._updateButton = gtk.Button(xstr("cruise_route_level_update"));
     4302        self._updateButton = Gtk.Button(xstr("cruise_route_level_update"));
    43034303        self._updateButton.set_use_underline(True)
    43044304        self._updateButton.set_tooltip_text(xstr("cruise_route_level_update_tooltip"))
     
    43094309        mainBox.pack_start(levelBox, False, False, 0)
    43104310
    4311         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     4311        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    43124312                                  xscale = 0.0, yscale = 1.0)
    43134313        mainBox.pack_start(alignment, True, True, 0)
     
    43874387        self._flightEnded = False
    43884388
    4389         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     4389        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    43904390                                  xscale = 0.0, yscale = 0.0)
    43914391
    4392         table = gtk.Table(7, 24)
     4392        table = Gtk.Table(7, 24)
    43934393        table.set_row_spacings(4)
    43944394        table.set_col_spacings(16)
     
    43994399        row = 0
    44004400
    4401         label = gtk.Label(xstr("landing_metar"))
     4401        label = Gtk.Label(xstr("landing_metar"))
    44024402        label.set_use_underline(True)
    44034403        label.set_alignment(0.0, 0.5)
    44044404        table.attach(label, 1, 2, row, row+1)
    44054405
    4406         self._metar = gtk.Entry()
     4406        self._metar = Gtk.Entry()
    44074407        self._metar.set_width_chars(40)
    44084408        self._metar.set_tooltip_text(xstr("landing_metar_tooltip"))
     
    44164416        row += 1
    44174417
    4418         label = gtk.Label(xstr("landing_star"))
     4418        label = Gtk.Label(xstr("landing_star"))
    44194419        label.set_use_underline(True)
    44204420        label.set_alignment(0.0, 0.5)
    44214421        table.attach(label, 1, 2, row, row + 1)
    44224422
    4423         self._star = gtk.ComboBox.new_with_model_and_entry(comboModel)
     4423        self._star = Gtk.ComboBox.new_with_model_and_entry(comboModel)
    44244424
    44254425        self._star.set_entry_text_column(0)
     
    44334433        row += 1
    44344434
    4435         label = gtk.Label(xstr("landing_transition"))
     4435        label = Gtk.Label(xstr("landing_transition"))
    44364436        label.set_use_underline(True)
    44374437        label.set_alignment(0.0, 0.5)
    44384438        table.attach(label, 1, 2, row, row + 1)
    44394439
    4440         self._transition = gtk.ComboBox.new_with_model_and_entry(comboModel)
     4440        self._transition = Gtk.ComboBox.new_with_model_and_entry(comboModel)
    44414441
    44424442        self._transition.set_entry_text_column(0)
     
    44504450        row += 1
    44514451
    4452         label = gtk.Label(xstr("landing_runway"))
     4452        label = Gtk.Label(xstr("landing_runway"))
    44534453        label.set_use_underline(True)
    44544454        label.set_alignment(0.0, 0.5)
    44554455        table.attach(label, 1, 2, row, row + 1)
    44564456
    4457         self._runway = gtk.Entry()
     4457        self._runway = Gtk.Entry()
    44584458        self._runway.set_width_chars(10)
    44594459        self._runway.set_tooltip_text(xstr("landing_runway_tooltip"))
     
    44644464        row += 1
    44654465
    4466         label = gtk.Label(xstr("landing_approach"))
     4466        label = Gtk.Label(xstr("landing_approach"))
    44674467        label.set_use_underline(True)
    44684468        label.set_alignment(0.0, 0.5)
    44694469        table.attach(label, 1, 2, row, row + 1)
    44704470
    4471         self._approachType = gtk.Entry()
     4471        self._approachType = Gtk.Entry()
    44724472        self._approachType.set_width_chars(10)
    44734473        self._approachType.set_tooltip_text(xstr("landing_approach_tooltip"))
     
    44784478        row += 1
    44794479
    4480         label = gtk.Label(xstr("landing_vref"))
     4480        label = Gtk.Label(xstr("landing_vref"))
    44814481        label.set_use_markup(True)
    44824482        label.set_use_underline(True)
     
    44914491        label.set_mnemonic_widget(self._vref)
    44924492
    4493         self._vrefUnit = gtk.Label(xstr("label_knots"))
     4493        self._vrefUnit = Gtk.Label(xstr("label_knots"))
    44944494        table.attach(self._vrefUnit, 4, 5, row, row + 1)
    44954495
    44964496        row += 1
    44974497
    4498         self._antiIceOn = gtk.CheckButton(xstr("landing_antiice"))
     4498        self._antiIceOn = Gtk.CheckButton(xstr("landing_antiice"))
    44994499        self._antiIceOn.set_use_underline(True)
    45004500        self._antiIceOn.set_tooltip_text(xstr("landing_antiice_tooltip"))
     
    47804780            page.setPIREPSaved()
    47814781
    4782         dialog = gtk.MessageDialog(parent = gui.mainWindow,
     4782        dialog = Gtk.MessageDialog(parent = gui.mainWindow,
    47834783                                   type = type, message_format = message)
    47844784        dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
     
    47964796        if self._savePIREPDialog is None:
    47974797            gui = self._wizard.gui
    4798             dialog = gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +
     4798            dialog = Gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +
    47994799                                           xstr("finish_save_title"),
    48004800                                           action = FILE_CHOOSER_ACTION_SAVE,
    4801                                            buttons = (gtk.STOCK_CANCEL,
     4801                                           buttons = (Gtk.STOCK_CANCEL,
    48024802                                                      RESPONSETYPE_CANCEL,
    4803                                                       gtk.STOCK_OK, RESPONSETYPE_OK),
     4803                                                      Gtk.STOCK_OK, RESPONSETYPE_OK),
    48044804                                           parent = gui.mainWindow)
    48054805            dialog.set_modal(True)
    48064806            dialog.set_do_overwrite_confirmation(True)
    48074807
    4808             filter = gtk.FileFilter()
     4808            filter = Gtk.FileFilter()
    48094809            filter.set_name(xstr("file_filter_pireps"))
    48104810            filter.add_pattern("*.pirep")
    48114811            dialog.add_filter(filter)
    48124812
    4813             filter = gtk.FileFilter()
     4813            filter = Gtk.FileFilter()
    48144814            filter.set_name(xstr("file_filter_all"))
    48154815            filter.add_pattern("*.*")
     
    48304830                                         xstr("finish_title"), help)
    48314831
    4832         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     4832        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    48334833                                  xscale = 0.0, yscale = 0.0)
    48344834
    4835         table = gtk.Table(10, 2)
     4835        table = Gtk.Table(10, 2)
    48364836        table.set_row_spacings(4)
    48374837        table.set_col_spacings(16)
     
    48424842        row = 0
    48434843
    4844         labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
    4845         label = gtk.Label(xstr("finish_rating"))
     4844        labelAlignment = Gtk.Alignment(xalign=1.0, xscale=0.0)
     4845        label = Gtk.Label(xstr("finish_rating"))
    48464846        labelAlignment.add(label)
    48474847        table.attach(labelAlignment, 0, 1, row, row+1)
    48484848
    4849         labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
    4850         self._flightRating = gtk.Label()
     4849        labelAlignment = Gtk.Alignment(xalign=0.0, xscale=0.0)
     4850        self._flightRating = Gtk.Label()
    48514851        self._flightRating.set_width_chars(8)
    48524852        self._flightRating.set_alignment(0.0, 0.5)
     
    48574857        row += 1
    48584858
    4859         labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
    4860         label = gtk.Label(xstr("finish_dep_time"))
     4859        labelAlignment = Gtk.Alignment(xalign=1.0, xscale=0.0)
     4860        label = Gtk.Label(xstr("finish_dep_time"))
    48614861        labelAlignment.add(label)
    48624862        table.attach(labelAlignment, 0, 1, row, row+1)
    48634863
    4864         labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
    4865         self._depTime = gtk.Label()
     4864        labelAlignment = Gtk.Alignment(xalign=0.0, xscale=0.0)
     4865        self._depTime = Gtk.Label()
    48664866        self._depTime.set_width_chars(13)
    48674867        self._depTime.set_alignment(0.0, 0.5)
     
    48734873        row += 1
    48744874
    4875         labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
    4876         label = gtk.Label(xstr("finish_flight_time"))
     4875        labelAlignment = Gtk.Alignment(xalign=1.0, xscale=0.0)
     4876        label = Gtk.Label(xstr("finish_flight_time"))
    48774877        labelAlignment.add(label)
    48784878        table.attach(labelAlignment, 0, 1, row, row+1)
    48794879
    4880         labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
    4881         self._flightTime = gtk.Label()
     4880        labelAlignment = Gtk.Alignment(xalign=0.0, xscale=0.0)
     4881        self._flightTime = Gtk.Label()
    48824882        self._flightTime.set_width_chars(10)
    48834883        self._flightTime.set_alignment(0.0, 0.5)
     
    48884888        row += 1
    48894889
    4890         labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
    4891         label = gtk.Label(xstr("finish_block_time"))
     4890        labelAlignment = Gtk.Alignment(xalign=1.0, xscale=0.0)
     4891        label = Gtk.Label(xstr("finish_block_time"))
    48924892        labelAlignment.add(label)
    48934893        table.attach(labelAlignment, 0, 1, row, row+1)
    48944894
    4895         labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
    4896         self._blockTime = gtk.Label()
     4895        labelAlignment = Gtk.Alignment(xalign=0.0, xscale=0.0)
     4896        self._blockTime = Gtk.Label()
    48974897        self._blockTime.set_width_chars(10)
    48984898        self._blockTime.set_alignment(0.0, 0.5)
     
    49034903        row += 1
    49044904
    4905         labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
    4906         label = gtk.Label(xstr("finish_arr_time"))
     4905        labelAlignment = Gtk.Alignment(xalign=1.0, xscale=0.0)
     4906        label = Gtk.Label(xstr("finish_arr_time"))
    49074907        labelAlignment.add(label)
    49084908        table.attach(labelAlignment, 0, 1, row, row+1)
    49094909
    4910         labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
    4911         self._arrTime = gtk.Label()
     4910        labelAlignment = Gtk.Alignment(xalign=0.0, xscale=0.0)
     4911        self._arrTime = Gtk.Label()
    49124912        self._arrTime.set_width_chars(13)
    49134913        self._arrTime.set_alignment(0.0, 0.5)
     
    49194919        row += 1
    49204920
    4921         labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
    4922         label = gtk.Label(xstr("finish_distance"))
     4921        labelAlignment = Gtk.Alignment(xalign=1.0, xscale=0.0)
     4922        label = Gtk.Label(xstr("finish_distance"))
    49234923        labelAlignment.add(label)
    49244924        table.attach(labelAlignment, 0, 1, row, row+1)
    49254925
    4926         labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
    4927         self._distanceFlown = gtk.Label()
     4926        labelAlignment = Gtk.Alignment(xalign=0.0, xscale=0.0)
     4927        self._distanceFlown = Gtk.Label()
    49284928        self._distanceFlown.set_width_chars(10)
    49294929        self._distanceFlown.set_alignment(0.0, 0.5)
     
    49344934        row += 1
    49354935
    4936         labelAlignment = gtk.Alignment(xalign=1.0, xscale=0.0)
    4937         label = gtk.Label(xstr("finish_fuel"))
     4936        labelAlignment = Gtk.Alignment(xalign=1.0, xscale=0.0)
     4937        label = Gtk.Label(xstr("finish_fuel"))
    49384938        labelAlignment.add(label)
    49394939        table.attach(labelAlignment, 0, 1, row, row+1)
    49404940
    4941         labelAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
    4942         self._fuelUsed = gtk.Label()
     4941        labelAlignment = Gtk.Alignment(xalign=0.0, xscale=0.0)
     4942        self._fuelUsed = Gtk.Label()
    49434943        self._fuelUsed.set_width_chars(10)
    49444944        self._fuelUsed.set_alignment(0.0, 0.5)
     
    49494949        row += 1
    49504950
    4951         labelAlignment = gtk.Alignment(xalign = 1.0, xscale = 0.0,
     4951        labelAlignment = Gtk.Alignment(xalign = 1.0, xscale = 0.0,
    49524952                                       yalign = 0.5, yscale = 0.0)
    4953         label = gtk.Label(xstr("finish_type"))
     4953        label = Gtk.Label(xstr("finish_type"))
    49544954        label.set_use_underline(True)
    49554955        labelAlignment.add(label)
     
    49604960        self._flightType.set_active(0)
    49614961        self._flightType.connect("changed", self._flightTypeChanged)
    4962         flightTypeAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
     4962        flightTypeAlignment = Gtk.Alignment(xalign=0.0, xscale=0.0)
    49634963        flightTypeAlignment.add(self._flightType)
    49644964        table.attach(flightTypeAlignment, 1, 2, row, row+1)
     
    49674967        row += 1
    49684968
    4969         self._onlineFlight = gtk.CheckButton(xstr("finish_online"))
     4969        self._onlineFlight = Gtk.CheckButton(xstr("finish_online"))
    49704970        self._onlineFlight.set_use_underline(True)
    49714971        self._onlineFlight.set_tooltip_text(xstr("finish_online_tooltip"))
    4972         onlineFlightAlignment = gtk.Alignment(xalign=0.0, xscale=0.0)
     4972        onlineFlightAlignment = Gtk.Alignment(xalign=0.0, xscale=0.0)
    49734973        onlineFlightAlignment.add(self._onlineFlight)
    49744974        table.attach(onlineFlightAlignment, 1, 2, row, row + 1)
     
    49764976        row += 1
    49774977
    4978         labelAlignment = gtk.Alignment(xalign = 1.0, xscale = 0.0,
     4978        labelAlignment = Gtk.Alignment(xalign = 1.0, xscale = 0.0,
    49794979                                       yalign = 0.5, yscale = 0.0)
    4980         self._gateLabel = gtk.Label(xstr("finish_gate"))
     4980        self._gateLabel = Gtk.Label(xstr("finish_gate"))
    49814981        self._gateLabel.set_use_underline(True)
    49824982        labelAlignment.add(self._gateLabel)
    49834983        table.attach(labelAlignment, 0, 1, row, row+1)
    49844984
    4985         self._gatesModel = gtk.ListStore(str)
    4986 
    4987         self._gate = gtk.ComboBox(model = self._gatesModel)
    4988         renderer = gtk.CellRendererText()
     4985        self._gatesModel = Gtk.ListStore(str)
     4986
     4987        self._gate = Gtk.ComboBox(model = self._gatesModel)
     4988        renderer = Gtk.CellRendererText()
    49894989        self._gate.pack_start(renderer, True)
    49904990        self._gate.add_attribute(renderer, "text", 0)
    49914991        self._gate.set_tooltip_text(xstr("finish_gate_tooltip"))
    49924992        self._gate.connect("changed", self._gateChanged)
    4993         gateAlignment = gtk.Alignment(xalign=0.0, xscale=1.0)
     4993        gateAlignment = Gtk.Alignment(xalign=0.0, xscale=1.0)
    49944994        gateAlignment.add(self._gate)
    49954995        table.attach(gateAlignment, 1, 2, row, row+1)
     
    51435143        gui = self._wizard.gui
    51445144        if not self._pirepSent and not self._pirepSaved:
    5145             dialog = gtk.MessageDialog(parent = gui.mainWindow,
     5145            dialog = Gtk.MessageDialog(parent = gui.mainWindow,
    51465146                                       type = MESSAGETYPE_QUESTION,
    51475147                                       message_format = xstr("finish_newFlight_question"))
     
    52615261                                                    "")
    52625262
    5263         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     5263        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    52645264                                  xscale = 1.0, yscale = 1.0)
    5265         self._label = gtk.Label()
     5265        self._label = Gtk.Label()
    52665266        alignment.add(self._label)
    52675267
     
    53495349            self._resetGUI()
    53505350        else:
    5351             dialog = gtk.MessageDialog(parent = gui.mainWindow,
     5351            dialog = Gtk.MessageDialog(parent = gui.mainWindow,
    53525352                                       type = MESSAGETYPE_ERROR,
    53535353                                       message_format =
     
    53695369#-----------------------------------------------------------------------------
    53705370
    5371 class Wizard(gtk.VBox):
     5371class Wizard(Gtk.VBox):
    53725372    """The flight wizard."""
    53735373    def __init__(self, gui):
     
    58815881                                   if self.entranceExam else
    58825882                                   xstr("login_invalid"))
    5883                 dialog = gtk.MessageDialog(parent = self.gui.mainWindow,
     5883                dialog = Gtk.MessageDialog(parent = self.gui.mainWindow,
    58845884                                           type = MESSAGETYPE_ERROR,
    58855885                                           message_format = message)
     
    58985898            message = xstr("reload_failconn") if isReload \
    58995899                      else xstr("login_failconn")
    5900             dialog = gtk.MessageDialog(parent = self.gui.mainWindow,
     5900            dialog = Gtk.MessageDialog(parent = self.gui.mainWindow,
    59015901                                       type = MESSAGETYPE_ERROR,
    59025902                                       message_format = message)
  • src/mlx/gui/flightlist.py

    r995 r996  
    2222        self._convertFn = convertFn
    2323        self._renderer = \
    24           gtk.CellRendererText() if renderer is None else renderer
     24          Gtk.CellRendererText() if renderer is None else renderer
    2525        self._extraColumnAttributes = extraColumnAttributes
    2626        self._sortable = sortable
     
    4747
    4848        @param index is the 0-based index of the column."""
    49         if isinstance(self._renderer, gtk.CellRendererText):
    50             column = gtk.TreeViewColumn(self._heading, self._renderer,
     49        if isinstance(self._renderer, Gtk.CellRendererText):
     50            column = Gtk.TreeViewColumn(self._heading, self._renderer,
    5151                                        text = index)
    52         elif isinstance(self._renderer, gtk.CellRendererToggle):
    53             column = gtk.TreeViewColumn(self._heading, self._renderer,
     52        elif isinstance(self._renderer, Gtk.CellRendererToggle):
     53            column = Gtk.TreeViewColumn(self._heading, self._renderer,
    5454                                        active = index)
    5555        else:
    56             column = gtk.TreeViewColumn(self._heading, self._renderer)
     56            column = Gtk.TreeViewColumn(self._heading, self._renderer)
    5757        column.set_expand(True)
    5858        if self._sortable:
     
    8383#-----------------------------------------------------------------------------
    8484
    85 class FlightList(gtk.Alignment):
     85class FlightList(Gtk.Alignment):
    8686    """Construct the flight list.
    8787
     
    114114            columnDescriptor.appendType(types)
    115115
    116         self._model = gtk.ListStore(*types)
     116        self._model = Gtk.ListStore(*types)
    117117        if defaultSortableIndex is not None:
    118118            sortOrder = SORT_DESCENDING \
     
    120120              else SORT_ASCENDING
    121121            self._model.set_sort_column_id(defaultSortableIndex, sortOrder)
    122         self._view = gtk.TreeView(self._model)
    123 
    124         flightIndexColumn = gtk.TreeViewColumn()
     122        self._view = Gtk.TreeView(self._model)
     123
     124        flightIndexColumn = Gtk.TreeViewColumn()
    125125        flightIndexColumn.set_visible(False)
    126126        self._view.append_column(flightIndexColumn)
     
    140140            selection.set_mode(SELECTION_MULTIPLE)
    141141
    142         scrolledWindow = gtk.ScrolledWindow()
     142        scrolledWindow = Gtk.ScrolledWindow()
    143143        scrolledWindow.add(self._view)
    144144        if widthRequest is not None:
    145145            scrolledWindow.set_size_request(widthRequest, -1)
    146146        # FIXME: these should be constants in common.py
    147         scrolledWindow.set_policy(gtk.PolicyType.AUTOMATIC,
    148                                   gtk.PolicyType.AUTOMATIC)
    149         scrolledWindow.set_shadow_type(gtk.ShadowType.IN)
     147        scrolledWindow.set_policy(Gtk.PolicyType.AUTOMATIC,
     148                                  Gtk.PolicyType.AUTOMATIC)
     149        scrolledWindow.set_shadow_type(Gtk.ShadowType.IN)
    150150
    151151        super(FlightList, self).__init__(xalign = 0.5, yalign = 0.0,
     
    235235#-----------------------------------------------------------------------------
    236236
    237 class PendingFlightsFrame(gtk.Frame):
     237class PendingFlightsFrame(Gtk.Frame):
    238238    """A frame for a list of pending (reported or rejected) flights.
    239239
     
    273273        self._pirepEditable = pirepEditable
    274274
    275         alignment = gtk.Alignment(xscale = 1.0, yscale = 1.0)
     275        alignment = Gtk.Alignment(xscale = 1.0, yscale = 1.0)
    276276        alignment.set_padding(padding_top = 2, padding_bottom = 8,
    277277                              padding_left = 4, padding_right = 4)
    278278
    279         hbox = gtk.HBox()
     279        hbox = Gtk.HBox()
    280280
    281281        self._flights = []
     
    289289        hbox.pack_start(self._flightList, True, True, 4)
    290290
    291         buttonBox = gtk.VBox()
    292 
    293         self._editButton = gtk.Button(xstr("pendflt_" +
     291        buttonBox = Gtk.VBox()
     292
     293        self._editButton = Gtk.Button(xstr("pendflt_" +
    294294                                           ("edit" if pirepEditable else
    295295                                            "view") + "_" + which))
     
    299299        buttonBox.pack_start(self._editButton, False, False, 2)
    300300
    301         self._reflyButton = gtk.Button(xstr("pendflt_refly_" + which))
     301        self._reflyButton = Gtk.Button(xstr("pendflt_refly_" + which))
    302302        self._reflyButton.set_sensitive(False)
    303303        self._reflyButton.set_use_underline(True)
     
    305305        buttonBox.pack_start(self._reflyButton, False, False, 2)
    306306
    307         self._deleteButton = gtk.Button(xstr("pendflt_delete_" + which))
     307        self._deleteButton = Gtk.Button(xstr("pendflt_delete_" + which))
    308308        self._deleteButton.set_sensitive(False)
    309309        self._deleteButton.set_use_underline(True)
     
    458458    def _producePopupMenu(self):
    459459        """Create the popup menu for the flights."""
    460         menu = gtk.Menu()
    461 
    462         menuItem = gtk.MenuItem()
     460        menu = Gtk.Menu()
     461
     462        menuItem = Gtk.MenuItem()
    463463        menuItem.set_label(xstr("pendflt_" +
    464464                                ("edit" if self._pirepEditable else "view") +
     
    470470        menu.append(menuItem)
    471471
    472         menuItem = gtk.MenuItem()
     472        menuItem = Gtk.MenuItem()
    473473        menuItem.set_label(xstr("pendflt_refly_" + self._which))
    474474        menuItem.set_use_underline(True)
     
    478478        menu.append(menuItem)
    479479
    480         menuItem = gtk.MenuItem()
     480        menuItem = Gtk.MenuItem()
    481481        menuItem.set_label(xstr("pendflt_delete_" + self._which))
    482482        menuItem.set_use_underline(True)
     
    503503#-----------------------------------------------------------------------------
    504504
    505 class PendingFlightsWindow(gtk.Window):
     505class PendingFlightsWindow(Gtk.Window):
    506506    """The window to display the lists of the pending (reported or rejected)
    507507    flights."""
     
    517517        self.set_modal(True)
    518518
    519         mainAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     519        mainAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    520520                                      xscale = 1.0, yscale = 1.0)
    521521        mainAlignment.set_padding(padding_top = 0, padding_bottom = 12,
    522522                                  padding_left = 8, padding_right = 8)
    523523
    524         vbox = gtk.VBox()
     524        vbox = Gtk.VBox()
    525525
    526526        self._reportedFrame = PendingFlightsFrame("reported", wizard, self,
     
    531531        vbox.pack_start(self._rejectedFrame, True, True, 2)
    532532
    533         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     533        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    534534                                  xscale = 0.0, yscale = 0.0)
    535         self._closeButton = gtk.Button(xstr("button_ok"))
     535        self._closeButton = Gtk.Button(xstr("button_ok"))
    536536        self._closeButton.connect("clicked", self._closeClicked)
    537537        self._closeButton.set_use_underline(True)
     
    586586#-----------------------------------------------------------------------------
    587587
    588 class AcceptedFlightsWindow(gtk.Window):
     588class AcceptedFlightsWindow(Gtk.Window):
    589589    """A window for a list of accepted flights."""
    590590    def getFlightDuration(flightTimeStart, flight):
     
    638638        self.set_transient_for(gui.mainWindow)
    639639
    640         alignment = gtk.Alignment(xscale = 1.0, yscale = 1.0)
     640        alignment = Gtk.Alignment(xscale = 1.0, yscale = 1.0)
    641641        alignment.set_padding(padding_top = 2, padding_bottom = 8,
    642642                              padding_left = 4, padding_right = 4)
    643643
    644         vbox = gtk.VBox()
    645 
    646         hbox = gtk.HBox()
     644        vbox = Gtk.VBox()
     645
     646        hbox = Gtk.HBox()
    647647        vbox.pack_start(hbox, True, True, 4)
    648648
     
    657657        hbox.pack_start(self._flightList, True, True, 4)
    658658
    659         buttonBox = gtk.VBox()
    660 
    661         self._refreshButton = gtk.Button(xstr("acceptedflt_refresh"))
     659        buttonBox = Gtk.VBox()
     660
     661        self._refreshButton = Gtk.Button(xstr("acceptedflt_refresh"))
    662662        self._refreshButton.set_sensitive(True)
    663663        self._refreshButton.set_use_underline(True)
     
    665665        buttonBox.pack_start(self._refreshButton, False, False, 2)
    666666
    667         filler = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     667        filler = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    668668                               xscale = 1.0, yscale = 1.0)
    669669        filler.set_size_request(-1, 4)
    670670        buttonBox.pack_start(filler, False, False, 0)
    671671
    672         self._viewButton = gtk.Button(xstr("acceptedflt_view"))
     672        self._viewButton = Gtk.Button(xstr("acceptedflt_view"))
    673673        self._viewButton.set_sensitive(False)
    674674        self._viewButton.set_use_underline(True)
     
    678678        hbox.pack_start(buttonBox, False, False, 4)
    679679
    680         buttonAlignment = gtk.Alignment(xscale = 0.0, yscale = 0.0,
     680        buttonAlignment = Gtk.Alignment(xscale = 0.0, yscale = 0.0,
    681681                                        xalign = 0.5, yalign = 0.5)
    682682
    683         self._closeButton =  gtk.Button(xstr("button_ok"))
     683        self._closeButton =  Gtk.Button(xstr("button_ok"))
    684684        self._closeButton.connect("clicked", self._closeClicked)
    685685        self._closeButton.set_use_underline(True)
  • src/mlx/gui/gates.py

    r994 r996  
    1919#-------------------------------------------------------------------------------
    2020
    21 class FleetGateStatus(gtk.VBox):
     21class FleetGateStatus(Gtk.VBox):
    2222    """The tab to display the fleet and gate status."""
    2323    def __init__(self, gui):
     
    2727        self._gui = gui
    2828
    29         mainAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     29        mainAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    3030                                      xscale = 1.0, yscale = 1.0)
    3131        mainAlignment.set_padding(padding_top = 4, padding_bottom = 4,
     
    3333        self.add(mainAlignment)
    3434
    35         self._mainBox = mainBox = gtk.VBox()
     35        self._mainBox = mainBox = Gtk.VBox()
    3636        mainAlignment.add(mainBox)
    3737   
    38         self._statusBox = statusBox = gtk.HBox()
     38        self._statusBox = statusBox = Gtk.HBox()
    3939        mainBox.pack_start(statusBox, True, True, 4)
    4040
    41         fleetFrame = gtk.Frame(label = xstr("gates_fleet_title"))
     41        fleetFrame = Gtk.Frame(label = xstr("gates_fleet_title"))
    4242        fleetLabel = fleetFrame.get_label_widget()
    4343        fleetLabel.set_use_underline(True)
    4444        statusBox.pack_start(fleetFrame, False, False, 4)
    4545
    46         self._fleetStore = gtk.ListStore(str, str)
    47         self._fleetList = gtk.TreeView(self._fleetStore)
     46        self._fleetStore = Gtk.ListStore(str, str)
     47        self._fleetList = Gtk.TreeView(self._fleetStore)
    4848        self._fleetList.set_tooltip_markup(xstr("gates_planes_tooltip"))
    4949        fleetLabel.set_mnemonic_widget(self._fleetList)
    50         column = gtk.TreeViewColumn(xstr("gates_tailno"), gtk.CellRendererText(),
     50        column = Gtk.TreeViewColumn(xstr("gates_tailno"), Gtk.CellRendererText(),
    5151                                    text = 0)
    5252        column.set_expand(True)
     
    5454        self._fleetList.append_column(column)
    5555
    56         column = gtk.TreeViewColumn(xstr("gates_planestatus"), gtk.CellRendererText(),
     56        column = Gtk.TreeViewColumn(xstr("gates_planestatus"), Gtk.CellRendererText(),
    5757                                    markup = 1)
    5858        column.set_expand(True)
     
    6060        self._fleetList.append_column(column)
    6161
    62         scrolledWindow = gtk.ScrolledWindow()
     62        scrolledWindow = Gtk.ScrolledWindow()
    6363        scrolledWindow.add(self._fleetList)
    6464        scrolledWindow.set_size_request(200, -1)
    6565        # FIXME: these should be constants in common.py
    66         scrolledWindow.set_policy(gtk.PolicyType.AUTOMATIC,
    67                                   gtk.PolicyType.AUTOMATIC)
    68         scrolledWindow.set_shadow_type(gtk.ShadowType.IN)
     66        scrolledWindow.set_policy(Gtk.PolicyType.AUTOMATIC,
     67                                  Gtk.PolicyType.AUTOMATIC)
     68        scrolledWindow.set_shadow_type(Gtk.ShadowType.IN)
    6969
    7070
    7171        self._fleetAlignment =  alignment = \
    72                                gtk.Alignment(xalign = 0.5, yalign = 0.0,
     72                               Gtk.Alignment(xalign = 0.5, yalign = 0.0,
    7373                                             xscale = 0.0, yscale = 1.0)
    7474        alignment.set_padding(padding_top = 4, padding_bottom = 4,
     
    7777        fleetFrame.add(alignment)       
    7878       
    79         self._gatesFrame = gatesFrame = gtk.Frame(label = xstr("gates_gates_title"))
     79        self._gatesFrame = gatesFrame = Gtk.Frame(label = xstr("gates_gates_title"))
    8080        statusBox.pack_start(gatesFrame, True, True, 4)       
    8181
    82         self._gatesTable = table = gtk.Table(lhbpGates.numRows,
     82        self._gatesTable = table = Gtk.Table(lhbpGates.numRows,
    8383                                             lhbpGates.numColumns)
    8484        table.set_tooltip_markup(xstr("gates_gates_tooltip"))
    85         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     85        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    8686                                  xscale = 1.0, yscale = 1.0)
    8787        alignment.set_padding(padding_top = 4, padding_bottom = 4,
     
    9797                gate = data
    9898
    99                 label = gtk.Label()
     99                label = Gtk.Label()
    100100                label.set_markup("<b>" + gate.number + "</b>")
    101101                table.attach(label, column, column + 1, row, row + 1)
     
    109109                column += 1
    110110
    111         button = gtk.Button(xstr("gates_refresh"))
     111        button = Gtk.Button(xstr("gates_refresh"))
    112112        button.set_use_underline(True)
    113113        button.set_tooltip_text(xstr("gates_refresh_tooltip"))
    114114        button.connect("clicked", self._refreshClicked)
    115115
    116         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     116        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    117117                                  xscale = 0.0, yscale = 0.0)
    118118        alignment.add(button)
     
    162162                self._fleetStore.append([tailNumber, status])
    163163            # FIXME: this should be a constant in common.py
    164             self._fleetStore.set_sort_column_id(0, gtk.SortType.ASCENDING)
     164            self._fleetStore.set_sort_column_id(0, Gtk.SortType.ASCENDING)
    165165
    166166            occupiedGateNumbers = fleet.getOccupiedGateNumbers()
  • src/mlx/gui/gui.py

    r995 r996  
    108108        """Build the GUI."""
    109109
    110         self._mainWindow = window = gtk.Window()
     110        self._mainWindow = window = Gtk.Window()
    111111        if os.name!="nt":
    112112            window.set_visual(window.get_screen().lookup_visual(0x21))
     
    118118        if os.name=="nt":
    119119            window.connect("leave-notify-event", self._handleLeaveNotify)
    120         accelGroup = gtk.AccelGroup()
     120        accelGroup = Gtk.AccelGroup()
    121121        window.add_accel_group(accelGroup)
    122122        window.realize()
    123123
    124         mainVBox = gtk.VBox()
     124        mainVBox = Gtk.VBox()
    125125        window.add(mainVBox)
    126126
     
    137137        mainVBox.pack_start(menuBar, False, False, 0)
    138138
    139         self._notebook = gtk.Notebook()
     139        self._notebook = Gtk.Notebook()
    140140        mainVBox.pack_start(self._notebook, True, True, 4)
    141141
    142142        self._wizard = Wizard(self)
    143         label = gtk.Label(xstr("tab_flight"))
     143        label = Gtk.Label(xstr("tab_flight"))
    144144        label.set_use_underline(True)
    145145        label.set_tooltip_text(xstr("tab_flight_tooltip"))
     
    147147
    148148        self._flightInfo = FlightInfo(self)
    149         label = gtk.Label(xstr("tab_flight_info"))
     149        label = Gtk.Label(xstr("tab_flight_info"))
    150150        label.set_use_underline(True)
    151151        label.set_tooltip_text(xstr("tab_flight_info_tooltip"))
     
    154154
    155155        self._weightHelp = WeightHelp(self)
    156         label = gtk.Label(xstr("tab_weight_help"))
     156        label = Gtk.Label(xstr("tab_weight_help"))
    157157        label.set_use_underline(True)
    158158        label.set_tooltip_text(xstr("tab_weight_help_tooltip"))
     
    161161        (logWidget, self._logView)  = self._buildLogWidget()
    162162        addFaultTag(self._logView.get_buffer())
    163         label = gtk.Label(xstr("tab_log"))
     163        label = Gtk.Label(xstr("tab_log"))
    164164        label.set_use_underline(True)
    165165        label.set_tooltip_text(xstr("tab_log_tooltip"))
     
    167167
    168168        self._fleetGateStatus = FleetGateStatus(self)
    169         label = gtk.Label(xstr("tab_gates"))
     169        label = Gtk.Label(xstr("tab_gates"))
    170170        label.set_use_underline(True)
    171171        label.set_tooltip_text(xstr("tab_gates_tooltip"))
     
    173173
    174174        self._acars = ACARS(self)
    175         label = gtk.Label("ACARS")
     175        label = Gtk.Label("ACARS")
    176176        label.set_use_underline(True)
    177177        self._notebook.append_page(self._acars, label)
     
    180180        self._debugLogWidget.show_all()
    181181
    182         mainVBox.pack_start(gtk.HSeparator(), False, False, 0)
     182        mainVBox.pack_start(Gtk.HSeparator(), False, False, 0)
    183183
    184184        self._statusbar = Statusbar(iconDirectory)
     
    447447        """Get the background colour of the main window."""
    448448        return self._mainWindow.get_style_context().\
    449             get_background_color(gtk.StateFlags.NORMAL)
     449            get_background_color(Gtk.StateFlags.NORMAL)
    450450
    451451    def run(self):
     
    461461
    462462        singleton.raiseCallback = self.raiseCallback
    463         gtk.main()
     463        Gtk.main()
    464464        singleton.raiseCallback = None
    465465
     
    501501        self._statusbar.updateConnection(self._connecting, self._connected)
    502502
    503         dialog = gtk.MessageDialog(parent = self._mainWindow,
     503        dialog = Gtk.MessageDialog(parent = self._mainWindow,
    504504                                   type = MESSAGETYPE_ERROR,
    505505                                   message_format = xstr("conn_failed"))
     
    533533        self._statusbar.updateConnection(self._connecting, self._connected)
    534534
    535         dialog = gtk.MessageDialog(type = MESSAGETYPE_ERROR,
     535        dialog = Gtk.MessageDialog(type = MESSAGETYPE_ERROR,
    536536                                   message_format = xstr("conn_broken"),
    537537                                   parent = self._mainWindow)
     
    591591    def cancelFlight(self):
    592592        """Cancel the current file, if the user confirms it."""
    593         dialog = gtk.MessageDialog(parent = self._mainWindow,
     593        dialog = Gtk.MessageDialog(parent = self._mainWindow,
    594594                                   type = MESSAGETYPE_QUESTION,
    595595                                   message_format = xstr("cancelFlight_question"))
     
    930930            self._fleet = None
    931931
    932             dialog = gtk.MessageDialog(parent = self.mainWindow,
     932            dialog = Gtk.MessageDialog(parent = self.mainWindow,
    933933                                       type = MESSAGETYPE_ERROR,
    934934                                       message_format = xstr("fleet_failed"))
     
    975975                    self._fleetGateStatus.handleFleet(self._fleet)
    976976        else:
    977             dialog = gtk.MessageDialog(parent = self.mainWindow,
     977            dialog = Gtk.MessageDialog(parent = self.mainWindow,
    978978                                       type = MESSAGETYPE_ERROR,
    979979                                       message_format = xstr("fleet_update_failed"))
     
    10651065    def _buildMenuBar(self, accelGroup):
    10661066        """Build the main menu bar."""
    1067         menuBar = gtk.MenuBar()
    1068 
    1069         fileMenuItem = gtk.MenuItem(xstr("menu_file"))
    1070         fileMenu = gtk.Menu()
     1067        menuBar = Gtk.MenuBar()
     1068
     1069        fileMenuItem = Gtk.MenuItem(xstr("menu_file"))
     1070        fileMenu = Gtk.Menu()
    10711071        fileMenuItem.set_submenu(fileMenu)
    10721072        menuBar.append(fileMenuItem)
    10731073
    1074         loadPIREPMenuItem = gtk.ImageMenuItem(gtk.STOCK_OPEN)
     1074        loadPIREPMenuItem = Gtk.ImageMenuItem(Gtk.STOCK_OPEN)
    10751075        loadPIREPMenuItem.set_use_stock(True)
    10761076        loadPIREPMenuItem.set_label(xstr("menu_file_loadPIREP"))
     
    10811081        fileMenu.append(loadPIREPMenuItem)
    10821082
    1083         fileMenu.append(gtk.SeparatorMenuItem())
    1084 
    1085         quitMenuItem = gtk.ImageMenuItem(gtk.STOCK_QUIT)
     1083        fileMenu.append(Gtk.SeparatorMenuItem())
     1084
     1085        quitMenuItem = Gtk.ImageMenuItem(Gtk.STOCK_QUIT)
    10861086        quitMenuItem.set_use_stock(True)
    10871087        quitMenuItem.set_label(xstr("menu_file_quit"))
     
    10921092        fileMenu.append(quitMenuItem)
    10931093
    1094         toolsMenuItem = gtk.MenuItem(xstr("menu_tools"))
    1095         toolsMenu = gtk.Menu()
     1094        toolsMenuItem = Gtk.MenuItem(xstr("menu_tools"))
     1095        toolsMenu = Gtk.Menu()
    10961096        toolsMenuItem.set_submenu(toolsMenu)
    10971097        menuBar.append(toolsMenuItem)
    10981098
    10991099        self._timetableMenuItem = timetableMenuItem = \
    1100           gtk.ImageMenuItem(gtk.STOCK_INDENT)
     1100          Gtk.ImageMenuItem(Gtk.STOCK_INDENT)
    11011101        timetableMenuItem.set_use_stock(True)
    11021102        timetableMenuItem.set_label(xstr("menu_tools_timetable"))
     
    11091109
    11101110        self._flightsMenuItem = flightsMenuItem = \
    1111           gtk.ImageMenuItem(gtk.STOCK_SPELL_CHECK)
     1111          Gtk.ImageMenuItem(Gtk.STOCK_SPELL_CHECK)
    11121112        flightsMenuItem.set_use_stock(True)
    11131113        flightsMenuItem.set_label(xstr("menu_tools_flights"))
     
    11191119        toolsMenu.append(flightsMenuItem)
    11201120
    1121         checklistMenuItem = gtk.ImageMenuItem(gtk.STOCK_APPLY)
     1121        checklistMenuItem = Gtk.ImageMenuItem(Gtk.STOCK_APPLY)
    11221122        checklistMenuItem.set_use_stock(True)
    11231123        checklistMenuItem.set_label(xstr("menu_tools_chklst"))
     
    11281128        toolsMenu.append(checklistMenuItem)
    11291129
    1130         approachCalloutsMenuItem = gtk.ImageMenuItem(gtk.STOCK_EDIT)
     1130        approachCalloutsMenuItem = Gtk.ImageMenuItem(Gtk.STOCK_EDIT)
    11311131        approachCalloutsMenuItem.set_use_stock(True)
    11321132        approachCalloutsMenuItem.set_label(xstr("menu_tools_callouts"))
     
    11371137        toolsMenu.append(approachCalloutsMenuItem)
    11381138
    1139         prefsMenuItem = gtk.ImageMenuItem(gtk.STOCK_PREFERENCES)
     1139        prefsMenuItem = Gtk.ImageMenuItem(Gtk.STOCK_PREFERENCES)
    11401140        prefsMenuItem.set_use_stock(True)
    11411141        prefsMenuItem.set_label(xstr("menu_tools_prefs"))
     
    11461146        toolsMenu.append(prefsMenuItem)
    11471147
    1148         toolsMenu.append(gtk.SeparatorMenuItem())
    1149 
    1150         bugReportMenuItem = gtk.ImageMenuItem(gtk.STOCK_PASTE)
     1148        toolsMenu.append(Gtk.SeparatorMenuItem())
     1149
     1150        bugReportMenuItem = Gtk.ImageMenuItem(Gtk.STOCK_PASTE)
    11511151        bugReportMenuItem.set_use_stock(True)
    11521152        bugReportMenuItem.set_label(xstr("menu_tools_bugreport"))
     
    11571157        toolsMenu.append(bugReportMenuItem)
    11581158
    1159         viewMenuItem = gtk.MenuItem(xstr("menu_view"))
    1160         viewMenu = gtk.Menu()
     1159        viewMenuItem = Gtk.MenuItem(xstr("menu_view"))
     1160        viewMenu = Gtk.Menu()
    11611161        viewMenuItem.set_submenu(viewMenu)
    11621162        menuBar.append(viewMenuItem)
    11631163
    1164         self._showMonitorMenuItem = gtk.CheckMenuItem()
     1164        self._showMonitorMenuItem = Gtk.CheckMenuItem()
    11651165        self._showMonitorMenuItem.set_label(xstr("menu_view_monitor"))
    11661166        self._showMonitorMenuItem.set_use_underline(True)
     
    11721172        viewMenu.append(self._showMonitorMenuItem)
    11731173
    1174         showDebugMenuItem = gtk.CheckMenuItem()
     1174        showDebugMenuItem = Gtk.CheckMenuItem()
    11751175        showDebugMenuItem.set_label(xstr("menu_view_debug"))
    11761176        showDebugMenuItem.set_use_underline(True)
     
    11821182        viewMenu.append(showDebugMenuItem)
    11831183
    1184         helpMenuItem = gtk.MenuItem(xstr("menu_help"))
    1185         helpMenu = gtk.Menu()
     1184        helpMenuItem = Gtk.MenuItem(xstr("menu_help"))
     1185        helpMenu = Gtk.Menu()
    11861186        helpMenuItem.set_submenu(helpMenu)
    11871187        menuBar.append(helpMenuItem)
    11881188
    1189         manualMenuItem = gtk.ImageMenuItem(gtk.STOCK_HELP)
     1189        manualMenuItem = Gtk.ImageMenuItem(Gtk.STOCK_HELP)
    11901190        manualMenuItem.set_use_stock(True)
    11911191        manualMenuItem.set_label(xstr("menu_help_manual"))
     
    11961196        helpMenu.append(manualMenuItem)
    11971197
    1198         helpMenu.append(gtk.SeparatorMenuItem())
    1199 
    1200         aboutMenuItem = gtk.ImageMenuItem(gtk.STOCK_ABOUT)
     1198        helpMenu.append(Gtk.SeparatorMenuItem())
     1199
     1200        aboutMenuItem = Gtk.ImageMenuItem(Gtk.STOCK_ABOUT)
    12011201        aboutMenuItem.set_use_stock(True)
    12021202        aboutMenuItem.set_label(xstr("menu_help_about"))
     
    12121212        """Toggle the debug log."""
    12131213        if menuItem.get_active():
    1214             label = gtk.Label(xstr("tab_debug_log"))
     1214            label = Gtk.Label(xstr("tab_debug_log"))
    12151215            label.set_use_underline(True)
    12161216            label.set_tooltip_text(xstr("tab_debug_log_tooltip"))
     
    12221222    def _buildLogWidget(self):
    12231223        """Build the widget for the log."""
    1224         alignment = gtk.Alignment(xscale = 1.0, yscale = 1.0)
     1224        alignment = Gtk.Alignment(xscale = 1.0, yscale = 1.0)
    12251225
    12261226        alignment.set_padding(padding_top = 8, padding_bottom = 8,
    12271227                              padding_left = 16, padding_right = 16)
    12281228
    1229         logScroller = gtk.ScrolledWindow()
     1229        logScroller = Gtk.ScrolledWindow()
    12301230        # FIXME: these should be constants in common
    1231         logScroller.set_policy(gtk.PolicyType.AUTOMATIC,
    1232                                gtk.PolicyType.AUTOMATIC)
    1233         logScroller.set_shadow_type(gtk.ShadowType.IN)
    1234         logView = gtk.TextView()
     1231        logScroller.set_policy(Gtk.PolicyType.AUTOMATIC,
     1232                               Gtk.PolicyType.AUTOMATIC)
     1233        logScroller.set_shadow_type(Gtk.ShadowType.IN)
     1234        logView = Gtk.TextView()
    12351235        logView.set_editable(False)
    12361236        logView.set_cursor_visible(False)
    12371237        logScroller.add(logView)
    12381238
    1239         logBox = gtk.VBox()
     1239        logBox = Gtk.VBox()
    12401240        logBox.pack_start(logScroller, True, True, 0)
    12411241        logBox.set_size_request(-1, 200)
     
    12561256            result=RESPONSETYPE_YES
    12571257        else:
    1258             dialog = gtk.MessageDialog(parent = self._mainWindow,
     1258            dialog = Gtk.MessageDialog(parent = self._mainWindow,
    12591259                                       type = MESSAGETYPE_QUESTION,
    12601260                                       message_format = xstr("quit_question"))
     
    12691269        if result==RESPONSETYPE_YES:
    12701270            self._statusIcon.destroy()
    1271             return gtk.main_quit()
     1271            return Gtk.main_quit()
    12721272
    12731273    def _notebookPageSwitch(self, notebook, page, page_num):
     
    13231323            self._timetableWindow.show_all()
    13241324        else:
    1325             dialog = gtk.MessageDialog(parent = self.mainWindow,
     1325            dialog = Gtk.MessageDialog(parent = self.mainWindow,
    13261326                                       type = MESSAGETYPE_ERROR,
    13271327                                       message_format = xstr("timetable_failed"))
     
    13531353            self._flightsWindow.show_all()
    13541354        else:
    1355             dialog = gtk.MessageDialog(parent = self.mainWindow,
     1355            dialog = Gtk.MessageDialog(parent = self.mainWindow,
    13561356                                       type = MESSAGETYPE_ERROR,
    13571357                                       message_format = xstr("acceptedflt_failed"))
     
    14521452
    14531453        if type is not None:
    1454             dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
     1454            dialog = Gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
    14551455                                       type = type, message_format = messageFormat)
    14561456            dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
     
    14831483            pirep = PIREP.load(self._lastLoadedPIREP)
    14841484            if pirep is None:
    1485                 dialog = gtk.MessageDialog(parent = self._mainWindow,
     1485                dialog = Gtk.MessageDialog(parent = self._mainWindow,
    14861486                                           type = MESSAGETYPE_ERROR,
    14871487                                           message_format = xstr("loadPIREP_failed"))
     
    15111511        If it is not created yet, it will be created."""
    15121512        if self._loadPIREPDialog is None:
    1513             dialog = gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +
     1513            dialog = Gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +
    15141514                                           xstr("loadPIREP_browser_title"),
    15151515                                           action = FILE_CHOOSER_ACTION_OPEN,
    1516                                            buttons = (gtk.STOCK_CANCEL,
     1516                                           buttons = (Gtk.STOCK_CANCEL,
    15171517                                                      RESPONSETYPE_CANCEL,
    1518                                                       gtk.STOCK_OK, RESPONSETYPE_OK),
     1518                                                      Gtk.STOCK_OK, RESPONSETYPE_OK),
    15191519                                           parent = self._mainWindow)
    15201520            dialog.set_modal(True)
    15211521
    15221522
    1523             filter = gtk.FileFilter()
     1523            filter = Gtk.FileFilter()
    15241524            filter.set_name(xstr("file_filter_pireps"))
    15251525            filter.add_pattern("*.pirep")
    15261526            dialog.add_filter(filter)
    15271527
    1528             filter = gtk.FileFilter()
     1528            filter = Gtk.FileFilter()
    15291529            filter.set_name(xstr("file_filter_all"))
    15301530            filter.add_pattern("*.*")
     
    15381538        """Get a dialog displaying the main information of the flight from the
    15391539        PIREP and providing Cancel and Send buttons."""
    1540         dialog = gtk.Dialog(title = WINDOW_TITLE_BASE + " - " +
     1540        dialog = Gtk.Dialog(title = WINDOW_TITLE_BASE + " - " +
    15411541                            xstr("loadPIREP_send_title"),
    15421542                            parent = self._mainWindow,
     
    15451545        contentArea = dialog.get_content_area()
    15461546
    1547         label = gtk.Label(xstr("loadPIREP_send_help"))
    1548         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     1547        label = Gtk.Label(xstr("loadPIREP_send_help"))
     1548        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    15491549                                  xscale = 0.0, yscale = 0.0)
    15501550        alignment.set_padding(padding_top = 16, padding_bottom = 0,
     
    15531553        contentArea.pack_start(alignment, False, False, 8)
    15541554
    1555         table = gtk.Table(5, 2)
    1556         tableAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     1555        table = Gtk.Table(5, 2)
     1556        tableAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    15571557                                       xscale = 0.0, yscale = 0.0)
    15581558        tableAlignment.set_padding(padding_top = 0, padding_bottom = 32,
     
    15651565        bookedFlight = pirep.bookedFlight
    15661566
    1567         label = gtk.Label("<b>" + xstr("loadPIREP_send_flightno") + "</b>")
     1567        label = Gtk.Label("<b>" + xstr("loadPIREP_send_flightno") + "</b>")
    15681568        label.set_use_markup(True)
    1569         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     1569        labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    15701570                                       xscale = 0.0, yscale = 0.0)
    15711571        labelAlignment.add(label)
    15721572        table.attach(labelAlignment, 0, 1, 0, 1)
    15731573
    1574         label = gtk.Label(bookedFlight.callsign)
    1575         labelAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     1574        label = Gtk.Label(bookedFlight.callsign)
     1575        labelAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    15761576                                       xscale = 0.0, yscale = 0.0)
    15771577        labelAlignment.add(label)
    15781578        table.attach(labelAlignment, 1, 2, 0, 1)
    15791579
    1580         label = gtk.Label("<b>" + xstr("loadPIREP_send_date") + "</b>")
     1580        label = Gtk.Label("<b>" + xstr("loadPIREP_send_date") + "</b>")
    15811581        label.set_use_markup(True)
    1582         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     1582        labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    15831583                                       xscale = 0.0, yscale = 0.0)
    15841584        labelAlignment.add(label)
    15851585        table.attach(labelAlignment, 0, 1, 1, 2)
    15861586
    1587         label = gtk.Label(str(bookedFlight.departureTime.date()))
    1588         labelAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     1587        label = Gtk.Label(str(bookedFlight.departureTime.date()))
     1588        labelAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    15891589                                       xscale = 0.0, yscale = 0.0)
    15901590        labelAlignment.add(label)
    15911591        table.attach(labelAlignment, 1, 2, 1, 2)
    15921592
    1593         label = gtk.Label("<b>" + xstr("loadPIREP_send_from") + "</b>")
     1593        label = Gtk.Label("<b>" + xstr("loadPIREP_send_from") + "</b>")
    15941594        label.set_use_markup(True)
    1595         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     1595        labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    15961596                                       xscale = 0.0, yscale = 0.0)
    15971597        labelAlignment.add(label)
    15981598        table.attach(labelAlignment, 0, 1, 2, 3)
    15991599
    1600         label = gtk.Label(bookedFlight.departureICAO)
    1601         labelAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     1600        label = Gtk.Label(bookedFlight.departureICAO)
     1601        labelAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    16021602                                       xscale = 0.0, yscale = 0.0)
    16031603        labelAlignment.add(label)
    16041604        table.attach(labelAlignment, 1, 2, 2, 3)
    16051605
    1606         label = gtk.Label("<b>" + xstr("loadPIREP_send_to") + "</b>")
     1606        label = Gtk.Label("<b>" + xstr("loadPIREP_send_to") + "</b>")
    16071607        label.set_use_markup(True)
    1608         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     1608        labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    16091609                                       xscale = 0.0, yscale = 0.0)
    16101610        labelAlignment.add(label)
    16111611        table.attach(labelAlignment, 0, 1, 3, 4)
    16121612
    1613         label = gtk.Label(bookedFlight.arrivalICAO)
    1614         labelAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     1613        label = Gtk.Label(bookedFlight.arrivalICAO)
     1614        labelAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    16151615                                       xscale = 0.0, yscale = 0.0)
    16161616        labelAlignment.add(label)
    16171617        table.attach(labelAlignment, 1, 2, 3, 4)
    16181618
    1619         label = gtk.Label("<b>" + xstr("loadPIREP_send_rating") + "</b>")
     1619        label = Gtk.Label("<b>" + xstr("loadPIREP_send_rating") + "</b>")
    16201620        label.set_use_markup(True)
    1621         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     1621        labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    16221622                                       xscale = 0.0, yscale = 0.0)
    16231623        labelAlignment.add(label)
     
    16251625
    16261626        rating = pirep.rating
    1627         label = gtk.Label()
     1627        label = Gtk.Label()
    16281628        if rating<0:
    16291629            label.set_markup('<b><span foreground="red">NO GO</span></b>')
     
    16311631            label.set_text("%.1f %%" % (rating,))
    16321632
    1633         labelAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     1633        labelAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    16341634                                       xscale = 0.0, yscale = 0.0)
    16351635        labelAlignment.add(label)
     
    16751675            secondaryMarkup = xstr("sendPIREP_failed_sec")
    16761676
    1677         dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
     1677        dialog = Gtk.MessageDialog(parent = self._wizard.gui.mainWindow,
    16781678                                   type = type, message_format = messageFormat)
    16791679        dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
     
    17361736            secondaryMarkup = xstr("sendBugReport_error_sec")
    17371737
    1738         dialog = gtk.MessageDialog(parent = self._wizard.gui._bugReportDialog,
     1738        dialog = Gtk.MessageDialog(parent = self._wizard.gui._bugReportDialog,
    17391739                                   type = type, message_format = messageFormat)
    17401740        dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK)
     
    18101810        If it does not exist yet, it will be created."""
    18111811        if self._aboutDialog is None:
    1812             dialog = gtk.AboutDialog()
     1812            dialog = Gtk.AboutDialog()
    18131813            dialog.set_transient_for(self._mainWindow)
    18141814            dialog.set_modal(True)
     
    19141914
    19151915        if not self.config.pilotID and not self.config.password:
    1916             dialog = gtk.MessageDialog(parent = self._mainWindow,
     1916            dialog = Gtk.MessageDialog(parent = self._mainWindow,
    19171917                                       type = MESSAGETYPE_QUESTION,
    19181918                                       message_format = xstr("register_ask"))
  • src/mlx/gui/info.py

    r954 r996  
    2121#------------------------------------------------------------------------------
    2222
    23 class FlightInfo(gtk.VBox):
     23class FlightInfo(Gtk.VBox):
    2424    """The flight info tab."""
    2525    @staticmethod
     
    3131        - the comment text editor."""
    3232
    33         frame = gtk.Frame(label = label)
     33        frame = Gtk.Frame(label = label)
    3434        label = frame.get_label_widget()
    3535        label.set_use_underline(True)
    3636
    37         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     37        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    3838                                  xscale = 1.0, yscale = 1.0)
    3939        alignment.set_padding(padding_top = 4, padding_bottom = 4,
    4040                              padding_left = 8, padding_right = 8)
    4141
    42         scroller = gtk.ScrolledWindow()
     42        scroller = Gtk.ScrolledWindow()
    4343        scroller.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
    4444        scroller.set_shadow_type(SHADOW_IN)
    4545
    46         comments = gtk.TextView()
     46        comments = Gtk.TextView()
    4747        comments.set_wrap_mode(WRAP_WORD)
    4848        scroller.add(comments)
     
    6060        self._callbackObject = callbackObject
    6161
    62         self._commentsAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     62        self._commentsAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    6363                                                xscale = 1.0, yscale = 1.0)
    64         commentsBox = gtk.HBox()
     64        commentsBox = Gtk.HBox()
    6565        commentsBox.set_homogeneous(True)
    6666
     
    7777        self.pack_start(self._commentsAlignment, True, True, 8)
    7878
    79         frame = gtk.Frame(label = xstr("info_delay"))
     79        frame = Gtk.Frame(label = xstr("info_delay"))
    8080        label = frame.get_label_widget()
    8181        label.set_use_underline(True)
    8282
    83         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     83        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    8484                                  xscale = 1.0, yscale = 1.0)
    8585        alignment.set_padding(padding_top = 4, padding_bottom = 4,
     
    8787
    8888        self._delayCodeTable = table = DelayCodeTable(self)
    89         self._delayWindow = scrolledWindow = gtk.ScrolledWindow()
     89        self._delayWindow = scrolledWindow = Gtk.ScrolledWindow()
    9090        scrolledWindow.add(table)
    9191        scrolledWindow.set_size_request(-1, 185)
     
    9696        frame.add(alignment)
    9797
    98         self._delayAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     98        self._delayAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    9999                                             xscale = 1.0, yscale = 1.0)
    100100        self._delayAlignment.add(frame)
  • src/mlx/gui/monitor.py

    r765 r996  
    1818#------------------------------------------------------------------------------
    1919
    20 class MonitorWindow(gtk.Window):
     20class MonitorWindow(Gtk.Window):
    2121    """The window for the data monitor."""
    2222    def __init__(self, gui, iconDirectory):
     
    3232                     lambda a, b: self._gui.hideMonitorWindow())
    3333
    34         alignment = gtk.Alignment(xscale = 1.0, yscale = 1.0)
     34        alignment = Gtk.Alignment(xscale = 1.0, yscale = 1.0)
    3535
    3636        alignment.set_padding(padding_top = 4, padding_bottom = 10,
    3737                              padding_left = 16, padding_right = 16)
    3838
    39         table = gtk.Table(rows = 9, columns = 14)
     39        table = Gtk.Table(rows = 9, columns = 14)
    4040        table.set_homogeneous(False)
    4141        table.set_row_spacings(4)
     
    4646        table.attach(self._timestamp, 1, 2, 0, 1)
    4747
    48         self._paused = gtk.Label("PAUSED")
     48        self._paused = Gtk.Label("PAUSED")
    4949        table.attach(self._paused, 2, 4, 0, 1)
    5050
    51         self._trickMode = gtk.Label("TRICKMODE")
     51        self._trickMode = Gtk.Label("TRICKMODE")
    5252        table.attach(self._trickMode, 4, 6, 0, 1, xoptions = 0)
    5353
    54         self._overspeed = gtk.Label("OVERSPEED")
     54        self._overspeed = Gtk.Label("OVERSPEED")
    5555        table.attach(self._overspeed, 6, 8, 0, 1)
    5656
    57         self._stalled = gtk.Label("STALLED")
     57        self._stalled = Gtk.Label("STALLED")
    5858        table.attach(self._stalled, 8, 10, 0, 1)
    5959
    60         self._onTheGround = gtk.Label("ONTHEGROUND")
     60        self._onTheGround = Gtk.Label("ONTHEGROUND")
    6161        table.attach(self._onTheGround, 10, 11, 0, 1)
    6262
    63         self._antiIceOn = gtk.Label("ANTI-ICE")
     63        self._antiIceOn = Gtk.Label("ANTI-ICE")
    6464        table.attach(self._antiIceOn, 11, 12, 0, 1)
    6565
     
    148148        table.attach(self._reverser, 9, 12, 4, 5)
    149149
    150         self._navLightsOn = gtk.Label("NAV")
     150        self._navLightsOn = Gtk.Label("NAV")
    151151        table.attach(self._navLightsOn, 0, 1, 5, 6)
    152152
    153         self._antiCollisionLightsOn = gtk.Label("ANTICOLLISION")
     153        self._antiCollisionLightsOn = Gtk.Label("ANTICOLLISION")
    154154        table.attach(self._antiCollisionLightsOn, 1, 2, 5, 6)
    155155
    156         self._strobeLightsOn = gtk.Label("STROBE")
     156        self._strobeLightsOn = Gtk.Label("STROBE")
    157157        table.attach(self._strobeLightsOn, 2, 3, 5, 6)
    158158
    159         self._landingLightsOn = gtk.Label("LANDING")
     159        self._landingLightsOn = Gtk.Label("LANDING")
    160160        table.attach(self._landingLightsOn, 3, 4, 5, 6)
    161161
    162         self._pitotHeatOn = gtk.Label("PITOT HEAT")
     162        self._pitotHeatOn = Gtk.Label("PITOT HEAT")
    163163        table.attach(self._pitotHeatOn, 4, 5, 5, 6)
    164164
    165         self._parking = gtk.Label("PARKING")
     165        self._parking = Gtk.Label("PARKING")
    166166        table.attach(self._parking, 5, 6, 5, 6)
    167167
    168         self._gearControlDown = gtk.Label("GEAR LEVER DOWN")
     168        self._gearControlDown = Gtk.Label("GEAR LEVER DOWN")
    169169        table.attach(self._gearControlDown, 6, 8, 5, 6)
    170170
    171         self._gearsDown = gtk.Label("GEARS DOWN")
     171        self._gearsDown = Gtk.Label("GEARS DOWN")
    172172        table.attach(self._gearsDown, 8, 10, 5, 6)
    173173
    174         self._spoilersArmed = gtk.Label("SPOILERS ARMED")
     174        self._spoilersArmed = Gtk.Label("SPOILERS ARMED")
    175175        table.attach(self._spoilersArmed, 10, 12, 5, 6)
    176176
     
    195195        table.attach(self._elevatorTrim, 11, 12, 6, 7)
    196196
    197         self._apMaster = gtk.Label("AP MASTER")
     197        self._apMaster = Gtk.Label("AP MASTER")
    198198        table.attach(self._apMaster, 0, 1, 7, 8)
    199199
    200         self._apHeadingHold = gtk.Label("AP HDG HOLD")
     200        self._apHeadingHold = Gtk.Label("AP HDG HOLD")
    201201        table.attach(self._apHeadingHold, 1, 2, 7, 8)
    202202
     
    205205        table.attach(self._apHeading, 3, 4, 7, 8)
    206206
    207         self._xpdrC = gtk.Label("XPDR C")
     207        self._xpdrC = Gtk.Label("XPDR C")
    208208        table.attach(self._xpdrC, 4, 5, 7, 8)
    209209
    210         self._apAltitudeHold = gtk.Label("AP ALT HOLD")
     210        self._apAltitudeHold = Gtk.Label("AP ALT HOLD")
    211211        table.attach(self._apAltitudeHold, 5, 6, 7, 8)
    212212
     
    262262        - the entry."""
    263263
    264         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5, xscale = 1.0)
     264        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5, xscale = 1.0)
    265265        alignment.set_padding(padding_top = 0, padding_bottom = 0,
    266266                              padding_left = 0, padding_right = 16)
    267         alignment.add(gtk.Label(label))
    268 
    269         entry = gtk.Entry()
     267        alignment.add(Gtk.Label(label))
     268
     269        entry = Gtk.Entry()
    270270        entry.set_editable(False)
    271271        entry.set_width_chars(width)
  • src/mlx/gui/pirep.py

    r994 r996  
    2626#------------------------------------------------------------------------------
    2727
    28 class MessageFrame(gtk.Frame):
     28class MessageFrame(Gtk.Frame):
    2929    """A frame containing the information about a PIREP message.
    3030
     
    3333    def __init__(self, message, senderPID, senderName):
    3434        """Construct the frame."""
    35         gtk.Frame.__init__(self)
    36 
    37         vbox = gtk.VBox()
    38 
    39         self._heading = heading = gtk.TextView()
     35        Gtk.Frame.__init__(self)
     36
     37        vbox = Gtk.VBox()
     38
     39        self._heading = heading = Gtk.TextView()
    4040        heading.set_editable(False)
    4141        heading.set_can_focus(False)
     
    4949                         buffer.get_start_iter(), buffer.get_end_iter())
    5050
    51         headingAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     51        headingAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    5252                                         xscale = 1.0, yscale = 0.0)
    5353        headingAlignment.set_padding(padding_top = 0, padding_bottom = 0,
     
    5656        vbox.pack_start(headingAlignment, True, True, 4)
    5757
    58         self._messageView = messageView = gtk.TextView()
     58        self._messageView = messageView = Gtk.TextView()
    5959        messageView.set_wrap_mode(WRAP_WORD)
    6060        messageView.set_editable(False)
     
    7272
    7373        styleContext = self.get_style_context()
    74         color = styleContext.get_background_color(gtk.StateFlags.NORMAL)
     74        color = styleContext.get_background_color(Gtk.StateFlags.NORMAL)
    7575        heading.override_background_color(0, color)
    7676
     
    7878#-------------------------------------------------------------------------------
    7979
    80 class MessagesWidget(gtk.Frame):
     80class MessagesWidget(Gtk.Frame):
    8181    """The widget for the messages."""
    8282    @staticmethod
     
    8686
    8787    def __init__(self, gui):
    88         gtk.Frame.__init__(self)
     88        Gtk.Frame.__init__(self)
    8989
    9090        self._gui = gui
     
    9393        label.set_use_underline(True)
    9494
    95         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     95        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    9696                                  xscale = 1.0, yscale = 1.0)
    9797        alignment.set_padding(padding_top = 4, padding_bottom = 4,
    9898                              padding_left = 4, padding_right = 4)
    9999
    100         self._outerBox = outerBox = gtk.EventBox()
     100        self._outerBox = outerBox = Gtk.EventBox()
    101101        outerBox.add(alignment)
    102102
    103         self._innerBox = innerBox = gtk.EventBox()
     103        self._innerBox = innerBox = Gtk.EventBox()
    104104        alignment.add(self._innerBox)
    105105
    106         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     106        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    107107                                  xscale = 1.0, yscale = 1.0)
    108108        alignment.set_padding(padding_top = 0, padding_bottom = 0,
     
    111111        innerBox.add(alignment)
    112112
    113         scroller = gtk.ScrolledWindow()
     113        scroller = Gtk.ScrolledWindow()
    114114        scroller.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
    115115        scroller.set_shadow_type(SHADOW_NONE)
    116116
    117         self._messages = gtk.VBox()
     117        self._messages = Gtk.VBox()
    118118        self._messages.set_homogeneous(False)
    119119        scroller.add_with_viewport(self._messages)
     
    129129        """Add a message from the given sender."""
    130130
    131         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     131        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    132132                                      xscale = 1.0, yscale = 0.0)
    133133        alignment.set_padding(padding_top = 2, padding_bottom = 2,
     
    154154#------------------------------------------------------------------------------
    155155
    156 class PIREPViewer(gtk.Dialog):
     156class PIREPViewer(Gtk.Dialog):
    157157    """The dialog for PIREP viewing."""
    158158    @staticmethod
     
    167167        - the frame,
    168168        - the inner VBox."""
    169         frame = gtk.Frame(label = label)
    170 
    171         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     169        frame = Gtk.Frame(label = label)
     170
     171        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    172172                                  xscale = 1.0, yscale = 1.0)
    173173        frame.add(alignment)
    174174        alignment.set_padding(padding_top = 4, padding_bottom = 4,
    175175                              padding_left = 4, padding_right = 4)
    176         box = gtk.VBox()
     176        box = Gtk.VBox()
    177177        alignment.add(box)
    178178
     
    182182    def getLabel(text, extraText = ""):
    183183        """Get a bold label with the given text."""
    184         label = gtk.Label("<b>" + text + "</b>" + extraText)
     184        label = Gtk.Label("<b>" + text + "</b>" + extraText)
    185185        label.set_use_markup(True)
    186186        label.set_alignment(0.0, 0.5)
     
    190190    def getDataLabel(width = None, xAlignment = 0.0):
    191191        """Get a bold label with the given text."""
    192         label = gtk.Label()
     192        label = Gtk.Label()
    193193        if width is not None:
    194194            label.set_width_chars(width)
     
    203203        - the window,
    204204        - the text view."""
    205         scrolledWindow = gtk.ScrolledWindow()
     205        scrolledWindow = Gtk.ScrolledWindow()
    206206        scrolledWindow.set_shadow_type(SHADOW_IN)
    207207        scrolledWindow.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC)
    208208
    209         textView = gtk.TextView()
     209        textView = Gtk.TextView()
    210210        textView.set_wrap_mode(WRAP_WORD)
    211211        textView.set_editable(editable)
     
    226226
    227227        Returns the data label attached."""
    228         dataBox = gtk.HBox()
     228        dataBox = Gtk.HBox()
    229229        table.attach(dataBox, column, column+1, row, row+1)
    230230
     
    251251    def addHFiller(hBox, width = 8):
    252252        """Add a filler to the given horizontal box."""
    253         filler = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     253        filler = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    254254                               xscale = 1.0, yscale = 1.0)
    255255        filler.set_size_request(width, -1)
     
    259259    def addVFiller(vBox, height = 4):
    260260        """Add a filler to the given vertical box."""
    261         filler = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     261        filler = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    262262                               xscale = 1.0, yscale = 1.0)
    263263        filler.set_size_request(-1, height)
     
    284284        contentArea = self.get_content_area()
    285285
    286         self._notebook = gtk.Notebook()
     286        self._notebook = Gtk.Notebook()
    287287        contentArea.pack_start(self._notebook, False, False, 4)
    288288
    289289        dataTab = self._buildDataTab()
    290         label = gtk.Label(xstr("pirepView_tab_data"))
     290        label = Gtk.Label(xstr("pirepView_tab_data"))
    291291        label.set_use_underline(True)
    292292        label.set_tooltip_text(xstr("pirepView_tab_data_tooltip"))
     
    294294
    295295        commentsTab = self._buildCommentsTab()
    296         label = gtk.Label(xstr("pirepView_tab_comments"))
     296        label = Gtk.Label(xstr("pirepView_tab_comments"))
    297297        label.set_use_underline(True)
    298298        label.set_tooltip_text(xstr("pirepView_tab_comments_tooltip"))
     
    300300
    301301        logTab = self._buildLogTab()
    302         label = gtk.Label(xstr("pirepView_tab_log"))
     302        label = Gtk.Label(xstr("pirepView_tab_log"))
    303303        label.set_use_underline(True)
    304304        label.set_tooltip_text(xstr("pirepView_tab_log_tooltip"))
     
    308308        if showMessages:
    309309            messagesTab = self._buildMessagesTab()
    310             label = gtk.Label(xstr("pirepView_tab_messages"))
     310            label = Gtk.Label(xstr("pirepView_tab_messages"))
    311311            label.set_use_underline(True)
    312312            label.set_tooltip_text(xstr("pirepView_tab_messages_tooltip"))
     
    417417    def _buildDataTab(self):
    418418        """Build the data tab of the viewer."""
    419         table = gtk.Table(1, 2)
     419        table = Gtk.Table(1, 2)
    420420        table.set_row_spacings(4)
    421421        table.set_col_spacings(16)
    422422        table.set_homogeneous(True)
    423423
    424         box1 = gtk.VBox()
     424        box1 = Gtk.VBox()
    425425        table.attach(box1, 0, 1, 0, 1)
    426426
    427         box2 = gtk.VBox()
     427        box2 = Gtk.VBox()
    428428        table.attach(box2, 1, 2, 0, 1)
    429429
     
    453453        (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_flight"))
    454454
    455         dataBox = gtk.HBox()
     455        dataBox = Gtk.HBox()
    456456        mainBox.pack_start(dataBox, False, False, 0)
    457457
     
    468468        PIREPViewer.addVFiller(mainBox)
    469469
    470         dataBox = gtk.HBox()
     470        dataBox = Gtk.HBox()
    471471        mainBox.pack_start(dataBox, False, False, 0)
    472472
     
    478478        PIREPViewer.addVFiller(mainBox)
    479479
    480         table = gtk.Table(3, 2)
     480        table = Gtk.Table(3, 2)
    481481        mainBox.pack_start(table, False, False, 0)
    482482        table.set_row_spacings(4)
     
    503503                                    width = 6)
    504504
    505         table = gtk.Table(3, 2)
     505        table = Gtk.Table(3, 2)
    506506        mainBox.pack_start(table, False, False, 0)
    507507        table.set_row_spacings(4)
     
    549549        (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_route"))
    550550
    551         levelBox = gtk.HBox()
     551        levelBox = Gtk.HBox()
    552552        mainBox.pack_start(levelBox, False, False, 0)
    553553
     
    581581        PIREPViewer.addVFiller(mainBox)
    582582
    583         dataBox = gtk.HBox()
     583        dataBox = Gtk.HBox()
    584584        mainBox.pack_start(dataBox, False, False, 0)
    585585
     
    608608        PIREPViewer.addVFiller(mainBox)
    609609
    610         table = gtk.Table(2, 2)
     610        table = Gtk.Table(2, 2)
    611611        mainBox.pack_start(table, False, False, 0)
    612612        table.set_row_spacings(4)
     
    639639        (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_statistics"))
    640640
    641         table = gtk.Table(4, 2)
     641        table = Gtk.Table(4, 2)
    642642        mainBox.pack_start(table, False, False, 0)
    643643        table.set_row_spacings(4)
     
    685685        (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_miscellaneous"))
    686686
    687         table = gtk.Table(3, 2)
     687        table = Gtk.Table(3, 2)
    688688        mainBox.pack_start(table, False, False, 0)
    689689        table.set_row_spacings(4)
     
    737737    def _buildCommentsTab(self):
    738738        """Build the tab with the comments and flight defects."""
    739         table = gtk.Table(2, 1)
     739        table = Gtk.Table(2, 1)
    740740        table.set_col_spacings(16)
    741741
     
    760760    def _buildLogTab(self):
    761761        """Build the log tab."""
    762         mainBox = gtk.VBox()
     762        mainBox = Gtk.VBox()
    763763
    764764        (logWindow, self._log) = PIREPViewer.getTextWindow(heightRequest = -1)
     
    770770    def _buildMessagesTab(self):
    771771        """Build the messages tab."""
    772         mainBox = gtk.VBox()
     772        mainBox = Gtk.VBox()
    773773
    774774        self._messages = MessagesWidget(self._gui)
     
    779779#------------------------------------------------------------------------------
    780780
    781 class PIREPEditor(gtk.Dialog):
     781class PIREPEditor(Gtk.Dialog):
    782782    """A PIREP editor dialog."""
    783783    _delayCodeRE = re.compile("([0-9]{2,3})( \([^\)]*\))")
     
    789789        The label will got to cell (column, row), the widget to cell
    790790        (column+1, row)."""
    791         label = gtk.Label("<b>" + labelText + "</b>")
     791        label = Gtk.Label("<b>" + labelText + "</b>")
    792792        label.set_use_markup(True)
    793         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     793        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    794794                                  xscale = 0.0, yscale = 0.0)
    795795        alignment.add(label)
     
    807807        The label will got to cell (column, row), the spin button to cell
    808808        (column+1, row)."""
    809         button = gtk.SpinButton()
     809        button = Gtk.SpinButton()
    810810        button.set_range(min = minValue, max = maxValue)
    811811        button.set_increments(step = stepIncrement, page = pageIncrement)
     
    847847        contentArea = self.get_content_area()
    848848
    849         self._notebook = gtk.Notebook()
     849        self._notebook = Gtk.Notebook()
    850850        contentArea.pack_start(self._notebook, False, False, 4)
    851851
    852852        dataTab = self._buildDataTab()
    853         label = gtk.Label(xstr("pirepView_tab_data"))
     853        label = Gtk.Label(xstr("pirepView_tab_data"))
    854854        label.set_use_underline(True)
    855855        label.set_tooltip_text(xstr("pirepView_tab_data_tooltip"))
     
    857857
    858858        self._flightInfo = self._buildCommentsTab()
    859         label = gtk.Label(xstr("pirepView_tab_comments"))
     859        label = Gtk.Label(xstr("pirepView_tab_comments"))
    860860        label.set_use_underline(True)
    861861        label.set_tooltip_text(xstr("pirepView_tab_comments_tooltip"))
     
    863863
    864864        logTab = self._buildLogTab()
    865         label = gtk.Label(xstr("pirepView_tab_log"))
     865        label = Gtk.Label(xstr("pirepView_tab_log"))
    866866        label.set_use_underline(True)
    867867        label.set_tooltip_text(xstr("pirepView_tab_log_tooltip"))
     
    10141014    def _buildDataTab(self):
    10151015        """Build the data tab of the viewer."""
    1016         table = gtk.Table(1, 2)
     1016        table = Gtk.Table(1, 2)
    10171017        table.set_row_spacings(4)
    10181018        table.set_col_spacings(16)
    10191019        table.set_homogeneous(True)
    10201020
    1021         box1 = gtk.VBox()
     1021        box1 = Gtk.VBox()
    10221022        table.attach(box1, 0, 1, 0, 1)
    10231023
    1024         box2 = gtk.VBox()
     1024        box2 = Gtk.VBox()
    10251025        table.attach(box2, 1, 2, 0, 1)
    10261026
     
    10501050        (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_flight"))
    10511051
    1052         dataBox = gtk.HBox()
     1052        dataBox = Gtk.HBox()
    10531053        mainBox.pack_start(dataBox, False, False, 0)
    10541054
     
    10651065        PIREPViewer.addVFiller(mainBox)
    10661066
    1067         dataBox = gtk.HBox()
     1067        dataBox = Gtk.HBox()
    10681068        mainBox.pack_start(dataBox, False, False, 0)
    10691069
     
    10751075        PIREPViewer.addVFiller(mainBox)
    10761076
    1077         table = gtk.Table(3, 2)
     1077        table = Gtk.Table(3, 2)
    10781078        mainBox.pack_start(table, False, False, 0)
    10791079        table.set_row_spacings(4)
     
    11001100                                    width = 6)
    11011101
    1102         table = gtk.Table(3, 2)
     1102        table = Gtk.Table(3, 2)
    11031103        mainBox.pack_start(table, False, False, 0)
    11041104        table.set_row_spacings(4)
     
    11451145        (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_route"))
    11461146
    1147         levelBox = gtk.HBox()
     1147        levelBox = Gtk.HBox()
    11481148        mainBox.pack_start(levelBox, False, False, 0)
    11491149
     
    11521152        levelBox.pack_start(label, False, False, 0)
    11531153
    1154         self._filedCruiseLevel = gtk.SpinButton()
     1154        self._filedCruiseLevel = Gtk.SpinButton()
    11551155        self._filedCruiseLevel.set_increments(step = 10, page = 100)
    11561156        self._filedCruiseLevel.set_range(min = 0, max = 500)
     
    11671167        levelBox.pack_start(label, False, False, 0)
    11681168
    1169         self._modifiedCruiseLevel = gtk.SpinButton()
     1169        self._modifiedCruiseLevel = Gtk.SpinButton()
    11701170        self._modifiedCruiseLevel.set_increments(step = 10, page = 100)
    11711171        self._modifiedCruiseLevel.set_range(min = 0, max = 500)
     
    12011201        PIREPViewer.addVFiller(mainBox)
    12021202
    1203         dataBox = gtk.HBox()
     1203        dataBox = Gtk.HBox()
    12041204        mainBox.pack_start(dataBox, False, False, 0)
    12051205
    1206         label = gtk.Label("<b>" + xstr("pirepView_runway") + "</b>")
     1206        label = Gtk.Label("<b>" + xstr("pirepView_runway") + "</b>")
    12071207        label.set_use_markup(True)
    12081208        dataBox.pack_start(label, False, False, 0)
    12091209
    12101210        # FIXME: quite the same as the runway entry boxes in the wizard
    1211         self._departureRunway = gtk.Entry()
     1211        self._departureRunway = Gtk.Entry()
    12121212        self._departureRunway.set_width_chars(5)
    12131213        self._departureRunway.set_tooltip_text(xstr("takeoff_runway_tooltip"))
     
    12151215        dataBox.pack_start(self._departureRunway, False, False, 8)
    12161216
    1217         label = gtk.Label("<b>" + xstr("pirepView_sid") + "</b>")
     1217        label = Gtk.Label("<b>" + xstr("pirepView_sid") + "</b>")
    12181218        label.set_use_markup(True)
    12191219        dataBox.pack_start(label, False, False, 0)
     
    12211221        # FIXME: quite the same as the SID combo box in
    12221222        # the flight wizard
    1223         self._sid = gtk.ComboBox.new_with_model_and_entry(comboModel)
     1223        self._sid = Gtk.ComboBox.new_with_model_and_entry(comboModel)
    12241224
    12251225        self._sid.set_entry_text_column(0)
     
    12471247        PIREPViewer.addVFiller(mainBox)
    12481248
    1249         table = gtk.Table(2, 4)
     1249        table = Gtk.Table(2, 4)
    12501250        mainBox.pack_start(table, False, False, 0)
    12511251        table.set_row_spacings(4)
     
    12531253
    12541254        # FIXME: quite the same as in the wizard
    1255         self._star = gtk.ComboBox.new_with_model_and_entry(comboModel)
     1255        self._star = Gtk.ComboBox.new_with_model_and_entry(comboModel)
    12561256
    12571257        self._star.set_entry_text_column(0)
     
    12651265
    12661266        # FIXME: quite the same as in the wizard
    1267         self._transition = gtk.ComboBox.new_with_model_and_entry(comboModel)
     1267        self._transition = Gtk.ComboBox.new_with_model_and_entry(comboModel)
    12681268
    12691269        self._transition.set_entry_text_column(0)
     
    12781278
    12791279        # FIXME: quite the same as in the wizard
    1280         self._approachType = gtk.Entry()
     1280        self._approachType = Gtk.Entry()
    12811281        self._approachType.set_width_chars(10)
    12821282        self._approachType.set_tooltip_text(xstr("landing_approach_tooltip"))
     
    12881288
    12891289        # FIXME: quite the same as in the wizard
    1290         self._arrivalRunway = gtk.Entry()
     1290        self._arrivalRunway = Gtk.Entry()
    12911291        self._arrivalRunway.set_width_chars(10)
    12921292        self._arrivalRunway.set_tooltip_text(xstr("landing_runway_tooltip"))
     
    13031303        (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_statistics"))
    13041304
    1305         table = gtk.Table(4, 4)
     1305        table = Gtk.Table(4, 4)
    13061306        mainBox.pack_start(table, False, False, 0)
    13071307        table.set_row_spacings(4)
     
    13551355        (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_miscellaneous"))
    13561356
    1357         table = gtk.Table(6, 2)
     1357        table = Gtk.Table(6, 2)
    13581358        mainBox.pack_start(table, False, False, 0)
    13591359        table.set_row_spacings(4)
     
    14031403        self._flightType.set_tooltip_text(xstr("pirepEdit_flight_type_tooltip"))
    14041404
    1405         self._online = gtk.CheckButton(xstr("pirepEdit_online"))
     1405        self._online = Gtk.CheckButton(xstr("pirepEdit_online"))
    14061406        table.attach(self._online, 2, 3, 2, 3)
    14071407        self._online.connect("toggled", self._updateButtons)
     
    14251425    def _buildLogTab(self):
    14261426        """Build the log tab."""
    1427         mainBox = gtk.VBox()
     1427        mainBox = Gtk.VBox()
    14281428
    14291429        (logWindow, self._log) = PIREPViewer.getTextWindow(heightRequest = -1)
  • src/mlx/gui/prefs.py

    r995 r996  
    2020#------------------------------------------------------------------------------
    2121
    22 class Hotkey(gtk.HBox):
     22class Hotkey(Gtk.HBox):
    2323    """A widget to handle a hotkey."""
    2424
     
    4343        super(Hotkey, self).__init__()
    4444
    45         label = gtk.Label(labelText)
     45        label = Gtk.Label(labelText)
    4646        label.set_use_underline(True)
    47         labelAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     47        labelAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    4848                                       xscale = 0.0, yscale = 0.0)
    4949        labelAlignment.set_padding(padding_top = 0, padding_bottom = 0,
     
    5252        self.pack_start(labelAlignment, False, False, 0)
    5353
    54         self._ctrl = gtk.CheckButton("Ctrl")
     54        self._ctrl = Gtk.CheckButton("Ctrl")
    5555        self._ctrl.set_tooltip_text(tooltips[1])
    5656        self._ctrl.connect("toggled", self._ctrlToggled)
    5757        self.pack_start(self._ctrl, False, False, 4)
    5858
    59         self._shift = gtk.CheckButton("Shift")
     59        self._shift = Gtk.CheckButton("Shift")
    6060        self._shift.set_tooltip_text(tooltips[2])
    6161        self._shift.connect("toggled", self._shiftToggled)
    6262        self.pack_start(self._shift, False, False, 4)
    6363
    64         self._hotkeyModel = gtk.ListStore(str)
     64        self._hotkeyModel = Gtk.ListStore(str)
    6565        for keyCode in list(range(ord("0"), ord("9")+1)) + list(range(ord("A"), ord("Z")+1)):
    6666            self._hotkeyModel.append([chr(keyCode)])
    6767
    68         self._hotkey = gtk.ComboBox(model = self._hotkeyModel)
    69         cell = gtk.CellRendererText()
     68        self._hotkey = Gtk.ComboBox(model = self._hotkeyModel)
     69        cell = Gtk.CellRendererText()
    7070        self._hotkey.pack_start(cell, True)
    7171        self._hotkey.add_attribute(cell, 'text', 0)
     
    166166#------------------------------------------------------------------------------
    167167
    168 class Preferences(gtk.Dialog):
     168class Preferences(Gtk.Dialog):
    169169    """The preferences dialog."""
    170170    def __init__(self, gui):
     
    184184        contentArea = self.get_content_area()
    185185
    186         notebook = gtk.Notebook()
     186        notebook = Gtk.Notebook()
    187187        contentArea.pack_start(notebook, True, True, 4)
    188188
    189189        general = self._buildGeneral()
    190         label = gtk.Label(xstr("prefs_tab_general"))
     190        label = Gtk.Label(xstr("prefs_tab_general"))
    191191        label.set_use_underline(True)
    192192        label.set_tooltip_text(xstr("prefs_tab_general_tooltip"))
     
    194194
    195195        messages = self._buildMessages()
    196         label = gtk.Label(xstr("prefs_tab_messages"))
     196        label = Gtk.Label(xstr("prefs_tab_messages"))
    197197        label.set_use_underline(True)
    198198        label.set_tooltip_text(xstr("prefs_tab_message_tooltip"))
     
    200200
    201201        sounds = self._buildSounds()
    202         label = gtk.Label(xstr("prefs_tab_sounds"))
     202        label = Gtk.Label(xstr("prefs_tab_sounds"))
    203203        label.set_use_underline(True)
    204204        label.set_tooltip_text(xstr("prefs_tab_sounds_tooltip"))
     
    206206
    207207        advanced = self._buildAdvanced()
    208         label = gtk.Label(xstr("prefs_tab_advanced"))
     208        label = Gtk.Label(xstr("prefs_tab_advanced"))
    209209        label.set_use_underline(True)
    210210        label.set_tooltip_text(xstr("prefs_tab_advanced_tooltip"))
     
    326326    def _buildGeneral(self):
    327327        """Build the page for the general settings."""
    328         mainAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     328        mainAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    329329                                      xscale = 1.0, yscale = 0.0)
    330330        mainAlignment.set_padding(padding_top = 0, padding_bottom = 8,
    331331                                  padding_left = 4, padding_right = 4)
    332         mainBox = gtk.VBox()
     332        mainBox = Gtk.VBox()
    333333        mainAlignment.add(mainBox)
    334334
    335335        guiBox = self._createFrame(mainBox, xstr("prefs_frame_gui"))
    336336
    337         languageBox = gtk.HBox()
     337        languageBox = Gtk.HBox()
    338338        guiBox.pack_start(languageBox, False, False, 4)
    339339
    340         label = gtk.Label(xstr("prefs_language"))
     340        label = Gtk.Label(xstr("prefs_language"))
    341341        label.set_use_underline(True)
    342342
    343343        languageBox.pack_start(label, False, False, 4)
    344344
    345         self._languageList = gtk.ListStore(str, str)
     345        self._languageList = Gtk.ListStore(str, str)
    346346        for language in const.languages:
    347347            self._languageList.append([xstr("prefs_lang_" + language),
     
    349349
    350350        self._languageComboBox = languageComboBox = \
    351             gtk.ComboBox(model = self._languageList)
    352         cell = gtk.CellRendererText()
     351            Gtk.ComboBox(model = self._languageList)
     352        cell = Gtk.CellRendererText()
    353353        languageComboBox.pack_start(cell, True)
    354354        languageComboBox.add_attribute(cell, 'text', 0)
     
    362362        self._warnedRestartNeeded = False
    363363
    364         self._hideMinimizedWindow = gtk.CheckButton(xstr("prefs_hideMinimizedWindow"))
     364        self._hideMinimizedWindow = Gtk.CheckButton(xstr("prefs_hideMinimizedWindow"))
    365365        self._hideMinimizedWindow.set_use_underline(True)
    366366        self._hideMinimizedWindow.set_tooltip_text(xstr("prefs_hideMinimizedWindow_tooltip"))
    367367        guiBox.pack_start(self._hideMinimizedWindow, False, False, 4)
    368368
    369         self._quitOnClose = gtk.CheckButton(xstr("prefs_quitOnClose"))
     369        self._quitOnClose = Gtk.CheckButton(xstr("prefs_quitOnClose"))
    370370        self._quitOnClose.set_use_underline(True)
    371371        self._quitOnClose.set_tooltip_text(xstr("prefs_quitOnClose_tooltip"))
     
    374374        onlineBox = self._createFrame(mainBox, xstr("prefs_frame_online"))
    375375
    376         self._onlineGateSystem = gtk.CheckButton(xstr("prefs_onlineGateSystem"))
     376        self._onlineGateSystem = Gtk.CheckButton(xstr("prefs_onlineGateSystem"))
    377377        self._onlineGateSystem.set_use_underline(True)
    378378        self._onlineGateSystem.set_tooltip_text(xstr("prefs_onlineGateSystem_tooltip"))
    379379        onlineBox.pack_start(self._onlineGateSystem, False, False, 4)
    380380
    381         self._onlineACARS = gtk.CheckButton(xstr("prefs_onlineACARS"))
     381        self._onlineACARS = Gtk.CheckButton(xstr("prefs_onlineACARS"))
    382382        self._onlineACARS.set_use_underline(True)
    383383        self._onlineACARS.set_tooltip_text(xstr("prefs_onlineACARS_tooltip"))
     
    386386        simulatorBox = self._createFrame(mainBox, xstr("prefs_frame_simulator"))
    387387
    388         self._flareTimeFromFS = gtk.CheckButton(xstr("prefs_flaretimeFromFS"))
     388        self._flareTimeFromFS = Gtk.CheckButton(xstr("prefs_flaretimeFromFS"))
    389389        self._flareTimeFromFS.set_use_underline(True)
    390390        self._flareTimeFromFS.set_tooltip_text(xstr("prefs_flaretimeFromFS_tooltip"))
    391391        simulatorBox.pack_start(self._flareTimeFromFS, False, False, 4)
    392392
    393         self._syncFSTime = gtk.CheckButton(xstr("prefs_syncFSTime"))
     393        self._syncFSTime = Gtk.CheckButton(xstr("prefs_syncFSTime"))
    394394        self._syncFSTime.set_use_underline(True)
    395395        self._syncFSTime.set_tooltip_text(xstr("prefs_syncFSTime_tooltip"))
    396396        simulatorBox.pack_start(self._syncFSTime, False, False, 4)
    397397
    398         self._usingFS2Crew = gtk.CheckButton(xstr("prefs_usingFS2Crew"))
     398        self._usingFS2Crew = Gtk.CheckButton(xstr("prefs_usingFS2Crew"))
    399399        self._usingFS2Crew.set_use_underline(True)
    400400        self._usingFS2Crew.set_tooltip_text(xstr("prefs_usingFS2Crew_tooltip"))
     
    413413        simulatorBox.pack_start(vsSmoothingBox, False, False, 4)
    414414
    415         self._useSimBrief = gtk.CheckButton(xstr("prefs_useSimBrief"))
     415        self._useSimBrief = Gtk.CheckButton(xstr("prefs_useSimBrief"))
    416416        self._useSimBrief.set_use_underline(True)
    417417        self._useSimBrief.set_tooltip_text(xstr("prefs_useSimBrief_tooltip"))
    418418        mainBox.pack_start(self._useSimBrief, False, False, 0)
    419419
    420         pirepBox = gtk.HBox()
     420        pirepBox = Gtk.HBox()
    421421        mainBox.pack_start(pirepBox, False, False, 8)
    422422
    423         label = gtk.Label(xstr("prefs_pirepDirectory"))
     423        label = Gtk.Label(xstr("prefs_pirepDirectory"))
    424424        label.set_use_underline(True)
    425425        pirepBox.pack_start(label, False, False, 4)
    426426
    427         self._pirepDirectory = gtk.Entry()
     427        self._pirepDirectory = Gtk.Entry()
    428428        self._pirepDirectory.set_tooltip_text(xstr("prefs_pirepDirectory_tooltip"))
    429429        self._pirepDirectory.connect("changed", self._pirepDirectoryChanged)
     
    431431        pirepBox.pack_start(self._pirepDirectory, True, True, 4)
    432432
    433         self._pirepDirectoryButton = gtk.Button(xstr("button_browse"))
     433        self._pirepDirectoryButton = Gtk.Button(xstr("button_browse"))
    434434        self._pirepDirectoryButton.connect("clicked",
    435435                                           self._pirepDirectoryButtonClicked)
    436436        pirepBox.pack_start(self._pirepDirectoryButton, False, False, 4)
    437437
    438         self._pirepAutoSave = gtk.CheckButton(xstr("prefs_pirepAutoSave"))
     438        self._pirepAutoSave = Gtk.CheckButton(xstr("prefs_pirepAutoSave"))
    439439        self._pirepAutoSave.set_use_underline(True)
    440440        self._pirepAutoSave.set_tooltip_text(xstr("prefs_pirepAutoSave_tooltip"))
     
    447447
    448448        Return the vbox."""
    449         frame = gtk.Frame(label = label)
     449        frame = Gtk.Frame(label = label)
    450450        mainBox.pack_start(frame, False, False, 4)
    451         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     451        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    452452                                  xscale = 1.0, yscale = 0.0)
    453453        alignment.set_padding(padding_top = 4, padding_bottom = 0,
    454454                              padding_left = 0, padding_right = 0)
    455455        frame.add(alignment)
    456         vbox = gtk.VBox()
     456        vbox = Gtk.VBox()
    457457        alignment.add(vbox)
    458458
     
    462462                            maxSeconds = 10):
    463463        """Create a HBox that contains entry fields for smoothing some value."""
    464         smoothingBox = gtk.HBox()
    465 
    466         smoothingEnabled = gtk.CheckButton(checkBoxLabel)
     464        smoothingBox = Gtk.HBox()
     465
     466        smoothingEnabled = Gtk.CheckButton(checkBoxLabel)
    467467        smoothingEnabled.set_use_underline(True)
    468468        smoothingEnabled.set_tooltip_text(checkBoxTooltip)
     
    470470        smoothingBox.pack_start(smoothingEnabled, False, False, 0)
    471471
    472         smoothingLength = gtk.SpinButton()
     472        smoothingLength = Gtk.SpinButton()
    473473        smoothingLength.set_numeric(True)
    474474        smoothingLength.set_range(2, maxSeconds)
     
    479479        smoothingBox.pack_start(smoothingLength, False, False, 0)
    480480
    481         smoothingBox.pack_start(gtk.Label(xstr("prefs_smoothing_seconds")),
     481        smoothingBox.pack_start(Gtk.Label(xstr("prefs_smoothing_seconds")),
    482482                                False, False, 4)
    483483
     
    511511        """Called when the language has changed."""
    512512        if not self._changingLanguage and not self._warnedRestartNeeded:
    513             dialog = gtk.MessageDialog(parent = self,
     513            dialog = Gtk.MessageDialog(parent = self,
    514514                                       type = MESSAGETYPE_INFO,
    515515                                       message_format = xstr("prefs_restart"))
     
    548548    def _pirepDirectoryButtonClicked(self, button):
    549549        """Called when the PIREP directory button is clicked."""
    550         dialog = gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +
     550        dialog = Gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +
    551551                                       xstr("prefs_pirepDirectory_browser_title"),
    552552                                       action = FILE_CHOOSER_ACTION_SELECT_FOLDER,
    553                                        buttons = (gtk.STOCK_CANCEL, RESPONSETYPE_CANCEL,
    554                                                   gtk.STOCK_OK, RESPONSETYPE_OK),
     553                                       buttons = (Gtk.STOCK_CANCEL, RESPONSETYPE_CANCEL,
     554                                                  Gtk.STOCK_OK, RESPONSETYPE_OK),
    555555                                       parent = self)
    556556        dialog.set_modal(True)
     
    578578        """Build the page for the message settings."""
    579579
    580         mainAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     580        mainAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    581581                                      xscale = 0.0, yscale = 0.0)
    582582        mainAlignment.set_padding(padding_top = 16, padding_bottom = 8,
    583583                                  padding_left = 4, padding_right = 4)
    584         mainBox = gtk.VBox()
     584        mainBox = Gtk.VBox()
    585585        mainAlignment.add(mainBox)
    586586
    587         table = gtk.Table(len(const.messageTypes) + 1, 3)
     587        table = Gtk.Table(len(const.messageTypes) + 1, 3)
    588588        table.set_row_spacings(8)
    589589        table.set_col_spacings(32)
     
    591591        mainBox.pack_start(table, False, False, 4)
    592592
    593         label = gtk.Label(xstr("prefs_msgs_fs"))
     593        label = Gtk.Label(xstr("prefs_msgs_fs"))
    594594        label.set_justify(JUSTIFY_CENTER)
    595595        label.set_alignment(0.5, 1.0)
    596596        table.attach(label, 1, 2, 0, 1)
    597597
    598         label = gtk.Label(xstr("prefs_msgs_sound"))
     598        label = Gtk.Label(xstr("prefs_msgs_sound"))
    599599        label.set_justify(JUSTIFY_CENTER)
    600600        label.set_alignment(0.5, 1.0)
     
    606606        for messageType in const.messageTypes:
    607607            messageTypeStr = const.messageType2string(messageType)
    608             label = gtk.Label(xstr("prefs_msgs_type_" + messageTypeStr))
     608            label = Gtk.Label(xstr("prefs_msgs_type_" + messageTypeStr))
    609609            label.set_justify(JUSTIFY_CENTER)
    610610            label.set_use_underline(True)
     
    612612            table.attach(label, 0, 1, row, row+1)
    613613
    614             fsCheckButton = gtk.CheckButton()
    615             alignment = gtk.Alignment(xscale = 0.0, yscale = 0.0,
     614            fsCheckButton = Gtk.CheckButton()
     615            alignment = Gtk.Alignment(xscale = 0.0, yscale = 0.0,
    616616                                      xalign = 0.5, yalign = 0.5)
    617617            alignment.add(fsCheckButton)
     
    619619            self._msgFSCheckButtons[messageType] = fsCheckButton
    620620
    621             soundCheckButton = gtk.CheckButton()
    622             alignment = gtk.Alignment(xscale = 0.0, yscale = 0.0,
     621            soundCheckButton = Gtk.CheckButton()
     622            alignment = Gtk.Alignment(xscale = 0.0, yscale = 0.0,
    623623                                      xalign = 0.5, yalign = 0.5)
    624624            alignment.add(soundCheckButton)
     
    626626            self._msgSoundCheckButtons[messageType] = soundCheckButton
    627627
    628             mnemonicWidget = gtk.Label("")
     628            mnemonicWidget = Gtk.Label("")
    629629            table.attach(mnemonicWidget, 3, 4, row, row+1)
    630630            label.set_mnemonic_widget(mnemonicWidget)
     
    655655    def _buildSounds(self):
    656656        """Build the page for the sounds."""
    657         mainAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     657        mainAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    658658                                      xscale = 1.0, yscale = 1.0)
    659659        mainAlignment.set_padding(padding_top = 8, padding_bottom = 8,
    660660                                  padding_left = 4, padding_right = 4)
    661661
    662         mainBox = gtk.VBox()
     662        mainBox = Gtk.VBox()
    663663        mainAlignment.add(mainBox)
    664664
    665         backgroundFrame = gtk.Frame(label = xstr("prefs_sounds_frame_bg"))
     665        backgroundFrame = Gtk.Frame(label = xstr("prefs_sounds_frame_bg"))
    666666        mainBox.pack_start(backgroundFrame, False, False, 4)
    667667
    668         backgroundAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     668        backgroundAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    669669                                            xscale = 1.0, yscale = 0.0)
    670670        backgroundAlignment.set_padding(padding_top = 4, padding_bottom = 4,
     
    672672        backgroundFrame.add(backgroundAlignment)
    673673
    674         backgroundBox = gtk.VBox()
     674        backgroundBox = Gtk.VBox()
    675675        backgroundAlignment.add(backgroundBox)
    676676
    677         self._enableSounds = gtk.CheckButton(xstr("prefs_sounds_enable"))
     677        self._enableSounds = Gtk.CheckButton(xstr("prefs_sounds_enable"))
    678678        self._enableSounds.set_use_underline(True)
    679679        self._enableSounds.set_tooltip_text(xstr("prefs_sounds_enable_tooltip"))
    680680        self._enableSounds.connect("toggled", self._enableSoundsToggled)
    681         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     681        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    682682                                  xscale = 1.0, yscale = 0.0)
    683683        alignment.add(self._enableSounds)
    684684        backgroundBox.pack_start(alignment, False, False, 4)
    685685
    686         self._pilotControlsSounds = gtk.CheckButton(xstr("prefs_sounds_pilotControls"))
     686        self._pilotControlsSounds = Gtk.CheckButton(xstr("prefs_sounds_pilotControls"))
    687687        self._pilotControlsSounds.set_use_underline(True)
    688688        self._pilotControlsSounds.set_tooltip_text(xstr("prefs_sounds_pilotControls_tooltip"))
     
    697697        backgroundBox.pack_start(self._pilotHotkey, False, False, 4)
    698698
    699         self._enableApproachCallouts = gtk.CheckButton(xstr("prefs_sounds_approachCallouts"))
     699        self._enableApproachCallouts = Gtk.CheckButton(xstr("prefs_sounds_approachCallouts"))
    700700        self._enableApproachCallouts.set_use_underline(True)
    701701        self._enableApproachCallouts.set_tooltip_text(xstr("prefs_sounds_approachCallouts_tooltip"))
    702702        backgroundBox.pack_start(self._enableApproachCallouts, False, False, 4)
    703703
    704         self._speedbrakeAtTD = gtk.CheckButton(xstr("prefs_sounds_speedbrakeAtTD"))
     704        self._speedbrakeAtTD = Gtk.CheckButton(xstr("prefs_sounds_speedbrakeAtTD"))
    705705        self._speedbrakeAtTD.set_use_underline(True)
    706706        self._speedbrakeAtTD.set_tooltip_text(xstr("prefs_sounds_speedbrakeAtTD_tooltip"))
    707707        backgroundBox.pack_start(self._speedbrakeAtTD, False, False, 4)
    708708
    709         checklistFrame = gtk.Frame(label = xstr("prefs_sounds_frame_checklists"))
     709        checklistFrame = Gtk.Frame(label = xstr("prefs_sounds_frame_checklists"))
    710710        mainBox.pack_start(checklistFrame, False, False, 4)
    711711
    712         checklistAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     712        checklistAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    713713                                           xscale = 1.0, yscale = 0.0)
    714714        checklistAlignment.set_padding(padding_top = 4, padding_bottom = 4,
     
    716716        checklistFrame.add(checklistAlignment)
    717717
    718         checklistBox = gtk.VBox()
     718        checklistBox = Gtk.VBox()
    719719        checklistAlignment.add(checklistBox)
    720720
    721         self._enableChecklists = gtk.CheckButton(xstr("prefs_sounds_enableChecklists"))
     721        self._enableChecklists = Gtk.CheckButton(xstr("prefs_sounds_enableChecklists"))
    722722        self._enableChecklists.set_use_underline(True)
    723723        self._enableChecklists.set_tooltip_text(xstr("prefs_sounds_enableChecklists_tooltip"))
     
    789789        """Build the page for the advanced settings."""
    790790
    791         mainAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     791        mainAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0,
    792792                                      xscale = 1.0, yscale = 0.0)
    793793        mainAlignment.set_padding(padding_top = 16, padding_bottom = 8,
    794794                                  padding_left = 4, padding_right = 4)
    795         mainBox = gtk.VBox()
     795        mainBox = Gtk.VBox()
    796796        mainAlignment.add(mainBox)
    797797
    798         self._autoUpdate = gtk.CheckButton(xstr("prefs_update_auto"))
     798        self._autoUpdate = Gtk.CheckButton(xstr("prefs_update_auto"))
    799799        mainBox.pack_start(self._autoUpdate, False, False, 4)
    800800
     
    804804        self._warnedAutoUpdate = False
    805805
    806         updateURLBox = gtk.HBox()
     806        updateURLBox = Gtk.HBox()
    807807        mainBox.pack_start(updateURLBox, False, False, 4)
    808         label = gtk.Label(xstr("prefs_update_url"))
     808        label = Gtk.Label(xstr("prefs_update_url"))
    809809        label.set_use_underline(True)
    810810        updateURLBox.pack_start(label, False, False, 4)
    811811
    812         self._updateURL = gtk.Entry()
     812        self._updateURL = Gtk.Entry()
    813813        label.set_mnemonic_widget(self._updateURL)
    814814        self._updateURL.set_width_chars(40)
     
    817817        updateURLBox.pack_start(self._updateURL, True, True, 4)
    818818
    819         self._useRPC = gtk.CheckButton(xstr("prefs_use_rpc"))
     819        self._useRPC = Gtk.CheckButton(xstr("prefs_use_rpc"))
    820820        mainBox.pack_start(self._useRPC, False, False, 16)
    821821
     
    841841        if not self._settingFromConfig and not self._warnedAutoUpdate and \
    842842           not self._autoUpdate.get_active():
    843             dialog = gtk.MessageDialog(parent = self,
     843            dialog = Gtk.MessageDialog(parent = self,
    844844                                       type = MESSAGETYPE_INFO,
    845845                                       message_format = xstr("prefs_update_auto_warning"))
  • src/mlx/gui/statusbar.py

    r994 r996  
    2020#-------------------------------------------------------------------------------
    2121
    22 class Statusbar(gtk.Frame, FlightStatusHandler):
     22class Statusbar(Gtk.Frame, FlightStatusHandler):
    2323    """A status bar for the logger."""
    2424    def __init__(self, iconDirectory):
    2525        """Construct the status bar."""
    26         gtk.Frame.__init__(self)
     26        Gtk.Frame.__init__(self)
    2727        FlightStatusHandler.__init__(self)
    2828
     
    3030        self._connected = False
    3131       
    32         self.set_shadow_type(gtk.ShadowType.NONE)
     32        self.set_shadow_type(Gtk.ShadowType.NONE)
    3333
    34         frameAlignment = gtk.Alignment(xscale = 1.0, yscale = 1.0)
     34        frameAlignment = Gtk.Alignment(xscale = 1.0, yscale = 1.0)
    3535
    3636        frameAlignment.set_padding(padding_top = 2, padding_bottom = 2,
     
    3838        self.add(frameAlignment)
    3939
    40         statusBox = gtk.HBox()
     40        statusBox = Gtk.HBox()
    4141        frameAlignment.add(statusBox)
    4242
     
    5050        self._connGreenIcon = pixbuf_new_from_file(iconPath)
    5151
    52         self._connStateArea = gtk.DrawingArea()
     52        self._connStateArea = Gtk.DrawingArea()
    5353        self._connStateArea.set_size_request(18, 18)
    5454        self._connStateArea.set_tooltip_markup(xstr("statusbar_conn_tooltip"))
     
    5656        self._connStateArea.connect("draw", self._drawConnState)
    5757
    58         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5)
     58        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5)
    5959        alignment.add(self._connStateArea)       
    6060
    6161        statusBox.pack_start(alignment, False, False, 8)
    6262
    63         statusBox.pack_start(gtk.VSeparator(), False, False, 8)
     63        statusBox.pack_start(Gtk.VSeparator(), False, False, 8)
    6464
    65         self._stageLabel = gtk.Label()
     65        self._stageLabel = Gtk.Label()
    6666        longestStage = xstr("flight_stage_" +
    6767                            const.stage2string(const.STAGE_PUSHANDTAXI))
     
    7272        statusBox.pack_start(self._stageLabel, False, False, 8)
    7373
    74         statusBox.pack_start(gtk.VSeparator(), False, False, 8)
     74        statusBox.pack_start(Gtk.VSeparator(), False, False, 8)
    7575
    76         self._timeLabel = gtk.Label("--:--:--")
     76        self._timeLabel = Gtk.Label("--:--:--")
    7777        self._timeLabel.set_width_chars(8)
    7878        self._timeLabel.set_tooltip_text(xstr("statusbar_time_tooltip"))
     
    8181        statusBox.pack_start(self._timeLabel, False, False, 8)
    8282
    83         statusBox.pack_start(gtk.VSeparator(), False, False, 8)
     83        statusBox.pack_start(Gtk.VSeparator(), False, False, 8)
    8484
    85         self._ratingLabel = gtk.Label()
     85        self._ratingLabel = Gtk.Label()
    8686        self._ratingLabel.set_width_chars(20)
    8787        self._ratingLabel.set_tooltip_text(xstr("statusbar_rating_tooltip"))
     
    9090        statusBox.pack_start(self._ratingLabel, False, False, 8)
    9191
    92         self._busyLabel = gtk.Label()
     92        self._busyLabel = Gtk.Label()
    9393        self._busyLabel.set_width_chars(30)
    9494        self._busyLabel.set_tooltip_text(xstr("statusbar_busy_tooltip"))
  • src/mlx/gui/statusicon.py

    r994 r996  
    3030        self._selfToggling = False
    3131
    32         menu = gtk.Menu()
     32        menu = Gtk.Menu()
    3333
    3434        if appIndicator:
    35             self._stageMenuItem = gtk.MenuItem("-")
     35            self._stageMenuItem = Gtk.MenuItem("-")
    3636            self._stageMenuItem.show()
    3737            menu.append(self._stageMenuItem)
    3838
    39             self._ratingMenuItem = gtk.MenuItem("-")
     39            self._ratingMenuItem = Gtk.MenuItem("-")
    4040            self._ratingMenuItem.show()
    4141            menu.append(self._ratingMenuItem)
    4242
    43             separator = gtk.SeparatorMenuItem()
     43            separator = Gtk.SeparatorMenuItem()
    4444            separator.show()
    4545            menu.append(separator)
    4646
    47         self._showHideMenuItem = gtk.CheckMenuItem()
     47        self._showHideMenuItem = Gtk.CheckMenuItem()
    4848        self._showHideMenuItem.set_label(xstr("statusicon_showmain"))
    4949        self._showHideMenuItem.set_active(True)
     
    5252        menu.append(self._showHideMenuItem)
    5353
    54         self._showMonitorMenuItem = gtk.CheckMenuItem()
     54        self._showMonitorMenuItem = Gtk.CheckMenuItem()
    5555        self._showMonitorMenuItem.set_label(xstr("statusicon_showmonitor"))
    5656        self._showMonitorMenuItem.set_active(False)
     
    5959        menu.append(self._showMonitorMenuItem)
    6060
    61         separator = gtk.SeparatorMenuItem()
     61        separator = Gtk.SeparatorMenuItem()
    6262        separator.show()
    6363        menu.append(separator)
    6464
    65         self._quitMenuItem = gtk.MenuItem()
     65        self._quitMenuItem = Gtk.MenuItem()
    6666        self._quitMenuItem.set_label(xstr("statusicon_quit"))
    6767        self._quitMenuItem.show()
     
    8282        else:
    8383            def popup_menu(status, button, time):
    84                 menu.popup(None, None, gtk.status_icon_position_menu,
     84                menu.popup(None, None, Gtk.status_icon_position_menu,
    8585                           button, time, status)
    8686
    87             statusIcon = gtk.StatusIcon()
     87            statusIcon = Gtk.StatusIcon()
    8888            statusIcon.set_from_file(iconFile)
    8989            statusIcon.set_visible(True)
  • src/mlx/gui/timetable.py

    r995 r996  
    1414#-----------------------------------------------------------------------------
    1515
    16 class Timetable(gtk.Alignment):
     16class Timetable(Gtk.Alignment):
    1717    """The widget for the time table."""
    1818    def _getVIPRenderer():
    1919        """Get the renderer for the VIP column."""
    20         renderer = gtk.CellRendererToggle()
     20        renderer = Gtk.CellRendererToggle()
    2121        renderer.set_activatable(True)
    2222        return renderer
     
    7474            columnDescriptor.appendType(types)
    7575
    76         self._model = gtk.ListStore(*types)
     76        self._model = Gtk.ListStore(*types)
    7777        if defaultSortableIndex is not None:
    7878            sortOrder = SORT_DESCENDING \
     
    8080              else SORT_ASCENDING
    8181            self._model.set_sort_column_id(defaultSortableIndex, sortOrder)
    82         self._view = gtk.TreeView(self._model)
     82        self._view = Gtk.TreeView(self._model)
    8383
    8484        self._view.connect("motion-notify-event", self._updateTooltip)
    8585
    86         flightPairIndexColumn = gtk.TreeViewColumn()
     86        flightPairIndexColumn = Gtk.TreeViewColumn()
    8787        flightPairIndexColumn.set_visible(False)
    8888        self._view.append_column(flightPairIndexColumn)
     
    102102        selection.connect("changed", self._selectionChanged)
    103103
    104         scrolledWindow = gtk.ScrolledWindow()
     104        scrolledWindow = Gtk.ScrolledWindow()
    105105        scrolledWindow.add(self._view)
    106106        scrolledWindow.set_size_request(800, -1)
    107107
    108108        # FIXME: these should be constants in common.py
    109         scrolledWindow.set_policy(gtk.PolicyType.AUTOMATIC,
    110                                   gtk.PolicyType.AUTOMATIC)
    111         scrolledWindow.set_shadow_type(gtk.ShadowType.IN)
     109        scrolledWindow.set_policy(Gtk.PolicyType.AUTOMATIC,
     110                                  Gtk.PolicyType.AUTOMATIC)
     111        scrolledWindow.set_shadow_type(Gtk.ShadowType.IN)
    112112
    113113        super(Timetable, self).__init__(xalign = 0.5, yalign = 0.0,
     
    252252#-----------------------------------------------------------------------------
    253253
    254 class CalendarWindow(gtk.Window):
     254class CalendarWindow(Gtk.Window):
    255255    """A window for a calendar."""
    256256    def __init__(self):
     
    262262        self.connect("key-press-event", self._keyPressed)
    263263
    264         mainAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     264        mainAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    265265                                      xscale = 1.0, yscale = 1.0)
    266266        #mainAlignment.set_padding(padding_top = 0, padding_bottom = 12,
    267267        #                              padding_left = 8, padding_right = 8)
    268268
    269         self._calendar = gtk.Calendar()
     269        self._calendar = Gtk.Calendar()
    270270        self._calendar.connect("day-selected-double-click", self._daySelectedDoubleClick)
    271271        mainAlignment.add(self._calendar)
     
    305305#-----------------------------------------------------------------------------
    306306
    307 class BookDialog(gtk.Dialog):
     307class BookDialog(Gtk.Dialog):
    308308    """The dialog box to select additional data for a booking."""
    309309    def __init__(self, timetableWindow, flightPair, planes):
     
    315315        contentArea = self.get_content_area()
    316316
    317         frame = gtk.Frame(xstr("timetable_book_frame_title"))
     317        frame = Gtk.Frame(xstr("timetable_book_frame_title"))
    318318        frame.set_size_request(600, -1)
    319319
    320         mainAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     320        mainAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    321321                                      xscale = 0.0, yscale = 0.0)
    322322        mainAlignment.set_padding(padding_top = 16, padding_bottom = 12,
    323323                                  padding_left = 8, padding_right = 8)
    324324
    325         table = gtk.Table(6, 2)
     325        table = Gtk.Table(6, 2)
    326326        table.set_row_spacings(8)
    327327        table.set_col_spacings(16)
    328328
    329329        row = 0
    330         label = gtk.Label()
     330        label = Gtk.Label()
    331331        label.set_markup(xstr("timetable_book_callsign"))
    332332        label.set_alignment(0.0, 0.5)
     
    336336        if flightPair.flight1 is not None:
    337337            text += " / " + flightPair.flight1.callsign
    338         label = gtk.Label(text)
     338        label = Gtk.Label(text)
    339339        label.set_alignment(0.0, 0.5)
    340340        table.attach(label, 1, 2, row, row + 1)
     
    342342        row += 1
    343343
    344         label = gtk.Label()
     344        label = Gtk.Label()
    345345        label.set_markup(xstr("timetable_book_from_to"))
    346346        label.set_alignment(0.0, 0.5)
     
    351351        if flightPair.flight1 is not None:
    352352            text += " - " + flightPair.flight1.arrivalICAO
    353         label = gtk.Label(text)
     353        label = Gtk.Label(text)
    354354        label.set_alignment(0.0, 0.5)
    355355        table.attach(label, 1, 2, row, row + 1)
     
    359359        if flightPair.flight0.type==ScheduledFlight.TYPE_VIP and \
    360360           flightPair.flight0.date!=const.defaultDate:
    361             label = gtk.Label()
     361            label = Gtk.Label()
    362362            label.set_markup(xstr("timetable_book_flightDate"))
    363363            label.set_use_underline(True)
     
    365365            table.attach(label, 0, 1, row, row + 1)
    366366
    367             self._flightDate = gtk.Button()
     367            self._flightDate = Gtk.Button()
    368368            self._flightDate.connect("clicked", self._flightDateClicked)
    369369            self._flightDate.set_tooltip_text(xstr("timetable_book_flightDate_tooltip"))
     
    384384            self._calendarWindow = None
    385385
    386         label = gtk.Label()
     386        label = Gtk.Label()
    387387        label.set_markup(xstr("timetable_book_dep_arr"))
    388388        label.set_alignment(0.0, 0.5)
     
    394394            text += " / " + str(flightPair.flight1.departureTime) + " - " + \
    395395                    str(flightPair.flight1.arrivalTime)
    396         label = gtk.Label(text)
     396        label = Gtk.Label(text)
    397397        label.set_alignment(0.0, 0.5)
    398398        table.attach(label, 1, 2, row, row + 1)
     
    400400        row += 1
    401401
    402         label = gtk.Label()
     402        label = Gtk.Label()
    403403        label.set_markup(xstr("timetable_book_duration"))
    404404        label.set_alignment(0.0, 0.5)
     
    411411            duration = flightPair.flight0.duration
    412412            text += " / %02d:%02d" % (duration/3600, (duration%3600)/60)
    413         label = gtk.Label(text)
     413        label = Gtk.Label(text)
    414414        label.set_alignment(0.0, 0.5)
    415415        table.attach(label, 1, 2, row, row + 1)
     
    417417        row += 2
    418418
    419         label = gtk.Label()
     419        label = Gtk.Label()
    420420        label.set_markup(xstr("timetable_book_tailNumber"))
    421421        label.set_alignment(0.0, 0.5)
     
    423423
    424424        self._planes = planes
    425         tailNumbersModel = gtk.ListStore(str)
     425        tailNumbersModel = Gtk.ListStore(str)
    426426        for plane in planes:
    427427            tailNumbersModel.append((plane.tailNumber,))
    428428
    429         self._tailNumber = gtk.ComboBox(model = tailNumbersModel)
    430         renderer = gtk.CellRendererText()
     429        self._tailNumber = Gtk.ComboBox(model = tailNumbersModel)
     430        renderer = Gtk.CellRendererText()
    431431        self._tailNumber.pack_start(renderer, True)
    432432        self._tailNumber.add_attribute(renderer, "text", 0)
     
    465465    def _flightDateClicked(self, button):
    466466        """Called when the flight date button is clicked."""
    467         self._calendarWindow.set_position(gtk.WIN_POS_MOUSE)
     467        self._calendarWindow.set_position(Gtk.WIN_POS_MOUSE)
    468468        self.set_focus(self._calendarWindow)
    469469        self._calendarWindow.show_all()
     
    481481#-----------------------------------------------------------------------------
    482482
    483 class TimetableWindow(gtk.Window):
     483class TimetableWindow(Gtk.Window):
    484484    """The window to display the timetable."""
    485485    typeFamilies = [
     
    506506        self.connect("key-press-event", self._keyPressed)
    507507
    508         mainAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     508        mainAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    509509                                      xscale = 1.0, yscale = 1.0)
    510510        mainAlignment.set_padding(padding_top = 0, padding_bottom = 12,
    511511                                  padding_left = 8, padding_right = 8)
    512512
    513         vbox = gtk.VBox()
    514 
    515         filterAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     513        vbox = Gtk.VBox()
     514
     515        filterAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    516516                                        xscale = 1.0, yscale = 1.0)
    517517
    518         filterFrame = gtk.Frame()
     518        filterFrame = Gtk.Frame()
    519519        filterFrame.set_label(xstr("timetable_filter"))
    520520
    521         filterVBox = gtk.VBox()
    522 
    523         topAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     521        filterVBox = Gtk.VBox()
     522
     523        topAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    524524                                     xscale = 0.0, yscale = 0.0)
    525         topHBox = gtk.HBox()
    526 
    527         label = gtk.Label(xstr("timetable_flightdate"))
     525        topHBox = Gtk.HBox()
     526
     527        label = Gtk.Label(xstr("timetable_flightdate"))
    528528        label.set_use_underline(True)
    529529        topHBox.pack_start(label, False, False, 4)
    530530
    531         self._flightDate = gtk.Button()
     531        self._flightDate = Gtk.Button()
    532532        self._flightDate.connect("clicked", self._flightDateClicked)
    533533        self._flightDate.connect("clicked", self._flightDateClicked)
     
    536536        topHBox.pack_start(self._flightDate, False, False, 4)
    537537
    538         filler = gtk.Alignment()
     538        filler = Gtk.Alignment()
    539539        filler.set_size_request(48, 2)
    540540        topHBox.pack_start(filler, False, True, 0)
    541541
    542         self._regularFlights = gtk.CheckButton(xstr("timetable_show_regular"))
     542        self._regularFlights = Gtk.CheckButton(xstr("timetable_show_regular"))
    543543        self._regularFlights.set_use_underline(True)
    544544        self._regularFlights.set_tooltip_text(xstr("timetable_show_regular_tooltip"))
     
    547547        topHBox.pack_start(self._regularFlights, False, False, 8)
    548548
    549         self._vipFlights = gtk.CheckButton(xstr("timetable_show_vip"))
     549        self._vipFlights = Gtk.CheckButton(xstr("timetable_show_vip"))
    550550        self._vipFlights.set_use_underline(True)
    551551        self._vipFlights.set_tooltip_text(xstr("timetable_show_vip_tooltip"))
     
    558558        filterVBox.pack_start(topAlignment, False, False, 4)
    559559
    560         separator = gtk.HSeparator()
     560        separator = Gtk.HSeparator()
    561561        filterVBox.pack_start(separator, False, False, 4)
    562562
    563         typeAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     563        typeAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    564564                                      xscale = 0.0, yscale = 0.0)
    565565
     
    567567        numRows = (len(TimetableWindow.typeFamilies)+numColumns-1)/numColumns
    568568
    569         typeTable = gtk.Table(numRows, numColumns)
     569        typeTable = Gtk.Table(numRows, numColumns)
    570570        typeTable.set_col_spacings(8)
    571571        row = 0
     
    573573        self._typeFamilyButtons = {}
    574574        for typeFamily in TimetableWindow.typeFamilies:
    575             checkButton = gtk.CheckButton(aircraftFamilyNames[typeFamily])
     575            checkButton = Gtk.CheckButton(aircraftFamilyNames[typeFamily])
    576576            checkButton.set_active(True)
    577577            checkButton.connect("toggled", self._filterChanged)
     
    599599        vbox.pack_start(self._timetable, True, True, 2)
    600600
    601         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     601        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    602602                                  xscale = 0.0, yscale = 0.0)
    603         buttonBox = gtk.HBox()
    604 
    605         self._bookButton = gtk.Button(xstr("button_book"))
     603        buttonBox = Gtk.HBox()
     604
     605        self._bookButton = Gtk.Button(xstr("button_book"))
    606606        self._bookButton.set_use_underline(True)
    607607        self._bookButton.set_can_default(True)
     
    610610        buttonBox.pack_start(self._bookButton, False, False, 4);
    611611
    612         self._closeButton = gtk.Button(xstr("button_close"))
     612        self._closeButton = Gtk.Button(xstr("button_close"))
    613613        self._closeButton.set_use_underline(True)
    614614        self._closeButton.connect("clicked", self._closeClicked)
     
    678678    def _flightDateClicked(self, button):
    679679        """Called when the flight date button is clicked."""
    680         self._calendarWindow.set_position(gtk.WIN_POS_MOUSE)
     680        self._calendarWindow.set_position(Gtk.WIN_POS_MOUSE)
    681681        self.set_focus(self._calendarWindow)
    682682        self._calendarWindow.show_all()
     
    771771        """Called when the booking has finished."""
    772772        if returned:
    773             dialog = gtk.MessageDialog(parent = self,
     773            dialog = Gtk.MessageDialog(parent = self,
    774774                                       type = MESSAGETYPE_INFO,
    775775                                       message_format = xstr("bookflights_successful"))
    776776            dialog.format_secondary_markup(xstr("bookflights_successful_secondary"))
    777777        else:
    778             dialog = gtk.MessageDialog(parent = self,
     778            dialog = Gtk.MessageDialog(parent = self,
    779779                                       type = MESSAGETYPE_ERROR,
    780780                                       message_format = xstr("bookflights_failed"))
     
    789789    def _createTimetablePopupMenu(self):
    790790        """Get the popuop menu for the timetable."""
    791         menu = gtk.Menu()
    792 
    793         menuItem = gtk.MenuItem()
     791        menu = Gtk.Menu()
     792
     793        menuItem = Gtk.MenuItem()
    794794        menuItem.set_label(xstr("timetable_popup_book"))
    795795        menuItem.set_use_underline(True)
  • src/mlx/gui/update.py

    r995 r996  
    4646            return
    4747
    48         Updater._progressWindow = window = gtk.Window()
     48        Updater._progressWindow = window = Gtk.Window()
    4949        window.set_title(WINDOW_TITLE_BASE + " " + xstr("update_title"))
    5050        window.set_transient_for(parentWindow)
     
    5555        window.connect("delete-event", lambda a, b: True)
    5656        window.set_deletable(False)
    57         window.set_position(gtk.WindowPosition.CENTER_ON_PARENT)
    58 
    59         mainAlignment = gtk.Alignment(xscale = 1.0)
     57        window.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
     58
     59        mainAlignment = Gtk.Alignment(xscale = 1.0)
    6060        mainAlignment.set_padding(padding_top = 4, padding_bottom = 10,
    6161                                  padding_left = 16, padding_right = 16)
    6262        window.add(mainAlignment)
    6363
    64         mainVBox = gtk.VBox()
     64        mainVBox = Gtk.VBox()
    6565        mainAlignment.add(mainVBox)
    6666
    67         labelAlignment = gtk.Alignment(xalign = 0.0, xscale = 0.0)
    68         Updater._progressLabel = progressLabel = gtk.Label()
     67        labelAlignment = Gtk.Alignment(xalign = 0.0, xscale = 0.0)
     68        Updater._progressLabel = progressLabel = Gtk.Label()
    6969        labelAlignment.add(progressLabel)
    7070        mainVBox.pack_start(labelAlignment, True, True, 4)
    7171       
    72         Updater._progressBar = progressBar = gtk.ProgressBar()
     72        Updater._progressBar = progressBar = Gtk.ProgressBar()
    7373        mainVBox.pack_start(progressBar, True, True, 4)
    7474
    75         buttonAlignment = gtk.Alignment(xalign = 0.5, xscale = 0.1)
    76         Updater._progressOKButton = progressOKButton = gtk.Button("OK")
     75        buttonAlignment = Gtk.Alignment(xalign = 0.5, xscale = 0.1)
     76        Updater._progressOKButton = progressOKButton = Gtk.Button("OK")
    7777        buttonAlignment.add(progressOKButton)       
    7878        mainVBox.pack_start(buttonAlignment, True, True, 4)
    7979
    8080        Updater._sudoDialog = sudoDialog = \
    81             gtk.Dialog(WINDOW_TITLE_BASE + " " + xstr("update_title"),
     81            Gtk.Dialog(WINDOW_TITLE_BASE + " " + xstr("update_title"),
    8282                       parentWindow,
    83                        gtk.DialogFlags.MODAL)
     83                       Gtk.DialogFlags.MODAL)
    8484        sudoDialog.add_button(xstr("button_cancel"), 0)
    8585        sudoDialog.add_button(xstr("button_ok"), 1)
    8686                       
    87         infoLabelAlignment = gtk.Alignment(xalign = 0.5, xscale = 0.1)
     87        infoLabelAlignment = Gtk.Alignment(xalign = 0.5, xscale = 0.1)
    8888        infoLabelAlignment.set_padding(padding_top = 4, padding_bottom = 10,
    8989                                       padding_left = 16, padding_right = 16)
    9090
    91         infoLabel = gtk.Label(xstr("update_needsudo"))
    92         infoLabel.set_justify(gtk.Justification.CENTER)
     91        infoLabel = Gtk.Label(xstr("update_needsudo"))
     92        infoLabel.set_justify(Gtk.Justification.CENTER)
    9393        infoLabelAlignment.add(infoLabel)
    9494        sudoDialog.vbox.pack_start(infoLabelAlignment, True, True, 4)
    9595
    96         sudoDialog.set_position(gtk.WindowPosition.CENTER_ON_PARENT)
     96        sudoDialog.set_position(Gtk.WindowPosition.CENTER_ON_PARENT)
    9797
    9898    def __init__(self, gui, programDirectory, updateURL, parentWindow):
  • src/mlx/gui/weighthelp.py

    r995 r996  
    1515#-------------------------------------------------------------------------------
    1616
    17 class WeightHelp(gtk.VBox):
     17class WeightHelp(Gtk.VBox):
    1818    """The weight calculation help tab."""
    1919    @staticmethod
     
    4040        self._gui = gui
    4141
    42         mainAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     42        mainAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    4343                                      xscale = 1.0, yscale = 1.0)
    4444        mainAlignment.set_padding(padding_top = 4, padding_bottom = 4,
     
    4646        self.add(mainAlignment)
    4747
    48         self._mainBox = mainBox = gtk.VBox()
     48        self._mainBox = mainBox = Gtk.VBox()
    4949        mainAlignment.add(mainBox)
    5050
    51         self._usingHelp = gtk.CheckButton(xstr("weighthelp_usinghelp"))
     51        self._usingHelp = Gtk.CheckButton(xstr("weighthelp_usinghelp"))
    5252        self._usingHelp.set_use_underline(True)
    5353        self._usingHelp.set_tooltip_text(xstr("weighthelp_usinghelp_tooltip"))
     
    5656
    5757       
    58         self._weightsTable = table = gtk.Table(16, 5)
     58        self._weightsTable = table = Gtk.Table(16, 5)
    5959        table.set_homogeneous(False)
    6060        table.set_row_spacings(4)
    6161        table.set_col_spacings(16)
    62         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     62        alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5,
    6363                                  xscale = 0.0, yscale = 0.0)
    6464        alignment.add(table)
    6565        mainBox.pack_start(alignment, True, True, 4)
    6666
    67         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.0,
     67        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.0,
    6868                                  xscale = 0.0, yscale = 0.0)
    6969        alignment.set_padding(padding_bottom = 16, padding_top = 0,
    7070                              padding_left = 0, padding_right = 0)
    71         label = gtk.Label(xstr("weighthelp_header_calculated"))
     71        label = Gtk.Label(xstr("weighthelp_header_calculated"))
    7272        label.set_use_markup(True)
    7373        # FIXME: should be a constant in common
    74         label.set_justify(gtk.Justification.CENTER)
     74        label.set_justify(Gtk.Justification.CENTER)
    7575        alignment.add(label)
    7676        table.attach(alignment, 1, 2, 0, 1)
    7777       
    78         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.0,
     78        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.0,
    7979                                  xscale = 0.0, yscale = 0.0)
    8080        alignment.set_padding(padding_bottom = 16, padding_top = 0,
    8181                              padding_left = 0, padding_right = 0)
    82         button = gtk.Button(xstr("weighthelp_header_simulator"))
     82        button = Gtk.Button(xstr("weighthelp_header_simulator"))
    8383        button.set_tooltip_markup(xstr("weighthelp_header_simulator_tooltip"))
    8484        button.connect("clicked", self._fsButtonClicked)
    8585        label = button.get_child()
    86         label.set_justify(gtk.Justification.CENTER)
     86        label.set_justify(Gtk.Justification.CENTER)
    8787        alignment.add(button)
    8888        table.attach(alignment, 3, 4, 0, 1)
    8989       
    9090
    91         self._crewLabel = gtk.Label(xstr("weighthelp_crew") % ("99",))
    92         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     91        self._crewLabel = Gtk.Label(xstr("weighthelp_crew") % ("99",))
     92        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    9393                                  xscale = 0.0, yscale = 0.0)
    9494        alignment.add(self._crewLabel)
    9595        table.attach(alignment, 0, 1, 1, 2)
    9696
    97         self._crewWeight = gtk.Label("0")
    98         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     97        self._crewWeight = Gtk.Label("0")
     98        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    9999                                  xscale = 0.0, yscale = 0.0)
    100100        alignment.add(self._crewWeight)
    101101        table.attach(alignment, 1, 2, 1, 2)
    102102       
    103         table.attach(gtk.Label("kg"), 2, 3, 1, 2)
     103        table.attach(Gtk.Label("kg"), 2, 3, 1, 2)
    104104
    105105        text = xstr("weighthelp_pax") % ("999",)
    106         self._paxLabel = gtk.Label(text)
     106        self._paxLabel = Gtk.Label(text)
    107107        self._paxLabel.set_width_chars(len(text))
    108108        self._paxLabel.set_alignment(0.0, 0.5)
    109         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     109        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    110110                                  xscale = 0.0, yscale = 0.0)
    111111        alignment.add(self._paxLabel)
    112112        table.attach(alignment, 0, 1, 2, 3)
    113113
    114         self._paxWeight = gtk.Label("20000")
    115         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     114        self._paxWeight = Gtk.Label("20000")
     115        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    116116                                  xscale = 0.0, yscale = 0.0)
    117117        alignment.add(self._paxWeight)
    118118        table.attach(alignment, 1, 2, 2, 3)
    119119       
    120         table.attach(gtk.Label("kg"), 2, 3, 2, 3)
    121        
    122         label = gtk.Label(xstr("weighthelp_baggage"))
    123         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     120        table.attach(Gtk.Label("kg"), 2, 3, 2, 3)
     121       
     122        label = Gtk.Label(xstr("weighthelp_baggage"))
     123        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    124124                                  xscale = 0.0, yscale = 0.0)
    125125        alignment.add(label)
    126126        table.attach(alignment, 0, 1, 3, 4)
    127127
    128         self._bagWeight = gtk.Label("2000")
    129         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     128        self._bagWeight = Gtk.Label("2000")
     129        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    130130                                  xscale = 0.0, yscale = 0.0)
    131131        alignment.add(self._bagWeight)
    132132        table.attach(alignment, 1, 2, 3, 4)
    133133       
    134         table.attach(gtk.Label("kg"), 2, 3, 3, 4)
    135        
    136         label = gtk.Label(xstr("weighthelp_cargo"))
    137         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     134        table.attach(Gtk.Label("kg"), 2, 3, 3, 4)
     135       
     136        label = Gtk.Label(xstr("weighthelp_cargo"))
     137        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    138138                                  xscale = 0.0, yscale = 0.0)
    139139        alignment.add(label)
    140140        table.attach(alignment, 0, 1, 4, 5)
    141141
    142         self._cargoWeight = gtk.Label("2000")
    143         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     142        self._cargoWeight = Gtk.Label("2000")
     143        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    144144                                  xscale = 0.0, yscale = 0.0)
    145145        alignment.add(self._cargoWeight)
    146146        table.attach(alignment, 1, 2, 4, 5)
    147147       
    148         table.attach(gtk.Label("kg"), 2, 3, 4, 5)
    149        
    150         label = gtk.Label(xstr("weighthelp_mail"))
    151         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     148        table.attach(Gtk.Label("kg"), 2, 3, 4, 5)
     149       
     150        label = Gtk.Label(xstr("weighthelp_mail"))
     151        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    152152                                  xscale = 0.0, yscale = 0.0)
    153153        alignment.add(label)
    154154        table.attach(alignment, 0, 1, 5, 6)
    155155
    156         self._mailWeight = gtk.Label("2000")
    157         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     156        self._mailWeight = Gtk.Label("2000")
     157        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    158158                                  xscale = 0.0, yscale = 0.0)
    159159        alignment.add(self._mailWeight)
    160160        table.attach(alignment, 1, 2, 5, 6)
    161161       
    162         table.attach(gtk.Label("kg"), 2, 3, 5, 6)
    163 
    164         table.attach(gtk.HSeparator(), 1, 2, 6, 7)
    165 
    166         label = gtk.Label("<b>" + xstr("weighthelp_payload") + "</b>")
    167         label.set_use_markup(True)
    168         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     162        table.attach(Gtk.Label("kg"), 2, 3, 5, 6)
     163
     164        table.attach(Gtk.HSeparator(), 1, 2, 6, 7)
     165
     166        label = Gtk.Label("<b>" + xstr("weighthelp_payload") + "</b>")
     167        label.set_use_markup(True)
     168        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    169169                                  xscale = 0.0, yscale = 0.0)
    170170        alignment.add(label)
    171171        table.attach(alignment, 0, 1, 7, 8)
    172172
    173         self._payload = gtk.Label("<b>32000</b>")
     173        self._payload = Gtk.Label("<b>32000</b>")
    174174        self._payload.set_use_markup(True)
    175         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     175        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    176176                                  xscale = 0.0, yscale = 0.0)
    177177        alignment.add(self._payload)
    178178        table.attach(alignment, 1, 2, 7, 8)
    179179       
    180         table.attach(gtk.Label("kg"), 2, 3, 7, 8)
    181 
    182         self._fsPayload = gtk.Label("<b>32001</b>")
     180        table.attach(Gtk.Label("kg"), 2, 3, 7, 8)
     181
     182        self._fsPayload = Gtk.Label("<b>32001</b>")
    183183        self._fsPayload.set_use_markup(True)
    184         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     184        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    185185                                  xscale = 0.0, yscale = 0.0)
    186186        alignment.add(self._fsPayload)
    187187        table.attach(alignment, 3, 4, 7, 8)
    188188       
    189         table.attach(gtk.Label("kg"), 4, 5, 7, 8)
    190 
    191         label = gtk.Label(xstr("weighthelp_dow"))
    192         label.set_use_markup(True)
    193         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     189        table.attach(Gtk.Label("kg"), 4, 5, 7, 8)
     190
     191        label = Gtk.Label(xstr("weighthelp_dow"))
     192        label.set_use_markup(True)
     193        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    194194                                  xscale = 0.0, yscale = 0.0)
    195195        alignment.add(label)
    196196        table.attach(alignment, 0, 1, 8, 9)
    197197
    198         self._dow = gtk.Label("35000")
    199         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     198        self._dow = Gtk.Label("35000")
     199        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    200200                                  xscale = 0.0, yscale = 0.0)
    201201        alignment.add(self._dow)
    202202        table.attach(alignment, 1, 2, 8, 9)
    203203       
    204         table.attach(gtk.Label("kg"), 2, 3, 8, 9)
    205 
    206         self._fsDOW = gtk.Label("33012")
    207         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     204        table.attach(Gtk.Label("kg"), 2, 3, 8, 9)
     205
     206        self._fsDOW = Gtk.Label("33012")
     207        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    208208                                  xscale = 0.0, yscale = 0.0)
    209209        alignment.add(self._fsDOW)
    210210        table.attach(alignment, 3, 4, 8, 9)
    211211       
    212         table.attach(gtk.Label("kg"), 4, 5, 8, 9)
    213 
    214         table.attach(gtk.HSeparator(), 1, 2, 9, 10)
    215 
    216         table.attach(gtk.HSeparator(), 3, 4, 9, 10)
    217 
    218         label = gtk.Label("<b>" + xstr("weighthelp_zfw") + "</b>")
    219         label.set_use_markup(True)
    220         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     212        table.attach(Gtk.Label("kg"), 4, 5, 8, 9)
     213
     214        table.attach(Gtk.HSeparator(), 1, 2, 9, 10)
     215
     216        table.attach(Gtk.HSeparator(), 3, 4, 9, 10)
     217
     218        label = Gtk.Label("<b>" + xstr("weighthelp_zfw") + "</b>")
     219        label.set_use_markup(True)
     220        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    221221                                  xscale = 0.0, yscale = 0.0)
    222222        alignment.add(label)
    223223        table.attach(alignment, 0, 1, 10, 11)
    224224
    225         self._zfw = gtk.Label("<b>122000</b>")
     225        self._zfw = Gtk.Label("<b>122000</b>")
    226226        self._zfw.set_use_markup(True)
    227         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     227        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    228228                                  xscale = 0.0, yscale = 0.0)
    229229        alignment.add(self._zfw)
    230230        table.attach(alignment, 1, 2, 10, 11)
    231231       
    232         table.attach(gtk.Label("kg"), 2, 3, 10, 11)
    233 
    234         self._fsZFW = gtk.Label("<b>124000</b>")
     232        table.attach(Gtk.Label("kg"), 2, 3, 10, 11)
     233
     234        self._fsZFW = Gtk.Label("<b>124000</b>")
    235235        self._fsZFW.set_use_markup(True)
    236         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     236        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    237237                                  xscale = 0.0, yscale = 0.0)
    238238        alignment.add(self._fsZFW)
    239239        table.attach(alignment, 3, 4, 10, 11)
    240240       
    241         table.attach(gtk.Label("kg"), 4, 5, 10, 11)
    242 
    243         table.attach(gtk.HSeparator(), 0, 5, 11, 12)
    244        
    245         label = gtk.Label(xstr("weighthelp_gross"))
    246         label.set_use_markup(True)
    247         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     241        table.attach(Gtk.Label("kg"), 4, 5, 10, 11)
     242
     243        table.attach(Gtk.HSeparator(), 0, 5, 11, 12)
     244       
     245        label = Gtk.Label(xstr("weighthelp_gross"))
     246        label.set_use_markup(True)
     247        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    248248                                  xscale = 0.0, yscale = 0.0)
    249249        alignment.add(label)
    250250        table.attach(alignment, 0, 1, 12, 13)
    251251
    252         self._fsGross = gtk.Label("124000")
    253         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     252        self._fsGross = Gtk.Label("124000")
     253        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    254254                                  xscale = 0.0, yscale = 0.0)
    255255        alignment.add(self._fsGross)
    256256        table.attach(alignment, 3, 4, 12, 13)
    257257       
    258         table.attach(gtk.Label("kg"), 4, 5, 12, 13)
    259 
    260         label = gtk.Label(xstr("weighthelp_mzfw"))
    261         label.set_use_markup(True)
    262         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     258        table.attach(Gtk.Label("kg"), 4, 5, 12, 13)
     259
     260        label = Gtk.Label(xstr("weighthelp_mzfw"))
     261        label.set_use_markup(True)
     262        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    263263                                  xscale = 0.0, yscale = 0.0)
    264264        alignment.add(label)
    265265        table.attach(alignment, 0, 1, 13, 14)
    266266
    267         self._mzfw = gtk.Label("35000")
    268         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     267        self._mzfw = Gtk.Label("35000")
     268        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    269269                                  xscale = 0.0, yscale = 0.0)
    270270        alignment.add(self._mzfw)
    271271        table.attach(alignment, 1, 2, 13, 14)
    272272       
    273         table.attach(gtk.Label("kg"), 2, 3, 13, 14)
    274 
    275         label = gtk.Label(xstr("weighthelp_mtow"))
    276         label.set_use_markup(True)
    277         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     273        table.attach(Gtk.Label("kg"), 2, 3, 13, 14)
     274
     275        label = Gtk.Label(xstr("weighthelp_mtow"))
     276        label.set_use_markup(True)
     277        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    278278                                  xscale = 0.0, yscale = 0.0)
    279279        alignment.add(label)
    280280        table.attach(alignment, 0, 1, 14, 15)
    281281
    282         self._mtow = gtk.Label("35000")
    283         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     282        self._mtow = Gtk.Label("35000")
     283        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    284284                                  xscale = 0.0, yscale = 0.0)
    285285        alignment.add(self._mtow)
    286286        table.attach(alignment, 1, 2, 14, 15)
    287287       
    288         table.attach(gtk.Label("kg"), 2, 3, 14, 15)
    289 
    290         label = gtk.Label(xstr("weighthelp_mlw"))
    291         label.set_use_markup(True)
    292         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,
     288        table.attach(Gtk.Label("kg"), 2, 3, 14, 15)
     289
     290        label = Gtk.Label(xstr("weighthelp_mlw"))
     291        label.set_use_markup(True)
     292        alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5,
    293293                                  xscale = 0.0, yscale = 0.0)
    294294        alignment.add(label)
    295295        table.attach(alignment, 0, 1, 15, 16)
    296296
    297         self._mlw = gtk.Label("35000")
    298         alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
     297        self._mlw = Gtk.Label("35000")
     298        alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5,
    299299                                  xscale = 0.0, yscale = 0.0)
    300300        alignment.add(self._mlw)
    301301        table.attach(alignment, 1, 2, 15, 16)
    302302       
    303         table.attach(gtk.Label("kg"), 2, 3, 15, 16)
     303        table.attach(Gtk.Label("kg"), 2, 3, 15, 16)
    304304
    305305        self.show_all()
Note: See TracChangeset for help on using the changeset viewer.