[Xfce4-commits] r26503 - in xarchiver/trunk: . src

Giuseppe Torelli colossus at xfce.org
Mon Dec 24 16:26:15 CET 2007


Author: colossus
Date: 2007-12-24 15:26:15 +0000 (Mon, 24 Dec 2007)
New Revision: 26503

Modified:
   xarchiver/trunk/INSTALL
   xarchiver/trunk/depcomp
   xarchiver/trunk/install-sh
   xarchiver/trunk/missing
   xarchiver/trunk/src/bzip2.c
   xarchiver/trunk/src/extract_dialog.c
   xarchiver/trunk/src/interface.c
   xarchiver/trunk/src/interface.h
   xarchiver/trunk/src/lzma.c
   xarchiver/trunk/src/window.c
   xarchiver/trunk/src/window.h
Log:
Viewing the HMTL help works again.
Passed the XArchive structure to some glib callbacks in xa_add_page.
Added a popupmenu when clicking right mouse button on an entry.
Xarchiver shows lzma compressed files instead of asking where to extract them.


Modified: xarchiver/trunk/INSTALL
===================================================================
--- xarchiver/trunk/INSTALL	2007-12-23 16:50:23 UTC (rev 26502)
+++ xarchiver/trunk/INSTALL	2007-12-24 15:26:15 UTC (rev 26503)
@@ -1,8 +1,8 @@
 Installation Instructions
 *************************
 
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006 Free Software Foundation, Inc.
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free
+Software Foundation, Inc.
 
 This file is free documentation; the Free Software Foundation gives
 unlimited permission to copy, distribute and modify it.
@@ -10,10 +10,7 @@
 Basic Installation
 ==================
 
-Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package.  The following
-more-detailed instructions are generic; see the `README' file for
-instructions specific to this package.
+These are generic installation instructions.
 
    The `configure' shell script attempts to guess correct values for
 various system-dependent variables used during compilation.  It uses
@@ -26,9 +23,9 @@
 
    It can also use an optional file (typically called `config.cache'
 and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring.  Caching is
+the results of its tests to speed up reconfiguring.  (Caching is
 disabled by default to prevent problems with accidental use of stale
-cache files.
+cache files.)
 
    If you need to do unusual things to compile the package, please try
 to figure out how `configure' could check whether to do them, and mail
@@ -38,17 +35,20 @@
 may remove or edit it.
 
    The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'.  You need `configure.ac' if
-you want to change it or regenerate `configure' using a newer version
-of `autoconf'.
+`configure' by a program called `autoconf'.  You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
 
 The simplest way to compile this package is:
 
   1. `cd' to the directory containing the package's source code and type
-     `./configure' to configure the package for your system.
+     `./configure' to configure the package for your system.  If you're
+     using `csh' on an old version of System V, you might need to type
+     `sh ./configure' instead to prevent `csh' from trying to execute
+     `configure' itself.
 
-     Running `configure' might take a while.  While running, it prints
-     some messages telling which features it is checking for.
+     Running `configure' takes awhile.  While running, it prints some
+     messages telling which features it is checking for.
 
   2. Type `make' to compile the package.
 
@@ -78,7 +78,7 @@
 by setting variables in the command line or in the environment.  Here
 is an example:
 
-     ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
 
    *Note Defining Variables::, for more details.
 
@@ -87,15 +87,17 @@
 
 You can compile the package for more than one kind of computer at the
 same time, by placing the object files for each architecture in their
-own directory.  To do this, you can use GNU `make'.  `cd' to the
+own directory.  To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
 directory where you want the object files and executables to go and run
 the `configure' script.  `configure' automatically checks for the
 source code in the directory that `configure' is in and in `..'.
 
-   With a non-GNU `make', it is safer to compile the package for one
-architecture at a time in the source code directory.  After you have
-installed the package for one architecture, use `make distclean' before
-reconfiguring for another architecture.
+   If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory.  After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
 
 Installation Names
 ==================
@@ -188,12 +190,12 @@
      ./configure CC=/usr/local2/bin/gcc
 
 causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script).
+overridden in the site shell script).  Here is a another example:
 
-Unfortunately, this technique does not work for `CONFIG_SHELL' due to
-an Autoconf bug.  Until the bug is fixed you can use this workaround:
+     /bin/bash ./configure CONFIG_SHELL=/bin/bash
 
-     CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
+Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
+configuration-related scripts to be executed by `/bin/bash'.
 
 `configure' Invocation
 ======================

Modified: xarchiver/trunk/depcomp
===================================================================
--- xarchiver/trunk/depcomp	2007-12-23 16:50:23 UTC (rev 26502)
+++ xarchiver/trunk/depcomp	2007-12-24 15:26:15 UTC (rev 26503)
@@ -1,10 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2006-10-15.18
+scriptversion=2005-07-09.11
 
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
-# Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -92,20 +91,7 @@
 ## gcc 3 implements dependency tracking that does exactly what
 ## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
 ## it if -MD -MP comes after the -MF stuff.  Hmm.
-## Unfortunately, FreeBSD c89 acceptance of flags depends upon
-## the command line argument order; so add the flags where they
-## appear in depend2.am.  Note that the slowdown incurred here
-## affects only configure: in makefiles, %FASTDEP% shortcuts this.
-  for arg
-  do
-    case $arg in
-    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
-    *)  set fnord "$@" "$arg" ;;
-    esac
-    shift # fnord
-    shift # $arg
-  done
-  "$@"
+  "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
   stat=$?
   if test $stat -eq 0; then :
   else
@@ -290,46 +276,6 @@
   rm -f "$tmpdepfile"
   ;;
 
-hp2)
-  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
-  # compilers, which have integrated preprocessors.  The correct option
-  # to use with these is +Maked; it writes dependencies to a file named
-  # 'foo.d', which lands next to the object file, wherever that
-  # happens to be.
-  # Much of this is similar to the tru64 case; see comments there.
-  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$object" && dir=
-  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
-  if test "$libtool" = yes; then
-    tmpdepfile1=$dir$base.d
-    tmpdepfile2=$dir.libs/$base.d
-    "$@" -Wc,+Maked
-  else
-    tmpdepfile1=$dir$base.d
-    tmpdepfile2=$dir$base.d
-    "$@" +Maked
-  fi
-  stat=$?
-  if test $stat -eq 0; then :
-  else
-     rm -f "$tmpdepfile1" "$tmpdepfile2"
-     exit $stat
-  fi
-
-  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
-  do
-    test -f "$tmpdepfile" && break
-  done
-  if test -f "$tmpdepfile"; then
-    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
-    # Add `dependent.h:' lines.
-    sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
-  else
-    echo "#dummy" > "$depfile"
-  fi
-  rm -f "$tmpdepfile" "$tmpdepfile2"
-  ;;
-
 tru64)
    # The Tru64 compiler uses -MD to generate dependencies as a side
    # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
@@ -342,13 +288,13 @@
 
    if test "$libtool" = yes; then
       # With Tru64 cc, shared objects can also be used to make a
-      # static library.  This mechanism is used in libtool 1.4 series to
+      # static library.  This mecanism is used in libtool 1.4 series to
       # handle both shared and static libraries in a single compilation.
       # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
       #
       # With libtool 1.5 this exception was removed, and libtool now
       # generates 2 separate objects for the 2 libraries.  These two
-      # compilations output dependencies in $dir.libs/$base.o.d and
+      # compilations output dependencies in in $dir.libs/$base.o.d and
       # in $dir$base.o.d.  We have to check for both files, because
       # one of the two compilations can be disabled.  We should prefer
       # $dir$base.o.d over $dir.libs/$base.o.d because the latter is

