plugins/image-crop/Makefile
plugins/random-image/Makefile
plugins/lens/Makefile
+ plugins/open-archive/Makefile
geeqie.spec
])
menu.\r
</para>\r
</section>\r
+ <section id="OpenArchive">\r
+ <title>Open archive file</title>\r
+ <para>\r
+ Opens an archive file (of the type .zip, .rar, .cbr, .tar.gz) and extracts the contents into a folder in <code>/tmp</code>. A new Geeqie window is opened in that folder.\r
+ </para>\r
+ <para>\r
+ This item is displayed in the\r
+ <emphasis role="strong">Plugins</emphasis>\r
+ menu.\r
+ </para>\r
+ </section>\r
</section>\r
-SUBDIRS = rotate symlink ufraw geocode-parameters export-jpeg tethered-photography camera-import image-crop random-image lens
+SUBDIRS = rotate symlink ufraw geocode-parameters export-jpeg tethered-photography camera-import image-crop random-image lens open-archive
qq_desktoptemplatedir = $(appdir)
qq_desktoptemplate_in_files = template.desktop.in
qq_desktoptemplate_DATA = $(qq_desktoptemplate_in_files:.desktop.in=.desktop)
--- /dev/null
+dist_gq_bin_SCRIPTS = geeqie-open-archive
+
+gq_desktopdir = $(appdir)/applications
+gq_desktop_in_files = open-archive.desktop.in
+gq_desktop_DATA = $(gq_desktop_in_files:.desktop.in=.desktop)
+@INTLTOOL_DESKTOP_RULE@
+
+EXTRA_DIST = $(gq_desktop_in_files)
+CLEANFILES = $(gq_desktop_DATA)
+
--- /dev/null
+#!/bin/bash
+
+# Extract the contents of an archive file to a
+# temporary folder under /tmp.
+#
+# Open a new Geeqie window pointing to that folder.
+
+full_path=$(realpath "$1")
+filename=$(basename -- "$1")
+extension="${filename#*.}"
+
+case $extension in
+
+ zip)
+ if [ $(which unzip > /dev/null; echo $? ) = 0 ]
+ then
+ rm --recursive --force "/tmp/geeqie-archive/$full_path"
+ mkdir --parents "/tmp/geeqie-archive/$full_path"
+ unzip "$full_path" -d "/tmp/geeqie-archive/$full_path" > /dev/null
+ geeqie --remote --new-window "/tmp/geeqie-archive/$full_path"
+ else
+ zenity --title="Geeqie Open Archive" --info --width=300 --text="Utility unzip is not installed"
+ fi
+ ;;
+
+ tar.gz)
+ if [ $(which tar > /dev/null; echo $? ) = 0 ]
+ then
+ rm --recursive --force "/tmp/geeqie-archive/$full_path"
+ mkdir --parents "/tmp/geeqie-archive/$full_path"
+ tar --extract --gunzip --directory "/tmp/geeqie-archive/$full_path" --file="$full_path" > /dev/null
+ geeqie --remote --new-window "/tmp/geeqie-archive/$full_path"
+ else
+ zenity --title="Geeqie Open Archive" --info --width=300 --text="Utility tar is not installed"
+ fi
+ ;;
+
+ cbr | rar)
+ if [ $(which unrar > /dev/null; echo $? ) = 0 ]
+ then
+ rm --recursive --force rf "/tmp/geeqie-archive/$full_path"
+ mkdir --parents "/tmp/geeqie-archive/$full_path"
+ unrar "$full_path" "/tmp/geeqie-archive/$full_path" > /dev/null
+ geeqie --remote --new-window "/tmp/geeqie-archive/$full_path"
+ else
+ zenity --title="Geeqie Open Archive" --info --width=300 --text="Utility unrar is not installed"
+ fi
+ ;;
+
+ *)
+ zenity --title="Geeqie Open Archive" --info --width=300 --text="This is not a known archive file type"
+ ;;
+esac
+
--- /dev/null
+[Desktop Entry]
+Version=1.0
+Type=Application
+_Name=Open archive file
+
+# call the helper script
+Exec=geeqie-open-archive %f
+
+# Desktop files that are usable only in Geeqie should be marked like this:
+Categories=X-Geeqie;
+OnlyShowIn=X-Geeqie;
+
+# It can be made verbose
+# X-Geeqie-Verbose=true
+
+Icon=package-x-generic
#endif
filter_add_if_missing("psd", "Adobe Photoshop Document", ".psd", FORMAT_CLASS_IMAGE, FALSE, FALSE, TRUE);
filter_add_if_missing("apng", "Animated Portable Network Graphic", ".apng", FORMAT_CLASS_IMAGE, FALSE, FALSE, TRUE);
+ filter_add_if_missing("zip", "Archive files", ".zip;.rar;.cbr;tar.gz", FORMAT_CLASS_ARCHIVE, FALSE, FALSE, TRUE);
}
GList *filter_to_list(const gchar *extensions)
if (filter_file_class(name, FORMAT_CLASS_VIDEO)) return FORMAT_CLASS_VIDEO;
if (filter_file_class(name, FORMAT_CLASS_COLLECTION)) return FORMAT_CLASS_COLLECTION;
if (filter_file_class(name, FORMAT_CLASS_DOCUMENT)) return FORMAT_CLASS_DOCUMENT;
+ if (filter_file_class(name, FORMAT_CLASS_ARCHIVE)) return FORMAT_CLASS_ARCHIVE;
return FORMAT_CLASS_UNKNOWN;
}
geeqie_logo.png \
scroller.png \
sheet_broken.png \
+ archive_file.png \
sheet_metadata.png \
sheet_unknown.png \
sheet_video.png \
icon_thumb $(srcdir)/icon_thumb.png \
icon_scroller $(srcdir)/scroller.png \
icon_broken $(srcdir)/sheet_broken.png \
+ icon_archive $(srcdir)/archive_file.png \
icon_metadata $(srcdir)/sheet_metadata.png \
icon_unknown $(srcdir)/sheet_unknown.png \
icon_video $(srcdir)/sheet_video.png \
case FORMAT_CLASS_DOCUMENT:
pixbuf = pixbuf_inline(PIXBUF_INLINE_ICON_PDF);
break;
+ case FORMAT_CLASS_ARCHIVE:
+ pixbuf = pixbuf_inline(PIXBUF_INLINE_ARCHIVE);
+ break;
default:
pixbuf = pixbuf_inline(PIXBUF_INLINE_BROKEN);
}
{ PIXBUF_INLINE_COLLECTION, icon_collection },
{ PIXBUF_INLINE_ICON, gqview_icon },
{ PIXBUF_INLINE_LOGO, geeqie_logo },
+ { PIXBUF_INLINE_ARCHIVE, icon_archive },
{ PIXBUF_INLINE_ICON_FLOAT, icon_float },
{ PIXBUF_INLINE_ICON_THUMB, icon_thumb },
{ PIXBUF_INLINE_ICON_BOOK, icon_book },
case FORMAT_CLASS_DOCUMENT:
pixbuf = pixbuf_inline(PIXBUF_INLINE_ICON_PDF);
break;
+ case FORMAT_CLASS_ARCHIVE:
+ pixbuf = pixbuf_inline(PIXBUF_INLINE_ARCHIVE);
+ break;
default:
pixbuf = pixbuf_inline(PIXBUF_INLINE_BROKEN);
}
#define PIXBUF_INLINE_COLLECTION "collection"
#define PIXBUF_INLINE_ICON "icon"
#define PIXBUF_INLINE_LOGO "logo"
+#define PIXBUF_INLINE_ARCHIVE "archive"
#define PIXBUF_INLINE_ICON_FLOAT "icon_float"
#define PIXBUF_INLINE_ICON_THUMB "icon_thumb"
N_("Metadata"),
N_("Video"),
N_("Collection"),
- N_("Document")
+ N_("Document"),
+ N_("Archive")
};
/* config memory values */
case FORMAT_CLASS_DOCUMENT:
out_string = g_string_append(out_string, " Class: Document");
break;
+ case FORMAT_CLASS_ARCHIVE:
+ out_string = g_string_append(out_string, " Class: Archive");
+ break;
case FORMAT_CLASS_UNKNOWN:
out_string = g_string_append(out_string, " Class: Unknown");
break;
FORMAT_CLASS_VIDEO,
FORMAT_CLASS_COLLECTION,
FORMAT_CLASS_DOCUMENT,
+ FORMAT_CLASS_ARCHIVE,
FILE_FORMAT_CLASSES
} FileFormatClass;