Esempio n. 1
0
bool
MainWindow::OnUser(unsigned id)
{
  switch ((Command)id) {
  case Command::GPS_UPDATE:
    UIReceiveSensorData();
    return true;

  case Command::CALCULATED_UPDATE:
    UIReceiveCalculatedData();
    return true;

  case Command::RESTORE_PAGE:
    if (restore_page_pending)
      PageActions::Restore();
    return true;

#ifdef ANDROID
  case Command::CRASH:
    ShowMessageBox(_T("How embarassing, we're terribly sorry!\n"
                      "Please submit a bug report and "
                      "include the file from the 'crash' directory.\n"
                      "http://bugs.xcsoar.org/newticket\n"
                      "After your report, we'll fix it ASAP."),
                   _T("XCSoar has crashed recently"),
                   MB_OK|MB_ICONERROR);
    return true;
#endif
  }

  return false;
}
Esempio n. 2
0
bool
MainWindow::OnUser(unsigned id)
{
  ProtectedAirspaceWarningManager *airspace_warnings;

  switch ((Command)id) {
  case Command::AIRSPACE_WARNING:
    airspace_warnings = GetAirspaceWarnings();
    if (!airspace_warning_pending || airspace_warnings == NULL)
      return true;

    airspace_warning_pending = false;
    if (dlgAirspaceWarningVisible())
      /* already visible */
      return true;

    /* un-blank the display, play a sound and show the dialog */
    ResetUserIdle();
    PlayResource(_T("IDR_WAV_BEEPBWEEP"));
    dlgAirspaceWarningsShowModal(*this, *airspace_warnings, true);
    return true;

  case Command::GPS_UPDATE:
    UIReceiveSensorData();
    return true;

  case Command::CALCULATED_UPDATE:
    UIReceiveCalculatedData();
    return true;

  case Command::RESTORE_PAGE:
    if (restore_page_pending)
      PageActions::Restore();
    return true;

  case Command::THERMAL_NOTIFICATION:
    PlayResource(_T("IDR_WAV_CLEAR"));
    return true;

#ifdef ANDROID
  case Command::CRASH:
    ShowMessageBox(_T("How embarassing, we're terribly sorry!\n"
                      "Please submit a bug report and "
                      "include the file from the 'crash' directory.\n"
                      "http://bugs.xcsoar.org/newticket\n"
                      "After your report, we'll fix it ASAP."),
                   _T("XCSoar has crashed recently"),
                   MB_OK|MB_ICONERROR);
    return true;
#endif
  }

  return false;
}
Esempio n. 3
0
bool
MainWindow::OnUser(unsigned id)
{
  switch ((Command)id) {
  case Command::GPS_UPDATE:
    UIReceiveSensorData();
    return true;

  case Command::CALCULATED_UPDATE:
    UIReceiveCalculatedData();
    return true;

  case Command::RESTORE_PAGE:
    if (restore_page_pending)
      PageActions::Restore();
    return true;
  }

  return false;
}