[Xfce4-commits] r23916 - in xarchiver/branches/xarchiver-psybsd: . libxarchiver po src
Stephan Arts
stephan at xfce.org
Tue Nov 21 11:25:16 CET 2006
Author: stephan
Date: 2006-11-21 10:25:14 +0000 (Tue, 21 Nov 2006)
New Revision: 23916
Modified:
xarchiver/branches/xarchiver-psybsd/Makefile.am
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/libxarchiver/archive-support.h
xarchiver/branches/xarchiver-psybsd/po/POTFILES.in
xarchiver/branches/xarchiver-psybsd/po/nl.po
xarchiver/branches/xarchiver-psybsd/src/main_window.c
xarchiver/branches/xarchiver-psybsd/src/widget_factory.c
xarchiver/branches/xarchiver-psybsd/xarchiver.desktop.in
Log:
Changed UserAction to CustomAction
Added integrity-testing method to zip archive-support
Made .desktop file translatable
Updated Dutch translation
Modified: xarchiver/branches/xarchiver-psybsd/Makefile.am
===================================================================
--- xarchiver/branches/xarchiver-psybsd/Makefile.am 2006-11-21 08:16:23 UTC (rev 23915)
+++ xarchiver/branches/xarchiver-psybsd/Makefile.am 2006-11-21 10:25:14 UTC (rev 23916)
@@ -6,7 +6,7 @@
SUBDIRS = libxarchiver src po
-pixmapsdir = $(datadir)/pixmaps/xarchiver
+pixmapsdir = $(datadir)/pixmaps
pixmaps_DATA = pixmaps/xarchiver.png \
pixmaps/extract.png \
pixmaps/extract_button.png \
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c 2006-11-21 08:16:23 UTC (rev 23915)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.c 2006-11-21 10:25:14 UTC (rev 23916)
@@ -29,6 +29,8 @@
#include "internals.h"
+#define XA_TEST_ACTION_ICON "gtk-index"
+
enum
{
LXA_ARCHIVE_SUPPORT_ZIP_EXTRACT_OVERWRITE = 1,
@@ -44,19 +46,26 @@
LXA_ARCHIVE_SUPPORT_ZIP_VIEW_CRC_32
};
-void
+static void
lxa_archive_support_zip_init(LXAArchiveSupportZip *support);
-void
+static void
lxa_archive_support_zip_class_init(LXAArchiveSupportZipClass *supportclass);
gboolean
lxa_archive_support_zip_refresh_parse_output(GIOChannel *ioc, GIOCondition cond, gpointer data);
-void
+static void
lxa_archive_support_zip_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec);
-void
+static void
lxa_archive_support_zip_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec);
+static gint lxa_archive_support_zip_add(LXAArchive *, GSList *);
+static gint lxa_archive_support_zip_extract(LXAArchive *, gchar *, GSList *);
+static gint lxa_archive_support_zip_remove(LXAArchive *, GSList *);
+static gint lxa_archive_support_zip_refresh(LXAArchive *);
+
+static void lxa_archive_support_zip_integrity_test(LXAArchiveSupport *, LXAArchive *, gpointer);
+
GType
lxa_archive_support_zip_get_type ()
{
@@ -82,10 +91,11 @@
return lxa_archive_support_zip_type;
}
-void
+static void
lxa_archive_support_zip_init(LXAArchiveSupportZip *support)
{
LXAArchiveSupport *archive_support = LXA_ARCHIVE_SUPPORT(support);
+ LXACustomAction *custom_action = NULL;
archive_support->id = "Zip";
@@ -96,9 +106,17 @@
archive_support->extract = lxa_archive_support_zip_extract;
archive_support->remove = lxa_archive_support_zip_remove;
archive_support->refresh = lxa_archive_support_zip_refresh;
+
+ custom_action = lxa_custom_action_new("menu-action-test",
+ _("Test"),
+ _("Test archive integrity\nTest the integrity of the archive"),
+ XA_TEST_ACTION_ICON,
+ lxa_archive_support_zip_integrity_test,
+ archive_support,
+ NULL);
}
-void
+static void
lxa_archive_support_zip_class_init(LXAArchiveSupportZipClass *supportclass)
{
GObjectClass *object_class = G_OBJECT_CLASS (supportclass);
@@ -169,7 +187,6 @@
FALSE,
G_PARAM_READWRITE);
g_object_class_install_property(object_class, LXA_ARCHIVE_SUPPORT_ZIP_VIEW_CRC_32, pspec);
-
}
LXAArchiveSupport*
@@ -190,7 +207,7 @@
return LXA_ARCHIVE_SUPPORT(support);
}
-gint
+static gint
lxa_archive_support_zip_add(LXAArchive *archive, GSList *filenames)
{
if(!LXA_IS_ARCHIVE_SUPPORT_ZIP(archive->support))
@@ -217,7 +234,7 @@
return 0;
}
-gint
+static gint
lxa_archive_support_zip_extract(LXAArchive *archive, gchar *dest_path, GSList *filenames)
{
if(!LXA_IS_ARCHIVE_SUPPORT_ZIP(archive->support))
@@ -249,7 +266,7 @@
return 0;
}
-gint
+static gint
lxa_archive_support_zip_remove(LXAArchive *archive, GSList *filenames)
{
if(!LXA_IS_ARCHIVE_SUPPORT_ZIP(archive->support))
@@ -276,7 +293,7 @@
return 0;
}
-gint
+static gint
lxa_archive_support_zip_refresh(LXAArchive *archive)
{
guint i = 0;
@@ -466,7 +483,13 @@
return TRUE;
}
-void
+static void
+lxa_archive_support_zip_integrity_test(LXAArchiveSupport *support, LXAArchive *archive, gpointer user_data)
+{
+
+}
+
+static void
lxa_archive_support_zip_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
switch(prop_id)
@@ -506,7 +529,7 @@
}
}
-void
+static void
lxa_archive_support_zip_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
switch(prop_id)
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.h 2006-11-21 08:16:23 UTC (rev 23915)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support-zip.h 2006-11-21 10:25:14 UTC (rev 23916)
@@ -68,11 +68,6 @@
GType lxa_archive_support_zip_get_type(void);
LXAArchiveSupport * lxa_archive_support_zip_new();
-gint lxa_archive_support_zip_add(LXAArchive *, GSList *);
-gint lxa_archive_support_zip_extract(LXAArchive *, gchar *, GSList *);
-gint lxa_archive_support_zip_remove(LXAArchive *, GSList *);
-gint lxa_archive_support_zip_refresh(LXAArchive *);
-
G_END_DECLS
#endif /* __LIBXARCHIVER_ARCHIVE_SUPPORT_ZIP_H__ */
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c 2006-11-21 08:16:23 UTC (rev 23915)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.c 2006-11-21 10:25:14 UTC (rev 23916)
@@ -70,7 +70,7 @@
support->extract = NULL;
support->remove = NULL;
support->refresh = NULL;
- support->user_action = NULL;
+ support->custom_action = NULL;
}
/*
@@ -256,75 +256,74 @@
}
void
-lxa_archive_support_install_action(LXAArchiveSupport *support, LXAUserAction *action)
+lxa_archive_support_install_action(LXAArchiveSupport *support, LXACustomAction *action)
{
- support->user_action = g_slist_append(support->user_action, action);
+ support->custom_action = g_slist_append(support->custom_action, action);
}
-LXAUserAction*
+LXACustomAction*
lxa_archive_support_find_action(LXAArchiveSupport *support, const gchar *name)
{
- GSList *actions = support->user_action;
+ GSList *actions = support->custom_action;
while(actions)
{
- if(strcmp(((LXAUserAction*)actions->data)->name, name) == 0)
- return (LXAUserAction*)actions->data;
+ if(strcmp(((LXACustomAction*)actions->data)->name, name) == 0)
+ return (LXACustomAction*)actions->data;
actions = actions->next;
}
return NULL;
}
-LXAUserAction**
+LXACustomAction**
lxa_archive_support_list_actions(LXAArchiveSupport *support, guint *n_actions)
{
- LXAUserAction** list;
+ LXACustomAction** list;
guint i = 0;
- GSList *actions = support->user_action;
+ GSList *actions = support->custom_action;
(*n_actions) = g_slist_length(actions);
- list = g_new(LXAUserAction*, *n_actions);
+ list = g_new(LXACustomAction*, *n_actions);
while(actions)
{
- list[i++] = (LXAUserAction*)actions->data;
+ list[i++] = (LXACustomAction*)actions->data;
actions = actions->next;
}
return list;
}
-LXAUserAction*
-lxa_user_action_new(const gchar *name, const gchar *nick, const gchar *blurb, const gchar *icon, LXAUserActionFunc func, LXAArchive *archive, LXAArchiveSupport *support, gpointer user_data)
+LXACustomAction*
+lxa_custom_action_new(const gchar *name, const gchar *nick, const gchar *blurb, const gchar *icon, LXACustomActionFunc func, LXAArchiveSupport *support, gpointer user_data)
{
- LXAUserAction *action = g_new(LXAUserAction, 1);
+ LXACustomAction *action = g_new(LXACustomAction, 1);
action->name = g_strdup(name);
action->nick = g_strdup(nick);
action->blurb = g_strdup(blurb);
action->icon = g_strdup(icon);
action->func = func;
- action->archive = archive;
action->support = support;
action->user_data = user_data;
return action;
}
const gchar*
-lxa_user_action_get_name(LXAUserAction *action)
+lxa_custom_action_get_name(LXACustomAction *action)
{
return action->name;
}
const gchar*
-lxa_user_action_get_nick(LXAUserAction *action)
+lxa_custom_action_get_nick(LXACustomAction *action)
{
return action->nick;
}
const gchar*
-lxa_user_action_get_blurb(LXAUserAction *action)
+lxa_custom_action_get_blurb(LXACustomAction *action)
{
return action->blurb;
}
void
-lxa_user_action_execute(LXAUserAction *action)
+lxa_custom_action_execute(LXACustomAction *action, LXAArchive *archive)
{
- action->func(action->archive, action->support, action->user_data);
+ action->func(action->support, archive, action->user_data);
}
Modified: xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.h
===================================================================
--- xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.h 2006-11-21 08:16:23 UTC (rev 23915)
+++ xarchiver/branches/xarchiver-psybsd/libxarchiver/archive-support.h 2006-11-21 10:25:14 UTC (rev 23916)
@@ -41,19 +41,18 @@
G_TYPE_CHECK_CLASS_TYPE ((klass), \
LXA_TYPE_ARCHIVE_SUPPORT))
-typedef struct _LXAUserAction LXAUserAction;
+typedef struct _LXACustomAction LXACustomAction;
typedef struct _LXAArchiveSupport LXAArchiveSupport;
-typedef void (*LXAUserActionFunc) (LXAArchive *archive, LXAArchiveSupport *support, gpointer user_data);
+typedef void (*LXACustomActionFunc) (LXAArchiveSupport *support, LXAArchive *, gpointer user_data);
-struct _LXAUserAction
+struct _LXACustomAction
{
gchar *name;
gchar *nick;
gchar *blurb;
gchar *icon;
- LXAUserActionFunc func;
- LXAArchive *archive;
+ LXACustomActionFunc func;
LXAArchiveSupport *support;
gpointer user_data;
};
@@ -63,7 +62,7 @@
GObject parent;
gchar *id;
GSList *mime;
- GSList *user_action;
+ GSList *custom_action;
/*
* The following functions should _NOT_ be called directly.
*
@@ -106,16 +105,22 @@
GSList * lxa_archive_support_list_properties(LXAArchiveSupport *, gchar *);
-void lxa_archive_support_install_action(LXAArchiveSupport *, LXAUserAction *);
-LXAUserAction* lxa_archive_support_find_action(LXAArchiveSupport *, const gchar *name);
-LXAUserAction** lxa_archive_support_list_actions(LXAArchiveSupport *, guint *n_actions);
+void lxa_archive_support_install_action(LXAArchiveSupport *, LXACustomAction *);
+LXACustomAction* lxa_archive_support_find_action(LXAArchiveSupport *, const gchar *name);
+LXACustomAction** lxa_archive_support_list_actions(LXAArchiveSupport *, guint *n_actions);
-LXAUserAction* lxa_user_action_new(const gchar *name, const gchar *nick, const gchar *blurb, const gchar *icon, LXAUserActionFunc func, LXAArchive *archive, LXAArchiveSupport *support, gpointer user_data);
-const gchar* lxa_user_action_get_name(LXAUserAction*);
-const gchar* lxa_user_action_get_nick(LXAUserAction*);
-const gchar* lxa_user_action_get_blurb(LXAUserAction*);
-const gchar* lxa_user_action_get_icon_name(LXAUserAction*);
-void lxa_user_action_execute(LXAUserAction*);
+LXACustomAction* lxa_custom_action_new(const gchar *name,
+ const gchar *nick,
+ const gchar *blurb,
+ const gchar *icon,
+ LXACustomActionFunc func,
+ LXAArchiveSupport *support,
+ gpointer user_data);
+const gchar* lxa_custom_action_get_name(LXACustomAction*);
+const gchar* lxa_custom_action_get_nick(LXACustomAction*);
+const gchar* lxa_custom_action_get_blurb(LXACustomAction*);
+const gchar* lxa_custom_action_get_icon_name(LXACustomAction*);
+void lxa_custom_action_execute(LXACustomAction*, LXAArchive *);
G_END_DECLS
Modified: xarchiver/branches/xarchiver-psybsd/po/POTFILES.in
===================================================================
--- xarchiver/branches/xarchiver-psybsd/po/POTFILES.in 2006-11-21 08:16:23 UTC (rev 23915)
+++ xarchiver/branches/xarchiver-psybsd/po/POTFILES.in 2006-11-21 10:25:14 UTC (rev 23916)
@@ -10,3 +10,5 @@
src/new_dialog.c
src/add_dialog.c
src/extract_dialog.c
+
+xarchiver.desktop.in
Modified: xarchiver/branches/xarchiver-psybsd/po/nl.po
===================================================================
--- xarchiver/branches/xarchiver-psybsd/po/nl.po 2006-11-21 08:16:23 UTC (rev 23915)
+++ xarchiver/branches/xarchiver-psybsd/po/nl.po 2006-11-21 10:25:14 UTC (rev 23916)
@@ -7,7 +7,7 @@
msgstr ""
"Project-Id-Version: xarchiver 0.3.9psybsd\n"
"Report-Msgid-Bugs-To: psybsd at gmail.com\n"
-"POT-Creation-Date: 2006-11-17 20:52+0100\n"
+"POT-Creation-Date: 2006-11-20 18:28+0100\n"
"PO-Revision-Date: 2006-07-20 16:36+0200\n"
"Last-Translator: Stephan Arts <psybsd at gmail.com>\n"
"Language-Team: Dutch <vertaling at vrijschrift.org>\n"
@@ -110,27 +110,27 @@
msgid "CRC-32"
msgstr "CRC-32"
-#: ../src/main.c:51
+#: ../src/main.c:52
msgid "[destination path]"
msgstr "[bestemmings map]"
-#: ../src/main.c:59
+#: ../src/main.c:60
msgid "[archive path] [file1] [file2] ... [fileN]"
msgstr "[archief map] [bestand1] [bestand2] ... [bestandN]"
-#: ../src/main.c:63
+#: ../src/main.c:64
msgid "[file1] [file2] ... [fileN]"
msgstr "[bestand1] [bestand2] ... [bestandN]"
-#: ../src/main.c:66
+#: ../src/main.c:67
msgid "Version information"
msgstr "Versie informatie"
-#: ../src/main.c:117
+#: ../src/main.c:118
msgid "[archive name]"
msgstr "[archief naam]"
-#: ../src/main.c:121
+#: ../src/main.c:122
#, c-format
msgid ""
"%s: %s\n"
@@ -141,70 +141,70 @@
"opties.\n"
#. File menu
-#: ../src/main_window.c:188
+#: ../src/main_window.c:210
msgid "_File"
msgstr "_Bestand"
#. Action menu
-#: ../src/main_window.c:219
+#: ../src/main_window.c:241
msgid "_Action"
msgstr "_Actie"
-#: ../src/main_window.c:224
+#: ../src/main_window.c:246
msgid "_Add"
msgstr "_Toevoegen"
-#: ../src/main_window.c:230
+#: ../src/main_window.c:252
msgid "_Extract"
msgstr "_Uitpakken"
#. View menu
-#: ../src/main_window.c:244
+#: ../src/main_window.c:266
msgid "_View"
msgstr "B_eeld"
-#: ../src/main_window.c:248
+#: ../src/main_window.c:270
msgid "_Location Selector"
msgstr "_Locatie Selecteerder"
-#: ../src/main_window.c:253
+#: ../src/main_window.c:275
msgid "Internal style"
msgstr "Interne stijl"
-#: ../src/main_window.c:257
+#: ../src/main_window.c:279
msgid "Toolbar style"
msgstr "Toolbar stijl"
-#: ../src/main_window.c:261
+#: ../src/main_window.c:284
msgid "Pathbar style"
msgstr "Padbar stijl"
-#: ../src/main_window.c:287
+#: ../src/main_window.c:311
msgid "Add"
msgstr "Toevoegen"
-#: ../src/main_window.c:291 ../src/main_window.c:672
+#: ../src/main_window.c:315 ../src/main_window.c:714
#: ../src/extract_dialog.c:102
msgid "Extract"
msgstr "Uitpakken"
-#: ../src/main_window.c:489
+#: ../src/main_window.c:523
msgid "Open archive"
msgstr "Archief openen"
-#: ../src/main_window.c:671
+#: ../src/main_window.c:713
msgid "Which action do you want to perform on the selected file(s)?"
msgstr "Welke actie wil je uitvoeren op de geselecteerde bestand(en)?"
-#: ../src/main_window.c:672
+#: ../src/main_window.c:714
msgid "View"
msgstr "Weergeven"
-#: ../src/main_window.c:735
+#: ../src/main_window.c:777
msgid "Failed to open file"
msgstr "Het openen van een bestand is mislukt"
-#: ../src/main_window.c:736
+#: ../src/main_window.c:778
#, c-format
msgid ""
"'%s'\n"
@@ -248,3 +248,11 @@
#: ../src/extract_dialog.c:115
msgid "Extract archive"
msgstr "Archief uitpakken"
+
+#: ../xarchiver.desktop.in.h:1
+msgid "A GTK+2 archive manager"
+msgstr "Een GTK+2 Archief beheerder"
+
+#: ../xarchiver.desktop.in.h:2
+msgid "Archive manager"
+msgstr "Archief beheerder"
Modified: xarchiver/branches/xarchiver-psybsd/src/main_window.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/main_window.c 2006-11-21 08:16:23 UTC (rev 23915)
+++ xarchiver/branches/xarchiver-psybsd/src/main_window.c 2006-11-21 10:25:14 UTC (rev 23916)
@@ -47,6 +47,11 @@
#include "main.h"
+enum
+{
+ XA_MAIN_WINDOW_NAVIGATION_STYLE = 1
+};
+
static void
xa_main_window_init(XAMainWindow *);
static void
@@ -112,11 +117,22 @@
xa_main_window_class_init(XAMainWindowClass *window_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (window_class);
+ GParamSpec *pspec = NULL;
object_class->set_property = xa_main_window_set_property;
object_class->get_property = xa_main_window_get_property;
object_class->finalize = xa_main_window_finalize;
+ pspec = g_param_spec_enum("navigation-style",
+ "",
+ "",
+ G_TYPE_ENUM,
+ 0,
+ G_PARAM_READWRITE);
+ g_object_class_install_property(object_class, XA_MAIN_WINDOW_NAVIGATION_STYLE, pspec);
+
+
+
}
static void
@@ -410,11 +426,23 @@
static void
xa_main_window_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
+/*
+ switch(prop_id)
+ {
+
+ }
+*/
}
static void
xa_main_window_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
+/*
+ switch(prop_id)
+ {
+
+ }
+*/
}
GtkWidget *
@@ -423,7 +451,7 @@
GError *error = NULL;
GtkWidget *file_image;
gchar *path;
- path = g_strconcat(DATADIR, "/pixmaps/xarchiver/", filename, NULL);
+ path = g_strconcat(DATADIR, "/pixmaps/", filename, NULL);
GdkPixbuf *file_pixbuf = gdk_pixbuf_new_from_file(path, &error);
if(error)
{
Modified: xarchiver/branches/xarchiver-psybsd/src/widget_factory.c
===================================================================
--- xarchiver/branches/xarchiver-psybsd/src/widget_factory.c 2006-11-21 08:16:23 UTC (rev 23915)
+++ xarchiver/branches/xarchiver-psybsd/src/widget_factory.c 2006-11-21 10:25:14 UTC (rev 23916)
@@ -723,14 +723,14 @@
xa_widget_factory_create_action_widget(XAWidgetFactory *factory, LXAArchiveSupport *obj, const gchar *act)
{
GtkWidget *widget = NULL;
- LXAUserAction *action = lxa_archive_support_find_action(obj, act);
+ LXACustomAction *action = lxa_archive_support_find_action(obj, act);
if(!action)
return NULL;
- widget = gtk_button_new_with_label(lxa_user_action_get_nick(action));
+ widget = gtk_button_new_with_label(lxa_custom_action_get_nick(action));
- const gchar *large_tip = lxa_user_action_get_blurb(action);
+ const gchar *large_tip = lxa_custom_action_get_blurb(action);
gchar *small_tip = NULL;
if(strchr(large_tip, '\n'))
{
Modified: xarchiver/branches/xarchiver-psybsd/xarchiver.desktop.in
===================================================================
--- xarchiver/branches/xarchiver-psybsd/xarchiver.desktop.in 2006-11-21 08:16:23 UTC (rev 23915)
+++ xarchiver/branches/xarchiver-psybsd/xarchiver.desktop.in 2006-11-21 10:25:14 UTC (rev 23916)
@@ -2,13 +2,13 @@
Encoding=UTF-8
Version=1.0
Name=Xarchiver
-_Comment=A GTK+2 only archive manager
+_Comment=A GTK+2 archive manager
_GenericName=Archive manager
Exec=xarchiver
-Icon=xarchiver.png
+Icon=xarchiver
Terminal=false
Type=Application
X-MultipleArgs=false
Categories=GTK;Archiving;Utility;
StartupNotify=true
-MimeType=application/x-bzip-compressed-tar;application/x-tar;application/x-compressed-tar;application/x-zip;application/zip;
+MimeType=application/x-bzip-compressed-tar;application/x-tar;application/x-compressed-tar;application/x-tzo;application/x-tarz;application/x-zip;application/zip;
More information about the Xfce4-commits
mailing list