Modified: xarchiver/trunk/install-sh
===================================================================
--- xarchiver/trunk/install-sh	2007-12-23 16:50:23 UTC (rev 26502)
+++ xarchiver/trunk/install-sh	2007-12-24 15:26:15 UTC (rev 26503)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2006-10-14.15
+scriptversion=2005-05-14.22
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -39,24 +39,15 @@
 # when there is no Makefile.
 #
 # This script is compatible with the BSD install script, but was written
-# from scratch.
+# from scratch.  It can only install one file at a time, a restriction
+# shared with many OS's install programs.
 
-nl='
-'
-IFS=" ""	$nl"
-
 # set DOITPROG to echo to test this script
 
 # Don't use :- since 4.3BSD and earlier shells don't like it.
 doit="${DOITPROG-}"
-if test -z "$doit"; then
-  doit_exec=exec
-else
-  doit_exec=$doit
-fi
 
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
+# put in absolute paths if you don't have them in your path; or use env. vars.
 
 mvprog="${MVPROG-mv}"
 cpprog="${CPPROG-cp}"
@@ -67,13 +58,7 @@
 rmprog="${RMPROG-rm}"
 mkdirprog="${MKDIRPROG-mkdir}"
 
-posix_glob=
-posix_mkdir=
-
-# Desired mode of installed file.
-mode=0755
-
-chmodcmd=$chmodprog
+chmodcmd="$chmodprog 0755"
 chowncmd=
 chgrpcmd=
 stripcmd=
@@ -110,7 +95,7 @@
   CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
 "
 
-while test $# -ne 0; do
+while test -n "$1"; do
   case $1 in
     -c) shift
         continue;;
@@ -126,15 +111,9 @@
 
     --help) echo "$usage"; exit $?;;
 
-    -m) mode=$2
+    -m) chmodcmd="$chmodprog $2"
         shift
         shift
-	case $mode in
-	  *' '* | *'	'* | *'
-'*	  | *'*'* | *'?'* | *'['*)
-	    echo "$0: invalid mode: $mode" >&2
-	    exit 1;;
-	esac
         continue;;
 
     -o) chowncmd="$chownprog $2"
@@ -157,33 +136,25 @@
 
     --version) echo "$0 $scriptversion"; exit $?;;
 
-    --)	shift
+    *)  # When -d is used, all remaining arguments are directories to create.
+	# When -t is used, the destination is already specified.
+	test -n "$dir_arg$dstarg" && break
+        # Otherwise, the last argument is the destination.  Remove it from $@.
+	for arg
+	do
+          if test -n "$dstarg"; then
+	    # $@ is not empty: it contains at least $arg.
+	    set fnord "$@" "$dstarg"
+	    shift # fnord
+	  fi
+	  shift # arg
+	  dstarg=$arg
+	done
 	break;;
-
-    -*)	echo "$0: invalid option: $1" >&2
-	exit 1;;
-
-    *)  break;;
   esac
 done
 
-if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
-  # When -d is used, all remaining arguments are directories to create.
-  # When -t is used, the destination is already specified.
-  # Otherwise, the last argument is the destination.  Remove it from $@.
-  for arg
-  do
-    if test -n "$dstarg"; then
-      # $@ is not empty: it contains at least $arg.
-      set fnord "$@" "$dstarg"
-      shift # fnord
-    fi
-    shift # arg
-    dstarg=$arg
-  done
-fi
-
-if test $# -eq 0; then
+if test -z "$1"; then
   if test -z "$dir_arg"; then
     echo "$0: no input file specified." >&2
     exit 1
@@ -193,33 +164,6 @@
   exit 0
 fi
 
-if test -z "$dir_arg"; then
-  trap '(exit $?); exit' 1 2 13 15
-
-  # Set umask so as not to create temps with too-generous modes.
-  # However, 'strip' requires both read and write access to temps.
-  case $mode in
-    # Optimize common cases.
-    *644) cp_umask=133;;
-    *755) cp_umask=22;;
-
-    *[0-7])
-      if test -z "$stripcmd"; then
-	u_plus_rw=
-      else
-	u_plus_rw='% 200'
-      fi
-      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
-    *)
-      if test -z "$stripcmd"; then
-	u_plus_rw=
-      else
-	u_plus_rw=,u+rw
-      fi
-      cp_umask=$mode$u_plus_rw;;
-  esac
-fi
-
 for src
 do
   # Protect names starting with `-'.
@@ -229,11 +173,15 @@
 
   if test -n "$dir_arg"; then
     dst=$src
-    dstdir=$dst
-    test -d "$dstdir"
-    dstdir_status=$?
-  else
+    src=
 
+    if test -d "$dst"; then
+      mkdircmd=:
+      chmodcmd=
+    else
+      mkdircmd=$mkdirprog
+    fi
+  else
     # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
     # might cause directories to be created, which would be especially bad
     # if $src (and thus $dsttmp) contains '*'.
@@ -260,188 +208,53 @@
 	echo "$0: $dstarg: Is a directory" >&2
 	exit 1
       fi
-      dstdir=$dst
-      dst=$dstdir/`basename "$src"`
-      dstdir_status=0
-    else
-      # Prefer dirname, but fall back on a substitute if dirname fails.
-      dstdir=`
-	(dirname "$dst") 2>/dev/null ||
-	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	     X"$dst" : 'X\(//\)[^/]' \| \
-	     X"$dst" : 'X\(//\)$' \| \
-	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
-	echo X"$dst" |
-	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)[^/].*/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\).*/{
-		   s//\1/
-		   q
-		 }
-		 s/.*/./; q'
-      `
-
-      test -d "$dstdir"
-      dstdir_status=$?
+      dst=$dst/`basename "$src"`
     fi
   fi
 
-  obsolete_mkdir_used=false
+  # This sed command emulates the dirname command.
+  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
 
-  if test $dstdir_status != 0; then
-    case $posix_mkdir in
-      '')
-	# Create intermediate dirs using mode 755 as modified by the umask.
-	# This is like FreeBSD 'install' as of 1997-10-28.
-	umask=`umask`
-	case $stripcmd.$umask in
-	  # Optimize common cases.
-	  *[2367][2367]) mkdir_umask=$umask;;
-	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+  # Make sure that the destination directory exists.
 
-	  *[0-7])
-	    mkdir_umask=`expr $umask + 22 \
-	      - $umask % 100 % 40 + $umask % 20 \
-	      - $umask % 10 % 4 + $umask % 2
-	    `;;
-	  *) mkdir_umask=$umask,go-w;;
-	esac
+  # Skip lots of stat calls in the usual case.
+  if test ! -d "$dstdir"; then
+    defaultIFS='
+	 '
+    IFS="${IFS-$defaultIFS}"
 
-	# With -d, create the new directory with the user-specified mode.
-	# Otherwise, rely on $mkdir_umask.
-	if test -n "$dir_arg"; then
-	  mkdir_mode=-m$mode
-	else
-	  mkdir_mode=
-	fi
+    oIFS=$IFS
+    # Some sh's can't handle IFS=/ for some reason.
+    IFS='%'
+    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+    shift
+    IFS=$oIFS
 
-	posix_mkdir=false
-	case $umask in
-	  *[123567][0-7][0-7])
-	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
-	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
-	    ;;
-	  *)
-	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+    pathcomp=
 
