예제 #1
0
static void download_map_done (void) {

   editor_main_set (1);
   navigate_main_reload_data ();
   roadmap_download_subscribe_when_done (NULL);
   roadmap_screen_unfreeze ();
   roadmap_screen_redraw ();
}
예제 #2
0
void roadmap_main_new (const char *title, int width, int height) {

   if (RoadMapMainBox == NULL) {

      RoadMapMainWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL);

#ifdef ROADMAP_USES_GPE
      displaymigration_mark_window (RoadMapMainWindow);
#endif

      gtk_widget_set_events (RoadMapMainWindow, GDK_KEY_PRESS_MASK);

      roadmap_main_set_window_size (RoadMapMainWindow, width, height);

      g_signal_connect (RoadMapMainWindow, "destroy_event",
                        (GCallback)roadmap_main_close,
                        RoadMapMainWindow);

      g_signal_connect (RoadMapMainWindow, "delete_event",
                        (GCallback)roadmap_main_close,
                        NULL);

      g_signal_connect (RoadMapMainWindow, "key_press_event",
                        (GCallback)roadmap_main_key_pressed,
                        NULL);

      RoadMapMainBox = gtk_vbox_new (FALSE, 0);
      gtk_container_add (GTK_CONTAINER(RoadMapMainWindow), RoadMapMainBox);
   }

   gtk_window_set_title (GTK_WINDOW(RoadMapMainWindow), title);

   if (RoadMapMainTitle != NULL) {
      free(RoadMapMainTitle);
   }
   RoadMapMainTitle = strdup (title);
#ifdef FREEMAP_IL
   editor_main_set (1);
#endif
}
예제 #3
0
void roadmap_main_new (const char *title, int width, int height) {
   editor_main_set (1);
}
예제 #4
0
static int editor_download_map (RoadMapDownloadCallbacks *callbacks) {

   static int *fips = NULL;
   static int ProtocolInitialized = 0;
   RoadMapPosition center;
   int count;
   int i;

   if (! ProtocolInitialized) {

      /* PLUGINS NOT SUPPORTED YET.
       * roadmap_plugin_load_all
       *      ("download", roadmap_download_subscribe_protocol);
       */

      roadmap_httpcopy_init (roadmap_download_subscribe_protocol);

      ProtocolInitialized = 1;
   }

   roadmap_screen_get_center (&center);
   count = roadmap_locator_by_position (&center, &fips);

#if defined(__SYMBIAN32__) && !defined(QTMOBILITY)
   fips[0] = 77001;
   count = 1;
#else
   if (count == 0) {

      if (callbacks) {
         fips[0] = 77001;
         count = 1;
      } else {
         roadmap_display_text("Info", "No map available");
         return -1;
      }
   }
#endif
   
#if 0
   for (i = count-1; i >= 0; --i) {

      if (!editor_export_empty (fips[i])) {

         if (!callbacks) {
            roadmap_messagebox("Info", "You must first export your data.");
         }

         return -1;
      }
   }
#endif

   roadmap_screen_freeze ();
   editor_main_set (0);

   roadmap_download_subscribe_when_done (download_map_done);
   roadmap_download_unblock_all ();

   for (i = count-1; i >= 0; --i) {

      int res;

      editor_db_close (fips[i]);
      editor_db_delete (fips[i]);
      res = roadmap_download_get_county (fips[i], 0, callbacks);

      if (res != 0) return -1;
   }

   return 0;
}
예제 #5
0
	void roadmap_main_new (const char */*title*/, int /*width*/, int /*height*/)
	{
	  roadmap_canvas_new(View->GetWindow(), 0, 0);
	  
	  editor_main_set (1);
  }