Beispiel #1
0
/*--------------------------------------------------------------------------*/
static void
no_download( void )
{
	gchar *date_min, *date_max, *finish_msg;
	gbTableModel     *table_model;

	gb_debug (DEBUG_UPDATE, "START");

	/* customize finish page for this outcome */
	gnome_druid_page_edge_set_title( GNOME_DRUID_PAGE_EDGE(finish_page),
					 _( "No new data available" ) );
	table_model = gb_table_get_model ();
	date_min = gb_date_fmt (gb_table_model_get_rdate_min (table_model));
	date_max = gb_date_fmt (gb_table_model_get_rdate_max (table_model));
	finish_msg = g_strdup_printf(
		_( "No new redemption data available from selected\n"
		   "download site.\n\n"
		   "GBonds is still configured with redemption data\n"
		   "for %s - %s.\n" ),
		date_min, date_max );
	gnome_druid_page_edge_set_text( GNOME_DRUID_PAGE_EDGE(finish_page), finish_msg );
	g_free( date_min );
	g_free( date_max );
	g_free( finish_msg );

	remote_dir_handle = NULL;

	/* Now jump to the finish page */
	gnome_druid_set_page( GNOME_DRUID(update_druid),
			      GNOME_DRUID_PAGE(finish_page) );

	gb_debug (DEBUG_UPDATE, "END");
}
Beispiel #2
0
Datei: at_new.c Projekt: piki/gat
static gboolean prepare_last_page(GnomeDruidPageEdge *pg, GtkWidget *ign,
    at_druid_info *info) {
  char *desc;
  const char *cmd = EGET(command);
  guint month, day, year;
  if (!cmd || !*cmd) {
    gnome_druid_page_edge_set_text(pg,
      "No command set.  Click \"Back\" to set one.");
    return TRUE;
  }
  gtk_calendar_get_date(GTK_CALENDAR(info->cal), &year, &month, &day);
  desc = g_strdup_printf("When: %02d/%02d/%04d at %02d:%02d\nWhat: %s\n\n"
    "If this is correct, click \"Apply\"", month+1, day, year,
    SGET(hour), SGET(minute), EGET(command));
  gnome_druid_page_edge_set_text(pg, desc);
  g_free(desc);
  return TRUE;
}
static void
ap_show_done (GnomeDruidPageEdge *druidpage,
              GtkWidget *druid,
              gpointer user_data)
{
    const char *msg;
    char *str;
    AcctPeriodInfo *info = user_data;
    ENTER ("info=%p", info);

    /* Translation FIXME: Can this %s-containing message please be
       replaced by one single message? Either this closing went
       successfully ("success", "congratulations") or something else
       should be displayed anyway. */
    msg = _("%s\nCongratulations! You are done closing books!");

    str = g_strdup_printf (msg, get_close_status_str (info));
    gnome_druid_page_edge_set_text (druidpage, str);
    g_free (str);
}
Beispiel #4
0
/*--------------------------------------------------------------------------*/
static void
download_done( DownloadCallbackData *data )
{
	GList            *p;
	GnomeVFSFileInfo *info, tmp_info = {0};
	gchar            *hash_name;
	gchar            *hash_path, *hash_text_uri;
	gchar            *file_path, *file_text_uri;
	gchar            *date_min, *date_max, *finish_msg;
	gchar            *data_dir;
	gbTableModel     *table_model;

	gb_debug (DEBUG_UPDATE, "START");

	/* Rename downloaded files (undo name hash) */
	data_dir = gb_util_get_home_data_dir();
	for ( p=data->list; p != NULL; p=p->next ) {
		info = (GnomeVFSFileInfo *)p->data;
		hash_name = hash_filename( info->name );
		hash_path = g_build_filename( data_dir, hash_name, NULL );
		hash_text_uri = gnome_vfs_get_uri_from_local_path( hash_path );
		file_path = g_build_filename( data_dir, info->name, NULL );
		file_text_uri = gnome_vfs_get_uri_from_local_path( file_path );
		gnome_vfs_get_file_info (hash_text_uri, &tmp_info, GNOME_VFS_FILE_INFO_DEFAULT);
		if ( info->size == tmp_info.size ) {
			gnome_vfs_move( hash_text_uri, file_text_uri, FALSE );
		} else {
			g_warning ("%s: Temporary file size (%"
				   GNOME_VFS_OFFSET_FORMAT_STR
				   ") does not match remote size (%"
				   GNOME_VFS_OFFSET_FORMAT_STR
				   ").",
				   info->name, tmp_info.size, info->size);
			gnome_vfs_unlink (hash_text_uri);
		}
		g_free( hash_name );
		g_free( hash_path );
		g_free( hash_text_uri );
		g_free( file_path );
		g_free( file_text_uri );
	}
	g_free( data_dir );

	/* Now reread redemption tables */
	table_model = gb_table_get_model ();
	gb_table_model_update (table_model);

	/* customize finish page for this outcome */
	gnome_druid_page_edge_set_title( GNOME_DRUID_PAGE_EDGE(finish_page),
					 _( "Download done" ) );
	date_min = gb_date_fmt (gb_table_model_get_rdate_min (table_model));
	date_max = gb_date_fmt (gb_table_model_get_rdate_max (table_model));
	finish_msg = g_strdup_printf(
		_( "GBonds has successfully downloaded "
		   "%d new redemption files.\n\n"
		   "GBonds is now configured with redemption data\n"
		   "for %s - %s.\n" ),
		data->n, date_min, date_max );
	gnome_druid_page_edge_set_text( GNOME_DRUID_PAGE_EDGE(finish_page), finish_msg );
	g_free( date_min );
	g_free( date_max );
	g_free( finish_msg );

	remote_dir_handle = NULL;

	/* Now jump to the finish page */
	gnome_druid_set_page( GNOME_DRUID(update_druid),
			      GNOME_DRUID_PAGE(finish_page) );

	gb_debug (DEBUG_UPDATE, "END");
}