-	    if (umask $mkdir_umask &&
-		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-	    then
-	      if test -z "$dir_arg" || {
-		   # Check for POSIX incompatibilities with -m.
-		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-		   # other-writeable bit of parent directory when it shouldn't.
-		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
-		   case $ls_ld_tmpdir in
-		     d????-?r-*) different_mode=700;;
-		     d????-?--*) different_mode=755;;
-		     *) false;;
-		   esac &&
-		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
-		   }
-		 }
-	      then posix_mkdir=:
-	      fi
-	      rmdir "$tmpdir/d" "$tmpdir"
-	    else
-	      # Remove any dirs left behind by ancient mkdir implementations.
-	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-	    fi
-	    trap '' 0;;
-	esac;;
-    esac
-
-    if
-      $posix_mkdir && (
-	umask $mkdir_umask &&
-	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
-      )
-    then :
-    else
-
-      # The umask is ridiculous, or mkdir does not conform to POSIX,
-      # or it failed possibly due to a race condition.  Create the
-      # directory the slow way, step by step, checking for races as we go.
-
-      case $dstdir in
-	/*) prefix=/ ;;
-	-*) prefix=./ ;;
-	*)  prefix= ;;
-      esac
-
-      case $posix_glob in
-        '')
-	  if (set -f) 2>/dev/null; then
-	    posix_glob=true
-	  else
-	    posix_glob=false
-	  fi ;;
-      esac
-
-      oIFS=$IFS
-      IFS=/
-      $posix_glob && set -f
-      set fnord $dstdir
+    while test $# -ne 0 ; do
+      pathcomp=$pathcomp$1
       shift
-      $posix_glob && set +f
-      IFS=$oIFS
-
-      prefixes=
-
-      for d
-      do
-	test -z "$d" && continue
-
-	prefix=$prefix$d
-	if test -d "$prefix"; then
-	  prefixes=
-	else
-	  if $posix_mkdir; then
-	    (umask=$mkdir_umask &&
-	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
-	    # Don't fail if two instances are running concurrently.
-	    test -d "$prefix" || exit 1
-	  else
-	    case $prefix in
-	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
-	      *) qprefix=$prefix;;
-	    esac
-	    prefixes="$prefixes '$qprefix'"
-	  fi
-	fi
-	prefix=$prefix/
-      done
-
-      if test -n "$prefixes"; then
-	# Don't fail if two instances are running concurrently.
-	(umask $mkdir_umask &&
-	 eval "\$doit_exec \$mkdirprog $prefixes") ||
-	  test -d "$dstdir" || exit 1
-	obsolete_mkdir_used=true
+      if test ! -d "$pathcomp"; then
+        $mkdirprog "$pathcomp"
+	# mkdir can fail with a `File exist' error in case several
+	# install-sh are creating the directory concurrently.  This
+	# is OK.
+	test -d "$pathcomp" || exit
       fi
-    fi
+      pathcomp=$pathcomp/
+    done
   fi
 
   if test -n "$dir_arg"; then
-    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
-    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
-    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
-      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+    $doit $mkdircmd "$dst" \
+      && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+      && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+      && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+      && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
   else
+    dstfile=`basename "$dst"`
 
     # Make a couple of temp file names in the proper directory.
     dsttmp=$dstdir/_inst.$$_
@@ -449,9 +262,10 @@
 
     # Trap to clean up those temp files at exit.
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+    trap '(exit $?); exit' 1 2 13 15
 
     # Copy the file name to the temp name.
-    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+    $doit $cpprog "$src" "$dsttmp" &&
 
     # and set any options; do chmod last to preserve setuid bits.
     #
@@ -462,10 +276,10 @@
     { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
       && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
       && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
-      && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
 
     # Now rename the file to the real destination.
-    { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
+    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
       || {
 	   # The rename failed, perhaps because mv can't rename something else
 	   # to itself, or perhaps because mv is so ancient that it does not
@@ -477,12 +291,11 @@
 	   # reasons.  In this case, the final cleanup might fail but the new
 	   # file should still install successfully.
 	   {
-	     if test -f "$dst"; then
-	       $doit $rmcmd -f "$dst" 2>/dev/null \
-	       || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
-		     && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
+	     if test -f "$dstdir/$dstfile"; then
+	       $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+	       || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
 	       || {
-		 echo "$0: cannot unlink or rename $dst" >&2
+		 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
 		 (exit 1); exit 1
 	       }
 	     else
@@ -491,14 +304,17 @@
 	   } &&
 
 	   # Now rename the file to the real destination.
-	   $doit $mvcmd "$dsttmp" "$dst"
+	   $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
 	 }
-    } || exit 1
-
-    trap '' 0
-  fi
+    }
+  fi || { (exit 1); exit 1; }
 done
 
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+  (exit 0); exit 0
+}
+
 # Local variables:
 # eval: (add-hook 'write-file-hooks 'time-stamp)
 # time-stamp-start: "scriptversion="

Modified: xarchiver/trunk/missing
===================================================================
--- xarchiver/trunk/missing	2007-12-23 16:50:23 UTC (rev 26502)
+++ xarchiver/trunk/missing	2007-12-24 15:26:15 UTC (rev 26503)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Common stub for a few missing GNU programs while installing.
 
-scriptversion=2006-05-10.23
+scriptversion=2005-06-08.21
 
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
 #   Free Software Foundation, Inc.
 # Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
 
@@ -33,8 +33,6 @@
 fi
 
 run=:
-sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
-sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
 
 # In the cases where this matters, `missing' is being run in the
 # srcdir already.
@@ -46,7 +44,7 @@
 
 msg="missing on your system"
 
-case $1 in
+case "$1" in
 --run)
   # Try to run requested program, and just exit if it succeeds.
   run=
@@ -79,7 +77,6 @@
   aclocal      touch file \`aclocal.m4'
   autoconf     touch file \`configure'
   autoheader   touch file \`config.h.in'
-  autom4te     touch the output file, or create a stub one
   automake     touch all \`Makefile.in' files
   bison        create \`y.tab.[ch]', if possible, from existing .[ch]
   flex         create \`lex.yy.c', if possible, from existing .c
@@ -109,7 +106,7 @@
 # Now exit if we have it, but it failed.  Also exit now if we
 # don't have it and --version was passed (most likely to detect
 # the program).
-case $1 in
+case "$1" in
   lex|yacc)
     # Not GNU programs, they don't have --version.
     ;;
@@ -138,7 +135,7 @@
 
 # If it does not exist, or fails to run (possibly an outdated version),
 # try to emulate it.
-case $1 in
+case "$1" in
   aclocal*)
     echo 1>&2 "\
 WARNING: \`$1' is $msg.  You should only need it if
@@ -167,7 +164,7 @@
     test -z "$files" && files="config.h"
     touch_files=
     for f in $files; do
-      case $f in
+      case "$f" in
       *:*) touch_files="$touch_files "`echo "$f" |
 				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
       *) touch_files="$touch_files $f.in";;
@@ -195,8 +192,8 @@
          You can get \`$1' as part of \`Autoconf' from any GNU
          archive site."
 
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+    test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
     if test -f "$file"; then
 	touch $file
     else
@@ -217,25 +214,25 @@
          in order for those modifications to take effect.  You can get
          \`Bison' from any GNU archive site."
     rm -f y.tab.c y.tab.h
-    if test $# -ne 1; then
+    if [ $# -ne 1 ]; then
         eval LASTARG="\${$#}"
-	case $LASTARG in
+	case "$LASTARG" in
 	*.y)
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
-	    if test -f "$SRCFILE"; then
+	    if [ -f "$SRCFILE" ]; then
 	         cp "$SRCFILE" y.tab.c
 	    fi
 	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
-	    if test -f "$SRCFILE"; then
+	    if [ -f "$SRCFILE" ]; then
 	         cp "$SRCFILE" y.tab.h
 	    fi
 	  ;;
 	esac
     fi
-    if test ! -f y.tab.h; then
+    if [ ! -f y.tab.h ]; then
 	echo >y.tab.h
     fi
-    if test ! -f y.tab.c; then
+    if [ ! -f y.tab.c ]; then
 	echo 'main() { return 0; }' >y.tab.c
     fi
     ;;
@@ -247,18 +244,18 @@
          in order for those modifications to take effect.  You can get
          \`Flex' from any GNU archive site."
     rm -f lex.yy.c
-    if test $# -ne 1; then
+    if [ $# -ne 1 ]; then
         eval LASTARG="\${$#}"
-	case $LASTARG in
+	case "$LASTARG" in
 	*.l)
 	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
-	    if test -f "$SRCFILE"; then
+	    if [ -f "$SRCFILE" ]; then
 	         cp "$SRCFILE" lex.yy.c
 	    fi
 	  ;;
 	esac
     fi
-    if test ! -f lex.yy.c; then
+    if [ ! -f lex.yy.c ]; then
 	echo 'main() { return 0; }' >lex.yy.c
     fi
     ;;
@@ -270,9 +267,11 @@
 	 \`Help2man' package in order for those modifications to take
 	 effect.  You can get \`Help2man' from any GNU archive site."
 
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
-    if test -f "$file"; then
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+    if test -z "$file"; then
+	file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+    fi
+    if [ -f "$file" ]; then
 	touch $file
     else
 	test -z "$file" || exec >$file
@@ -290,17 +289,11 @@
          DU, IRIX).  You might want to install the \`Texinfo' package or
          the \`GNU make' package.  Grab either from any GNU archive site."
     # The file to touch is that specified with -o ...
-    file=`echo "$*" | sed -n "$sed_output"`
-    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
     if test -z "$file"; then
       # ... or it is the one specified with @setfilename ...
       infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
-      file=`sed -n '
-	/^@setfilename/{
-	  s/.* \([^ ]*\) *$/\1/
-	  p
-	  q
-	}' $infile`
+      file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
       # ... or it is derived from the source name (dir/f.texi becomes f.info)
       test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
     fi
@@ -324,13 +317,13 @@
     fi
     firstarg="$1"
     if shift; then
-	case $firstarg in
+	case "$firstarg" in
 	*o*)
 	    firstarg=`echo "$firstarg" | sed s/o//`
 	    tar "$firstarg" "$@" && exit 0
 	    ;;
 	esac
-	case $firstarg in
+	case "$firstarg" in
 	*h*)
 	    firstarg=`echo "$firstarg" | sed s/h//`
 	    tar "$firstarg" "$@" && exit 0

Modified: xarchiver/trunk/src/bzip2.c
===================================================================
--- xarchiver/trunk/src/bzip2.c	2007-12-23 16:50:23 UTC (rev 26502)
+++ xarchiver/trunk/src/bzip2.c	2007-12-24 15:26:15 UTC (rev 26503)
@@ -25,7 +25,7 @@
 
 void xa_open_bzip2 (XArchive *archive)
 {
-	XEntry *entry;
+	XEntry *entry = NULL;
 	struct stat my_stat;
 	gchar tmp_dir[14] = "";
 	gchar *compressed = NULL;

Modified: xarchiver/trunk/src/extract_dialog.c
===================================================================
--- xarchiver/trunk/src/extract_dialog.c	2007-12-23 16:50:23 UTC (rev 26502)
+++ xarchiver/trunk/src/extract_dialog.c	2007-12-24 15:26:15 UTC (rev 26503)
@@ -773,7 +773,7 @@
 	return command;
 }
 
-gboolean xa_extract_tar_without_directories (gchar *string, XArchive *archive, gchar *extract_path,gboolean cpio_flag)
+gboolean xa_extract_tar_without_directories (gchar *string,XArchive *archive,gchar *extract_path,gboolean cpio_flag)
 {
 	gchar *command = NULL;
 	gchar *name = NULL;
@@ -835,16 +835,16 @@
 	if (cpio_flag)
 	{
 		chdir (archive->tmp);
-		command = g_strconcat ( "cpio --make-directories -F " , archive->tmp , " -i" , NULL );
+		command = g_strconcat ("cpio --make-directories -F ",archive->tmp," -i",NULL);
 	}
 	else
-		command = g_strconcat ( string, archive->escaped_path,
+		command = g_strconcat (string, archive->escaped_path,
 										archive->overwrite ? " --overwrite" : " --keep-old-files",
 										archive->tar_touch ? " --touch" : "",
 										" --no-wildcards -C ",
 										archive->tmp,names->str,NULL);
 	result = xa_run_command (archive,command);
-	g_string_free (names, TRUE);
+	g_string_free (names,TRUE);
 	g_free (command);
 
 	if (result == 0 || stop_flag)
@@ -856,8 +856,8 @@
 	}
 	while (filenames)
 	{
-		gchar *unescaped = xa_escape_bad_chars ( (gchar*)filenames->data , "$\'`\"\\!?* ()&|@#:;");
-		g_string_prepend ( unescaped_names, unescaped );
+		gchar *unescaped = xa_escape_bad_chars((gchar*)filenames->data,"$\'`\"\\!?* ()&|@#:;");
+		g_string_prepend (unescaped_names,unescaped);
 		g_string_prepend_c (unescaped_names, ' ');
 		g_free (unescaped);
 		filenames = filenames->next;
@@ -867,7 +867,7 @@
 		extract_path = archive->tmp;
 
 	chdir (archive->tmp);
-	command = g_strconcat ( "mv -f ", unescaped_names->str, " " , extract_path , NULL );
+	command = g_strconcat ("mv -f ",unescaped_names->str," ",extract_path,NULL);
 
 	result = xa_run_command (archive,command);
 	g_free (command);

Modified: xarchiver/trunk/src/interface.c
===================================================================
--- xarchiver/trunk/src/interface.c	2007-12-23 16:50:23 UTC (rev 26502)
+++ xarchiver/trunk/src/interface.c	2007-12-24 15:26:15 UTC (rev 26503)
@@ -51,6 +51,7 @@
 {
 	GdkPixbuf *icon;
 
+	xa_create_popup_menu();
 	tooltips = gtk_tooltips_new ();
 	accel_group = gtk_accel_group_new ();
 	xa_set_window_title (MainWindow , NULL);
@@ -389,13 +390,13 @@
 	notebook = GTK_NOTEBOOK(gtk_notebook_new() );
 	gtk_box_pack_start (GTK_BOX(vbox1), GTK_WIDGET(notebook),TRUE,TRUE,0);
 	gtk_notebook_set_tab_pos (notebook, GTK_POS_TOP);
-	gtk_notebook_set_scrollable (notebook, TRUE);
+	gtk_notebook_set_scrollable (notebook,TRUE);
 	gtk_notebook_popup_enable (notebook);
 	gtk_widget_show (GTK_WIDGET(notebook));
-	g_signal_connect ((gpointer) notebook, "switch-page", G_CALLBACK (xa_page_has_changed), NULL);
+	g_signal_connect ((gpointer) notebook, "switch-page",G_CALLBACK (xa_page_has_changed),NULL);
 
-	gtk_drag_dest_set (GTK_WIDGET(notebook),GTK_DEST_DEFAULT_ALL, drop_targets, 1, GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK |	GDK_ACTION_ASK);
-	g_signal_connect (G_OBJECT (notebook), "drag-data-received",	G_CALLBACK (on_drag_data_received), NULL);
+	gtk_drag_dest_set (GTK_WIDGET(notebook),GTK_DEST_DEFAULT_ALL,drop_targets,1,GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK);
+	g_signal_connect (G_OBJECT (notebook), "drag-data-received",G_CALLBACK (on_drag_data_received), NULL);
 
   	hbox_sb = gtk_hbox_new (FALSE, 0);
 	gtk_widget_show (hbox_sb);
@@ -574,24 +575,25 @@
 	gtk_widget_show_all (page_hbox);
 
 	gtk_misc_set_alignment(GTK_MISC(tab_label), 0.0, 0);
-	gtk_notebook_append_page_menu (notebook, archive->scrollwindow, page_hbox, tab_label);
+	gtk_notebook_append_page_menu (notebook, archive->scrollwindow,page_hbox,tab_label);
 	gtk_notebook_set_current_page(notebook, -1);
-	gtk_notebook_set_tab_reorderable(notebook, archive->scrollwindow, TRUE);
+	gtk_notebook_set_tab_reorderable(notebook, archive->scrollwindow,TRUE);
 	archive->treeview = gtk_tree_view_new ();
 	gtk_container_add (GTK_CONTAINER (archive->scrollwindow), archive->treeview);
 	gtk_widget_show (archive->treeview);
-	gtk_tree_view_set_rules_hint ( GTK_TREE_VIEW (archive->treeview) , TRUE );
-	gtk_tree_view_set_search_equal_func (GTK_TREE_VIEW (archive->treeview),(GtkTreeViewSearchEqualFunc) treeview_select_search, NULL, NULL);
-	GtkTreeSelection *sel = gtk_tree_view_get_selection( GTK_TREE_VIEW (archive->treeview) );
+	gtk_tree_view_set_rules_hint ( GTK_TREE_VIEW (archive->treeview),TRUE);
+	gtk_tree_view_set_search_equal_func (GTK_TREE_VIEW (archive->treeview),(GtkTreeViewSearchEqualFunc) treeview_select_search,NULL,NULL);
+	GtkTreeSelection *sel = gtk_tree_view_get_selection( GTK_TREE_VIEW (archive->treeview));
 	gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE);
 	gtk_tree_view_set_rubber_banding(GTK_TREE_VIEW(archive->treeview),TRUE);
 
 	gtk_drag_source_set (archive->treeview, GDK_BUTTON1_MASK, drag_targets, 1, GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK | GDK_ACTION_ASK);
-	g_signal_connect ((gpointer) sel, 				"changed", 		G_CALLBACK (xa_activate_delete_and_view), NULL);
-	g_signal_connect (G_OBJECT (archive->treeview), "drag-begin",	G_CALLBACK (drag_begin), NULL);
-	g_signal_connect (G_OBJECT (archive->treeview), "drag-data-get",G_CALLBACK (drag_data_get), NULL );
-	g_signal_connect (G_OBJECT (archive->treeview), "drag-end",		G_CALLBACK (drag_end), NULL);
-	g_signal_connect (G_OBJECT (archive->treeview), "row-activated",G_CALLBACK (xa_treeview_row_activated), NULL);
+	g_signal_connect ((gpointer) sel, 				"changed", 		G_CALLBACK (xa_activate_delete_and_view),archive);
+	g_signal_connect (G_OBJECT (archive->treeview), "drag_begin",	G_CALLBACK (drag_begin),archive);
+	g_signal_connect (G_OBJECT (archive->treeview), "drag_data_get",G_CALLBACK (drag_data_get),archive);
+	g_signal_connect (G_OBJECT (archive->treeview), "drag_end",		G_CALLBACK (drag_end),NULL);
+	g_signal_connect (G_OBJECT (archive->treeview), "row_activated",G_CALLBACK (xa_treeview_row_activated),archive);
+	g_signal_connect (G_OBJECT (archive->treeview), "button_press_event",G_CALLBACK (xa_mouse_button_event),archive);
 }
 
 void xa_close_page (GtkWidget *widget, gpointer data)
@@ -715,8 +717,101 @@
 	return data;
 }
 
-GtkWidget *create_archive_properties_window ()
+void xa_create_popup_menu()
 {
+	GtkWidget *cut;
+	GtkWidget *image6;
+	GtkWidget *copy;
+	GtkWidget *image7;
+	GtkWidget *paste;
+	GtkWidget *image8;
+	GtkWidget *separator;
+	GtkWidget *view;
+	GtkWidget *extract;
+	GtkWidget *image9;
+	GtkWidget *ddelete;
+	GtkWidget *image10;
+	GtkWidget *rename;
+	GtkWidget *image11;
+
+	xa_popup_menu = gtk_menu_new();
+
+	view = gtk_image_menu_item_new_with_mnemonic (_("View"));
+	gtk_widget_show (view);
+	gtk_container_add (GTK_CONTAINER (xa_popup_menu),view);
+
+	image9 = gtk_image_new_from_stock ("gtk-find", GTK_ICON_SIZE_MENU);
+	gtk_widget_show (image9);
+	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (view), image9);
+
+	extract = gtk_image_menu_item_new_with_mnemonic (_("Extract"));
+	gtk_widget_show (extract);
+	gtk_container_add (GTK_CONTAINER (xa_popup_menu),extract);
+	
+	image9 =  xa_main_window_find_image ("xarchiver-extract.png", GTK_ICON_SIZE_MENU);
+	gtk_widget_show (image9);
+	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (extract), image9);
+
+	separator = gtk_separator_menu_item_new ();
+	gtk_widget_show (separator);
+	gtk_container_add (GTK_CONTAINER (xa_popup_menu), separator);
+	gtk_widget_set_sensitive (separator,FALSE);
+	
+	cut = gtk_image_menu_item_new_with_mnemonic (_("Cut"));
+	gtk_widget_show (cut);
+	gtk_container_add (GTK_CONTAINER (xa_popup_menu), cut);
+
+	image6 = gtk_image_new_from_stock ("gtk-cut", GTK_ICON_SIZE_MENU);
+	gtk_widget_show (image6);
+	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (cut), image6);
+
+	copy = gtk_image_menu_item_new_with_mnemonic (_("Copy"));
+	gtk_widget_show (copy);
+	gtk_container_add (GTK_CONTAINER (xa_popup_menu), copy);
+
+	image7 = gtk_image_new_from_stock ("gtk-copy", GTK_ICON_SIZE_MENU);
+	gtk_widget_show (image7);
+	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (copy), image7);
+
+	paste = gtk_image_menu_item_new_with_mnemonic (_("Paste"));
+	gtk_widget_show (paste);
+	gtk_container_add (GTK_CONTAINER (xa_popup_menu), paste);
+
+	image8 = gtk_image_new_from_stock ("gtk-paste", GTK_ICON_SIZE_MENU);
+	gtk_widget_show (image8);
+	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (paste), image8);
+
+	separator = gtk_separator_menu_item_new();
+	gtk_widget_show (separator);
+	gtk_container_add (GTK_CONTAINER (xa_popup_menu), separator);
+	gtk_widget_set_sensitive (separator,FALSE);
+
+	ddelete = gtk_image_menu_item_new_with_mnemonic (_("Delete"));
+	gtk_widget_show (ddelete);
+	gtk_container_add (GTK_CONTAINER (xa_popup_menu), ddelete);
+
+	image10 = gtk_image_new_from_stock ("gtk-delete", GTK_ICON_SIZE_MENU);
+	gtk_widget_show (image10);
+	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (ddelete), image10);
+
+	rename = gtk_image_menu_item_new_with_mnemonic (_("Rename"));
+	gtk_widget_show (rename);
+	gtk_container_add (GTK_CONTAINER (xa_popup_menu), rename);
+
+	image11 = gtk_image_new_from_stock ("gtk-refresh", GTK_ICON_SIZE_MENU);
+	gtk_widget_show (image11);
+	gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (rename), image11);
+
+	/*g_signal_connect ((gpointer) cut, "activate",G_CALLBACK (on_xa_cut_activate),NULL);
+	g_signal_connect ((gpointer) copy, "activate",G_CALLBACK (on_xa_copy_activate),NULL);
+	g_signal_connect ((gpointer) paste, "activate",G_CALLBACK (on_xa_paste_activate),NULL);
+	g_signal_connect ((gpointer) open, "activate",G_CALLBACK (on_xa_open_activate),NULL);
+	g_signal_connect ((gpointer) ddelete, "activate",G_CALLBACK (on_xa_delete_activate),NULL);
+	g_signal_connect ((gpointer) rename, "activate",G_CALLBACK (on_xa_rename_activate),NULL);*/
+}
+
+GtkWidget *create_archive_properties_window()
+{
 	archive_properties_window = gtk_dialog_new_with_buttons (_("Archive Properties Window"),
 									GTK_WINDOW (MainWindow), GTK_DIALOG_DESTROY_WITH_PARENT,
 									GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL, NULL);

Modified: xarchiver/trunk/src/interface.h
===================================================================
--- xarchiver/trunk/src/interface.h	2007-12-23 16:50:23 UTC (rev 26502)
+++ xarchiver/trunk/src/interface.h	2007-12-24 15:26:15 UTC (rev 26503)
@@ -21,7 +21,7 @@
 #define __XARCHIVER_INTERFACE_H__
 
 #include "archive.h"
-
+GtkWidget *xa_popup_menu;
 GtkWidget *MainWindow;
 GtkWidget *vbox1;
 GtkNotebook *notebook;
@@ -119,12 +119,13 @@
 	GtkTextIter iter;
 } widget_data;
 
