Changeset 484:e6fc7bff478b for src/mlx/gui/gui.py
- Timestamp:
- 03/31/13 09:33:45 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/gui.py
r483 r484 85 85 86 86 self._sendPIREPCallback = None 87 self._sendBugReportCallback = None 87 88 88 89 self.webHandler = web.Handler() … … 109 110 self._checklistEditor = ChecklistEditor(self) 110 111 self._approachCalloutsEditor = ApproachCalloutsEditor(self) 111 self._bug reportDialog = BugReportDialog(self)112 self._bugReportDialog = BugReportDialog(self) 112 113 113 114 menuBar = self._buildMenuBar(accelGroup) … … 1141 1142 def _reportBug(self, menuItem): 1142 1143 """Callback for reporting a bug.""" 1143 self._bug reportDialog.run()1144 self._bugReportDialog.run() 1144 1145 1145 1146 def _setupTimeSync(self): … … 1382 1383 callback(returned, result) 1383 1384 1385 def sendBugReport(self, summary, description, email, callback = None): 1386 """Send the bug report with the given data.""" 1387 self.beginBusy(xstr("sendBugReport_busy")) 1388 self._sendBugReportCallback = callback 1389 self.webHandler.sendBugReport(self._bugReportSentCallback, 1390 summary, description, email) 1391 1392 def _bugReportSentCallback(self, returned, result): 1393 """Callback function for the bug report sending result.""" 1394 gobject.idle_add(self._handleBugReportSent, returned, result) 1395 1396 def _handleBugReportSent(self, returned, result): 1397 """Callback for the bug report sending result.""" 1398 self.endBusy() 1399 secondaryMarkup = None 1400 type = MESSAGETYPE_ERROR 1401 if returned: 1402 if result.success: 1403 type = MESSAGETYPE_INFO 1404 messageFormat = xstr("sendBugReport_success") 1405 secondaryMarkup = xstr("sendBugReport_success_sec") 1406 else: 1407 messageFormat = xstr("sendBugReport_error") 1408 secondaryMarkup = xstr("sendBugReport_siteerror_sec") 1409 else: 1410 messageFormat = xstr("sendBugReport_error") 1411 secondaryMarkup = xstr("sendBugReport_error_sec") 1412 1413 dialog = gtk.MessageDialog(parent = self._wizard.gui._bugReportDialog, 1414 type = type, message_format = messageFormat) 1415 dialog.add_button(xstr("button_ok"), RESPONSETYPE_OK) 1416 dialog.set_title(WINDOW_TITLE_BASE) 1417 if secondaryMarkup is not None: 1418 dialog.format_secondary_markup(secondaryMarkup) 1419 1420 dialog.run() 1421 dialog.hide() 1422 1423 callback = self._sendBugReportCallback 1424 self._sendBugReportCallback = None 1425 if callback is not None: 1426 callback(returned, result) 1427 1384 1428 def _listenHotkeys(self): 1385 1429 """Setup the hotkeys based on the configuration."""
Note:
See TracChangeset
for help on using the changeset viewer.