예제 #1
0
static int report_irrelevant(SsdWidget widget, const char *new_value, void *context){
   char message[200];
   PluginLine line;
   int direction;
   const char *str;
   RoadMapGpsPosition 	*CurrentGpsPoint;

   if (the_active_alert.active_alert_id == -1)
      return 1;

   CurrentGpsPoint = malloc(sizeof(*CurrentGpsPoint));
   if (roadmap_navigate_get_current
         (CurrentGpsPoint, &line, &direction) == -1) {
      roadmap_messagebox ("Error", "Can't find current street.");
      return 0;
   }

   roadmap_trip_set_gps_position ("AlertSelection", "Selection", NULL, CurrentGpsPoint);
   str = (* (RoadMapAlertProviders.provider[the_active_alert.alert_provider]->get_string)) (the_active_alert.active_alert_id);
   if (str != NULL){
      const char *alertStr = roadmap_lang_get(str);
      sprintf(message,"%s\n%s",roadmap_lang_get("Please confirm that the following alert is not relevant:"), alertStr);

      ssd_confirm_dialog("Delete Alert", message,FALSE, delete_callback,  (void *)NULL);
   }
   return 1;
}
예제 #2
0
static void softkey_callback(void) {
    char message[200];
    PluginLine line;
    int direction;
    RoadMapGpsPosition 	*CurrentGpsPoint;

    CurrentGpsPoint = malloc(sizeof(*CurrentGpsPoint));
    if (roadmap_navigate_get_current
            (CurrentGpsPoint, &line, &direction) == -1) {
        roadmap_messagebox ("Error", "Can't find current street.");
        return;
    }

    roadmap_trip_set_gps_position ("AlertSelection", "Selection", NULL, CurrentGpsPoint);

    sprintf(message,"%s\n%s",roadmap_lang_get("Please confirm that the following alert is not relevant:"), roadmap_lang_get((* (RoadMapAlertProvidors.providor[the_active_alert.alert_providor]->get_string)) (the_active_alert.active_alert_id) ));

    ssd_confirm_dialog("Delete Alert", message,FALSE, delete_callback,  (void *)NULL);
    alert_should_be_visible = FALSE;
}