-gchar *password_dialog ();
+gchar *password_dialog();
 void set_label (GtkWidget *label,gchar *text);
 int xa_progressbar_pulse (gpointer data);
+void xa_create_popup_menu();
 widget_data *xa_create_output_window(gchar *);
 void xa_create_mainwindow (GtkWidget *MainWindow,gboolean show_location);
-GtkWidget *create_archive_properties_window (void);
+GtkWidget *create_archive_properties_window();
 void xa_handle_navigation_buttons (GtkMenuItem *menuitem, gpointer user_data);
 void xa_add_page (XArchive *archive);
 void xa_page_has_changed (GtkNotebook *notebook, GtkNotebookPage *page, guint page_num, gpointer user_data);

Modified: xarchiver/trunk/src/lzma.c
===================================================================
--- xarchiver/trunk/src/lzma.c	2007-12-23 16:50:23 UTC (rev 26502)
+++ xarchiver/trunk/src/lzma.c	2007-12-24 15:26:15 UTC (rev 26503)
@@ -27,9 +27,18 @@
 
 void xa_open_lzma (XArchive *archive)
 {
-	gchar *command;
+	XEntry *entry = NULL;
+	gchar *command = NULL;
 	unsigned short int i;
-
+	struct stat my_stat;
+	gboolean result;
+	gchar tmp_dir[14] = "";
+	gchar *compressed = NULL;
+	gchar *size = NULL;
+	gchar *filename = NULL;;
+	gchar *_filename;
+	gpointer item[2];
+	
 	if (g_str_has_suffix(archive->escaped_path , ".tar.lzma") || g_str_has_suffix (archive->escaped_path , ".tlz"))
 	{
     	gchar *tar;
@@ -65,10 +74,70 @@
 	}
 	else
 	{
-		extract_window = xa_create_extract_dialog (0,archive);
-		command = xa_parse_extract_dialog_options (archive,extract_window,NULL);
-		gtk_widget_destroy (extract_window->dialog1);
-		g_free (extract_window);
+		GSList *list = NULL;
+		archive->can_add = archive->has_test = archive->has_sfx = FALSE;
+		archive->has_properties = archive->can_extract = TRUE;
+		archive->nc = 3;
+		archive->nr_of_files = 1;
+		archive->nr_of_dirs = 0;
+		archive->format = "LZMA";
+
+		GType types[]= {GDK_TYPE_PIXBUF,G_TYPE_STRING,G_TYPE_UINT64,G_TYPE_UINT64,G_TYPE_POINTER};
+		archive->column_types = g_malloc0(sizeof(types));
+		for (i = 0; i < 5; i++)
+			archive->column_types[i] = types[i];
+
+		char *names[]= {(_("Compressed")),(_("Size"))};
+		xa_create_liststore (archive,names);
+		result = xa_create_temp_directory (archive,tmp_dir);
+		if (result == 0)
+			return;
+
+		/* Let's copy the lzma file in the tmp dir */
+		command = g_strconcat("cp -f ",archive->escaped_path," ",archive->tmp,NULL);
+		list = g_slist_append(list,command);
+		/* Let's get its compressed file size */
+		stat (archive->escaped_path,&my_stat);
+		compressed = g_strdup_printf("%lld",(unsigned long long int)my_stat.st_size);
+		item[0] = compressed;
+
+		/* Let's extract it */
+		chdir (archive->tmp);
+		_filename = g_strrstr (archive->escaped_path , "/");
+		if (_filename)
+			command = g_strconcat("lzma -f -d ",archive->tmp,_filename,NULL);
+		else
+			command = g_strconcat("lzma -f -d ",archive->tmp,"/",archive->escaped_path,NULL);
+
+		list = g_slist_append(list,command);
+		result = xa_run_command (archive,list);
+
+		/* and let's get its uncompressed file size */
+		if (_filename)
+		{
+			_filename++;
+			filename = g_strndup(_filename,strlen(_filename)-4);
+			command = g_strconcat(archive->tmp,"/",filename,NULL);
+		}
+		else
+		{
+			command = g_strconcat(archive->tmp,"/",archive->escaped_path,NULL);
+			filename = g_strdup(archive->escaped_path);
+		}
+		stat (command,&my_stat);
+		g_free(command);
+		size = g_strdup_printf("%lld",(unsigned long long int)my_stat.st_size);
+		archive->dummy_size = my_stat.st_size;
+		item[1] = size;
+
+		entry = xa_set_archive_entries_for_each_row (archive,filename,item);
+		g_free(compressed);
+		g_free(size);
+		g_free(filename);
+		
+		xa_update_window_with_archive_entries (archive,NULL);
+		gtk_tree_view_set_model (GTK_TREE_VIEW(archive->treeview), archive->model);
+		g_object_unref (archive->model);
 	}
 }
 

