X-Git-Url: https://git.jankratochvil.net/?a=blobdiff_plain;f=src%2Finstall%2Facquire%2Fmain.c;h=26447f40f1b8b815811c70990e06901956247de8;hb=729fd3d6c07aba050261244c59f8feb9fa29549d;hp=abd4799791de67371ad2cc4c4ef9d246575d04a5;hpb=e93e84cb350ed495d755c7971d996bcd18ce4f7c;p=captive.git diff --git a/src/install/acquire/main.c b/src/install/acquire/main.c index abd4799..26447f4 100644 --- a/src/install/acquire/main.c +++ b/src/install/acquire/main.c @@ -41,8 +41,16 @@ #include #include "ui-gnome.h" +#ifdef ENABLE_STANDALONE +#include "standalone-libntfs.h" +#endif + #include +#include +#include + +CaptiveCaptivemodidObject *captivemodid; int optarg_verbose; int optarg_dry; @@ -50,7 +58,6 @@ static int optarg_microsoft_com; static int optarg_scan_disks; static int optarg_scan_disks_quick; static int optarg_text; -static char *optarg_modid_path=G_STRINGIFY(SYSCONFDIR) "/w32-mod-id.captivemodid.xml"; static GList *optarg_scan_path_list; /* of (char *) */ static void acquire_popt_callback @@ -74,8 +81,6 @@ static const struct poptOption popt_table[]={ N_("Disable Gnome UI; --text must be first argument"),NULL), BUG_ACQUIRE_POPT('v',"verbose" ,POPT_ARG_NONE ,&optarg_verbose,0,N_("Display additional debug information"),NULL), BUG_ACQUIRE_POPT('n',"dry" ,POPT_ARG_NONE ,&optarg_dry ,0,N_("No modifications, no files written"),NULL), - BUG_ACQUIRE_POPT(0 ,"modid-path" ,POPT_ARG_STRING|POPT_ARGFLAG_SHOW_DEFAULT,&optarg_modid_path,0, - N_("Path to .captivemodid.xml database"),N_("path")), BUG_ACQUIRE_POPT(0 ,"scan-disks" ,POPT_ARG_NONE ,&optarg_scan_disks,0,N_("Scan all files on local disks"),NULL), BUG_ACQUIRE_POPT(0 ,"scan-disks-quick",POPT_ARG_NONE ,&optarg_scan_disks_quick,0, N_("Scan MS-Windows directories on local disks"),NULL), @@ -116,6 +121,7 @@ static gboolean ui_progress_dummy(GnomeVFSURI *uri) } gboolean (*ui_progress)(GnomeVFSURI *uri)=ui_progress_dummy; +void (*ui_progress_bar)(gint done,gint length); static GList *mod_uri_list_local; static void mod_uri_list_local_init(void) @@ -148,12 +154,12 @@ void scan_disks(void) void microsoft_com(void) { - g_list_foreach(mod_uri_microsoftcom_list(),(GFunc)mod_uri_load,NULL); + g_list_foreach(mod_uri_microsoftcom_list(),(GFunc)mod_uri_load_base_reporting,NULL); } static void scan_batch(void) { - g_list_foreach(optarg_scan_path_list,(GFunc)mod_uri_load,NULL); + g_list_foreach(optarg_scan_path_list,(GFunc)mod_uri_load_base_reporting,NULL); if (optarg_scan_disks_quick) scan_disks_quick(); @@ -198,14 +204,15 @@ gboolean no_gnome; )); #endif - /* Initialize the i18n stuff */ - setlocale(LC_ALL,""); - bindtextdomain(PACKAGE,LOCALEDIR); - textdomain(PACKAGE); + captive_standalone_init(); if (!gnome_vfs_init()) g_error(_("GnomeVFS failed to initialize")); +#ifdef ENABLE_STANDALONE + standalone_libntfs_init(); +#endif + if (argv[1] && !strcmp(argv[1],"--text")) optarg_text=1; @@ -241,6 +248,7 @@ gboolean no_gnome; GnomeProgram *gnome_program; guint handler_id; + captive_standalone_gnome_init(); gnome_init_atexit_disable=FALSE; g_atexit(gnome_init_atexit_handler); gnome_init_g_log_handler_hit=FALSE; @@ -275,15 +283,14 @@ guint handler_id; && ! optarg_microsoft_com); /* Initialize UI here to catch all GLog errors below. */ - if (1 + if (is_interactive && (no_gnome || !ui_gnome_init()) && !ui_line_init()) g_error(_("No UI interface could be initialized")); - if (!captivemodid_load(optarg_modid_path) && !captivemodid_load("./w32-mod-id.captivemodid.xml")) - g_error(_("Unable to load modid database: %s"),optarg_modid_path); + captivemodid=captive_captivemodid_load_default(TRUE); - mod_uri_load(gnome_vfs_uri_new("file://" G_STRINGIFY(VARLIBCAPTIVEDIR))); + mod_uri_load_base_reporting(gnome_vfs_uri_new("file://" G_STRINGIFY(VARLIBCAPTIVEDIR))); if (!is_interactive) scan_batch();