Changeset 221:2126271cea84 for src/mlx/gui
- Timestamp:
- 06/04/12 11:39:30 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx/gui
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/common.py
r220 r221 227 227 228 228 #------------------------------------------------------------------------------ 229 230 def formatFlightLogLine(timeStr, line): 231 """Format the given flight log line.""" 232 """Format the given line for flight logging.""" 233 if timeStr is not None: 234 line = timeStr + ": " + line 235 return line + "\n" 236 237 #------------------------------------------------------------------------------ -
src/mlx/gui/gui.py
r220 r221 33 33 class GUI(fs.ConnectionListener): 34 34 """The main GUI class.""" 35 @staticmethod36 def _formatFlightLogLine(timeStr, line):37 """Format the given line for flight logging."""38 if timeStr is not None:39 line = timeStr + ": " + line40 return line + "\n"41 42 35 def __init__(self, programDirectory, config): 43 36 """Construct the GUI.""" … … 473 466 """Write the given message line to the log.""" 474 467 gobject.idle_add(self._writeLog, 475 GUI._formatFlightLogLine(timeStr, line),468 formatFlightLogLine(timeStr, line), 476 469 self._logView) 477 470 … … 479 472 """Update the line with the given index.""" 480 473 gobject.idle_add(self._updateFlightLogLine, index, 481 GUI._formatFlightLogLine(timeStr, line))474 formatFlightLogLine(timeStr, line)) 482 475 483 476 def _updateFlightLogLine(self, index, line): -
src/mlx/gui/pirep.py
r220 r221 131 131 132 132 contentArea = self.get_content_area() 133 134 self._notebook = gtk.Notebook() 135 contentArea.pack_start(self._notebook, False, False, 4) 136 133 137 dataTab = self._buildDataTab() 134 contentArea.pack_start(dataTab, False, False, 0) 138 label = gtk.Label(xstr("pirepView_tab_data")) 139 label.set_use_underline(True) 140 label.set_tooltip_text(xstr("pirepView_tab_data_tooltip")) 141 self._notebook.append_page(dataTab, label) 142 143 commentsTab = self._buildCommentsTab() 144 label = gtk.Label(xstr("pirepView_tab_comments")) 145 label.set_use_underline(True) 146 label.set_tooltip_text(xstr("pirepView_tab_comments_tooltip")) 147 self._notebook.append_page(commentsTab, label) 148 149 logTab = self._buildLogTab() 150 label = gtk.Label(xstr("pirepView_tab_log")) 151 label.set_use_underline(True) 152 label.set_tooltip_text(xstr("pirepView_tab_log_tooltip")) 153 self._notebook.append_page(logTab, label) 135 154 136 155 def setPIREP(self, pirep): … … 205 224 delayCodes += PIREP.delayCodes[code] 206 225 207 self._delayCodes.get_buffer().set_text(delayCodes) 226 self._delayCodes.get_buffer().set_text(delayCodes) 227 228 self._comments.get_buffer().set_text(pirep.comments) 229 self._flightDefects.get_buffer().set_text(pirep.flightDefects) 230 231 logBuffer = self._log.get_buffer() 232 logBuffer.set_text("") 233 for (timeStr, line) in pirep.logLines: 234 logBuffer.insert(logBuffer.get_end_iter(), 235 formatFlightLogLine(timeStr, line)) 236 237 self._notebook.set_current_page(0) 208 238 209 239 def _buildDataTab(self): … … 437 467 table.set_row_spacings(4) 438 468 table.set_col_spacings(8) 469 table.set_homogeneous(False) 439 470 440 471 self._blockTimeStart = \ … … 501 532 return frame 502 533 534 def _buildCommentsTab(self): 535 """Build the tab with the comments and flight defects.""" 536 table = gtk.Table(2, 1) 537 table.set_col_spacings(16) 538 539 (frame, commentsBox) = \ 540 PIREPViewer.createFrame(xstr("pirepView_comments")) 541 table.attach(frame, 0, 1, 0, 1) 542 543 (commentsWindow, self._comments) = \ 544 PIREPViewer.getTextWindow(heightRequest = -1) 545 commentsBox.pack_start(commentsWindow, True, True, 0) 546 547 (frame, flightDefectsBox) = \ 548 PIREPViewer.createFrame(xstr("pirepView_flightDefects")) 549 table.attach(frame, 1, 2, 0, 1) 550 551 (flightDefectsWindow, self._flightDefects) = \ 552 PIREPViewer.getTextWindow(heightRequest = -1) 553 flightDefectsBox.pack_start(flightDefectsWindow, True, True, 0) 554 555 return table 556 557 def _buildLogTab(self): 558 """Build the log tab.""" 559 mainBox = gtk.VBox() 560 561 (logWindow, self._log) = PIREPViewer.getTextWindow(heightRequest = -1) 562 mainBox.pack_start(logWindow, True, True, 0) 563 564 return mainBox 565 503 566 #------------------------------------------------------------------------------ 504 #------------------------------------------------------------------------------505 #------------------------------------------------------------------------------506 #------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.