Esempio n. 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;
}
Esempio n. 2
0
static int confirmed_edit_callback (SsdWidget widget, const char *new_value)
{
    SsdEntryContext *ctx = ( SsdEntryContext* ) widget->parent->context;
    const char* mb_text = ctx->mb_text;
    ssd_confirm_dialog("Warning",(char *) mb_text, FALSE, confirm_cb, (void *) widget);

    return 1;
}
static int history_delete_callback (SsdWidget widget, const char *new_value, const void *value,
										    void *data) {
   char message[100];

   if (!new_value[0] || !strcmp(new_value, roadmap_lang_get ("Other city"))) {
   	// do nothing here
      return 0;
   } else if (!strchr(new_value, ',')) {
   	// do nothing
		return 0;
   } else {

   	sprintf(message,"%s\n%s",roadmap_lang_get("Delete history entry"), new_value);
   	ssd_confirm_dialog("Delete History", message,FALSE, delete_callback, (void *)ssd_dialog_get_data ("list"));
	   return 0;
   }
}
Esempio n. 4
0
///////////////////////////////////////////////////////
// Submit all debug info
static void submit (int with_confirmation)
{
   int initialized = 0;

   if (!initialized) {
      roadmap_config_declare( "preferences", &RMCfgDebugInfoServer, CFG_DEBUG_INFO_SERVER_DEFAULT, NULL );
      initialized = 1;
   }
#ifdef IPHONE
   roadmap_main_show_root(NO);
#endif

   if (with_confirmation)
      ssd_confirm_dialog ("Submit logs", "Sending logs requires large amount of data, continue?", TRUE, roadmap_confirmed_debug_info_submit , NULL);
   else
      roadmap_confirmed_debug_info_submit(dec_yes, NULL);
}
Esempio n. 5
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;
}
void ssd_confirm_dialog_timeout (const char *title, const char *text, BOOL default_yes, ConfirmDialogCallback callback, void *context, int seconds) {

   ssd_confirm_dialog (title, text,default_yes,callback, context);
   MessageBoxCallback = ssd_confirm_dialog_close;
   roadmap_main_set_periodic (seconds * 1000, ssd_confirm_dialog_close );
}
Esempio n. 7
0
void roadmap_trip_server_restore_favorites(void){
   ssd_confirm_dialog (roadmap_lang_get("Welcome back"), roadmap_lang_get("Would you like to restore your favorites?"), TRUE, roadmap_trip_server_restore_favorites_cb , NULL);
}