Modified: xarchiver/trunk/src/window.c
===================================================================
--- xarchiver/trunk/src/window.c	2007-12-23 16:50:23 UTC (rev 26502)
+++ xarchiver/trunk/src/window.c	2007-12-24 15:26:15 UTC (rev 26503)
@@ -1409,14 +1409,16 @@
 	xa_shell_quote_filename(full_pathname,names,archive[idx]);
 	g_free(full_pathname);
 
+	result = xa_create_temp_directory(archive[idx],tmp_dir);
+	if (result == FALSE)
+		return;
+
 	full_path = archive[idx]->full_path;
 	overwrite = archive[idx]->overwrite;
 
 	archive[idx]->full_path = 0;
 	archive[idx]->overwrite = 1;
-
-	result = xa_create_temp_directory(archive[idx],tmp_dir);
-
+	
 	command = xa_extract_single_files(archive[idx],names,archive[idx]->tmp);
 	g_string_free (names,TRUE);
 
@@ -1559,36 +1561,33 @@
     gtk_widget_show_all ( archive_properties_win );
 }
 
-void xa_activate_delete_and_view ()
+void xa_activate_delete_and_view (GtkTreeSelection *treeselection,gpointer data)
 {
-	gint current_page;
-	gint idx;
+	XArchive *archive = data;
+	GtkTreeSelection *selection;
 
 	if ( ! GTK_WIDGET_VISIBLE (Extract_button) )
 		return;
 
-	current_page = gtk_notebook_get_current_page (notebook);
-	idx = xa_find_archive_index (current_page);
-
-	GtkTreeSelection *selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW (archive[idx]->treeview) );
-	gint selected = gtk_tree_selection_count_selected_rows ( selection );
+	selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW (archive->treeview));
+	gint selected = gtk_tree_selection_count_selected_rows (selection);
 	if (selected == 0 )
 		xa_disable_delete_view_buttons (FALSE);
 	else
 	{
-		if (archive[idx]->type == XARCHIVETYPE_RAR && unrar)
-			gtk_widget_set_sensitive ( delete_menu , FALSE );
-		else if ( archive[idx]->type != XARCHIVETYPE_RPM && archive[idx]->type != XARCHIVETYPE_DEB )
-			gtk_widget_set_sensitive ( delete_menu , TRUE );
+		if (archive->type == XARCHIVETYPE_RAR && unrar)
+			gtk_widget_set_sensitive ( delete_menu,FALSE);
+		else if ( archive->type != XARCHIVETYPE_RPM && archive->type != XARCHIVETYPE_DEB)
+			gtk_widget_set_sensitive (delete_menu,TRUE);
 		if (selected > 1 )
 		{
-			gtk_widget_set_sensitive ( View_button , FALSE);
-			gtk_widget_set_sensitive ( view_menu, FALSE );
+			gtk_widget_set_sensitive (View_button,FALSE);
+			gtk_widget_set_sensitive (view_menu,FALSE );
 		}
 		else
 		{
-			gtk_widget_set_sensitive ( View_button , TRUE );
-			gtk_widget_set_sensitive ( view_menu, TRUE );
+			gtk_widget_set_sensitive (View_button,TRUE);
+			gtk_widget_set_sensitive (view_menu,TRUE);
 		}
 	}
 }
