Ejemplo n.º 1
0
void
SystemWidget::OnAction(int id)
{
  switch (id) {
  case REBOOT:
    KoboReboot();
    break;

  case SWITCH_KERNEL:
    SwitchKernel();
    break;
  }
}
Ejemplo n.º 2
0
void
KoboExecNickel()
{
#ifdef KOBO
  /* our "rcS" will call the original Kobo "rcS" if start_nickel
     exists */
  mkdir("/mnt/onboard/XCSoarData", 0777);
  mkdir("/mnt/onboard/XCSoarData/kobo", 0777);
  File::CreateExclusive(Path("/mnt/onboard/XCSoarData/kobo/start_nickel"));

  /* unfortunately, a bug in the Kobo applications forces us to reboot
     the Kobo at this point */
  KoboReboot();
#endif
}
Ejemplo n.º 3
0
void
SystemWidget::OnAction(int id)
{
  switch (id) {
  case REBOOT:
    KoboReboot();
    break;

  case SWITCH_KERNEL:
    SwitchKernel();
    break;

  case USB_STORAGE:
    ExportUSBStorage();
    break;
  }
}
Ejemplo n.º 4
0
inline void
SystemWidget::SwitchKernel()
{
#ifdef KOBO
  KoboModel model = DetectKoboModel();
  if (model != KoboModel::MINI &&
      model != KoboModel::GLO &&
      model != KoboModel::TOUCH2 &&
      model != KoboModel::GLO_HD &&
      model != KoboModel::AURA2 &&
      ShowMessageBox(_T("This feature was designed for the Kobo Mini, Touch 2.0, Glo HD and Aura 2, but this is not one.  Use at your own risk.  Continue?"),
                     _T("USB-OTG"), MB_YESNO) != IDYES)
    return;

  const char *otg_kernel_image, *kobo_kernel_image;
  switch (model)
  {
  case KoboModel::GLO_HD:
  case KoboModel::TOUCH2:
    otg_kernel_image = "/opt/xcsoar/lib/kernel/uImage.glohd.otg";
    kobo_kernel_image = "/opt/xcsoar/lib/kernel/uImage.glohd";
    break;

  case KoboModel::AURA2:
    otg_kernel_image = "/opt/xcsoar/lib/kernel/uImage.aura2.otg";
    kobo_kernel_image = "/opt/xcsoar/lib/kernel/uImage.aura2";
    break;

  default:
    otg_kernel_image = "/opt/xcsoar/lib/kernel/uImage.otg";
    kobo_kernel_image = "/opt/xcsoar/lib/kernel/uImage.kobo";
  }

  const char *kernel_image = IsKoboOTGKernel()
    ? kobo_kernel_image
    : otg_kernel_image;

  if (!KoboInstallKernel(kernel_image)) {
      ShowMessageBox(_T("Failed to activate kernel."), _("Error"), MB_OK);
      return;
  }

  KoboReboot();
#endif
}
Ejemplo n.º 5
0
inline void
SystemWidget::SwitchKernel()
{
#ifdef KOBO
  const char *otg_kernel_image = "/opt/xcsoar/lib/kernel/uImage.otg";
  const char *kobo_kernel_image = "/opt/xcsoar/lib/kernel/uImage.kobo";

  const char *kernel_image = IsKoboOTGKernel()
    ? kobo_kernel_image
    : otg_kernel_image;

  if (!KoboInstallKernel(kernel_image)) {
      ShowMessageBox(_T("Failed to activate kernel."), _("Error"), MB_OK);
      return;
  }

  KoboReboot();
#endif
}
Ejemplo n.º 6
0
inline void
SystemWidget::SwitchKernel()
{
#ifdef KOBO
  if (DetectKoboModel() != KoboModel::MINI &&
      ShowMessageBox(_T("This feature was designed for the Kobo Mini, but this is not one.  Use at your own risk.  Continue?"),
                     _T("USB-OTG"), MB_YESNO) != IDYES)
    return;

  const char *otg_kernel_image = "/opt/xcsoar/lib/kernel/uImage.otg";
  const char *kobo_kernel_image = "/opt/xcsoar/lib/kernel/uImage.kobo";

  const char *kernel_image = IsKoboOTGKernel()
    ? kobo_kernel_image
    : otg_kernel_image;

  if (!KoboInstallKernel(kernel_image)) {
      ShowMessageBox(_T("Failed to activate kernel."), _("Error"), MB_OK);
      return;
  }

  KoboReboot();
#endif
}