Author: stephan Date: 2006-08-29 11:50:44 +0000 (Tue, 29 Aug 2006) New Revision: 22931
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.h xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c xarchiver/branches/xarchiver-psybsd/po/nl.po xarchiver/branches/xarchiver-psybsd/po/xarchiver.pot xarchiver/branches/xarchiver-psybsd/src/extract_dialog.c Log: boolean extract options are now supported by extract-dialog Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c =================================================================== --- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c 2006-08-29 08:18:18 UTC (rev 22930) +++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-gnu-tar.c 2006-08-29 11:50:44 UTC (rev 22931) @@ -265,7 +265,7 @@ if(command) { lxa_execute(command, archive, NULL, NULL, NULL, NULL); - g_debug("Extracting archive '%s' to '%s'", archive->path, dest_path); + g_debug("Extracting archive '%s' to '%s'\nUsing command '%s'", archive->path, dest_path, command); g_free(command); } } Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c =================================================================== --- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c 2006-08-29 08:18:18 UTC (rev 22930) +++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c 2006-08-29 11:50:44 UTC (rev 22931) @@ -31,8 +31,6 @@ enum { LXA_ARCHIVE_SUPPORT_ZIP_EXTRACT_OVERWRITE = 1, - LXA_ARCHIVE_SUPPORT_ZIP_EXTRACT_FRESHEN_EXISTING, - LXA_ARCHIVE_SUPPORT_ZIP_EXTRACT_UPDATE_EXISTING, LXA_ARCHIVE_SUPPORT_ZIP_ADD_COMPRESSION_LEVEL, LXA_ARCHIVE_SUPPORT_ZIP_PASSWORD, }; @@ -95,6 +93,13 @@ object_class->set_property = lxa_archive_support_zip_set_property; object_class->get_property = lxa_archive_support_zip_get_property; + pspec = g_param_spec_string("extract-password", + _("Password"), + _("Password"), + "", + G_PARAM_READWRITE); + g_object_class_install_property(object_class, LXA_ARCHIVE_SUPPORT_ZIP_PASSWORD, pspec); + pspec = g_param_spec_boolean("extract-overwrite", _("Overwrite existing files"), _("Overwrite existing files on extraction"), @@ -207,6 +212,9 @@ case LXA_ARCHIVE_SUPPORT_ZIP_EXTRACT_OVERWRITE: g_value_set_boolean(value, LXA_ARCHIVE_SUPPORT_ZIP(object)->_extr_overwrite); break; + case LXA_ARCHIVE_SUPPORT_ZIP_PASSWORD: + g_value_set_string (value, LXA_ARCHIVE_SUPPORT_ZIP(object)->_extr_password); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object,prop_id,pspec); break; @@ -221,6 +229,9 @@ case LXA_ARCHIVE_SUPPORT_ZIP_EXTRACT_OVERWRITE: LXA_ARCHIVE_SUPPORT_ZIP(object)->_extr_overwrite = g_value_get_boolean(value); break; + case LXA_ARCHIVE_SUPPORT_ZIP_PASSWORD: + LXA_ARCHIVE_SUPPORT_ZIP(object)->_extr_password = (gchar *)g_value_get_string(value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object,prop_id,pspec); break; Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.h =================================================================== --- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.h 2006-08-29 08:18:18 UTC (rev 22930) +++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.h 2006-08-29 11:50:44 UTC (rev 22931) @@ -46,7 +46,8 @@ struct _LXAArchiveSupportZip { LXAArchiveSupport parent; - gboolean _extr_overwrite; + gboolean _extr_overwrite; + gchar *_extr_password; }; typedef struct _LXAArchiveSupportZipClass LXAArchiveSupportZipClass; Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c =================================================================== --- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c 2006-08-29 08:18:18 UTC (rev 22930) +++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c 2006-08-29 11:50:44 UTC (rev 22931) @@ -225,11 +225,15 @@ GParamSpec **pspecs = g_object_class_list_properties(support_class, &_nprops); GSList *pspec_list = NULL; - for(i = 0; i < _nprops; i++) +/* Reverse the array, because the list gets prepended + * Otherwise the option-list gets reversed + */ + for(i = _nprops; i > 0; i--) { - if(!strncmp(prefix, g_param_spec_get_name(pspecs[i]), strlen(prefix))) + if(!strncmp(prefix, g_param_spec_get_name(pspecs[i-1]), strlen(prefix))) { - pspec_list = g_slist_prepend(pspec_list, pspecs[i]); + pspec_list = g_slist_prepend(pspec_list, pspecs[i-1]); } } + return pspec_list; } Modified: xarchiver/branches/xarchiver-psybsd/po/nl.po =================================================================== --- xarchiver/branches/xarchiver-psybsd/po/nl.po 2006-08-29 08:18:18 UTC (rev 22930) +++ xarchiver/branches/xarchiver-psybsd/po/nl.po 2006-08-29 11:50:44 UTC (rev 22931) @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: xarchiver 0.3.9psybsd\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-08-29 00:00+0200\n" +"POT-Creation-Date: 2006-08-29 07:38+0200\n" "PO-Revision-Date: 2006-07-20 16:36+0200\n" "Last-Translator: Stephan Arts <[EMAIL PROTECTED]>\n" "Language-Team: Dutch <[EMAIL PROTECTED]>\n" @@ -26,6 +26,11 @@ msgid "Overwrite existing files on extraction" msgstr "Bestaande bestanden overschrijven tijdens uitpakken" +#: ../libxarchiver/archive-support-zip.c:107 +#: ../libxarchiver/archive-support-zip.c:108 +msgid "Password" +msgstr "Wachtwoord" + #: ../src/main.c:47 msgid "[destination path]" msgstr "[bestemmings map]" Modified: xarchiver/branches/xarchiver-psybsd/po/xarchiver.pot =================================================================== --- xarchiver/branches/xarchiver-psybsd/po/xarchiver.pot 2006-08-29 08:18:18 UTC (rev 22930) +++ xarchiver/branches/xarchiver-psybsd/po/xarchiver.pot 2006-08-29 11:50:44 UTC (rev 22931) @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2006-08-29 00:00+0200\n" +"POT-Creation-Date: 2006-08-29 07:38+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <[EMAIL PROTECTED]>\n" "Language-Team: LANGUAGE <[EMAIL PROTECTED]>\n" @@ -26,6 +26,11 @@ msgid "Overwrite existing files on extraction" msgstr "" +#: ../libxarchiver/archive-support-zip.c:107 +#: ../libxarchiver/archive-support-zip.c:108 +msgid "Password" +msgstr "" + #: ../src/main.c:47 msgid "[destination path]" msgstr "" Modified: xarchiver/branches/xarchiver-psybsd/src/extract_dialog.c =================================================================== --- xarchiver/branches/xarchiver-psybsd/src/extract_dialog.c 2006-08-29 08:18:18 UTC (rev 22930) +++ xarchiver/branches/xarchiver-psybsd/src/extract_dialog.c 2006-08-29 11:50:44 UTC (rev 22931) @@ -31,6 +31,9 @@ static void xa_extract_archive_dialog_init(XAExtractArchiveDialog *archive); +void +xa_extract_dialog_option_toggled (GtkWidget *widget, gpointer data); + GType xa_extract_archive_dialog_get_type () { @@ -120,9 +123,10 @@ { case (G_TYPE_BOOLEAN): test = gtk_check_button_new_with_label(g_param_spec_get_nick(G_PARAM_SPEC(extract_options->data))); + g_signal_connect(G_OBJECT(test), "toggled", G_CALLBACK(xa_extract_dialog_option_toggled), (void *)g_param_spec_get_name(G_PARAM_SPEC(extract_options->data))); gtk_box_pack_start(GTK_BOX(r_vbox), test, FALSE, FALSE, 0); break; - case (G_TYPE_STRING): + case (G_TYPE_STRING): /* TODO: Add text-field */ test = gtk_label_new(g_param_spec_get_nick(G_PARAM_SPEC(extract_options->data))); gtk_box_pack_start(GTK_BOX(r_vbox), test, FALSE, FALSE, 0); break; @@ -133,3 +137,18 @@ gtk_widget_show_all(r_vbox); return GTK_WIDGET(dialog); } + +void +xa_extract_dialog_option_toggled (GtkWidget *widget, gpointer data) +{ + GValue *val = g_new0(GValue, 1); + gboolean active; + + val = g_value_init(val, G_TYPE_BOOLEAN); + + g_value_set_boolean(val, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))); + + g_object_set_property(G_OBJECT(XA_EXTRACT_ARCHIVE_DIALOG(gtk_widget_get_ancestor(widget, GTK_TYPE_DIALOG))->support), (gchar *)data, val); + + g_free(val); +} _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits