mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-08-25 02:36:07 +00:00
Change the download_progress and download_failed signals to pass a
* components/services/install/idl/trilobite-eazel-install.idl: * components/services/install/lib/eazel-install-corba-callback.c: (impl_download_progress), (impl_download_failed): * components/services/install/lib/eazel-install-corba-types.c: (corba_packagedatastruct_from_packagedata): * components/services/install/lib/eazel-install-object.c: (eazel_install_fetch_remote_package_list), (eazel_install_emit_download_progress), (eazel_install_emit_download_progress_default), (eazel_install_emit_download_failed), (eazel_install_emit_download_failed_default): * components/services/install/lib/eazel-install-protocols.c: (http_fetch_remote_file), (ftp_fetch_remote_file), (gnome_vfs_xfer_callback), (gnome_vfs_fetch_remote_file), (local_fetch_remote_file), (eazel_install_fetch_file), (eazel_install_fetch_package): * components/services/install/lib/eazel-install-protocols.h: * components/services/install/lib/eazel-install-public.h: Change the download_progress and download_failed signals to pass a PackageData struct (and not a char*) just like every other signal, now that we can do that. Fix a missing bytesize fill-in in one of the corba conversion functions. Also, make the non-slim build use the file-rename trick from the bootstrap installer, to ensure that uncompleted downloads are never treated like valid package files. * components/rpmview/nautilus-rpm-view-install.c: (nautilus_rpm_view_download_progress_signal), (nautilus_rpm_view_download_failed): * components/services/install/command-line/eazel-alt-install-corba. c: (eazel_download_progress_signal), (download_failed), (something_failed): Fix rpm view and command-line install to use the new download signal signatures. * components/services/install/nautilus-view/nautilus-service-instal l-view.c: (nautilus_service_install_downloading), (nautilus_service_install_preflight_check), (nautilus_service_install_download_failed), (nautilus_service_install_installing), (nautilus_service_install_done), (nautilus_service_install_view_update_from_uri): Use the new download signal signatures to draw a nifty progress bar for the overall download (where 90% of most users' time will be spent in this view). Scale the progress bar to match the package files' expected sizes (softcat bug to be fixed in 1.0). Leave the throbber on during the downloads so they can be aborted. Don't offer to erase rpms if the package was already installed (and therefore not downloaded).
This commit is contained in:
parent
c621843a87
commit
8efb99a531
54
ChangeLog
54
ChangeLog
|
@ -1,3 +1,57 @@
|
||||||
|
2001-01-22 Robey Pointer <robey@eazel.com>
|
||||||
|
|
||||||
|
* components/services/install/idl/trilobite-eazel-install.idl:
|
||||||
|
* components/services/install/lib/eazel-install-corba-callback.c:
|
||||||
|
(impl_download_progress), (impl_download_failed):
|
||||||
|
* components/services/install/lib/eazel-install-corba-types.c:
|
||||||
|
(corba_packagedatastruct_from_packagedata):
|
||||||
|
* components/services/install/lib/eazel-install-object.c:
|
||||||
|
(eazel_install_fetch_remote_package_list),
|
||||||
|
(eazel_install_emit_download_progress),
|
||||||
|
(eazel_install_emit_download_progress_default),
|
||||||
|
(eazel_install_emit_download_failed),
|
||||||
|
(eazel_install_emit_download_failed_default):
|
||||||
|
* components/services/install/lib/eazel-install-protocols.c:
|
||||||
|
(http_fetch_remote_file), (ftp_fetch_remote_file),
|
||||||
|
(gnome_vfs_xfer_callback), (gnome_vfs_fetch_remote_file),
|
||||||
|
(local_fetch_remote_file), (eazel_install_fetch_file),
|
||||||
|
(eazel_install_fetch_package):
|
||||||
|
* components/services/install/lib/eazel-install-protocols.h:
|
||||||
|
* components/services/install/lib/eazel-install-public.h:
|
||||||
|
|
||||||
|
Change the download_progress and download_failed signals to pass a
|
||||||
|
PackageData struct (and not a char*) just like every other signal,
|
||||||
|
now that we can do that. Fix a missing bytesize fill-in in one of
|
||||||
|
the corba conversion functions. Also, make the non-slim build use
|
||||||
|
the file-rename trick from the bootstrap installer, to ensure that
|
||||||
|
uncompleted downloads are never treated like valid package files.
|
||||||
|
|
||||||
|
* components/rpmview/nautilus-rpm-view-install.c:
|
||||||
|
(nautilus_rpm_view_download_progress_signal),
|
||||||
|
(nautilus_rpm_view_download_failed):
|
||||||
|
* components/services/install/command-line/eazel-alt-install-corba.
|
||||||
|
c: (eazel_download_progress_signal), (download_failed),
|
||||||
|
(something_failed):
|
||||||
|
|
||||||
|
Fix rpm view and command-line install to use the new download
|
||||||
|
signal signatures.
|
||||||
|
|
||||||
|
* components/services/install/nautilus-view/nautilus-service-instal
|
||||||
|
l-view.c: (nautilus_service_install_downloading),
|
||||||
|
(nautilus_service_install_preflight_check),
|
||||||
|
(nautilus_service_install_download_failed),
|
||||||
|
(nautilus_service_install_installing),
|
||||||
|
(nautilus_service_install_done),
|
||||||
|
(nautilus_service_install_view_update_from_uri):
|
||||||
|
|
||||||
|
Use the new download signal signatures to draw a nifty progress
|
||||||
|
bar for the overall download (where 90% of most users' time will
|
||||||
|
be spent in this view). Scale the progress bar to match the
|
||||||
|
package files' expected sizes (softcat bug to be fixed in 1.0).
|
||||||
|
Leave the throbber on during the downloads so they can be
|
||||||
|
aborted. Don't offer to erase rpms if the package was already
|
||||||
|
installed (and therefore not downloaded).
|
||||||
|
|
||||||
2001-01-22 Arlo Rose <arlo@eazel.com>
|
2001-01-22 Arlo Rose <arlo@eazel.com>
|
||||||
|
|
||||||
A whole mess of files checked in to add a new color variation
|
A whole mess of files checked in to add a new color variation
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nautilus_rpm_view_download_progress_signal (EazelInstallCallback *service,
|
nautilus_rpm_view_download_progress_signal (EazelInstallCallback *service,
|
||||||
const char *name,
|
const PackageData *pack,
|
||||||
int amount,
|
int amount,
|
||||||
int total,
|
int total,
|
||||||
NautilusRPMView *rpm_view)
|
NautilusRPMView *rpm_view)
|
||||||
|
@ -88,10 +88,11 @@ nautilus_rpm_view_install_progress_signal (EazelInstallCallback *service,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nautilus_rpm_view_download_failed (EazelInstallCallback *service,
|
nautilus_rpm_view_download_failed (EazelInstallCallback *service,
|
||||||
const char *name,
|
const PackageData *pack,
|
||||||
NautilusRPMView *rpm_view)
|
NautilusRPMView *rpm_view)
|
||||||
{
|
{
|
||||||
trilobite_debug ("Download of %s FAILED", name);
|
g_assert (pack->name != NULL);
|
||||||
|
trilobite_debug ("Download of %s FAILED", pack->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -498,7 +498,7 @@ create_package (char *name, int local_file)
|
||||||
* package-name [ "?version=" version ] ( ";" package-name [ "?version=" version ] )*
|
* package-name [ "?version=" version ] ( ";" package-name [ "?version=" version ] )*
|
||||||
*
|
*
|
||||||
* eazel-install:xfig
|
* eazel-install:xfig
|
||||||
* eazel-install://anonymous@freeamp
|
* eazel-install://anonymous@/freeamp
|
||||||
* eazel-install://example.com:8888/nautilus?version=1.0;xpdf;sephiroth?version=0.4
|
* eazel-install://example.com:8888/nautilus?version=1.0;xpdf;sephiroth?version=0.4
|
||||||
*/
|
*/
|
||||||
/* returns TRUE if a hostname was parsed from the uri */
|
/* returns TRUE if a hostname was parsed from the uri */
|
||||||
|
@ -654,28 +654,26 @@ current_progress_bar_complete (NautilusServiceInstallView *view, const char *tex
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nautilus_service_install_downloading (EazelInstallCallback *cb, const char *name, int amount, int total,
|
nautilus_service_install_downloading (EazelInstallCallback *cb, const PackageData *pack, int amount, int total,
|
||||||
NautilusServiceInstallView *view)
|
NautilusServiceInstallView *view)
|
||||||
{
|
{
|
||||||
char *out;
|
char *out;
|
||||||
const char *root_name, *tmp, *needed_by;
|
const char *needed_by;
|
||||||
GList *iter;
|
GList *iter;
|
||||||
InstallMessage *im = view->details->current_im;
|
InstallMessage *im = view->details->current_im;
|
||||||
|
float fake_amount;
|
||||||
|
|
||||||
if (view->details->installer == NULL) {
|
if (view->details->installer == NULL) {
|
||||||
g_warning ("Got download notice after unref!");
|
g_warning ("Got download notice after unref!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sometimes the "name" is annoyingly the entire path */
|
/* install lib better damn well know the name of the package by the time we download it! */
|
||||||
root_name = name;
|
g_assert (pack->name != NULL);
|
||||||
while ((tmp = strchr (root_name, '/')) != NULL) {
|
|
||||||
root_name = tmp+1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (amount == 0) {
|
if (amount == 0) {
|
||||||
/* could be a redundant zero-trigger for the same rpm... */
|
/* could be a redundant zero-trigger for the same rpm... */
|
||||||
if (view->details->current_rpm && (strcmp (view->details->current_rpm, root_name) == 0)) {
|
if (view->details->current_rpm && (strcmp (view->details->current_rpm, pack->name) == 0)) {
|
||||||
/* spin_cylon (view); */
|
/* spin_cylon (view); */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -684,38 +682,35 @@ nautilus_service_install_downloading (EazelInstallCallback *cb, const char *name
|
||||||
gtk_timeout_remove (view->details->cylon_timer);
|
gtk_timeout_remove (view->details->cylon_timer);
|
||||||
view->details->cylon_timer = 0;
|
view->details->cylon_timer = 0;
|
||||||
}
|
}
|
||||||
turn_cylon_off (view, 0.0);
|
|
||||||
|
|
||||||
g_free (view->details->current_rpm);
|
g_free (view->details->current_rpm);
|
||||||
view->details->current_rpm = g_strdup (root_name);
|
view->details->current_rpm = g_strdup (pack->name);
|
||||||
|
|
||||||
show_overall_feedback (view, " ");
|
|
||||||
|
|
||||||
/* figure out if this is a toplevel package, and if so, update the header */
|
/* figure out if this is a toplevel package, and if so, update the header */
|
||||||
for (iter = g_list_first (((CategoryData *)(view->details->categories->data))->packages);
|
for (iter = g_list_first (((CategoryData *)(view->details->categories->data))->packages);
|
||||||
iter != NULL; iter = g_list_next (iter)) {
|
iter != NULL; iter = g_list_next (iter)) {
|
||||||
PackageData *pack = (PackageData *)(iter->data);
|
PackageData *pack2 = (PackageData *)(iter->data);
|
||||||
if ((pack->name != NULL) && (strcmp (pack->name, name) == 0)) {
|
if ((pack2->name != NULL) && (strcmp (pack2->name, pack->name) == 0)) {
|
||||||
out = g_strdup_printf (_("Downloading \"%s\""), name);
|
out = g_strdup_printf (_("Downloading \"%s\""), pack->name);
|
||||||
nautilus_label_set_text (NAUTILUS_LABEL (view->details->package_name), out);
|
nautilus_label_set_text (NAUTILUS_LABEL (view->details->package_name), out);
|
||||||
g_free (out);
|
g_free (out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* new progress message and bar */
|
/* new progress message and bar */
|
||||||
im = view->details->current_im = install_message_new (view, root_name);
|
im = view->details->current_im = install_message_new (view, pack->name);
|
||||||
gtk_progress_set_percentage (GTK_PROGRESS (im->progress_bar), 0.0);
|
gtk_progress_set_percentage (GTK_PROGRESS (im->progress_bar), 0.0);
|
||||||
out = g_strdup_printf (_("0K of %dK"), total/1024);
|
out = g_strdup_printf (_("0K of %dK"), total/1024);
|
||||||
nautilus_label_set_text (NAUTILUS_LABEL (im->progress_label), out);
|
nautilus_label_set_text (NAUTILUS_LABEL (im->progress_label), out);
|
||||||
g_free (out);
|
g_free (out);
|
||||||
view->details->last_k = 0;
|
view->details->last_k = 0;
|
||||||
|
|
||||||
needed_by = g_hash_table_lookup (view->details->deps, root_name);
|
needed_by = g_hash_table_lookup (view->details->deps, pack->name);
|
||||||
if (needed_by != NULL) {
|
if (needed_by != NULL) {
|
||||||
out = g_strdup_printf (_("The package \"%s\" needs \"%s\" to run.\nI'm now attempting to download it."),
|
out = g_strdup_printf (_("The package \"%s\" needs \"%s\" to run.\nI'm now attempting to download it."),
|
||||||
needed_by, root_name);
|
needed_by, pack->name);
|
||||||
} else {
|
} else {
|
||||||
out = g_strdup_printf (_("I'm attempting to download package \"%s\"."), root_name);
|
out = g_strdup_printf (_("I'm attempting to download package \"%s\"."), pack->name);
|
||||||
}
|
}
|
||||||
nautilus_label_set_text (NAUTILUS_LABEL (im->label), out);
|
nautilus_label_set_text (NAUTILUS_LABEL (im->label), out);
|
||||||
g_free (out);
|
g_free (out);
|
||||||
|
@ -723,12 +718,12 @@ nautilus_service_install_downloading (EazelInstallCallback *cb, const char *name
|
||||||
/* done! */
|
/* done! */
|
||||||
current_progress_bar_complete (view, _("Complete"));
|
current_progress_bar_complete (view, _("Complete"));
|
||||||
gtk_progress_set_percentage (GTK_PROGRESS (im->progress_bar), 1.0);
|
gtk_progress_set_percentage (GTK_PROGRESS (im->progress_bar), 1.0);
|
||||||
needed_by = g_hash_table_lookup (view->details->deps, root_name);
|
needed_by = g_hash_table_lookup (view->details->deps, pack->name);
|
||||||
if (needed_by != NULL) {
|
if (needed_by != NULL) {
|
||||||
out = g_strdup_printf (_("The package \"%s\" needs \"%s\" to run.\nI've downloaded it successfully."),
|
out = g_strdup_printf (_("The package \"%s\" needs \"%s\" to run.\nI've downloaded it successfully."),
|
||||||
needed_by, root_name);
|
needed_by, pack->name);
|
||||||
} else {
|
} else {
|
||||||
out = g_strdup_printf (_("I've successfully downloaded package \"%s\"."), root_name);
|
out = g_strdup_printf (_("I've successfully downloaded package \"%s\"."), pack->name);
|
||||||
}
|
}
|
||||||
nautilus_label_set_text (NAUTILUS_LABEL (im->label), out);
|
nautilus_label_set_text (NAUTILUS_LABEL (im->label), out);
|
||||||
g_free (out);
|
g_free (out);
|
||||||
|
@ -736,13 +731,11 @@ nautilus_service_install_downloading (EazelInstallCallback *cb, const char *name
|
||||||
view->details->current_rpm = NULL;
|
view->details->current_rpm = NULL;
|
||||||
view->details->current_im = NULL;
|
view->details->current_im = NULL;
|
||||||
/* update downloaded bytes */
|
/* update downloaded bytes */
|
||||||
view->details->download_bytes_sofar += total;
|
view->details->download_bytes_sofar += pack->bytesize;
|
||||||
#if 0
|
|
||||||
/* not until we get an rpm size */
|
/* not until we get an rpm size */
|
||||||
gtk_progress_set_percentage (GTK_PROGRESS (view->details->total_progress_bar),
|
gtk_progress_set_percentage (GTK_PROGRESS (view->details->total_progress_bar),
|
||||||
(float) view->details->download_bytes_sofar /
|
(float) view->details->download_bytes_sofar /
|
||||||
(float) view->details->download_bytes_total);
|
(float) view->details->download_bytes_total);
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
/* could be a leftover event, after user hit STOP (in which case, current_im = NULL) */
|
/* could be a leftover event, after user hit STOP (in which case, current_im = NULL) */
|
||||||
if ((im != NULL) && (im->progress_bar != NULL)) {
|
if ((im != NULL) && (im->progress_bar != NULL)) {
|
||||||
|
@ -755,6 +748,16 @@ nautilus_service_install_downloading (EazelInstallCallback *cb, const char *name
|
||||||
view->details->last_k = (amount/1024);
|
view->details->last_k = (amount/1024);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* so, for PR3, we are given a "size" field in the softcat XML which is actually
|
||||||
|
* the size of the decompressed files. so this little hocus-pocus scales the
|
||||||
|
* actual size (which we know once we start downloading the file) to match the
|
||||||
|
* previously-assumed size
|
||||||
|
*/
|
||||||
|
fake_amount = (float)amount * (float)pack->bytesize / (float)total;
|
||||||
|
gtk_progress_set_percentage (GTK_PROGRESS (view->details->total_progress_bar),
|
||||||
|
((float) view->details->download_bytes_sofar + fake_amount) /
|
||||||
|
(float) view->details->download_bytes_total);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -854,8 +857,6 @@ nautilus_service_install_preflight_check (EazelInstallCallback *cb, const GList
|
||||||
char *out;
|
char *out;
|
||||||
unsigned long total_k;
|
unsigned long total_k;
|
||||||
|
|
||||||
/* no longer "loading" anything */
|
|
||||||
nautilus_view_report_load_complete (view->details->nautilus_view);
|
|
||||||
/* turn off the cylon and show "real" progress */
|
/* turn off the cylon and show "real" progress */
|
||||||
turn_cylon_off (view, 0.0);
|
turn_cylon_off (view, 0.0);
|
||||||
|
|
||||||
|
@ -920,9 +921,9 @@ nautilus_service_install_preflight_check (EazelInstallCallback *cb, const GList
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_list_length (package_list) == 1) {
|
if (g_list_length (package_list) == 1) {
|
||||||
out = g_strdup (_("Preparing to download 1 package"));
|
out = g_strdup (_("Downloading 1 package"));
|
||||||
} else {
|
} else {
|
||||||
out = g_strdup_printf (_("Preparing to download %d packages"), g_list_length (package_list));
|
out = g_strdup_printf (_("Downloading %d packages"), g_list_length (package_list));
|
||||||
}
|
}
|
||||||
show_overall_feedback (view, out);
|
show_overall_feedback (view, out);
|
||||||
g_free (out);
|
g_free (out);
|
||||||
|
@ -934,17 +935,19 @@ nautilus_service_install_preflight_check (EazelInstallCallback *cb, const GList
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nautilus_service_install_download_failed (EazelInstallCallback *cb, const char *name,
|
nautilus_service_install_download_failed (EazelInstallCallback *cb, const PackageData *pack,
|
||||||
NautilusServiceInstallView *view)
|
NautilusServiceInstallView *view)
|
||||||
{
|
{
|
||||||
char *out;
|
char *out, *tmp;
|
||||||
|
|
||||||
turn_cylon_off (view, 0.0);
|
turn_cylon_off (view, 0.0);
|
||||||
|
|
||||||
/* no longer "loading" anything */
|
/* no longer "loading" anything */
|
||||||
nautilus_view_report_load_complete (view->details->nautilus_view);
|
nautilus_view_report_load_complete (view->details->nautilus_view);
|
||||||
|
|
||||||
out = g_strdup_printf (_("Download of package \"%s\" failed!"), name);
|
tmp = packagedata_get_readable_name (pack);
|
||||||
|
out = g_strdup_printf (_("Download of package \"%s\" failed!"), tmp);
|
||||||
|
g_free (tmp);
|
||||||
if (view->details->current_im != NULL) {
|
if (view->details->current_im != NULL) {
|
||||||
nautilus_label_set_text (NAUTILUS_LABEL (view->details->current_im->label), out);
|
nautilus_label_set_text (NAUTILUS_LABEL (view->details->current_im->label), out);
|
||||||
}
|
}
|
||||||
|
@ -992,6 +995,9 @@ nautilus_service_install_installing (EazelInstallCallback *cb, const PackageData
|
||||||
|
|
||||||
im = view->details->current_im;
|
im = view->details->current_im;
|
||||||
if (current_package != view->details->current_package) {
|
if (current_package != view->details->current_package) {
|
||||||
|
/* no longer "loading" anything */
|
||||||
|
nautilus_view_report_load_complete (view->details->nautilus_view);
|
||||||
|
|
||||||
/* starting a new package -- create new progress indicator */
|
/* starting a new package -- create new progress indicator */
|
||||||
out = g_strdup_printf (_("Installing package %d of %d"), current_package, total_packages);
|
out = g_strdup_printf (_("Installing package %d of %d"), current_package, total_packages);
|
||||||
show_overall_feedback (view, out);
|
show_overall_feedback (view, out);
|
||||||
|
@ -1287,7 +1293,7 @@ nautilus_service_install_done (EazelInstallCallback *cb, gboolean success, Nauti
|
||||||
real_message = g_strdup_printf (_("%s\n%s\nErase the leftover RPM files?"),
|
real_message = g_strdup_printf (_("%s\n%s\nErase the leftover RPM files?"),
|
||||||
message,
|
message,
|
||||||
nautilus_install_service_locate_menu_entries (view));
|
nautilus_install_service_locate_menu_entries (view));
|
||||||
} else if (view->details->cancelled_before_downloads) {
|
} else if (view->details->cancelled_before_downloads || view->details->already_installed) {
|
||||||
real_message = g_strdup (message);
|
real_message = g_strdup (message);
|
||||||
question_dialog = FALSE;
|
question_dialog = FALSE;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1567,8 +1573,6 @@ nautilus_service_install_view_update_from_uri (NautilusServiceInstallView *view,
|
||||||
}
|
}
|
||||||
GNOME_Trilobite_Eazel_Install__set_test_mode (service, FALSE, &ev);
|
GNOME_Trilobite_Eazel_Install__set_test_mode (service, FALSE, &ev);
|
||||||
|
|
||||||
/* attempt to create a directory we can use */
|
|
||||||
|
|
||||||
gtk_signal_connect (GTK_OBJECT (view->details->installer), "download_progress",
|
gtk_signal_connect (GTK_OBJECT (view->details->installer), "download_progress",
|
||||||
GTK_SIGNAL_FUNC (nautilus_service_install_downloading), view);
|
GTK_SIGNAL_FUNC (nautilus_service_install_downloading), view);
|
||||||
gtk_signal_connect (GTK_OBJECT (view->details->installer), "download_failed",
|
gtk_signal_connect (GTK_OBJECT (view->details->installer), "download_failed",
|
||||||
|
@ -1589,7 +1593,7 @@ nautilus_service_install_view_update_from_uri (NautilusServiceInstallView *view,
|
||||||
|
|
||||||
CORBA_exception_free (&ev);
|
CORBA_exception_free (&ev);
|
||||||
|
|
||||||
show_overall_feedback (view, _("Contacting software catalog ..."));
|
show_overall_feedback (view, _("Contacting the software catalog ..."));
|
||||||
|
|
||||||
/* might take a while... cylon a bit */
|
/* might take a while... cylon a bit */
|
||||||
gtk_progress_set_activity_mode (GTK_PROGRESS (view->details->total_progress_bar), TRUE);
|
gtk_progress_set_activity_mode (GTK_PROGRESS (view->details->total_progress_bar), TRUE);
|
||||||
|
|
|
@ -270,7 +270,7 @@ set_parameters_from_command_line (GNOME_Trilobite_Eazel_Install service)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
eazel_download_progress_signal (EazelInstallCallback *service,
|
eazel_download_progress_signal (EazelInstallCallback *service,
|
||||||
const char *name,
|
const PackageData *pack,
|
||||||
int amount,
|
int amount,
|
||||||
int total,
|
int total,
|
||||||
char *title)
|
char *title)
|
||||||
|
@ -283,10 +283,12 @@ eazel_download_progress_signal (EazelInstallCallback *service,
|
||||||
time_t diff;
|
time_t diff;
|
||||||
static float ks=0;
|
static float ks=0;
|
||||||
|
|
||||||
|
g_assert (pack->name != NULL);
|
||||||
|
|
||||||
downloaded_files = TRUE;
|
downloaded_files = TRUE;
|
||||||
|
|
||||||
if (amount==0) {
|
if (amount==0) {
|
||||||
fprintf (stdout, "Downloading %s...", name);
|
fprintf (stdout, "Downloading %s...", pack->name);
|
||||||
t = time (NULL);
|
t = time (NULL);
|
||||||
old_pct = pct = 0;
|
old_pct = pct = 0;
|
||||||
} else if (amount != total ) {
|
} else if (amount != total ) {
|
||||||
|
@ -300,24 +302,24 @@ eazel_download_progress_signal (EazelInstallCallback *service,
|
||||||
old_pct = pct;
|
old_pct = pct;
|
||||||
}
|
}
|
||||||
fprintf (stdout, "\rDownloading %s... (%d/%d) = %d%% %.1f Kb/s \r",
|
fprintf (stdout, "\rDownloading %s... (%d/%d) = %d%% %.1f Kb/s \r",
|
||||||
name,
|
pack->name,
|
||||||
amount, total, pct,
|
amount, total, pct,
|
||||||
ks);
|
ks);
|
||||||
} else {
|
} else {
|
||||||
fprintf (stdout, "\rDownloading %s... (%d/%d) = %d%%",
|
fprintf (stdout, "\rDownloading %s... (%d/%d) = %d%%",
|
||||||
name,
|
pack->name,
|
||||||
amount, total, pct);
|
amount, total, pct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (amount == total && total!=0) {
|
} else if (amount == total && total!=0) {
|
||||||
if (arg_no_pct==0) {
|
if (arg_no_pct==0) {
|
||||||
fprintf (stdout, "\rDownloading %s... (%d/%d) %.1f Kb/s Done \n",
|
fprintf (stdout, "\rDownloading %s... (%d/%d) %.1f Kb/s Done \n",
|
||||||
name,
|
pack->name,
|
||||||
amount, total,
|
amount, total,
|
||||||
ks);
|
ks);
|
||||||
} else {
|
} else {
|
||||||
fprintf (stdout, "Downloading %s... %3.1f KB/s Done\n",
|
fprintf (stdout, "Downloading %s... %3.1f KB/s Done\n",
|
||||||
name, ks);
|
pack->name, ks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fflush (stdout);
|
fflush (stdout);
|
||||||
|
@ -360,10 +362,11 @@ eazel_install_progress_signal (EazelInstallCallback *service,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
download_failed (EazelInstallCallback *service,
|
download_failed (EazelInstallCallback *service,
|
||||||
const char *name,
|
const PackageData *pack,
|
||||||
gpointer unused)
|
gpointer unused)
|
||||||
{
|
{
|
||||||
fprintf (stdout, "Download of %s FAILED\n", name);
|
g_assert (pack->name != NULL);
|
||||||
|
fprintf (stdout, "Download of %s FAILED\n", pack->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This is ridiculous... */
|
/* This is ridiculous... */
|
||||||
|
|
|
@ -115,7 +115,7 @@ module Trilobite {
|
||||||
interface InstallCallback : Bonobo::Unknown {
|
interface InstallCallback : Bonobo::Unknown {
|
||||||
/* Called during download of a file */
|
/* Called during download of a file */
|
||||||
/* make it 2-way so that it will process incoming corba calls */
|
/* make it 2-way so that it will process incoming corba calls */
|
||||||
void download_progress (in string file, in long amount, in long total);
|
void download_progress (in PackageDataStruct package, in long amount, in long total);
|
||||||
|
|
||||||
/* Called when dependency check is being handled */
|
/* Called when dependency check is being handled */
|
||||||
oneway void dependency_check (in PackageDataStruct package, in PackageDataStruct needs);
|
oneway void dependency_check (in PackageDataStruct package, in PackageDataStruct needs);
|
||||||
|
@ -143,7 +143,7 @@ module Trilobite {
|
||||||
|
|
||||||
/* Called whenever a package (un)install fails
|
/* Called whenever a package (un)install fails
|
||||||
*/
|
*/
|
||||||
void download_failed (in string file);
|
void download_failed (in PackageDataStruct package);
|
||||||
/* FIXME bugzilla.eazel.com 1542:
|
/* FIXME bugzilla.eazel.com 1542:
|
||||||
This is what they should be, but orbit-idl's lack of
|
This is what they should be, but orbit-idl's lack of
|
||||||
recursive structures, forces us to encode the structures
|
recursive structures, forces us to encode the structures
|
||||||
|
|
|
@ -70,12 +70,16 @@ typedef struct {
|
||||||
|
|
||||||
static void
|
static void
|
||||||
impl_download_progress (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
|
impl_download_progress (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
|
||||||
const char *name,
|
const GNOME_Trilobite_Eazel_PackageDataStruct *corbapack,
|
||||||
const CORBA_long amount,
|
const CORBA_long amount,
|
||||||
const CORBA_long total,
|
const CORBA_long total,
|
||||||
CORBA_Environment * ev)
|
CORBA_Environment * ev)
|
||||||
{
|
{
|
||||||
gtk_signal_emit (GTK_OBJECT (servant->object), signals[DOWNLOAD_PROGRESS], name, amount, total);
|
PackageData *pack;
|
||||||
|
|
||||||
|
pack = packagedata_from_corba_packagedatastruct (*corbapack);
|
||||||
|
gtk_signal_emit (GTK_OBJECT (servant->object), signals[DOWNLOAD_PROGRESS], pack, amount, total);
|
||||||
|
packagedata_destroy (pack, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static CORBA_boolean
|
static CORBA_boolean
|
||||||
|
@ -113,10 +117,14 @@ impl_preflight_check (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
impl_download_failed (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
|
impl_download_failed (impl_POA_GNOME_Trilobite_Eazel_InstallCallback *servant,
|
||||||
const char *name,
|
const GNOME_Trilobite_Eazel_PackageDataStruct *corbapack,
|
||||||
CORBA_Environment * ev)
|
CORBA_Environment * ev)
|
||||||
{
|
{
|
||||||
gtk_signal_emit (GTK_OBJECT (servant->object), signals[DOWNLOAD_FAILED], name);
|
PackageData *pack;
|
||||||
|
|
||||||
|
pack = packagedata_from_corba_packagedatastruct (*corbapack);
|
||||||
|
gtk_signal_emit (GTK_OBJECT (servant->object), signals[DOWNLOAD_FAILED], pack);
|
||||||
|
packagedata_destroy (pack, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -79,7 +79,6 @@ corba_packagedatastruct_from_packagedata (const PackageData *pack)
|
||||||
corbapack->version = pack->version ? CORBA_string_dup (pack->version) : CORBA_string_dup ("");
|
corbapack->version = pack->version ? CORBA_string_dup (pack->version) : CORBA_string_dup ("");
|
||||||
corbapack->archtype = pack->archtype ? CORBA_string_dup (pack->archtype) : CORBA_string_dup ("");
|
corbapack->archtype = pack->archtype ? CORBA_string_dup (pack->archtype) : CORBA_string_dup ("");
|
||||||
corbapack->filename = pack->filename ? CORBA_string_dup (pack->filename) : CORBA_string_dup ("");
|
corbapack->filename = pack->filename ? CORBA_string_dup (pack->filename) : CORBA_string_dup ("");
|
||||||
corbapack->toplevel = pack->toplevel;
|
|
||||||
|
|
||||||
corbapack->install_root = pack->install_root ? CORBA_string_dup (pack->install_root) : CORBA_string_dup ("");
|
corbapack->install_root = pack->install_root ? CORBA_string_dup (pack->install_root) : CORBA_string_dup ("");
|
||||||
corbapack->md5 = pack->md5 ? CORBA_string_dup (pack->md5) : CORBA_string_dup ("");
|
corbapack->md5 = pack->md5 ? CORBA_string_dup (pack->md5) : CORBA_string_dup ("");
|
||||||
|
@ -100,6 +99,8 @@ corba_packagedatastruct_from_packagedata (const PackageData *pack)
|
||||||
corbapack->release = pack->minor ? CORBA_string_dup (pack->minor) : CORBA_string_dup ("");
|
corbapack->release = pack->minor ? CORBA_string_dup (pack->minor) : CORBA_string_dup ("");
|
||||||
corbapack->summary = pack->summary ? CORBA_string_dup (pack->summary) : CORBA_string_dup ("");
|
corbapack->summary = pack->summary ? CORBA_string_dup (pack->summary) : CORBA_string_dup ("");
|
||||||
corbapack->description = pack->description ? CORBA_string_dup (pack->description) : CORBA_string_dup ("");
|
corbapack->description = pack->description ? CORBA_string_dup (pack->description) : CORBA_string_dup ("");
|
||||||
|
corbapack->bytesize = pack->bytesize;
|
||||||
|
corbapack->toplevel = pack->toplevel;
|
||||||
|
|
||||||
switch (pack->status) {
|
switch (pack->status) {
|
||||||
case PACKAGE_UNKNOWN_STATUS:
|
case PACKAGE_UNKNOWN_STATUS:
|
||||||
|
|
|
@ -115,7 +115,7 @@ void eazel_install_emit_install_progress_default (EazelInstall *service,
|
||||||
const PackageData *pack,
|
const PackageData *pack,
|
||||||
int, int, int, int, int, int);
|
int, int, int, int, int, int);
|
||||||
void eazel_install_emit_download_progress_default (EazelInstall *service,
|
void eazel_install_emit_download_progress_default (EazelInstall *service,
|
||||||
const char *name,
|
const PackageData *package,
|
||||||
int amount,
|
int amount,
|
||||||
int total);
|
int total);
|
||||||
gboolean eazel_install_emit_preflight_check_default (EazelInstall *service,
|
gboolean eazel_install_emit_preflight_check_default (EazelInstall *service,
|
||||||
|
@ -123,7 +123,7 @@ gboolean eazel_install_emit_preflight_check_default (EazelInstall *service,
|
||||||
int total_bytes,
|
int total_bytes,
|
||||||
int total_packages);
|
int total_packages);
|
||||||
void eazel_install_emit_download_failed_default (EazelInstall *service,
|
void eazel_install_emit_download_failed_default (EazelInstall *service,
|
||||||
const char *name);
|
const PackageData *package);
|
||||||
void eazel_install_emit_md5_check_failed_default (EazelInstall *service,
|
void eazel_install_emit_md5_check_failed_default (EazelInstall *service,
|
||||||
const PackageData *pack,
|
const PackageData *pack,
|
||||||
const char *actual_md5);
|
const char *actual_md5);
|
||||||
|
@ -882,17 +882,13 @@ eazel_install_fetch_remote_package_list (EazelInstall *service)
|
||||||
eazel_install_get_server_port (service),
|
eazel_install_get_server_port (service),
|
||||||
eazel_install_get_package_list_storage_path (service)[0]=='/'?"":"/",
|
eazel_install_get_package_list_storage_path (service)[0]=='/'?"":"/",
|
||||||
eazel_install_get_package_list_storage_path (service));
|
eazel_install_get_package_list_storage_path (service));
|
||||||
#ifdef EAZEL_INSTALL_SLIM
|
|
||||||
destination = g_strdup (eazel_install_get_package_list (service));
|
destination = g_strdup (eazel_install_get_package_list (service));
|
||||||
#else /* EAZEL_INSTALL_SLIM */
|
|
||||||
destination = g_strdup_printf ("file://%s",
|
|
||||||
eazel_install_get_package_list (service));
|
|
||||||
#endif /* EAZEL_INSTALL_SLIM */
|
|
||||||
|
|
||||||
retval = eazel_install_fetch_file (service,
|
retval = eazel_install_fetch_file (service,
|
||||||
url,
|
url,
|
||||||
"package list",
|
"package list",
|
||||||
destination);
|
destination,
|
||||||
|
NULL);
|
||||||
|
|
||||||
if (!retval) {
|
if (!retval) {
|
||||||
g_warning (_("Unable to retrieve package-list.xml!\n"));
|
g_warning (_("Unable to retrieve package-list.xml!\n"));
|
||||||
|
@ -1285,17 +1281,17 @@ eazel_install_emit_install_progress_default (EazelInstall *service,
|
||||||
|
|
||||||
void
|
void
|
||||||
eazel_install_emit_download_progress (EazelInstall *service,
|
eazel_install_emit_download_progress (EazelInstall *service,
|
||||||
const char *name,
|
const PackageData *pack,
|
||||||
int amount,
|
int amount,
|
||||||
int total)
|
int total)
|
||||||
{
|
{
|
||||||
EAZEL_INSTALL_SANITY(service);
|
EAZEL_INSTALL_SANITY(service);
|
||||||
gtk_signal_emit (GTK_OBJECT (service), signals[DOWNLOAD_PROGRESS], name, amount, total);
|
gtk_signal_emit (GTK_OBJECT (service), signals[DOWNLOAD_PROGRESS], pack, amount, total);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
eazel_install_emit_download_progress_default (EazelInstall *service,
|
eazel_install_emit_download_progress_default (EazelInstall *service,
|
||||||
const char *name,
|
const PackageData *pack,
|
||||||
int amount,
|
int amount,
|
||||||
int total)
|
int total)
|
||||||
{
|
{
|
||||||
|
@ -1304,11 +1300,14 @@ eazel_install_emit_download_progress_default (EazelInstall *service,
|
||||||
CORBA_exception_init (&ev);
|
CORBA_exception_init (&ev);
|
||||||
EAZEL_INSTALL_SANITY(service);
|
EAZEL_INSTALL_SANITY(service);
|
||||||
if (service->callback != CORBA_OBJECT_NIL) {
|
if (service->callback != CORBA_OBJECT_NIL) {
|
||||||
GNOME_Trilobite_Eazel_InstallCallback_download_progress (service->callback, name, amount, total, &ev);
|
GNOME_Trilobite_Eazel_PackageDataStruct *package;
|
||||||
|
package = corba_packagedatastruct_from_packagedata (pack);
|
||||||
|
GNOME_Trilobite_Eazel_InstallCallback_download_progress (service->callback, package, amount, total, &ev);
|
||||||
if (ev._major != CORBA_NO_EXCEPTION) {
|
if (ev._major != CORBA_NO_EXCEPTION) {
|
||||||
/* user has aborted us and gone home -- tell VFS to STOP! */
|
/* user has aborted us and gone home -- tell VFS to STOP! */
|
||||||
service->private->cancel_download = TRUE;
|
service->private->cancel_download = TRUE;
|
||||||
}
|
}
|
||||||
|
CORBA_free (package);
|
||||||
}
|
}
|
||||||
CORBA_exception_free (&ev);
|
CORBA_exception_free (&ev);
|
||||||
#endif /* EAZEL_INSTALL_NO_CORBA */
|
#endif /* EAZEL_INSTALL_NO_CORBA */
|
||||||
|
@ -1408,22 +1407,29 @@ eazel_install_emit_preflight_check_default (EazelInstall *service,
|
||||||
|
|
||||||
void
|
void
|
||||||
eazel_install_emit_download_failed (EazelInstall *service,
|
eazel_install_emit_download_failed (EazelInstall *service,
|
||||||
const char *name)
|
const PackageData *pack)
|
||||||
{
|
{
|
||||||
EAZEL_INSTALL_SANITY(service);
|
EAZEL_INSTALL_SANITY(service);
|
||||||
gtk_signal_emit (GTK_OBJECT (service), signals[DOWNLOAD_FAILED], name);
|
gtk_signal_emit (GTK_OBJECT (service), signals[DOWNLOAD_FAILED], pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
eazel_install_emit_download_failed_default (EazelInstall *service,
|
eazel_install_emit_download_failed_default (EazelInstall *service,
|
||||||
const char *name)
|
const PackageData *pack)
|
||||||
{
|
{
|
||||||
#ifndef EAZEL_INSTALL_NO_CORBA
|
#ifndef EAZEL_INSTALL_NO_CORBA
|
||||||
CORBA_Environment ev;
|
CORBA_Environment ev;
|
||||||
CORBA_exception_init (&ev);
|
CORBA_exception_init (&ev);
|
||||||
EAZEL_INSTALL_SANITY(service);
|
EAZEL_INSTALL_SANITY(service);
|
||||||
if (service->callback != CORBA_OBJECT_NIL) {
|
if (service->callback != CORBA_OBJECT_NIL) {
|
||||||
GNOME_Trilobite_Eazel_InstallCallback_download_failed (service->callback, name, &ev);
|
GNOME_Trilobite_Eazel_PackageDataStruct *package;
|
||||||
|
package = corba_packagedatastruct_from_packagedata (pack);
|
||||||
|
GNOME_Trilobite_Eazel_InstallCallback_download_failed (service->callback, package, &ev);
|
||||||
|
if (ev._major != CORBA_NO_EXCEPTION) {
|
||||||
|
/* user has aborted us and gone home -- tell VFS to STOP! */
|
||||||
|
service->private->cancel_download = TRUE;
|
||||||
|
}
|
||||||
|
CORBA_free (package);
|
||||||
}
|
}
|
||||||
CORBA_exception_free (&ev);
|
CORBA_exception_free (&ev);
|
||||||
#endif /* EAZEL_INSTALL_NO_CORBA */
|
#endif /* EAZEL_INSTALL_NO_CORBA */
|
||||||
|
|
|
@ -55,13 +55,14 @@
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
EazelInstall *service;
|
EazelInstall *service;
|
||||||
const char *file_to_report;
|
const PackageData *package;
|
||||||
} gnome_vfs_callback_struct;
|
} gnome_vfs_callback_struct;
|
||||||
|
|
||||||
typedef gboolean (*eazel_install_file_fetch_function) (gpointer *obj,
|
typedef gboolean (*eazel_install_file_fetch_function) (gpointer *obj,
|
||||||
char *url,
|
char *url,
|
||||||
const char *file_to_report,
|
const char *file_to_report,
|
||||||
const char *target_file);
|
const char *target_file,
|
||||||
|
const PackageData *package);
|
||||||
|
|
||||||
|
|
||||||
#ifdef EAZEL_INSTALL_SLIM
|
#ifdef EAZEL_INSTALL_SLIM
|
||||||
|
@ -69,21 +70,25 @@ typedef gboolean (*eazel_install_file_fetch_function) (gpointer *obj,
|
||||||
gboolean http_fetch_remote_file (EazelInstall *service,
|
gboolean http_fetch_remote_file (EazelInstall *service,
|
||||||
char *url,
|
char *url,
|
||||||
const char *file_to_report,
|
const char *file_to_report,
|
||||||
const char* target_file);
|
const char* target_file,
|
||||||
|
const PackageData *package);
|
||||||
gboolean ftp_fetch_remote_file (EazelInstall *service,
|
gboolean ftp_fetch_remote_file (EazelInstall *service,
|
||||||
char *url,
|
char *url,
|
||||||
const char *file_to_report,
|
const char *file_to_report,
|
||||||
const char* target_file);
|
const char* target_file,
|
||||||
|
const PackageData *package);
|
||||||
#else /* EAZEL_INSTALL_SLIM */
|
#else /* EAZEL_INSTALL_SLIM */
|
||||||
gboolean gnome_vfs_fetch_remote_file (EazelInstall *service,
|
gboolean gnome_vfs_fetch_remote_file (EazelInstall *service,
|
||||||
char *url,
|
char *url,
|
||||||
const char *file_to_report,
|
const char *file_to_report,
|
||||||
const char *target_file);
|
const char *target_file,
|
||||||
|
const PackageData *package);
|
||||||
#endif /* EAZEL_INSTALL_SLIM */
|
#endif /* EAZEL_INSTALL_SLIM */
|
||||||
gboolean local_fetch_remote_file (EazelInstall *service,
|
gboolean local_fetch_remote_file (EazelInstall *service,
|
||||||
char *url,
|
char *url,
|
||||||
const char *file_to_report,
|
const char *file_to_report,
|
||||||
const char* target_file);
|
const char* target_file,
|
||||||
|
const PackageData *package);
|
||||||
|
|
||||||
|
|
||||||
#ifdef EAZEL_INSTALL_SLIM
|
#ifdef EAZEL_INSTALL_SLIM
|
||||||
|
@ -91,7 +96,8 @@ gboolean
|
||||||
http_fetch_remote_file (EazelInstall *service,
|
http_fetch_remote_file (EazelInstall *service,
|
||||||
char *url,
|
char *url,
|
||||||
const char *file_to_report,
|
const char *file_to_report,
|
||||||
const char* target_file)
|
const char* target_file,
|
||||||
|
const PackageData *package)
|
||||||
{
|
{
|
||||||
int length, get_failed;
|
int length, get_failed;
|
||||||
ghttp_request* request;
|
ghttp_request* request;
|
||||||
|
@ -159,13 +165,13 @@ http_fetch_remote_file (EazelInstall *service,
|
||||||
total_bytes = curStat.bytes_total;
|
total_bytes = curStat.bytes_total;
|
||||||
/* Ensure first emit is with amount==0 */
|
/* Ensure first emit is with amount==0 */
|
||||||
if (first_emit && total_bytes > 0) {
|
if (first_emit && total_bytes > 0) {
|
||||||
eazel_install_emit_download_progress (service, report, 0, total_bytes);
|
eazel_install_emit_download_progress (service, package, 0, total_bytes);
|
||||||
first_emit = FALSE;
|
first_emit = FALSE;
|
||||||
}
|
}
|
||||||
/* And that amount==0 & amount==total only occurs once */
|
/* And that amount==0 & amount==total only occurs once */
|
||||||
if (curStat.bytes_read!=0 && (curStat.bytes_read != curStat.bytes_total)) {
|
if (curStat.bytes_read!=0 && (curStat.bytes_read != curStat.bytes_total)) {
|
||||||
eazel_install_emit_download_progress (service,
|
eazel_install_emit_download_progress (service,
|
||||||
report,
|
package,
|
||||||
curStat.bytes_read,
|
curStat.bytes_read,
|
||||||
curStat.bytes_total);
|
curStat.bytes_total);
|
||||||
}
|
}
|
||||||
|
@ -194,7 +200,7 @@ http_fetch_remote_file (EazelInstall *service,
|
||||||
g_main_iteration (FALSE);
|
g_main_iteration (FALSE);
|
||||||
}
|
}
|
||||||
/* Last emit amount==total */
|
/* Last emit amount==total */
|
||||||
eazel_install_emit_download_progress (service, report, total_bytes, total_bytes);
|
eazel_install_emit_download_progress (service, package, total_bytes, total_bytes);
|
||||||
|
|
||||||
if (ghttp_status_code (request) != 200) {
|
if (ghttp_status_code (request) != 200) {
|
||||||
g_warning (_("HTTP error: %d %s"), ghttp_status_code (request),
|
g_warning (_("HTTP error: %d %s"), ghttp_status_code (request),
|
||||||
|
@ -244,7 +250,8 @@ gboolean
|
||||||
ftp_fetch_remote_file (EazelInstall *service,
|
ftp_fetch_remote_file (EazelInstall *service,
|
||||||
char *url,
|
char *url,
|
||||||
const char *file_to_report,
|
const char *file_to_report,
|
||||||
const char* target_file)
|
const char* target_file,
|
||||||
|
const PackageData *package)
|
||||||
{
|
{
|
||||||
trilobite_debug (_("Downloading %s..."), url);
|
trilobite_debug (_("Downloading %s..."), url);
|
||||||
trilobite_debug (_("FTP not supported yet"));
|
trilobite_debug (_("FTP not supported yet"));
|
||||||
|
@ -261,7 +268,7 @@ gnome_vfs_xfer_callback (GnomeVFSXferProgressInfo *info,
|
||||||
static gboolean initial_emit;
|
static gboolean initial_emit;
|
||||||
static gboolean last_emit;
|
static gboolean last_emit;
|
||||||
EazelInstall *service = cbstruct->service;
|
EazelInstall *service = cbstruct->service;
|
||||||
const char *file_to_report = cbstruct->file_to_report;
|
const PackageData *package = cbstruct->package;
|
||||||
|
|
||||||
switch (info->status) {
|
switch (info->status) {
|
||||||
case GNOME_VFS_XFER_PROGRESS_STATUS_VFSERROR:
|
case GNOME_VFS_XFER_PROGRESS_STATUS_VFSERROR:
|
||||||
|
@ -297,18 +304,18 @@ gnome_vfs_xfer_callback (GnomeVFSXferProgressInfo *info,
|
||||||
if (initial_emit && info->file_size>0) {
|
if (initial_emit && info->file_size>0) {
|
||||||
initial_emit = FALSE;
|
initial_emit = FALSE;
|
||||||
eazel_install_emit_download_progress (service,
|
eazel_install_emit_download_progress (service,
|
||||||
file_to_report ? file_to_report : info->source_name,
|
package,
|
||||||
0,
|
0,
|
||||||
info->file_size);
|
info->file_size);
|
||||||
} else if (!last_emit && info->bytes_copied == info->file_size) {
|
} else if (!last_emit && info->bytes_copied == info->file_size) {
|
||||||
last_emit = TRUE;
|
last_emit = TRUE;
|
||||||
eazel_install_emit_download_progress (service,
|
eazel_install_emit_download_progress (service,
|
||||||
file_to_report ? file_to_report : info->source_name,
|
package,
|
||||||
info->file_size,
|
info->file_size,
|
||||||
info->file_size);
|
info->file_size);
|
||||||
} else if (info->bytes_copied > 0) {
|
} else if (info->bytes_copied > 0) {
|
||||||
eazel_install_emit_download_progress (service,
|
eazel_install_emit_download_progress (service,
|
||||||
file_to_report ? file_to_report : info->source_name,
|
package,
|
||||||
info->bytes_copied,
|
info->bytes_copied,
|
||||||
info->file_size);
|
info->file_size);
|
||||||
|
|
||||||
|
@ -337,7 +344,7 @@ gnome_vfs_xfer_callback (GnomeVFSXferProgressInfo *info,
|
||||||
if (!last_emit) {
|
if (!last_emit) {
|
||||||
last_emit = TRUE;
|
last_emit = TRUE;
|
||||||
eazel_install_emit_download_progress (service,
|
eazel_install_emit_download_progress (service,
|
||||||
file_to_report ? file_to_report : info->source_name,
|
package,
|
||||||
info->file_size,
|
info->file_size,
|
||||||
info->file_size);
|
info->file_size);
|
||||||
}
|
}
|
||||||
|
@ -362,22 +369,21 @@ gboolean
|
||||||
gnome_vfs_fetch_remote_file (EazelInstall *service,
|
gnome_vfs_fetch_remote_file (EazelInstall *service,
|
||||||
char *url,
|
char *url,
|
||||||
const char *file_to_report,
|
const char *file_to_report,
|
||||||
const char *target_file)
|
const char *target_file,
|
||||||
|
const PackageData *package)
|
||||||
{
|
{
|
||||||
GnomeVFSResult result;
|
GnomeVFSResult result;
|
||||||
GnomeVFSXferOptions xfer_options = 0;
|
GnomeVFSXferOptions xfer_options = 0;
|
||||||
GnomeVFSURI *src_uri;
|
GnomeVFSURI *src_uri;
|
||||||
GnomeVFSURI *dest_uri;
|
GnomeVFSURI *dest_uri;
|
||||||
char *t_file;
|
char *t_file;
|
||||||
|
char *target_file_premove;
|
||||||
gnome_vfs_callback_struct *cbstruct;
|
gnome_vfs_callback_struct *cbstruct;
|
||||||
|
|
||||||
/* Ensure the target_file has a protocol://,
|
target_file_premove = g_strdup_printf ("%s~", target_file);
|
||||||
if not, prefix a file:// */
|
|
||||||
if (strstr (target_file, "://")==NULL) {
|
/* this will always be a file: uri */
|
||||||
t_file = g_strdup_printf ("file://%s", target_file);
|
t_file = g_strdup_printf ("file://%s", target_file_premove);
|
||||||
} else {
|
|
||||||
t_file = g_strdup (target_file);
|
|
||||||
}
|
|
||||||
|
|
||||||
trilobite_debug ("gnome_vfs_xfer_uri ( %s %s )", url, t_file);
|
trilobite_debug ("gnome_vfs_xfer_uri ( %s %s )", url, t_file);
|
||||||
|
|
||||||
|
@ -388,14 +394,14 @@ gnome_vfs_fetch_remote_file (EazelInstall *service,
|
||||||
gnome_vfs_uri_set_host_name (src_uri, "localhost");
|
gnome_vfs_uri_set_host_name (src_uri, "localhost");
|
||||||
}
|
}
|
||||||
|
|
||||||
dest_uri = gnome_vfs_uri_new (t_file);
|
dest_uri = gnome_vfs_uri_new (target_file_premove);
|
||||||
g_assert (dest_uri != NULL);
|
g_assert (dest_uri != NULL);
|
||||||
|
|
||||||
/* Setup the userdata for the callback, I need both the
|
/* Setup the userdata for the callback, I need both the
|
||||||
service object to emit signals too, and the filename to report */
|
service object to emit signals too, and the filename to report */
|
||||||
cbstruct = g_new0 (gnome_vfs_callback_struct, 1);
|
cbstruct = g_new0 (gnome_vfs_callback_struct, 1);
|
||||||
cbstruct->service = service;
|
cbstruct->service = service;
|
||||||
cbstruct->file_to_report = file_to_report;
|
cbstruct->package = package;
|
||||||
|
|
||||||
/* Execute the gnome_vfs copy */
|
/* Execute the gnome_vfs copy */
|
||||||
service->private->cancel_download = FALSE;
|
service->private->cancel_download = FALSE;
|
||||||
|
@ -408,7 +414,8 @@ gnome_vfs_fetch_remote_file (EazelInstall *service,
|
||||||
|
|
||||||
if (result==GNOME_VFS_OK) {
|
if (result==GNOME_VFS_OK) {
|
||||||
chmod (target_file, 0600);
|
chmod (target_file, 0600);
|
||||||
trilobite_debug ("File download successfull");
|
trilobite_debug ("File download successful");
|
||||||
|
rename (target_file_premove, target_file);
|
||||||
} else {
|
} else {
|
||||||
trilobite_debug ("File download failed");
|
trilobite_debug ("File download failed");
|
||||||
if (result == GNOME_VFS_ERROR_BAD_PARAMETERS) {
|
if (result == GNOME_VFS_ERROR_BAD_PARAMETERS) {
|
||||||
|
@ -435,7 +442,8 @@ gboolean
|
||||||
local_fetch_remote_file (EazelInstall *service,
|
local_fetch_remote_file (EazelInstall *service,
|
||||||
char *url,
|
char *url,
|
||||||
const char *file_to_report,
|
const char *file_to_report,
|
||||||
const char* target_file)
|
const char* target_file,
|
||||||
|
const PackageData *package)
|
||||||
{
|
{
|
||||||
gboolean result;
|
gboolean result;
|
||||||
const char *report;
|
const char *report;
|
||||||
|
@ -447,8 +455,8 @@ local_fetch_remote_file (EazelInstall *service,
|
||||||
struct stat sbuf;
|
struct stat sbuf;
|
||||||
stat (target_file, &sbuf);
|
stat (target_file, &sbuf);
|
||||||
/* Emit bogus download progress */
|
/* Emit bogus download progress */
|
||||||
eazel_install_emit_download_progress (service, report, 0, sbuf.st_size);
|
eazel_install_emit_download_progress (service, package, 0, sbuf.st_size);
|
||||||
eazel_install_emit_download_progress (service, report, sbuf.st_size, sbuf.st_size);
|
eazel_install_emit_download_progress (service, package, sbuf.st_size, sbuf.st_size);
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
@ -516,7 +524,8 @@ gboolean
|
||||||
eazel_install_fetch_file (EazelInstall *service,
|
eazel_install_fetch_file (EazelInstall *service,
|
||||||
char *url,
|
char *url,
|
||||||
const char *file_to_report,
|
const char *file_to_report,
|
||||||
const char* target_file)
|
const char* target_file,
|
||||||
|
const PackageData *package)
|
||||||
{
|
{
|
||||||
gboolean result;
|
gboolean result;
|
||||||
GList *iter;
|
GList *iter;
|
||||||
|
@ -549,21 +558,21 @@ eazel_install_fetch_file (EazelInstall *service,
|
||||||
struct stat buf;
|
struct stat buf;
|
||||||
stat (target_file, &buf);
|
stat (target_file, &buf);
|
||||||
trilobite_debug ("%s already present, not downloading", target_file);
|
trilobite_debug ("%s already present, not downloading", target_file);
|
||||||
eazel_install_emit_download_progress (service, file_to_report, 0, buf.st_size);
|
eazel_install_emit_download_progress (service, package, 0, buf.st_size);
|
||||||
eazel_install_emit_download_progress (service, file_to_report, buf.st_size, buf.st_size);
|
eazel_install_emit_download_progress (service, package, buf.st_size, buf.st_size);
|
||||||
result = TRUE;
|
result = TRUE;
|
||||||
} else {
|
} else {
|
||||||
result = (func_table [eazel_install_get_protocol (service)])((gpointer)service,
|
result = (func_table [eazel_install_get_protocol (service)])((gpointer)service,
|
||||||
url,
|
url,
|
||||||
file_to_report,
|
file_to_report,
|
||||||
target_file);
|
target_file,
|
||||||
|
package);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!result) {
|
if (!result) {
|
||||||
g_warning (_("Failed to retrieve %s!"),
|
g_warning (_("Failed to retrieve %s!"),
|
||||||
file_to_report ? file_to_report : g_basename (target_file));
|
file_to_report ? file_to_report : g_basename (target_file));
|
||||||
eazel_install_emit_download_failed (service,
|
eazel_install_emit_download_failed (service, package);
|
||||||
file_to_report ? file_to_report : g_basename (target_file));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -629,7 +638,7 @@ eazel_install_fetch_package (EazelInstall *service,
|
||||||
targetname = g_strdup_printf ("%s/%s",
|
targetname = g_strdup_printf ("%s/%s",
|
||||||
eazel_install_get_tmp_dir (service),
|
eazel_install_get_tmp_dir (service),
|
||||||
filename_from_url (url));
|
filename_from_url (url));
|
||||||
result = eazel_install_fetch_file (service, url, package->name, targetname);
|
result = eazel_install_fetch_file (service, url, package->name, targetname, package);
|
||||||
if (result) {
|
if (result) {
|
||||||
package = eazel_package_system_load_package (service->private->package_system,
|
package = eazel_package_system_load_package (service->private->package_system,
|
||||||
package,
|
package,
|
||||||
|
|
|
@ -34,7 +34,8 @@
|
||||||
gboolean eazel_install_fetch_file (EazelInstall *service,
|
gboolean eazel_install_fetch_file (EazelInstall *service,
|
||||||
char *url,
|
char *url,
|
||||||
const char *file_to_report,
|
const char *file_to_report,
|
||||||
const char *target_file);
|
const char *target_file,
|
||||||
|
const PackageData *package);
|
||||||
|
|
||||||
gboolean eazel_install_fetch_package (EazelInstall *service,
|
gboolean eazel_install_fetch_package (EazelInstall *service,
|
||||||
PackageData *package);
|
PackageData *package);
|
||||||
|
|
|
@ -73,7 +73,7 @@ struct _EazelInstallClass
|
||||||
BonoboObjectClass parent_class;
|
BonoboObjectClass parent_class;
|
||||||
#endif /* EAZEL_INSTALL_NO_CORBA */
|
#endif /* EAZEL_INSTALL_NO_CORBA */
|
||||||
/* signal prototypes */
|
/* signal prototypes */
|
||||||
void (*download_progress) (EazelInstall *service, const char *file, int amount, int total);
|
void (*download_progress) (EazelInstall *service, const PackageData *package, int amount, int total);
|
||||||
|
|
||||||
gboolean (*preflight_check) (EazelInstall *service,
|
gboolean (*preflight_check) (EazelInstall *service,
|
||||||
GList *packages,
|
GList *packages,
|
||||||
|
@ -89,7 +89,7 @@ struct _EazelInstallClass
|
||||||
/*
|
/*
|
||||||
if the set URLType is PROTOCOL_HTTP, info is a HTTPError struc
|
if the set URLType is PROTOCOL_HTTP, info is a HTTPError struc
|
||||||
*/
|
*/
|
||||||
void (*download_failed) (EazelInstall *service, const char *name);
|
void (*download_failed) (EazelInstall *service, const PackageData *package);
|
||||||
/*
|
/*
|
||||||
if RPM_FAIL is RPM_SRC_NOT_SUPPORTED, info is NULL
|
if RPM_FAIL is RPM_SRC_NOT_SUPPORTED, info is NULL
|
||||||
RPM_DEP_FAIL, info is a GSList of required packages (PackageData objects)
|
RPM_DEP_FAIL, info is a GSList of required packages (PackageData objects)
|
||||||
|
@ -151,13 +151,13 @@ void eazel_install_emit_install_progress (EazelInstall *service,
|
||||||
int package_size_completed, int package_size_total,
|
int package_size_completed, int package_size_total,
|
||||||
int total_size_completed, int total_size);
|
int total_size_completed, int total_size);
|
||||||
void eazel_install_emit_download_progress (EazelInstall *service,
|
void eazel_install_emit_download_progress (EazelInstall *service,
|
||||||
const char *name,
|
const PackageData *package,
|
||||||
int amount,
|
int amount,
|
||||||
int total);
|
int total);
|
||||||
gboolean eazel_install_emit_preflight_check (EazelInstall *service,
|
gboolean eazel_install_emit_preflight_check (EazelInstall *service,
|
||||||
GList *packages);
|
GList *packages);
|
||||||
void eazel_install_emit_download_failed (EazelInstall *service,
|
void eazel_install_emit_download_failed (EazelInstall *service,
|
||||||
const char *name);
|
const PackageData *package);
|
||||||
void eazel_install_emit_md5_check_failed (EazelInstall *service,
|
void eazel_install_emit_md5_check_failed (EazelInstall *service,
|
||||||
const PackageData *pd,
|
const PackageData *pd,
|
||||||
const char *actual_md5);
|
const char *actual_md5);
|
||||||
|
|
|
@ -498,7 +498,7 @@ create_package (char *name, int local_file)
|
||||||
* package-name [ "?version=" version ] ( ";" package-name [ "?version=" version ] )*
|
* package-name [ "?version=" version ] ( ";" package-name [ "?version=" version ] )*
|
||||||
*
|
*
|
||||||
* eazel-install:xfig
|
* eazel-install:xfig
|
||||||
* eazel-install://anonymous@freeamp
|
* eazel-install://anonymous@/freeamp
|
||||||
* eazel-install://example.com:8888/nautilus?version=1.0;xpdf;sephiroth?version=0.4
|
* eazel-install://example.com:8888/nautilus?version=1.0;xpdf;sephiroth?version=0.4
|
||||||
*/
|
*/
|
||||||
/* returns TRUE if a hostname was parsed from the uri */
|
/* returns TRUE if a hostname was parsed from the uri */
|
||||||
|
@ -654,28 +654,26 @@ current_progress_bar_complete (NautilusServiceInstallView *view, const char *tex
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nautilus_service_install_downloading (EazelInstallCallback *cb, const char *name, int amount, int total,
|
nautilus_service_install_downloading (EazelInstallCallback *cb, const PackageData *pack, int amount, int total,
|
||||||
NautilusServiceInstallView *view)
|
NautilusServiceInstallView *view)
|
||||||
{
|
{
|
||||||
char *out;
|
char *out;
|
||||||
const char *root_name, *tmp, *needed_by;
|
const char *needed_by;
|
||||||
GList *iter;
|
GList *iter;
|
||||||
InstallMessage *im = view->details->current_im;
|
InstallMessage *im = view->details->current_im;
|
||||||
|
float fake_amount;
|
||||||
|
|
||||||
if (view->details->installer == NULL) {
|
if (view->details->installer == NULL) {
|
||||||
g_warning ("Got download notice after unref!");
|
g_warning ("Got download notice after unref!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* sometimes the "name" is annoyingly the entire path */
|
/* install lib better damn well know the name of the package by the time we download it! */
|
||||||
root_name = name;
|
g_assert (pack->name != NULL);
|
||||||
while ((tmp = strchr (root_name, '/')) != NULL) {
|
|
||||||
root_name = tmp+1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (amount == 0) {
|
if (amount == 0) {
|
||||||
/* could be a redundant zero-trigger for the same rpm... */
|
/* could be a redundant zero-trigger for the same rpm... */
|
||||||
if (view->details->current_rpm && (strcmp (view->details->current_rpm, root_name) == 0)) {
|
if (view->details->current_rpm && (strcmp (view->details->current_rpm, pack->name) == 0)) {
|
||||||
/* spin_cylon (view); */
|
/* spin_cylon (view); */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -684,38 +682,35 @@ nautilus_service_install_downloading (EazelInstallCallback *cb, const char *name
|
||||||
gtk_timeout_remove (view->details->cylon_timer);
|
gtk_timeout_remove (view->details->cylon_timer);
|
||||||
view->details->cylon_timer = 0;
|
view->details->cylon_timer = 0;
|
||||||
}
|
}
|
||||||
turn_cylon_off (view, 0.0);
|
|
||||||
|
|
||||||
g_free (view->details->current_rpm);
|
g_free (view->details->current_rpm);
|
||||||
view->details->current_rpm = g_strdup (root_name);
|
view->details->current_rpm = g_strdup (pack->name);
|
||||||
|
|
||||||
show_overall_feedback (view, " ");
|
|
||||||
|
|
||||||
/* figure out if this is a toplevel package, and if so, update the header */
|
/* figure out if this is a toplevel package, and if so, update the header */
|
||||||
for (iter = g_list_first (((CategoryData *)(view->details->categories->data))->packages);
|
for (iter = g_list_first (((CategoryData *)(view->details->categories->data))->packages);
|
||||||
iter != NULL; iter = g_list_next (iter)) {
|
iter != NULL; iter = g_list_next (iter)) {
|
||||||
PackageData *pack = (PackageData *)(iter->data);
|
PackageData *pack2 = (PackageData *)(iter->data);
|
||||||
if ((pack->name != NULL) && (strcmp (pack->name, name) == 0)) {
|
if ((pack2->name != NULL) && (strcmp (pack2->name, pack->name) == 0)) {
|
||||||
out = g_strdup_printf (_("Downloading \"%s\""), name);
|
out = g_strdup_printf (_("Downloading \"%s\""), pack->name);
|
||||||
nautilus_label_set_text (NAUTILUS_LABEL (view->details->package_name), out);
|
nautilus_label_set_text (NAUTILUS_LABEL (view->details->package_name), out);
|
||||||
g_free (out);
|
g_free (out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* new progress message and bar */
|
/* new progress message and bar */
|
||||||
im = view->details->current_im = install_message_new (view, root_name);
|
im = view->details->current_im = install_message_new (view, pack->name);
|
||||||
gtk_progress_set_percentage (GTK_PROGRESS (im->progress_bar), 0.0);
|
gtk_progress_set_percentage (GTK_PROGRESS (im->progress_bar), 0.0);
|
||||||
out = g_strdup_printf (_("0K of %dK"), total/1024);
|
out = g_strdup_printf (_("0K of %dK"), total/1024);
|
||||||
nautilus_label_set_text (NAUTILUS_LABEL (im->progress_label), out);
|
nautilus_label_set_text (NAUTILUS_LABEL (im->progress_label), out);
|
||||||
g_free (out);
|
g_free (out);
|
||||||
view->details->last_k = 0;
|
view->details->last_k = 0;
|
||||||
|
|
||||||
needed_by = g_hash_table_lookup (view->details->deps, root_name);
|
needed_by = g_hash_table_lookup (view->details->deps, pack->name);
|
||||||
if (needed_by != NULL) {
|
if (needed_by != NULL) {
|
||||||
out = g_strdup_printf (_("The package \"%s\" needs \"%s\" to run.\nI'm now attempting to download it."),
|
out = g_strdup_printf (_("The package \"%s\" needs \"%s\" to run.\nI'm now attempting to download it."),
|
||||||
needed_by, root_name);
|
needed_by, pack->name);
|
||||||
} else {
|
} else {
|
||||||
out = g_strdup_printf (_("I'm attempting to download package \"%s\"."), root_name);
|
out = g_strdup_printf (_("I'm attempting to download package \"%s\"."), pack->name);
|
||||||
}
|
}
|
||||||
nautilus_label_set_text (NAUTILUS_LABEL (im->label), out);
|
nautilus_label_set_text (NAUTILUS_LABEL (im->label), out);
|
||||||
g_free (out);
|
g_free (out);
|
||||||
|
@ -723,12 +718,12 @@ nautilus_service_install_downloading (EazelInstallCallback *cb, const char *name
|
||||||
/* done! */
|
/* done! */
|
||||||
current_progress_bar_complete (view, _("Complete"));
|
current_progress_bar_complete (view, _("Complete"));
|
||||||
gtk_progress_set_percentage (GTK_PROGRESS (im->progress_bar), 1.0);
|
gtk_progress_set_percentage (GTK_PROGRESS (im->progress_bar), 1.0);
|
||||||
needed_by = g_hash_table_lookup (view->details->deps, root_name);
|
needed_by = g_hash_table_lookup (view->details->deps, pack->name);
|
||||||
if (needed_by != NULL) {
|
if (needed_by != NULL) {
|
||||||
out = g_strdup_printf (_("The package \"%s\" needs \"%s\" to run.\nI've downloaded it successfully."),
|
out = g_strdup_printf (_("The package \"%s\" needs \"%s\" to run.\nI've downloaded it successfully."),
|
||||||
needed_by, root_name);
|
needed_by, pack->name);
|
||||||
} else {
|
} else {
|
||||||
out = g_strdup_printf (_("I've successfully downloaded package \"%s\"."), root_name);
|
out = g_strdup_printf (_("I've successfully downloaded package \"%s\"."), pack->name);
|
||||||
}
|
}
|
||||||
nautilus_label_set_text (NAUTILUS_LABEL (im->label), out);
|
nautilus_label_set_text (NAUTILUS_LABEL (im->label), out);
|
||||||
g_free (out);
|
g_free (out);
|
||||||
|
@ -736,13 +731,11 @@ nautilus_service_install_downloading (EazelInstallCallback *cb, const char *name
|
||||||
view->details->current_rpm = NULL;
|
view->details->current_rpm = NULL;
|
||||||
view->details->current_im = NULL;
|
view->details->current_im = NULL;
|
||||||
/* update downloaded bytes */
|
/* update downloaded bytes */
|
||||||
view->details->download_bytes_sofar += total;
|
view->details->download_bytes_sofar += pack->bytesize;
|
||||||
#if 0
|
|
||||||
/* not until we get an rpm size */
|
/* not until we get an rpm size */
|
||||||
gtk_progress_set_percentage (GTK_PROGRESS (view->details->total_progress_bar),
|
gtk_progress_set_percentage (GTK_PROGRESS (view->details->total_progress_bar),
|
||||||
(float) view->details->download_bytes_sofar /
|
(float) view->details->download_bytes_sofar /
|
||||||
(float) view->details->download_bytes_total);
|
(float) view->details->download_bytes_total);
|
||||||
#endif
|
|
||||||
} else {
|
} else {
|
||||||
/* could be a leftover event, after user hit STOP (in which case, current_im = NULL) */
|
/* could be a leftover event, after user hit STOP (in which case, current_im = NULL) */
|
||||||
if ((im != NULL) && (im->progress_bar != NULL)) {
|
if ((im != NULL) && (im->progress_bar != NULL)) {
|
||||||
|
@ -755,6 +748,16 @@ nautilus_service_install_downloading (EazelInstallCallback *cb, const char *name
|
||||||
view->details->last_k = (amount/1024);
|
view->details->last_k = (amount/1024);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* so, for PR3, we are given a "size" field in the softcat XML which is actually
|
||||||
|
* the size of the decompressed files. so this little hocus-pocus scales the
|
||||||
|
* actual size (which we know once we start downloading the file) to match the
|
||||||
|
* previously-assumed size
|
||||||
|
*/
|
||||||
|
fake_amount = (float)amount * (float)pack->bytesize / (float)total;
|
||||||
|
gtk_progress_set_percentage (GTK_PROGRESS (view->details->total_progress_bar),
|
||||||
|
((float) view->details->download_bytes_sofar + fake_amount) /
|
||||||
|
(float) view->details->download_bytes_total);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -854,8 +857,6 @@ nautilus_service_install_preflight_check (EazelInstallCallback *cb, const GList
|
||||||
char *out;
|
char *out;
|
||||||
unsigned long total_k;
|
unsigned long total_k;
|
||||||
|
|
||||||
/* no longer "loading" anything */
|
|
||||||
nautilus_view_report_load_complete (view->details->nautilus_view);
|
|
||||||
/* turn off the cylon and show "real" progress */
|
/* turn off the cylon and show "real" progress */
|
||||||
turn_cylon_off (view, 0.0);
|
turn_cylon_off (view, 0.0);
|
||||||
|
|
||||||
|
@ -920,9 +921,9 @@ nautilus_service_install_preflight_check (EazelInstallCallback *cb, const GList
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_list_length (package_list) == 1) {
|
if (g_list_length (package_list) == 1) {
|
||||||
out = g_strdup (_("Preparing to download 1 package"));
|
out = g_strdup (_("Downloading 1 package"));
|
||||||
} else {
|
} else {
|
||||||
out = g_strdup_printf (_("Preparing to download %d packages"), g_list_length (package_list));
|
out = g_strdup_printf (_("Downloading %d packages"), g_list_length (package_list));
|
||||||
}
|
}
|
||||||
show_overall_feedback (view, out);
|
show_overall_feedback (view, out);
|
||||||
g_free (out);
|
g_free (out);
|
||||||
|
@ -934,17 +935,19 @@ nautilus_service_install_preflight_check (EazelInstallCallback *cb, const GList
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
nautilus_service_install_download_failed (EazelInstallCallback *cb, const char *name,
|
nautilus_service_install_download_failed (EazelInstallCallback *cb, const PackageData *pack,
|
||||||
NautilusServiceInstallView *view)
|
NautilusServiceInstallView *view)
|
||||||
{
|
{
|
||||||
char *out;
|
char *out, *tmp;
|
||||||
|
|
||||||
turn_cylon_off (view, 0.0);
|
turn_cylon_off (view, 0.0);
|
||||||
|
|
||||||
/* no longer "loading" anything */
|
/* no longer "loading" anything */
|
||||||
nautilus_view_report_load_complete (view->details->nautilus_view);
|
nautilus_view_report_load_complete (view->details->nautilus_view);
|
||||||
|
|
||||||
out = g_strdup_printf (_("Download of package \"%s\" failed!"), name);
|
tmp = packagedata_get_readable_name (pack);
|
||||||
|
out = g_strdup_printf (_("Download of package \"%s\" failed!"), tmp);
|
||||||
|
g_free (tmp);
|
||||||
if (view->details->current_im != NULL) {
|
if (view->details->current_im != NULL) {
|
||||||
nautilus_label_set_text (NAUTILUS_LABEL (view->details->current_im->label), out);
|
nautilus_label_set_text (NAUTILUS_LABEL (view->details->current_im->label), out);
|
||||||
}
|
}
|
||||||
|
@ -992,6 +995,9 @@ nautilus_service_install_installing (EazelInstallCallback *cb, const PackageData
|
||||||
|
|
||||||
im = view->details->current_im;
|
im = view->details->current_im;
|
||||||
if (current_package != view->details->current_package) {
|
if (current_package != view->details->current_package) {
|
||||||
|
/* no longer "loading" anything */
|
||||||
|
nautilus_view_report_load_complete (view->details->nautilus_view);
|
||||||
|
|
||||||
/* starting a new package -- create new progress indicator */
|
/* starting a new package -- create new progress indicator */
|
||||||
out = g_strdup_printf (_("Installing package %d of %d"), current_package, total_packages);
|
out = g_strdup_printf (_("Installing package %d of %d"), current_package, total_packages);
|
||||||
show_overall_feedback (view, out);
|
show_overall_feedback (view, out);
|
||||||
|
@ -1287,7 +1293,7 @@ nautilus_service_install_done (EazelInstallCallback *cb, gboolean success, Nauti
|
||||||
real_message = g_strdup_printf (_("%s\n%s\nErase the leftover RPM files?"),
|
real_message = g_strdup_printf (_("%s\n%s\nErase the leftover RPM files?"),
|
||||||
message,
|
message,
|
||||||
nautilus_install_service_locate_menu_entries (view));
|
nautilus_install_service_locate_menu_entries (view));
|
||||||
} else if (view->details->cancelled_before_downloads) {
|
} else if (view->details->cancelled_before_downloads || view->details->already_installed) {
|
||||||
real_message = g_strdup (message);
|
real_message = g_strdup (message);
|
||||||
question_dialog = FALSE;
|
question_dialog = FALSE;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1567,8 +1573,6 @@ nautilus_service_install_view_update_from_uri (NautilusServiceInstallView *view,
|
||||||
}
|
}
|
||||||
GNOME_Trilobite_Eazel_Install__set_test_mode (service, FALSE, &ev);
|
GNOME_Trilobite_Eazel_Install__set_test_mode (service, FALSE, &ev);
|
||||||
|
|
||||||
/* attempt to create a directory we can use */
|
|
||||||
|
|
||||||
gtk_signal_connect (GTK_OBJECT (view->details->installer), "download_progress",
|
gtk_signal_connect (GTK_OBJECT (view->details->installer), "download_progress",
|
||||||
GTK_SIGNAL_FUNC (nautilus_service_install_downloading), view);
|
GTK_SIGNAL_FUNC (nautilus_service_install_downloading), view);
|
||||||
gtk_signal_connect (GTK_OBJECT (view->details->installer), "download_failed",
|
gtk_signal_connect (GTK_OBJECT (view->details->installer), "download_failed",
|
||||||
|
@ -1589,7 +1593,7 @@ nautilus_service_install_view_update_from_uri (NautilusServiceInstallView *view,
|
||||||
|
|
||||||
CORBA_exception_free (&ev);
|
CORBA_exception_free (&ev);
|
||||||
|
|
||||||
show_overall_feedback (view, _("Contacting software catalog ..."));
|
show_overall_feedback (view, _("Contacting the software catalog ..."));
|
||||||
|
|
||||||
/* might take a while... cylon a bit */
|
/* might take a while... cylon a bit */
|
||||||
gtk_progress_set_activity_mode (GTK_PROGRESS (view->details->total_progress_bar), TRUE);
|
gtk_progress_set_activity_mode (GTK_PROGRESS (view->details->total_progress_bar), TRUE);
|
||||||
|
|
Loading…
Reference in a new issue