Changeset 996:8035d80d5feb
- Timestamp:
- 07/04/19 17:57:45 (5 years ago)
- Branch:
- python3
- Phase:
- public
- Location:
- src/mlx/gui
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/acars.py
r919 r996 18 18 #------------------------------------------------------------------------------ 19 19 20 class ACARS( gtk.VBox):20 class ACARS(Gtk.VBox): 21 21 """The flight info tab.""" 22 22 # The URL of the ACARS map -
src/mlx/gui/bugreport.py
r954 r996 18 18 #------------------------------------------------------------------------------ 19 19 20 class BugReportDialog( gtk.Dialog):20 class BugReportDialog(Gtk.Dialog): 21 21 """The dialog to report a bug.""" 22 22 def __init__(self, gui): … … 33 33 contentArea = self.get_content_area() 34 34 35 contentAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,35 contentAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 36 36 xscale = 0.0, yscale = 0.0) 37 37 contentAlignment.set_padding(padding_top = 4, padding_bottom = 16, … … 40 40 contentArea.pack_start(contentAlignment, False, False, 0) 41 41 42 contentVBox = gtk.VBox()42 contentVBox = Gtk.VBox() 43 43 contentAlignment.add(contentVBox) 44 44 45 label = gtk.Label(xstr("bugreport_summary"))45 label = Gtk.Label(xstr("bugreport_summary")) 46 46 label.set_use_underline(True) 47 47 label.set_alignment(0.0, 0.5) … … 49 49 contentVBox.pack_start(label, False, False, 4) 50 50 51 self._summary = summary = gtk.Entry()51 self._summary = summary = Gtk.Entry() 52 52 summary.connect("changed", self._summaryChanged) 53 53 summary.set_tooltip_text(xstr("bugreport_summary_tooltip")) … … 56 56 contentVBox.pack_start(summary, True, True, 4) 57 57 58 label = gtk.Label(xstr("bugreport_description"))58 label = Gtk.Label(xstr("bugreport_description")) 59 59 label.set_use_underline(True) 60 60 label.set_alignment(0.0, 0.5) … … 62 62 contentVBox.pack_start(label, False, False, 4) 63 63 64 self._description = description = gtk.TextView()64 self._description = description = Gtk.TextView() 65 65 description.set_tooltip_text(xstr("bugreport_description_tooltip")) 66 66 description.set_wrap_mode(WRAP_WORD) 67 67 label.set_mnemonic_widget(description) 68 68 69 scrolledWindow = gtk.ScrolledWindow()69 scrolledWindow = Gtk.ScrolledWindow() 70 70 scrolledWindow.add(description) 71 71 scrolledWindow.set_size_request(-1, 200) … … 73 73 scrolledWindow.set_shadow_type(SHADOW_IN) 74 74 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) 76 76 alignment.add(scrolledWindow) 77 77 78 78 contentVBox.pack_start(alignment, True, True, 4) 79 79 80 emailBox = gtk.HBox()80 emailBox = Gtk.HBox() 81 81 contentVBox.pack_start(emailBox, False, False, 4) 82 82 83 label = gtk.Label(xstr("bugreport_email"))83 label = Gtk.Label(xstr("bugreport_email")) 84 84 label.set_use_underline(True) 85 85 label.set_alignment(0.0, 0.5) … … 87 87 emailBox.pack_start(label, False, False, 0) 88 88 89 alignment = gtk.Alignment()89 alignment = Gtk.Alignment() 90 90 emailBox.pack_start(alignment, False, False, 8) 91 91 92 self._email = email = gtk.Entry()92 self._email = email = Gtk.Entry() 93 93 email.set_tooltip_text(xstr("bugreport_email_tooltip")) 94 94 label.set_mnemonic_widget(email) -
src/mlx/gui/callouts.py
r995 r996 27 27 #------------------------------------------------------------------------------ 28 28 29 class ApproachCalloutsEditor( gtk.Dialog):29 class ApproachCalloutsEditor(Gtk.Dialog): 30 30 """The dialog to edit the approach callouts.""" 31 31 integerRE = re.compile("[0-9]+") … … 67 67 68 68 # 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")) 72 72 label.set_use_underline(True) 73 73 74 74 typeBox.pack_start(label, False, False, 4) 75 75 76 self._aircraftTypeModel = gtk.ListStore(str, int)76 self._aircraftTypeModel = Gtk.ListStore(str, int) 77 77 for type in const.aircraftTypes: 78 78 name = aircraftNames[type] if type in aircraftNames \ 79 79 else "Aircraft type #%d" % (type,) 80 80 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() 83 83 self._aircraftType.pack_start(renderer, True) 84 84 self._aircraftType.add_attribute(renderer, "text", 0) … … 90 90 typeBox.pack_start(self._aircraftType, True, True, 4) 91 91 92 typeBoxAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,92 typeBoxAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 93 93 xscale = 0.0, yscale = 0.0) 94 94 typeBoxAlignment.set_size_request(400, -1) … … 98 98 # FIXME: common code until here, but note that some texts are different 99 99 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, 104 104 xscale = 0.0, yscale = 0.0) 105 105 controlAlignment.set_padding(padding_top = 0, padding_bottom = 0, … … 108 108 contentBox.pack_start(controlAlignment, False, False, 0) 109 109 110 self._addButton = gtk.Button(xstr("callouts_add"))110 self._addButton = Gtk.Button(xstr("callouts_add")) 111 111 self._addButton.set_use_underline(True) 112 112 self._addButton.set_tooltip_text(xstr("callouts_add_tooltip")) 113 113 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, 115 115 xscale = 0.0, yscale = 0.0) 116 116 addAlignment.set_padding(padding_top = 24, padding_bottom = 0, … … 119 119 controlBox.pack_start(addAlignment, False, False, 0) 120 120 121 self._removeButton = gtk.Button(xstr("callouts_remove"))121 self._removeButton = Gtk.Button(xstr("callouts_remove")) 122 122 self._removeButton.set_use_underline(True) 123 123 self._removeButton.set_tooltip_text(xstr("callouts_remove_tooltip")) … … 125 125 self._removeButton.connect("clicked", self._removeButtonClicked) 126 126 127 removeAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.0,127 removeAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.0, 128 128 xscale = 0.0, yscale = 0.0) 129 129 removeAlignment.set_padding(padding_top = 24, padding_bottom = 0, … … 132 132 controlBox.pack_start(removeAlignment, False, False, 0) 133 133 134 self._fileListModel = gtk.ListStore(int, str, str)134 self._fileListModel = Gtk.ListStore(int, str, str) 135 135 self._fileListModel.set_sort_column_id(0, SORT_DESCENDING) 136 136 … … 139 139 self._lastAddedAltitude = None 140 140 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() 144 144 renderer.set_property("editable", True) 145 145 146 adjustment = gtk.Adjustment(0, 0, 5000, 10, 100)146 adjustment = Gtk.Adjustment(0, 0, 5000, 10, 100) 147 147 renderer.set_property("adjustment", adjustment); 148 148 renderer.connect("edited", self._altitudeEdited) 149 149 150 column = gtk.TreeViewColumn(xstr("callouts_header_altitude"),150 column = Gtk.TreeViewColumn(xstr("callouts_header_altitude"), 151 151 renderer, text = 0) 152 152 self._fileList.append_column(column) … … 159 159 column.set_expand(False) 160 160 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) 163 163 self._fileList.append_column(column) 164 164 column.set_expand(True) … … 178 178 self._buildFileListPopupMenu() 179 179 180 scrolledWindow = gtk.ScrolledWindow()180 scrolledWindow = Gtk.ScrolledWindow() 181 181 scrolledWindow.add(self._fileList) 182 182 scrolledWindow.set_size_request(300, -1) … … 184 184 scrolledWindow.set_shadow_type(SHADOW_IN) 185 185 186 fileListAlignment = gtk.Alignment(xscale=1.0, yscale=1.0,186 fileListAlignment = Gtk.Alignment(xscale=1.0, yscale=1.0, 187 187 xalign=0.5, yalign=0.5) 188 188 fileListAlignment.set_padding(padding_top = 0, padding_bottom = 16, … … 292 292 otherPath = self._hasAltitude(newAltitude, ignorePath = editedPath) 293 293 if otherPath is not None: 294 dialog = gtk.MessageDialog(parent = self,294 dialog = Gtk.MessageDialog(parent = self, 295 295 type = MESSAGETYPE_QUESTION, 296 296 message_format = … … 346 346 If it does not exist yet, it will be created.""" 347 347 if self._fileOpenDialog is None: 348 dialog = gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +348 dialog = Gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " + 349 349 xstr("callouts_open_title"), 350 350 action = FILE_CHOOSER_ACTION_OPEN, 351 buttons = ( gtk.STOCK_CANCEL,351 buttons = (Gtk.STOCK_CANCEL, 352 352 RESPONSETYPE_CANCEL, 353 gtk.STOCK_OK, RESPONSETYPE_OK),353 Gtk.STOCK_OK, RESPONSETYPE_OK), 354 354 parent = self) 355 355 dialog.set_modal(True) … … 358 358 # FIXME: create the filters in one location and use them 359 359 # from there 360 filter = gtk.FileFilter()360 filter = Gtk.FileFilter() 361 361 filter.set_name(xstr("file_filter_audio")) 362 362 filter.add_pattern("*.wav") … … 364 364 dialog.add_filter(filter) 365 365 366 filter = gtk.FileFilter()366 filter = Gtk.FileFilter() 367 367 filter.set_name(xstr("file_filter_all")) 368 368 filter.add_pattern("*.*") … … 481 481 def _buildFileListPopupMenu(self): 482 482 """Build the file list popup menu.""" 483 menu = gtk.Menu()484 485 menuItem = gtk.MenuItem()483 menu = Gtk.Menu() 484 485 menuItem = Gtk.MenuItem() 486 486 menuItem.set_label(xstr("callouts_remove")) 487 487 menuItem.set_use_underline(True) -
src/mlx/gui/cef.py
r995 r996 308 308 within.""" 309 309 if os.name=="nt": 310 container = gtk.DrawingArea()310 container = Gtk.DrawingArea() 311 311 container.set_property("can-focus", True) 312 312 container.connect("size-allocate", _handleSizeAllocate) 313 313 else: 314 container = gtk.DrawingArea()314 container = Gtk.DrawingArea() 315 315 316 316 container.show() -
src/mlx/gui/checklist.py
r994 r996 22 22 #------------------------------------------------------------------------------ 23 23 24 class ChecklistEditor( gtk.Dialog):24 class ChecklistEditor(Gtk.Dialog): 25 25 """The dialog to edit the checklists.""" 26 26 def __init__(self, gui): … … 39 39 contentArea = self.get_content_area() 40 40 41 typeBox = gtk.HBox()42 43 label = gtk.Label(xstr("chklst_aircraftType"))41 typeBox = Gtk.HBox() 42 43 label = Gtk.Label(xstr("chklst_aircraftType")) 44 44 label.set_use_underline(True) 45 45 46 46 typeBox.pack_start(label, False, False, 4) 47 47 48 self._aircraftTypeModel = gtk.ListStore(str, int)48 self._aircraftTypeModel = Gtk.ListStore(str, int) 49 49 for type in const.aircraftTypes: 50 50 name = aircraftNames[type] if type in aircraftNames \ 51 51 else "Aircraft type #%d" % (type,) 52 52 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() 55 55 self._aircraftType.pack_start(renderer, True) 56 56 self._aircraftType.add_attribute(renderer, "text", 0) … … 62 62 typeBox.pack_start(self._aircraftType, True, True, 4) 63 63 64 typeBoxAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,64 typeBoxAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 65 65 xscale = 0.0, yscale = 0.0) 66 66 typeBoxAlignment.set_size_request(400, -1) … … 69 69 contentArea.pack_start(typeBoxAlignment, False, False, 12) 70 70 71 fileBox = gtk.HBox()72 73 self._fileChooser = gtk.FileChooserWidget()71 fileBox = Gtk.HBox() 72 73 self._fileChooser = Gtk.FileChooserWidget() 74 74 self._fileChooser.set_select_multiple(True) 75 75 76 filter = gtk.FileFilter()76 filter = Gtk.FileFilter() 77 77 filter.set_name(xstr("file_filter_audio")) 78 78 filter.add_pattern("*.wav") … … 80 80 self._fileChooser.add_filter(filter) 81 81 82 filter = gtk.FileFilter()82 filter = Gtk.FileFilter() 83 83 filter.set_name(xstr("file_filter_all")) 84 84 filter.add_pattern("*.*") … … 90 90 fileBox.pack_start(self._fileChooser, True, True, 4) 91 91 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, 94 94 xscale = 0.0, yscale = 0.0) 95 95 controlAlignment.set_padding(padding_top = 0, padding_bottom = 0, … … 98 98 fileBox.pack_start(controlAlignment, False, False, 0) 99 99 100 self._addButton = gtk.Button(xstr("chklst_add"))100 self._addButton = Gtk.Button(xstr("chklst_add")) 101 101 self._addButton.set_use_underline(True) 102 102 self._addButton.set_tooltip_text(xstr("chklst_add_tooltip")) 103 103 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, 105 105 xscale = 0.0, yscale = 0.0) 106 106 addAlignment.set_padding(padding_top = 64, padding_bottom = 0, … … 109 109 controlBox.pack_start(addAlignment, False, False, 0) 110 110 111 self._removeButton = gtk.Button(xstr("chklst_remove"))111 self._removeButton = Gtk.Button(xstr("chklst_remove")) 112 112 self._removeButton.set_use_underline(True) 113 113 self._removeButton.set_tooltip_text(xstr("chklst_remove_tooltip")) … … 115 115 self._removeButton.connect("clicked", self._removeButtonClicked) 116 116 117 removeAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.0,117 removeAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.0, 118 118 xscale = 0.0, yscale = 0.0) 119 119 removeAlignment.set_padding(padding_top = 64, padding_bottom = 0, … … 122 122 controlBox.pack_start(removeAlignment, False, False, 0) 123 123 124 self._moveUpButton = gtk.Button(xstr("chklst_moveUp"))124 self._moveUpButton = Gtk.Button(xstr("chklst_moveUp")) 125 125 self._moveUpButton.set_use_underline(True) 126 126 self._moveUpButton.set_tooltip_text(xstr("chklst_moveUp_tooltip")) … … 128 128 self._moveUpButton.connect("clicked", self._moveUpButtonClicked) 129 129 130 moveUpAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.0,130 moveUpAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.0, 131 131 xscale = 0.0, yscale = 0.0) 132 132 moveUpAlignment.set_padding(padding_top = 16, padding_bottom = 0, … … 135 135 controlBox.pack_start(moveUpAlignment, False, False, 0) 136 136 137 self._moveDownButton = gtk.Button(xstr("chklst_moveDown"))137 self._moveDownButton = Gtk.Button(xstr("chklst_moveDown")) 138 138 self._moveDownButton.set_use_underline(True) 139 139 self._moveDownButton.set_tooltip_text(xstr("chklst_moveDown_tooltip")) … … 141 141 self._moveDownButton.connect("clicked", self._moveDownButtonClicked) 142 142 143 moveDownAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.0,143 moveDownAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.0, 144 144 xscale = 0.0, yscale = 0.0) 145 145 moveDownAlignment.set_padding(padding_top = 4, padding_bottom = 0, … … 148 148 controlBox.pack_start(moveDownAlignment, False, False, 0) 149 149 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) 152 152 self._fileList.connect("button-press-event", 153 153 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) 156 156 column.set_expand(True) 157 157 column.set_clickable(False) … … 167 167 self._buildFileListPopupMenu() 168 168 169 scrolledWindow = gtk.ScrolledWindow()169 scrolledWindow = Gtk.ScrolledWindow() 170 170 scrolledWindow.add(self._fileList) 171 171 scrolledWindow.set_size_request(200, -1) … … 329 329 def _buildFileListPopupMenu(self): 330 330 """Build the file list popup menu.""" 331 menu = gtk.Menu()332 333 menuItem = gtk.MenuItem()331 menu = Gtk.Menu() 332 333 menuItem = Gtk.MenuItem() 334 334 menuItem.set_label(xstr("chklst_remove")) 335 335 menuItem.set_use_underline(True) … … 340 340 menu.append(menuItem) 341 341 342 menuItem = gtk.MenuItem()342 menuItem = Gtk.MenuItem() 343 343 menuItem.set_label(xstr("chklst_moveUp")) 344 344 menuItem.set_use_underline(True) … … 349 349 menu.append(menuItem) 350 350 351 menuItem = gtk.MenuItem()351 menuItem = Gtk.MenuItem() 352 352 menuItem.set_label(xstr("chklst_moveDown")) 353 353 menuItem.set_use_underline(True) -
src/mlx/gui/common.py
r995 r996 26 26 from gi.repository import GdkPixbuf as gdkPixbuf 27 27 gi.require_version("Gtk", "3.0") 28 from gi.repository import Gtk as gtk28 from gi.repository import Gtk 29 29 try: 30 30 gi.require_version("AppIndicator3", "0.1") … … 36 36 37 37 38 MESSAGETYPE_ERROR = gtk.MessageType.ERROR39 MESSAGETYPE_QUESTION = gtk.MessageType.QUESTION40 MESSAGETYPE_INFO = gtk.MessageType.INFO41 RESPONSETYPE_NONE = gtk.ResponseType.NONE42 RESPONSETYPE_OK = gtk.ResponseType.OK43 RESPONSETYPE_YES = gtk.ResponseType.YES44 RESPONSETYPE_NO = gtk.ResponseType.NO45 RESPONSETYPE_ACCEPT = gtk.ResponseType.ACCEPT46 RESPONSETYPE_REJECT = gtk.ResponseType.REJECT47 RESPONSETYPE_CANCEL = gtk.ResponseType.CANCEL48 ACCEL_VISIBLE = gtk.AccelFlags.VISIBLE38 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 49 49 CONTROL_MASK = gdk.ModifierType.CONTROL_MASK 50 DIALOG_MODAL = gtk.DialogFlags.MODAL51 WRAP_WORD = gtk.WrapMode.WORD52 JUSTIFY_CENTER = gtk.Justification.CENTER53 JUSTIFY_LEFT = gtk.Justification.LEFT50 DIALOG_MODAL = Gtk.DialogFlags.MODAL 51 WRAP_WORD = Gtk.WrapMode.WORD 52 JUSTIFY_CENTER = Gtk.Justification.CENTER 53 JUSTIFY_LEFT = Gtk.Justification.LEFT 54 54 55 55 CONTROL_MASK = gdk.ModifierType.CONTROL_MASK … … 60 60 SCROLL_DOWN = gdk.ScrollDirection.DOWN 61 61 62 SPIN_USER_DEFINED = gtk.SpinType.USER_DEFINED63 64 FILE_CHOOSER_ACTION_SELECT_FOLDER = gtk.FileChooserAction.SELECT_FOLDER65 FILE_CHOOSER_ACTION_OPEN = gtk.FileChooserAction.OPEN66 FILE_CHOOSER_ACTION_SAVE = gtk.FileChooserAction.SAVE67 68 SELECTION_MULTIPLE = gtk.SelectionMode.MULTIPLE69 70 SHADOW_IN = gtk.ShadowType.IN71 SHADOW_NONE = gtk.ShadowType.NONE72 73 POLICY_AUTOMATIC = gtk.PolicyType.AUTOMATIC74 POLICY_NEVER = gtk.PolicyType.NEVER75 POLICY_ALWAYS = gtk.PolicyType.ALWAYS62 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 76 76 77 77 WEIGHT_NORMAL = pango.Weight.NORMAL … … 81 81 WINDOW_STATE_WITHDRAWN = gdk.WindowState.WITHDRAWN 82 82 83 SORT_ASCENDING = gtk.SortType.ASCENDING84 SORT_DESCENDING = gtk.SortType.DESCENDING83 SORT_ASCENDING = Gtk.SortType.ASCENDING 84 SORT_DESCENDING = Gtk.SortType.DESCENDING 85 85 86 86 EVENT_BUTTON_PRESS = gdk.EventType.BUTTON_PRESS 87 87 88 TREE_VIEW_COLUMN_FIXED = gtk.TreeViewColumnSizing.FIXED89 90 FILL = gtk.AttachOptions.FILL91 EXPAND = gtk.AttachOptions.EXPAND92 93 UPDATE_IF_VALID = gtk.SpinButtonUpdatePolicy.IF_VALID94 95 SELECTION_MULTIPLE = gtk.SelectionMode.MULTIPLE88 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 96 96 97 97 pixbuf_new_from_file = gdkPixbuf.Pixbuf.new_from_file … … 139 139 #------------------------------------------------------------------------------ 140 140 141 class IntegerEntry( gtk.Entry):141 class IntegerEntry(Gtk.Entry): 142 142 """An entry that allows only either an empty value, or an integer.""" 143 143 def __init__(self, defaultValue = None): 144 144 """Construct the entry.""" 145 gtk.Entry.__init__(self)145 Gtk.Entry.__init__(self) 146 146 147 147 self.set_alignment(1.0) … … 191 191 #------------------------------------------------------------------------------ 192 192 193 class TimeEntry( gtk.Entry):193 class TimeEntry(Gtk.Entry): 194 194 """Widget to display and edit a time value in HH:MM format.""" 195 195 def __init__(self): … … 296 296 pass 297 297 else: 298 gtk.gdk.display_get_default().beep()298 Gtk.gdk.display_get_default().beep() 299 299 self.stop_emission(signal) 300 300 301 301 #------------------------------------------------------------------------------ 302 302 303 class CredentialsDialog( gtk.Dialog):303 class CredentialsDialog(Gtk.Dialog): 304 304 """A dialog window to ask for a user name and a password.""" 305 305 def __init__(self, gui, userName, password, … … 320 320 contentArea = self.get_content_area() 321 321 322 contentAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,322 contentAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 323 323 xscale = 0.0, yscale = 0.0) 324 324 contentAlignment.set_padding(padding_top = 4, padding_bottom = 16, … … 327 327 contentArea.pack_start(contentAlignment, False, False, 0) 328 328 329 contentVBox = gtk.VBox()329 contentVBox = Gtk.VBox() 330 330 contentAlignment.add(contentVBox) 331 331 332 332 if infoText is not None: 333 label = gtk.Label(infoText)333 label = Gtk.Label(infoText) 334 334 label.set_alignment(0.0, 0.0) 335 335 336 336 contentVBox.pack_start(label, False, False, 0) 337 337 338 tableAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,338 tableAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 339 339 xscale = 0.0, yscale = 0.0) 340 340 tableAlignment.set_padding(padding_top = 24, padding_bottom = 0, 341 341 padding_left = 0, padding_right = 0) 342 342 343 table = gtk.Table(3, 2)343 table = Gtk.Table(3, 2) 344 344 table.set_row_spacings(4) 345 345 table.set_col_spacings(16) … … 349 349 contentVBox.pack_start(tableAlignment, True, True, 0) 350 350 351 label = gtk.Label(userNameLabel)351 label = Gtk.Label(userNameLabel) 352 352 label.set_use_underline(True) 353 353 label.set_alignment(0.0, 0.5) 354 354 table.attach(label, 0, 1, 0, 1) 355 355 356 self._userName = gtk.Entry()356 self._userName = Gtk.Entry() 357 357 self._userName.set_width_chars(16) 358 358 # FIXME: enabled the OK button only when there is something in thr … … 365 365 label.set_mnemonic_widget(self._userName) 366 366 367 label = gtk.Label(passwordLabel)367 label = Gtk.Label(passwordLabel) 368 368 label.set_use_underline(True) 369 369 label.set_alignment(0.0, 0.5) 370 370 table.attach(label, 0, 1, 1, 2) 371 371 372 self._password = gtk.Entry()372 self._password = Gtk.Entry() 373 373 self._password.set_visibility(False) 374 374 #self._password.connect("changed", … … 380 380 381 381 if rememberPassword is not None: 382 self._rememberButton = gtk.CheckButton(rememberLabel)382 self._rememberButton = Gtk.CheckButton(rememberLabel) 383 383 self._rememberButton.set_use_underline(True) 384 384 self._rememberButton.set_tooltip_text(rememberTooltip) … … 522 522 523 523 Return a boolean indicating the answer.""" 524 dialog = gtk.MessageDialog(parent = parent,524 dialog = Gtk.MessageDialog(parent = parent, 525 525 type = MESSAGETYPE_QUESTION, 526 526 message_format = question) … … 540 540 title = WINDOW_TITLE_BASE): 541 541 """Display an error dialog box with the given message.""" 542 dialog = gtk.MessageDialog(parent = parent,542 dialog = Gtk.MessageDialog(parent = parent, 543 543 type = MESSAGETYPE_ERROR, 544 544 message_format = message) … … 562 562 563 563 def createFlightTypeComboBox(): 564 flightTypeModel = gtk.ListStore(str, int)564 flightTypeModel = Gtk.ListStore(str, int) 565 565 for type in _const.flightTypes: 566 566 name = "flighttype_" + _const.flightType2string(type) 567 567 flightTypeModel.append([xstr(name), type]) 568 568 569 flightType = gtk.ComboBox(model = flightTypeModel)570 renderer = gtk.CellRendererText()569 flightType = Gtk.ComboBox(model = flightTypeModel) 570 renderer = Gtk.CellRendererText() 571 571 flightType.pack_start(renderer, True) 572 572 flightType.add_attribute(renderer, "text", 0) -
src/mlx/gui/delaycodes.py
r995 r996 11 11 #------------------------------------------------------------------------------ 12 12 13 class Viewport( gtk.Viewport):13 class Viewport(Gtk.Viewport): 14 14 """Viewport implementation that alleviates the problem with improper 15 15 resizing by the VBox.""" 16 16 def __init__(self): 17 17 """Construct the viewport.""" 18 gtk.Viewport.__init__(self)18 Gtk.Viewport.__init__(self) 19 19 self._recursive = False 20 20 self._vboxHeight = None … … 34 34 allocation.height = self._vboxHeight - allocation.y 35 35 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 38 class DelayCodeTableBase(Gtk.VBox, Gtk.Scrollable): 39 39 """PyGObject-specific base class for the delay code table.""" 40 40 __gproperties__ = { 41 "vscroll-policy" : ( gtk.ScrollablePolicy,41 "vscroll-policy" : ( Gtk.ScrollablePolicy, 42 42 "vscroll-policy", 43 43 "The vertical scrolling policy", 44 gtk.ScrollablePolicy.MINIMUM,44 Gtk.ScrollablePolicy.MINIMUM, 45 45 GObject.PARAM_READWRITE ), 46 "vadjustment" : ( gtk.Adjustment,46 "vadjustment" : ( Gtk.Adjustment, 47 47 "vadjustment", 48 48 "The vertical adjustment", 49 49 GObject.PARAM_READWRITE ), 50 "hscroll-policy" : ( gtk.ScrollablePolicy,50 "hscroll-policy" : ( Gtk.ScrollablePolicy, 51 51 "hscroll-policy", 52 52 "The horizontal scrolling policy", 53 gtk.ScrollablePolicy.MINIMUM,53 Gtk.ScrollablePolicy.MINIMUM, 54 54 GObject.PARAM_READWRITE ), 55 "hadjustment" : ( gtk.Adjustment,55 "hadjustment" : ( Gtk.Adjustment, 56 56 "hadjustment", 57 57 "The horizontal adjustment", … … 74 74 do_size_allocate() function of VBox().""" 75 75 self._viewport.setVBOXHeight(allocation.height) 76 gtk.VBox.do_size_allocate(self, allocation)76 Gtk.VBox.do_size_allocate(self, allocation) 77 77 self.allocate_column_sizes(allocation) 78 78 … … 109 109 """Set the style of the event box from the treeview.""" 110 110 111 class Alignment( gtk.Alignment):111 class Alignment(Gtk.Alignment): 112 112 """An alignment that remembers the width it was given.""" 113 113 def __init__(self, xalign = 0.0, yalign=0.0, … … 121 121 """Called with the new size allocation.""" 122 122 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 125 class TreeView(Gtk.TreeView): 126 126 def do_size_allocate(self, allocation): 127 127 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 132 class CheckButton(Gtk.CheckButton): 133 133 """A check button that contains a reference to a row in the delay code 134 134 data table.""" … … 184 184 self._delayCodeData = None 185 185 186 self._treeView = TreeView( gtk.ListStore(str, str))186 self._treeView = TreeView(Gtk.ListStore(str, str)) 187 187 self._treeView.set_rules_hint(True) 188 188 … … 192 192 self._checkButtons = [] 193 193 194 self._eventBox = gtk.EventBox()194 self._eventBox = Gtk.EventBox() 195 195 196 196 self._table = None … … 254 254 numRows = len(rows) 255 255 256 column = gtk.TreeViewColumn("", gtk.CellRendererText())256 column = Gtk.TreeViewColumn("", Gtk.CellRendererText()) 257 257 column.set_sizing(TREE_VIEW_COLUMN_FIXED) 258 258 self._treeView.append_column(column) 259 259 260 260 for header in headers: 261 column = gtk.TreeViewColumn(header, gtk.CellRendererText())261 column = Gtk.TreeViewColumn(header, Gtk.CellRendererText()) 262 262 column.set_sizing(TREE_VIEW_COLUMN_FIXED) 263 263 self._treeView.append_column(column) 264 264 265 self._table = gtk.Table(numRows, numColumns)265 self._table = Gtk.Table(numRows, numColumns) 266 266 self._table.set_homogeneous(False) 267 267 self._table.set_col_spacings(16) … … 276 276 (type, elements) = rows[i] 277 277 if type==CAPTION: 278 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,278 alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5, 279 279 xscale = 1.0) 280 label = gtk.Label("<b>" + elements + "</b>")280 label = Gtk.Label("<b>" + elements + "</b>") 281 281 label.set_use_markup(True) 282 282 label.set_alignment(0.0, 0.5) … … 297 297 298 298 for j in range(0, numColumns-1): 299 label = gtk.Label(elements[j])299 label = Gtk.Label(elements[j]) 300 300 label.set_alignment(0.0, 0.5) 301 301 alignment = Alignment(xalign = 0.5, yalign = 0.5, -
src/mlx/gui/faultexplain.py
r995 r996 19 19 #------------------------------------------------------------------------------- 20 20 21 class FaultFrame( gtk.Frame):21 class FaultFrame(Gtk.Frame): 22 22 """A frame containing the information about a single fault. 23 23 … … 26 26 def __init__(self, faultText): 27 27 """Construct the frame.""" 28 gtk.Frame.__init__(self)28 Gtk.Frame.__init__(self) 29 29 30 30 self._faultText = faultText 31 31 32 vbox = gtk.VBox()33 34 self._fault = fault = gtk.Label()32 vbox = Gtk.VBox() 33 34 self._fault = fault = Gtk.Label() 35 35 fault.set_xalign(0.0) 36 36 fault.set_justify(JUSTIFY_LEFT) … … 39 39 self.faultText = faultText 40 40 41 faultAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,41 faultAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 42 42 xscale = 1.0, yscale = 0.0) 43 43 faultAlignment.set_padding(padding_top = 0, padding_bottom = 0, … … 46 46 vbox.pack_start(faultAlignment, True, True, 4) 47 47 48 self._explanation = explanation = gtk.TextView()48 self._explanation = explanation = Gtk.TextView() 49 49 explanation.set_wrap_mode(WRAP_WORD) 50 50 explanation.set_accepts_tab(False) … … 60 60 61 61 styleContext = self.get_style_context() 62 color = styleContext.get_background_color( gtk.StateFlags.NORMAL)62 color = styleContext.get_background_color(Gtk.StateFlags.NORMAL) 63 63 fault.override_background_color(0, color) 64 64 … … 119 119 #------------------------------------------------------------------------------- 120 120 121 class FaultExplainWidget( gtk.Frame):121 class FaultExplainWidget(Gtk.Frame): 122 122 """The widget for the faults and their explanations.""" 123 123 @staticmethod … … 127 127 128 128 def __init__(self, gui): 129 gtk.Frame.__init__(self)129 Gtk.Frame.__init__(self) 130 130 131 131 self._gui = gui … … 134 134 label.set_use_underline(True) 135 135 136 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,136 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 137 137 xscale = 1.0, yscale = 1.0) 138 138 alignment.set_padding(padding_top = 4, padding_bottom = 4, 139 139 padding_left = 4, padding_right = 4) 140 140 141 self._outerBox = outerBox = gtk.EventBox()141 self._outerBox = outerBox = Gtk.EventBox() 142 142 outerBox.add(alignment) 143 143 144 self._innerBox = innerBox = gtk.EventBox()144 self._innerBox = innerBox = Gtk.EventBox() 145 145 alignment.add(self._innerBox) 146 146 147 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,147 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 148 148 xscale = 1.0, yscale = 1.0) 149 149 alignment.set_padding(padding_top = 0, padding_bottom = 0, … … 152 152 innerBox.add(alignment) 153 153 154 scroller = gtk.ScrolledWindow()154 scroller = Gtk.ScrolledWindow() 155 155 scroller.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC) 156 156 scroller.set_shadow_type(SHADOW_NONE) 157 157 158 self._faults = gtk.VBox()158 self._faults = Gtk.VBox() 159 159 self._faults.set_homogeneous(False) 160 160 scroller.add(self._faults) … … 189 189 """Add a fault with the given ID and text.""" 190 190 191 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,191 alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 192 192 xscale = 1.0, yscale = 0.0) 193 193 alignment.set_padding(padding_top = 2, padding_bottom = 2, … … 287 287 else: 288 288 outerColour = \ 289 styleContext.get_border_color( gtk.StateFlags.DROP_ACTIVE)289 styleContext.get_border_color(Gtk.StateFlags.DROP_ACTIVE) 290 290 innerColour = self._gui.backgroundColour 291 291 292 self._outerBox.override_background_color( gtk.StateFlags.NORMAL,292 self._outerBox.override_background_color(Gtk.StateFlags.NORMAL, 293 293 outerColour) 294 self._innerBox.override_background_color( gtk.StateFlags.NORMAL,294 self._innerBox.override_background_color(Gtk.StateFlags.NORMAL, 295 295 innerColour) 296 296 -
src/mlx/gui/flight.py
r995 r996 57 57 #----------------------------------------------------------------------------- 58 58 59 comboModel = gtk.ListStore(GObject.TYPE_STRING)59 comboModel = Gtk.ListStore(GObject.TYPE_STRING) 60 60 comboModel.append(("N/A",)) 61 61 comboModel.append(("VECTORS",)) … … 63 63 #----------------------------------------------------------------------------- 64 64 65 class Page( gtk.Alignment):65 class Page(Gtk.Alignment): 66 66 """A page in the flight wizard.""" 67 67 def __init__(self, wizard, id, title, help, completedHelp = None): … … 72 72 padding_left = 12, padding_right = 12) 73 73 74 frame = gtk.Frame()74 frame = Gtk.Frame() 75 75 self.add(frame) 76 76 77 self._vbox = gtk.VBox()77 self._vbox = Gtk.VBox() 78 78 self._vbox.set_homogeneous(False) 79 79 frame.add(self._vbox) 80 80 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) 86 86 titleLabel.modify_font(pango.FontDescription("bold 24")) 87 87 alignment.set_padding(padding_top = 4, padding_bottom = 4, … … 96 96 self._titleLabel = titleLabel 97 97 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, 101 101 xscale = 1.0, yscale = 1.0) 102 102 alignment.set_padding(padding_top = 16, padding_bottom = 16, … … 105 105 self._vbox.pack_start(alignment, True, True, 0) 106 106 107 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.0,107 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.0, 108 108 xscale = 0.0, yscale = 0.0) 109 109 alignment.set_padding(padding_top = 0, padding_bottom = 16, … … 119 119 longerHelp = completedHelp 120 120 121 self._helpLabel = gtk.Label(longerHelp)121 self._helpLabel = Gtk.Label(longerHelp) 122 122 # FIXME: should be a constant in common 123 self._helpLabel.set_justify( gtk.Justification.CENTER)123 self._helpLabel.set_justify(Gtk.Justification.CENTER) 124 124 self._helpLabel.set_use_markup(True) 125 125 alignment.add(self._helpLabel) 126 126 mainBox.pack_start(alignment, False, False, 0) 127 127 128 self._mainAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,128 self._mainAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 129 129 xscale = 1.0, yscale = 1.0) 130 130 mainBox.pack_start(self._mainAlignment, True, True, 0) 131 131 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) 133 133 buttonAlignment.set_padding(padding_top = 4, padding_bottom = 10, 134 134 padding_left = 16, padding_right = 16) 135 135 136 self._buttonBox = gtk.HBox()136 self._buttonBox = Gtk.HBox() 137 137 self._buttonBox.set_homogeneous(False) 138 138 self._defaultButton = None … … 175 175 176 176 Return the button object created.""" 177 button = gtk.Button(label)177 button = Gtk.Button(label) 178 178 self._buttonBox.pack_start(button, False, False, padding) 179 179 button.set_use_underline(True) … … 220 220 """Set the styles of some of the items on the page.""" 221 221 context = self.get_style_context() 222 color = context.get_background_color( gtk.StateFlags.SELECTED)222 color = context.get_background_color(Gtk.StateFlags.SELECTED) 223 223 self._titleEventBox.modify_bg(0, color.to_color()) 224 color = context.get_color( gtk.StateFlags.SELECTED)224 color = context.get_color(Gtk.StateFlags.SELECTED) 225 225 self._titleLabel.modify_fg(0, color.to_color()) 226 226 … … 299 299 xstr("login"), xstr("loginHelp")) 300 300 301 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,301 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 302 302 xscale = 0.0, yscale = 0.0) 303 303 304 table = gtk.Table(3, 2)304 table = Gtk.Table(3, 2) 305 305 table.set_row_spacings(4) 306 306 table.set_col_spacings(32) … … 308 308 self.setMainWidget(alignment) 309 309 310 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,310 labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5, 311 311 xscale = 0.0, yscale = 0.0) 312 label = gtk.Label(xstr("label_pilotID"))312 label = Gtk.Label(xstr("label_pilotID")) 313 313 label.set_use_underline(True) 314 314 labelAlignment.add(label) 315 315 table.attach(labelAlignment, 0, 1, 0, 1) 316 316 317 self._pilotID = gtk.Entry()317 self._pilotID = Gtk.Entry() 318 318 self._pilotID.connect("changed", self._pilotIDChanged) 319 319 self._pilotID.set_tooltip_text(xstr("login_pilotID_tooltip")) … … 321 321 label.set_mnemonic_widget(self._pilotID) 322 322 323 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,323 labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5, 324 324 xscale = 0.0, yscale = 0.0) 325 label = gtk.Label(xstr("label_password"))325 label = Gtk.Label(xstr("label_password")) 326 326 label.set_use_underline(True) 327 327 labelAlignment.add(label) 328 328 table.attach(labelAlignment, 0, 1, 1, 2) 329 329 330 self._password = gtk.Entry()330 self._password = Gtk.Entry() 331 331 self._password.set_visibility(False) 332 332 self._password.connect("changed", self._setControls) … … 335 335 label.set_mnemonic_widget(self._password) 336 336 337 self._rememberButton = gtk.CheckButton(xstr("remember_password"))337 self._rememberButton = Gtk.CheckButton(xstr("remember_password")) 338 338 self._rememberButton.set_use_underline(True) 339 339 self._rememberButton.set_tooltip_text(xstr("login_remember_tooltip")) … … 440 440 help, completedHelp = completedHelp) 441 441 442 mainBox = gtk.HBox()442 mainBox = Gtk.HBox() 443 443 mainBox.set_homogeneous(False) 444 444 445 leftVBox = gtk.VBox()446 447 alignment = gtk.Alignment(xscale = 1.0)445 leftVBox = Gtk.VBox() 446 447 alignment = Gtk.Alignment(xscale = 1.0) 448 448 alignment.set_size_request(100, 0) 449 449 … … 460 460 mainBox.pack_start(self._flightList, False, False, 8) 461 461 462 flightButtonBox = gtk.VBox()463 464 alignment = gtk.Alignment(xscale = 1.0)462 flightButtonBox = Gtk.VBox() 463 464 alignment = Gtk.Alignment(xscale = 1.0) 465 465 alignment.set_size_request(100, 0) 466 466 flightButtonBox.pack_start(alignment, False, False, 0) 467 467 468 flightButtonWidthAlignment = gtk.Alignment(xscale=1.0, yscale=0.0,468 flightButtonWidthAlignment = Gtk.Alignment(xscale=1.0, yscale=0.0, 469 469 xalign=0.0, yalign=0.0) 470 470 flightButtonWidthAlignment.set_padding(padding_top = 0, … … 472 472 padding_left = 8, 473 473 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")) 477 477 self._saveButton.set_use_underline(True) 478 478 self._saveButton.set_sensitive(False) … … 482 482 flightButtonWidthBox.pack_start(self._saveButton, True, True, 4) 483 483 484 self._printButton = gtk.Button(xstr("flightsel_print"))484 self._printButton = Gtk.Button(xstr("flightsel_print")) 485 485 self._printButton.set_use_underline(True) 486 486 self._printButton.set_sensitive(False) … … 490 490 flightButtonWidthBox.pack_start(self._printButton, True, True, 4) 491 491 492 self._deleteButton = gtk.Button(xstr("flightsel_delete"))492 self._deleteButton = Gtk.Button(xstr("flightsel_delete")) 493 493 self._deleteButton.set_use_underline(True) 494 494 self._deleteButton.set_sensitive(False) … … 649 649 except Exception as e: 650 650 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, 652 652 type = MESSAGETYPE_ERROR, 653 653 message_format = … … 669 669 flight = self._getSelectedFlight() 670 670 671 printOperation = gtk.PrintOperation()671 printOperation = Gtk.PrintOperation() 672 672 if self._printSettings is not None: 673 673 printOperation.set_print_settings(self._printSettings) … … 684 684 printOperation.set_use_full_page(False) 685 685 686 result = printOperation.run( gtk.PRINT_OPERATION_ACTION_PRINT_DIALOG,686 result = printOperation.run(Gtk.PRINT_OPERATION_ACTION_PRINT_DIALOG, 687 687 wizard.gui.mainWindow) 688 688 689 if result == gtk.PRINT_OPERATION_RESULT_APPLY:689 if result == Gtk.PRINT_OPERATION_RESULT_APPLY: 690 690 self._printSettings = printOperation.get_print_settings() 691 elif result == gtk.PRINT_OPERATION_RESULT_ERROR:691 elif result == Gtk.PRINT_OPERATION_RESULT_ERROR: 692 692 errorDialog(xstr("flightsel_print_failed", 693 693 wizard.gui.mainWindow, … … 942 942 except Exception as e: 943 943 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, 945 945 type = MESSAGETYPE_ERROR, 946 946 message_format = … … 1024 1024 1025 1025 gui = self._wizard.gui 1026 dialog = gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +1026 dialog = Gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " + 1027 1027 xstr("flightsel_save_title"), 1028 1028 action = FILE_CHOOSER_ACTION_SAVE, 1029 buttons = ( gtk.STOCK_CANCEL,1029 buttons = (Gtk.STOCK_CANCEL, 1030 1030 RESPONSETYPE_CANCEL, 1031 gtk.STOCK_OK, RESPONSETYPE_OK),1031 Gtk.STOCK_OK, RESPONSETYPE_OK), 1032 1032 parent = gui.mainWindow) 1033 1033 dialog.set_modal(True) 1034 1034 dialog.set_do_overwrite_confirmation(True) 1035 1035 1036 filter = gtk.FileFilter()1036 filter = Gtk.FileFilter() 1037 1037 filter.set_name(xstr("flightsel_filter_flights")) 1038 1038 filter.add_pattern("*.vaflight") 1039 1039 dialog.add_filter(filter) 1040 1040 1041 filter = gtk.FileFilter()1041 filter = Gtk.FileFilter() 1042 1042 filter.set_name(xstr("file_filter_all")) 1043 1043 filter.add_pattern("*.*") … … 1054 1054 1055 1055 gui = self._wizard.gui 1056 dialog = gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +1056 dialog = Gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " + 1057 1057 xstr("flightsel_load_title"), 1058 1058 action = FILE_CHOOSER_ACTION_OPEN, 1059 buttons = ( gtk.STOCK_CANCEL,1059 buttons = (Gtk.STOCK_CANCEL, 1060 1060 RESPONSETYPE_CANCEL, 1061 gtk.STOCK_OK, RESPONSETYPE_OK),1061 Gtk.STOCK_OK, RESPONSETYPE_OK), 1062 1062 parent = gui.mainWindow) 1063 1063 dialog.set_modal(True) 1064 1064 1065 filter = gtk.FileFilter()1065 filter = Gtk.FileFilter() 1066 1066 filter.set_name(xstr("flightsel_filter_flights")) 1067 1067 filter.add_pattern("*.vaflight") 1068 1068 dialog.add_filter(filter) 1069 1069 1070 filter = gtk.FileFilter()1070 filter = Gtk.FileFilter() 1071 1071 filter.set_name(xstr("file_filter_all")) 1072 1072 filter.add_pattern("*.*") … … 1079 1079 def _createListPopupMenu(self): 1080 1080 """Get the flight list popup menu.""" 1081 menu = gtk.Menu()1082 1083 menuItem = gtk.MenuItem()1081 menu = Gtk.Menu() 1082 1083 menuItem = Gtk.MenuItem() 1084 1084 menuItem.set_label(xstr("flightsel_popup_select")) 1085 1085 menuItem.set_use_underline(True) … … 1089 1089 menu.append(menuItem) 1090 1090 1091 menuItem = gtk.MenuItem()1091 menuItem = Gtk.MenuItem() 1092 1092 menuItem.set_label(xstr("flightsel_popup_save")) 1093 1093 menuItem.set_use_underline(True) … … 1097 1097 menu.append(menuItem) 1098 1098 1099 menuItem = gtk.MenuItem()1099 menuItem = Gtk.MenuItem() 1100 1100 menuItem.set_label(xstr("flightsel_popup_print")) 1101 1101 menuItem.set_use_underline(True) … … 1105 1105 menu.append(menuItem) 1106 1106 1107 menuItem = gtk.MenuItem()1107 menuItem = Gtk.MenuItem() 1108 1108 menuItem.set_label(xstr("flightsel_popup_delete")) 1109 1109 menuItem.set_use_underline(True) … … 1146 1146 xstr("gatesel_help")) 1147 1147 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(), 1151 1151 text = 0) 1152 1152 column.set_expand(True) … … 1158 1158 gateSelection.connect("changed", self._selectionChanged) 1159 1159 1160 scrolledWindow = gtk.ScrolledWindow()1160 scrolledWindow = Gtk.ScrolledWindow() 1161 1161 scrolledWindow.add(self._gateList) 1162 1162 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) 1168 1168 alignment.add(scrolledWindow) 1169 1169 … … 1227 1227 self._wizard.jumpPage("connect") 1228 1228 else: 1229 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,1229 dialog = Gtk.MessageDialog(parent = self._wizard.gui.mainWindow, 1230 1230 type = MESSAGETYPE_ERROR, 1231 1231 message_format = xstr("gatesel_conflict")) … … 1265 1265 xstr("register_help")) 1266 1266 1267 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,1267 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 1268 1268 xscale = 0.0, yscale = 0.0) 1269 1269 1270 table = gtk.Table(12, 4)1270 table = Gtk.Table(12, 4) 1271 1271 table.set_row_spacings(4) 1272 1272 table.set_col_spacings(24) … … 1276 1276 row = 0 1277 1277 1278 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,1278 labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5, 1279 1279 xscale = 0.0, yscale = 0.0) 1280 label = gtk.Label(xstr("register_name1"))1280 label = Gtk.Label(xstr("register_name1")) 1281 1281 label.set_use_underline(True) 1282 1282 labelAlignment.add(label) 1283 1283 table.attach(labelAlignment, 0, 1, row, row+1) 1284 1284 1285 self._name1 = gtk.Entry()1285 self._name1 = Gtk.Entry() 1286 1286 self._name1.connect("changed", self._updateButtons) 1287 1287 self._name1.set_tooltip_text(xstr("register_name1_tooltip")) … … 1290 1290 label.set_mnemonic_widget(self._name1) 1291 1291 1292 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,1292 labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5, 1293 1293 xscale = 0.0, yscale = 0.0) 1294 label = gtk.Label(xstr("register_name2"))1294 label = Gtk.Label(xstr("register_name2")) 1295 1295 label.set_use_underline(True) 1296 1296 labelAlignment.add(label) 1297 1297 table.attach(labelAlignment, 2, 3, row, row+1) 1298 1298 1299 self._name2 = gtk.Entry()1299 self._name2 = Gtk.Entry() 1300 1300 self._name2.connect("changed", self._updateButtons) 1301 1301 self._name2.set_tooltip_text(xstr("register_name2_tooltip")) … … 1306 1306 row += 1 1307 1307 1308 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,1308 labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5, 1309 1309 xscale = 0.0, yscale = 0.0) 1310 label = gtk.Label(xstr("register_year_of_birth"))1310 label = Gtk.Label(xstr("register_year_of_birth")) 1311 1311 label.set_use_underline(True) 1312 1312 labelAlignment.add(label) 1313 1313 table.attach(labelAlignment, 0, 1, row, row+1) 1314 1314 1315 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,1315 alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 1316 1316 xscale = 0.0, yscale = 0.0) 1317 1317 1318 self._yearOfBirth = gtk.SpinButton()1318 self._yearOfBirth = Gtk.SpinButton() 1319 1319 self._yearOfBirth.set_increments(step = 1, page = 10) 1320 1320 self._yearOfBirth.set_range(min = RegisterPage._minYearOfBirth, … … 1331 1331 row += 1 1332 1332 1333 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,1333 labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5, 1334 1334 xscale = 0.0, yscale = 0.0) 1335 label = gtk.Label(xstr("register_email"))1335 label = Gtk.Label(xstr("register_email")) 1336 1336 label.set_use_underline(True) 1337 1337 labelAlignment.add(label) 1338 1338 table.attach(labelAlignment, 0, 1, row, row+1) 1339 1339 1340 self._emailAddress = gtk.Entry()1340 self._emailAddress = Gtk.Entry() 1341 1341 self._emailAddress.connect("changed", self._updateButtons) 1342 1342 self._emailAddress.set_tooltip_text(xstr("register_email_tooltip")) … … 1344 1344 label.set_mnemonic_widget(self._emailAddress) 1345 1345 1346 self._emailAddressPublic = gtk.CheckButton(xstr("register_email_public"))1346 self._emailAddressPublic = Gtk.CheckButton(xstr("register_email_public")) 1347 1347 self._emailAddressPublic.set_use_underline(True) 1348 1348 self._emailAddressPublic.set_tooltip_text(xstr("register_email_public_tooltip")) … … 1351 1351 row += 1 1352 1352 1353 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,1353 labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5, 1354 1354 xscale = 0.0, yscale = 0.0) 1355 label = gtk.Label(xstr("register_vatsim_id"))1355 label = Gtk.Label(xstr("register_vatsim_id")) 1356 1356 label.set_use_underline(True) 1357 1357 labelAlignment.add(label) 1358 1358 table.attach(labelAlignment, 0, 1, row, row+1) 1359 1359 1360 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,1360 alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 1361 1361 xscale = 0.0, yscale = 0.0) 1362 1362 self._vatsimID = IntegerEntry() … … 1368 1368 label.set_mnemonic_widget(self._vatsimID) 1369 1369 1370 labelAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,1370 labelAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5, 1371 1371 xscale = 0.0, yscale = 0.0) 1372 label = gtk.Label(xstr("register_ivao_id"))1372 label = Gtk.Label(xstr("register_ivao_id")) 1373 1373 label.set_use_underline(True) 1374 1374 labelAlignment.add(label) 1375 1375 table.attach(labelAlignment, 2, 3, row, row+1) 1376 1376 1377 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,1377 alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 1378 1378 xscale = 0.0, yscale = 0.0) 1379 1379 self._ivaoID = IntegerEntry() … … 1387 1387 row += 1 1388 1388 1389 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,1389 labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5, 1390 1390 xscale = 0.0, yscale = 0.0) 1391 label = gtk.Label(xstr("register_phone_num"))1391 label = Gtk.Label(xstr("register_phone_num")) 1392 1392 label.set_use_underline(True) 1393 1393 label.set_use_markup(True) … … 1395 1395 table.attach(labelAlignment, 0, 1, row, row+1) 1396 1396 1397 self._phoneNumber = gtk.Entry()1397 self._phoneNumber = Gtk.Entry() 1398 1398 self._phoneNumber.set_tooltip_text(xstr("register_phone_num_tooltip")) 1399 1399 table.attach(self._phoneNumber, 1, 2, row, row+1) … … 1402 1402 row += 1 1403 1403 1404 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,1404 labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5, 1405 1405 xscale = 0.0, yscale = 0.0) 1406 label = gtk.Label(xstr("register_nationality"))1406 label = Gtk.Label(xstr("register_nationality")) 1407 1407 label.set_use_underline(True) 1408 1408 label.set_use_markup(True) … … 1411 1411 1412 1412 1413 self._nationality = gtk.Entry()1413 self._nationality = Gtk.Entry() 1414 1414 self._nationality.set_tooltip_text(xstr("register_nationality_tooltip")) 1415 1415 table.attach(self._nationality, 1, 2, row, row+1) 1416 1416 label.set_mnemonic_widget(self._nationality) 1417 1417 1418 placeholder = gtk.Label()1418 placeholder = Gtk.Label() 1419 1419 placeholder.set_text(xstr("register_password_mismatch")) 1420 1420 placeholder.set_use_markup(True) … … 1425 1425 row += 1 1426 1426 1427 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,1427 labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5, 1428 1428 xscale = 0.0, yscale = 0.0) 1429 label = gtk.Label(xstr("register_password"))1429 label = Gtk.Label(xstr("register_password")) 1430 1430 label.set_use_underline(True) 1431 1431 labelAlignment.add(label) 1432 1432 table.attach(labelAlignment, 0, 1, row, row+1) 1433 1433 1434 self._password = gtk.Entry()1434 self._password = Gtk.Entry() 1435 1435 self._password.set_visibility(False) 1436 1436 self._password.connect("changed", self._updateButtons) … … 1439 1439 label.set_mnemonic_widget(self._password) 1440 1440 1441 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,1441 alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5, 1442 1442 xscale = 0.0, yscale = 0.0) 1443 self._passwordStatus = gtk.Label()1443 self._passwordStatus = Gtk.Label() 1444 1444 alignment.add(self._passwordStatus) 1445 1445 table.attach(alignment, 2, 4, row, row+1) … … 1447 1447 row += 1 1448 1448 1449 labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,1449 labelAlignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5, 1450 1450 xscale = 0.0, yscale = 0.0) 1451 label = gtk.Label(xstr("register_password2"))1451 label = Gtk.Label(xstr("register_password2")) 1452 1452 label.set_use_underline(True) 1453 1453 labelAlignment.add(label) 1454 1454 table.attach(labelAlignment, 0, 1, row, row+1) 1455 1455 1456 self._password2 = gtk.Entry()1456 self._password2 = Gtk.Entry() 1457 1457 self._password2.set_visibility(False) 1458 1458 self._password2.connect("changed", self._updateButtons) … … 1461 1461 label.set_mnemonic_widget(self._password2) 1462 1462 1463 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,1463 alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5, 1464 1464 xscale = 0.0, yscale = 0.0) 1465 self._password2Status = gtk.Label()1465 self._password2Status = Gtk.Label() 1466 1466 alignment.add(self._password2Status) 1467 1467 table.attach(alignment, 2, 4, row, row+1) … … 1469 1469 row += 1 1470 1470 1471 self._rememberButton = gtk.CheckButton(xstr("remember_password"))1471 self._rememberButton = Gtk.CheckButton(xstr("remember_password")) 1472 1472 self._rememberButton.set_use_underline(True) 1473 1473 self._rememberButton.set_tooltip_text(xstr("login_remember_tooltip")) … … 1681 1681 messageType = MESSAGETYPE_ERROR 1682 1682 1683 dialog = gtk.MessageDialog(parent = gui.mainWindow,1683 dialog = Gtk.MessageDialog(parent = gui.mainWindow, 1684 1684 type = messageType, 1685 1685 message_format = message) … … 1715 1715 self._getEntryExamStatusCancelled = False 1716 1716 1717 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,1717 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 1718 1718 xscale = 0.5, yscale = 0.0) 1719 1719 1720 table = gtk.Table(6, 4)1720 table = Gtk.Table(6, 4) 1721 1721 table.set_row_spacings(4) 1722 1722 table.set_col_spacings(0) … … 1727 1727 row = 0 1728 1728 1729 labelAlignment = gtk.Alignment(xalign=0.0, yalign = 0.5,1729 labelAlignment = Gtk.Alignment(xalign=0.0, yalign = 0.5, 1730 1730 xscale=0.0, yscale = 0.0) 1731 label = gtk.Label(xstr("student_entry_exam_status"))1731 label = Gtk.Label(xstr("student_entry_exam_status")) 1732 1732 label.set_alignment(0.0, 0.5) 1733 1733 labelAlignment.add(label) … … 1735 1735 table.attach(labelAlignment, 0, 1, row, row + 1, xoptions = FILL) 1736 1736 1737 alignment = gtk.Alignment(xalign=0.0, yalign = 0.5,1737 alignment = Gtk.Alignment(xalign=0.0, yalign = 0.5, 1738 1738 xscale=1.0, yscale = 0.0) 1739 self._entryExamStatus = gtk.Label()1739 self._entryExamStatus = Gtk.Label() 1740 1740 self._entryExamStatus.set_use_markup(True) 1741 1741 self._entryExamStatus.set_alignment(0.0, 0.5) … … 1746 1746 row += 1 1747 1747 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")) 1750 1750 button.set_use_underline(True) 1751 1751 button.connect("clicked", self._entryExamClicked) … … 1758 1758 row += 3 1759 1759 1760 labelAlignment = gtk.Alignment(xalign=0.0, yalign = 0.5,1760 labelAlignment = Gtk.Alignment(xalign=0.0, yalign = 0.5, 1761 1761 xscale=0.0, yscale = 0.0) 1762 label = gtk.Label(xstr("student_check_flight_status"))1762 label = Gtk.Label(xstr("student_check_flight_status")) 1763 1763 labelAlignment.add(label) 1764 1764 table.attach(labelAlignment, 0, 1, row, row + 1, xoptions = FILL) 1765 1765 1766 alignment = gtk.Alignment(xalign=0.0, yalign = 0.5,1766 alignment = Gtk.Alignment(xalign=0.0, yalign = 0.5, 1767 1767 xscale=1.0, yscale = 0.0) 1768 self._checkFlightStatus = gtk.Label()1768 self._checkFlightStatus = Gtk.Label() 1769 1769 self._checkFlightStatus.set_use_markup(True) 1770 1770 self._checkFlightStatus.set_alignment(0.0, 0.5) … … 1774 1774 row += 1 1775 1775 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() 1779 1779 hbox.set_homogeneous(False) 1780 1780 hbox.set_spacing(0) 1781 1781 1782 aircraftTypesModel = gtk.ListStore(str, int)1782 aircraftTypesModel = Gtk.ListStore(str, int) 1783 1783 for aircraftType in web.BookedFlight.checkFlightTypes: 1784 1784 aircraftTypesModel.append([aircraftNames[aircraftType], 1785 1785 aircraftType]) 1786 1786 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() 1791 1791 self._aircraftType.pack_start(renderer, True) 1792 1792 self._aircraftType.add_attribute(renderer, "text", 0) … … 1798 1798 hbox.pack_start(aircraftTypeAlignment, False, False, 0) 1799 1799 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")) 1802 1802 button.set_use_underline(True) 1803 1803 button.connect("clicked", self._checkFlightClicked) … … 1894 1894 gui = wizard.gui 1895 1895 1896 dialog = gtk.MessageDialog(parent = gui.mainWindow,1896 dialog = Gtk.MessageDialog(parent = gui.mainWindow, 1897 1897 type = MESSAGETYPE_INFO, 1898 1898 message_format = xstr("student_fo")) … … 1924 1924 self._selectSimulator = os.name=="nt" or "FORCE_SELECT_SIM" in os.environ 1925 1925 1926 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,1926 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 1927 1927 xscale = 0.0, yscale = 0.0) 1928 1928 1929 table = gtk.Table(7 if self._selectSimulator else 5, 2)1929 table = Gtk.Table(7 if self._selectSimulator else 5, 2) 1930 1930 table.set_row_spacings(4) 1931 1931 table.set_col_spacings(16) … … 1934 1934 self.setMainWidget(alignment) 1935 1935 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")) 1938 1938 labelAlignment.add(label) 1939 1939 table.attach(labelAlignment, 0, 1, 0, 1) 1940 1940 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() 1943 1943 self._flightNumber.set_width_chars(9) 1944 1944 self._flightNumber.set_alignment(0.0, 0.5) … … 1946 1946 table.attach(labelAlignment, 1, 2, 0, 1) 1947 1947 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")) 1950 1950 labelAlignment.add(label) 1951 1951 table.attach(labelAlignment, 0, 1, 1, 2) 1952 1952 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() 1955 1955 self._aircraft.set_width_chars(25) 1956 1956 self._aircraft.set_alignment(0.0, 0.5) … … 1958 1958 table.attach(labelAlignment, 1, 2, 1, 2) 1959 1959 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")) 1962 1962 labelAlignment.add(label) 1963 1963 table.attach(labelAlignment, 0, 1, 2, 3) 1964 1964 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() 1967 1967 self._tailNumber.set_width_chars(10) 1968 1968 self._tailNumber.set_alignment(0.0, 0.5) … … 1970 1970 table.attach(labelAlignment, 1, 2, 2, 3) 1971 1971 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")) 1974 1974 labelAlignment.add(label) 1975 1975 table.attach(labelAlignment, 0, 1, 3, 4) 1976 1976 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() 1979 1979 self._departureICAO.set_width_chars(6) 1980 1980 self._departureICAO.set_alignment(0.0, 0.5) … … 1982 1982 table.attach(labelAlignment, 1, 2, 3, 4) 1983 1983 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")) 1986 1986 labelAlignment.add(label) 1987 1987 table.attach(labelAlignment, 0, 1, 4, 5) 1988 1988 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() 1991 1991 self._departureGate.set_width_chars(5) 1992 1992 self._departureGate.set_alignment(0.0, 0.5) … … 1995 1995 1996 1996 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")) 1999 1999 labelAlignment.add(label) 2000 2000 table.attach(labelAlignment, 0, 1, 5, 7) 2001 2001 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() 2005 2005 self._selectMSFS = \ 2006 gtk.RadioButton.new_with_mnemonic_from_widget(None,2006 Gtk.RadioButton.new_with_mnemonic_from_widget(None, 2007 2007 xstr("connect_sim_msfs")) 2008 2008 … … 2010 2010 2011 2011 self._selectXPlane = \ 2012 gtk.RadioButton.new_with_mnemonic_from_widget(self._selectMSFS,2012 Gtk.RadioButton.new_with_mnemonic_from_widget(self._selectMSFS, 2013 2013 xstr("connect_sim_xplane")) 2014 2014 … … 2101 2101 completedHelp = xstr("payload_chelp")) 2102 2102 2103 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,2103 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 2104 2104 xscale = 0.0, yscale = 0.0) 2105 2105 2106 table = gtk.Table(7, 3)2106 table = Gtk.Table(7, 3) 2107 2107 table.set_row_spacings(4) 2108 2108 table.set_col_spacings(16) … … 2111 2111 self.setMainWidget(alignment) 2112 2112 2113 label = gtk.Label(xstr("payload_crew"))2113 label = Gtk.Label(xstr("payload_crew")) 2114 2114 label.set_use_underline(True) 2115 2115 label.set_alignment(0.0, 0.5) … … 2123 2123 label.set_mnemonic_widget(self._numCrew) 2124 2124 2125 label = gtk.Label(xstr("payload_pax"))2125 label = Gtk.Label(xstr("payload_pax")) 2126 2126 label.set_use_underline(True) 2127 2127 label.set_alignment(0.0, 0.5) … … 2135 2135 label.set_mnemonic_widget(self._numPassengers) 2136 2136 2137 label = gtk.Label(xstr("payload_bag"))2137 label = Gtk.Label(xstr("payload_bag")) 2138 2138 label.set_use_underline(True) 2139 2139 label.set_alignment(0.0, 0.5) … … 2147 2147 label.set_mnemonic_widget(self._bagWeight) 2148 2148 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")) 2152 2152 label.set_use_underline(True) 2153 2153 label.set_alignment(0.0, 0.5) … … 2161 2161 label.set_mnemonic_widget(self._cargoWeight) 2162 2162 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")) 2166 2166 label.set_use_underline(True) 2167 2167 label.set_alignment(0.0, 0.5) … … 2175 2175 label.set_mnemonic_widget(self._mailWeight) 2176 2176 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>") 2180 2180 label.set_alignment(0.0, 0.5) 2181 2181 label.set_use_markup(True) 2182 2182 table.attach(label, 0, 1, 5, 6) 2183 2183 2184 self._calculatedZFW = gtk.Label()2184 self._calculatedZFW = Gtk.Label() 2185 2185 self._calculatedZFW.set_width_chars(6) 2186 2186 self._calculatedZFW.set_alignment(1.0, 0.5) 2187 2187 table.attach(self._calculatedZFW, 1, 2, 5, 6) 2188 2188 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")) 2192 2192 self._zfwButton.set_use_underline(True) 2193 2193 self._zfwButton.connect("clicked", self._zfwRequested) … … 2195 2195 table.attach(self._zfwButton, 0, 1, 6, 7) 2196 2196 2197 self._simulatorZFW = gtk.Label("-")2197 self._simulatorZFW = Gtk.Label("-") 2198 2198 self._simulatorZFW.set_width_chars(6) 2199 2199 self._simulatorZFW.set_alignment(1.0, 0.5) … … 2201 2201 self._simulatorZFWValue = None 2202 2202 2203 table.attach( gtk.Label("kg"), 2, 3, 6, 7)2203 table.attach(Gtk.Label("kg"), 2, 3, 6, 7) 2204 2204 2205 2205 self.addCancelFlightButton() … … 2329 2329 completedHelp = xstr("time_chelp")) 2330 2330 2331 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,2331 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 2332 2332 xscale = 0.0, yscale = 0.0) 2333 2333 2334 table = gtk.Table(3, 2)2334 table = Gtk.Table(3, 2) 2335 2335 table.set_row_spacings(4) 2336 2336 table.set_col_spacings(16) … … 2339 2339 self.setMainWidget(alignment) 2340 2340 2341 label = gtk.Label(xstr("time_departure"))2341 label = Gtk.Label(xstr("time_departure")) 2342 2342 label.set_alignment(0.0, 0.5) 2343 2343 table.attach(label, 0, 1, 0, 1) 2344 2344 2345 self._departure = gtk.Label()2345 self._departure = Gtk.Label() 2346 2346 self._departure.set_alignment(0.0, 0.5) 2347 2347 table.attach(self._departure, 1, 2, 0, 1) 2348 2348 2349 label = gtk.Label(xstr("time_arrival"))2349 label = Gtk.Label(xstr("time_arrival")) 2350 2350 label.set_alignment(0.0, 0.5) 2351 2351 table.attach(label, 0, 1, 1, 2) 2352 2352 2353 self._arrival = gtk.Label()2353 self._arrival = Gtk.Label() 2354 2354 self._arrival.set_alignment(0.0, 0.5) 2355 2355 table.attach(self._arrival, 1, 2, 1, 2) 2356 2356 2357 self._timeButton = gtk.Button(xstr("time_fs"))2357 self._timeButton = Gtk.Button(xstr("time_fs")) 2358 2358 self._timeButton.set_use_underline(True) 2359 2359 self._timeButton.set_tooltip_text(xstr("time_fs_tooltip")) … … 2361 2361 table.attach(self._timeButton, 0, 1, 2, 3) 2362 2362 2363 self._simulatorTime = gtk.Label("-")2363 self._simulatorTime = Gtk.Label("-") 2364 2364 self._simulatorTime.set_alignment(0.0, 0.5) 2365 2365 table.attach(self._simulatorTime, 1, 2, 2, 3) … … 2451 2451 completedHelp = xstr("route_chelp")) 2452 2452 2453 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,2453 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 2454 2454 xscale = 0.0, yscale = 0.0) 2455 2455 2456 mainBox = gtk.VBox()2456 mainBox = Gtk.VBox() 2457 2457 alignment.add(mainBox) 2458 2458 self.setMainWidget(alignment) 2459 2459 2460 levelBox = gtk.HBox()2461 2462 label = gtk.Label(xstr("route_level"))2460 levelBox = Gtk.HBox() 2461 2462 label = Gtk.Label(xstr("route_level")) 2463 2463 label.set_use_underline(True) 2464 2464 levelBox.pack_start(label, True, True, 0) 2465 2465 2466 self._cruiseLevel = gtk.SpinButton()2466 self._cruiseLevel = Gtk.SpinButton() 2467 2467 self._cruiseLevel.set_increments(step = 10, page = 100) 2468 2468 self._cruiseLevel.set_range(min = 0, max = 500) … … 2475 2475 levelBox.pack_start(self._cruiseLevel, False, False, 8) 2476 2476 2477 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,2477 alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5, 2478 2478 xscale = 0.0, yscale = 0.0) 2479 2479 alignment.add(levelBox) … … 2482 2482 2483 2483 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, 2487 2487 xscale = 0.0, yscale = 0.0) 2488 label = gtk.Label(xstr("route_route"))2488 label = Gtk.Label(xstr("route_route")) 2489 2489 label.set_use_underline(True) 2490 2490 alignment.add(label) 2491 2491 routeBox.pack_start(alignment, True, True, 0) 2492 2492 2493 routeWindow = gtk.ScrolledWindow()2493 routeWindow = Gtk.ScrolledWindow() 2494 2494 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) 2498 2498 2499 2499 self._uppercasingRoute = False 2500 2500 2501 self._route = gtk.TextView()2501 self._route = Gtk.TextView() 2502 2502 self._route.set_tooltip_text(xstr("route_route_tooltip")) 2503 2503 self._route.set_wrap_mode(WRAP_WORD) … … 2511 2511 mainBox.pack_start(routeBox, True, True, 8) 2512 2512 2513 alternateBox = gtk.HBox()2514 2515 label = gtk.Label(xstr("route_altn"))2513 alternateBox = Gtk.HBox() 2514 2515 label = Gtk.Label(xstr("route_altn")) 2516 2516 label.set_use_underline(True) 2517 2517 alternateBox.pack_start(label, True, True, 0) 2518 2518 2519 self._alternate = gtk.Entry()2519 self._alternate = Gtk.Entry() 2520 2520 self._alternate.set_width_chars(6) 2521 2521 self._alternate.connect("changed", self._alternateChanged) … … 2525 2525 alternateBox.pack_start(self._alternate, False, False, 8) 2526 2526 2527 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,2527 alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5, 2528 2528 xscale = 0.0, yscale = 0.0) 2529 2529 alignment.add(alternateBox) … … 2619 2619 #----------------------------------------------------------------------------- 2620 2620 2621 class SimBriefCredentialsDialog( gtk.Dialog):2621 class SimBriefCredentialsDialog(Gtk.Dialog): 2622 2622 """A dialog window to ask for SimBrief credentials.""" 2623 2623 def __init__(self, gui, userName, password, rememberPassword): … … 2632 2632 contentArea = self.get_content_area() 2633 2633 2634 contentAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,2634 contentAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 2635 2635 xscale = 0.0, yscale = 0.0) 2636 2636 contentAlignment.set_padding(padding_top = 4, padding_bottom = 16, … … 2639 2639 contentArea.pack_start(contentAlignment, False, False, 0) 2640 2640 2641 contentVBox = gtk.VBox()2641 contentVBox = Gtk.VBox() 2642 2642 contentAlignment.add(contentVBox) 2643 2643 2644 label = gtk.Label(xstr("simbrief_login_failed"))2644 label = Gtk.Label(xstr("simbrief_login_failed")) 2645 2645 label.set_alignment(0.0, 0.0) 2646 2646 2647 2647 contentVBox.pack_start(label, False, False, 0) 2648 2648 2649 tableAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,2649 tableAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 2650 2650 xscale = 0.0, yscale = 0.0) 2651 2651 tableAlignment.set_padding(padding_top = 24, padding_bottom = 0, 2652 2652 padding_left = 0, padding_right = 0) 2653 2653 2654 table = gtk.Table(3, 2)2654 table = Gtk.Table(3, 2) 2655 2655 table.set_row_spacings(4) 2656 2656 table.set_col_spacings(16) … … 2660 2660 contentVBox.pack_start(tableAlignment, True, True, 0) 2661 2661 2662 label = gtk.Label(xstr("simbrief_username"))2662 label = Gtk.Label(xstr("simbrief_username")) 2663 2663 label.set_use_underline(True) 2664 2664 label.set_alignment(0.0, 0.5) 2665 2665 table.attach(label, 0, 1, 0, 1) 2666 2666 2667 self._userName = gtk.Entry()2667 self._userName = Gtk.Entry() 2668 2668 self._userName.set_width_chars(16) 2669 2669 #self._userName.connect("changed", … … 2674 2674 label.set_mnemonic_widget(self._userName) 2675 2675 2676 label = gtk.Label(xstr("simbrief_password"))2676 label = Gtk.Label(xstr("simbrief_password")) 2677 2677 label.set_use_underline(True) 2678 2678 label.set_alignment(0.0, 0.5) 2679 2679 table.attach(label, 0, 1, 1, 2) 2680 2680 2681 self._password = gtk.Entry()2681 self._password = Gtk.Entry() 2682 2682 self._password.set_visibility(False) 2683 2683 #self._password.connect("changed", … … 2688 2688 label.set_mnemonic_widget(self._password) 2689 2689 2690 self._rememberButton = gtk.CheckButton(xstr("simbrief_remember_password"))2690 self._rememberButton = Gtk.CheckButton(xstr("simbrief_remember_password")) 2691 2691 self._rememberButton.set_use_underline(True) 2692 2692 self._rememberButton.set_tooltip_text(xstr("simbrief_remember_tooltip")) … … 2779 2779 xstr("simbrief_setup_chelp")) 2780 2780 2781 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,2781 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 2782 2782 xscale = 0.0, yscale = 0.0) 2783 2783 2784 table = gtk.Table(9, 3)2784 table = Gtk.Table(9, 3) 2785 2785 table.set_row_spacings(4) 2786 2786 table.set_col_spacings(16) … … 2789 2789 self.setMainWidget(alignment) 2790 2790 2791 label = gtk.Label(xstr("simbrief_username"))2791 label = Gtk.Label(xstr("simbrief_username")) 2792 2792 label.set_use_underline(True) 2793 2793 label.set_alignment(0.0, 0.5) 2794 2794 table.attach(label, 0, 1, 0, 1) 2795 2795 2796 self._userName = gtk.Entry()2796 self._userName = Gtk.Entry() 2797 2797 self._userName.set_width_chars(16) 2798 2798 self._userName.connect("changed", … … 2802 2802 label.set_mnemonic_widget(self._userName) 2803 2803 2804 label = gtk.Label(xstr("simbrief_password"))2804 label = Gtk.Label(xstr("simbrief_password")) 2805 2805 label.set_use_underline(True) 2806 2806 label.set_alignment(0.0, 0.5) 2807 2807 table.attach(label, 0, 1, 1, 2) 2808 2808 2809 self._password = gtk.Entry()2809 self._password = Gtk.Entry() 2810 2810 self._password.set_visibility(False) 2811 2811 self._password.connect("changed", … … 2815 2815 label.set_mnemonic_widget(self._password) 2816 2816 2817 self._rememberButton = gtk.CheckButton(xstr("simbrief_remember_password"))2817 self._rememberButton = Gtk.CheckButton(xstr("simbrief_remember_password")) 2818 2818 self._rememberButton.set_use_underline(True) 2819 2819 self._rememberButton.set_tooltip_text(xstr("simbrief_remember_tooltip")) 2820 2820 table.attach(self._rememberButton, 1, 2, 2, 3, ypadding = 8) 2821 2821 2822 label = gtk.Label(xstr("simbrief_extra_fuel"))2822 label = Gtk.Label(xstr("simbrief_extra_fuel")) 2823 2823 label.set_use_underline(True) 2824 2824 label.set_alignment(0.0, 0.5) … … 2831 2831 label.set_mnemonic_widget(self._extraFuel) 2832 2832 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")) 2836 2836 label.set_use_underline(True) 2837 2837 label.set_alignment(0.0, 0.5) 2838 2838 table.attach(label, 0, 1, 4, 5) 2839 2839 2840 self._takeoffRunway = gtk.Entry()2840 self._takeoffRunway = Gtk.Entry() 2841 2841 self._takeoffRunway.set_width_chars(10) 2842 2842 self._takeoffRunway.set_tooltip_text(xstr("simbrief_takeoff_runway_tooltip")) … … 2845 2845 label.set_mnemonic_widget(self._takeoffRunway) 2846 2846 2847 label = gtk.Label(xstr("simbrief_landing_runway"))2847 label = Gtk.Label(xstr("simbrief_landing_runway")) 2848 2848 label.set_use_underline(True) 2849 2849 label.set_alignment(0.0, 0.5) 2850 2850 table.attach(label, 0, 1, 5, 6) 2851 2851 2852 self._landingRunway = gtk.Entry()2852 self._landingRunway = Gtk.Entry() 2853 2853 self._landingRunway.set_width_chars(10) 2854 2854 self._landingRunway.set_tooltip_text(xstr("simbrief_takeoff_runway_tooltip")) … … 2857 2857 label.set_mnemonic_widget(self._landingRunway) 2858 2858 2859 label = gtk.Label(xstr("simbrief_climb_profile"))2859 label = Gtk.Label(xstr("simbrief_climb_profile")) 2860 2860 label.set_use_underline(True) 2861 2861 label.set_alignment(0.0, 0.5) 2862 2862 table.attach(label, 0, 1, 6, 7) 2863 2863 2864 self._climbProfile = gtk.ComboBox()2865 renderer = gtk.CellRendererText()2864 self._climbProfile = Gtk.ComboBox() 2865 renderer = Gtk.CellRendererText() 2866 2866 self._climbProfile.pack_start(renderer, True) 2867 2867 self._climbProfile.add_attribute(renderer, "text", 0) … … 2870 2870 label.set_mnemonic_widget(self._climbProfile) 2871 2871 2872 label = gtk.Label(xstr("simbrief_cruise_profile"))2872 label = Gtk.Label(xstr("simbrief_cruise_profile")) 2873 2873 label.set_use_underline(True) 2874 2874 label.set_alignment(0.0, 0.5) 2875 2875 table.attach(label, 0, 1, 7, 8) 2876 2876 2877 self._cruiseProfile = gtk.ComboBox()2878 renderer = gtk.CellRendererText()2877 self._cruiseProfile = Gtk.ComboBox() 2878 renderer = Gtk.CellRendererText() 2879 2879 self._cruiseProfile.pack_start(renderer, True) 2880 2880 self._cruiseProfile.add_attribute(renderer, "text", 0) … … 2883 2883 label.set_mnemonic_widget(self._cruiseProfile) 2884 2884 2885 label = gtk.Label(xstr("simbrief_descent_profile"))2885 label = Gtk.Label(xstr("simbrief_descent_profile")) 2886 2886 label.set_use_underline(True) 2887 2887 label.set_alignment(0.0, 0.5) 2888 2888 table.attach(label, 0, 1, 8, 9) 2889 2889 2890 self._descentProfile = gtk.ComboBox()2891 renderer = gtk.CellRendererText()2890 self._descentProfile = Gtk.ComboBox() 2891 renderer = Gtk.CellRendererText() 2892 2892 self._descentProfile.pack_start(renderer, True) 2893 2893 self._descentProfile.add_attribute(renderer, "text", 0) … … 2930 2930 (self._descentProfile, 2931 2931 simBriefData.descentProfiles)]: 2932 model = gtk.ListStore(str)2932 model = Gtk.ListStore(str) 2933 2933 for profile in profiles: 2934 2934 model.append([profile]) … … 3053 3053 message = SimBriefSetupPage.result2Message.get(result, 3054 3054 "simbrief_result_unknown") 3055 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,3055 dialog = Gtk.MessageDialog(parent = self._wizard.gui.mainWindow, 3056 3056 type = MESSAGETYPE_ERROR, 3057 3057 message_format = … … 3155 3155 xstr("simbrief_result_title"), "") 3156 3156 3157 self._alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,3157 self._alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 3158 3158 xscale = 1.0, yscale = 1.0) 3159 3159 … … 3224 3224 #----------------------------------------------------------------------------- 3225 3225 3226 class FuelTank( gtk.VBox):3226 class FuelTank(Gtk.VBox): 3227 3227 """Widget for the fuel tank.""" 3228 3228 def __init__(self, fuelTank, name, capacity, currentWeight): … … 3236 3236 self.expectedWeight = currentWeight 3237 3237 3238 self._label = label = gtk.Label("<b>" + name + "</b>")3238 self._label = label = Gtk.Label("<b>" + name + "</b>") 3239 3239 label.set_use_markup(True) 3240 3240 label.set_use_underline(True) … … 3242 3242 label.set_alignment(0.5, 1.0) 3243 3243 3244 self._tankFigure = gtk.EventBox()3244 self._tankFigure = Gtk.EventBox() 3245 3245 self._tankFigure.set_size_request(38, 200) 3246 3246 self._tankFigure.set_visible_window(False) … … 3252 3252 self._tankFigure.connect("scroll-event", self._scrolled) 3253 3253 3254 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,3254 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 3255 3255 xscale = 0.0, yscale = 1.0) 3256 3256 alignment.add(self._tankFigure) … … 3258 3258 self.pack_start(alignment, True, True, 4) 3259 3259 3260 self._expectedButton = gtk.SpinButton()3260 self._expectedButton = Gtk.SpinButton() 3261 3261 self._expectedButton.set_numeric(True) 3262 3262 self._expectedButton.set_range(0, self.capacity) … … 3414 3414 self._fuelTanks = [] 3415 3415 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, 3417 3417 xscale = 0.0, yscale = 1.0) 3418 3418 self.setMainWidget(self._fuelAlignment) … … 3470 3470 3471 3471 self._fuelTanks = [] 3472 self._fuelTable = gtk.Grid()3472 self._fuelTable = Gtk.Grid() 3473 3473 self._fuelTable.set_column_homogeneous(True) 3474 3474 self._fuelTable.set_row_spacing(4) … … 3481 3481 self._fuelTanks.append(fuelTank) 3482 3482 3483 alignment = gtk.Alignment(xalign = 0.5, yalign = 1.0,3483 alignment = Gtk.Alignment(xalign = 0.5, yalign = 1.0, 3484 3484 xscale = 1.0, yscale = 0.0) 3485 3485 alignment.add(fuelTank.label) 3486 3486 self._fuelTable.attach(alignment, index*2, 0, 3, 1) 3487 3487 3488 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,3488 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 3489 3489 xscale = 0.0, yscale = 1.0) 3490 3490 alignment.add(fuelTank) … … 3492 3492 3493 3493 3494 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,3494 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 3495 3495 xscale = 1.0, yscale = 0.0) 3496 3496 alignment.add(fuelTank.expectedButton) … … 3607 3607 completedHelp = xstr("briefing_chelp")) 3608 3608 3609 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,3609 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 3610 3610 xscale = 1.0, yscale = 1.0) 3611 3611 3612 mainBox = gtk.VBox()3612 mainBox = Gtk.VBox() 3613 3613 alignment.add(mainBox) 3614 3614 self.setMainWidget(alignment) 3615 3615 3616 self._notamsFrame = gtk.Frame()3616 self._notamsFrame = Gtk.Frame() 3617 3617 self._notamsFrame.set_label(xstr("briefing_notams_init")) 3618 scrolledWindow = gtk.ScrolledWindow()3618 scrolledWindow = Gtk.ScrolledWindow() 3619 3619 scrolledWindow.set_size_request(-1, 128) 3620 3620 # 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() 3624 3624 self._notams.set_editable(False) 3625 3625 self._notams.set_accepts_tab(False) 3626 self._notams.set_wrap_mode( gtk.WrapMode.WORD)3626 self._notams.set_wrap_mode(Gtk.WrapMode.WORD) 3627 3627 scrolledWindow.add(self._notams) 3628 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,3628 alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 3629 3629 xscale = 1.0, yscale = 1.0) 3630 3630 alignment.set_padding(padding_top = 4, padding_bottom = 0, … … 3634 3634 mainBox.pack_start(self._notamsFrame, True, True, 4) 3635 3635 3636 self._metarFrame = gtk.Frame()3636 self._metarFrame = Gtk.Frame() 3637 3637 self._metarFrame.set_label(xstr("briefing_metar_init")) 3638 scrolledWindow = gtk.ScrolledWindow()3638 scrolledWindow = Gtk.ScrolledWindow() 3639 3639 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) 3642 3642 3643 3643 self._updatingMETAR = False 3644 3644 3645 self._metar = gtk.TextView()3645 self._metar = Gtk.TextView() 3646 3646 self._metar.set_accepts_tab(False) 3647 self._metar.set_wrap_mode( gtk.WrapMode.WORD)3647 self._metar.set_wrap_mode(Gtk.WrapMode.WORD) 3648 3648 self._metar.get_buffer().connect("changed", self._metarChanged) 3649 3649 self._metar.get_buffer().connect_after("insert-text", self._metarInserted) 3650 3650 scrolledWindow.add(self._metar) 3651 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,3651 alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 3652 3652 xscale = 1.0, yscale = 1.0) 3653 3653 alignment.set_padding(padding_top = 4, padding_bottom = 0, … … 3794 3794 self._forwardAllowed = False 3795 3795 3796 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,3796 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 3797 3797 xscale = 0.0, yscale = 0.0) 3798 3798 3799 table = gtk.Table(9, 24)3799 table = Gtk.Table(9, 24) 3800 3800 table.set_row_spacings(4) 3801 3801 table.set_col_spacings(16) … … 3806 3806 row = 0 3807 3807 3808 label = gtk.Label(xstr("takeoff_metar"))3808 label = Gtk.Label(xstr("takeoff_metar")) 3809 3809 label.set_use_underline(True) 3810 3810 label.set_alignment(0.0, 0.5) 3811 3811 table.attach(label, 0, 1, row, row+1) 3812 3812 3813 self._metar = gtk.Entry()3813 self._metar = Gtk.Entry() 3814 3814 self._metar.set_width_chars(40) 3815 3815 self._metar.set_tooltip_text(xstr("takeoff_metar_tooltip")) … … 3823 3823 row += 1 3824 3824 3825 label = gtk.Label(xstr("takeoff_runway"))3825 label = Gtk.Label(xstr("takeoff_runway")) 3826 3826 label.set_use_underline(True) 3827 3827 label.set_alignment(0.0, 0.5) 3828 3828 table.attach(label, 0, 1, row, row+1) 3829 3829 3830 self._runway = gtk.Entry()3830 self._runway = Gtk.Entry() 3831 3831 self._runway.set_width_chars(10) 3832 3832 self._runway.set_tooltip_text(xstr("takeoff_runway_tooltip")) … … 3837 3837 row += 1 3838 3838 3839 label = gtk.Label(xstr("takeoff_sid"))3839 label = Gtk.Label(xstr("takeoff_sid")) 3840 3840 label.set_use_underline(True) 3841 3841 label.set_alignment(0.0, 0.5) 3842 3842 table.attach(label, 0, 1, row, row+1) 3843 3843 3844 self._sid = gtk.ComboBox.new_with_model_and_entry(comboModel)3844 self._sid = Gtk.ComboBox.new_with_model_and_entry(comboModel) 3845 3845 3846 3846 self._sid.set_entry_text_column(0) … … 3853 3853 row += 1 3854 3854 3855 label = gtk.Label(xstr("takeoff_v1"))3855 label = Gtk.Label(xstr("takeoff_v1")) 3856 3856 label.set_use_markup(True) 3857 3857 label.set_use_underline(True) … … 3866 3866 label.set_mnemonic_widget(self._v1) 3867 3867 3868 self._v1Unit = gtk.Label(xstr("label_knots"))3868 self._v1Unit = Gtk.Label(xstr("label_knots")) 3869 3869 self._v1Unit.set_alignment(0.0, 0.5) 3870 3870 table.attach(self._v1Unit, 3, 4, row, row+1) … … 3872 3872 row += 1 3873 3873 3874 label = gtk.Label(xstr("takeoff_vr"))3874 label = Gtk.Label(xstr("takeoff_vr")) 3875 3875 label.set_use_markup(True) 3876 3876 label.set_use_underline(True) … … 3885 3885 label.set_mnemonic_widget(self._vr) 3886 3886 3887 self._vrUnit = gtk.Label(xstr("label_knots"))3887 self._vrUnit = Gtk.Label(xstr("label_knots")) 3888 3888 self._vrUnit.set_alignment(0.0, 0.5) 3889 3889 table.attach(self._vrUnit, 3, 4, row, row+1) … … 3891 3891 row += 1 3892 3892 3893 label = gtk.Label(xstr("takeoff_v2"))3893 label = Gtk.Label(xstr("takeoff_v2")) 3894 3894 label.set_use_markup(True) 3895 3895 label.set_use_underline(True) … … 3904 3904 label.set_mnemonic_widget(self._v2) 3905 3905 3906 self._v2Unit = gtk.Label(xstr("label_knots"))3906 self._v2Unit = Gtk.Label(xstr("label_knots")) 3907 3907 self._v2Unit.set_alignment(0.0, 0.5) 3908 3908 table.attach(self._v2Unit, 3, 4, row, row+1) … … 3912 3912 self._derateType = acft.DERATE_NONE 3913 3913 3914 self._derateLabel = gtk.Label()3914 self._derateLabel = Gtk.Label() 3915 3915 self._derateLabel.set_use_underline(True) 3916 3916 self._derateLabel.set_markup(xstr("takeoff_derate_tupolev")) … … 3918 3918 table.attach(self._derateLabel, 0, 1, row, row+1) 3919 3919 3920 self._derate = gtk.Alignment()3920 self._derate = Gtk.Alignment() 3921 3921 table.attach(self._derate, 2, 4, row, row+1) 3922 3922 self._derateWidget = None … … 3927 3927 row += 1 3928 3928 3929 self._antiIceOn = gtk.CheckButton(xstr("takeoff_antiice"))3929 self._antiIceOn = Gtk.CheckButton(xstr("takeoff_antiice")) 3930 3930 self._antiIceOn.set_use_underline(True) 3931 3931 self._antiIceOn.set_tooltip_text(xstr("takeoff_antiice_tooltip")) … … 3934 3934 row += 1 3935 3935 3936 self._rto = gtk.CheckButton(xstr("takeoff_rto"))3936 self._rto = Gtk.CheckButton(xstr("takeoff_rto")) 3937 3937 self._rto.set_use_underline(True) 3938 3938 self._rto.set_tooltip_text(xstr("takeoff_rto_tooltip")) … … 4168 4168 self._derateLabel.set_sensitive(True) 4169 4169 4170 self._derateEntry = gtk.Entry()4170 self._derateEntry = Gtk.Entry() 4171 4171 self._derateEntry.set_width_chars(7) 4172 4172 self._derateEntry.set_tooltip_text(xstr("takeoff_derate_boeing_tooltip")) … … 4175 4175 self._derateLabel.set_mnemonic_widget(self._derateEntry) 4176 4176 4177 self._derateUnit = gtk.Label("%")4177 self._derateUnit = Gtk.Label("%") 4178 4178 self._derateUnit.set_alignment(0.0, 0.5) 4179 4179 4180 self._derateWidget = gtk.Table(3, 1)4180 self._derateWidget = Gtk.Table(3, 1) 4181 4181 self._derateWidget.set_row_spacings(4) 4182 4182 self._derateWidget.set_col_spacings(16) … … 4192 4192 self._derateLabel.set_sensitive(True) 4193 4193 4194 self._derateWidget = gtk.Entry()4194 self._derateWidget = Gtk.Entry() 4195 4195 self._derateWidget.set_width_chars(7) 4196 4196 self._derateWidget.set_tooltip_text(xstr("takeoff_derate_epr_tooltip")) … … 4205 4205 self._derateLabel.set_sensitive(True) 4206 4206 4207 nominal = gtk.RadioButton.\4207 nominal = Gtk.RadioButton.\ 4208 4208 new_with_label_from_widget(None, 4209 4209 xstr("takeoff_derate_tupolev_nominal")) … … 4212 4212 nominal.connect("toggled", self._derateChanged) 4213 4213 4214 takeoff = gtk.RadioButton.\4214 takeoff = Gtk.RadioButton.\ 4215 4215 new_with_label_from_widget(nominal, 4216 4216 xstr("takeoff_derate_tupolev_takeoff")) … … 4222 4222 self._derateButtons = [nominal, takeoff] 4223 4223 4224 self._derateWidget = gtk.HBox()4224 self._derateWidget = Gtk.HBox() 4225 4225 self._derateWidget.pack_start(nominal, False, False, 4) 4226 4226 self._derateWidget.pack_start(takeoff, False, False, 4) … … 4230 4230 self._derateLabel.set_text("") 4231 4231 4232 self._derateWidget = gtk.CheckButton(xstr("takeoff_derate_b462"))4232 self._derateWidget = Gtk.CheckButton(xstr("takeoff_derate_b462")) 4233 4233 self._derateWidget.set_tooltip_text(xstr("takeoff_derate_b462_tooltip")) 4234 4234 self._derateWidget.set_use_underline(True) … … 4273 4273 self._activated = False 4274 4274 4275 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.0,4275 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.0, 4276 4276 xscale = 0.0, yscale = 1.0) 4277 4277 4278 mainBox = gtk.VBox()4278 mainBox = Gtk.VBox() 4279 4279 alignment.add(mainBox) 4280 4280 self.setMainWidget(alignment) 4281 4281 4282 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,4282 alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 4283 4283 xscale = 0.0, yscale = 0.0) 4284 4284 mainBox.pack_start(alignment, False, False, 16) 4285 4285 4286 levelBox = gtk.HBox()4287 4288 label = gtk.Label(xstr("route_level"))4286 levelBox = Gtk.HBox() 4287 4288 label = Gtk.Label(xstr("route_level")) 4289 4289 label.set_use_underline(True) 4290 4290 levelBox.pack_start(label, True, True, 0) 4291 4291 4292 self._cruiseLevel = gtk.SpinButton()4292 self._cruiseLevel = Gtk.SpinButton() 4293 4293 self._cruiseLevel.set_increments(step = 10, page = 100) 4294 4294 self._cruiseLevel.set_range(min = 50, max = 500) … … 4300 4300 levelBox.pack_start(self._cruiseLevel, False, False, 8) 4301 4301 4302 self._updateButton = gtk.Button(xstr("cruise_route_level_update"));4302 self._updateButton = Gtk.Button(xstr("cruise_route_level_update")); 4303 4303 self._updateButton.set_use_underline(True) 4304 4304 self._updateButton.set_tooltip_text(xstr("cruise_route_level_update_tooltip")) … … 4309 4309 mainBox.pack_start(levelBox, False, False, 0) 4310 4310 4311 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,4311 alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 4312 4312 xscale = 0.0, yscale = 1.0) 4313 4313 mainBox.pack_start(alignment, True, True, 0) … … 4387 4387 self._flightEnded = False 4388 4388 4389 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,4389 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 4390 4390 xscale = 0.0, yscale = 0.0) 4391 4391 4392 table = gtk.Table(7, 24)4392 table = Gtk.Table(7, 24) 4393 4393 table.set_row_spacings(4) 4394 4394 table.set_col_spacings(16) … … 4399 4399 row = 0 4400 4400 4401 label = gtk.Label(xstr("landing_metar"))4401 label = Gtk.Label(xstr("landing_metar")) 4402 4402 label.set_use_underline(True) 4403 4403 label.set_alignment(0.0, 0.5) 4404 4404 table.attach(label, 1, 2, row, row+1) 4405 4405 4406 self._metar = gtk.Entry()4406 self._metar = Gtk.Entry() 4407 4407 self._metar.set_width_chars(40) 4408 4408 self._metar.set_tooltip_text(xstr("landing_metar_tooltip")) … … 4416 4416 row += 1 4417 4417 4418 label = gtk.Label(xstr("landing_star"))4418 label = Gtk.Label(xstr("landing_star")) 4419 4419 label.set_use_underline(True) 4420 4420 label.set_alignment(0.0, 0.5) 4421 4421 table.attach(label, 1, 2, row, row + 1) 4422 4422 4423 self._star = gtk.ComboBox.new_with_model_and_entry(comboModel)4423 self._star = Gtk.ComboBox.new_with_model_and_entry(comboModel) 4424 4424 4425 4425 self._star.set_entry_text_column(0) … … 4433 4433 row += 1 4434 4434 4435 label = gtk.Label(xstr("landing_transition"))4435 label = Gtk.Label(xstr("landing_transition")) 4436 4436 label.set_use_underline(True) 4437 4437 label.set_alignment(0.0, 0.5) 4438 4438 table.attach(label, 1, 2, row, row + 1) 4439 4439 4440 self._transition = gtk.ComboBox.new_with_model_and_entry(comboModel)4440 self._transition = Gtk.ComboBox.new_with_model_and_entry(comboModel) 4441 4441 4442 4442 self._transition.set_entry_text_column(0) … … 4450 4450 row += 1 4451 4451 4452 label = gtk.Label(xstr("landing_runway"))4452 label = Gtk.Label(xstr("landing_runway")) 4453 4453 label.set_use_underline(True) 4454 4454 label.set_alignment(0.0, 0.5) 4455 4455 table.attach(label, 1, 2, row, row + 1) 4456 4456 4457 self._runway = gtk.Entry()4457 self._runway = Gtk.Entry() 4458 4458 self._runway.set_width_chars(10) 4459 4459 self._runway.set_tooltip_text(xstr("landing_runway_tooltip")) … … 4464 4464 row += 1 4465 4465 4466 label = gtk.Label(xstr("landing_approach"))4466 label = Gtk.Label(xstr("landing_approach")) 4467 4467 label.set_use_underline(True) 4468 4468 label.set_alignment(0.0, 0.5) 4469 4469 table.attach(label, 1, 2, row, row + 1) 4470 4470 4471 self._approachType = gtk.Entry()4471 self._approachType = Gtk.Entry() 4472 4472 self._approachType.set_width_chars(10) 4473 4473 self._approachType.set_tooltip_text(xstr("landing_approach_tooltip")) … … 4478 4478 row += 1 4479 4479 4480 label = gtk.Label(xstr("landing_vref"))4480 label = Gtk.Label(xstr("landing_vref")) 4481 4481 label.set_use_markup(True) 4482 4482 label.set_use_underline(True) … … 4491 4491 label.set_mnemonic_widget(self._vref) 4492 4492 4493 self._vrefUnit = gtk.Label(xstr("label_knots"))4493 self._vrefUnit = Gtk.Label(xstr("label_knots")) 4494 4494 table.attach(self._vrefUnit, 4, 5, row, row + 1) 4495 4495 4496 4496 row += 1 4497 4497 4498 self._antiIceOn = gtk.CheckButton(xstr("landing_antiice"))4498 self._antiIceOn = Gtk.CheckButton(xstr("landing_antiice")) 4499 4499 self._antiIceOn.set_use_underline(True) 4500 4500 self._antiIceOn.set_tooltip_text(xstr("landing_antiice_tooltip")) … … 4780 4780 page.setPIREPSaved() 4781 4781 4782 dialog = gtk.MessageDialog(parent = gui.mainWindow,4782 dialog = Gtk.MessageDialog(parent = gui.mainWindow, 4783 4783 type = type, message_format = message) 4784 4784 dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK) … … 4796 4796 if self._savePIREPDialog is None: 4797 4797 gui = self._wizard.gui 4798 dialog = gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +4798 dialog = Gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " + 4799 4799 xstr("finish_save_title"), 4800 4800 action = FILE_CHOOSER_ACTION_SAVE, 4801 buttons = ( gtk.STOCK_CANCEL,4801 buttons = (Gtk.STOCK_CANCEL, 4802 4802 RESPONSETYPE_CANCEL, 4803 gtk.STOCK_OK, RESPONSETYPE_OK),4803 Gtk.STOCK_OK, RESPONSETYPE_OK), 4804 4804 parent = gui.mainWindow) 4805 4805 dialog.set_modal(True) 4806 4806 dialog.set_do_overwrite_confirmation(True) 4807 4807 4808 filter = gtk.FileFilter()4808 filter = Gtk.FileFilter() 4809 4809 filter.set_name(xstr("file_filter_pireps")) 4810 4810 filter.add_pattern("*.pirep") 4811 4811 dialog.add_filter(filter) 4812 4812 4813 filter = gtk.FileFilter()4813 filter = Gtk.FileFilter() 4814 4814 filter.set_name(xstr("file_filter_all")) 4815 4815 filter.add_pattern("*.*") … … 4830 4830 xstr("finish_title"), help) 4831 4831 4832 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,4832 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 4833 4833 xscale = 0.0, yscale = 0.0) 4834 4834 4835 table = gtk.Table(10, 2)4835 table = Gtk.Table(10, 2) 4836 4836 table.set_row_spacings(4) 4837 4837 table.set_col_spacings(16) … … 4842 4842 row = 0 4843 4843 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")) 4846 4846 labelAlignment.add(label) 4847 4847 table.attach(labelAlignment, 0, 1, row, row+1) 4848 4848 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() 4851 4851 self._flightRating.set_width_chars(8) 4852 4852 self._flightRating.set_alignment(0.0, 0.5) … … 4857 4857 row += 1 4858 4858 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")) 4861 4861 labelAlignment.add(label) 4862 4862 table.attach(labelAlignment, 0, 1, row, row+1) 4863 4863 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() 4866 4866 self._depTime.set_width_chars(13) 4867 4867 self._depTime.set_alignment(0.0, 0.5) … … 4873 4873 row += 1 4874 4874 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")) 4877 4877 labelAlignment.add(label) 4878 4878 table.attach(labelAlignment, 0, 1, row, row+1) 4879 4879 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() 4882 4882 self._flightTime.set_width_chars(10) 4883 4883 self._flightTime.set_alignment(0.0, 0.5) … … 4888 4888 row += 1 4889 4889 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")) 4892 4892 labelAlignment.add(label) 4893 4893 table.attach(labelAlignment, 0, 1, row, row+1) 4894 4894 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() 4897 4897 self._blockTime.set_width_chars(10) 4898 4898 self._blockTime.set_alignment(0.0, 0.5) … … 4903 4903 row += 1 4904 4904 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")) 4907 4907 labelAlignment.add(label) 4908 4908 table.attach(labelAlignment, 0, 1, row, row+1) 4909 4909 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() 4912 4912 self._arrTime.set_width_chars(13) 4913 4913 self._arrTime.set_alignment(0.0, 0.5) … … 4919 4919 row += 1 4920 4920 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")) 4923 4923 labelAlignment.add(label) 4924 4924 table.attach(labelAlignment, 0, 1, row, row+1) 4925 4925 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() 4928 4928 self._distanceFlown.set_width_chars(10) 4929 4929 self._distanceFlown.set_alignment(0.0, 0.5) … … 4934 4934 row += 1 4935 4935 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")) 4938 4938 labelAlignment.add(label) 4939 4939 table.attach(labelAlignment, 0, 1, row, row+1) 4940 4940 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() 4943 4943 self._fuelUsed.set_width_chars(10) 4944 4944 self._fuelUsed.set_alignment(0.0, 0.5) … … 4949 4949 row += 1 4950 4950 4951 labelAlignment = gtk.Alignment(xalign = 1.0, xscale = 0.0,4951 labelAlignment = Gtk.Alignment(xalign = 1.0, xscale = 0.0, 4952 4952 yalign = 0.5, yscale = 0.0) 4953 label = gtk.Label(xstr("finish_type"))4953 label = Gtk.Label(xstr("finish_type")) 4954 4954 label.set_use_underline(True) 4955 4955 labelAlignment.add(label) … … 4960 4960 self._flightType.set_active(0) 4961 4961 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) 4963 4963 flightTypeAlignment.add(self._flightType) 4964 4964 table.attach(flightTypeAlignment, 1, 2, row, row+1) … … 4967 4967 row += 1 4968 4968 4969 self._onlineFlight = gtk.CheckButton(xstr("finish_online"))4969 self._onlineFlight = Gtk.CheckButton(xstr("finish_online")) 4970 4970 self._onlineFlight.set_use_underline(True) 4971 4971 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) 4973 4973 onlineFlightAlignment.add(self._onlineFlight) 4974 4974 table.attach(onlineFlightAlignment, 1, 2, row, row + 1) … … 4976 4976 row += 1 4977 4977 4978 labelAlignment = gtk.Alignment(xalign = 1.0, xscale = 0.0,4978 labelAlignment = Gtk.Alignment(xalign = 1.0, xscale = 0.0, 4979 4979 yalign = 0.5, yscale = 0.0) 4980 self._gateLabel = gtk.Label(xstr("finish_gate"))4980 self._gateLabel = Gtk.Label(xstr("finish_gate")) 4981 4981 self._gateLabel.set_use_underline(True) 4982 4982 labelAlignment.add(self._gateLabel) 4983 4983 table.attach(labelAlignment, 0, 1, row, row+1) 4984 4984 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() 4989 4989 self._gate.pack_start(renderer, True) 4990 4990 self._gate.add_attribute(renderer, "text", 0) 4991 4991 self._gate.set_tooltip_text(xstr("finish_gate_tooltip")) 4992 4992 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) 4994 4994 gateAlignment.add(self._gate) 4995 4995 table.attach(gateAlignment, 1, 2, row, row+1) … … 5143 5143 gui = self._wizard.gui 5144 5144 if not self._pirepSent and not self._pirepSaved: 5145 dialog = gtk.MessageDialog(parent = gui.mainWindow,5145 dialog = Gtk.MessageDialog(parent = gui.mainWindow, 5146 5146 type = MESSAGETYPE_QUESTION, 5147 5147 message_format = xstr("finish_newFlight_question")) … … 5261 5261 "") 5262 5262 5263 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,5263 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 5264 5264 xscale = 1.0, yscale = 1.0) 5265 self._label = gtk.Label()5265 self._label = Gtk.Label() 5266 5266 alignment.add(self._label) 5267 5267 … … 5349 5349 self._resetGUI() 5350 5350 else: 5351 dialog = gtk.MessageDialog(parent = gui.mainWindow,5351 dialog = Gtk.MessageDialog(parent = gui.mainWindow, 5352 5352 type = MESSAGETYPE_ERROR, 5353 5353 message_format = … … 5369 5369 #----------------------------------------------------------------------------- 5370 5370 5371 class Wizard( gtk.VBox):5371 class Wizard(Gtk.VBox): 5372 5372 """The flight wizard.""" 5373 5373 def __init__(self, gui): … … 5881 5881 if self.entranceExam else 5882 5882 xstr("login_invalid")) 5883 dialog = gtk.MessageDialog(parent = self.gui.mainWindow,5883 dialog = Gtk.MessageDialog(parent = self.gui.mainWindow, 5884 5884 type = MESSAGETYPE_ERROR, 5885 5885 message_format = message) … … 5898 5898 message = xstr("reload_failconn") if isReload \ 5899 5899 else xstr("login_failconn") 5900 dialog = gtk.MessageDialog(parent = self.gui.mainWindow,5900 dialog = Gtk.MessageDialog(parent = self.gui.mainWindow, 5901 5901 type = MESSAGETYPE_ERROR, 5902 5902 message_format = message) -
src/mlx/gui/flightlist.py
r995 r996 22 22 self._convertFn = convertFn 23 23 self._renderer = \ 24 gtk.CellRendererText() if renderer is None else renderer24 Gtk.CellRendererText() if renderer is None else renderer 25 25 self._extraColumnAttributes = extraColumnAttributes 26 26 self._sortable = sortable … … 47 47 48 48 @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, 51 51 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, 54 54 active = index) 55 55 else: 56 column = gtk.TreeViewColumn(self._heading, self._renderer)56 column = Gtk.TreeViewColumn(self._heading, self._renderer) 57 57 column.set_expand(True) 58 58 if self._sortable: … … 83 83 #----------------------------------------------------------------------------- 84 84 85 class FlightList( gtk.Alignment):85 class FlightList(Gtk.Alignment): 86 86 """Construct the flight list. 87 87 … … 114 114 columnDescriptor.appendType(types) 115 115 116 self._model = gtk.ListStore(*types)116 self._model = Gtk.ListStore(*types) 117 117 if defaultSortableIndex is not None: 118 118 sortOrder = SORT_DESCENDING \ … … 120 120 else SORT_ASCENDING 121 121 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() 125 125 flightIndexColumn.set_visible(False) 126 126 self._view.append_column(flightIndexColumn) … … 140 140 selection.set_mode(SELECTION_MULTIPLE) 141 141 142 scrolledWindow = gtk.ScrolledWindow()142 scrolledWindow = Gtk.ScrolledWindow() 143 143 scrolledWindow.add(self._view) 144 144 if widthRequest is not None: 145 145 scrolledWindow.set_size_request(widthRequest, -1) 146 146 # 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) 150 150 151 151 super(FlightList, self).__init__(xalign = 0.5, yalign = 0.0, … … 235 235 #----------------------------------------------------------------------------- 236 236 237 class PendingFlightsFrame( gtk.Frame):237 class PendingFlightsFrame(Gtk.Frame): 238 238 """A frame for a list of pending (reported or rejected) flights. 239 239 … … 273 273 self._pirepEditable = pirepEditable 274 274 275 alignment = gtk.Alignment(xscale = 1.0, yscale = 1.0)275 alignment = Gtk.Alignment(xscale = 1.0, yscale = 1.0) 276 276 alignment.set_padding(padding_top = 2, padding_bottom = 8, 277 277 padding_left = 4, padding_right = 4) 278 278 279 hbox = gtk.HBox()279 hbox = Gtk.HBox() 280 280 281 281 self._flights = [] … … 289 289 hbox.pack_start(self._flightList, True, True, 4) 290 290 291 buttonBox = gtk.VBox()292 293 self._editButton = gtk.Button(xstr("pendflt_" +291 buttonBox = Gtk.VBox() 292 293 self._editButton = Gtk.Button(xstr("pendflt_" + 294 294 ("edit" if pirepEditable else 295 295 "view") + "_" + which)) … … 299 299 buttonBox.pack_start(self._editButton, False, False, 2) 300 300 301 self._reflyButton = gtk.Button(xstr("pendflt_refly_" + which))301 self._reflyButton = Gtk.Button(xstr("pendflt_refly_" + which)) 302 302 self._reflyButton.set_sensitive(False) 303 303 self._reflyButton.set_use_underline(True) … … 305 305 buttonBox.pack_start(self._reflyButton, False, False, 2) 306 306 307 self._deleteButton = gtk.Button(xstr("pendflt_delete_" + which))307 self._deleteButton = Gtk.Button(xstr("pendflt_delete_" + which)) 308 308 self._deleteButton.set_sensitive(False) 309 309 self._deleteButton.set_use_underline(True) … … 458 458 def _producePopupMenu(self): 459 459 """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() 463 463 menuItem.set_label(xstr("pendflt_" + 464 464 ("edit" if self._pirepEditable else "view") + … … 470 470 menu.append(menuItem) 471 471 472 menuItem = gtk.MenuItem()472 menuItem = Gtk.MenuItem() 473 473 menuItem.set_label(xstr("pendflt_refly_" + self._which)) 474 474 menuItem.set_use_underline(True) … … 478 478 menu.append(menuItem) 479 479 480 menuItem = gtk.MenuItem()480 menuItem = Gtk.MenuItem() 481 481 menuItem.set_label(xstr("pendflt_delete_" + self._which)) 482 482 menuItem.set_use_underline(True) … … 503 503 #----------------------------------------------------------------------------- 504 504 505 class PendingFlightsWindow( gtk.Window):505 class PendingFlightsWindow(Gtk.Window): 506 506 """The window to display the lists of the pending (reported or rejected) 507 507 flights.""" … … 517 517 self.set_modal(True) 518 518 519 mainAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,519 mainAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 520 520 xscale = 1.0, yscale = 1.0) 521 521 mainAlignment.set_padding(padding_top = 0, padding_bottom = 12, 522 522 padding_left = 8, padding_right = 8) 523 523 524 vbox = gtk.VBox()524 vbox = Gtk.VBox() 525 525 526 526 self._reportedFrame = PendingFlightsFrame("reported", wizard, self, … … 531 531 vbox.pack_start(self._rejectedFrame, True, True, 2) 532 532 533 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,533 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 534 534 xscale = 0.0, yscale = 0.0) 535 self._closeButton = gtk.Button(xstr("button_ok"))535 self._closeButton = Gtk.Button(xstr("button_ok")) 536 536 self._closeButton.connect("clicked", self._closeClicked) 537 537 self._closeButton.set_use_underline(True) … … 586 586 #----------------------------------------------------------------------------- 587 587 588 class AcceptedFlightsWindow( gtk.Window):588 class AcceptedFlightsWindow(Gtk.Window): 589 589 """A window for a list of accepted flights.""" 590 590 def getFlightDuration(flightTimeStart, flight): … … 638 638 self.set_transient_for(gui.mainWindow) 639 639 640 alignment = gtk.Alignment(xscale = 1.0, yscale = 1.0)640 alignment = Gtk.Alignment(xscale = 1.0, yscale = 1.0) 641 641 alignment.set_padding(padding_top = 2, padding_bottom = 8, 642 642 padding_left = 4, padding_right = 4) 643 643 644 vbox = gtk.VBox()645 646 hbox = gtk.HBox()644 vbox = Gtk.VBox() 645 646 hbox = Gtk.HBox() 647 647 vbox.pack_start(hbox, True, True, 4) 648 648 … … 657 657 hbox.pack_start(self._flightList, True, True, 4) 658 658 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")) 662 662 self._refreshButton.set_sensitive(True) 663 663 self._refreshButton.set_use_underline(True) … … 665 665 buttonBox.pack_start(self._refreshButton, False, False, 2) 666 666 667 filler = gtk.Alignment(xalign = 0.0, yalign = 0.0,667 filler = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 668 668 xscale = 1.0, yscale = 1.0) 669 669 filler.set_size_request(-1, 4) 670 670 buttonBox.pack_start(filler, False, False, 0) 671 671 672 self._viewButton = gtk.Button(xstr("acceptedflt_view"))672 self._viewButton = Gtk.Button(xstr("acceptedflt_view")) 673 673 self._viewButton.set_sensitive(False) 674 674 self._viewButton.set_use_underline(True) … … 678 678 hbox.pack_start(buttonBox, False, False, 4) 679 679 680 buttonAlignment = gtk.Alignment(xscale = 0.0, yscale = 0.0,680 buttonAlignment = Gtk.Alignment(xscale = 0.0, yscale = 0.0, 681 681 xalign = 0.5, yalign = 0.5) 682 682 683 self._closeButton = gtk.Button(xstr("button_ok"))683 self._closeButton = Gtk.Button(xstr("button_ok")) 684 684 self._closeButton.connect("clicked", self._closeClicked) 685 685 self._closeButton.set_use_underline(True) -
src/mlx/gui/gates.py
r994 r996 19 19 #------------------------------------------------------------------------------- 20 20 21 class FleetGateStatus( gtk.VBox):21 class FleetGateStatus(Gtk.VBox): 22 22 """The tab to display the fleet and gate status.""" 23 23 def __init__(self, gui): … … 27 27 self._gui = gui 28 28 29 mainAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,29 mainAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 30 30 xscale = 1.0, yscale = 1.0) 31 31 mainAlignment.set_padding(padding_top = 4, padding_bottom = 4, … … 33 33 self.add(mainAlignment) 34 34 35 self._mainBox = mainBox = gtk.VBox()35 self._mainBox = mainBox = Gtk.VBox() 36 36 mainAlignment.add(mainBox) 37 37 38 self._statusBox = statusBox = gtk.HBox()38 self._statusBox = statusBox = Gtk.HBox() 39 39 mainBox.pack_start(statusBox, True, True, 4) 40 40 41 fleetFrame = gtk.Frame(label = xstr("gates_fleet_title"))41 fleetFrame = Gtk.Frame(label = xstr("gates_fleet_title")) 42 42 fleetLabel = fleetFrame.get_label_widget() 43 43 fleetLabel.set_use_underline(True) 44 44 statusBox.pack_start(fleetFrame, False, False, 4) 45 45 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) 48 48 self._fleetList.set_tooltip_markup(xstr("gates_planes_tooltip")) 49 49 fleetLabel.set_mnemonic_widget(self._fleetList) 50 column = gtk.TreeViewColumn(xstr("gates_tailno"), gtk.CellRendererText(),50 column = Gtk.TreeViewColumn(xstr("gates_tailno"), Gtk.CellRendererText(), 51 51 text = 0) 52 52 column.set_expand(True) … … 54 54 self._fleetList.append_column(column) 55 55 56 column = gtk.TreeViewColumn(xstr("gates_planestatus"), gtk.CellRendererText(),56 column = Gtk.TreeViewColumn(xstr("gates_planestatus"), Gtk.CellRendererText(), 57 57 markup = 1) 58 58 column.set_expand(True) … … 60 60 self._fleetList.append_column(column) 61 61 62 scrolledWindow = gtk.ScrolledWindow()62 scrolledWindow = Gtk.ScrolledWindow() 63 63 scrolledWindow.add(self._fleetList) 64 64 scrolledWindow.set_size_request(200, -1) 65 65 # 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) 69 69 70 70 71 71 self._fleetAlignment = alignment = \ 72 gtk.Alignment(xalign = 0.5, yalign = 0.0,72 Gtk.Alignment(xalign = 0.5, yalign = 0.0, 73 73 xscale = 0.0, yscale = 1.0) 74 74 alignment.set_padding(padding_top = 4, padding_bottom = 4, … … 77 77 fleetFrame.add(alignment) 78 78 79 self._gatesFrame = gatesFrame = gtk.Frame(label = xstr("gates_gates_title"))79 self._gatesFrame = gatesFrame = Gtk.Frame(label = xstr("gates_gates_title")) 80 80 statusBox.pack_start(gatesFrame, True, True, 4) 81 81 82 self._gatesTable = table = gtk.Table(lhbpGates.numRows,82 self._gatesTable = table = Gtk.Table(lhbpGates.numRows, 83 83 lhbpGates.numColumns) 84 84 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, 86 86 xscale = 1.0, yscale = 1.0) 87 87 alignment.set_padding(padding_top = 4, padding_bottom = 4, … … 97 97 gate = data 98 98 99 label = gtk.Label()99 label = Gtk.Label() 100 100 label.set_markup("<b>" + gate.number + "</b>") 101 101 table.attach(label, column, column + 1, row, row + 1) … … 109 109 column += 1 110 110 111 button = gtk.Button(xstr("gates_refresh"))111 button = Gtk.Button(xstr("gates_refresh")) 112 112 button.set_use_underline(True) 113 113 button.set_tooltip_text(xstr("gates_refresh_tooltip")) 114 114 button.connect("clicked", self._refreshClicked) 115 115 116 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,116 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 117 117 xscale = 0.0, yscale = 0.0) 118 118 alignment.add(button) … … 162 162 self._fleetStore.append([tailNumber, status]) 163 163 # 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) 165 165 166 166 occupiedGateNumbers = fleet.getOccupiedGateNumbers() -
src/mlx/gui/gui.py
r995 r996 108 108 """Build the GUI.""" 109 109 110 self._mainWindow = window = gtk.Window()110 self._mainWindow = window = Gtk.Window() 111 111 if os.name!="nt": 112 112 window.set_visual(window.get_screen().lookup_visual(0x21)) … … 118 118 if os.name=="nt": 119 119 window.connect("leave-notify-event", self._handleLeaveNotify) 120 accelGroup = gtk.AccelGroup()120 accelGroup = Gtk.AccelGroup() 121 121 window.add_accel_group(accelGroup) 122 122 window.realize() 123 123 124 mainVBox = gtk.VBox()124 mainVBox = Gtk.VBox() 125 125 window.add(mainVBox) 126 126 … … 137 137 mainVBox.pack_start(menuBar, False, False, 0) 138 138 139 self._notebook = gtk.Notebook()139 self._notebook = Gtk.Notebook() 140 140 mainVBox.pack_start(self._notebook, True, True, 4) 141 141 142 142 self._wizard = Wizard(self) 143 label = gtk.Label(xstr("tab_flight"))143 label = Gtk.Label(xstr("tab_flight")) 144 144 label.set_use_underline(True) 145 145 label.set_tooltip_text(xstr("tab_flight_tooltip")) … … 147 147 148 148 self._flightInfo = FlightInfo(self) 149 label = gtk.Label(xstr("tab_flight_info"))149 label = Gtk.Label(xstr("tab_flight_info")) 150 150 label.set_use_underline(True) 151 151 label.set_tooltip_text(xstr("tab_flight_info_tooltip")) … … 154 154 155 155 self._weightHelp = WeightHelp(self) 156 label = gtk.Label(xstr("tab_weight_help"))156 label = Gtk.Label(xstr("tab_weight_help")) 157 157 label.set_use_underline(True) 158 158 label.set_tooltip_text(xstr("tab_weight_help_tooltip")) … … 161 161 (logWidget, self._logView) = self._buildLogWidget() 162 162 addFaultTag(self._logView.get_buffer()) 163 label = gtk.Label(xstr("tab_log"))163 label = Gtk.Label(xstr("tab_log")) 164 164 label.set_use_underline(True) 165 165 label.set_tooltip_text(xstr("tab_log_tooltip")) … … 167 167 168 168 self._fleetGateStatus = FleetGateStatus(self) 169 label = gtk.Label(xstr("tab_gates"))169 label = Gtk.Label(xstr("tab_gates")) 170 170 label.set_use_underline(True) 171 171 label.set_tooltip_text(xstr("tab_gates_tooltip")) … … 173 173 174 174 self._acars = ACARS(self) 175 label = gtk.Label("ACARS")175 label = Gtk.Label("ACARS") 176 176 label.set_use_underline(True) 177 177 self._notebook.append_page(self._acars, label) … … 180 180 self._debugLogWidget.show_all() 181 181 182 mainVBox.pack_start( gtk.HSeparator(), False, False, 0)182 mainVBox.pack_start(Gtk.HSeparator(), False, False, 0) 183 183 184 184 self._statusbar = Statusbar(iconDirectory) … … 447 447 """Get the background colour of the main window.""" 448 448 return self._mainWindow.get_style_context().\ 449 get_background_color( gtk.StateFlags.NORMAL)449 get_background_color(Gtk.StateFlags.NORMAL) 450 450 451 451 def run(self): … … 461 461 462 462 singleton.raiseCallback = self.raiseCallback 463 gtk.main()463 Gtk.main() 464 464 singleton.raiseCallback = None 465 465 … … 501 501 self._statusbar.updateConnection(self._connecting, self._connected) 502 502 503 dialog = gtk.MessageDialog(parent = self._mainWindow,503 dialog = Gtk.MessageDialog(parent = self._mainWindow, 504 504 type = MESSAGETYPE_ERROR, 505 505 message_format = xstr("conn_failed")) … … 533 533 self._statusbar.updateConnection(self._connecting, self._connected) 534 534 535 dialog = gtk.MessageDialog(type = MESSAGETYPE_ERROR,535 dialog = Gtk.MessageDialog(type = MESSAGETYPE_ERROR, 536 536 message_format = xstr("conn_broken"), 537 537 parent = self._mainWindow) … … 591 591 def cancelFlight(self): 592 592 """Cancel the current file, if the user confirms it.""" 593 dialog = gtk.MessageDialog(parent = self._mainWindow,593 dialog = Gtk.MessageDialog(parent = self._mainWindow, 594 594 type = MESSAGETYPE_QUESTION, 595 595 message_format = xstr("cancelFlight_question")) … … 930 930 self._fleet = None 931 931 932 dialog = gtk.MessageDialog(parent = self.mainWindow,932 dialog = Gtk.MessageDialog(parent = self.mainWindow, 933 933 type = MESSAGETYPE_ERROR, 934 934 message_format = xstr("fleet_failed")) … … 975 975 self._fleetGateStatus.handleFleet(self._fleet) 976 976 else: 977 dialog = gtk.MessageDialog(parent = self.mainWindow,977 dialog = Gtk.MessageDialog(parent = self.mainWindow, 978 978 type = MESSAGETYPE_ERROR, 979 979 message_format = xstr("fleet_update_failed")) … … 1065 1065 def _buildMenuBar(self, accelGroup): 1066 1066 """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() 1071 1071 fileMenuItem.set_submenu(fileMenu) 1072 1072 menuBar.append(fileMenuItem) 1073 1073 1074 loadPIREPMenuItem = gtk.ImageMenuItem(gtk.STOCK_OPEN)1074 loadPIREPMenuItem = Gtk.ImageMenuItem(Gtk.STOCK_OPEN) 1075 1075 loadPIREPMenuItem.set_use_stock(True) 1076 1076 loadPIREPMenuItem.set_label(xstr("menu_file_loadPIREP")) … … 1081 1081 fileMenu.append(loadPIREPMenuItem) 1082 1082 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) 1086 1086 quitMenuItem.set_use_stock(True) 1087 1087 quitMenuItem.set_label(xstr("menu_file_quit")) … … 1092 1092 fileMenu.append(quitMenuItem) 1093 1093 1094 toolsMenuItem = gtk.MenuItem(xstr("menu_tools"))1095 toolsMenu = gtk.Menu()1094 toolsMenuItem = Gtk.MenuItem(xstr("menu_tools")) 1095 toolsMenu = Gtk.Menu() 1096 1096 toolsMenuItem.set_submenu(toolsMenu) 1097 1097 menuBar.append(toolsMenuItem) 1098 1098 1099 1099 self._timetableMenuItem = timetableMenuItem = \ 1100 gtk.ImageMenuItem(gtk.STOCK_INDENT)1100 Gtk.ImageMenuItem(Gtk.STOCK_INDENT) 1101 1101 timetableMenuItem.set_use_stock(True) 1102 1102 timetableMenuItem.set_label(xstr("menu_tools_timetable")) … … 1109 1109 1110 1110 self._flightsMenuItem = flightsMenuItem = \ 1111 gtk.ImageMenuItem(gtk.STOCK_SPELL_CHECK)1111 Gtk.ImageMenuItem(Gtk.STOCK_SPELL_CHECK) 1112 1112 flightsMenuItem.set_use_stock(True) 1113 1113 flightsMenuItem.set_label(xstr("menu_tools_flights")) … … 1119 1119 toolsMenu.append(flightsMenuItem) 1120 1120 1121 checklistMenuItem = gtk.ImageMenuItem(gtk.STOCK_APPLY)1121 checklistMenuItem = Gtk.ImageMenuItem(Gtk.STOCK_APPLY) 1122 1122 checklistMenuItem.set_use_stock(True) 1123 1123 checklistMenuItem.set_label(xstr("menu_tools_chklst")) … … 1128 1128 toolsMenu.append(checklistMenuItem) 1129 1129 1130 approachCalloutsMenuItem = gtk.ImageMenuItem(gtk.STOCK_EDIT)1130 approachCalloutsMenuItem = Gtk.ImageMenuItem(Gtk.STOCK_EDIT) 1131 1131 approachCalloutsMenuItem.set_use_stock(True) 1132 1132 approachCalloutsMenuItem.set_label(xstr("menu_tools_callouts")) … … 1137 1137 toolsMenu.append(approachCalloutsMenuItem) 1138 1138 1139 prefsMenuItem = gtk.ImageMenuItem(gtk.STOCK_PREFERENCES)1139 prefsMenuItem = Gtk.ImageMenuItem(Gtk.STOCK_PREFERENCES) 1140 1140 prefsMenuItem.set_use_stock(True) 1141 1141 prefsMenuItem.set_label(xstr("menu_tools_prefs")) … … 1146 1146 toolsMenu.append(prefsMenuItem) 1147 1147 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) 1151 1151 bugReportMenuItem.set_use_stock(True) 1152 1152 bugReportMenuItem.set_label(xstr("menu_tools_bugreport")) … … 1157 1157 toolsMenu.append(bugReportMenuItem) 1158 1158 1159 viewMenuItem = gtk.MenuItem(xstr("menu_view"))1160 viewMenu = gtk.Menu()1159 viewMenuItem = Gtk.MenuItem(xstr("menu_view")) 1160 viewMenu = Gtk.Menu() 1161 1161 viewMenuItem.set_submenu(viewMenu) 1162 1162 menuBar.append(viewMenuItem) 1163 1163 1164 self._showMonitorMenuItem = gtk.CheckMenuItem()1164 self._showMonitorMenuItem = Gtk.CheckMenuItem() 1165 1165 self._showMonitorMenuItem.set_label(xstr("menu_view_monitor")) 1166 1166 self._showMonitorMenuItem.set_use_underline(True) … … 1172 1172 viewMenu.append(self._showMonitorMenuItem) 1173 1173 1174 showDebugMenuItem = gtk.CheckMenuItem()1174 showDebugMenuItem = Gtk.CheckMenuItem() 1175 1175 showDebugMenuItem.set_label(xstr("menu_view_debug")) 1176 1176 showDebugMenuItem.set_use_underline(True) … … 1182 1182 viewMenu.append(showDebugMenuItem) 1183 1183 1184 helpMenuItem = gtk.MenuItem(xstr("menu_help"))1185 helpMenu = gtk.Menu()1184 helpMenuItem = Gtk.MenuItem(xstr("menu_help")) 1185 helpMenu = Gtk.Menu() 1186 1186 helpMenuItem.set_submenu(helpMenu) 1187 1187 menuBar.append(helpMenuItem) 1188 1188 1189 manualMenuItem = gtk.ImageMenuItem(gtk.STOCK_HELP)1189 manualMenuItem = Gtk.ImageMenuItem(Gtk.STOCK_HELP) 1190 1190 manualMenuItem.set_use_stock(True) 1191 1191 manualMenuItem.set_label(xstr("menu_help_manual")) … … 1196 1196 helpMenu.append(manualMenuItem) 1197 1197 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) 1201 1201 aboutMenuItem.set_use_stock(True) 1202 1202 aboutMenuItem.set_label(xstr("menu_help_about")) … … 1212 1212 """Toggle the debug log.""" 1213 1213 if menuItem.get_active(): 1214 label = gtk.Label(xstr("tab_debug_log"))1214 label = Gtk.Label(xstr("tab_debug_log")) 1215 1215 label.set_use_underline(True) 1216 1216 label.set_tooltip_text(xstr("tab_debug_log_tooltip")) … … 1222 1222 def _buildLogWidget(self): 1223 1223 """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) 1225 1225 1226 1226 alignment.set_padding(padding_top = 8, padding_bottom = 8, 1227 1227 padding_left = 16, padding_right = 16) 1228 1228 1229 logScroller = gtk.ScrolledWindow()1229 logScroller = Gtk.ScrolledWindow() 1230 1230 # 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() 1235 1235 logView.set_editable(False) 1236 1236 logView.set_cursor_visible(False) 1237 1237 logScroller.add(logView) 1238 1238 1239 logBox = gtk.VBox()1239 logBox = Gtk.VBox() 1240 1240 logBox.pack_start(logScroller, True, True, 0) 1241 1241 logBox.set_size_request(-1, 200) … … 1256 1256 result=RESPONSETYPE_YES 1257 1257 else: 1258 dialog = gtk.MessageDialog(parent = self._mainWindow,1258 dialog = Gtk.MessageDialog(parent = self._mainWindow, 1259 1259 type = MESSAGETYPE_QUESTION, 1260 1260 message_format = xstr("quit_question")) … … 1269 1269 if result==RESPONSETYPE_YES: 1270 1270 self._statusIcon.destroy() 1271 return gtk.main_quit()1271 return Gtk.main_quit() 1272 1272 1273 1273 def _notebookPageSwitch(self, notebook, page, page_num): … … 1323 1323 self._timetableWindow.show_all() 1324 1324 else: 1325 dialog = gtk.MessageDialog(parent = self.mainWindow,1325 dialog = Gtk.MessageDialog(parent = self.mainWindow, 1326 1326 type = MESSAGETYPE_ERROR, 1327 1327 message_format = xstr("timetable_failed")) … … 1353 1353 self._flightsWindow.show_all() 1354 1354 else: 1355 dialog = gtk.MessageDialog(parent = self.mainWindow,1355 dialog = Gtk.MessageDialog(parent = self.mainWindow, 1356 1356 type = MESSAGETYPE_ERROR, 1357 1357 message_format = xstr("acceptedflt_failed")) … … 1452 1452 1453 1453 if type is not None: 1454 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,1454 dialog = Gtk.MessageDialog(parent = self._wizard.gui.mainWindow, 1455 1455 type = type, message_format = messageFormat) 1456 1456 dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK) … … 1483 1483 pirep = PIREP.load(self._lastLoadedPIREP) 1484 1484 if pirep is None: 1485 dialog = gtk.MessageDialog(parent = self._mainWindow,1485 dialog = Gtk.MessageDialog(parent = self._mainWindow, 1486 1486 type = MESSAGETYPE_ERROR, 1487 1487 message_format = xstr("loadPIREP_failed")) … … 1511 1511 If it is not created yet, it will be created.""" 1512 1512 if self._loadPIREPDialog is None: 1513 dialog = gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +1513 dialog = Gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " + 1514 1514 xstr("loadPIREP_browser_title"), 1515 1515 action = FILE_CHOOSER_ACTION_OPEN, 1516 buttons = ( gtk.STOCK_CANCEL,1516 buttons = (Gtk.STOCK_CANCEL, 1517 1517 RESPONSETYPE_CANCEL, 1518 gtk.STOCK_OK, RESPONSETYPE_OK),1518 Gtk.STOCK_OK, RESPONSETYPE_OK), 1519 1519 parent = self._mainWindow) 1520 1520 dialog.set_modal(True) 1521 1521 1522 1522 1523 filter = gtk.FileFilter()1523 filter = Gtk.FileFilter() 1524 1524 filter.set_name(xstr("file_filter_pireps")) 1525 1525 filter.add_pattern("*.pirep") 1526 1526 dialog.add_filter(filter) 1527 1527 1528 filter = gtk.FileFilter()1528 filter = Gtk.FileFilter() 1529 1529 filter.set_name(xstr("file_filter_all")) 1530 1530 filter.add_pattern("*.*") … … 1538 1538 """Get a dialog displaying the main information of the flight from the 1539 1539 PIREP and providing Cancel and Send buttons.""" 1540 dialog = gtk.Dialog(title = WINDOW_TITLE_BASE + " - " +1540 dialog = Gtk.Dialog(title = WINDOW_TITLE_BASE + " - " + 1541 1541 xstr("loadPIREP_send_title"), 1542 1542 parent = self._mainWindow, … … 1545 1545 contentArea = dialog.get_content_area() 1546 1546 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, 1549 1549 xscale = 0.0, yscale = 0.0) 1550 1550 alignment.set_padding(padding_top = 16, padding_bottom = 0, … … 1553 1553 contentArea.pack_start(alignment, False, False, 8) 1554 1554 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, 1557 1557 xscale = 0.0, yscale = 0.0) 1558 1558 tableAlignment.set_padding(padding_top = 0, padding_bottom = 32, … … 1565 1565 bookedFlight = pirep.bookedFlight 1566 1566 1567 label = gtk.Label("<b>" + xstr("loadPIREP_send_flightno") + "</b>")1567 label = Gtk.Label("<b>" + xstr("loadPIREP_send_flightno") + "</b>") 1568 1568 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, 1570 1570 xscale = 0.0, yscale = 0.0) 1571 1571 labelAlignment.add(label) 1572 1572 table.attach(labelAlignment, 0, 1, 0, 1) 1573 1573 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, 1576 1576 xscale = 0.0, yscale = 0.0) 1577 1577 labelAlignment.add(label) 1578 1578 table.attach(labelAlignment, 1, 2, 0, 1) 1579 1579 1580 label = gtk.Label("<b>" + xstr("loadPIREP_send_date") + "</b>")1580 label = Gtk.Label("<b>" + xstr("loadPIREP_send_date") + "</b>") 1581 1581 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, 1583 1583 xscale = 0.0, yscale = 0.0) 1584 1584 labelAlignment.add(label) 1585 1585 table.attach(labelAlignment, 0, 1, 1, 2) 1586 1586 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, 1589 1589 xscale = 0.0, yscale = 0.0) 1590 1590 labelAlignment.add(label) 1591 1591 table.attach(labelAlignment, 1, 2, 1, 2) 1592 1592 1593 label = gtk.Label("<b>" + xstr("loadPIREP_send_from") + "</b>")1593 label = Gtk.Label("<b>" + xstr("loadPIREP_send_from") + "</b>") 1594 1594 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, 1596 1596 xscale = 0.0, yscale = 0.0) 1597 1597 labelAlignment.add(label) 1598 1598 table.attach(labelAlignment, 0, 1, 2, 3) 1599 1599 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, 1602 1602 xscale = 0.0, yscale = 0.0) 1603 1603 labelAlignment.add(label) 1604 1604 table.attach(labelAlignment, 1, 2, 2, 3) 1605 1605 1606 label = gtk.Label("<b>" + xstr("loadPIREP_send_to") + "</b>")1606 label = Gtk.Label("<b>" + xstr("loadPIREP_send_to") + "</b>") 1607 1607 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, 1609 1609 xscale = 0.0, yscale = 0.0) 1610 1610 labelAlignment.add(label) 1611 1611 table.attach(labelAlignment, 0, 1, 3, 4) 1612 1612 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, 1615 1615 xscale = 0.0, yscale = 0.0) 1616 1616 labelAlignment.add(label) 1617 1617 table.attach(labelAlignment, 1, 2, 3, 4) 1618 1618 1619 label = gtk.Label("<b>" + xstr("loadPIREP_send_rating") + "</b>")1619 label = Gtk.Label("<b>" + xstr("loadPIREP_send_rating") + "</b>") 1620 1620 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, 1622 1622 xscale = 0.0, yscale = 0.0) 1623 1623 labelAlignment.add(label) … … 1625 1625 1626 1626 rating = pirep.rating 1627 label = gtk.Label()1627 label = Gtk.Label() 1628 1628 if rating<0: 1629 1629 label.set_markup('<b><span foreground="red">NO GO</span></b>') … … 1631 1631 label.set_text("%.1f %%" % (rating,)) 1632 1632 1633 labelAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.5,1633 labelAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.5, 1634 1634 xscale = 0.0, yscale = 0.0) 1635 1635 labelAlignment.add(label) … … 1675 1675 secondaryMarkup = xstr("sendPIREP_failed_sec") 1676 1676 1677 dialog = gtk.MessageDialog(parent = self._wizard.gui.mainWindow,1677 dialog = Gtk.MessageDialog(parent = self._wizard.gui.mainWindow, 1678 1678 type = type, message_format = messageFormat) 1679 1679 dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK) … … 1736 1736 secondaryMarkup = xstr("sendBugReport_error_sec") 1737 1737 1738 dialog = gtk.MessageDialog(parent = self._wizard.gui._bugReportDialog,1738 dialog = Gtk.MessageDialog(parent = self._wizard.gui._bugReportDialog, 1739 1739 type = type, message_format = messageFormat) 1740 1740 dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK) … … 1810 1810 If it does not exist yet, it will be created.""" 1811 1811 if self._aboutDialog is None: 1812 dialog = gtk.AboutDialog()1812 dialog = Gtk.AboutDialog() 1813 1813 dialog.set_transient_for(self._mainWindow) 1814 1814 dialog.set_modal(True) … … 1914 1914 1915 1915 if not self.config.pilotID and not self.config.password: 1916 dialog = gtk.MessageDialog(parent = self._mainWindow,1916 dialog = Gtk.MessageDialog(parent = self._mainWindow, 1917 1917 type = MESSAGETYPE_QUESTION, 1918 1918 message_format = xstr("register_ask")) -
src/mlx/gui/info.py
r954 r996 21 21 #------------------------------------------------------------------------------ 22 22 23 class FlightInfo( gtk.VBox):23 class FlightInfo(Gtk.VBox): 24 24 """The flight info tab.""" 25 25 @staticmethod … … 31 31 - the comment text editor.""" 32 32 33 frame = gtk.Frame(label = label)33 frame = Gtk.Frame(label = label) 34 34 label = frame.get_label_widget() 35 35 label.set_use_underline(True) 36 36 37 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,37 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 38 38 xscale = 1.0, yscale = 1.0) 39 39 alignment.set_padding(padding_top = 4, padding_bottom = 4, 40 40 padding_left = 8, padding_right = 8) 41 41 42 scroller = gtk.ScrolledWindow()42 scroller = Gtk.ScrolledWindow() 43 43 scroller.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC) 44 44 scroller.set_shadow_type(SHADOW_IN) 45 45 46 comments = gtk.TextView()46 comments = Gtk.TextView() 47 47 comments.set_wrap_mode(WRAP_WORD) 48 48 scroller.add(comments) … … 60 60 self._callbackObject = callbackObject 61 61 62 self._commentsAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,62 self._commentsAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 63 63 xscale = 1.0, yscale = 1.0) 64 commentsBox = gtk.HBox()64 commentsBox = Gtk.HBox() 65 65 commentsBox.set_homogeneous(True) 66 66 … … 77 77 self.pack_start(self._commentsAlignment, True, True, 8) 78 78 79 frame = gtk.Frame(label = xstr("info_delay"))79 frame = Gtk.Frame(label = xstr("info_delay")) 80 80 label = frame.get_label_widget() 81 81 label.set_use_underline(True) 82 82 83 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,83 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 84 84 xscale = 1.0, yscale = 1.0) 85 85 alignment.set_padding(padding_top = 4, padding_bottom = 4, … … 87 87 88 88 self._delayCodeTable = table = DelayCodeTable(self) 89 self._delayWindow = scrolledWindow = gtk.ScrolledWindow()89 self._delayWindow = scrolledWindow = Gtk.ScrolledWindow() 90 90 scrolledWindow.add(table) 91 91 scrolledWindow.set_size_request(-1, 185) … … 96 96 frame.add(alignment) 97 97 98 self._delayAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,98 self._delayAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 99 99 xscale = 1.0, yscale = 1.0) 100 100 self._delayAlignment.add(frame) -
src/mlx/gui/monitor.py
r765 r996 18 18 #------------------------------------------------------------------------------ 19 19 20 class MonitorWindow( gtk.Window):20 class MonitorWindow(Gtk.Window): 21 21 """The window for the data monitor.""" 22 22 def __init__(self, gui, iconDirectory): … … 32 32 lambda a, b: self._gui.hideMonitorWindow()) 33 33 34 alignment = gtk.Alignment(xscale = 1.0, yscale = 1.0)34 alignment = Gtk.Alignment(xscale = 1.0, yscale = 1.0) 35 35 36 36 alignment.set_padding(padding_top = 4, padding_bottom = 10, 37 37 padding_left = 16, padding_right = 16) 38 38 39 table = gtk.Table(rows = 9, columns = 14)39 table = Gtk.Table(rows = 9, columns = 14) 40 40 table.set_homogeneous(False) 41 41 table.set_row_spacings(4) … … 46 46 table.attach(self._timestamp, 1, 2, 0, 1) 47 47 48 self._paused = gtk.Label("PAUSED")48 self._paused = Gtk.Label("PAUSED") 49 49 table.attach(self._paused, 2, 4, 0, 1) 50 50 51 self._trickMode = gtk.Label("TRICKMODE")51 self._trickMode = Gtk.Label("TRICKMODE") 52 52 table.attach(self._trickMode, 4, 6, 0, 1, xoptions = 0) 53 53 54 self._overspeed = gtk.Label("OVERSPEED")54 self._overspeed = Gtk.Label("OVERSPEED") 55 55 table.attach(self._overspeed, 6, 8, 0, 1) 56 56 57 self._stalled = gtk.Label("STALLED")57 self._stalled = Gtk.Label("STALLED") 58 58 table.attach(self._stalled, 8, 10, 0, 1) 59 59 60 self._onTheGround = gtk.Label("ONTHEGROUND")60 self._onTheGround = Gtk.Label("ONTHEGROUND") 61 61 table.attach(self._onTheGround, 10, 11, 0, 1) 62 62 63 self._antiIceOn = gtk.Label("ANTI-ICE")63 self._antiIceOn = Gtk.Label("ANTI-ICE") 64 64 table.attach(self._antiIceOn, 11, 12, 0, 1) 65 65 … … 148 148 table.attach(self._reverser, 9, 12, 4, 5) 149 149 150 self._navLightsOn = gtk.Label("NAV")150 self._navLightsOn = Gtk.Label("NAV") 151 151 table.attach(self._navLightsOn, 0, 1, 5, 6) 152 152 153 self._antiCollisionLightsOn = gtk.Label("ANTICOLLISION")153 self._antiCollisionLightsOn = Gtk.Label("ANTICOLLISION") 154 154 table.attach(self._antiCollisionLightsOn, 1, 2, 5, 6) 155 155 156 self._strobeLightsOn = gtk.Label("STROBE")156 self._strobeLightsOn = Gtk.Label("STROBE") 157 157 table.attach(self._strobeLightsOn, 2, 3, 5, 6) 158 158 159 self._landingLightsOn = gtk.Label("LANDING")159 self._landingLightsOn = Gtk.Label("LANDING") 160 160 table.attach(self._landingLightsOn, 3, 4, 5, 6) 161 161 162 self._pitotHeatOn = gtk.Label("PITOT HEAT")162 self._pitotHeatOn = Gtk.Label("PITOT HEAT") 163 163 table.attach(self._pitotHeatOn, 4, 5, 5, 6) 164 164 165 self._parking = gtk.Label("PARKING")165 self._parking = Gtk.Label("PARKING") 166 166 table.attach(self._parking, 5, 6, 5, 6) 167 167 168 self._gearControlDown = gtk.Label("GEAR LEVER DOWN")168 self._gearControlDown = Gtk.Label("GEAR LEVER DOWN") 169 169 table.attach(self._gearControlDown, 6, 8, 5, 6) 170 170 171 self._gearsDown = gtk.Label("GEARS DOWN")171 self._gearsDown = Gtk.Label("GEARS DOWN") 172 172 table.attach(self._gearsDown, 8, 10, 5, 6) 173 173 174 self._spoilersArmed = gtk.Label("SPOILERS ARMED")174 self._spoilersArmed = Gtk.Label("SPOILERS ARMED") 175 175 table.attach(self._spoilersArmed, 10, 12, 5, 6) 176 176 … … 195 195 table.attach(self._elevatorTrim, 11, 12, 6, 7) 196 196 197 self._apMaster = gtk.Label("AP MASTER")197 self._apMaster = Gtk.Label("AP MASTER") 198 198 table.attach(self._apMaster, 0, 1, 7, 8) 199 199 200 self._apHeadingHold = gtk.Label("AP HDG HOLD")200 self._apHeadingHold = Gtk.Label("AP HDG HOLD") 201 201 table.attach(self._apHeadingHold, 1, 2, 7, 8) 202 202 … … 205 205 table.attach(self._apHeading, 3, 4, 7, 8) 206 206 207 self._xpdrC = gtk.Label("XPDR C")207 self._xpdrC = Gtk.Label("XPDR C") 208 208 table.attach(self._xpdrC, 4, 5, 7, 8) 209 209 210 self._apAltitudeHold = gtk.Label("AP ALT HOLD")210 self._apAltitudeHold = Gtk.Label("AP ALT HOLD") 211 211 table.attach(self._apAltitudeHold, 5, 6, 7, 8) 212 212 … … 262 262 - the entry.""" 263 263 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) 265 265 alignment.set_padding(padding_top = 0, padding_bottom = 0, 266 266 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() 270 270 entry.set_editable(False) 271 271 entry.set_width_chars(width) -
src/mlx/gui/pirep.py
r994 r996 26 26 #------------------------------------------------------------------------------ 27 27 28 class MessageFrame( gtk.Frame):28 class MessageFrame(Gtk.Frame): 29 29 """A frame containing the information about a PIREP message. 30 30 … … 33 33 def __init__(self, message, senderPID, senderName): 34 34 """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() 40 40 heading.set_editable(False) 41 41 heading.set_can_focus(False) … … 49 49 buffer.get_start_iter(), buffer.get_end_iter()) 50 50 51 headingAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,51 headingAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 52 52 xscale = 1.0, yscale = 0.0) 53 53 headingAlignment.set_padding(padding_top = 0, padding_bottom = 0, … … 56 56 vbox.pack_start(headingAlignment, True, True, 4) 57 57 58 self._messageView = messageView = gtk.TextView()58 self._messageView = messageView = Gtk.TextView() 59 59 messageView.set_wrap_mode(WRAP_WORD) 60 60 messageView.set_editable(False) … … 72 72 73 73 styleContext = self.get_style_context() 74 color = styleContext.get_background_color( gtk.StateFlags.NORMAL)74 color = styleContext.get_background_color(Gtk.StateFlags.NORMAL) 75 75 heading.override_background_color(0, color) 76 76 … … 78 78 #------------------------------------------------------------------------------- 79 79 80 class MessagesWidget( gtk.Frame):80 class MessagesWidget(Gtk.Frame): 81 81 """The widget for the messages.""" 82 82 @staticmethod … … 86 86 87 87 def __init__(self, gui): 88 gtk.Frame.__init__(self)88 Gtk.Frame.__init__(self) 89 89 90 90 self._gui = gui … … 93 93 label.set_use_underline(True) 94 94 95 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,95 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 96 96 xscale = 1.0, yscale = 1.0) 97 97 alignment.set_padding(padding_top = 4, padding_bottom = 4, 98 98 padding_left = 4, padding_right = 4) 99 99 100 self._outerBox = outerBox = gtk.EventBox()100 self._outerBox = outerBox = Gtk.EventBox() 101 101 outerBox.add(alignment) 102 102 103 self._innerBox = innerBox = gtk.EventBox()103 self._innerBox = innerBox = Gtk.EventBox() 104 104 alignment.add(self._innerBox) 105 105 106 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,106 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 107 107 xscale = 1.0, yscale = 1.0) 108 108 alignment.set_padding(padding_top = 0, padding_bottom = 0, … … 111 111 innerBox.add(alignment) 112 112 113 scroller = gtk.ScrolledWindow()113 scroller = Gtk.ScrolledWindow() 114 114 scroller.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC) 115 115 scroller.set_shadow_type(SHADOW_NONE) 116 116 117 self._messages = gtk.VBox()117 self._messages = Gtk.VBox() 118 118 self._messages.set_homogeneous(False) 119 119 scroller.add_with_viewport(self._messages) … … 129 129 """Add a message from the given sender.""" 130 130 131 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,131 alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 132 132 xscale = 1.0, yscale = 0.0) 133 133 alignment.set_padding(padding_top = 2, padding_bottom = 2, … … 154 154 #------------------------------------------------------------------------------ 155 155 156 class PIREPViewer( gtk.Dialog):156 class PIREPViewer(Gtk.Dialog): 157 157 """The dialog for PIREP viewing.""" 158 158 @staticmethod … … 167 167 - the frame, 168 168 - 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, 172 172 xscale = 1.0, yscale = 1.0) 173 173 frame.add(alignment) 174 174 alignment.set_padding(padding_top = 4, padding_bottom = 4, 175 175 padding_left = 4, padding_right = 4) 176 box = gtk.VBox()176 box = Gtk.VBox() 177 177 alignment.add(box) 178 178 … … 182 182 def getLabel(text, extraText = ""): 183 183 """Get a bold label with the given text.""" 184 label = gtk.Label("<b>" + text + "</b>" + extraText)184 label = Gtk.Label("<b>" + text + "</b>" + extraText) 185 185 label.set_use_markup(True) 186 186 label.set_alignment(0.0, 0.5) … … 190 190 def getDataLabel(width = None, xAlignment = 0.0): 191 191 """Get a bold label with the given text.""" 192 label = gtk.Label()192 label = Gtk.Label() 193 193 if width is not None: 194 194 label.set_width_chars(width) … … 203 203 - the window, 204 204 - the text view.""" 205 scrolledWindow = gtk.ScrolledWindow()205 scrolledWindow = Gtk.ScrolledWindow() 206 206 scrolledWindow.set_shadow_type(SHADOW_IN) 207 207 scrolledWindow.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC) 208 208 209 textView = gtk.TextView()209 textView = Gtk.TextView() 210 210 textView.set_wrap_mode(WRAP_WORD) 211 211 textView.set_editable(editable) … … 226 226 227 227 Returns the data label attached.""" 228 dataBox = gtk.HBox()228 dataBox = Gtk.HBox() 229 229 table.attach(dataBox, column, column+1, row, row+1) 230 230 … … 251 251 def addHFiller(hBox, width = 8): 252 252 """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, 254 254 xscale = 1.0, yscale = 1.0) 255 255 filler.set_size_request(width, -1) … … 259 259 def addVFiller(vBox, height = 4): 260 260 """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, 262 262 xscale = 1.0, yscale = 1.0) 263 263 filler.set_size_request(-1, height) … … 284 284 contentArea = self.get_content_area() 285 285 286 self._notebook = gtk.Notebook()286 self._notebook = Gtk.Notebook() 287 287 contentArea.pack_start(self._notebook, False, False, 4) 288 288 289 289 dataTab = self._buildDataTab() 290 label = gtk.Label(xstr("pirepView_tab_data"))290 label = Gtk.Label(xstr("pirepView_tab_data")) 291 291 label.set_use_underline(True) 292 292 label.set_tooltip_text(xstr("pirepView_tab_data_tooltip")) … … 294 294 295 295 commentsTab = self._buildCommentsTab() 296 label = gtk.Label(xstr("pirepView_tab_comments"))296 label = Gtk.Label(xstr("pirepView_tab_comments")) 297 297 label.set_use_underline(True) 298 298 label.set_tooltip_text(xstr("pirepView_tab_comments_tooltip")) … … 300 300 301 301 logTab = self._buildLogTab() 302 label = gtk.Label(xstr("pirepView_tab_log"))302 label = Gtk.Label(xstr("pirepView_tab_log")) 303 303 label.set_use_underline(True) 304 304 label.set_tooltip_text(xstr("pirepView_tab_log_tooltip")) … … 308 308 if showMessages: 309 309 messagesTab = self._buildMessagesTab() 310 label = gtk.Label(xstr("pirepView_tab_messages"))310 label = Gtk.Label(xstr("pirepView_tab_messages")) 311 311 label.set_use_underline(True) 312 312 label.set_tooltip_text(xstr("pirepView_tab_messages_tooltip")) … … 417 417 def _buildDataTab(self): 418 418 """Build the data tab of the viewer.""" 419 table = gtk.Table(1, 2)419 table = Gtk.Table(1, 2) 420 420 table.set_row_spacings(4) 421 421 table.set_col_spacings(16) 422 422 table.set_homogeneous(True) 423 423 424 box1 = gtk.VBox()424 box1 = Gtk.VBox() 425 425 table.attach(box1, 0, 1, 0, 1) 426 426 427 box2 = gtk.VBox()427 box2 = Gtk.VBox() 428 428 table.attach(box2, 1, 2, 0, 1) 429 429 … … 453 453 (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_flight")) 454 454 455 dataBox = gtk.HBox()455 dataBox = Gtk.HBox() 456 456 mainBox.pack_start(dataBox, False, False, 0) 457 457 … … 468 468 PIREPViewer.addVFiller(mainBox) 469 469 470 dataBox = gtk.HBox()470 dataBox = Gtk.HBox() 471 471 mainBox.pack_start(dataBox, False, False, 0) 472 472 … … 478 478 PIREPViewer.addVFiller(mainBox) 479 479 480 table = gtk.Table(3, 2)480 table = Gtk.Table(3, 2) 481 481 mainBox.pack_start(table, False, False, 0) 482 482 table.set_row_spacings(4) … … 503 503 width = 6) 504 504 505 table = gtk.Table(3, 2)505 table = Gtk.Table(3, 2) 506 506 mainBox.pack_start(table, False, False, 0) 507 507 table.set_row_spacings(4) … … 549 549 (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_route")) 550 550 551 levelBox = gtk.HBox()551 levelBox = Gtk.HBox() 552 552 mainBox.pack_start(levelBox, False, False, 0) 553 553 … … 581 581 PIREPViewer.addVFiller(mainBox) 582 582 583 dataBox = gtk.HBox()583 dataBox = Gtk.HBox() 584 584 mainBox.pack_start(dataBox, False, False, 0) 585 585 … … 608 608 PIREPViewer.addVFiller(mainBox) 609 609 610 table = gtk.Table(2, 2)610 table = Gtk.Table(2, 2) 611 611 mainBox.pack_start(table, False, False, 0) 612 612 table.set_row_spacings(4) … … 639 639 (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_statistics")) 640 640 641 table = gtk.Table(4, 2)641 table = Gtk.Table(4, 2) 642 642 mainBox.pack_start(table, False, False, 0) 643 643 table.set_row_spacings(4) … … 685 685 (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_miscellaneous")) 686 686 687 table = gtk.Table(3, 2)687 table = Gtk.Table(3, 2) 688 688 mainBox.pack_start(table, False, False, 0) 689 689 table.set_row_spacings(4) … … 737 737 def _buildCommentsTab(self): 738 738 """Build the tab with the comments and flight defects.""" 739 table = gtk.Table(2, 1)739 table = Gtk.Table(2, 1) 740 740 table.set_col_spacings(16) 741 741 … … 760 760 def _buildLogTab(self): 761 761 """Build the log tab.""" 762 mainBox = gtk.VBox()762 mainBox = Gtk.VBox() 763 763 764 764 (logWindow, self._log) = PIREPViewer.getTextWindow(heightRequest = -1) … … 770 770 def _buildMessagesTab(self): 771 771 """Build the messages tab.""" 772 mainBox = gtk.VBox()772 mainBox = Gtk.VBox() 773 773 774 774 self._messages = MessagesWidget(self._gui) … … 779 779 #------------------------------------------------------------------------------ 780 780 781 class PIREPEditor( gtk.Dialog):781 class PIREPEditor(Gtk.Dialog): 782 782 """A PIREP editor dialog.""" 783 783 _delayCodeRE = re.compile("([0-9]{2,3})( \([^\)]*\))") … … 789 789 The label will got to cell (column, row), the widget to cell 790 790 (column+1, row).""" 791 label = gtk.Label("<b>" + labelText + "</b>")791 label = Gtk.Label("<b>" + labelText + "</b>") 792 792 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, 794 794 xscale = 0.0, yscale = 0.0) 795 795 alignment.add(label) … … 807 807 The label will got to cell (column, row), the spin button to cell 808 808 (column+1, row).""" 809 button = gtk.SpinButton()809 button = Gtk.SpinButton() 810 810 button.set_range(min = minValue, max = maxValue) 811 811 button.set_increments(step = stepIncrement, page = pageIncrement) … … 847 847 contentArea = self.get_content_area() 848 848 849 self._notebook = gtk.Notebook()849 self._notebook = Gtk.Notebook() 850 850 contentArea.pack_start(self._notebook, False, False, 4) 851 851 852 852 dataTab = self._buildDataTab() 853 label = gtk.Label(xstr("pirepView_tab_data"))853 label = Gtk.Label(xstr("pirepView_tab_data")) 854 854 label.set_use_underline(True) 855 855 label.set_tooltip_text(xstr("pirepView_tab_data_tooltip")) … … 857 857 858 858 self._flightInfo = self._buildCommentsTab() 859 label = gtk.Label(xstr("pirepView_tab_comments"))859 label = Gtk.Label(xstr("pirepView_tab_comments")) 860 860 label.set_use_underline(True) 861 861 label.set_tooltip_text(xstr("pirepView_tab_comments_tooltip")) … … 863 863 864 864 logTab = self._buildLogTab() 865 label = gtk.Label(xstr("pirepView_tab_log"))865 label = Gtk.Label(xstr("pirepView_tab_log")) 866 866 label.set_use_underline(True) 867 867 label.set_tooltip_text(xstr("pirepView_tab_log_tooltip")) … … 1014 1014 def _buildDataTab(self): 1015 1015 """Build the data tab of the viewer.""" 1016 table = gtk.Table(1, 2)1016 table = Gtk.Table(1, 2) 1017 1017 table.set_row_spacings(4) 1018 1018 table.set_col_spacings(16) 1019 1019 table.set_homogeneous(True) 1020 1020 1021 box1 = gtk.VBox()1021 box1 = Gtk.VBox() 1022 1022 table.attach(box1, 0, 1, 0, 1) 1023 1023 1024 box2 = gtk.VBox()1024 box2 = Gtk.VBox() 1025 1025 table.attach(box2, 1, 2, 0, 1) 1026 1026 … … 1050 1050 (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_flight")) 1051 1051 1052 dataBox = gtk.HBox()1052 dataBox = Gtk.HBox() 1053 1053 mainBox.pack_start(dataBox, False, False, 0) 1054 1054 … … 1065 1065 PIREPViewer.addVFiller(mainBox) 1066 1066 1067 dataBox = gtk.HBox()1067 dataBox = Gtk.HBox() 1068 1068 mainBox.pack_start(dataBox, False, False, 0) 1069 1069 … … 1075 1075 PIREPViewer.addVFiller(mainBox) 1076 1076 1077 table = gtk.Table(3, 2)1077 table = Gtk.Table(3, 2) 1078 1078 mainBox.pack_start(table, False, False, 0) 1079 1079 table.set_row_spacings(4) … … 1100 1100 width = 6) 1101 1101 1102 table = gtk.Table(3, 2)1102 table = Gtk.Table(3, 2) 1103 1103 mainBox.pack_start(table, False, False, 0) 1104 1104 table.set_row_spacings(4) … … 1145 1145 (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_route")) 1146 1146 1147 levelBox = gtk.HBox()1147 levelBox = Gtk.HBox() 1148 1148 mainBox.pack_start(levelBox, False, False, 0) 1149 1149 … … 1152 1152 levelBox.pack_start(label, False, False, 0) 1153 1153 1154 self._filedCruiseLevel = gtk.SpinButton()1154 self._filedCruiseLevel = Gtk.SpinButton() 1155 1155 self._filedCruiseLevel.set_increments(step = 10, page = 100) 1156 1156 self._filedCruiseLevel.set_range(min = 0, max = 500) … … 1167 1167 levelBox.pack_start(label, False, False, 0) 1168 1168 1169 self._modifiedCruiseLevel = gtk.SpinButton()1169 self._modifiedCruiseLevel = Gtk.SpinButton() 1170 1170 self._modifiedCruiseLevel.set_increments(step = 10, page = 100) 1171 1171 self._modifiedCruiseLevel.set_range(min = 0, max = 500) … … 1201 1201 PIREPViewer.addVFiller(mainBox) 1202 1202 1203 dataBox = gtk.HBox()1203 dataBox = Gtk.HBox() 1204 1204 mainBox.pack_start(dataBox, False, False, 0) 1205 1205 1206 label = gtk.Label("<b>" + xstr("pirepView_runway") + "</b>")1206 label = Gtk.Label("<b>" + xstr("pirepView_runway") + "</b>") 1207 1207 label.set_use_markup(True) 1208 1208 dataBox.pack_start(label, False, False, 0) 1209 1209 1210 1210 # FIXME: quite the same as the runway entry boxes in the wizard 1211 self._departureRunway = gtk.Entry()1211 self._departureRunway = Gtk.Entry() 1212 1212 self._departureRunway.set_width_chars(5) 1213 1213 self._departureRunway.set_tooltip_text(xstr("takeoff_runway_tooltip")) … … 1215 1215 dataBox.pack_start(self._departureRunway, False, False, 8) 1216 1216 1217 label = gtk.Label("<b>" + xstr("pirepView_sid") + "</b>")1217 label = Gtk.Label("<b>" + xstr("pirepView_sid") + "</b>") 1218 1218 label.set_use_markup(True) 1219 1219 dataBox.pack_start(label, False, False, 0) … … 1221 1221 # FIXME: quite the same as the SID combo box in 1222 1222 # 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) 1224 1224 1225 1225 self._sid.set_entry_text_column(0) … … 1247 1247 PIREPViewer.addVFiller(mainBox) 1248 1248 1249 table = gtk.Table(2, 4)1249 table = Gtk.Table(2, 4) 1250 1250 mainBox.pack_start(table, False, False, 0) 1251 1251 table.set_row_spacings(4) … … 1253 1253 1254 1254 # 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) 1256 1256 1257 1257 self._star.set_entry_text_column(0) … … 1265 1265 1266 1266 # 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) 1268 1268 1269 1269 self._transition.set_entry_text_column(0) … … 1278 1278 1279 1279 # FIXME: quite the same as in the wizard 1280 self._approachType = gtk.Entry()1280 self._approachType = Gtk.Entry() 1281 1281 self._approachType.set_width_chars(10) 1282 1282 self._approachType.set_tooltip_text(xstr("landing_approach_tooltip")) … … 1288 1288 1289 1289 # FIXME: quite the same as in the wizard 1290 self._arrivalRunway = gtk.Entry()1290 self._arrivalRunway = Gtk.Entry() 1291 1291 self._arrivalRunway.set_width_chars(10) 1292 1292 self._arrivalRunway.set_tooltip_text(xstr("landing_runway_tooltip")) … … 1303 1303 (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_statistics")) 1304 1304 1305 table = gtk.Table(4, 4)1305 table = Gtk.Table(4, 4) 1306 1306 mainBox.pack_start(table, False, False, 0) 1307 1307 table.set_row_spacings(4) … … 1355 1355 (frame, mainBox) = PIREPViewer.createFrame(xstr("pirepView_frame_miscellaneous")) 1356 1356 1357 table = gtk.Table(6, 2)1357 table = Gtk.Table(6, 2) 1358 1358 mainBox.pack_start(table, False, False, 0) 1359 1359 table.set_row_spacings(4) … … 1403 1403 self._flightType.set_tooltip_text(xstr("pirepEdit_flight_type_tooltip")) 1404 1404 1405 self._online = gtk.CheckButton(xstr("pirepEdit_online"))1405 self._online = Gtk.CheckButton(xstr("pirepEdit_online")) 1406 1406 table.attach(self._online, 2, 3, 2, 3) 1407 1407 self._online.connect("toggled", self._updateButtons) … … 1425 1425 def _buildLogTab(self): 1426 1426 """Build the log tab.""" 1427 mainBox = gtk.VBox()1427 mainBox = Gtk.VBox() 1428 1428 1429 1429 (logWindow, self._log) = PIREPViewer.getTextWindow(heightRequest = -1) -
src/mlx/gui/prefs.py
r995 r996 20 20 #------------------------------------------------------------------------------ 21 21 22 class Hotkey( gtk.HBox):22 class Hotkey(Gtk.HBox): 23 23 """A widget to handle a hotkey.""" 24 24 … … 43 43 super(Hotkey, self).__init__() 44 44 45 label = gtk.Label(labelText)45 label = Gtk.Label(labelText) 46 46 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, 48 48 xscale = 0.0, yscale = 0.0) 49 49 labelAlignment.set_padding(padding_top = 0, padding_bottom = 0, … … 52 52 self.pack_start(labelAlignment, False, False, 0) 53 53 54 self._ctrl = gtk.CheckButton("Ctrl")54 self._ctrl = Gtk.CheckButton("Ctrl") 55 55 self._ctrl.set_tooltip_text(tooltips[1]) 56 56 self._ctrl.connect("toggled", self._ctrlToggled) 57 57 self.pack_start(self._ctrl, False, False, 4) 58 58 59 self._shift = gtk.CheckButton("Shift")59 self._shift = Gtk.CheckButton("Shift") 60 60 self._shift.set_tooltip_text(tooltips[2]) 61 61 self._shift.connect("toggled", self._shiftToggled) 62 62 self.pack_start(self._shift, False, False, 4) 63 63 64 self._hotkeyModel = gtk.ListStore(str)64 self._hotkeyModel = Gtk.ListStore(str) 65 65 for keyCode in list(range(ord("0"), ord("9")+1)) + list(range(ord("A"), ord("Z")+1)): 66 66 self._hotkeyModel.append([chr(keyCode)]) 67 67 68 self._hotkey = gtk.ComboBox(model = self._hotkeyModel)69 cell = gtk.CellRendererText()68 self._hotkey = Gtk.ComboBox(model = self._hotkeyModel) 69 cell = Gtk.CellRendererText() 70 70 self._hotkey.pack_start(cell, True) 71 71 self._hotkey.add_attribute(cell, 'text', 0) … … 166 166 #------------------------------------------------------------------------------ 167 167 168 class Preferences( gtk.Dialog):168 class Preferences(Gtk.Dialog): 169 169 """The preferences dialog.""" 170 170 def __init__(self, gui): … … 184 184 contentArea = self.get_content_area() 185 185 186 notebook = gtk.Notebook()186 notebook = Gtk.Notebook() 187 187 contentArea.pack_start(notebook, True, True, 4) 188 188 189 189 general = self._buildGeneral() 190 label = gtk.Label(xstr("prefs_tab_general"))190 label = Gtk.Label(xstr("prefs_tab_general")) 191 191 label.set_use_underline(True) 192 192 label.set_tooltip_text(xstr("prefs_tab_general_tooltip")) … … 194 194 195 195 messages = self._buildMessages() 196 label = gtk.Label(xstr("prefs_tab_messages"))196 label = Gtk.Label(xstr("prefs_tab_messages")) 197 197 label.set_use_underline(True) 198 198 label.set_tooltip_text(xstr("prefs_tab_message_tooltip")) … … 200 200 201 201 sounds = self._buildSounds() 202 label = gtk.Label(xstr("prefs_tab_sounds"))202 label = Gtk.Label(xstr("prefs_tab_sounds")) 203 203 label.set_use_underline(True) 204 204 label.set_tooltip_text(xstr("prefs_tab_sounds_tooltip")) … … 206 206 207 207 advanced = self._buildAdvanced() 208 label = gtk.Label(xstr("prefs_tab_advanced"))208 label = Gtk.Label(xstr("prefs_tab_advanced")) 209 209 label.set_use_underline(True) 210 210 label.set_tooltip_text(xstr("prefs_tab_advanced_tooltip")) … … 326 326 def _buildGeneral(self): 327 327 """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, 329 329 xscale = 1.0, yscale = 0.0) 330 330 mainAlignment.set_padding(padding_top = 0, padding_bottom = 8, 331 331 padding_left = 4, padding_right = 4) 332 mainBox = gtk.VBox()332 mainBox = Gtk.VBox() 333 333 mainAlignment.add(mainBox) 334 334 335 335 guiBox = self._createFrame(mainBox, xstr("prefs_frame_gui")) 336 336 337 languageBox = gtk.HBox()337 languageBox = Gtk.HBox() 338 338 guiBox.pack_start(languageBox, False, False, 4) 339 339 340 label = gtk.Label(xstr("prefs_language"))340 label = Gtk.Label(xstr("prefs_language")) 341 341 label.set_use_underline(True) 342 342 343 343 languageBox.pack_start(label, False, False, 4) 344 344 345 self._languageList = gtk.ListStore(str, str)345 self._languageList = Gtk.ListStore(str, str) 346 346 for language in const.languages: 347 347 self._languageList.append([xstr("prefs_lang_" + language), … … 349 349 350 350 self._languageComboBox = languageComboBox = \ 351 gtk.ComboBox(model = self._languageList)352 cell = gtk.CellRendererText()351 Gtk.ComboBox(model = self._languageList) 352 cell = Gtk.CellRendererText() 353 353 languageComboBox.pack_start(cell, True) 354 354 languageComboBox.add_attribute(cell, 'text', 0) … … 362 362 self._warnedRestartNeeded = False 363 363 364 self._hideMinimizedWindow = gtk.CheckButton(xstr("prefs_hideMinimizedWindow"))364 self._hideMinimizedWindow = Gtk.CheckButton(xstr("prefs_hideMinimizedWindow")) 365 365 self._hideMinimizedWindow.set_use_underline(True) 366 366 self._hideMinimizedWindow.set_tooltip_text(xstr("prefs_hideMinimizedWindow_tooltip")) 367 367 guiBox.pack_start(self._hideMinimizedWindow, False, False, 4) 368 368 369 self._quitOnClose = gtk.CheckButton(xstr("prefs_quitOnClose"))369 self._quitOnClose = Gtk.CheckButton(xstr("prefs_quitOnClose")) 370 370 self._quitOnClose.set_use_underline(True) 371 371 self._quitOnClose.set_tooltip_text(xstr("prefs_quitOnClose_tooltip")) … … 374 374 onlineBox = self._createFrame(mainBox, xstr("prefs_frame_online")) 375 375 376 self._onlineGateSystem = gtk.CheckButton(xstr("prefs_onlineGateSystem"))376 self._onlineGateSystem = Gtk.CheckButton(xstr("prefs_onlineGateSystem")) 377 377 self._onlineGateSystem.set_use_underline(True) 378 378 self._onlineGateSystem.set_tooltip_text(xstr("prefs_onlineGateSystem_tooltip")) 379 379 onlineBox.pack_start(self._onlineGateSystem, False, False, 4) 380 380 381 self._onlineACARS = gtk.CheckButton(xstr("prefs_onlineACARS"))381 self._onlineACARS = Gtk.CheckButton(xstr("prefs_onlineACARS")) 382 382 self._onlineACARS.set_use_underline(True) 383 383 self._onlineACARS.set_tooltip_text(xstr("prefs_onlineACARS_tooltip")) … … 386 386 simulatorBox = self._createFrame(mainBox, xstr("prefs_frame_simulator")) 387 387 388 self._flareTimeFromFS = gtk.CheckButton(xstr("prefs_flaretimeFromFS"))388 self._flareTimeFromFS = Gtk.CheckButton(xstr("prefs_flaretimeFromFS")) 389 389 self._flareTimeFromFS.set_use_underline(True) 390 390 self._flareTimeFromFS.set_tooltip_text(xstr("prefs_flaretimeFromFS_tooltip")) 391 391 simulatorBox.pack_start(self._flareTimeFromFS, False, False, 4) 392 392 393 self._syncFSTime = gtk.CheckButton(xstr("prefs_syncFSTime"))393 self._syncFSTime = Gtk.CheckButton(xstr("prefs_syncFSTime")) 394 394 self._syncFSTime.set_use_underline(True) 395 395 self._syncFSTime.set_tooltip_text(xstr("prefs_syncFSTime_tooltip")) 396 396 simulatorBox.pack_start(self._syncFSTime, False, False, 4) 397 397 398 self._usingFS2Crew = gtk.CheckButton(xstr("prefs_usingFS2Crew"))398 self._usingFS2Crew = Gtk.CheckButton(xstr("prefs_usingFS2Crew")) 399 399 self._usingFS2Crew.set_use_underline(True) 400 400 self._usingFS2Crew.set_tooltip_text(xstr("prefs_usingFS2Crew_tooltip")) … … 413 413 simulatorBox.pack_start(vsSmoothingBox, False, False, 4) 414 414 415 self._useSimBrief = gtk.CheckButton(xstr("prefs_useSimBrief"))415 self._useSimBrief = Gtk.CheckButton(xstr("prefs_useSimBrief")) 416 416 self._useSimBrief.set_use_underline(True) 417 417 self._useSimBrief.set_tooltip_text(xstr("prefs_useSimBrief_tooltip")) 418 418 mainBox.pack_start(self._useSimBrief, False, False, 0) 419 419 420 pirepBox = gtk.HBox()420 pirepBox = Gtk.HBox() 421 421 mainBox.pack_start(pirepBox, False, False, 8) 422 422 423 label = gtk.Label(xstr("prefs_pirepDirectory"))423 label = Gtk.Label(xstr("prefs_pirepDirectory")) 424 424 label.set_use_underline(True) 425 425 pirepBox.pack_start(label, False, False, 4) 426 426 427 self._pirepDirectory = gtk.Entry()427 self._pirepDirectory = Gtk.Entry() 428 428 self._pirepDirectory.set_tooltip_text(xstr("prefs_pirepDirectory_tooltip")) 429 429 self._pirepDirectory.connect("changed", self._pirepDirectoryChanged) … … 431 431 pirepBox.pack_start(self._pirepDirectory, True, True, 4) 432 432 433 self._pirepDirectoryButton = gtk.Button(xstr("button_browse"))433 self._pirepDirectoryButton = Gtk.Button(xstr("button_browse")) 434 434 self._pirepDirectoryButton.connect("clicked", 435 435 self._pirepDirectoryButtonClicked) 436 436 pirepBox.pack_start(self._pirepDirectoryButton, False, False, 4) 437 437 438 self._pirepAutoSave = gtk.CheckButton(xstr("prefs_pirepAutoSave"))438 self._pirepAutoSave = Gtk.CheckButton(xstr("prefs_pirepAutoSave")) 439 439 self._pirepAutoSave.set_use_underline(True) 440 440 self._pirepAutoSave.set_tooltip_text(xstr("prefs_pirepAutoSave_tooltip")) … … 447 447 448 448 Return the vbox.""" 449 frame = gtk.Frame(label = label)449 frame = Gtk.Frame(label = label) 450 450 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, 452 452 xscale = 1.0, yscale = 0.0) 453 453 alignment.set_padding(padding_top = 4, padding_bottom = 0, 454 454 padding_left = 0, padding_right = 0) 455 455 frame.add(alignment) 456 vbox = gtk.VBox()456 vbox = Gtk.VBox() 457 457 alignment.add(vbox) 458 458 … … 462 462 maxSeconds = 10): 463 463 """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) 467 467 smoothingEnabled.set_use_underline(True) 468 468 smoothingEnabled.set_tooltip_text(checkBoxTooltip) … … 470 470 smoothingBox.pack_start(smoothingEnabled, False, False, 0) 471 471 472 smoothingLength = gtk.SpinButton()472 smoothingLength = Gtk.SpinButton() 473 473 smoothingLength.set_numeric(True) 474 474 smoothingLength.set_range(2, maxSeconds) … … 479 479 smoothingBox.pack_start(smoothingLength, False, False, 0) 480 480 481 smoothingBox.pack_start( gtk.Label(xstr("prefs_smoothing_seconds")),481 smoothingBox.pack_start(Gtk.Label(xstr("prefs_smoothing_seconds")), 482 482 False, False, 4) 483 483 … … 511 511 """Called when the language has changed.""" 512 512 if not self._changingLanguage and not self._warnedRestartNeeded: 513 dialog = gtk.MessageDialog(parent = self,513 dialog = Gtk.MessageDialog(parent = self, 514 514 type = MESSAGETYPE_INFO, 515 515 message_format = xstr("prefs_restart")) … … 548 548 def _pirepDirectoryButtonClicked(self, button): 549 549 """Called when the PIREP directory button is clicked.""" 550 dialog = gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " +550 dialog = Gtk.FileChooserDialog(title = WINDOW_TITLE_BASE + " - " + 551 551 xstr("prefs_pirepDirectory_browser_title"), 552 552 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), 555 555 parent = self) 556 556 dialog.set_modal(True) … … 578 578 """Build the page for the message settings.""" 579 579 580 mainAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,580 mainAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 581 581 xscale = 0.0, yscale = 0.0) 582 582 mainAlignment.set_padding(padding_top = 16, padding_bottom = 8, 583 583 padding_left = 4, padding_right = 4) 584 mainBox = gtk.VBox()584 mainBox = Gtk.VBox() 585 585 mainAlignment.add(mainBox) 586 586 587 table = gtk.Table(len(const.messageTypes) + 1, 3)587 table = Gtk.Table(len(const.messageTypes) + 1, 3) 588 588 table.set_row_spacings(8) 589 589 table.set_col_spacings(32) … … 591 591 mainBox.pack_start(table, False, False, 4) 592 592 593 label = gtk.Label(xstr("prefs_msgs_fs"))593 label = Gtk.Label(xstr("prefs_msgs_fs")) 594 594 label.set_justify(JUSTIFY_CENTER) 595 595 label.set_alignment(0.5, 1.0) 596 596 table.attach(label, 1, 2, 0, 1) 597 597 598 label = gtk.Label(xstr("prefs_msgs_sound"))598 label = Gtk.Label(xstr("prefs_msgs_sound")) 599 599 label.set_justify(JUSTIFY_CENTER) 600 600 label.set_alignment(0.5, 1.0) … … 606 606 for messageType in const.messageTypes: 607 607 messageTypeStr = const.messageType2string(messageType) 608 label = gtk.Label(xstr("prefs_msgs_type_" + messageTypeStr))608 label = Gtk.Label(xstr("prefs_msgs_type_" + messageTypeStr)) 609 609 label.set_justify(JUSTIFY_CENTER) 610 610 label.set_use_underline(True) … … 612 612 table.attach(label, 0, 1, row, row+1) 613 613 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, 616 616 xalign = 0.5, yalign = 0.5) 617 617 alignment.add(fsCheckButton) … … 619 619 self._msgFSCheckButtons[messageType] = fsCheckButton 620 620 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, 623 623 xalign = 0.5, yalign = 0.5) 624 624 alignment.add(soundCheckButton) … … 626 626 self._msgSoundCheckButtons[messageType] = soundCheckButton 627 627 628 mnemonicWidget = gtk.Label("")628 mnemonicWidget = Gtk.Label("") 629 629 table.attach(mnemonicWidget, 3, 4, row, row+1) 630 630 label.set_mnemonic_widget(mnemonicWidget) … … 655 655 def _buildSounds(self): 656 656 """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, 658 658 xscale = 1.0, yscale = 1.0) 659 659 mainAlignment.set_padding(padding_top = 8, padding_bottom = 8, 660 660 padding_left = 4, padding_right = 4) 661 661 662 mainBox = gtk.VBox()662 mainBox = Gtk.VBox() 663 663 mainAlignment.add(mainBox) 664 664 665 backgroundFrame = gtk.Frame(label = xstr("prefs_sounds_frame_bg"))665 backgroundFrame = Gtk.Frame(label = xstr("prefs_sounds_frame_bg")) 666 666 mainBox.pack_start(backgroundFrame, False, False, 4) 667 667 668 backgroundAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,668 backgroundAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 669 669 xscale = 1.0, yscale = 0.0) 670 670 backgroundAlignment.set_padding(padding_top = 4, padding_bottom = 4, … … 672 672 backgroundFrame.add(backgroundAlignment) 673 673 674 backgroundBox = gtk.VBox()674 backgroundBox = Gtk.VBox() 675 675 backgroundAlignment.add(backgroundBox) 676 676 677 self._enableSounds = gtk.CheckButton(xstr("prefs_sounds_enable"))677 self._enableSounds = Gtk.CheckButton(xstr("prefs_sounds_enable")) 678 678 self._enableSounds.set_use_underline(True) 679 679 self._enableSounds.set_tooltip_text(xstr("prefs_sounds_enable_tooltip")) 680 680 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, 682 682 xscale = 1.0, yscale = 0.0) 683 683 alignment.add(self._enableSounds) 684 684 backgroundBox.pack_start(alignment, False, False, 4) 685 685 686 self._pilotControlsSounds = gtk.CheckButton(xstr("prefs_sounds_pilotControls"))686 self._pilotControlsSounds = Gtk.CheckButton(xstr("prefs_sounds_pilotControls")) 687 687 self._pilotControlsSounds.set_use_underline(True) 688 688 self._pilotControlsSounds.set_tooltip_text(xstr("prefs_sounds_pilotControls_tooltip")) … … 697 697 backgroundBox.pack_start(self._pilotHotkey, False, False, 4) 698 698 699 self._enableApproachCallouts = gtk.CheckButton(xstr("prefs_sounds_approachCallouts"))699 self._enableApproachCallouts = Gtk.CheckButton(xstr("prefs_sounds_approachCallouts")) 700 700 self._enableApproachCallouts.set_use_underline(True) 701 701 self._enableApproachCallouts.set_tooltip_text(xstr("prefs_sounds_approachCallouts_tooltip")) 702 702 backgroundBox.pack_start(self._enableApproachCallouts, False, False, 4) 703 703 704 self._speedbrakeAtTD = gtk.CheckButton(xstr("prefs_sounds_speedbrakeAtTD"))704 self._speedbrakeAtTD = Gtk.CheckButton(xstr("prefs_sounds_speedbrakeAtTD")) 705 705 self._speedbrakeAtTD.set_use_underline(True) 706 706 self._speedbrakeAtTD.set_tooltip_text(xstr("prefs_sounds_speedbrakeAtTD_tooltip")) 707 707 backgroundBox.pack_start(self._speedbrakeAtTD, False, False, 4) 708 708 709 checklistFrame = gtk.Frame(label = xstr("prefs_sounds_frame_checklists"))709 checklistFrame = Gtk.Frame(label = xstr("prefs_sounds_frame_checklists")) 710 710 mainBox.pack_start(checklistFrame, False, False, 4) 711 711 712 checklistAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,712 checklistAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 713 713 xscale = 1.0, yscale = 0.0) 714 714 checklistAlignment.set_padding(padding_top = 4, padding_bottom = 4, … … 716 716 checklistFrame.add(checklistAlignment) 717 717 718 checklistBox = gtk.VBox()718 checklistBox = Gtk.VBox() 719 719 checklistAlignment.add(checklistBox) 720 720 721 self._enableChecklists = gtk.CheckButton(xstr("prefs_sounds_enableChecklists"))721 self._enableChecklists = Gtk.CheckButton(xstr("prefs_sounds_enableChecklists")) 722 722 self._enableChecklists.set_use_underline(True) 723 723 self._enableChecklists.set_tooltip_text(xstr("prefs_sounds_enableChecklists_tooltip")) … … 789 789 """Build the page for the advanced settings.""" 790 790 791 mainAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,791 mainAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 792 792 xscale = 1.0, yscale = 0.0) 793 793 mainAlignment.set_padding(padding_top = 16, padding_bottom = 8, 794 794 padding_left = 4, padding_right = 4) 795 mainBox = gtk.VBox()795 mainBox = Gtk.VBox() 796 796 mainAlignment.add(mainBox) 797 797 798 self._autoUpdate = gtk.CheckButton(xstr("prefs_update_auto"))798 self._autoUpdate = Gtk.CheckButton(xstr("prefs_update_auto")) 799 799 mainBox.pack_start(self._autoUpdate, False, False, 4) 800 800 … … 804 804 self._warnedAutoUpdate = False 805 805 806 updateURLBox = gtk.HBox()806 updateURLBox = Gtk.HBox() 807 807 mainBox.pack_start(updateURLBox, False, False, 4) 808 label = gtk.Label(xstr("prefs_update_url"))808 label = Gtk.Label(xstr("prefs_update_url")) 809 809 label.set_use_underline(True) 810 810 updateURLBox.pack_start(label, False, False, 4) 811 811 812 self._updateURL = gtk.Entry()812 self._updateURL = Gtk.Entry() 813 813 label.set_mnemonic_widget(self._updateURL) 814 814 self._updateURL.set_width_chars(40) … … 817 817 updateURLBox.pack_start(self._updateURL, True, True, 4) 818 818 819 self._useRPC = gtk.CheckButton(xstr("prefs_use_rpc"))819 self._useRPC = Gtk.CheckButton(xstr("prefs_use_rpc")) 820 820 mainBox.pack_start(self._useRPC, False, False, 16) 821 821 … … 841 841 if not self._settingFromConfig and not self._warnedAutoUpdate and \ 842 842 not self._autoUpdate.get_active(): 843 dialog = gtk.MessageDialog(parent = self,843 dialog = Gtk.MessageDialog(parent = self, 844 844 type = MESSAGETYPE_INFO, 845 845 message_format = xstr("prefs_update_auto_warning")) -
src/mlx/gui/statusbar.py
r994 r996 20 20 #------------------------------------------------------------------------------- 21 21 22 class Statusbar( gtk.Frame, FlightStatusHandler):22 class Statusbar(Gtk.Frame, FlightStatusHandler): 23 23 """A status bar for the logger.""" 24 24 def __init__(self, iconDirectory): 25 25 """Construct the status bar.""" 26 gtk.Frame.__init__(self)26 Gtk.Frame.__init__(self) 27 27 FlightStatusHandler.__init__(self) 28 28 … … 30 30 self._connected = False 31 31 32 self.set_shadow_type( gtk.ShadowType.NONE)32 self.set_shadow_type(Gtk.ShadowType.NONE) 33 33 34 frameAlignment = gtk.Alignment(xscale = 1.0, yscale = 1.0)34 frameAlignment = Gtk.Alignment(xscale = 1.0, yscale = 1.0) 35 35 36 36 frameAlignment.set_padding(padding_top = 2, padding_bottom = 2, … … 38 38 self.add(frameAlignment) 39 39 40 statusBox = gtk.HBox()40 statusBox = Gtk.HBox() 41 41 frameAlignment.add(statusBox) 42 42 … … 50 50 self._connGreenIcon = pixbuf_new_from_file(iconPath) 51 51 52 self._connStateArea = gtk.DrawingArea()52 self._connStateArea = Gtk.DrawingArea() 53 53 self._connStateArea.set_size_request(18, 18) 54 54 self._connStateArea.set_tooltip_markup(xstr("statusbar_conn_tooltip")) … … 56 56 self._connStateArea.connect("draw", self._drawConnState) 57 57 58 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5)58 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5) 59 59 alignment.add(self._connStateArea) 60 60 61 61 statusBox.pack_start(alignment, False, False, 8) 62 62 63 statusBox.pack_start( gtk.VSeparator(), False, False, 8)63 statusBox.pack_start(Gtk.VSeparator(), False, False, 8) 64 64 65 self._stageLabel = gtk.Label()65 self._stageLabel = Gtk.Label() 66 66 longestStage = xstr("flight_stage_" + 67 67 const.stage2string(const.STAGE_PUSHANDTAXI)) … … 72 72 statusBox.pack_start(self._stageLabel, False, False, 8) 73 73 74 statusBox.pack_start( gtk.VSeparator(), False, False, 8)74 statusBox.pack_start(Gtk.VSeparator(), False, False, 8) 75 75 76 self._timeLabel = gtk.Label("--:--:--")76 self._timeLabel = Gtk.Label("--:--:--") 77 77 self._timeLabel.set_width_chars(8) 78 78 self._timeLabel.set_tooltip_text(xstr("statusbar_time_tooltip")) … … 81 81 statusBox.pack_start(self._timeLabel, False, False, 8) 82 82 83 statusBox.pack_start( gtk.VSeparator(), False, False, 8)83 statusBox.pack_start(Gtk.VSeparator(), False, False, 8) 84 84 85 self._ratingLabel = gtk.Label()85 self._ratingLabel = Gtk.Label() 86 86 self._ratingLabel.set_width_chars(20) 87 87 self._ratingLabel.set_tooltip_text(xstr("statusbar_rating_tooltip")) … … 90 90 statusBox.pack_start(self._ratingLabel, False, False, 8) 91 91 92 self._busyLabel = gtk.Label()92 self._busyLabel = Gtk.Label() 93 93 self._busyLabel.set_width_chars(30) 94 94 self._busyLabel.set_tooltip_text(xstr("statusbar_busy_tooltip")) -
src/mlx/gui/statusicon.py
r994 r996 30 30 self._selfToggling = False 31 31 32 menu = gtk.Menu()32 menu = Gtk.Menu() 33 33 34 34 if appIndicator: 35 self._stageMenuItem = gtk.MenuItem("-")35 self._stageMenuItem = Gtk.MenuItem("-") 36 36 self._stageMenuItem.show() 37 37 menu.append(self._stageMenuItem) 38 38 39 self._ratingMenuItem = gtk.MenuItem("-")39 self._ratingMenuItem = Gtk.MenuItem("-") 40 40 self._ratingMenuItem.show() 41 41 menu.append(self._ratingMenuItem) 42 42 43 separator = gtk.SeparatorMenuItem()43 separator = Gtk.SeparatorMenuItem() 44 44 separator.show() 45 45 menu.append(separator) 46 46 47 self._showHideMenuItem = gtk.CheckMenuItem()47 self._showHideMenuItem = Gtk.CheckMenuItem() 48 48 self._showHideMenuItem.set_label(xstr("statusicon_showmain")) 49 49 self._showHideMenuItem.set_active(True) … … 52 52 menu.append(self._showHideMenuItem) 53 53 54 self._showMonitorMenuItem = gtk.CheckMenuItem()54 self._showMonitorMenuItem = Gtk.CheckMenuItem() 55 55 self._showMonitorMenuItem.set_label(xstr("statusicon_showmonitor")) 56 56 self._showMonitorMenuItem.set_active(False) … … 59 59 menu.append(self._showMonitorMenuItem) 60 60 61 separator = gtk.SeparatorMenuItem()61 separator = Gtk.SeparatorMenuItem() 62 62 separator.show() 63 63 menu.append(separator) 64 64 65 self._quitMenuItem = gtk.MenuItem()65 self._quitMenuItem = Gtk.MenuItem() 66 66 self._quitMenuItem.set_label(xstr("statusicon_quit")) 67 67 self._quitMenuItem.show() … … 82 82 else: 83 83 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, 85 85 button, time, status) 86 86 87 statusIcon = gtk.StatusIcon()87 statusIcon = Gtk.StatusIcon() 88 88 statusIcon.set_from_file(iconFile) 89 89 statusIcon.set_visible(True) -
src/mlx/gui/timetable.py
r995 r996 14 14 #----------------------------------------------------------------------------- 15 15 16 class Timetable( gtk.Alignment):16 class Timetable(Gtk.Alignment): 17 17 """The widget for the time table.""" 18 18 def _getVIPRenderer(): 19 19 """Get the renderer for the VIP column.""" 20 renderer = gtk.CellRendererToggle()20 renderer = Gtk.CellRendererToggle() 21 21 renderer.set_activatable(True) 22 22 return renderer … … 74 74 columnDescriptor.appendType(types) 75 75 76 self._model = gtk.ListStore(*types)76 self._model = Gtk.ListStore(*types) 77 77 if defaultSortableIndex is not None: 78 78 sortOrder = SORT_DESCENDING \ … … 80 80 else SORT_ASCENDING 81 81 self._model.set_sort_column_id(defaultSortableIndex, sortOrder) 82 self._view = gtk.TreeView(self._model)82 self._view = Gtk.TreeView(self._model) 83 83 84 84 self._view.connect("motion-notify-event", self._updateTooltip) 85 85 86 flightPairIndexColumn = gtk.TreeViewColumn()86 flightPairIndexColumn = Gtk.TreeViewColumn() 87 87 flightPairIndexColumn.set_visible(False) 88 88 self._view.append_column(flightPairIndexColumn) … … 102 102 selection.connect("changed", self._selectionChanged) 103 103 104 scrolledWindow = gtk.ScrolledWindow()104 scrolledWindow = Gtk.ScrolledWindow() 105 105 scrolledWindow.add(self._view) 106 106 scrolledWindow.set_size_request(800, -1) 107 107 108 108 # 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) 112 112 113 113 super(Timetable, self).__init__(xalign = 0.5, yalign = 0.0, … … 252 252 #----------------------------------------------------------------------------- 253 253 254 class CalendarWindow( gtk.Window):254 class CalendarWindow(Gtk.Window): 255 255 """A window for a calendar.""" 256 256 def __init__(self): … … 262 262 self.connect("key-press-event", self._keyPressed) 263 263 264 mainAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,264 mainAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 265 265 xscale = 1.0, yscale = 1.0) 266 266 #mainAlignment.set_padding(padding_top = 0, padding_bottom = 12, 267 267 # padding_left = 8, padding_right = 8) 268 268 269 self._calendar = gtk.Calendar()269 self._calendar = Gtk.Calendar() 270 270 self._calendar.connect("day-selected-double-click", self._daySelectedDoubleClick) 271 271 mainAlignment.add(self._calendar) … … 305 305 #----------------------------------------------------------------------------- 306 306 307 class BookDialog( gtk.Dialog):307 class BookDialog(Gtk.Dialog): 308 308 """The dialog box to select additional data for a booking.""" 309 309 def __init__(self, timetableWindow, flightPair, planes): … … 315 315 contentArea = self.get_content_area() 316 316 317 frame = gtk.Frame(xstr("timetable_book_frame_title"))317 frame = Gtk.Frame(xstr("timetable_book_frame_title")) 318 318 frame.set_size_request(600, -1) 319 319 320 mainAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,320 mainAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 321 321 xscale = 0.0, yscale = 0.0) 322 322 mainAlignment.set_padding(padding_top = 16, padding_bottom = 12, 323 323 padding_left = 8, padding_right = 8) 324 324 325 table = gtk.Table(6, 2)325 table = Gtk.Table(6, 2) 326 326 table.set_row_spacings(8) 327 327 table.set_col_spacings(16) 328 328 329 329 row = 0 330 label = gtk.Label()330 label = Gtk.Label() 331 331 label.set_markup(xstr("timetable_book_callsign")) 332 332 label.set_alignment(0.0, 0.5) … … 336 336 if flightPair.flight1 is not None: 337 337 text += " / " + flightPair.flight1.callsign 338 label = gtk.Label(text)338 label = Gtk.Label(text) 339 339 label.set_alignment(0.0, 0.5) 340 340 table.attach(label, 1, 2, row, row + 1) … … 342 342 row += 1 343 343 344 label = gtk.Label()344 label = Gtk.Label() 345 345 label.set_markup(xstr("timetable_book_from_to")) 346 346 label.set_alignment(0.0, 0.5) … … 351 351 if flightPair.flight1 is not None: 352 352 text += " - " + flightPair.flight1.arrivalICAO 353 label = gtk.Label(text)353 label = Gtk.Label(text) 354 354 label.set_alignment(0.0, 0.5) 355 355 table.attach(label, 1, 2, row, row + 1) … … 359 359 if flightPair.flight0.type==ScheduledFlight.TYPE_VIP and \ 360 360 flightPair.flight0.date!=const.defaultDate: 361 label = gtk.Label()361 label = Gtk.Label() 362 362 label.set_markup(xstr("timetable_book_flightDate")) 363 363 label.set_use_underline(True) … … 365 365 table.attach(label, 0, 1, row, row + 1) 366 366 367 self._flightDate = gtk.Button()367 self._flightDate = Gtk.Button() 368 368 self._flightDate.connect("clicked", self._flightDateClicked) 369 369 self._flightDate.set_tooltip_text(xstr("timetable_book_flightDate_tooltip")) … … 384 384 self._calendarWindow = None 385 385 386 label = gtk.Label()386 label = Gtk.Label() 387 387 label.set_markup(xstr("timetable_book_dep_arr")) 388 388 label.set_alignment(0.0, 0.5) … … 394 394 text += " / " + str(flightPair.flight1.departureTime) + " - " + \ 395 395 str(flightPair.flight1.arrivalTime) 396 label = gtk.Label(text)396 label = Gtk.Label(text) 397 397 label.set_alignment(0.0, 0.5) 398 398 table.attach(label, 1, 2, row, row + 1) … … 400 400 row += 1 401 401 402 label = gtk.Label()402 label = Gtk.Label() 403 403 label.set_markup(xstr("timetable_book_duration")) 404 404 label.set_alignment(0.0, 0.5) … … 411 411 duration = flightPair.flight0.duration 412 412 text += " / %02d:%02d" % (duration/3600, (duration%3600)/60) 413 label = gtk.Label(text)413 label = Gtk.Label(text) 414 414 label.set_alignment(0.0, 0.5) 415 415 table.attach(label, 1, 2, row, row + 1) … … 417 417 row += 2 418 418 419 label = gtk.Label()419 label = Gtk.Label() 420 420 label.set_markup(xstr("timetable_book_tailNumber")) 421 421 label.set_alignment(0.0, 0.5) … … 423 423 424 424 self._planes = planes 425 tailNumbersModel = gtk.ListStore(str)425 tailNumbersModel = Gtk.ListStore(str) 426 426 for plane in planes: 427 427 tailNumbersModel.append((plane.tailNumber,)) 428 428 429 self._tailNumber = gtk.ComboBox(model = tailNumbersModel)430 renderer = gtk.CellRendererText()429 self._tailNumber = Gtk.ComboBox(model = tailNumbersModel) 430 renderer = Gtk.CellRendererText() 431 431 self._tailNumber.pack_start(renderer, True) 432 432 self._tailNumber.add_attribute(renderer, "text", 0) … … 465 465 def _flightDateClicked(self, button): 466 466 """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) 468 468 self.set_focus(self._calendarWindow) 469 469 self._calendarWindow.show_all() … … 481 481 #----------------------------------------------------------------------------- 482 482 483 class TimetableWindow( gtk.Window):483 class TimetableWindow(Gtk.Window): 484 484 """The window to display the timetable.""" 485 485 typeFamilies = [ … … 506 506 self.connect("key-press-event", self._keyPressed) 507 507 508 mainAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,508 mainAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 509 509 xscale = 1.0, yscale = 1.0) 510 510 mainAlignment.set_padding(padding_top = 0, padding_bottom = 12, 511 511 padding_left = 8, padding_right = 8) 512 512 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, 516 516 xscale = 1.0, yscale = 1.0) 517 517 518 filterFrame = gtk.Frame()518 filterFrame = Gtk.Frame() 519 519 filterFrame.set_label(xstr("timetable_filter")) 520 520 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, 524 524 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")) 528 528 label.set_use_underline(True) 529 529 topHBox.pack_start(label, False, False, 4) 530 530 531 self._flightDate = gtk.Button()531 self._flightDate = Gtk.Button() 532 532 self._flightDate.connect("clicked", self._flightDateClicked) 533 533 self._flightDate.connect("clicked", self._flightDateClicked) … … 536 536 topHBox.pack_start(self._flightDate, False, False, 4) 537 537 538 filler = gtk.Alignment()538 filler = Gtk.Alignment() 539 539 filler.set_size_request(48, 2) 540 540 topHBox.pack_start(filler, False, True, 0) 541 541 542 self._regularFlights = gtk.CheckButton(xstr("timetable_show_regular"))542 self._regularFlights = Gtk.CheckButton(xstr("timetable_show_regular")) 543 543 self._regularFlights.set_use_underline(True) 544 544 self._regularFlights.set_tooltip_text(xstr("timetable_show_regular_tooltip")) … … 547 547 topHBox.pack_start(self._regularFlights, False, False, 8) 548 548 549 self._vipFlights = gtk.CheckButton(xstr("timetable_show_vip"))549 self._vipFlights = Gtk.CheckButton(xstr("timetable_show_vip")) 550 550 self._vipFlights.set_use_underline(True) 551 551 self._vipFlights.set_tooltip_text(xstr("timetable_show_vip_tooltip")) … … 558 558 filterVBox.pack_start(topAlignment, False, False, 4) 559 559 560 separator = gtk.HSeparator()560 separator = Gtk.HSeparator() 561 561 filterVBox.pack_start(separator, False, False, 4) 562 562 563 typeAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,563 typeAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 564 564 xscale = 0.0, yscale = 0.0) 565 565 … … 567 567 numRows = (len(TimetableWindow.typeFamilies)+numColumns-1)/numColumns 568 568 569 typeTable = gtk.Table(numRows, numColumns)569 typeTable = Gtk.Table(numRows, numColumns) 570 570 typeTable.set_col_spacings(8) 571 571 row = 0 … … 573 573 self._typeFamilyButtons = {} 574 574 for typeFamily in TimetableWindow.typeFamilies: 575 checkButton = gtk.CheckButton(aircraftFamilyNames[typeFamily])575 checkButton = Gtk.CheckButton(aircraftFamilyNames[typeFamily]) 576 576 checkButton.set_active(True) 577 577 checkButton.connect("toggled", self._filterChanged) … … 599 599 vbox.pack_start(self._timetable, True, True, 2) 600 600 601 alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,601 alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.5, 602 602 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")) 606 606 self._bookButton.set_use_underline(True) 607 607 self._bookButton.set_can_default(True) … … 610 610 buttonBox.pack_start(self._bookButton, False, False, 4); 611 611 612 self._closeButton = gtk.Button(xstr("button_close"))612 self._closeButton = Gtk.Button(xstr("button_close")) 613 613 self._closeButton.set_use_underline(True) 614 614 self._closeButton.connect("clicked", self._closeClicked) … … 678 678 def _flightDateClicked(self, button): 679 679 """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) 681 681 self.set_focus(self._calendarWindow) 682 682 self._calendarWindow.show_all() … … 771 771 """Called when the booking has finished.""" 772 772 if returned: 773 dialog = gtk.MessageDialog(parent = self,773 dialog = Gtk.MessageDialog(parent = self, 774 774 type = MESSAGETYPE_INFO, 775 775 message_format = xstr("bookflights_successful")) 776 776 dialog.format_secondary_markup(xstr("bookflights_successful_secondary")) 777 777 else: 778 dialog = gtk.MessageDialog(parent = self,778 dialog = Gtk.MessageDialog(parent = self, 779 779 type = MESSAGETYPE_ERROR, 780 780 message_format = xstr("bookflights_failed")) … … 789 789 def _createTimetablePopupMenu(self): 790 790 """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() 794 794 menuItem.set_label(xstr("timetable_popup_book")) 795 795 menuItem.set_use_underline(True) -
src/mlx/gui/update.py
r995 r996 46 46 return 47 47 48 Updater._progressWindow = window = gtk.Window()48 Updater._progressWindow = window = Gtk.Window() 49 49 window.set_title(WINDOW_TITLE_BASE + " " + xstr("update_title")) 50 50 window.set_transient_for(parentWindow) … … 55 55 window.connect("delete-event", lambda a, b: True) 56 56 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) 60 60 mainAlignment.set_padding(padding_top = 4, padding_bottom = 10, 61 61 padding_left = 16, padding_right = 16) 62 62 window.add(mainAlignment) 63 63 64 mainVBox = gtk.VBox()64 mainVBox = Gtk.VBox() 65 65 mainAlignment.add(mainVBox) 66 66 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() 69 69 labelAlignment.add(progressLabel) 70 70 mainVBox.pack_start(labelAlignment, True, True, 4) 71 71 72 Updater._progressBar = progressBar = gtk.ProgressBar()72 Updater._progressBar = progressBar = Gtk.ProgressBar() 73 73 mainVBox.pack_start(progressBar, True, True, 4) 74 74 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") 77 77 buttonAlignment.add(progressOKButton) 78 78 mainVBox.pack_start(buttonAlignment, True, True, 4) 79 79 80 80 Updater._sudoDialog = sudoDialog = \ 81 gtk.Dialog(WINDOW_TITLE_BASE + " " + xstr("update_title"),81 Gtk.Dialog(WINDOW_TITLE_BASE + " " + xstr("update_title"), 82 82 parentWindow, 83 gtk.DialogFlags.MODAL)83 Gtk.DialogFlags.MODAL) 84 84 sudoDialog.add_button(xstr("button_cancel"), 0) 85 85 sudoDialog.add_button(xstr("button_ok"), 1) 86 86 87 infoLabelAlignment = gtk.Alignment(xalign = 0.5, xscale = 0.1)87 infoLabelAlignment = Gtk.Alignment(xalign = 0.5, xscale = 0.1) 88 88 infoLabelAlignment.set_padding(padding_top = 4, padding_bottom = 10, 89 89 padding_left = 16, padding_right = 16) 90 90 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) 93 93 infoLabelAlignment.add(infoLabel) 94 94 sudoDialog.vbox.pack_start(infoLabelAlignment, True, True, 4) 95 95 96 sudoDialog.set_position( gtk.WindowPosition.CENTER_ON_PARENT)96 sudoDialog.set_position(Gtk.WindowPosition.CENTER_ON_PARENT) 97 97 98 98 def __init__(self, gui, programDirectory, updateURL, parentWindow): -
src/mlx/gui/weighthelp.py
r995 r996 15 15 #------------------------------------------------------------------------------- 16 16 17 class WeightHelp( gtk.VBox):17 class WeightHelp(Gtk.VBox): 18 18 """The weight calculation help tab.""" 19 19 @staticmethod … … 40 40 self._gui = gui 41 41 42 mainAlignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,42 mainAlignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 43 43 xscale = 1.0, yscale = 1.0) 44 44 mainAlignment.set_padding(padding_top = 4, padding_bottom = 4, … … 46 46 self.add(mainAlignment) 47 47 48 self._mainBox = mainBox = gtk.VBox()48 self._mainBox = mainBox = Gtk.VBox() 49 49 mainAlignment.add(mainBox) 50 50 51 self._usingHelp = gtk.CheckButton(xstr("weighthelp_usinghelp"))51 self._usingHelp = Gtk.CheckButton(xstr("weighthelp_usinghelp")) 52 52 self._usingHelp.set_use_underline(True) 53 53 self._usingHelp.set_tooltip_text(xstr("weighthelp_usinghelp_tooltip")) … … 56 56 57 57 58 self._weightsTable = table = gtk.Table(16, 5)58 self._weightsTable = table = Gtk.Table(16, 5) 59 59 table.set_homogeneous(False) 60 60 table.set_row_spacings(4) 61 61 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, 63 63 xscale = 0.0, yscale = 0.0) 64 64 alignment.add(table) 65 65 mainBox.pack_start(alignment, True, True, 4) 66 66 67 alignment = gtk.Alignment(xalign = 1.0, yalign = 0.0,67 alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.0, 68 68 xscale = 0.0, yscale = 0.0) 69 69 alignment.set_padding(padding_bottom = 16, padding_top = 0, 70 70 padding_left = 0, padding_right = 0) 71 label = gtk.Label(xstr("weighthelp_header_calculated"))71 label = Gtk.Label(xstr("weighthelp_header_calculated")) 72 72 label.set_use_markup(True) 73 73 # FIXME: should be a constant in common 74 label.set_justify( gtk.Justification.CENTER)74 label.set_justify(Gtk.Justification.CENTER) 75 75 alignment.add(label) 76 76 table.attach(alignment, 1, 2, 0, 1) 77 77 78 alignment = gtk.Alignment(xalign = 1.0, yalign = 0.0,78 alignment = Gtk.Alignment(xalign = 1.0, yalign = 0.0, 79 79 xscale = 0.0, yscale = 0.0) 80 80 alignment.set_padding(padding_bottom = 16, padding_top = 0, 81 81 padding_left = 0, padding_right = 0) 82 button = gtk.Button(xstr("weighthelp_header_simulator"))82 button = Gtk.Button(xstr("weighthelp_header_simulator")) 83 83 button.set_tooltip_markup(xstr("weighthelp_header_simulator_tooltip")) 84 84 button.connect("clicked", self._fsButtonClicked) 85 85 label = button.get_child() 86 label.set_justify( gtk.Justification.CENTER)86 label.set_justify(Gtk.Justification.CENTER) 87 87 alignment.add(button) 88 88 table.attach(alignment, 3, 4, 0, 1) 89 89 90 90 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, 93 93 xscale = 0.0, yscale = 0.0) 94 94 alignment.add(self._crewLabel) 95 95 table.attach(alignment, 0, 1, 1, 2) 96 96 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, 99 99 xscale = 0.0, yscale = 0.0) 100 100 alignment.add(self._crewWeight) 101 101 table.attach(alignment, 1, 2, 1, 2) 102 102 103 table.attach( gtk.Label("kg"), 2, 3, 1, 2)103 table.attach(Gtk.Label("kg"), 2, 3, 1, 2) 104 104 105 105 text = xstr("weighthelp_pax") % ("999",) 106 self._paxLabel = gtk.Label(text)106 self._paxLabel = Gtk.Label(text) 107 107 self._paxLabel.set_width_chars(len(text)) 108 108 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, 110 110 xscale = 0.0, yscale = 0.0) 111 111 alignment.add(self._paxLabel) 112 112 table.attach(alignment, 0, 1, 2, 3) 113 113 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, 116 116 xscale = 0.0, yscale = 0.0) 117 117 alignment.add(self._paxWeight) 118 118 table.attach(alignment, 1, 2, 2, 3) 119 119 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, 124 124 xscale = 0.0, yscale = 0.0) 125 125 alignment.add(label) 126 126 table.attach(alignment, 0, 1, 3, 4) 127 127 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, 130 130 xscale = 0.0, yscale = 0.0) 131 131 alignment.add(self._bagWeight) 132 132 table.attach(alignment, 1, 2, 3, 4) 133 133 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, 138 138 xscale = 0.0, yscale = 0.0) 139 139 alignment.add(label) 140 140 table.attach(alignment, 0, 1, 4, 5) 141 141 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, 144 144 xscale = 0.0, yscale = 0.0) 145 145 alignment.add(self._cargoWeight) 146 146 table.attach(alignment, 1, 2, 4, 5) 147 147 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, 152 152 xscale = 0.0, yscale = 0.0) 153 153 alignment.add(label) 154 154 table.attach(alignment, 0, 1, 5, 6) 155 155 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, 158 158 xscale = 0.0, yscale = 0.0) 159 159 alignment.add(self._mailWeight) 160 160 table.attach(alignment, 1, 2, 5, 6) 161 161 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, 169 169 xscale = 0.0, yscale = 0.0) 170 170 alignment.add(label) 171 171 table.attach(alignment, 0, 1, 7, 8) 172 172 173 self._payload = gtk.Label("<b>32000</b>")173 self._payload = Gtk.Label("<b>32000</b>") 174 174 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, 176 176 xscale = 0.0, yscale = 0.0) 177 177 alignment.add(self._payload) 178 178 table.attach(alignment, 1, 2, 7, 8) 179 179 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>") 183 183 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, 185 185 xscale = 0.0, yscale = 0.0) 186 186 alignment.add(self._fsPayload) 187 187 table.attach(alignment, 3, 4, 7, 8) 188 188 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, 194 194 xscale = 0.0, yscale = 0.0) 195 195 alignment.add(label) 196 196 table.attach(alignment, 0, 1, 8, 9) 197 197 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, 200 200 xscale = 0.0, yscale = 0.0) 201 201 alignment.add(self._dow) 202 202 table.attach(alignment, 1, 2, 8, 9) 203 203 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, 208 208 xscale = 0.0, yscale = 0.0) 209 209 alignment.add(self._fsDOW) 210 210 table.attach(alignment, 3, 4, 8, 9) 211 211 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, 221 221 xscale = 0.0, yscale = 0.0) 222 222 alignment.add(label) 223 223 table.attach(alignment, 0, 1, 10, 11) 224 224 225 self._zfw = gtk.Label("<b>122000</b>")225 self._zfw = Gtk.Label("<b>122000</b>") 226 226 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, 228 228 xscale = 0.0, yscale = 0.0) 229 229 alignment.add(self._zfw) 230 230 table.attach(alignment, 1, 2, 10, 11) 231 231 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>") 235 235 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, 237 237 xscale = 0.0, yscale = 0.0) 238 238 alignment.add(self._fsZFW) 239 239 table.attach(alignment, 3, 4, 10, 11) 240 240 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, 248 248 xscale = 0.0, yscale = 0.0) 249 249 alignment.add(label) 250 250 table.attach(alignment, 0, 1, 12, 13) 251 251 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, 254 254 xscale = 0.0, yscale = 0.0) 255 255 alignment.add(self._fsGross) 256 256 table.attach(alignment, 3, 4, 12, 13) 257 257 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, 263 263 xscale = 0.0, yscale = 0.0) 264 264 alignment.add(label) 265 265 table.attach(alignment, 0, 1, 13, 14) 266 266 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, 269 269 xscale = 0.0, yscale = 0.0) 270 270 alignment.add(self._mzfw) 271 271 table.attach(alignment, 1, 2, 13, 14) 272 272 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, 278 278 xscale = 0.0, yscale = 0.0) 279 279 alignment.add(label) 280 280 table.attach(alignment, 0, 1, 14, 15) 281 281 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, 284 284 xscale = 0.0, yscale = 0.0) 285 285 alignment.add(self._mtow) 286 286 table.attach(alignment, 1, 2, 14, 15) 287 287 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, 293 293 xscale = 0.0, yscale = 0.0) 294 294 alignment.add(label) 295 295 table.attach(alignment, 0, 1, 15, 16) 296 296 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, 299 299 xscale = 0.0, yscale = 0.0) 300 300 alignment.add(self._mlw) 301 301 table.attach(alignment, 1, 2, 15, 16) 302 302 303 table.attach( gtk.Label("kg"), 2, 3, 15, 16)303 table.attach(Gtk.Label("kg"), 2, 3, 15, 16) 304 304 305 305 self.show_all()
Note:
See TracChangeset
for help on using the changeset viewer.