@@ -1665,32 +1664,30 @@
 void xa_disable_delete_view_buttons (gboolean value)
 {
     gtk_widget_set_sensitive (delete_menu,value);
+    //TODO: disable the popupmenu entries
+    //gtk_widget_set_sensitive (ddelete,value);
     gtk_widget_set_sensitive (View_button,value);
     gtk_widget_set_sensitive (view_menu,value);
 }
 
 void drag_begin (GtkWidget *treeview1,GdkDragContext *context, gpointer data)
 {
+	XArchive *archive = data;
     GtkTreeSelection *selection;
     GtkTreeIter       iter;
     gchar            *name;
     GList            *row_list;
-	gint current_page;
-	gint idx;
 	XEntry *entry;
 	
 	//gtk_drag_source_set_icon_name (treeview1, DATADIR "/pixmaps/xarchiver.png" );
-	current_page = gtk_notebook_get_current_page(notebook);
-	idx = xa_find_archive_index (current_page);
+    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (archive->treeview));
 
-    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (archive[idx]->treeview));
-
 	row_list = gtk_tree_selection_get_selected_rows (selection, NULL);
 	if ( row_list == NULL)
 		return;
 
-	gtk_tree_model_get_iter(archive[idx]->model,&iter,(GtkTreePath*) (row_list->data));
-	gtk_tree_model_get (GTK_TREE_MODEL (archive[idx]->liststore),&iter,archive[idx]->nc+1,&entry, -1);
+	gtk_tree_model_get_iter(archive->model,&iter,(GtkTreePath*) (row_list->data));
+	gtk_tree_model_get (GTK_TREE_MODEL (archive->liststore),&iter,archive->nc+1,&entry, -1);
 	name = xa_build_full_path_name_from_entry(entry);
 	gchar *no_slashes = g_strrstr(name,"/");
 	if (no_slashes != NULL)
