diff options
author | Eskil Heyn Olsen <eskil@src.gnome.org> | 2000-08-11 03:17:55 +0000 |
---|---|---|
committer | Eskil Heyn Olsen <eskil@src.gnome.org> | 2000-08-11 03:17:55 +0000 |
commit | 2ac9b4577534a6c0c4319eda894033a75da0b8c8 (patch) | |
tree | 7d754c0afd808ee581210d40621bea1aa05d2613 | |
parent | b8592d8bc1112b67521f7a57117bad85bbd0fad5 (diff) | |
download | nautilus-2ac9b4577534a6c0c4319eda894033a75da0b8c8.tar.gz |
Use unref instead of destroy in eazelinstallcorbacallback
* components/rpmview/nautilus-rpm-view-install.c:
(nautilus_rpm_view_install_done):
Use unref instead of destroy in eazelinstallcorbacallback
* components/services/install/command-line/eazel-alt-install-corba.c:
(set_parameters_from_command_line), (main):
Defaults to ham.eazel.com:8888 instead of testmachine.eazel.com:80
now.
Also added reversion support
* components/services/install/command-line/eazel-package-query.c:
(main):
use the unref instead of destroy
* components/services/install/command-line/eazel-revert.c: (main):
Fixed the --port arg
use unref instead of destroy
* components/services/install/command-line/eazel-uninstall.c:
(main):
use unref instead of destroy
* components/services/install/lib/eazel-install-corba-callback.h:
* components/services/install/lib/eazel-install-corba-callback.c:
(eazel_install_callback_unref), (eazel_install_callback_finalize),
(eazel_install_callback_class_initialize):
A unref instead of destroy
* components/services/install/lib/eazel-install-corba-types.c:
(packagedata_from_corba_packagedatastruct):
Fixed for the new get_distribution_enum
* components/services/install/lib/eazel-install-public.h:
* components/services/install/lib/eazel-install-object.c:
(eazel_install_unref), (eazel_install_finalize),
(eazel_install_class_initialize):
A unref instead of a destroy
* components/services/install/lib/eazel-install-private.h:
A boolean to indicate that the subcommand is running
* components/services/install/lib/eazel-install-protocols.c:
(eazel_install_fetch_package), (get_url_for_package),
(get_search_url_for_package):
Stuff to call the new OSD xml parsing. Plus some logic to check
for a existing file. (used when EI_PROT_USE_NEW_CGI is set)
Proper transfer of distro name (bug 1333)
* components/services/install/lib/eazel-install-rpm-glue.c:
(install_all_packages), (uninstall_all_packages),
(eazel_install_do_transaction_fill_hash),
(eazel_install_do_transaction_get_total_size),
(eazel_install_do_transaction_add_to_transaction),
(eazel_install_start_transaction_make_rpm_argument_list),
(eazel_install_start_transaction_make_argument_list),
(eazel_install_do_transaction_save_report_helper),
(eazel_install_do_transaction_save_report),
(eazel_install_monitor_rpm_propcess_pipe),
(eazel_install_monitor_process_pipe),
(eazel_install_display_arguments),
(eazel_install_monitor_subcommand_pipe),
(eazel_install_start_transaction):
Lot of renaming & some slashing to accomodate other package
systems then rpm.
New pipe parser for rpm -hv args, since --percent proved useless.
* components/services/install/lib/eazel-install-xml-package-list.h:
* components/services/install/lib/eazel-install-xml-package-list.c:
(osd_parse_implementation), (osd_parse_softpkg),
(osd_parse_shared), (parse_osd_xml_from_memory):
Implemented parsing of the OSD xml.
* components/services/install/nautilus-view/nautilus-service-install.
c: (nautilus_service_install_done):
Use the unref instead of destroy
* components/services/trilobite/libtrilobite/trilobite-core-distribut
ion.h:
* components/services/trilobite/libtrilobite/trilobite-core-distribut
ion.c: (trilobite_get_distribution_enum_compact),
(trilobite_get_distribution_enum_verbose),
(trilobite_get_distribution_enum):
Changed get_distro_enum to parse compact names.
* nautilus-installer/src/callbacks.c: (begin_install),
(prep_install):
* nautilus-installer/src/callbacks.h:
* nautilus-installer/src/installer.c: (eazel_install_progress),
(eazel_download_progress), (download_failed),
(eazel_install_preflight), (installer):
* nautilus-installer/src/interface.c: (create_what_to_do_page),
(create_install_page), (create_finish_page), (create_window):
* nautilus-installer/src/main.c:
* nautilus-installer/src/prescript:
Some reslashing of the installer
* po/da.po:
Came across some missing translations
28 files changed, 1091 insertions, 592 deletions
@@ -1,3 +1,104 @@ +2000-08-10 Eskil Heyn Olsen <eskil@eazel.com> + + * components/rpmview/nautilus-rpm-view-install.c: + (nautilus_rpm_view_install_done): + Use unref instead of destroy in eazelinstallcorbacallback + + * components/services/install/command-line/eazel-alt-install-corba.c: + (set_parameters_from_command_line), (main): + Defaults to ham.eazel.com:8888 instead of testmachine.eazel.com:80 + now. + Also added reversion support + + * components/services/install/command-line/eazel-package-query.c: + (main): + use the unref instead of destroy + + * components/services/install/command-line/eazel-revert.c: (main): + Fixed the --port arg + use unref instead of destroy + + * components/services/install/command-line/eazel-uninstall.c: + (main): + use unref instead of destroy + + * components/services/install/lib/eazel-install-corba-callback.h: + * components/services/install/lib/eazel-install-corba-callback.c: + (eazel_install_callback_unref), (eazel_install_callback_finalize), + (eazel_install_callback_class_initialize): + A unref instead of destroy + + * components/services/install/lib/eazel-install-corba-types.c: + (packagedata_from_corba_packagedatastruct): + Fixed for the new get_distribution_enum + + * components/services/install/lib/eazel-install-public.h: + * components/services/install/lib/eazel-install-object.c: + (eazel_install_unref), (eazel_install_finalize), + (eazel_install_class_initialize): + A unref instead of a destroy + + * components/services/install/lib/eazel-install-private.h: + A boolean to indicate that the subcommand is running + + * components/services/install/lib/eazel-install-protocols.c: + (eazel_install_fetch_package), (get_url_for_package), + (get_search_url_for_package): + Stuff to call the new OSD xml parsing. Plus some logic to check + for a existing file. (used when EI_PROT_USE_NEW_CGI is set) + Proper transfer of distro name (bug 1333) + + * components/services/install/lib/eazel-install-rpm-glue.c: + (install_all_packages), (uninstall_all_packages), + (eazel_install_do_transaction_fill_hash), + (eazel_install_do_transaction_get_total_size), + (eazel_install_do_transaction_add_to_transaction), + (eazel_install_start_transaction_make_rpm_argument_list), + (eazel_install_start_transaction_make_argument_list), + (eazel_install_do_transaction_save_report_helper), + (eazel_install_do_transaction_save_report), + (eazel_install_monitor_rpm_propcess_pipe), + (eazel_install_monitor_process_pipe), + (eazel_install_display_arguments), + (eazel_install_monitor_subcommand_pipe), + (eazel_install_start_transaction): + Lot of renaming & some slashing to accomodate other package + systems then rpm. + New pipe parser for rpm -hv args, since --percent proved useless. + + * components/services/install/lib/eazel-install-xml-package-list.h: + * components/services/install/lib/eazel-install-xml-package-list.c: + (osd_parse_implementation), (osd_parse_softpkg), + (osd_parse_shared), (parse_osd_xml_from_memory): + Implemented parsing of the OSD xml. + + * components/services/install/nautilus-view/nautilus-service-install. + c: (nautilus_service_install_done): + Use the unref instead of destroy + + * components/services/trilobite/libtrilobite/trilobite-core-distribut + ion.h: + * components/services/trilobite/libtrilobite/trilobite-core-distribut + ion.c: (trilobite_get_distribution_enum_compact), + (trilobite_get_distribution_enum_verbose), + (trilobite_get_distribution_enum): + Changed get_distro_enum to parse compact names. + + * nautilus-installer/src/callbacks.c: (begin_install), + (prep_install): + * nautilus-installer/src/callbacks.h: + * nautilus-installer/src/installer.c: (eazel_install_progress), + (eazel_download_progress), (download_failed), + (eazel_install_preflight), (installer): + * nautilus-installer/src/interface.c: (create_what_to_do_page), + (create_install_page), (create_finish_page), (create_window): + * nautilus-installer/src/main.c: + * nautilus-installer/src/prescript: + Some reslashing of the installer + + * po/da.po: + Came across some missing translations + 2000-08-10 John Sullivan <sullivan@eazel.com> I accidentally committed before writing ChangeLog (wrong diff --git a/components/rpmview/nautilus-rpm-view-install.c b/components/rpmview/nautilus-rpm-view-install.c index cf8ce5916..3550d8839 100644 --- a/components/rpmview/nautilus-rpm-view-install.c +++ b/components/rpmview/nautilus-rpm-view-install.c @@ -145,7 +145,7 @@ nautilus_rpm_view_install_done (EazelInstallCallback *service, NautilusRPMView *rpm_view) { char *tmp; - eazel_install_callback_destroy (GTK_OBJECT (service)); + eazel_install_callback_unref (GTK_OBJECT (service)); tmp = g_strdup (rpm_view->details->current_uri); nautilus_rpm_view_load_uri (rpm_view, tmp); g_free (tmp); diff --git a/components/services/docs/packagexml.dtd b/components/services/docs/packagexml.dtd new file mode 100644 index 000000000..e0b705f64 --- /dev/null +++ b/components/services/docs/packagexml.dtd @@ -0,0 +1,21 @@ +<!ELEMENT CATEGORIES (CATEGORY)*> + +<!ELEMENT CATEGORY (PACKAGES)*> +<!ATTLIST CATEGORY NAME CDATA> + +<!ELEMENT PACKAGES (PACKAGE)*> + +<!ELEMENT PACKAGE (NAME | VERSION | MINOR | ARCH | BYTESIZE | SUMMARY)*> + +<!ELEMENT NAME (#PCDATA)> + +<!ELEMENT VERSION (#PCDATA)> + +<!ELEMENT MINOR (#PCDATA)> + +<!ELEMENT ARCH (#PCDATA)> + +<!ELEMENT BYTESIZE (#PCDATA)> + +<!ELEMENT SUMMARY (#PCDATA)> + diff --git a/components/services/install-view/nautilus-service-install.c b/components/services/install-view/nautilus-service-install.c index 62915365e..28fb58cba 100644 --- a/components/services/install-view/nautilus-service-install.c +++ b/components/services/install-view/nautilus-service-install.c @@ -140,7 +140,7 @@ nautilus_service_install_done (EazelInstallCallback *service, NautilusServiceInstallView *view) { char *tmp; - eazel_install_callback_destroy (GTK_OBJECT (service)); + eazel_install_callback_unref (GTK_OBJECT (service)); tmp = g_strdup (view->details->uri); nautilus_service_install_view_load_uri (view, tmp); g_free (tmp); diff --git a/components/services/install/command-line/eazel-alt-install-corba.c b/components/services/install/command-line/eazel-alt-install-corba.c index 83e285538..e19ae88a8 100644 --- a/components/services/install/command-line/eazel-alt-install-corba.c +++ b/components/services/install/command-line/eazel-alt-install-corba.c @@ -39,8 +39,8 @@ #define PACKAGE_FILE_NAME "package-list.xml" #define DEFAULT_CONFIG_FILE "/var/eazel/services/eazel-services-config.xml" -#define DEFAULT_HOSTNAME "testmachine.eazel.com" -#define DEFAULT_PORT_NUMBER 80 +#define DEFAULT_HOSTNAME "ham.eazel.com" +#define DEFAULT_PORT_NUMBER 8888 #define DEFAULT_PROTOCOL PROTOCOL_HTTP #define DEFAULT_TMP_DIR "/tmp/eazel-install" #define DEFAULT_RPMRC "/usr/lib/rpm/rpmrc" @@ -67,7 +67,8 @@ int arg_dry_run, arg_upgrade, arg_downgrade, arg_erase, - arg_query; + arg_query, + arg_revert; char *arg_server, *arg_config_file, *arg_package_list, @@ -90,6 +91,7 @@ static const struct poptOption options[] = { {"packagefile", '\0', POPT_ARG_STRING, &arg_package_list, 0, N_("Specify package file"), NULL}, {"port", '\0', POPT_ARG_INT, &arg_port, 0 , N_("Set port numer (80)"), NULL}, {"query", 'q', POPT_ARG_NONE, &arg_query, 0, N_("Run Query"), NULL}, + {"revert", 'r', POPT_ARG_NONE, &arg_revert, 0, N_("Revert"), NULL}, {"server", '\0', POPT_ARG_STRING, &arg_server, 0, N_("Specify server"), NULL}, {"test", 't', POPT_ARG_NONE, &arg_dry_run, 0, N_("Test run"), NULL}, {"tmp", '\0', POPT_ARG_STRING, &arg_tmp_dir, 0, N_("Set tmp dir (/tmp/eazel-install)"), NULL}, @@ -125,8 +127,8 @@ set_parameters_from_command_line (Trilobite_Eazel_Install service) Trilobite_Eazel_Install__set_protocol (service, Trilobite_Eazel_PROTOCOL_HTTP, &ev); check_ev ("set_protocol"); } - if (arg_downgrade + arg_upgrade + arg_erase > 1) { - fprintf (stderr, "*** Upgrade and erase ? Yeah rite....\n"); + if (arg_downgrade + arg_upgrade + arg_erase +arg_revert > 1) { + fprintf (stderr, "*** Upgrade, downgrade, revert and erase ? This is not a all-in-one tool"); exit (1); } if (arg_upgrade) { @@ -466,7 +468,7 @@ int main(int argc, char *argv[]) { gtk_signal_connect (GTK_OBJECT (cb), "delete_files", (void *)delete_files, NULL); gtk_signal_connect (GTK_OBJECT (cb), "done", done, NULL); - if (arg_erase + arg_query > 1) { + if (arg_erase + arg_query + arg_downgrade + arg_upgrade + arg_revert > 1) { g_error ("Only one operation at a time please."); } @@ -484,6 +486,11 @@ int main(int argc, char *argv[]) { fprintf (stdout, "%s %s %50.50s", p->name, p->version, p->summary); } } + } else if (arg_revert) { + GList *iterator; + for (iterator = strs; iterator; iterator = iterator->next) { + eazel_install_callback_revert_transaction (cb, (char*)iterator->data, &ev); + } } else { eazel_install_callback_install_packages (cb, categories, &ev); } @@ -493,7 +500,7 @@ int main(int argc, char *argv[]) { bonobo_main (); } - eazel_install_callback_destroy (GTK_OBJECT (cb)); + eazel_install_callback_unref (GTK_OBJECT (cb)); /* Corba cleanup */ CORBA_exception_free (&ev); diff --git a/components/services/install/command-line/eazel-package-query.c b/components/services/install/command-line/eazel-package-query.c index 4b8b931e8..c64e58e13 100644 --- a/components/services/install/command-line/eazel-package-query.c +++ b/components/services/install/command-line/eazel-package-query.c @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) { g_list_free (result); } - eazel_install_destroy (GTK_OBJECT (service)); + eazel_install_unref (GTK_OBJECT (service)); return 0; }; diff --git a/components/services/install/command-line/eazel-revert.c b/components/services/install/command-line/eazel-revert.c index ece22690c..7a38976f9 100644 --- a/components/services/install/command-line/eazel-revert.c +++ b/components/services/install/command-line/eazel-revert.c @@ -74,7 +74,7 @@ CORBA_Environment ev; static const struct poptOption options[] = { {"debug", 'd', POPT_ARG_NONE, &arg_debug, 0 , N_("Show debug output"), NULL}, {"delay", '\0', POPT_ARG_NONE, &arg_delay, 0 , N_("10 sec delay after starting service"), NULL}, - {"port", '\0', POPT_ARG_NONE, &arg_port, 0 , N_("Set port numer (80)"), NULL}, + {"port", '\0', POPT_ARG_INT, &arg_port, 0 , N_("Set port numer (80)"), NULL}, {"test", 't', POPT_ARG_NONE, &arg_dry_run, 0, N_("Test run"), NULL}, {"tmp", '\0', POPT_ARG_STRING, &arg_tmp_dir, 0, N_("Set tmp dir (/tmp/eazel-install)"), NULL}, {"server", '\0', POPT_ARG_STRING, &arg_server, 0, N_("Specify server"), NULL}, @@ -411,7 +411,7 @@ int main(int argc, char *argv[]) { fprintf (stdout, "\nEntering main loop...\n"); bonobo_main (); - eazel_install_callback_destroy (GTK_OBJECT (cb)); + eazel_install_callback_unref (GTK_OBJECT (cb)); /* Corba cleanup */ CORBA_exception_free (&ev); diff --git a/components/services/install/command-line/eazel-uninstall.c b/components/services/install/command-line/eazel-uninstall.c index e80f7d0e4..97df49b26 100644 --- a/components/services/install/command-line/eazel-uninstall.c +++ b/components/services/install/command-line/eazel-uninstall.c @@ -294,7 +294,7 @@ int main(int argc, char *argv[]) { bonobo_main (); /* Corba cleanup */ - eazel_install_callback_destroy (GTK_OBJECT (cb)); + eazel_install_callback_unref (GTK_OBJECT (cb)); CORBA_exception_free (&ev); return 0; diff --git a/components/services/install/lib/eazel-install-corba-callback.c b/components/services/install/lib/eazel-install-corba-callback.c index 5663bf556..bf36fb923 100644 --- a/components/services/install/lib/eazel-install-corba-callback.c +++ b/components/services/install/lib/eazel-install-corba-callback.c @@ -258,14 +258,25 @@ eazel_install_callback_create_corba_object (BonoboObject *service) { *****************************************/ void -eazel_install_callback_destroy (GtkObject *object) +eazel_install_callback_unref (GtkObject *object) { EazelInstallCallback *service; g_return_if_fail (object != NULL); g_return_if_fail (EAZEL_INSTALL_CALLBACK (object)); - g_message ("in eazel_install_callback_destroy"); + bonobo_object_unref (BONOBO_OBJECT (object)); +} + +void +eazel_install_callback_finalize (GtkObject *object) +{ + EazelInstallCallback *service; + + g_return_if_fail (object != NULL); + g_return_if_fail (EAZEL_INSTALL_CALLBACK (object)); + + g_message ("in eazel_install_callback_finalize"); service = EAZEL_INSTALL_CALLBACK (object); @@ -284,7 +295,7 @@ eazel_install_callback_destroy (GtkObject *object) if (GTK_OBJECT_CLASS (eazel_install_callback_parent_class)->destroy) { GTK_OBJECT_CLASS (eazel_install_callback_parent_class)->destroy (object); } - g_message ("out eazel_install_callback_destroy"); + g_message ("out eazel_install_callback_finalize"); } static void @@ -293,7 +304,7 @@ eazel_install_callback_class_initialize (EazelInstallCallbackClass *klass) GtkObjectClass *object_class; object_class = (GtkObjectClass*)klass; - object_class->destroy = (void(*)(GtkObject*))eazel_install_callback_destroy; + object_class->finalize = eazel_install_callback_finalize; eazel_install_callback_parent_class = gtk_type_class (bonobo_object_get_type ()); klass->servant_vepv = g_new0 (POA_Trilobite_Eazel_InstallCallback__vepv,1); diff --git a/components/services/install/lib/eazel-install-corba-callback.h b/components/services/install/lib/eazel-install-corba-callback.h index eb59425dd..e0a8aae5e 100644 --- a/components/services/install/lib/eazel-install-corba-callback.h +++ b/components/services/install/lib/eazel-install-corba-callback.h @@ -95,7 +95,7 @@ struct _EazelInstallCallback /* Create a new eazel-install-callback object */ EazelInstallCallback *eazel_install_callback_new (void); /* Destroy the eazel-install-callback object */ -void eazel_install_callback_destroy (GtkObject *object); +void eazel_install_callback_unref (GtkObject *object); /* Request the installation of a set of packages in categories. If categories = NULL, the service tries to fetch the packagelist diff --git a/components/services/install/lib/eazel-install-corba-types.c b/components/services/install/lib/eazel-install-corba-types.c index 90b17ea0b..a1b2d4c98 100644 --- a/components/services/install/lib/eazel-install-corba-types.c +++ b/components/services/install/lib/eazel-install-corba-types.c @@ -146,7 +146,7 @@ packagedata_from_corba_packagedatastruct (const Trilobite_Eazel_PackageDataStruc pack->toplevel = corbapack.toplevel; pack->bytesize = corbapack.bytesize; - pack->distribution.name = trilobite_get_distribution_enum (corbapack.distribution.name); + pack->distribution.name = trilobite_get_distribution_enum (corbapack.distribution.name, FALSE); pack->distribution.version_major = corbapack.distribution.major; pack->distribution.version_minor = corbapack.distribution.minor; diff --git a/components/services/install/lib/eazel-install-object.c b/components/services/install/lib/eazel-install-object.c index 2adb2c7ac..75a5964db 100644 --- a/components/services/install/lib/eazel-install-object.c +++ b/components/services/install/lib/eazel-install-object.c @@ -156,12 +156,20 @@ xml_from_packagedata (const PackageData *pack) { GTK+ object stuff *****************************************/ +void eazel_install_unref (GtkObject *object) +{ + g_return_if_fail (object != NULL); + g_return_if_fail (EAZEL_INSTALL (object)); + + bonobo_object_unref (BONOBO_OBJECT (object)); +} + void -eazel_install_destroy (GtkObject *object) +eazel_install_finalize (GtkObject *object) { EazelInstall *service; - g_message ("in eazel_install_destroy"); + g_message ("in eazel_install_finalize"); g_return_if_fail (object != NULL); g_return_if_fail (EAZEL_INSTALL (object)); @@ -189,7 +197,7 @@ eazel_install_destroy (GtkObject *object) GTK_OBJECT_CLASS (eazel_install_parent_class)->destroy (object); } - g_message ("out eazel_install_destroy"); + g_message ("out eazel_install_finalize"); } static void @@ -271,7 +279,7 @@ eazel_install_class_initialize (EazelInstallClass *klass) GtkObjectClass *object_class; object_class = (GtkObjectClass*)klass; - object_class->destroy = (void(*)(GtkObject*))eazel_install_destroy; + object_class->finalize = eazel_install_finalize; object_class->set_arg = eazel_install_set_arg; #ifdef EAZEL_INSTALL_NO_CORBA @@ -305,13 +313,14 @@ eazel_install_class_initialize (EazelInstallClass *klass) GTK_SIGNAL_OFFSET (EazelInstallClass, install_progress), eazel_install_gtk_marshal_NONE__POINTER_INT_INT_INT_INT_INT_INT, GTK_TYPE_NONE, 7, GTK_TYPE_POINTER, - GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT); + GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT, + GTK_TYPE_INT, GTK_TYPE_INT, GTK_TYPE_INT); signals[DOWNLOAD_FAILED] = gtk_signal_new ("download_failed", GTK_RUN_LAST, object_class->type, GTK_SIGNAL_OFFSET (EazelInstallClass, download_failed), - gtk_marshal_NONE__POINTER_POINTER, + gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); signals[INSTALL_FAILED] = gtk_signal_new ("install_failed", diff --git a/components/services/install/lib/eazel-install-private.h b/components/services/install/lib/eazel-install-private.h index c4a27b224..ff0ac3209 100644 --- a/components/services/install/lib/eazel-install-private.h +++ b/components/services/install/lib/eazel-install-private.h @@ -64,9 +64,13 @@ struct _EazelInstallPrivate { Entries are added in eazel-install-rpm-glue.c, as stuff is done */ GList *transaction; - + + /* The logfile used for the object */ FILE *logfile; char *logfilename; + + /* TRUE if the rpm subcommand is running */ + gboolean subcommand_running; }; #endif /* EAZEL_INSTALL_PRIVATE_H */ diff --git a/components/services/install/lib/eazel-install-protocols.c b/components/services/install/lib/eazel-install-protocols.c index c1472545e..a56742aae 100644 --- a/components/services/install/lib/eazel-install-protocols.c +++ b/components/services/install/lib/eazel-install-protocols.c @@ -28,6 +28,7 @@ #include "eazel-install-protocols.h" #include "eazel-install-private.h" +#include "eazel-install-xml-package-list.h" #include <config.h> #include <sys/utsname.h> #include <errno.h> @@ -36,8 +37,14 @@ It should contain a %s for the server name, and later a %d for the portnumber. In this order, no other order */ + +#define EI_PROT_USE_NEW_CGI + +#ifndef EI_PROT_USE_NEW_CGI #define CGI_BASE "http://%s:%d/cgi-bin/rpmsearch.cgi" -/* #define CGI_BASE "http://%s:%d/catalog/find" */ +#else /* EI_PROT_USE_NEW_CGI */ +#define CGI_BASE "http://%s:%d/catalog/find" +#endif /* EI_PROT_USE_NEW_CGI */ gboolean http_fetch_remote_file (EazelInstall *service, char* url, @@ -248,11 +255,10 @@ eazel_install_fetch_package (EazelInstall *service, gboolean result; char* url; char* targetname; - + result = FALSE; url = NULL; - switch (eazel_install_get_protocol (service)) { case PROTOCOL_FTP: case PROTOCOL_HTTP: @@ -268,19 +274,35 @@ eazel_install_fetch_package (EazelInstall *service, if (url == NULL) { g_warning (_("Could not get a URL for %s"), rpmfilename_from_packagedata (package)); } else { - /* FIXME bugzilla.eazel.com 1315: - Loose the check once a proper rpmsearch.cgi is up and running */ + targetname = g_strdup_printf ("%s/%s", + eazel_install_get_tmp_dir (service), + filename_from_url (url)); + g_message ("%s resolved", package->name); +#ifdef EI_PROT_USE_NEW_CGI + if (g_file_test (targetname, G_FILE_TEST_ISFILE)) { + /* Uh, file already exists, check the size to see if we can reuse it */ + struct stat sbuf; + stat (targetname, &sbuf); + g_message ("File already exists, checking %d vs %d", package->bytesize, sbuf.st_size); + if (sbuf.st_size == package->bytesize) { + g_message ("Size checks out"); + result = TRUE; + } else { + result = eazel_install_fetch_file (service, url, targetname); + } + } else { + result = eazel_install_fetch_file (service, url, targetname); + } +#else /* EI_PROT_USE_NEW_CGI */ if (filename_from_url (url) && strlen (filename_from_url (url))>1) { - targetname = g_strdup_printf ("%s/%s", - eazel_install_get_tmp_dir (service), - filename_from_url (url)); - /* package->filename = g_strdup (targetname); */ result = eazel_install_fetch_file (service, url, targetname); - if (result==TRUE) { - packagedata_fill_from_file (package, targetname); - } - g_free (targetname); } +#endif /* EI_PROT_USE_NEW_CGI */ + if (result==TRUE) { + packagedata_fill_from_file (package, targetname); + } + + g_free (targetname); g_free (url); } @@ -357,7 +379,7 @@ add_to_url (char **url, char* get_url_for_package (EazelInstall *service, RpmSearchEntry entry, - const gpointer data) + gpointer data) { char *search_url; char *url; @@ -373,6 +395,7 @@ get_url_for_package (EazelInstall *service, g_warning (_("Could not create an http request !")); } else { + ghttp_set_header (request, http_hdr_User_Agent, "Trilobite"); if (ghttp_set_uri (request, search_url) != 0) { g_warning (_("Invalid uri")); } else { @@ -397,15 +420,44 @@ get_url_for_package (EazelInstall *service, break; } case ghttp_done: - /* 404 or did we get something usefull ? */ - /* FIXME bugzilla.eazel.com 1718: - Once the rpmsearch script is done, revamp this to parse the - xml returned */ if (ghttp_status_code (request) != 404) { +#ifdef EI_PROT_USE_NEW_CGI + /* Parse the returned xml */ + GList *packages; + + packages = parse_osd_xml_from_memory (ghttp_get_body (request), + ghttp_get_body_len (request)); + if (g_list_length (packages) == 0) { + g_warning ("No url for file"); + } else if (g_list_length (packages) > 1) { + g_warning ("Ugh, more then one match, using first"); + } else { + /* Get the first package returned */ + PackageData *pack; + + g_assert (packages->data != NULL); + pack = (PackageData*)packages->data; + url = g_strdup (pack->filename); + + /* Update the given package */ + if (entry==RPMSEARCH_ENTRY_NAME) { + PackageData *pack2; + pack2 = (PackageData*)data; + g_message ("setting bytesize to %d", pack->bytesize); + pack2->bytesize = pack->bytesize; + } + + g_list_foreach (packages, + (GFunc)packagedata_destroy_foreach, + NULL); + } +#else /* EI_PROT_USE_NEW_CGI */ url = g_strdup (ghttp_get_body (request)); if (url) { url [ ghttp_get_body_len (request)] = 0; } +#endif /* EI_PROT_USE_NEW_CGI */ + } else { url = NULL; } @@ -432,11 +484,6 @@ char* get_search_url_for_package (EazelInstall *service, eazel_install_get_server (service), eazel_install_get_server_port (service)); -/* - FIXME bugzilla.eazel.com 1333: - We need to send distro name at some point. Depends on the rpmsearch cgi script -*/ - dist = trilobite_get_distribution (); switch (entry) { @@ -449,7 +496,7 @@ char* get_search_url_for_package (EazelInstall *service, add_to_url (&url, "&version>=", pack->version); if (pack->distribution.name != DISTRO_UNKNOWN) { dist = pack->distribution; - } + } } break; case RPMSEARCH_ENTRY_PROVIDES: { @@ -461,15 +508,15 @@ char* get_search_url_for_package (EazelInstall *service, break; } -/* +#ifdef EI_PROT_USE_NEW_CGI if (dist.name != DISTRO_UNKNOWN) { char *distro; - distro = g_strdup_printf ("\"%s\"", + distro = g_strdup_printf ("%s", trilobite_get_distribution_name (dist, TRUE, TRUE)); add_to_url (&url, "&distro=", distro); g_free (distro); } -*/ +#endif /* EI_PROT_USE_NEW_CGI */ switch (eazel_install_get_protocol (service)) { case PROTOCOL_HTTP: diff --git a/components/services/install/lib/eazel-install-public.h b/components/services/install/lib/eazel-install-public.h index b74ffa133..87ec73c1c 100644 --- a/components/services/install/lib/eazel-install-public.h +++ b/components/services/install/lib/eazel-install-public.h @@ -109,7 +109,7 @@ struct _EazelInstall EazelInstall *eazel_install_new (void); EazelInstall *eazel_install_new_with_config (const char *config_file); GtkType eazel_install_get_type (void); -void eazel_install_destroy (GtkObject *object); +void eazel_install_unref (GtkObject *object); #ifndef EAZEL_INSTALL_NO_CORBA POA_Trilobite_Eazel_Install__epv *eazel_install_get_epv (void); diff --git a/components/services/install/lib/eazel-install-rpm-glue.c b/components/services/install/lib/eazel-install-rpm-glue.c index 57569b1f7..87724703a 100644 --- a/components/services/install/lib/eazel-install-rpm-glue.c +++ b/components/services/install/lib/eazel-install-rpm-glue.c @@ -55,6 +55,8 @@ #include <fcntl.h> #include <unistd.h> +#define PERCENTS_PER_RPM_HASH 2 + typedef void (*rpm_install_cb)(char* name, char* group, void* user_data); static gboolean download_all_packages (EazelInstall *service, @@ -67,8 +69,8 @@ typedef void* (*RpmCallbackFunc) (const Header, const rpmCallbackType, const unsigned long, const unsigned long, const void*, void*); -static int do_rpm_transaction (EazelInstall *service, - GList* packages); +static int eazel_install_start_transaction (EazelInstall *service, + GList* packages); static gboolean eazel_install_ensure_deps (EazelInstall *service, GList **filenames, @@ -265,8 +267,8 @@ install_all_packages (EazelInstall *service, eazel_install_free_package_system (service); g_message (_("Category = %s, %d packages"), cat->name, g_list_length (packages)); - do_rpm_transaction (service, - packages); + eazel_install_start_transaction (service, + packages); g_list_free (packages); } @@ -294,8 +296,8 @@ uninstall_all_packages (EazelInstall *service, failed = NULL; eazel_uninstall_globber (service, &cat->packages, &failed); - do_rpm_transaction (service, - cat->packages); + eazel_install_start_transaction (service, + cat->packages); categories = categories->next; } @@ -451,7 +453,7 @@ revert_transaction (EazelInstall *service, } static void -eazel_install_do_rpm_transaction_fill_hash (EazelInstall *service, +eazel_install_do_transaction_fill_hash (EazelInstall *service, GList *packages) { GList *iterator; @@ -460,7 +462,7 @@ eazel_install_do_rpm_transaction_fill_hash (EazelInstall *service, PackageData *pack; pack = (PackageData*)iterator->data; - tmp = g_strdup_printf ("%s-%s-%s", pack->name, pack->version, pack->minor); + tmp = g_strdup_printf ("%s", pack->name); g_hash_table_insert (service->private->name_to_package_hash, tmp, iterator->data); @@ -468,7 +470,7 @@ eazel_install_do_rpm_transaction_fill_hash (EazelInstall *service, } static void -eazel_install_do_rpm_transaction_get_total_size (EazelInstall *service, +eazel_install_do_transaction_get_total_size (EazelInstall *service, GList *packages) { GList *iterator; @@ -480,9 +482,42 @@ eazel_install_do_rpm_transaction_get_total_size (EazelInstall *service, } } +static void +eazel_install_do_transaction_add_to_transaction (EazelInstall *service, + PackageData *pack) +{ + service->private->transaction = g_list_prepend (service->private->transaction, + pack); +} + +static void +eazel_install_start_transaction_make_rpm_argument_list (EazelInstall *service, + GList **args) +{ + if (eazel_install_get_test (service)) { + g_message ("Dry run mode!"); + (*args) = g_list_prepend (*args, g_strdup ("--test")); + } + if (eazel_install_get_force (service)) { + g_warning ("Force install mode!"); + (*args) = g_list_prepend (*args, g_strdup ("--force")); + (*args) = g_list_prepend (*args, g_strdup ("--nodeps")); + } + if (eazel_install_get_uninstall (service)) { + (*args) = g_list_prepend (*args, g_strdup ("-ev")); + } else if (eazel_install_get_update (service)) { + (*args) = g_list_prepend (*args, g_strdup ("-Uvh")); + } else if (eazel_install_get_downgrade (service)) { + (*args) = g_list_prepend (*args, g_strdup ("--oldpackage")); + (*args) = g_list_prepend (*args, g_strdup ("-Uvh")); + } else { + (*args) = g_list_prepend (*args, g_strdup ("-ivh")); + } +} + static GList* -eazel_install_do_rpm_transaction_make_argument_list (EazelInstall *service, - GList *packages) +eazel_install_start_transaction_make_argument_list (EazelInstall *service, + GList *packages) { GList *args; GList *iterator; @@ -506,124 +541,28 @@ eazel_install_do_rpm_transaction_make_argument_list (EazelInstall *service, pack->modify_status = PACKAGE_MOD_INSTALLED; args = g_list_prepend (args, g_strdup (pack->filename)); } + /* NOTE: rpm does not generate hash/percent output for + - uninstall + thus, I add them to the transaction report here */ + if (pack->toplevel && + eazel_install_get_uninstall (service)) { + eazel_install_do_transaction_add_to_transaction (service, pack); + } } /* Set the RPM parameters */ - if (eazel_install_get_test (service)) { - g_message ("Dry run mode!"); - args = g_list_prepend (args, g_strdup ("--test")); - } - if (eazel_install_get_force (service)) { - g_warning ("Force install mode!"); - args = g_list_prepend (args, g_strdup ("--force")); - args = g_list_prepend (args, g_strdup ("--nodeps")); - } - if (eazel_install_get_uninstall (service)) { - args = g_list_prepend (args, g_strdup ("-ev")); - } else if (eazel_install_get_update (service)) { - args = g_list_prepend (args, g_strdup ("--percent")); - args = g_list_prepend (args, g_strdup ("-Uv")); - } else if (eazel_install_get_downgrade (service)) { - args = g_list_prepend (args, g_strdup ("--percent")); - args = g_list_prepend (args, g_strdup ("--oldpackage")); - args = g_list_prepend (args, g_strdup ("-Uv")); - } else { - args = g_list_prepend (args, g_strdup ("--percent")); - args = g_list_prepend (args, g_strdup ("-iv")); + switch (eazel_install_get_package_system (service)) { + case EAZEL_INSTALL_USE_RPM: + eazel_install_start_transaction_make_rpm_argument_list (service, &args); + break; } return args; } -static void -eazel_install_do_rpm_transaction_process_pipe (EazelInstall *service, - int fd) -{ - char *tmp; - FILE *pipe; - PackageData *pack; - - /* Get the helpers stdout */ - pipe = fdopen (fd, "r"); - fflush (pipe); - tmp = g_new0 (char, 1024); - pack = NULL; - - /* while something there... */ - while (!feof (pipe)) { - fflush (pipe); - fgets (tmp, 1023, pipe); - if (feof (pipe)) { - break; - } - - if (tmp) { - g_message ("READ \"%s\"", tmp); - /* Percentage output, parse and emit... */ - if (tmp[0]=='%' && tmp[1]=='%') { - char *ptr; - int pct; - int amount; - - - if (pack == NULL) { - continue; - } - ptr = tmp + 3; - pct = strtol (ptr, NULL, 10); - if (pct == 100) { - amount = pack->bytesize; - } else { - amount = (pack->bytesize * pct) / 100; - } - if (pack && amount) { - eazel_install_emit_install_progress (service, - pack, - service->private->packsys.rpm.packages_installed, - service->private->packsys.rpm.num_packages, - amount, - pack->bytesize, - service->private->packsys.rpm.current_installed_size + amount, - service->private->packsys.rpm.total_size); - } - /* By invalidating the pointer here, we - only emit with amount==total once */ - if (pct==100) { - service->private->packsys.rpm.current_installed_size += pack->bytesize; - /* If a toplevel pacakge completed, add to transction list */ - if (pack->toplevel) { - service->private->transaction = g_list_prepend (service->private->transaction, - pack); - } - pack = NULL; - } - } else if (strlen (tmp)) { - /* Not percantage mark, that means filename, step ahead one file */ - tmp [ strlen (tmp) - 1] = 0; - pack = g_hash_table_lookup (service->private->name_to_package_hash, tmp); - if (pack==NULL) { - g_warning ("lookup \"%s\" failed", tmp); - } else { - service->private->packsys.rpm.packages_installed ++; - eazel_install_emit_install_progress (service, - pack, - service->private->packsys.rpm.packages_installed, - service->private->packsys.rpm.num_packages, - 0, - pack->bytesize, - service->private->packsys.rpm.current_installed_size, - service->private->packsys.rpm.total_size); - } - } - } - } - - fclose (pipe); -} - #ifndef EAZEL_INSTALL_SLIM static void -eazel_install_do_rpm_transaction_save_report_helper (xmlNodePtr node, +eazel_install_do_transaction_save_report_helper (xmlNodePtr node, GList *packages) { GList *iterator; @@ -645,18 +584,20 @@ eazel_install_do_rpm_transaction_save_report_helper (xmlNodePtr node, break; } if (pack->modifies) { - eazel_install_do_rpm_transaction_save_report_helper (node, pack->modifies); + eazel_install_do_transaction_save_report_helper (node, pack->modifies); } } } static void -eazel_install_do_rpm_transaction_save_report (EazelInstall *service) +eazel_install_do_transaction_save_report (EazelInstall *service) { FILE *outfile; xmlDocPtr doc; xmlNodePtr node, root; char *name; + + g_message ("writing transaction..."); /* Ensure the transaction dir is present */ if (! g_file_test (eazel_install_get_transaction_dir (service), G_FILE_TEST_ISDIR)) { @@ -696,7 +637,7 @@ eazel_install_do_rpm_transaction_save_report (EazelInstall *service) g_free (tmp); } - eazel_install_do_rpm_transaction_save_report_helper (node, service->private->transaction); + eazel_install_do_transaction_save_report_helper (node, service->private->transaction); xmlDocDump (outfile, doc); @@ -704,9 +645,153 @@ eazel_install_do_rpm_transaction_save_report (EazelInstall *service) g_free (name);} #endif /* EAZEL_INSTALL_SLIM */ +static gboolean +eazel_install_monitor_rpm_propcess_pipe (GIOChannel *source, + GIOCondition condition, + EazelInstall *service) +{ + char tmp; + static int package_name_length = 80; + static char package_name [80]; + ssize_t bytes_read; + static PackageData *pack = NULL; + static int pct; + + g_io_channel_read (source, &tmp, 1, &bytes_read); + + if (bytes_read) { + /* g_message ("READ '%c'", tmp); */ + /* Percentage output, parse and emit... */ + if (tmp=='#') { + int amount; + if (pack == NULL) { + return TRUE; + } + pct += PERCENTS_PER_RPM_HASH; + if (pct == 100) { + amount = pack->bytesize; + } else { + amount = (pack->bytesize * pct) / 100; + } + if (pack && amount) { + eazel_install_emit_install_progress (service, + pack, + service->private->packsys.rpm.packages_installed, + service->private->packsys.rpm.num_packages, + amount, + pack->bytesize, + service->private->packsys.rpm.current_installed_size + amount, + service->private->packsys.rpm.total_size); + } + /* By invalidating the pointer here, we + only emit with amount==total once */ + if (pct==100) { + service->private->packsys.rpm.current_installed_size += pack->bytesize; + /* If a toplevel pacakge completed, add to transction list */ + if (pack->toplevel) { + eazel_install_do_transaction_add_to_transaction (service, pack); + } + pack = NULL; + pct = 0; + package_name [0] = 0; + } + } else if (tmp != ' ') { + /* Read untill we hit a space */ + while (bytes_read && tmp != ' ') { + if (strlen (package_name) < package_name_length) { + /* Add char to package */ + int x; + x = strlen (package_name); + if (!isspace (tmp)) { + package_name [x] = tmp; + package_name [x+1] = 0; + } + } + /* read next byte */ + g_io_channel_read (source, &tmp, 1, &bytes_read); + } + + /* Not percantage mark, that means filename, step ahead one file */ + pack = g_hash_table_lookup (service->private->name_to_package_hash, package_name); + if (pack==NULL) { + g_warning ("lookup \"%s\" failed", package_name); + } else { + g_message ("matched \"%s\"", package_name); + pct = 0; + service->private->packsys.rpm.packages_installed ++; + eazel_install_emit_install_progress (service, + pack, + service->private->packsys.rpm.packages_installed, + service->private->packsys.rpm.num_packages, + 0, + pack->bytesize, + service->private->packsys.rpm.current_installed_size, + service->private->packsys.rpm.total_size); + } + } + } + if (bytes_read == 0) { +#ifndef EAZEL_INSTALL_SLIM + eazel_install_do_transaction_save_report (service); +#endif /* EAZEL_INSTALL_SLIM */ + return FALSE; + } else { + return TRUE; + } +} + +/* 1.39 has the code to parse --percent output */ +static gboolean +eazel_install_monitor_process_pipe (GIOChannel *source, + GIOCondition condition, + EazelInstall *service) +{ + if (condition == (G_IO_ERR | G_IO_NVAL | G_IO_HUP)) { + service->private->subcommand_running = FALSE; + } else { + switch (eazel_install_get_package_system (service)) { + case EAZEL_INSTALL_USE_RPM: + service->private->subcommand_running = eazel_install_monitor_rpm_propcess_pipe (source, + condition, + service); + break; + } + } + return service->private->subcommand_running; +} + +void +eazel_install_display_arguments (GList *args) +{ + GList *iterator; + fprintf (stdout, "\nARGS: "); + for (iterator = args; iterator; iterator = iterator->next) { + fprintf (stdout, "%s ", (char*)iterator->data); + } + fprintf (stdout, "\n"); +} + +void +eazel_install_monitor_subcommand_pipe (EazelInstall *service, + int fd, + GIOFunc monitor_func) +{ + GIOChannel *channel; + channel = g_io_channel_unix_new (fd); + g_message ("beginning monitor on %d", fd); + service->private->subcommand_running = TRUE; + g_io_add_watch (channel, G_IO_IN | G_IO_ERR | G_IO_NVAL | G_IO_HUP, + monitor_func, + service); + while (service->private->subcommand_running) { + g_main_iteration (TRUE); + } + g_message ("ending monitor on %d", fd); +} + int -do_rpm_transaction (EazelInstall *service, - GList* packages) +eazel_install_start_transaction (EazelInstall *service, + GList* packages) { #ifndef EAZEL_INSTALL_SLIM TrilobiteRootHelper *root_helper; @@ -727,23 +812,15 @@ do_rpm_transaction (EazelInstall *service, args = NULL; res = 0; - eazel_install_do_rpm_transaction_fill_hash (service, packages); - eazel_install_do_rpm_transaction_get_total_size (service, packages); - args = eazel_install_do_rpm_transaction_make_argument_list (service, packages); + eazel_install_do_transaction_fill_hash (service, packages); + eazel_install_do_transaction_get_total_size (service, packages); + args = eazel_install_start_transaction_make_argument_list (service, packages); eazel_install_emit_preflight_check (service, service->private->packsys.rpm.total_size, service->private->packsys.rpm.num_packages); - { - GList *iterator; - fprintf (stdout, "\nARGS: "); - for (iterator = args; iterator; iterator = iterator->next) { - fprintf (stdout, "%s ", (char*)iterator->data); - } - fprintf (stdout, "\n"); - } - + eazel_install_display_arguments (args); #ifdef EAZEL_INSTALL_SLIM { char **argv; @@ -790,18 +867,17 @@ do_rpm_transaction (EazelInstall *service, } #endif /* EAZEL_INSTALL_SLIM */ - if (res==0) { - eazel_install_do_rpm_transaction_process_pipe (service, fd); -#ifndef EAZEL_INSTALL_SLIM - eazel_install_do_rpm_transaction_save_report (service); -#endif /* EAZEL_INSTALL_SLIM */ + if (res==0) { + eazel_install_monitor_subcommand_pipe (service, + fd, + (GIOFunc)eazel_install_monitor_process_pipe); } g_list_foreach (args, (GFunc)g_free, NULL); g_list_free (args); return res; -} /* end do_rpm_transaction */ +} /* end start_transaction */ /* The helper for eazel_install_prune_packages. diff --git a/components/services/install/lib/eazel-install-xml-package-list.c b/components/services/install/lib/eazel-install-xml-package-list.c index fbaeba333..196365a60 100644 --- a/components/services/install/lib/eazel-install-xml-package-list.c +++ b/components/services/install/lib/eazel-install-xml-package-list.c @@ -476,6 +476,134 @@ eazel_install_categorydata_to_xml (const CategoryData *category) return node; } +void +osd_parse_implementation (PackageData *pack, + xmlNodePtr node) +{ + xmlNodePtr child; + + child = node->childs; + while (child) { + if (g_strcasecmp (child->name, "PROCESSOR")==0) { + pack->archtype = g_strdup (xmlGetProp (child, "VALUE")); + } else if (g_strcasecmp (child->name, "OS")==0) { + pack->distribution.name = trilobite_get_distribution_enum (xmlGetProp (child, "VALUE"), + TRUE); + } else if (g_strcasecmp (child->name, "CODEBASE")==0) { + pack->filename = g_strdup (xmlGetProp (child, "HREF")); + { + char *tmp; + tmp = xmlGetProp (child, "SIZE"); + if (tmp) { + pack->bytesize = atoi (tmp); + } else { + pack->bytesize = 0; + } + } + } else { + g_warning ("unparsed tag \"%s\" in IMPLEMENTATION", child->name); + } + child = child->next; + } +} + +PackageData* +osd_parse_softpkg (xmlNodePtr softpkg) +{ + PackageData *result; + xmlNodePtr child; + + result = packagedata_new (); + + result->name = g_strdup (xmlGetProp (softpkg, "NAME")); + result->version = g_strdup (xmlGetProp (softpkg, "VERSION")); + + child = softpkg->childs; + while (child) { + if (g_strcasecmp (child->name, "ABSTRACT")==0) { + result->summary = g_strdup (xmlNodeGetContent (child)); + } else if (g_strcasecmp (child->name, "IMPLEMENTATION")==0) { + osd_parse_implementation (result, child); + } else { + g_warning ("unparsed tag \"%s\" in SOFTPKG", child->name); + } + child = child->next; + } + + return result; +} + +GList* +osd_parse_shared (xmlDocPtr doc) +{ + GList *result; + xmlNodePtr base, child; + + result = NULL; + + base = doc->root; + if (base == NULL) { + g_warning (_("*** The osd xml contains no data! ***\n")); + return result; + } + + if (g_strcasecmp (base->name, "PACKAGES")) { + g_warning (_("*** Bailing from osd parse! ***\n")); + return result; + } + + child = base->childs; + while (child) { + if (g_strcasecmp (child->name, "SOFTPKG") == 0) { + PackageData *pack; + pack = osd_parse_softpkg (child); + if (pack) { + result = g_list_prepend (result, pack); + } else { + g_warning ("SOFTPKG parse failed"); + } + } else { + g_warning ("child is not a SOFTPKG, but a \"%s\"", child->name); + } + child = child->next; + } + + return result; +} + +GList* +parse_osd_xml_from_memory (const char *mem, + int size) +{ + xmlDocPtr doc; + GList *result; + char *ptr; + + result = NULL; + if (mem==NULL) { + return result; + } + + mem [size] = 0; + + ptr = strstr (mem, "<?xml"); + if (ptr == NULL) { + g_warning ("Could not find <?xml tag in string"); + return result; + } + doc = xmlParseMemory ((char*)ptr, size); + + if (doc == NULL) { + g_warning ("XML =\"%s\"", ptr); + g_warning ("parse_osd_xml_from_memory, doc == NULL"); + return result; + } + + result = osd_parse_shared (doc); + xmlFreeDoc (doc); + + return result; +} diff --git a/components/services/install/lib/eazel-install-xml-package-list.h b/components/services/install/lib/eazel-install-xml-package-list.h index 565750c0e..1ac81e510 100644 --- a/components/services/install/lib/eazel-install-xml-package-list.h +++ b/components/services/install/lib/eazel-install-xml-package-list.h @@ -47,4 +47,6 @@ xmlNodePtr eazel_install_packagedata_to_xml (const PackageData *pack, char *titl xmlNodePtr eazel_install_packagelist_to_xml (GList *packages); xmlNodePtr eazel_install_categorydata_to_xml (const CategoryData *category); +GList *parse_osd_xml_from_memory (const char *mem, int size); + #endif /* EAZEL_INSTALL_XML_PACKAGE_LIST_H */ diff --git a/components/services/install/nautilus-view/nautilus-service-install.c b/components/services/install/nautilus-view/nautilus-service-install.c index 62915365e..28fb58cba 100644 --- a/components/services/install/nautilus-view/nautilus-service-install.c +++ b/components/services/install/nautilus-view/nautilus-service-install.c @@ -140,7 +140,7 @@ nautilus_service_install_done (EazelInstallCallback *service, NautilusServiceInstallView *view) { char *tmp; - eazel_install_callback_destroy (GTK_OBJECT (service)); + eazel_install_callback_unref (GTK_OBJECT (service)); tmp = g_strdup (view->details->uri); nautilus_service_install_view_load_uri (view, tmp); g_free (tmp); diff --git a/components/services/trilobite/libtrilobite/trilobite-core-distribution.c b/components/services/trilobite/libtrilobite/trilobite-core-distribution.c index a759ebe58..17bdbadf8 100644 --- a/components/services/trilobite/libtrilobite/trilobite-core-distribution.c +++ b/components/services/trilobite/libtrilobite/trilobite-core-distribution.c @@ -252,8 +252,32 @@ trilobite_get_distribution_name (DistributionInfo distinfo, return result; } -DistributionName -trilobite_get_distribution_enum (const char *name) +static DistributionName +trilobite_get_distribution_enum_compact (const char *name) +{ + g_return_val_if_fail (name!=NULL, DISTRO_UNKNOWN); + if (strncmp (name, RHATc, strlen (RHATc)) == 0) { + return DISTRO_REDHAT; + } else if (strncmp (name, DEBIc, strlen (DEBIc)) == 0) { + return DISTRO_DEBIAN; + } else if (strncmp (name, CALDc, strlen (CALDc)) == 0) { + return DISTRO_CALDERA; + } else if (strncmp (name, SUSEc, strlen (SUSEc)) == 0) { + return DISTRO_SUSE; + } else if (strncmp (name, LPPCc, strlen (LPPCc)) == 0) { + return DISTRO_LINUXPPC; + } else if (strncmp (name, TURBc, strlen (TURBc)) == 0) { + return DISTRO_TURBOLINUX; + } else if (strncmp (name, CORLc, strlen (CORLc)) == 0) { + return DISTRO_COREL; + } else if (strncmp (name, MANDc, strlen (MANDc)) == 0) { + return DISTRO_MANDRAKE; + } + return DISTRO_UNKNOWN; +} + +static DistributionName +trilobite_get_distribution_enum_verbose (const char *name) { g_return_val_if_fail (name!=NULL, DISTRO_UNKNOWN); if (strncmp (name, RHAT, strlen (RHAT)) == 0) { @@ -275,3 +299,13 @@ trilobite_get_distribution_enum (const char *name) } return DISTRO_UNKNOWN; } + +DistributionName +trilobite_get_distribution_enum (const char *name, gboolean compact) +{ + if (compact) { + return trilobite_get_distribution_enum_compact (name); + } else { + return trilobite_get_distribution_enum_verbose (name); + } +} diff --git a/components/services/trilobite/libtrilobite/trilobite-core-distribution.h b/components/services/trilobite/libtrilobite/trilobite-core-distribution.h index 5b4451d8e..4ca9d8cba 100644 --- a/components/services/trilobite/libtrilobite/trilobite-core-distribution.h +++ b/components/services/trilobite/libtrilobite/trilobite-core-distribution.h @@ -66,7 +66,7 @@ char* trilobite_get_distribution_name (DistributionInfo distinfo, returns. The version part (if show_version = TRUE was used) is _not_ parsed */ -DistributionName trilobite_get_distribution_enum (const char *name); +DistributionName trilobite_get_distribution_enum (const char *name, gboolean compact); #endif /* EAZEL_SERVICES_DISTRIBUTION_H */ diff --git a/nautilus-installer/src/callbacks.c b/nautilus-installer/src/callbacks.c index 581f1114d..c46040f51 100644 --- a/nautilus-installer/src/callbacks.c +++ b/nautilus-installer/src/callbacks.c @@ -23,17 +23,14 @@ druid_cancel (GnomeDruid *gnomedruid, } -void -begin_install (GtkButton *button, - gpointer window) +gboolean +begin_install (gpointer window) { GnomeDruid *druid; druid = GNOME_DRUID (gtk_object_get_data (GTK_OBJECT (window), "druid")); gnome_druid_set_buttons_sensitive(druid,TRUE,FALSE,TRUE); - gtk_widget_set_sensitive (GTK_WIDGET (button), FALSE); - if (GTK_TOGGLE_BUTTON (gtk_object_get_data (GTK_OBJECT (window), "fullbutton"))->active) { g_message ("full install"); @@ -57,6 +54,8 @@ begin_install (GtkButton *button, } gnome_druid_set_buttons_sensitive(druid,TRUE,TRUE,TRUE); + + return FALSE; } @@ -76,10 +75,7 @@ prep_install (GnomeDruidPage *gnomedruidpage, GnomeDruid *druid; GtkButton *button; - button = GTK_BUTTON (gtk_object_get_data (GTK_OBJECT (window), "begin_button")); - gtk_widget_set_sensitive (GTK_WIDGET (button), TRUE); - druid = GNOME_DRUID (gtk_object_get_data (GTK_OBJECT (window), "druid")); - gnome_druid_set_buttons_sensitive(druid,TRUE,FALSE,TRUE); + g_timeout_add (0, (GSourceFunc)begin_install, window); } void diff --git a/nautilus-installer/src/callbacks.h b/nautilus-installer/src/callbacks.h index 466af314c..caa361a7c 100644 --- a/nautilus-installer/src/callbacks.h +++ b/nautilus-installer/src/callbacks.h @@ -10,9 +10,8 @@ druid_finish (GnomeDruidPage *gnomedruidpage, gpointer arg1, gpointer user_data); -void -begin_install (GtkButton *button, - gpointer user_data); +gboolean +begin_install (gpointer user_data); void prep_install (GnomeDruidPage *gnomedruidpage, diff --git a/nautilus-installer/src/installer.c b/nautilus-installer/src/installer.c index 81ab3f04f..8c675908c 100644 --- a/nautilus-installer/src/installer.c +++ b/nautilus-installer/src/installer.c @@ -32,10 +32,10 @@ static char *package_list[LAST] = { "/package-uninstall-list.xml", }; -char *failure_info; -int installer_debug; -int installer_test; -int installer_local; +static char *failure_info = NULL; +int installer_debug = 0; +int installer_test = 0; +int installer_local = 0; static void eazel_install_progress (EazelInstall *service, @@ -57,19 +57,22 @@ eazel_install_progress (EazelInstall *service, if (amount == 0) { gtk_label_set_text (action_label, "Install :"); gtk_label_set_text (package_label, pack->name); - gtk_progress_set_format_string (GTK_PROGRESS (progressbar), "%p%% - %v kb/%u kb"); + gtk_progress_set_format_string (GTK_PROGRESS (progressbar), "%p%% - %vkb/%ukb"); gtk_progress_configure (GTK_PROGRESS (progressbar), 0, 0, (float)(total/1024)); } if (installer_debug) { float pct; pct = ( (total > 0) ? ((float) ((((float) amount) / total) * 100)): 100.0); - fprintf (stdout, "Install Progress - %s - %d %d %% %f\r", - pack->name?pack->name:"(null)", amount, total, pct); + fprintf (stdout, "Install Progress - %s - %d %d (%d %d) %% %f\r", + pack->name?pack->name:"(null)", + amount, total, + total_size_completed, total_size, + pct); } - gtk_progress_set_value (GTK_PROGRESS (progressbar), (float)(amount/1024)); - gtk_progress_set_value (GTK_PROGRESS (progress_overall), (float)package_num-1); + gtk_progress_set_value (GTK_PROGRESS (progressbar), (float)(amount/1024 > total/1024 ? total/1024 : amount/1024)); + gtk_progress_set_value (GTK_PROGRESS (progress_overall), (float)total_size_completed>total_size ? total_size : total_size_completed); g_main_iteration (FALSE); fflush (stdout); @@ -96,9 +99,13 @@ eazel_download_progress (EazelInstall *service, progressbar = gtk_object_get_data (GTK_OBJECT (widget), "progressbar_single"); if (amount == 0) { - gtk_label_set_text (package_label, name); + char *tmp; + tmp = g_strdup_printf ("Retrieving %s", name); + gtk_label_set_text (package_label, tmp); + g_free (tmp); + gtk_label_set_text (action_label, "Download :"); - gtk_progress_set_format_string (GTK_PROGRESS (progressbar), "%p%% - %v kb/%u kb"); + gtk_progress_set_format_string (GTK_PROGRESS (progressbar), "%p%% (%v of %u kb)"); gtk_progress_configure (GTK_PROGRESS (progressbar), 0, 0, (float)(total/1024)); } @@ -208,7 +215,11 @@ download_failed (EazelInstall *service, const char *name, char **output) { - (*output) = g_strdup_printf ("Download of %s failed", name); + if (*output) { + (*output) = g_strdup_printf ("%s\nDownload of %s failed", *output, name); + } else { + (*output) = g_strdup_printf ("Download of %s failed", name); + } } static void @@ -226,9 +237,8 @@ eazel_install_preflight (EazelInstall *service, package_label = gtk_object_get_data (GTK_OBJECT (widget), "package_label"); progress_overall = gtk_object_get_data (GTK_OBJECT (widget), "progressbar_overall"); - gtk_progress_set_format_string (GTK_PROGRESS (progress_overall), "%p%% - package %v of %u"); - gtk_progress_configure (GTK_PROGRESS (progress_overall), 0, 0, (float)num_packages); - gtk_widget_show (GTK_WIDGET (progress_overall)); + gtk_progress_set_format_string (GTK_PROGRESS (progress_overall), "Total completion %p%%"); + gtk_progress_configure (GTK_PROGRESS (progress_overall), 0, 0, (float)total_size); tmp = g_strdup_printf ("Preparing RPM, %d packages (%d mb)", num_packages, total_size/(1024*1024)); @@ -239,7 +249,6 @@ eazel_install_preflight (EazelInstall *service, gtk_label_set_text (action_label, "Install :"); gtk_label_set_text (package_label, tmp); g_main_iteration (FALSE); - g_main_iteration (FALSE); } static void @@ -308,8 +317,6 @@ void installer (GtkWidget *window, GtkLabel *package_label; GtkLabel *action_label; - make_dirs (); - if (method==UPGRADE) { gnome_warning_dialog ("We don't do UPGRADE yet"); return; @@ -341,6 +348,7 @@ void installer (GtkWidget *window, "rpmrc_file", RPMRC, "server", HOSTNAME, "rpm_storage_path", REMOTE_RPM_DIR, + "package_list", installer_local, "package_list_storage_path", package_list [ method ], "server_port", PORT_NUMBER, NULL)); @@ -363,12 +371,10 @@ void installer (GtkWidget *window, gtk_signal_connect (GTK_OBJECT (service), "delete_files", GTK_SIGNAL_FUNC (eazel_install_delete_files), window); gtk_signal_connect (GTK_OBJECT (service), "download_failed", - GTK_SIGNAL_FUNC (download_failed), &failure_info); + download_failed, &failure_info); gtk_signal_connect (GTK_OBJECT (service), "install_failed", GTK_SIGNAL_FUNC (install_failed), &failure_info); - failure_info = g_new0 (char, 8192); - switch (method) { case FULL_INST: case NAUTILUS_ONLY: diff --git a/nautilus-installer/src/interface.c b/nautilus-installer/src/interface.c index 2d13c6bc0..6cd767eb4 100644 --- a/nautilus-installer/src/interface.c +++ b/nautilus-installer/src/interface.c @@ -1,6 +1,3 @@ -/* - * DO NOT EDIT THIS FILE - it is generated by Glade. - */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -18,335 +15,394 @@ #include "support.h" GtkWidget* +create_what_to_do_page (void) +{ + GtkWidget *what_to_do_page; + GdkColor what_to_do_page_bg_color = { 0, 3341, 23130, 26214 }; + GdkColor what_to_do_page_logo_bg_color = { 0, 3341, 23130, 26214 }; + GdkColor what_to_do_page_title_color = { 0, 65535, 65535, 65535 }; + GtkWidget *druid_vbox1; + GtkWidget *vbox3; + GtkWidget *label10; + GtkWidget *fixed3; + GSList *fixed3_group = NULL; + GtkWidget *fullbutton; + GtkWidget *nautilus_only_button; + GtkWidget *services_only_button; + GtkWidget *upgrade_button; + GtkWidget *uninstall_button; + + what_to_do_page = gnome_druid_page_standard_new_with_vals ("", NULL); + + set_white_stuff (GTK_WIDGET (what_to_do_page)); + + gtk_widget_set_name (what_to_do_page, "what_to_do_page"); + gtk_widget_ref (what_to_do_page); + gtk_object_set_data_full (GTK_OBJECT (window), "what_to_do_page", what_to_do_page, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show_all (what_to_do_page); + gnome_druid_append_page (GNOME_DRUID (druid), GNOME_DRUID_PAGE (what_to_do_page)); + gnome_druid_page_standard_set_bg_color (GNOME_DRUID_PAGE_STANDARD (what_to_do_page), + &what_to_do_page_bg_color); + gnome_druid_page_standard_set_logo_bg_color (GNOME_DRUID_PAGE_STANDARD (what_to_do_page), + &what_to_do_page_logo_bg_color); + gnome_druid_page_standard_set_title_color (GNOME_DRUID_PAGE_STANDARD (what_to_do_page), + &what_to_do_page_title_color); + gnome_druid_page_standard_set_title (GNOME_DRUID_PAGE_STANDARD (what_to_do_page), _("What to do ?")); + + druid_vbox1 = GNOME_DRUID_PAGE_STANDARD (what_to_do_page)->vbox; + set_white_stuff (GTK_WIDGET (druid_vbox1)); + gtk_widget_set_name (druid_vbox1, "druid_vbox1"); + gtk_widget_ref (druid_vbox1); + gtk_object_set_data_full (GTK_OBJECT (window), "druid_vbox1", druid_vbox1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (druid_vbox1); + + vbox3 = gtk_vbox_new (FALSE, 0); + gtk_widget_set_name (vbox3, "vbox3"); + gtk_widget_ref (vbox3); + gtk_object_set_data_full (GTK_OBJECT (window), "vbox3", vbox3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (vbox3); + gtk_box_pack_start (GTK_BOX (druid_vbox1), vbox3, TRUE, TRUE, 0); + + label10 = gtk_label_new (_("You have several choices for what you would like the installer to do.\n" + "Please choose one and click on the \"Next\" button to begin install.")); + gtk_widget_set_name (label10, "label10"); + gtk_widget_ref (label10); + gtk_object_set_data_full (GTK_OBJECT (window), "label10", label10, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label10); + gtk_box_pack_start (GTK_BOX (vbox3), label10, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label10), GTK_JUSTIFY_LEFT); + + fixed3 = gtk_fixed_new (); + set_white_stuff (GTK_WIDGET (fixed3)); + gtk_widget_set_name (fixed3, "fixed3"); + gtk_widget_ref (fixed3); + gtk_object_set_data_full (GTK_OBJECT (window), "fixed3", fixed3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (fixed3); + gtk_box_pack_start (GTK_BOX (vbox3), fixed3, TRUE, TRUE, 0); + + fullbutton = gtk_radio_button_new_with_label (fixed3_group, _("Most recent build")); + fixed3_group = gtk_radio_button_group (GTK_RADIO_BUTTON (fullbutton)); + gtk_widget_set_name (fullbutton, "fullbutton"); + gtk_widget_ref (fullbutton); + gtk_object_set_data_full (GTK_OBJECT (window), "fullbutton", fullbutton, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (fullbutton); + gtk_fixed_put (GTK_FIXED (fixed3), fullbutton, 72, 24); + gtk_widget_set_uposition (fullbutton, 72, 24); + gtk_widget_set_usize (fullbutton, 0, 0); + + nautilus_only_button = gtk_radio_button_new_with_label (fixed3_group, _("Stable Nautilus")); + fixed3_group = gtk_radio_button_group (GTK_RADIO_BUTTON (nautilus_only_button)); + gtk_widget_set_name (nautilus_only_button, "nautilus_only_button"); + gtk_widget_ref (nautilus_only_button); + gtk_object_set_data_full (GTK_OBJECT (window), "nautilus_only_button", nautilus_only_button, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (nautilus_only_button); + gtk_fixed_put (GTK_FIXED (fixed3), nautilus_only_button, 72, 56); + gtk_widget_set_uposition (nautilus_only_button, 72, 56); + gtk_widget_set_usize (nautilus_only_button, 0, 0); +/* + services_only_button = gtk_radio_button_new_with_label (fixed3_group, _("*")); + fixed3_group = gtk_radio_button_group (GTK_RADIO_BUTTON (services_only_button)); + gtk_widget_set_name (services_only_button, "services_only_button"); + gtk_widget_ref (services_only_button); + gtk_object_set_data_full (GTK_OBJECT (window), "services_only_button", services_only_button, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (services_only_button); + gtk_fixed_put (GTK_FIXED (fixed3), services_only_button, 72, 88); + gtk_widget_set_uposition (services_only_button, 72, 88); + gtk_widget_set_usize (services_only_button, 0, 0); + gtk_widget_set_sensitive (GTK_WIDGET (services_only_button), FALSE); + + upgrade_button = gtk_radio_button_new_with_label (fixed3_group, _("*")); + fixed3_group = gtk_radio_button_group (GTK_RADIO_BUTTON (upgrade_button)); + gtk_widget_set_name (upgrade_button, "upgrade_button"); + gtk_widget_ref (upgrade_button); + gtk_object_set_data_full (GTK_OBJECT (window), "upgrade_button", upgrade_button, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (upgrade_button); + gtk_fixed_put (GTK_FIXED (fixed3), upgrade_button, 72, 120); + gtk_widget_set_uposition (upgrade_button, 72, 120); + gtk_widget_set_usize (upgrade_button, 0, 0); + gtk_widget_set_sensitive (GTK_WIDGET (upgrade_button), FALSE); +*/ + uninstall_button = gtk_radio_button_new_with_label (fixed3_group, _("Uninstall")); + fixed3_group = gtk_radio_button_group (GTK_RADIO_BUTTON (uninstall_button)); + gtk_widget_set_name (uninstall_button, "uninstall_button"); + gtk_widget_ref (uninstall_button); + gtk_object_set_data_full (GTK_OBJECT (window), "uninstall_button", uninstall_button, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (uninstall_button); + gtk_fixed_put (GTK_FIXED (fixed3), uninstall_button, 72, 152); + gtk_widget_set_uposition (uninstall_button, 72, 152); + gtk_widget_set_usize (uninstall_button, 0, 0); + gtk_widget_set_sensitive (GTK_WIDGET (uninstall_button), FALSE); + + return what_to_do_page; +} + +GtkWidget* +create_install_page (void) +{ + GtkWidget *install_page; + GdkColor install_page_bg_color = { 0, 3341, 23130, 26214 }; + GdkColor install_page_logo_bg_color = { 0, 3341, 23130, 26214 }; + GdkColor install_page_title_color = { 0, 65535, 65535, 65535 }; + GtkWidget *druid_vbox2; + GtkWidget *vbox5; + GtkWidget *label11; + GtkWidget *table2; + GtkWidget *label12; + GtkWidget *label13; + GtkWidget *action_label; + GtkWidget *progressbar1; + GtkWidget *progressbar2; + GtkWidget *package_label; + GtkWidget *fixed1; + + install_page = gnome_druid_page_standard_new_with_vals ("", NULL); + set_white_stuff (GTK_WIDGET (install_page)); + gtk_widget_set_name (install_page, "install_page"); + gtk_widget_ref (install_page); + gtk_object_set_data_full (GTK_OBJECT (window), "install_page", install_page, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show_all (install_page); + gnome_druid_append_page (GNOME_DRUID (druid), GNOME_DRUID_PAGE (install_page)); + gnome_druid_page_standard_set_bg_color (GNOME_DRUID_PAGE_STANDARD (install_page), + &install_page_bg_color); + gnome_druid_page_standard_set_logo_bg_color (GNOME_DRUID_PAGE_STANDARD (install_page), + &install_page_logo_bg_color); + gnome_druid_page_standard_set_title_color (GNOME_DRUID_PAGE_STANDARD (install_page), + &install_page_title_color); + gnome_druid_page_standard_set_title (GNOME_DRUID_PAGE_STANDARD (install_page), _("Progress...")); + + druid_vbox2 = GNOME_DRUID_PAGE_STANDARD (install_page)->vbox; + gtk_widget_set_name (druid_vbox2, "druid_vbox2"); + gtk_widget_ref (druid_vbox2); + gtk_object_set_data_full (GTK_OBJECT (window), "druid_vbox2", druid_vbox2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (druid_vbox2); + + vbox5 = gtk_vbox_new (FALSE, 0); + set_white_stuff (GTK_WIDGET (vbox5)); + gtk_widget_set_name (vbox5, "vbox5"); + gtk_widget_ref (vbox5); + gtk_object_set_data_full (GTK_OBJECT (window), "vbox5", vbox5, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (vbox5); + gtk_box_pack_start (GTK_BOX (druid_vbox2), vbox5, TRUE, TRUE, 0); +/* + label11 = gtk_label_new (_("(between download and install, we'll take a small break)")); + gtk_widget_set_name (label11, "label11"); + gtk_widget_ref (label11); + gtk_object_set_data_full (GTK_OBJECT (window), "label11", label11, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label11); + gtk_box_pack_start (GTK_BOX (vbox5), label11, TRUE, FALSE, 0); +*/ + table2 = gtk_table_new (3, 2, FALSE); + set_white_stuff (GTK_WIDGET (table2)); + gtk_widget_set_name (table2, "table2"); + gtk_widget_ref (table2); + gtk_object_set_data_full (GTK_OBJECT (window), "table2", table2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (table2); + gtk_box_pack_start (GTK_BOX (vbox5), table2, FALSE, TRUE, 16); + gtk_table_set_row_spacings (GTK_TABLE (table2), 16); + + label12 = gtk_label_new (_("Package :")); + gtk_widget_set_name (label12, "label12"); + gtk_widget_ref (label12); + gtk_object_set_data_full (GTK_OBJECT (window), "label12", label12, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label12); + gtk_table_attach (GTK_TABLE (table2), label12, 0, 1, 0, 1, + (GtkAttachOptions) 0, + (GtkAttachOptions) 0, + 0, 0); + + action_label = gtk_label_new (_("")); + gtk_widget_set_name (action_label, ""); + gtk_widget_ref (action_label); + gtk_object_set_data_full (GTK_OBJECT (window), "action_label", action_label, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (action_label); + gtk_table_attach (GTK_TABLE (table2), action_label, 0, 1, 1, 2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + + label13 = gtk_label_new (_("Overall progress :")); + gtk_widget_set_name (label13, "label13"); + gtk_widget_ref (label13); + gtk_object_set_data_full (GTK_OBJECT (window), "label13", label13, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label13); + gtk_table_attach (GTK_TABLE (table2), label13, 0, 1, 2, 3, + 0, 0, + 0, 0); + + progressbar1 = gtk_progress_bar_new (); + gtk_widget_set_name (progressbar1, "progressbar_single"); + gtk_widget_ref (progressbar1); + gtk_object_set_data_full (GTK_OBJECT (window), "progressbar_single", progressbar1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_progress_set_show_text (GTK_PROGRESS (progressbar1), TRUE); + gtk_widget_show (progressbar1); + gtk_table_attach (GTK_TABLE (table2), progressbar1, 1, 2, 1, 2, + GTK_FILL, + GTK_FILL, + 0, 0); + + progressbar2 = gtk_progress_bar_new (); + gtk_widget_set_name (progressbar2, "progressbar_overall"); + gtk_widget_ref (progressbar2); + gtk_object_set_data_full (GTK_OBJECT (window), "progressbar_overall", progressbar2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_progress_set_format_string (GTK_PROGRESS (progressbar2), "Waiting for download..."); + gtk_progress_set_show_text (GTK_PROGRESS (progressbar2), TRUE); + gtk_widget_show (progressbar2); + gtk_table_attach (GTK_TABLE (table2), progressbar2, 1, 2, 2, 3, + GTK_FILL, + GTK_FILL, + 0, 0); + + package_label = gtk_label_new (_("")); + gtk_widget_set_name (package_label, "package_label"); + gtk_widget_ref (package_label); + gtk_object_set_data_full (GTK_OBJECT (window), "package_label", package_label, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (package_label); + gtk_table_attach (GTK_TABLE (table2), package_label, 1, 2, 0, 1, + GTK_FILL, + GTK_FILL, + 0, 0); + + fixed1 = gtk_fixed_new (); + gtk_widget_set_name (fixed1, "fixed1"); + set_white_stuff (GTK_WIDGET (fixed1)); + gtk_widget_ref (fixed1); + gtk_object_set_data_full (GTK_OBJECT (window), "fixed1", fixed1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (fixed1); + gtk_box_pack_start (GTK_BOX (vbox5), fixed1, FALSE, FALSE, 16); + + return install_page; +} + +GtkWidget* +create_finish_page (void) +{ + GtkWidget *finish_page; + GdkColor finish_page_bg_color = { 0, 3341, 23130, 26214 }; + GdkColor finish_page_textbox_color = { 0, 65535, 65535, 65535 }; + GdkColor finish_page_logo_bg_color = { 0, 3341, 23130, 26214 }; + GdkColor finish_page_title_color = { 0, 65535, 65535, 65535 }; + + finish_page = gnome_druid_page_finish_new (); + gtk_widget_set_name (finish_page, "finish_page"); + gtk_widget_ref (finish_page); + gtk_object_set_data_full (GTK_OBJECT (window), "finish_page", finish_page, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (finish_page); + gnome_druid_append_page (GNOME_DRUID (druid), GNOME_DRUID_PAGE (finish_page)); + gnome_druid_page_finish_set_bg_color (GNOME_DRUID_PAGE_FINISH (finish_page), + &finish_page_bg_color); + gnome_druid_page_finish_set_textbox_color (GNOME_DRUID_PAGE_FINISH (finish_page), + &finish_page_textbox_color); + gnome_druid_page_finish_set_logo_bg_color (GNOME_DRUID_PAGE_FINISH (finish_page), + &finish_page_logo_bg_color); + gnome_druid_page_finish_set_title_color (GNOME_DRUID_PAGE_FINISH (finish_page), + &finish_page_title_color); + gnome_druid_page_finish_set_title (GNOME_DRUID_PAGE_FINISH (finish_page), _("Finished")); + gnome_druid_page_finish_set_text (GNOME_DRUID_PAGE_FINISH (finish_page), + _("If the installation was successfull, you can\n" + "find the nautilus icon in the applications menu.\n" + "If you restart GMC, you can also use the desktop icon, which\n" + "I'll install when you click \"Finish\".\n\n" + "Thanks for taking the time to try out Nautilus.\n\n" + "May your life be a healthy and happy one.")); + + return finish_page; +} + +GtkWidget* create_window (void) { - GtkWidget *window; - GtkWidget *druid; - GtkWidget *start_page; - GdkColor start_page_bg_color = { 0, 3341, 23130, 26214 }; - GdkColor start_page_textbox_color = { 0, 65535, 65535, 65535 }; - GdkColor start_page_logo_bg_color = { 0, 3341, 23130, 26214 }; - GdkColor start_page_title_color = { 0, 65535, 65535, 65535 }; - GtkWidget *what_to_do_page; - GdkColor what_to_do_page_bg_color = { 0, 3341, 23130, 26214 }; - GdkColor what_to_do_page_logo_bg_color = { 0, 3341, 23130, 26214 }; - GdkColor what_to_do_page_title_color = { 0, 65535, 65535, 65535 }; - GtkWidget *druid_vbox1; - GtkWidget *vbox3; - GtkWidget *label10; - GtkWidget *fixed3; - GSList *fixed3_group = NULL; - GtkWidget *fullbutton; - GtkWidget *nautilus_only_button; - GtkWidget *services_only_button; - GtkWidget *upgrade_button; - GtkWidget *uninstall_button; - GtkWidget *install_page; - GdkColor install_page_bg_color = { 0, 3341, 23130, 26214 }; - GdkColor install_page_logo_bg_color = { 0, 3341, 23130, 26214 }; - GdkColor install_page_title_color = { 0, 65535, 65535, 65535 }; - GtkWidget *druid_vbox2; - GtkWidget *vbox5; - GtkWidget *label11; - GtkWidget *table2; - GtkWidget *label12; - GtkWidget *action_label; - GtkWidget *progressbar1; - GtkWidget *progressbar2; - GtkWidget *package_label; - GtkWidget *fixed1; - GtkWidget *begin_button; - GtkWidget *finish_page; - GdkColor finish_page_bg_color = { 0, 3341, 23130, 26214 }; - GdkColor finish_page_textbox_color = { 0, 65535, 65535, 65535 }; - GdkColor finish_page_logo_bg_color = { 0, 3341, 23130, 26214 }; - GdkColor finish_page_title_color = { 0, 65535, 65535, 65535 }; - - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_widget_set_name (window, "window"); - gtk_object_set_data (GTK_OBJECT (window), "window", window); - gtk_window_set_title (GTK_WINDOW (window), _("Nautilus install tool")); - - druid = gnome_druid_new (); - gtk_widget_set_name (druid, "druid"); - gtk_widget_ref (druid); - gtk_object_set_data_full (GTK_OBJECT (window), "druid", druid, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (druid); - gtk_container_add (GTK_CONTAINER (window), druid); - - start_page = gnome_druid_page_start_new (); - gtk_widget_set_name (start_page, "start_page"); - gtk_widget_ref (start_page); - gtk_object_set_data_full (GTK_OBJECT (window), "start_page", start_page, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (start_page); - gnome_druid_append_page (GNOME_DRUID (druid), GNOME_DRUID_PAGE (start_page)); - gnome_druid_set_page (GNOME_DRUID (druid), GNOME_DRUID_PAGE (start_page)); - gnome_druid_page_start_set_bg_color (GNOME_DRUID_PAGE_START (start_page), &start_page_bg_color); - gnome_druid_page_start_set_textbox_color (GNOME_DRUID_PAGE_START (start_page), &start_page_textbox_color); - gnome_druid_page_start_set_logo_bg_color (GNOME_DRUID_PAGE_START (start_page), &start_page_logo_bg_color); - gnome_druid_page_start_set_title_color (GNOME_DRUID_PAGE_START (start_page), &start_page_title_color); - gnome_druid_page_start_set_title (GNOME_DRUID_PAGE_START (start_page), _("Step one:")); - gnome_druid_page_start_set_text (GNOME_DRUID_PAGE_START (start_page), _("This is the internal Nautilus installer.\n\nLots of text should go here letting you know what you need\nto have installed before you should even begin to think about\nusing this. For example:\n\n * Stuff\n * More stuff\n * Other stuff\n\nIf you meet these requirements, hit the \"Next\" button to continue!\n\n")); - - what_to_do_page = gnome_druid_page_standard_new_with_vals ("", NULL); - - set_white_stuff (GTK_WIDGET (what_to_do_page)); - - gtk_widget_set_name (what_to_do_page, "what_to_do_page"); - gtk_widget_ref (what_to_do_page); - gtk_object_set_data_full (GTK_OBJECT (window), "what_to_do_page", what_to_do_page, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show_all (what_to_do_page); - gnome_druid_append_page (GNOME_DRUID (druid), GNOME_DRUID_PAGE (what_to_do_page)); - gnome_druid_page_standard_set_bg_color (GNOME_DRUID_PAGE_STANDARD (what_to_do_page), &what_to_do_page_bg_color); - gnome_druid_page_standard_set_logo_bg_color (GNOME_DRUID_PAGE_STANDARD (what_to_do_page), &what_to_do_page_logo_bg_color); - gnome_druid_page_standard_set_title_color (GNOME_DRUID_PAGE_STANDARD (what_to_do_page), &what_to_do_page_title_color); - gnome_druid_page_standard_set_title (GNOME_DRUID_PAGE_STANDARD (what_to_do_page), _("What to do ?")); - - druid_vbox1 = GNOME_DRUID_PAGE_STANDARD (what_to_do_page)->vbox; - set_white_stuff (GTK_WIDGET (druid_vbox1)); - gtk_widget_set_name (druid_vbox1, "druid_vbox1"); - gtk_widget_ref (druid_vbox1); - gtk_object_set_data_full (GTK_OBJECT (window), "druid_vbox1", druid_vbox1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (druid_vbox1); - - vbox3 = gtk_vbox_new (FALSE, 0); - gtk_widget_set_name (vbox3, "vbox3"); - gtk_widget_ref (vbox3); - gtk_object_set_data_full (GTK_OBJECT (window), "vbox3", vbox3, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox3); - gtk_box_pack_start (GTK_BOX (druid_vbox1), vbox3, TRUE, TRUE, 0); - - label10 = gtk_label_new (_("You have several choices for what you would like the installer to do.\nPlease choose one and click on the \"Next\" button.")); - gtk_widget_set_name (label10, "label10"); - gtk_widget_ref (label10); - gtk_object_set_data_full (GTK_OBJECT (window), "label10", label10, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label10); - gtk_box_pack_start (GTK_BOX (vbox3), label10, FALSE, FALSE, 0); - gtk_label_set_justify (GTK_LABEL (label10), GTK_JUSTIFY_LEFT); - - fixed3 = gtk_fixed_new (); - set_white_stuff (GTK_WIDGET (fixed3)); - gtk_widget_set_name (fixed3, "fixed3"); - gtk_widget_ref (fixed3); - gtk_object_set_data_full (GTK_OBJECT (window), "fixed3", fixed3, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (fixed3); - gtk_box_pack_start (GTK_BOX (vbox3), fixed3, TRUE, TRUE, 0); - - fullbutton = gtk_radio_button_new_with_label (fixed3_group, _("Most recent build")); - fixed3_group = gtk_radio_button_group (GTK_RADIO_BUTTON (fullbutton)); - gtk_widget_set_name (fullbutton, "fullbutton"); - gtk_widget_ref (fullbutton); - gtk_object_set_data_full (GTK_OBJECT (window), "fullbutton", fullbutton, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (fullbutton); - gtk_fixed_put (GTK_FIXED (fixed3), fullbutton, 72, 24); - gtk_widget_set_uposition (fullbutton, 72, 24); - gtk_widget_set_usize (fullbutton, 0, 0); - - nautilus_only_button = gtk_radio_button_new_with_label (fixed3_group, _("Stable Nautilus")); - fixed3_group = gtk_radio_button_group (GTK_RADIO_BUTTON (nautilus_only_button)); - gtk_widget_set_name (nautilus_only_button, "nautilus_only_button"); - gtk_widget_ref (nautilus_only_button); - gtk_object_set_data_full (GTK_OBJECT (window), "nautilus_only_button", nautilus_only_button, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (nautilus_only_button); - gtk_fixed_put (GTK_FIXED (fixed3), nautilus_only_button, 72, 56); - gtk_widget_set_uposition (nautilus_only_button, 72, 56); - gtk_widget_set_usize (nautilus_only_button, 0, 0); - - services_only_button = gtk_radio_button_new_with_label (fixed3_group, _("*")); - fixed3_group = gtk_radio_button_group (GTK_RADIO_BUTTON (services_only_button)); - gtk_widget_set_name (services_only_button, "services_only_button"); - gtk_widget_ref (services_only_button); - gtk_object_set_data_full (GTK_OBJECT (window), "services_only_button", services_only_button, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (services_only_button); - gtk_fixed_put (GTK_FIXED (fixed3), services_only_button, 72, 88); - gtk_widget_set_uposition (services_only_button, 72, 88); - gtk_widget_set_usize (services_only_button, 0, 0); - gtk_widget_set_sensitive (GTK_WIDGET (services_only_button), FALSE); - - upgrade_button = gtk_radio_button_new_with_label (fixed3_group, _("*")); - fixed3_group = gtk_radio_button_group (GTK_RADIO_BUTTON (upgrade_button)); - gtk_widget_set_name (upgrade_button, "upgrade_button"); - gtk_widget_ref (upgrade_button); - gtk_object_set_data_full (GTK_OBJECT (window), "upgrade_button", upgrade_button, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (upgrade_button); - gtk_fixed_put (GTK_FIXED (fixed3), upgrade_button, 72, 120); - gtk_widget_set_uposition (upgrade_button, 72, 120); - gtk_widget_set_usize (upgrade_button, 0, 0); - gtk_widget_set_sensitive (GTK_WIDGET (upgrade_button), FALSE); - - uninstall_button = gtk_radio_button_new_with_label (fixed3_group, _("Uninstall")); - fixed3_group = gtk_radio_button_group (GTK_RADIO_BUTTON (uninstall_button)); - gtk_widget_set_name (uninstall_button, "uninstall_button"); - gtk_widget_ref (uninstall_button); - gtk_object_set_data_full (GTK_OBJECT (window), "uninstall_button", uninstall_button, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (uninstall_button); - gtk_fixed_put (GTK_FIXED (fixed3), uninstall_button, 72, 152); - gtk_widget_set_uposition (uninstall_button, 72, 152); - gtk_widget_set_usize (uninstall_button, 0, 0); - gtk_widget_set_sensitive (GTK_WIDGET (uninstall_button), FALSE); - - install_page = gnome_druid_page_standard_new_with_vals ("", NULL); - set_white_stuff (GTK_WIDGET (install_page)); - gtk_widget_set_name (install_page, "install_page"); - gtk_widget_ref (install_page); - gtk_object_set_data_full (GTK_OBJECT (window), "install_page", install_page, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show_all (install_page); - gnome_druid_append_page (GNOME_DRUID (druid), GNOME_DRUID_PAGE (install_page)); - gnome_druid_page_standard_set_bg_color (GNOME_DRUID_PAGE_STANDARD (install_page), &install_page_bg_color); - gnome_druid_page_standard_set_logo_bg_color (GNOME_DRUID_PAGE_STANDARD (install_page), &install_page_logo_bg_color); - gnome_druid_page_standard_set_title_color (GNOME_DRUID_PAGE_STANDARD (install_page), &install_page_title_color); - gnome_druid_page_standard_set_title (GNOME_DRUID_PAGE_STANDARD (install_page), _("Progress...")); - - druid_vbox2 = GNOME_DRUID_PAGE_STANDARD (install_page)->vbox; - gtk_widget_set_name (druid_vbox2, "druid_vbox2"); - gtk_widget_ref (druid_vbox2); - gtk_object_set_data_full (GTK_OBJECT (window), "druid_vbox2", druid_vbox2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (druid_vbox2); - - vbox5 = gtk_vbox_new (FALSE, 0); - set_white_stuff (GTK_WIDGET (vbox5)); - gtk_widget_set_name (vbox5, "vbox5"); - gtk_widget_ref (vbox5); - gtk_object_set_data_full (GTK_OBJECT (window), "vbox5", vbox5, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox5); - gtk_box_pack_start (GTK_BOX (druid_vbox2), vbox5, TRUE, TRUE, 0); - - label11 = gtk_label_new (_("Press the big begin button, and watch the installer do it's thing...\n(between download and install, we'll take a small break)")); - gtk_widget_set_name (label11, "label11"); - gtk_widget_ref (label11); - gtk_object_set_data_full (GTK_OBJECT (window), "label11", label11, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label11); - gtk_box_pack_start (GTK_BOX (vbox5), label11, TRUE, FALSE, 0); - - table2 = gtk_table_new (3, 2, FALSE); - set_white_stuff (GTK_WIDGET (table2)); - gtk_widget_set_name (table2, "table2"); - gtk_widget_ref (table2); - gtk_object_set_data_full (GTK_OBJECT (window), "table2", table2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (table2); - gtk_box_pack_start (GTK_BOX (vbox5), table2, FALSE, TRUE, 16); - gtk_table_set_row_spacings (GTK_TABLE (table2), 16); - - label12 = gtk_label_new (_("Package :")); - gtk_widget_set_name (label12, "label12"); - gtk_widget_ref (label12); - gtk_object_set_data_full (GTK_OBJECT (window), "label12", label12, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label12); - gtk_table_attach (GTK_TABLE (table2), label12, 0, 1, 0, 1, - (GtkAttachOptions) 0, - (GtkAttachOptions) 0, - 0, 0); - - action_label = gtk_label_new (_("")); - gtk_widget_set_name (action_label, ""); - gtk_widget_ref (action_label); - gtk_object_set_data_full (GTK_OBJECT (window), "action_label", action_label, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (action_label); - gtk_table_attach (GTK_TABLE (table2), action_label, 0, 1, 1, 2, - (GtkAttachOptions) (0), - (GtkAttachOptions) (0), 0, 0); - - progressbar1 = gtk_progress_bar_new (); - gtk_widget_set_name (progressbar1, "progressbar_single"); - gtk_widget_ref (progressbar1); - gtk_object_set_data_full (GTK_OBJECT (window), "progressbar_single", progressbar1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_progress_set_show_text (GTK_PROGRESS (progressbar1), TRUE); - gtk_widget_show (progressbar1); - gtk_table_attach (GTK_TABLE (table2), progressbar1, 1, 2, 1, 2, - GTK_EXPAND, - GTK_EXPAND, - 0, 0); - - progressbar2 = gtk_progress_bar_new (); - gtk_widget_set_name (progressbar2, "progressbar_overall"); - gtk_widget_ref (progressbar2); - gtk_object_set_data_full (GTK_OBJECT (window), "progressbar_overall", progressbar2, - (GtkDestroyNotify) gtk_widget_unref); - gtk_progress_set_show_text (GTK_PROGRESS (progressbar2), TRUE); - gtk_table_attach (GTK_TABLE (table2), progressbar2, 1, 2, 2, 3, - GTK_EXPAND, - GTK_EXPAND, - 0, 0); - - package_label = gtk_label_new (_("")); - gtk_widget_set_name (package_label, "package_label"); - gtk_widget_ref (package_label); - gtk_object_set_data_full (GTK_OBJECT (window), "package_label", package_label, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (package_label); - gtk_table_attach (GTK_TABLE (table2), package_label, 1, 2, 0, 1, - (GtkAttachOptions) (0), - (GtkAttachOptions) (0), 0, 0); - - fixed1 = gtk_fixed_new (); - gtk_widget_set_name (fixed1, "fixed1"); - set_white_stuff (GTK_WIDGET (fixed1)); - gtk_widget_ref (fixed1); - gtk_object_set_data_full (GTK_OBJECT (window), "fixed1", fixed1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (fixed1); - gtk_box_pack_start (GTK_BOX (vbox5), fixed1, FALSE, FALSE, 16); - - begin_button = gtk_button_new_with_label (_("Begin")); - gtk_widget_set_name (begin_button, "begin_button"); - gtk_widget_ref (begin_button); - gtk_object_set_data_full (GTK_OBJECT (window), "begin_button", begin_button, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (begin_button); - gtk_fixed_put (GTK_FIXED (fixed1), begin_button, 208, 32); - gtk_widget_set_uposition (begin_button, 208, 32); - gtk_widget_set_usize (begin_button, 94, 46); - - finish_page = gnome_druid_page_finish_new (); - gtk_widget_set_name (finish_page, "finish_page"); - gtk_widget_ref (finish_page); - gtk_object_set_data_full (GTK_OBJECT (window), "finish_page", finish_page, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (finish_page); - gnome_druid_append_page (GNOME_DRUID (druid), GNOME_DRUID_PAGE (finish_page)); - gnome_druid_page_finish_set_bg_color (GNOME_DRUID_PAGE_FINISH (finish_page), &finish_page_bg_color); - gnome_druid_page_finish_set_textbox_color (GNOME_DRUID_PAGE_FINISH (finish_page), &finish_page_textbox_color); - gnome_druid_page_finish_set_logo_bg_color (GNOME_DRUID_PAGE_FINISH (finish_page), &finish_page_logo_bg_color); - gnome_druid_page_finish_set_title_color (GNOME_DRUID_PAGE_FINISH (finish_page), &finish_page_title_color); - gnome_druid_page_finish_set_title (GNOME_DRUID_PAGE_FINISH (finish_page), _("Finished")); - gnome_druid_page_finish_set_text (GNOME_DRUID_PAGE_FINISH (finish_page), _("If the installation was successfull, you can\n findthe nautilus icon in the applications menu.\n\nThanks for taking the time to try out Nautilus.\n\nMay your life be a healthy and happy one.")); - - gtk_signal_connect (GTK_OBJECT (druid), "cancel", - GTK_SIGNAL_FUNC (druid_cancel), - NULL); - gtk_signal_connect (GTK_OBJECT (install_page), "finish", - GTK_SIGNAL_FUNC (druid_finish), - NULL); - gtk_signal_connect (GTK_OBJECT (install_page), "prepare", - GTK_SIGNAL_FUNC (prep_install), - window); - gtk_signal_connect (GTK_OBJECT (begin_button), "clicked", - GTK_SIGNAL_FUNC (begin_install), - window); - gtk_signal_connect (GTK_OBJECT (finish_page), "finish", - GTK_SIGNAL_FUNC (druid_finish), - NULL); - - return window; + GtkWidget *window; + GtkWidget *druid; + GtkWidget *start_page; + GdkColor start_page_bg_color = { 0, 3341, 23130, 26214 }; + GdkColor start_page_textbox_color = { 0, 65535, 65535, 65535 }; + GdkColor start_page_logo_bg_color = { 0, 3341, 23130, 26214 }; + GdkColor start_page_title_color = { 0, 65535, 65535, 65535 }; + GtkWidget *what_to_do_page; + GtkWidget *install_page; + GtkWidget *finish_page; + + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_widget_set_name (window, "window"); + gtk_object_set_data (GTK_OBJECT (window), "window", window); + gtk_window_set_title (GTK_WINDOW (window), _("Nautilus install tool")); + + druid = gnome_druid_new (); + gtk_widget_set_name (druid, "druid"); + gtk_widget_ref (druid); + gtk_object_set_data_full (GTK_OBJECT (window), "druid", druid, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (druid); + gtk_container_add (GTK_CONTAINER (window), druid); + + start_page = gnome_druid_page_start_new (); + gtk_widget_set_name (start_page, "start_page"); + gtk_widget_ref (start_page); + gtk_object_set_data_full (GTK_OBJECT (window), "start_page", start_page, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (start_page); + gnome_druid_append_page (GNOME_DRUID (druid), GNOME_DRUID_PAGE (start_page)); + gnome_druid_set_page (GNOME_DRUID (druid), GNOME_DRUID_PAGE (start_page)); + gnome_druid_page_start_set_bg_color (GNOME_DRUID_PAGE_START (start_page), + &start_page_bg_color); + gnome_druid_page_start_set_textbox_color (GNOME_DRUID_PAGE_START (start_page), + &start_page_textbox_color); + gnome_druid_page_start_set_logo_bg_color (GNOME_DRUID_PAGE_START (start_page), + &start_page_logo_bg_color); + gnome_druid_page_start_set_title_color (GNOME_DRUID_PAGE_START (start_page), + &start_page_title_color); + gnome_druid_page_start_set_title (GNOME_DRUID_PAGE_START (start_page), _("Step one:")); + gnome_druid_page_start_set_text (GNOME_DRUID_PAGE_START (start_page), + _("This is the internal Nautilus installer.\n\n" + "Lots of text should go here letting you know what you need\n" + "to have installed before you should even begin to think about\n" + "using this. For example:\n" + "\n" + " * Stuff\n" + " * More stuff\n" + " * Other stuff\n" + "\n" + "If you meet these requirements, hit the \"Next\" button to continue!\n\n")); + + what_to_do_page = create_what_to_do_page (); + install_page = create_install_page (); + finish_page = create_finish_page (); + + gtk_signal_connect (GTK_OBJECT (druid), "cancel", + GTK_SIGNAL_FUNC (druid_cancel), + NULL); + gtk_signal_connect (GTK_OBJECT (install_page), "finish", + GTK_SIGNAL_FUNC (druid_finish), + NULL); + gtk_signal_connect (GTK_OBJECT (install_page), "prepare", + GTK_SIGNAL_FUNC (prep_install), + window); + gtk_signal_connect (GTK_OBJECT (finish_page), "finish", + GTK_SIGNAL_FUNC (druid_finish), + NULL); + + return window; } diff --git a/nautilus-installer/src/main.c b/nautilus-installer/src/main.c index 5d1247de6..c9b6f71e0 100644 --- a/nautilus-installer/src/main.c +++ b/nautilus-installer/src/main.c @@ -16,12 +16,12 @@ extern int installer_debug; extern int installer_test; -extern int installer_local; +extern char* installer_local; static const struct poptOption options[] = { {"debug", 'd', POPT_ARG_NONE, &installer_debug, 0 , N_("Show debug output"), NULL}, {"test", 't', POPT_ARG_NONE, &installer_test, 0, N_("Test run"), NULL}, - {"local", 'l', POPT_ARG_NONE, &installer_local, 0, N_("Read local rpm's."), NULL}, + {"local", '\0', POPT_ARG_STRING, &installer_local, 0, N_("Use local, specify xml file to yse"), NULL}, {NULL, '\0', 0, NULL, 0} }; diff --git a/nautilus-installer/src/prescript b/nautilus-installer/src/prescript index 16f1fcf49..4f7bd0920 100644 --- a/nautilus-installer/src/prescript +++ b/nautilus-installer/src/prescript @@ -19,6 +19,8 @@ if test $UID -ne 0; then xhost + localhost su - -c "export DISPLAY=$DISPLAY && cd $PWD && echo Uncompressing... && sh $0 $* $USER" xhost - localhost + cp -f /usr/share/gnome/apps/Applications/nautilus.desktop ~/.gnome-desktop/ + chmod -f 644 ~/.gnome-desktop/nautilus.desktop exit fi if ! test -d /var/eazel/services; then @@ -139,7 +139,7 @@ msgstr "*** pkg listefilen indeholder ingen data ***\n" #: components/services/install/command-line/eazel-install.c:345 msgid "Transaction completed normally...\n" -msgstr "" +msgstr "Transaktionen afsluttede normalt...\n" #: components/services/install/command-line/eazel-package-query.c:45 msgid "Lookup package in the db" @@ -182,7 +182,7 @@ msgstr "version %s-%s" #: components/services/trilobite/libtrilobite/trilobite-core-utils.c:197 #: components/shell/shell.c:60 msgid "Could not initialize Bonobo" -msgstr "" +msgstr "Kunne ikke initialisere Bonobo" #: components/services/trilobite/libtrilobite/trilobite-core-utils.c:212 #, fuzzy, c-format @@ -227,7 +227,7 @@ msgstr "Søg" #. Results list #: components/websearch/ntl-web-search.c:184 msgid "Results" -msgstr "" +msgstr "Resultater" #: cut-n-paste-code/widgets/nautilus-druid/nautilus-druid-page-edge.c:265 #: cut-n-paste-code/widgets/nautilus-druid/nautilus-druid-page-finish.c:244 @@ -249,7 +249,7 @@ msgstr "Tilbage" #: cut-n-paste-code/widgets/nautilus-druid/nautilus-druid.c:153 msgid "Finish" -msgstr "" +msgstr "Afslut" #. This application can't deal with this uri, because it #. * can only handle local files. Tell user. Some day we could offer @@ -289,7 +289,7 @@ msgstr "Type" #: libnautilus-extensions/nautilus-search-bar-criterion.c:45 #, fuzzy msgid "Stored" -msgstr "Stop" +msgstr "Gemt" #: libnautilus-extensions/nautilus-search-bar-criterion.c:46 #: src/file-manager/fm-list-view.c:1578 @@ -299,7 +299,7 @@ msgstr "Størrelse" #: libnautilus-extensions/nautilus-search-bar-criterion.c:47 msgid "With Note" -msgstr "" +msgstr "Med note" #: libnautilus-extensions/nautilus-search-bar-criterion.c:48 #, fuzzy @@ -313,7 +313,7 @@ msgstr "Dato for ændring" #: libnautilus-extensions/nautilus-search-bar-criterion.c:50 msgid "Owned By" -msgstr "" +msgstr "Ejet af" #: libnautilus-extensions/nautilus-search-bar-criterion.c:56 #, fuzzy @@ -322,7 +322,7 @@ msgstr "Kontakter %s" #: libnautilus-extensions/nautilus-search-bar-criterion.c:57 msgid "starts with" -msgstr "" +msgstr "Starer med" #: libnautilus-extensions/nautilus-search-bar-criterion.c:58 #, fuzzy @@ -336,7 +336,7 @@ msgstr "Ingen træffere." #: libnautilus-extensions/nautilus-search-bar-criterion.c:60 msgid "matches regexp" -msgstr "" +msgstr "passer regulært udtryk" #: libnautilus-extensions/nautilus-search-bar-criterion.c:65 msgid "includes" @@ -344,18 +344,18 @@ msgstr "" #: libnautilus-extensions/nautilus-search-bar-criterion.c:66 msgid "does not include" -msgstr "" +msgstr "inkluderer ej" #: libnautilus-extensions/nautilus-search-bar-criterion.c:72 #: libnautilus-extensions/nautilus-search-bar-criterion.c:87 #: libnautilus-extensions/nautilus-search-bar-criterion.c:147 msgid "is" -msgstr "" +msgstr "er" #: libnautilus-extensions/nautilus-search-bar-criterion.c:73 #: libnautilus-extensions/nautilus-search-bar-criterion.c:148 msgid "is not" -msgstr "" +msgstr "er ikke" #: libnautilus-extensions/nautilus-search-bar-criterion.c:78 #, fuzzy @@ -393,11 +393,11 @@ msgstr "" #: libnautilus-extensions/nautilus-search-bar-criterion.c:98 msgid "larger than" -msgstr "" +msgstr "større end" #: libnautilus-extensions/nautilus-search-bar-criterion.c:99 msgid "smaller than" -msgstr "" +msgstr "mindre end" #: libnautilus-extensions/nautilus-search-bar-criterion.c:104 msgid "1 KB" @@ -425,44 +425,44 @@ msgstr "" #: libnautilus-extensions/nautilus-search-bar-criterion.c:115 msgid "including" -msgstr "" +msgstr "inkluderer" #: libnautilus-extensions/nautilus-search-bar-criterion.c:116 #, fuzzy msgid "not including" -msgstr "ingenting" +msgstr "inkluderer ej" #: libnautilus-extensions/nautilus-search-bar-criterion.c:121 msgid "marked with" -msgstr "" +msgstr "markeret med" #: libnautilus-extensions/nautilus-search-bar-criterion.c:122 msgid "not marked with" -msgstr "" +msgstr "ej markeret med" #: libnautilus-extensions/nautilus-search-bar-criterion.c:134 msgid "after" -msgstr "" +msgstr "efter" #: libnautilus-extensions/nautilus-search-bar-criterion.c:135 msgid "before" -msgstr "" +msgstr "før" #: libnautilus-extensions/nautilus-search-bar-criterion.c:140 msgid "today" -msgstr "" +msgstr "idag" #: libnautilus-extensions/nautilus-search-bar-criterion.c:141 msgid "this week" -msgstr "" +msgstr "imorgen" #: libnautilus-extensions/nautilus-search-bar-criterion.c:142 msgid "this month" -msgstr "" +msgstr "i denne måned" #: libnautilus-extensions/nautilus-stock-dialogs.c:409 msgid "Details" -msgstr "" +msgstr "Detaljer" #: components/services/install/lib/eazel-install-metadata.c:54 #: components/services/install/lib/eazel-install-metadata.c:62 @@ -3068,12 +3068,12 @@ msgstr "Luk dette vindue" #: src/nautilus-window-menus.c:1037 #, fuzzy msgid "Close All Windows" -msgstr "_Luk vindue" +msgstr "Luk alle vinduer" #: src/nautilus-window-menus.c:1038 #, fuzzy msgid "Close all windows" -msgstr "Luk dette vindue" +msgstr "Luk alle vinduer" #. Edit menu #: src/nautilus-window-menus.c:1048 |