From b28ae6fe841663d7cfc96908172c4adecd1dd3c6 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Mon, 28 Oct 2013 20:41:20 +0100 Subject: package installer: don't display an error message if the user cancelled the operation --- src/dlg-package-installer.c | 49 ++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/dlg-package-installer.c b/src/dlg-package-installer.c index 451a2ca..4eabd02 100644 --- a/src/dlg-package-installer.c +++ b/src/dlg-package-installer.c @@ -48,8 +48,9 @@ installer_data_free (InstallerData *idata) static void -package_installer_terminated (InstallerData *idata, - const char *error) +package_installer_terminated (InstallerData *idata, + FrProcErrorType error_type, + const char *error_message) { GdkWindow *window; @@ -57,11 +58,11 @@ package_installer_terminated (InstallerData *idata, if (window != NULL) gdk_window_set_cursor (window, NULL); - if (error != NULL) { + if (error_type != FR_PROC_ERROR_NONE) { fr_archive_action_completed (idata->archive, FR_ACTION_CREATING_NEW_ARCHIVE, - FR_PROC_ERROR_GENERIC, - error); + error_type, + error_message); } else { update_registered_commands_capabilities (); @@ -83,24 +84,36 @@ packagekit_install_package_names_ready_cb (GObject *source_object, GAsyncResult *res, gpointer user_data) { - InstallerData *idata = user_data; - GDBusProxy *proxy; - GVariant *values; - GError *error = NULL; - char *message = NULL; + InstallerData *idata = user_data; + GDBusProxy *proxy; + GVariant *values; + GError *error = NULL; + FrProcErrorType error_type = FR_PROC_ERROR_NONE; + char *error_message = NULL; proxy = G_DBUS_PROXY (source_object); values = g_dbus_proxy_call_finish (proxy, res, &error); if (values == NULL) { - message = g_strdup_printf ("%s\n%s", - _("There was an internal error trying to search for applications:"), - error->message); + if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) + || (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_DBUS_ERROR) + && (error->message != NULL) + && (strstr (error->message, "org.freedesktop.Packagekit.Modify.Cancelled") != NULL))) + { + error_type = FR_PROC_ERROR_STOPPED; + error_message = NULL; + } + else { + error_type = FR_PROC_ERROR_GENERIC; + error_message = g_strdup_printf ("%s\n%s", + _("There was an internal error trying to search for applications:"), + error->message); + } g_clear_error (&error); } - package_installer_terminated (idata, message); + package_installer_terminated (idata, error_type, error_message); - g_free (message); + g_free (error_message); if (values != NULL) g_variant_unref (values); g_object_unref (proxy); @@ -204,7 +217,7 @@ install_packages (InstallerData *idata) message = g_strdup_printf ("%s\n%s", _("There was an internal error trying to search for applications:"), error->message); - package_installer_terminated (idata, message); + package_installer_terminated (idata, FR_PROC_ERROR_GENERIC, message); g_clear_error (&error); } @@ -251,7 +264,7 @@ dlg_package_installer (FrWindow *window, if (command_type == 0) command_type = get_preferred_command_for_mime_type (idata->archive->content_type, FR_COMMAND_CAN_READ); if (command_type == 0) { - package_installer_terminated (idata, _("Archive type not supported.")); + package_installer_terminated (idata, FR_PROC_ERROR_GENERIC, _("Archive type not supported.")); return; } @@ -260,7 +273,7 @@ dlg_package_installer (FrWindow *window, g_object_unref (command); if (idata->packages == NULL) { - package_installer_terminated (idata, _("Archive type not supported.")); + package_installer_terminated (idata, FR_PROC_ERROR_GENERIC, _("Archive type not supported.")); return; } -- cgit v1.2.1 From 5ef1b4801e7365b4cbf53c6ee829259dde32b5ee Mon Sep 17 00:00:00 2001 From: raveit65 Date: Mon, 28 Oct 2013 21:03:26 +0100 Subject: adds Windows Imaging Format (.wim, .swm) support --- src/fr-command-7z.c | 1 + src/main.c | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src') diff --git a/src/fr-command-7z.c b/src/fr-command-7z.c index 9909271..b61868b 100644 --- a/src/fr-command-7z.c +++ b/src/fr-command-7z.c @@ -526,6 +526,7 @@ const char *sevenz_mime_types[] = { "application/x-7z-compressed", /*"application/x-cbr",*/ "application/x-cbz", "application/x-ms-dos-executable", + "application/x-ms-wim", "application/x-rar", "application/zip", NULL }; diff --git a/src/main.c b/src/main.c index bbcaa31..fed73bb 100644 --- a/src/main.c +++ b/src/main.c @@ -113,6 +113,7 @@ FrMimeTypeDescription mime_type_desc[] = { { "application/x-lzma-compressed-tar", ".tar.lzma", N_("Tar compressed with lzma (.tar.lzma)"), 0 }, { "application/x-lzop", ".lzo", NULL, 0 }, { "application/x-lzop-compressed-tar", ".tar.lzo", N_("Tar compressed with lzop (.tar.lzo)"), 0 }, + { "application/x-ms-wim", ".wim", N_("Windows Imaging Format (.wim)"), 0 }, { "application/x-rar", ".rar", N_("Rar (.rar)"), 0 }, { "application/x-rpm", ".rpm", NULL, 0 }, { "application/x-rzip", ".rz", NULL, 0 }, @@ -156,6 +157,7 @@ FrExtensionType file_ext_type[] = { { ".rpm", "application/x-rpm" }, { ".rz", "application/x-rzip" }, { ".sit", "application/x-stuffit" }, + { ".swm", "application/x-ms-wim" }, { ".tar", "application/x-tar" }, { ".tar.bz", "application/x-bzip-compressed-tar" }, { ".tar.bz2", "application/x-bzip-compressed-tar" }, @@ -176,6 +178,7 @@ FrExtensionType file_ext_type[] = { { ".tzma", "application/x-lzma-compressed-tar" }, { ".tzo", "application/x-lzop-compressed-tar" }, { ".war", "application/x-war" }, + { ".wim", "application/x-ms-wim" }, { ".xz", "application/x-xz" }, { ".z", "application/x-gzip" }, { ".Z", "application/x-compress" }, -- cgit v1.2.1 From d2e86889e0386a0dda2f4f8bbffd464bd3778ee7 Mon Sep 17 00:00:00 2001 From: raveit65 Date: Mon, 28 Oct 2013 21:17:21 +0100 Subject: engrampa does not build without packagekit https://bugzilla.gnome.org/show_bug.cgi?id=634356 --- src/dlg-package-installer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/dlg-package-installer.c b/src/dlg-package-installer.c index 4eabd02..466aa5f 100644 --- a/src/dlg-package-installer.c +++ b/src/dlg-package-installer.c @@ -301,7 +301,7 @@ dlg_package_installer (FrWindow *window, #else /* ! ENABLE_PACKAGEKIT */ - package_installer_terminated (idata, _("Archive type not supported.")); + package_installer_terminated (idata, FR_PROC_ERROR_GENERIC, _("Archive type not supported.")); #endif /* ENABLE_PACKAGEKIT */ } -- cgit v1.2.1 From c5b92183993bc71fd7798f3dac869174453fe1db Mon Sep 17 00:00:00 2001 From: raveit65 Date: Mon, 28 Oct 2013 21:25:03 +0100 Subject: 7z: changed the compression level options normal compression : from "-mx=5" to "-mx=7" maximum compression: from "-mx=7" to "-mx=9 -m0=lzma2" https://bugzilla.gnome.org/show_bug.cgi?id=635083 --- src/fr-command-7z.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/fr-command-7z.c b/src/fr-command-7z.c index b61868b..fbce9cf 100644 --- a/src/fr-command-7z.c +++ b/src/fr-command-7z.c @@ -347,13 +347,18 @@ fr_command_7z_add (FrCommand *comm, switch (comm->compression) { case FR_COMPRESSION_VERY_FAST: - fr_process_add_arg (comm->process, "-mx=1"); break; + fr_process_add_arg (comm->process, "-mx=1"); + break; case FR_COMPRESSION_FAST: - fr_process_add_arg (comm->process, "-mx=5"); break; + fr_process_add_arg (comm->process, "-mx=5"); + break; case FR_COMPRESSION_NORMAL: - fr_process_add_arg (comm->process, "-mx=5"); break; + fr_process_add_arg (comm->process, "-mx=7"); + break; case FR_COMPRESSION_MAXIMUM: - fr_process_add_arg (comm->process, "-mx=7"); break; + fr_process_add_arg (comm->process, "-mx=9"); + fr_process_add_arg (comm->process, "-m0=lzma2");; + break; } if (is_mime_type (comm->mime_type, "application/x-ms-dos-executable")) -- cgit v1.2.1