@@ -1713,6 +1710,7 @@
 
 void drag_data_get (GtkWidget *widget, GdkDragContext *dc, GtkSelectionData *selection_data, guint info, guint t, gpointer data)
 {
+	XArchive *archive = data;
 	GtkTreeSelection *selection;
 	guchar *fm_path;
 	int fm_path_len;
@@ -1721,18 +1719,13 @@
 	GList *row_list = NULL;
 	GSList *list = NULL;
 	GString *names;
-	gint current_page;
-	gint idx;
 
-	current_page = gtk_notebook_get_current_page(notebook);
-	idx = xa_find_archive_index (current_page);
-
-    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (archive[idx]->treeview));
+    selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (archive->treeview));
 	row_list = gtk_tree_selection_get_selected_rows (selection, NULL);
 
 	if ( row_list == NULL)
 		return;
-	if (archive[idx]->status == XA_ARCHIVESTATUS_EXTRACT)
+	if (archive->status == XA_ARCHIVESTATUS_EXTRACT)
 	{
 		response = xa_show_message_dialog (GTK_WINDOW (MainWindow),GTK_DIALOG_MODAL,GTK_MESSAGE_ERROR,GTK_BUTTONS_OK,_("Can't perform another extraction:"),_("Please wait until the completion of the current one!") );
 		return;
@@ -1754,50 +1747,50 @@
 			gtk_drag_finish (dc, FALSE, FALSE, t);
 			return;
 		}
-		if ( archive[idx]->has_passwd )
+		if (archive->has_passwd)
 		{
-			if ( archive[idx]->passwd == NULL)
+			if (archive->passwd == NULL)
 			{
-				archive[idx]->passwd = password_dialog ();
-				if ( archive[idx]->passwd == NULL)
+				archive->passwd = password_dialog();
+				if ( archive->passwd == NULL)
 				{
-					gtk_drag_finish (dc, FALSE, FALSE, t);
+					gtk_drag_finish (dc,FALSE,FALSE,t);
 					return;
 				}
 			}
 		}
-		archive[idx]->extraction_path = extract_local_path ( no_uri_path );
-		g_free ( no_uri_path );
-		if (archive[idx]->extraction_path != NULL)
+		archive->extraction_path = extract_local_path (no_uri_path);
+		g_free (no_uri_path);
+		if (archive->extraction_path != NULL)
 			to_send = "S";
 
 		names = g_string_new ("");
-		gtk_tree_selection_selected_foreach (selection, (GtkTreeSelectionForeachFunc) xa_concat_filenames, names );
-		full_path = archive[idx]->full_path;
-		overwrite = archive[idx]->overwrite;
-		archive[idx]->full_path = 0;
-		archive[idx]->overwrite = 1;
-		command = xa_extract_single_files ( archive[idx] , names, archive[idx]->extraction_path );
+		gtk_tree_selection_selected_foreach (selection, (GtkTreeSelectionForeachFunc) xa_concat_filenames,names);
+		full_path = archive->full_path;
+		overwrite = archive->overwrite;
+		archive->full_path = 0;
+		archive->overwrite = 1;
+		command = xa_extract_single_files (archive,names,archive->extraction_path);
 		g_string_free (names, TRUE);
 		if ( command != NULL )
 		{
-			archive[idx]->status = XA_ARCHIVESTATUS_EXTRACT;
+			archive->status = XA_ARCHIVESTATUS_EXTRACT;
 			list = g_slist_append(list,command);
-			xa_run_command (archive[idx],list);
+			xa_run_command (archive,list);
 		}
-		archive[idx]->full_path = full_path;
-		archive[idx]->overwrite = overwrite;
-		gtk_selection_data_set (selection_data, selection_data->target, 8, (guchar*)to_send, 1);
+		archive->full_path = full_path;
+		archive->overwrite = overwrite;
+		gtk_selection_data_set (selection_data, selection_data->target,8,(guchar*)to_send,1);
 	}
 
-	if (archive[idx]->extraction_path != NULL)
+	if (archive->extraction_path != NULL)
 	{
-		g_free (archive[idx]->extraction_path);
-		archive[idx]->extraction_path = NULL;
+		g_free (archive->extraction_path);
+		archive->extraction_path = NULL;
 	}
-	g_list_foreach (row_list, (GFunc) gtk_tree_path_free, NULL);
+	g_list_foreach (row_list,(GFunc) gtk_tree_path_free,NULL);
 	g_list_free (row_list);
-	archive[idx]->status = XA_ARCHIVESTATUS_IDLE;
+	archive->status = XA_ARCHIVESTATUS_IDLE;
 }
 
 void on_drag_data_received (GtkWidget *widget,GdkDragContext *context,int x,int y,GtkSelectionData *data, unsigned int info,unsigned int time,gpointer user_data)
@@ -1932,7 +1925,7 @@
 	return FALSE;
 }
 
-void xa_select_all ( GtkMenuItem *menuitem , gpointer user_data )
+void xa_select_all(GtkMenuItem *menuitem,gpointer user_data)
 {
 	gint idx;
 	gint current_page;
@@ -1959,9 +1952,10 @@
 	gtk_widget_set_sensitive (deselect_all,FALSE);
 }
 
-void xa_activate_link (GtkAboutDialog *about, const gchar *link, gpointer data)
+void xa_activate_link (GtkAboutDialog *about,const gchar *link,gpointer data)
 {
 	gchar *browser_path;
+	gboolean result;
 
 	browser_path = gtk_combo_box_get_active_text(GTK_COMBO_BOX(prefs_window->combo_prefered_web_browser));
 
@@ -1972,6 +1966,8 @@
 		g_free (browser_path);
 		return;	
 	}
+	result = xa_launch_external_program(browser_path,(gchar *)link);
+
 	if (browser_path != NULL)
 		g_free (browser_path);
 }
@@ -2090,27 +2086,47 @@
 	xa_update_window_with_archive_entries(archive[idx],new_entry);
 }
 
+int xa_mouse_button_event(GtkWidget *widget,GdkEventButton *event,gpointer data)
+{
+	XArchive *archive = data;
+	GtkTreePath *path;
+	GtkTreeIter  iter;
+	GtkTreeSelection *selection;
+
+	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (archive->treeview));
+	gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (archive->treeview),event->x, event->y,&path,NULL,NULL,NULL);
+	if ((event->type == GDK_BUTTON_PRESS) && (event->button == 3))
+	{
+		gtk_tree_model_get_iter (GTK_TREE_MODEL (archive->liststore),&iter,path);
+		gtk_tree_path_free (path);
+		if (! gtk_tree_selection_iter_is_selected (selection, &iter))
+		{
+			gtk_tree_selection_unselect_all (selection);
+			gtk_tree_selection_select_iter (selection, &iter);
+		}
+		gtk_menu_popup (GTK_MENU (xa_popup_menu),NULL,NULL,NULL,MainWindow,event->button,event->time);
+		return TRUE;
+	}
+	return FALSE;
+}
+
 void xa_treeview_row_activated(GtkTreeView *tree_view,GtkTreePath *path,GtkTreeViewColumn *column,gpointer user_data)
 {
-	gint current_page;
-	gint idx;
+	XArchive *archive = user_data;
 	XEntry *entry;
 	GtkTreeIter iter;
 
-	current_page = gtk_notebook_get_current_page(notebook);
-	idx = xa_find_archive_index (current_page);
-
-	if (! gtk_tree_model_get_iter (GTK_TREE_MODEL (archive[idx]->liststore),&iter,path))
+	if (! gtk_tree_model_get_iter (GTK_TREE_MODEL (archive->liststore),&iter,path))
 		return;
 
-	gtk_tree_model_get (GTK_TREE_MODEL (archive[idx]->liststore),&iter,archive[idx]->nc+1,&entry, -1);
+	gtk_tree_model_get (GTK_TREE_MODEL (archive->liststore),&iter,archive->nc+1,&entry,-1);
 	if (! entry->is_dir)
 		return;
-	if (archive[idx]->location_entry_path != NULL)
-		archive[idx]->back = g_slist_prepend(archive[idx]->back,xa_find_entry_from_path(archive[idx]->root_entry,archive[idx]->location_entry_path));
+	if (archive->location_entry_path != NULL)
+		archive->back = g_slist_prepend(archive->back,xa_find_entry_from_path(archive->root_entry,archive->location_entry_path));
+	/* Put NULL so to display the root entry */
 	else
-		/* Put NULL so to display the root entry */
-		archive[idx]->back = g_slist_prepend(archive[idx]->back,NULL);
+		archive->back = g_slist_prepend(archive->back,NULL);
 
-	xa_update_window_with_archive_entries(archive[idx],entry);
+	xa_update_window_with_archive_entries(archive,entry);
 }

Modified: xarchiver/trunk/src/window.h
===================================================================
--- xarchiver/trunk/src/window.h	2007-12-23 16:50:23 UTC (rev 26502)
+++ xarchiver/trunk/src/window.h	2007-12-24 15:26:15 UTC (rev 26503)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (C) 2007 Giuseppe Torelli - <colossus73 at gmail.com>
+ *  Copyright (C) 2008 Giuseppe Torelli - <colossus73 at gmail.com>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -80,7 +80,7 @@
 void xa_cancel_archive ( GtkMenuItem *menuitem , gpointer user_data);
 void xa_add_files_archive ( GtkMenuItem *menuitem, gpointer user_data );
 void xa_show_prefs_dialog ( GtkMenuItem *menuitem , gpointer user_data );
-void xa_activate_delete_and_view();
+void xa_activate_delete_and_view (GtkTreeSelection *treeselection,gpointer data);
 void on_drag_data_received (GtkWidget *widget,GdkDragContext *context, int x,int y,GtkSelectionData *data, unsigned int info, unsigned int time, gpointer user_data);
 void drag_begin (GtkWidget *treeview1,GdkDragContext *context, gpointer data);
 void drag_end (GtkWidget *treeview1, GdkDragContext *context, gpointer data);
@@ -106,9 +106,10 @@
 
 gchar *xa_open_file_dialog ();
 gchar *xa_open_sfx_file_selector ();
-void xa_activate_link (GtkAboutDialog *about, const gchar *link, gpointer data);
-void xa_location_entry_activated (GtkEntry *entry,gpointer  user_data);
+void xa_activate_link (GtkAboutDialog *about,const gchar *link,gpointer data);
+void xa_location_entry_activated (GtkEntry *entry,gpointer user_data);
 void xa_treeview_row_activated(GtkTreeView *tree_view,GtkTreePath *path,GtkTreeViewColumn *column,gpointer user_data);
+int xa_mouse_button_event(GtkWidget *widget,GdkEventButton *event,gpointer data);
 gchar *name;
 gchar *permissions;
 #endif



More information about the Xfce4-commits mailing list