Added old abandoned KDE3 version of keep
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/keep@1088044 283d02a7-25f6-0310-bc7c-ecb5cbfe19dav3.5.13-sru
commit
cfe7326707
@ -0,0 +1,67 @@
|
||||
Keep ChangeLog
|
||||
=====================
|
||||
|
||||
VERSION 0.4.0
|
||||
ADD: possibility to use an inclusion/exclusion list when setting up backup source
|
||||
ADD: possibility to control rdiff-backup process priority
|
||||
ADD: Restore backup wizard now displays last backup date
|
||||
FIX: Backup every hour bug fixed
|
||||
|
||||
VERSION 0.3.0
|
||||
ADD: backup error management
|
||||
ADD: notifications
|
||||
ADD: backup logging
|
||||
FIX: many memory leaks
|
||||
FIX: rdiff-backup management improved
|
||||
|
||||
VERSION 0.2.4
|
||||
FIX: updated wording of the application
|
||||
FIX: updated GUI in restore and add wizard
|
||||
|
||||
VERSION 0.2.3
|
||||
ADD: advanced configuration of backups
|
||||
FIX: the backup method has been fixed
|
||||
|
||||
VERSION 0.2.2
|
||||
ADD: it's now possible to edit a backup
|
||||
ADD: it's now possible to avoid special files (devices, sockets, links, etc.) in backups
|
||||
FIX: fixed error when trying to backup a directory to multiple destinations
|
||||
|
||||
VERSION 0.2.1
|
||||
ADD: It's now possible to see the modifications of selected increment when restoring
|
||||
ADD: It's now possible to see the changed files of selected increment when restoring
|
||||
ADD: It's now possible to see the files of the selected increment
|
||||
ADD: Restoration of a custom backup directory
|
||||
ADD: Restoration to a custom directory
|
||||
|
||||
VERSION 0.2.0
|
||||
ADD: Keep use now rdiff-backup as backend. Thanks Luke!
|
||||
ADD: You can now set different backups, with defined settings for each
|
||||
ADD: GUI has been redesigned
|
||||
ADD: There is now a wizard to add a directory to backup
|
||||
ADD: There is now a wizard to restore a backuped directory
|
||||
ADD: Forcing backup has been redesigned
|
||||
ADD: New icons for each action (Force Backup, Restore Backup, Add Backup)
|
||||
FIX: major code reorganization: now icons are in a separate dir and wizard in the app dir
|
||||
|
||||
VERSION 0.1.2
|
||||
ADD: Action panel. You can now control the backup system from the application
|
||||
ADD: It's now possible to clean the backup directory
|
||||
ADD: GUI enhanced
|
||||
ADD: New icon (inspired by both Ark and KMail ones, thanks to the artists who created them: Bryce Corkins, Liam Smit)
|
||||
FIX: Backup directory size function cleaned
|
||||
FIX: Now backup function fixed (deletion of old backups behaves now as expected)
|
||||
FIX: Last and next backup date when there is no backup.
|
||||
FIX: Fixed many makefiles, now it builds with automake and when builddir != srcdir
|
||||
|
||||
|
||||
VERSION 0.1.1
|
||||
ADD: It's now possible to see if the backup system is well configured
|
||||
ADD: It's now possible to force a backup
|
||||
ADD: the main window has been redesigned
|
||||
FIX: Fixed many bugs in the backup process
|
||||
FIX: Code of the daemon cleaned
|
||||
FIX: Code of the main application cleaned
|
||||
|
||||
VERSION 0.1.0
|
||||
ADD: Initial release
|
@ -0,0 +1,20 @@
|
||||
Index of software in kdeplayground-admin
|
||||
========================================
|
||||
|
||||
Please add software to this index. Each entry should include the
|
||||
following entries:
|
||||
* Name:, which is the directory name
|
||||
* Synopsis:, which is a short description of what it does
|
||||
* Notes:, for key usage / applicability information (optional)
|
||||
* See also:, for cross references to other KDE apps/modules (optional)
|
||||
* URL:, for web links to required software or a home page (optional)
|
||||
|
||||
Entries should be entirely objective.
|
||||
|
||||
Name: kextprocess
|
||||
Synopsis: Library with a KProcess-like API for running apps remotely via e.g. SSH
|
||||
|
||||
Name: ksystemlog
|
||||
Synopsis: System log viewer tool for KDE
|
||||
URL: http://annivernet.free.fr/ksystemlog
|
||||
|
@ -0,0 +1,167 @@
|
||||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, and a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure').
|
||||
|
||||
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
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' 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. 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' takes a while. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
4. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
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 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 `..'.
|
||||
|
||||
If you have to use a `make' that does not supports 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
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Operation Controls
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
|
||||
`--help'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made.
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
||||
|
@ -0,0 +1,5 @@
|
||||
/** @mainpage Playground - Sysadmin
|
||||
|
||||
This is the KDE playground for sysadmin tools.
|
||||
|
||||
*/
|
@ -0,0 +1,12 @@
|
||||
## kdebase/Makefile.am
|
||||
## (C) 1997 Stephan Kulow
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign 1.6.1
|
||||
|
||||
dist-hook:
|
||||
cd $(top_distdir) && perl $(top_srcdir)/admin/am_edit -padmin
|
||||
|
||||
include admin/Doxyfile.am
|
||||
include admin/deps.am
|
||||
|
||||
SUBDIRS=$(TOPSUBDIRS)
|
@ -0,0 +1,11 @@
|
||||
## kdebase/Makefile.am
|
||||
## (C) 1997 Stephan Kulow
|
||||
|
||||
AUTOMAKE_OPTIONS = foreign 1.6.1
|
||||
|
||||
dist-hook:
|
||||
cd $(top_distdir) && perl $(top_srcdir)/admin/am_edit -padmin
|
||||
|
||||
include admin/Doxyfile.am
|
||||
include admin/deps.am
|
||||
|
@ -0,0 +1,12 @@
|
||||
Keep README
|
||||
=====================
|
||||
|
||||
Keep is a simple backup system for KDE.
|
||||
|
||||
The principe is pretty simple: you choose a directory to backup, you choose the directory in which you want to backup it, you set up some options (eg. frequency) and it's done! Of course you can add later some other directories.
|
||||
|
||||
A daemon will after take care of automatically perform backups when it's needed.
|
||||
|
||||
When the time comes, Keep offers you a simple wizard to recover a previously backuped directory.
|
||||
|
||||
It uses rdiff-backup (http://www.nongnu.org/rdiff-backup/) as backend.
|
@ -0,0 +1,9 @@
|
||||
Keep TODO
|
||||
=====================
|
||||
|
||||
VERSION 0.5.0
|
||||
KIO integration
|
||||
Improve notifications
|
||||
Network located backups
|
||||
Improve wording and usability
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,884 @@
|
||||
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_AUTOMAKE_VERSION(VERSION)
|
||||
# ----------------------------
|
||||
# Automake X.Y traces this macro to ensure aclocal.m4 has been
|
||||
# generated from the m4 files accompanying Automake X.Y.
|
||||
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
|
||||
|
||||
# AM_SET_CURRENT_AUTOMAKE_VERSION
|
||||
# -------------------------------
|
||||
# Call AM_AUTOMAKE_VERSION so it can be traced.
|
||||
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
|
||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||
[AM_AUTOMAKE_VERSION([1.9.6])])
|
||||
|
||||
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
|
||||
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
|
||||
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
|
||||
#
|
||||
# Of course, Automake must honor this variable whenever it calls a
|
||||
# tool from the auxiliary directory. The problem is that $srcdir (and
|
||||
# therefore $ac_aux_dir as well) can be either absolute or relative,
|
||||
# depending on how configure is run. This is pretty annoying, since
|
||||
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
|
||||
# source directory, any form will work fine, but in subdirectories a
|
||||
# relative path needs to be adjusted first.
|
||||
#
|
||||
# $ac_aux_dir/missing
|
||||
# fails when called from a subdirectory if $ac_aux_dir is relative
|
||||
# $top_srcdir/$ac_aux_dir/missing
|
||||
# fails if $ac_aux_dir is absolute,
|
||||
# fails when called from a subdirectory in a VPATH build with
|
||||
# a relative $ac_aux_dir
|
||||
#
|
||||
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
|
||||
# are both prefixed by $srcdir. In an in-source build this is usually
|
||||
# harmless because $srcdir is `.', but things will broke when you
|
||||
# start a VPATH build or use an absolute $srcdir.
|
||||
#
|
||||
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
|
||||
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
|
||||
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
|
||||
# and then we would define $MISSING as
|
||||
# MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# This will work as long as MISSING is not called from configure, because
|
||||
# unfortunately $(top_srcdir) has no meaning in configure.
|
||||
# However there are other variables, like CC, which are often used in
|
||||
# configure, and could therefore not use this "fixed" $ac_aux_dir.
|
||||
#
|
||||
# Another solution, used here, is to always expand $ac_aux_dir to an
|
||||
# absolute PATH. The drawback is that using absolute paths prevent a
|
||||
# configured tree to be moved without reconfiguration.
|
||||
|
||||
AC_DEFUN([AM_AUX_DIR_EXPAND],
|
||||
[dnl Rely on autoconf to set up CDPATH properly.
|
||||
AC_PREREQ([2.50])dnl
|
||||
# expand $ac_aux_dir to an absolute path
|
||||
am_aux_dir=`cd $ac_aux_dir && pwd`
|
||||
])
|
||||
|
||||
# AM_CONDITIONAL -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 7
|
||||
|
||||
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
|
||||
# -------------------------------------
|
||||
# Define a conditional.
|
||||
AC_DEFUN([AM_CONDITIONAL],
|
||||
[AC_PREREQ(2.52)dnl
|
||||
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
|
||||
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
|
||||
AC_SUBST([$1_TRUE])
|
||||
AC_SUBST([$1_FALSE])
|
||||
if $2; then
|
||||
$1_TRUE=
|
||||
$1_FALSE='#'
|
||||
else
|
||||
$1_TRUE='#'
|
||||
$1_FALSE=
|
||||
fi
|
||||
AC_CONFIG_COMMANDS_PRE(
|
||||
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
|
||||
AC_MSG_ERROR([[conditional "$1" was never defined.
|
||||
Usually this means the macro was only invoked conditionally.]])
|
||||
fi])])
|
||||
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 8
|
||||
|
||||
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
|
||||
# written in clear, in which case automake, when reading aclocal.m4,
|
||||
# will think it sees a *use*, and therefore will trigger all it's
|
||||
# C support machinery. Also note that it means that autoscan, seeing
|
||||
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
|
||||
|
||||
|
||||
# _AM_DEPENDENCIES(NAME)
|
||||
# ----------------------
|
||||
# See how the compiler implements dependency checking.
|
||||
# NAME is "CC", "CXX", "GCJ", or "OBJC".
|
||||
# We try a few techniques and use that to set a single cache variable.
|
||||
#
|
||||
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
|
||||
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
|
||||
# dependency, and given that the user is not expected to run this macro,
|
||||
# just rely on AC_PROG_CC.
|
||||
AC_DEFUN([_AM_DEPENDENCIES],
|
||||
[AC_REQUIRE([AM_SET_DEPDIR])dnl
|
||||
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
|
||||
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
|
||||
AC_REQUIRE([AM_DEP_TRACK])dnl
|
||||
|
||||
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
|
||||
[$1], CXX, [depcc="$CXX" am_compiler_list=],
|
||||
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
|
||||
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
|
||||
[depcc="$$1" am_compiler_list=])
|
||||
|
||||
AC_CACHE_CHECK([dependency style of $depcc],
|
||||
[am_cv_$1_dependencies_compiler_type],
|
||||
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
|
||||
# We make a subdir and do the tests there. Otherwise we can end up
|
||||
# making bogus files that we don't know about and never remove. For
|
||||
# instance it was reported that on HP-UX the gcc test will end up
|
||||
# making a dummy file named `D' -- because `-MD' means `put the output
|
||||
# in D'.
|
||||
mkdir conftest.dir
|
||||
# Copy depcomp to subdir because otherwise we won't find it if we're
|
||||
# using a relative directory.
|
||||
cp "$am_depcomp" conftest.dir
|
||||
cd conftest.dir
|
||||
# We will build objects and dependencies in a subdirectory because
|
||||
# it helps to detect inapplicable dependency modes. For instance
|
||||
# both Tru64's cc and ICC support -MD to output dependencies as a
|
||||
# side effect of compilation, but ICC will put the dependencies in
|
||||
# the current directory while Tru64 will put them in the object
|
||||
# directory.
|
||||
mkdir sub
|
||||
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
if test "$am_compiler_list" = ""; then
|
||||
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
|
||||
fi
|
||||
for depmode in $am_compiler_list; do
|
||||
# Setup a source with many dependencies, because some compilers
|
||||
# like to wrap large dependency lists on column 80 (with \), and
|
||||
# we should not choose a depcomp mode which is confused by this.
|
||||
#
|
||||
# We need to recreate these files for each test, as the compiler may
|
||||
# overwrite some of them when testing with obscure command lines.
|
||||
# This happens at least with the AIX C compiler.
|
||||
: > sub/conftest.c
|
||||
for i in 1 2 3 4 5 6; do
|
||||
echo '#include "conftst'$i'.h"' >> sub/conftest.c
|
||||
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
|
||||
# Solaris 8's {/usr,}/bin/sh.
|
||||
touch sub/conftst$i.h
|
||||
done
|
||||
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
|
||||
|
||||
case $depmode in
|
||||
nosideeffect)
|
||||
# after this tag, mechanisms are not by side-effect, so they'll
|
||||
# only be used when explicitly requested
|
||||
if test "x$enable_dependency_tracking" = xyes; then
|
||||
continue
|
||||
else
|
||||
break
|
||||
fi
|
||||
;;
|
||||
none) break ;;
|
||||
esac
|
||||
# We check with `-c' and `-o' for the sake of the "dashmstdout"
|
||||
# mode. It turns out that the SunPro C++ compiler does not properly
|
||||
# handle `-M -o', and we need to detect this.
|
||||
if depmode=$depmode \
|
||||
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
|
||||
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
|
||||
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
|
||||
>/dev/null 2>conftest.err &&
|
||||
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
|
||||
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
|
||||
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
|
||||
# icc doesn't choke on unknown options, it will just issue warnings
|
||||
# or remarks (even with -Werror). So we grep stderr for any message
|
||||
# that says an option was ignored or not supported.
|
||||
# When given -MP, icc 7.0 and 7.1 complain thusly:
|
||||
# icc: Command line warning: ignoring option '-M'; no argument required
|
||||
# The diagnosis changed in icc 8.0:
|
||||
# icc: Command line remark: option '-MP' not supported
|
||||
if (grep 'ignoring option' conftest.err ||
|
||||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
|
||||
am_cv_$1_dependencies_compiler_type=$depmode
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
cd ..
|
||||
rm -rf conftest.dir
|
||||
else
|
||||
am_cv_$1_dependencies_compiler_type=none
|
||||
fi
|
||||
])
|
||||
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
|
||||
AM_CONDITIONAL([am__fastdep$1], [
|
||||
test "x$enable_dependency_tracking" != xno \
|
||||
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
|
||||
])
|
||||
|
||||
|
||||
# AM_SET_DEPDIR
|
||||
# -------------
|
||||
# Choose a directory name for dependency files.
|
||||
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
|
||||
AC_DEFUN([AM_SET_DEPDIR],
|
||||
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
|
||||
])
|
||||
|
||||
|
||||
# AM_DEP_TRACK
|
||||
# ------------
|
||||
AC_DEFUN([AM_DEP_TRACK],
|
||||
[AC_ARG_ENABLE(dependency-tracking,
|
||||
[ --disable-dependency-tracking speeds up one-time build
|
||||
--enable-dependency-tracking do not reject slow dependency extractors])
|
||||
if test "x$enable_dependency_tracking" != xno; then
|
||||
am_depcomp="$ac_aux_dir/depcomp"
|
||||
AMDEPBACKSLASH='\'
|
||||
fi
|
||||
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
||||
AC_SUBST([AMDEPBACKSLASH])
|
||||
])
|
||||
|
||||
# Generate code to set up dependency tracking. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
#serial 3
|
||||
|
||||
# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# ------------------------------
|
||||
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[for mf in $CONFIG_FILES; do
|
||||
# Strip MF so we end up with the name of the file.
|
||||
mf=`echo "$mf" | sed -e 's/:.*$//'`
|
||||
# Check whether this is an Automake generated Makefile or not.
|
||||
# We used to match only the files named `Makefile.in', but
|
||||
# some people rename them; so instead we look at the file content.
|
||||
# Grep'ing the first line is not enough: some people post-process
|
||||
# each Makefile.in and add a new line on top of each file to say so.
|
||||
# So let's grep whole file.
|
||||
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
|
||||
dirpart=`AS_DIRNAME("$mf")`
|
||||
else
|
||||
continue
|
||||
fi
|
||||
# Extract the definition of DEPDIR, am__include, and am__quote
|
||||
# from the Makefile without running `make'.
|
||||
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
|
||||
test -z "$DEPDIR" && continue
|
||||
am__include=`sed -n 's/^am__include = //p' < "$mf"`
|
||||
test -z "am__include" && continue
|
||||
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
|
||||
# When using ansi2knr, U may be empty or an underscore; expand it
|
||||
U=`sed -n 's/^U = //p' < "$mf"`
|
||||
# Find all dependency output files, they are included files with
|
||||
# $(DEPDIR) in their names. We invoke sed twice because it is the
|
||||
# simplest approach to changing $(DEPDIR) to its actual value in the
|
||||
# expansion.
|
||||
for file in `sed -n "
|
||||
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
|
||||
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
|
||||
# Make sure the directory exists.
|
||||
test -f "$dirpart/$file" && continue
|
||||
fdir=`AS_DIRNAME(["$file"])`
|
||||
AS_MKDIR_P([$dirpart/$fdir])
|
||||
# echo "creating $dirpart/$file"
|
||||
echo '# dummy' > "$dirpart/$file"
|
||||
done
|
||||
done
|
||||
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
|
||||
|
||||
# AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# -----------------------------
|
||||
# This macro should only be invoked once -- use via AC_REQUIRE.
|
||||
#
|
||||
# This code is only required when automatic dependency tracking
|
||||
# is enabled. FIXME. This creates each `.P' file that we will
|
||||
# need in order to bootstrap the dependency handling code.
|
||||
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AC_CONFIG_COMMANDS([depfiles],
|
||||
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
|
||||
])
|
||||
|
||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 8
|
||||
|
||||
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
|
||||
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
|
||||
|
||||
# Do all the work for Automake. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 12
|
||||
|
||||
# This macro actually does too much. Some checks are only needed if
|
||||
# your package does certain things. But this isn't really a big deal.
|
||||
|
||||
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
|
||||
# AM_INIT_AUTOMAKE([OPTIONS])
|
||||
# -----------------------------------------------
|
||||
# The call with PACKAGE and VERSION arguments is the old style
|
||||
# call (pre autoconf-2.50), which is being phased out. PACKAGE
|
||||
# and VERSION should now be passed to AC_INIT and removed from
|
||||
# the call to AM_INIT_AUTOMAKE.
|
||||
# We support both call styles for the transition. After
|
||||
# the next Automake release, Autoconf can make the AC_INIT
|
||||
# arguments mandatory, and then we can depend on a new Autoconf
|
||||
# release and drop the old call support.
|
||||
AC_DEFUN([AM_INIT_AUTOMAKE],
|
||||
[AC_PREREQ([2.58])dnl
|
||||
dnl Autoconf wants to disallow AM_ names. We explicitly allow
|
||||
dnl the ones we care about.
|
||||
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
|
||||
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
|
||||
AC_REQUIRE([AC_PROG_INSTALL])dnl
|
||||
# test to see if srcdir already configured
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`" &&
|
||||
test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
|
||||
# test whether we have cygpath
|
||||
if test -z "$CYGPATH_W"; then
|
||||
if (cygpath --version) >/dev/null 2>/dev/null; then
|
||||
CYGPATH_W='cygpath -w'
|
||||
else
|
||||
CYGPATH_W=echo
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([CYGPATH_W])
|
||||
|
||||
# Define the identity of the package.
|
||||
dnl Distinguish between old-style and new-style calls.
|
||||
m4_ifval([$2],
|
||||
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
|
||||
AC_SUBST([PACKAGE], [$1])dnl
|
||||
AC_SUBST([VERSION], [$2])],
|
||||
[_AM_SET_OPTIONS([$1])dnl
|
||||
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
|
||||
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
|
||||
|
||||
_AM_IF_OPTION([no-define],,
|
||||
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
|
||||
|
||||
# Some tools Automake needs.
|
||||
AC_REQUIRE([AM_SANITY_CHECK])dnl
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])dnl
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo)
|
||||
AM_PROG_INSTALL_SH
|
||||
AM_PROG_INSTALL_STRIP
|
||||
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
|
||||
# We need awk for the "check" target. The system "awk" is bad on
|
||||
# some platforms.
|
||||
AC_REQUIRE([AC_PROG_AWK])dnl
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
|
||||
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
|
||||
[_AM_PROG_TAR([v7])])])
|
||||
_AM_IF_OPTION([no-dependencies],,
|
||||
[AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
[_AM_DEPENDENCIES(CC)],
|
||||
[define([AC_PROG_CC],
|
||||
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[_AM_DEPENDENCIES(CXX)],
|
||||
[define([AC_PROG_CXX],
|
||||
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
|
||||
])
|
||||
])
|
||||
|
||||
|
||||
# When config.status generates a header, we must update the stamp-h file.
|
||||
# This file resides in the same directory as the config header
|
||||
# that is generated. The stamp files are numbered to have different names.
|
||||
|
||||
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
|
||||
# loop where config.status creates the headers, so we can generate
|
||||
# our stamp files there.
|
||||
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
|
||||
[# Compute $1's index in $config_headers.
|
||||
_am_stamp_count=1
|
||||
for _am_header in $config_headers :; do
|
||||
case $_am_header in
|
||||
$1 | $1:* )
|
||||
break ;;
|
||||
* )
|
||||
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
|
||||
esac
|
||||
done
|
||||
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_SH
|
||||
# ------------------
|
||||
# Define $install_sh.
|
||||
AC_DEFUN([AM_PROG_INSTALL_SH],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
install_sh=${install_sh-"$am_aux_dir/install-sh"}
|
||||
AC_SUBST(install_sh)])
|
||||
|
||||
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# Check whether the underlying file-system supports filenames
|
||||
# with a leading dot. For instance MS-DOS doesn't.
|
||||
AC_DEFUN([AM_SET_LEADING_DOT],
|
||||
[rm -rf .tst 2>/dev/null
|
||||
mkdir .tst 2>/dev/null
|
||||
if test -d .tst; then
|
||||
am__leading_dot=.
|
||||
else
|
||||
am__leading_dot=_
|
||||
fi
|
||||
rmdir .tst 2>/dev/null
|
||||
AC_SUBST([am__leading_dot])])
|
||||
|
||||
# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 5
|
||||
|
||||
# AM_PROG_LEX
|
||||
# -----------
|
||||
# Autoconf leaves LEX=: if lex or flex can't be found. Change that to a
|
||||
# "missing" invocation, for better error output.
|
||||
AC_DEFUN([AM_PROG_LEX],
|
||||
[AC_PREREQ(2.50)dnl
|
||||
AC_REQUIRE([AM_MISSING_HAS_RUN])dnl
|
||||
AC_REQUIRE([AC_PROG_LEX])dnl
|
||||
if test "$LEX" = :; then
|
||||
LEX=${am_missing_run}flex
|
||||
fi])
|
||||
|
||||
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# AM_MAKE_INCLUDE()
|
||||
# -----------------
|
||||
# Check to see how make treats includes.
|
||||
AC_DEFUN([AM_MAKE_INCLUDE],
|
||||
[am_make=${MAKE-make}
|
||||
cat > confinc << 'END'
|
||||
am__doit:
|
||||
@echo done
|
||||
.PHONY: am__doit
|
||||
END
|
||||
# If we don't find an include directive, just comment out the code.
|
||||
AC_MSG_CHECKING([for style of include used by $am_make])
|
||||
am__include="#"
|
||||
am__quote=
|
||||
_am_result=none
|
||||
# First try GNU make style include.
|
||||
echo "include confinc" > confmf
|
||||
# We grep out `Entering directory' and `Leaving directory'
|
||||
# messages which can occur if `w' ends up in MAKEFLAGS.
|
||||
# In particular we don't look at `^make:' because GNU make might
|
||||
# be invoked under some other name (usually "gmake"), in which
|
||||
# case it prints its new name instead of `make'.
|
||||
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
|
||||
am__include=include
|
||||
am__quote=
|
||||
_am_result=GNU
|
||||
fi
|
||||
# Now try BSD make style include.
|
||||
if test "$am__include" = "#"; then
|
||||
echo '.include "confinc"' > confmf
|
||||
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
|
||||
am__include=.include
|
||||
am__quote="\""
|
||||
_am_result=BSD
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([am__include])
|
||||
AC_SUBST([am__quote])
|
||||
AC_MSG_RESULT([$_am_result])
|
||||
rm -f confinc confmf
|
||||
])
|
||||
|
||||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 4
|
||||
|
||||
# AM_MISSING_PROG(NAME, PROGRAM)
|
||||
# ------------------------------
|
||||
AC_DEFUN([AM_MISSING_PROG],
|
||||
[AC_REQUIRE([AM_MISSING_HAS_RUN])
|
||||
$1=${$1-"${am_missing_run}$2"}
|
||||
AC_SUBST($1)])
|
||||
|
||||
|
||||
# AM_MISSING_HAS_RUN
|
||||
# ------------------
|
||||
# Define MISSING if not defined so far and test if it supports --run.
|
||||
# If it does, set am_missing_run to use it, otherwise, to nothing.
|
||||
AC_DEFUN([AM_MISSING_HAS_RUN],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# Use eval to expand $SHELL
|
||||
if eval "$MISSING --run true"; then
|
||||
am_missing_run="$MISSING --run "
|
||||
else
|
||||
am_missing_run=
|
||||
AC_MSG_WARN([`missing' script is too old or missing])
|
||||
fi
|
||||
])
|
||||
|
||||
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_MKDIR_P
|
||||
# ---------------
|
||||
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
|
||||
#
|
||||
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
|
||||
# created by `make install' are always world readable, even if the
|
||||
# installer happens to have an overly restrictive umask (e.g. 077).
|
||||
# This was a mistake. There are at least two reasons why we must not
|
||||
# use `-m 0755':
|
||||
# - it causes special bits like SGID to be ignored,
|
||||
# - it may be too restrictive (some setups expect 775 directories).
|
||||
#
|
||||
# Do not use -m 0755 and let people choose whatever they expect by
|
||||
# setting umask.
|
||||
#
|
||||
# We cannot accept any implementation of `mkdir' that recognizes `-p'.
|
||||
# Some implementations (such as Solaris 8's) are not thread-safe: if a
|
||||
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
|
||||
# concurrently, both version can detect that a/ is missing, but only
|
||||
# one can create it and the other will error out. Consequently we
|
||||
# restrict ourselves to GNU make (using the --version option ensures
|
||||
# this.)
|
||||
AC_DEFUN([AM_PROG_MKDIR_P],
|
||||
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
|
||||
# We used to keeping the `.' as first argument, in order to
|
||||
# allow $(mkdir_p) to be used without argument. As in
|
||||
# $(mkdir_p) $(somedir)
|
||||
# where $(somedir) is conditionally defined. However this is wrong
|
||||
# for two reasons:
|
||||
# 1. if the package is installed by a user who cannot write `.'
|
||||
# make install will fail,
|
||||
# 2. the above comment should most certainly read
|
||||
# $(mkdir_p) $(DESTDIR)$(somedir)
|
||||
# so it does not work when $(somedir) is undefined and
|
||||
# $(DESTDIR) is not.
|
||||
# To support the latter case, we have to write
|
||||
# test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
|
||||
# so the `.' trick is pointless.
|
||||
mkdir_p='mkdir -p --'
|
||||
else
|
||||
# On NextStep and OpenStep, the `mkdir' command does not
|
||||
# recognize any option. It will interpret all options as
|
||||
# directories to create, and then abort because `.' already
|
||||
# exists.
|
||||
for d in ./-p ./--version;
|
||||
do
|
||||
test -d $d && rmdir $d
|
||||
done
|
||||
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
|
||||
if test -f "$ac_aux_dir/mkinstalldirs"; then
|
||||
mkdir_p='$(mkinstalldirs)'
|
||||
else
|
||||
mkdir_p='$(install_sh) -d'
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([mkdir_p])])
|
||||
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 3
|
||||
|
||||
# _AM_MANGLE_OPTION(NAME)
|
||||
# -----------------------
|
||||
AC_DEFUN([_AM_MANGLE_OPTION],
|
||||
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
# _AM_SET_OPTION(NAME)
|
||||
# ------------------------------
|
||||
# Set option NAME. Presently that only means defining a flag for this option.
|
||||
AC_DEFUN([_AM_SET_OPTION],
|
||||
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
|
||||
|
||||
# _AM_SET_OPTIONS(OPTIONS)
|
||||
# ----------------------------------
|
||||
# OPTIONS is a space-separated list of Automake options.
|
||||
AC_DEFUN([_AM_SET_OPTIONS],
|
||||
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
|
||||
|
||||
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
|
||||
# -------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
AC_DEFUN([_AM_IF_OPTION],
|
||||
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
||||
|
||||
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 4
|
||||
|
||||
# AM_SANITY_CHECK
|
||||
# ---------------
|
||||
AC_DEFUN([AM_SANITY_CHECK],
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftest.file
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
|
||||
if test "$[*]" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t $srcdir/configure conftest.file`
|
||||
fi
|
||||
rm -f conftest.file
|
||||
if test "$[*]" != "X $srcdir/configure conftest.file" \
|
||||
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "$[2]" = conftest.file
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_STRIP
|
||||
# ---------------------
|
||||
# One issue with vendor `install' (even GNU) is that you can't
|
||||
# specify the program used to strip binaries. This is especially
|
||||
# annoying in cross-compiling environments, where the build's strip
|
||||
# is unlikely to handle the host's binaries.
|
||||
# Fortunately install-sh will honor a STRIPPROG variable, so we
|
||||
# always use install-sh in `make install-strip', and initialize
|
||||
# STRIPPROG with the value of the STRIP variable (set by the user).
|
||||
AC_DEFUN([AM_PROG_INSTALL_STRIP],
|
||||
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
|
||||
# Installed binaries are usually stripped using `strip' when the user
|
||||
# run `make install-strip'. However `strip' might not be the right
|
||||
# tool to use in cross-compilation environments, therefore Automake
|
||||
# will honor the `STRIP' environment variable to overrule this program.
|
||||
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
|
||||
if test "$cross_compiling" != no; then
|
||||
AC_CHECK_TOOL([STRIP], [strip], :)
|
||||
fi
|
||||
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
|
||||
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
||||
|
||||
# Check how to create a tarball. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# _AM_PROG_TAR(FORMAT)
|
||||
# --------------------
|
||||
# Check how to create a tarball in format FORMAT.
|
||||
# FORMAT should be one of `v7', `ustar', or `pax'.
|
||||
#
|
||||
# Substitute a variable $(am__tar) that is a command
|
||||
# writing to stdout a FORMAT-tarball containing the directory
|
||||
# $tardir.
|
||||
# tardir=directory && $(am__tar) > result.tar
|
||||
#
|
||||
# Substitute a variable $(am__untar) that extract such
|
||||
# a tarball read from stdin.
|
||||
# $(am__untar) < result.tar
|
||||
AC_DEFUN([_AM_PROG_TAR],
|
||||
[# Always define AMTAR for backward compatibility.
|
||||
AM_MISSING_PROG([AMTAR], [tar])
|
||||
m4_if([$1], [v7],
|
||||
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
|
||||
[m4_case([$1], [ustar],, [pax],,
|
||||
[m4_fatal([Unknown tar format])])
|
||||
AC_MSG_CHECKING([how to create a $1 tar archive])
|
||||
# Loop over all known methods to create a tar archive until one works.
|
||||
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
|
||||
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
|
||||
# Do not fold the above two line into one, because Tru64 sh and
|
||||
# Solaris sh will not grok spaces in the rhs of `-'.
|
||||
for _am_tool in $_am_tools
|
||||
do
|
||||
case $_am_tool in
|
||||
gnutar)
|
||||
for _am_tar in tar gnutar gtar;
|
||||
do
|
||||
AM_RUN_LOG([$_am_tar --version]) && break
|
||||
done
|
||||
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
|
||||
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
|
||||
am__untar="$_am_tar -xf -"
|
||||
;;
|
||||
plaintar)
|
||||
# Must skip GNU tar: if it does not support --format= it doesn't create
|
||||
# ustar tarball either.
|
||||
(tar --version) >/dev/null 2>&1 && continue
|
||||
am__tar='tar chf - "$$tardir"'
|
||||
am__tar_='tar chf - "$tardir"'
|
||||
am__untar='tar xf -'
|
||||
;;
|
||||
pax)
|
||||
am__tar='pax -L -x $1 -w "$$tardir"'
|
||||
am__tar_='pax -L -x $1 -w "$tardir"'
|
||||
am__untar='pax -r'
|
||||
;;
|
||||
cpio)
|
||||
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
|
||||
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
|
||||
am__untar='cpio -i -H $1 -d'
|
||||
;;
|
||||
none)
|
||||
am__tar=false
|
||||
am__tar_=false
|
||||
am__untar=false
|
||||
;;
|
||||
esac
|
||||
|
||||
# If the value was cached, stop now. We just wanted to have am__tar
|
||||
# and am__untar set.
|
||||
test -n "${am_cv_prog_tar_$1}" && break
|
||||
|
||||
# tar/untar a dummy directory, and stop if the command works
|
||||
rm -rf conftest.dir
|
||||
mkdir conftest.dir
|
||||
echo GrepMe > conftest.dir/file
|
||||
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
|
||||
rm -rf conftest.dir
|
||||
if test -s conftest.tar; then
|
||||
AM_RUN_LOG([$am__untar <conftest.tar])
|
||||
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
|
||||
fi
|
||||
done
|
||||
rm -rf conftest.dir
|
||||
|
||||
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
|
||||
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
|
||||
AC_SUBST([am__tar])
|
||||
AC_SUBST([am__untar])
|
||||
]) # _AM_PROG_TAR
|
||||
|
||||
m4_include([acinclude.m4])
|
@ -0,0 +1,394 @@
|
||||
/* config.h.in. Generated from configure.in by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <Carbon/Carbon.h> header file. */
|
||||
#undef HAVE_CARBON_CARBON_H
|
||||
|
||||
/* Define if you have the CoreAudio API */
|
||||
#undef HAVE_COREAUDIO
|
||||
|
||||
/* Define to 1 if you have the <crt_externs.h> header file. */
|
||||
#undef HAVE_CRT_EXTERNS_H
|
||||
|
||||
/* Defines if your system has the crypt function */
|
||||
#undef HAVE_CRYPT
|
||||
|
||||
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
|
||||
*/
|
||||
#undef HAVE_DIRENT_H
|
||||
|
||||
/* Define if you have dlfcn */
|
||||
#undef HAVE_DLFCN
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <dl.h> header file. */
|
||||
#undef HAVE_DL_H
|
||||
|
||||
/* Define to 1 if you have the `fabsl' function. */
|
||||
#undef HAVE_FABSL
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define to 1 if you have the `flock' function. */
|
||||
#undef HAVE_FLOCK
|
||||
|
||||
/* Define to 1 if you have the <fnmatch.h> header file. */
|
||||
#undef HAVE_FNMATCH_H
|
||||
|
||||
/* Define if you have getdomainname */
|
||||
#undef HAVE_GETDOMAINNAME
|
||||
|
||||
/* Define if you have the getdomainname prototype */
|
||||
#undef HAVE_GETDOMAINNAME_PROTO
|
||||
|
||||
/* Define if you have gethostname */
|
||||
#undef HAVE_GETHOSTNAME
|
||||
|
||||
/* Define if you have the gethostname prototype */
|
||||
#undef HAVE_GETHOSTNAME_PROTO
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define if you have libjpeg */
|
||||
#undef HAVE_LIBJPEG
|
||||
|
||||
/* Define if you have libpng */
|
||||
#undef HAVE_LIBPNG
|
||||
|
||||
/* Define if you have a working libpthread (will enable threaded code) */
|
||||
#undef HAVE_LIBPTHREAD
|
||||
|
||||
/* Define if you have libz */
|
||||
#undef HAVE_LIBZ
|
||||
|
||||
/* Define to 1 if you have the <linux/tcp.h> header file. */
|
||||
#undef HAVE_LINUX_TCP_H
|
||||
|
||||
/* Define to 1 if the type `long double' works and has more range or precision
|
||||
than `double'. */
|
||||
#undef HAVE_LONG_DOUBLE
|
||||
|
||||
/* Define to 1 if the type `long double' works and has more range or precision
|
||||
than `double'. */
|
||||
#undef HAVE_LONG_DOUBLE_WIDER
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
/* Define if your system needs _NSGetEnviron to set up the environment */
|
||||
#undef HAVE_NSGETENVIRON
|
||||
|
||||
/* Define to 1 if you have the <paths.h> header file. */
|
||||
#undef HAVE_PATHS_H
|
||||
|
||||
/* Define if you have res_init */
|
||||
#undef HAVE_RES_INIT
|
||||
|
||||
/* Define if you have the res_init prototype */
|
||||
#undef HAVE_RES_INIT_PROTO
|
||||
|
||||
/* Define to 1 if you have the `re_comp' function. */
|
||||
#undef HAVE_RE_COMP
|
||||
|
||||
/* Define if you have setenv */
|
||||
#undef HAVE_SETENV
|
||||
|
||||
/* Define if you have the setenv prototype */
|
||||
#undef HAVE_SETENV_PROTO
|
||||
|
||||
/* Define if you have a STL implementation by SGI */
|
||||
#undef HAVE_SGI_STL
|
||||
|
||||
/* Define if you have shload */
|
||||
#undef HAVE_SHLOAD
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#undef HAVE_SNPRINTF
|
||||
|
||||
/* Define to 1 if you have the `socket' function. */
|
||||
#undef HAVE_SOCKET
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the `strdup' function. */
|
||||
#undef HAVE_STRDUP
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define if you have strlcat */
|
||||
#undef HAVE_STRLCAT
|
||||
|
||||
/* Define if you have the strlcat prototype */
|
||||
#undef HAVE_STRLCAT_PROTO
|
||||
|
||||
/* Define if you have strlcpy */
|
||||
#undef HAVE_STRLCPY
|
||||
|
||||
/* Define if you have the strlcpy prototype */
|
||||
#undef HAVE_STRLCPY_PROTO
|
||||
|
||||
/* Define to 1 if you have the <sysent.h> header file. */
|
||||
#undef HAVE_SYSENT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/bitypes.h> header file. */
|
||||
#undef HAVE_SYS_BITYPES_H
|
||||
|
||||
/* Define to 1 if you have the <sys/cdefs.h> header file. */
|
||||
#undef HAVE_SYS_CDEFS_H
|
||||
|
||||
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
|
||||
*/
|
||||
#undef HAVE_SYS_DIR_H
|
||||
|
||||
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
|
||||
*/
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define to 1 if you have the <sys/proc.h> header file. */
|
||||
#undef HAVE_SYS_PROC_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have unsetenv */
|
||||
#undef HAVE_UNSETENV
|
||||
|
||||
/* Define if you have the unsetenv prototype */
|
||||
#undef HAVE_UNSETENV_PROTO
|
||||
|
||||
/* Define to 1 if you have the <utmp.h> header file. */
|
||||
#undef HAVE_UTMP_H
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#undef HAVE_VSNPRINTF
|
||||
|
||||
/* Suffix for lib directories */
|
||||
#undef KDELIBSUFF
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* The size of `char *', as computed by sizeof. */
|
||||
#undef SIZEOF_CHAR_P
|
||||
|
||||
/* The size of `int', as computed by sizeof. */
|
||||
#undef SIZEOF_INT
|
||||
|
||||
/* The size of `long', as computed by sizeof. */
|
||||
#undef SIZEOF_LONG
|
||||
|
||||
/* The size of `short', as computed by sizeof. */
|
||||
#undef SIZEOF_SHORT
|
||||
|
||||
/* The size of `size_t', as computed by sizeof. */
|
||||
#undef SIZEOF_SIZE_T
|
||||
|
||||
/* The size of `unsigned long', as computed by sizeof. */
|
||||
#undef SIZEOF_UNSIGNED_LONG
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Defined if compiling without arts */
|
||||
#undef WITHOUT_ARTS
|
||||
|
||||
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
|
||||
`char[]'. */
|
||||
#undef YYTEXT_POINTER
|
||||
|
||||
/*
|
||||
* jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
|
||||
* headers and I'm too lazy to write a configure test as long as only
|
||||
* unixware is related
|
||||
*/
|
||||
#ifdef _UNIXWARE
|
||||
#define HAVE_BOOLEAN
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
|
||||
* that defines bzero.
|
||||
*/
|
||||
|
||||
#if defined(_AIX)
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
|
||||
# include <sys/time.h>
|
||||
# include <crt_externs.h>
|
||||
# define environ (*_NSGetEnviron())
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(HAVE_GETDOMAINNAME_PROTO)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
int getdomainname (char *, size_t);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(HAVE_GETHOSTNAME_PROTO)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
int gethostname (char *, unsigned int);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(HAVE_RES_INIT_PROTO)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
int res_init(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(HAVE_SETENV_PROTO)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
int setenv (const char *, const char *, int);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(HAVE_STRLCAT_PROTO)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
unsigned long strlcat(char*, const char*, unsigned long);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(HAVE_STRLCPY_PROTO)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
unsigned long strlcpy(char*, const char*, unsigned long);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if !defined(HAVE_UNSETENV_PROTO)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
void unsetenv (const char *);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* On HP-UX, the declaration of vsnprintf() is needed every time !
|
||||
*/
|
||||
|
||||
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
|
||||
#if __STDC__
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#else
|
||||
#include <varargs.h>
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
int snprintf(char *str, size_t n, char const *fmt, ...);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if defined(__SVR4) && !defined(__svr4__)
|
||||
#define __svr4__ 1
|
||||
#endif
|
||||
|
||||
|
||||
/* type to use in place of socklen_t if not defined */
|
||||
#undef kde_socklen_t
|
||||
|
||||
/* type to use in place of socklen_t if not defined (deprecated, use
|
||||
kde_socklen_t) */
|
||||
#undef ksize_t
|
@ -0,0 +1,2 @@
|
||||
./admin/configure.in.min
|
||||
configure.in.in
|
@ -0,0 +1,170 @@
|
||||
dnl =======================================================
|
||||
dnl FILE: ./admin/configure.in.min
|
||||
dnl =======================================================
|
||||
|
||||
dnl This file is part of the KDE libraries/packages
|
||||
dnl Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
|
||||
|
||||
dnl This file is free software; you can redistribute it and/or
|
||||
dnl modify it under the terms of the GNU Library General Public
|
||||
dnl License as published by the Free Software Foundation; either
|
||||
dnl version 2 of the License, or (at your option) any later version.
|
||||
|
||||
dnl This library is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
dnl Library General Public License for more details.
|
||||
|
||||
dnl You should have received a copy of the GNU Library General Public License
|
||||
dnl along with this library; see the file COPYING.LIB. If not, write to
|
||||
dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
dnl Boston, MA 02110-1301, USA.
|
||||
|
||||
# Original Author was Kalle@kde.org
|
||||
# I lifted it in some mater. (Stephan Kulow)
|
||||
# I used much code from Janos Farkas
|
||||
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_INIT(acinclude.m4) dnl a source file from your sub dir
|
||||
|
||||
dnl This is so we can use kde-common
|
||||
AC_CONFIG_AUX_DIR(admin)
|
||||
|
||||
dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
|
||||
unset CDPATH
|
||||
|
||||
dnl Checking host/target/build systems, for make, install etc.
|
||||
AC_CANONICAL_SYSTEM
|
||||
dnl Perform program name transformation
|
||||
AC_ARG_PROGRAM
|
||||
|
||||
dnl Automake doc recommends to do this only here. (Janos)
|
||||
AM_INIT_AUTOMAKE(keep-0.4.0, "3.5.4") dnl searches for some needed programs
|
||||
|
||||
KDE_SET_PREFIX
|
||||
|
||||
dnl generate the config header
|
||||
AM_CONFIG_HEADER(config.h) dnl at the distribution this done
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_CHECK_COMPILERS
|
||||
AC_ENABLE_SHARED(yes)
|
||||
AC_ENABLE_STATIC(no)
|
||||
KDE_PROG_LIBTOOL
|
||||
|
||||
dnl for NLS support. Call them in this order!
|
||||
dnl WITH_NLS is for the po files
|
||||
AM_KDE_WITH_NLS
|
||||
|
||||
KDE_USE_QT(3.3)
|
||||
AC_PATH_KDE
|
||||
dnl =======================================================
|
||||
dnl FILE: configure.in.in
|
||||
dnl =======================================================
|
||||
|
||||
#MIN_CONFIG(3.3)
|
||||
# Define a symbol, to know that we're compiling WITH kde. (for apps that
|
||||
# can compile without KDE, optionally)
|
||||
AM_CONDITIONAL(KDE_INSTALLED, test "$have_kde" = "yes")
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_DIRENT
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(fcntl.h sys/time.h sys/stat.h stdint.h)
|
||||
AC_CHECK_HEADERS(sys/cdefs.h fnmatch.h sysent.h strings.h paths.h)
|
||||
AC_CHECK_HEADERS(utmp.h sys/param.h linux/tcp.h sys/proc.h)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_HEADER_TIME
|
||||
|
||||
AC_C_LONG_DOUBLE
|
||||
|
||||
dnl Checks for library functions.
|
||||
KDE_CHECK_DLOPEN
|
||||
AC_CHECK_FUNCS(socket fabsl strdup vsnprintf re_comp flock)
|
||||
AC_CHECK_SETENV
|
||||
AC_CHECK_UNSETENV
|
||||
AC_CHECK_GETDOMAINNAME
|
||||
AC_CHECK_GETHOSTNAME
|
||||
AM_PROG_LEX
|
||||
LFLAGS="-o${LEX_OUTPUT_ROOT}.c"
|
||||
AC_SUBST(LFLAGS)
|
||||
KDE_CREATE_SUBDIRSLIST
|
||||
AM_CONDITIONAL(keep_SUBDIR_included, test "x$keep_SUBDIR_included" = xyes)
|
||||
AM_CONDITIONAL(po_SUBDIR_included, test "x$po_SUBDIR_included" = xyes)
|
||||
AC_CONFIG_FILES([ Makefile ])
|
||||
AC_CONFIG_FILES([ keep/Makefile ])
|
||||
AC_CONFIG_FILES([ keep/app/Makefile ])
|
||||
AC_CONFIG_FILES([ keep/common/Makefile ])
|
||||
AC_CONFIG_FILES([ keep/icons/Makefile ])
|
||||
AC_CONFIG_FILES([ keep/kded/Makefile ])
|
||||
AC_CONFIG_FILES([ po/Makefile ])
|
||||
AC_CONFIG_FILES([ po/bg/Makefile ])
|
||||
AC_CONFIG_FILES([ po/br/Makefile ])
|
||||
AC_CONFIG_FILES([ po/cs/Makefile ])
|
||||
AC_CONFIG_FILES([ po/da/Makefile ])
|
||||
AC_CONFIG_FILES([ po/de/Makefile ])
|
||||
AC_CONFIG_FILES([ po/el/Makefile ])
|
||||
AC_CONFIG_FILES([ po/es/Makefile ])
|
||||
AC_CONFIG_FILES([ po/ga/Makefile ])
|
||||
AC_CONFIG_FILES([ po/gl/Makefile ])
|
||||
AC_CONFIG_FILES([ po/it/Makefile ])
|
||||
AC_CONFIG_FILES([ po/ja/Makefile ])
|
||||
AC_CONFIG_FILES([ po/ka/Makefile ])
|
||||
AC_CONFIG_FILES([ po/lt/Makefile ])
|
||||
AC_CONFIG_FILES([ po/nl/Makefile ])
|
||||
AC_CONFIG_FILES([ po/pl/Makefile ])
|
||||
AC_CONFIG_FILES([ po/pt/Makefile ])
|
||||
AC_CONFIG_FILES([ po/ru/Makefile ])
|
||||
AC_CONFIG_FILES([ po/sk/Makefile ])
|
||||
AC_CONFIG_FILES([ po/sr/Makefile ])
|
||||
AC_CONFIG_FILES([ po/sr@Latn/Makefile ])
|
||||
AC_CONFIG_FILES([ po/sv/Makefile ])
|
||||
AC_CONFIG_FILES([ po/tr/Makefile ])
|
||||
AC_OUTPUT
|
||||
# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
|
||||
if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
|
||||
# And if so, warn when they don't match
|
||||
if test "$kde_libs_prefix" != "$given_prefix"; then
|
||||
# And if kde doesn't know about the prefix yet
|
||||
echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
|
||||
if test $? -ne 0; then
|
||||
echo ""
|
||||
echo "Warning: you chose to install this package in $given_prefix,"
|
||||
echo "but KDE was found in $kde_libs_prefix."
|
||||
echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
|
||||
echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix"
|
||||
echo "Then restart KDE."
|
||||
echo ""
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then
|
||||
echo ""
|
||||
echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility"
|
||||
echo "was not included. Therefore, GCC symbol visibility support remains disabled."
|
||||
echo ""
|
||||
echo "For better performance, consider including the Qt visibility supporting patch"
|
||||
echo "located at:"
|
||||
echo ""
|
||||
echo "http://bugs.kde.org/show_bug.cgi?id=109386"
|
||||
echo ""
|
||||
echo "and recompile all of Qt and KDE. Note, this is entirely optional and"
|
||||
echo "everything will continue to work just fine without it."
|
||||
echo ""
|
||||
fi
|
||||
|
||||
if test "$all_tests" = "bad"; then
|
||||
if test ! "$cache_file" = "/dev/null"; then
|
||||
echo ""
|
||||
echo "Please remove the file $cache_file after changing your setup"
|
||||
echo "so that configure will find the changes next time."
|
||||
echo ""
|
||||
fi
|
||||
else
|
||||
echo ""
|
||||
echo "Good - your configure finished. Start make now"
|
||||
echo ""
|
||||
fi
|
@ -0,0 +1,27 @@
|
||||
#MIN_CONFIG(3.3)
|
||||
# Define a symbol, to know that we're compiling WITH kde. (for apps that
|
||||
# can compile without KDE, optionally)
|
||||
AM_CONDITIONAL(KDE_INSTALLED, test "$have_kde" = "yes")
|
||||
|
||||
dnl Checks for header files.
|
||||
AC_HEADER_DIRENT
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(fcntl.h sys/time.h sys/stat.h stdint.h)
|
||||
AC_CHECK_HEADERS(sys/cdefs.h fnmatch.h sysent.h strings.h paths.h)
|
||||
AC_CHECK_HEADERS(utmp.h sys/param.h linux/tcp.h sys/proc.h)
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_HEADER_TIME
|
||||
|
||||
AC_C_LONG_DOUBLE
|
||||
|
||||
dnl Checks for library functions.
|
||||
KDE_CHECK_DLOPEN
|
||||
AC_CHECK_FUNCS(socket fabsl strdup vsnprintf re_comp flock)
|
||||
AC_CHECK_SETENV
|
||||
AC_CHECK_UNSETENV
|
||||
AC_CHECK_GETDOMAINNAME
|
||||
AC_CHECK_GETHOSTNAME
|
||||
AM_PROG_LEX
|
||||
LFLAGS="-o${LEX_OUTPUT_ROOT}.c"
|
||||
AC_SUBST(LFLAGS)
|
@ -0,0 +1,9 @@
|
||||
messages:
|
||||
$(EXTRACTRC) `find . -name "*.rc" -o -name "*.ui"` > rc.cpp
|
||||
LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \
|
||||
if test -n "$$LIST"; then \
|
||||
$(XGETTEXT) $$LIST -o $(podir)/keep.pot; \
|
||||
fi
|
||||
|
||||
SUBDIRS = common app kded icons
|
||||
EXTRA_DIST = AUTHORS COPYING ChangeLog INSTALL README TODO
|
@ -0,0 +1,14 @@
|
||||
Keep NEWS
|
||||
=====================
|
||||
|
||||
09/02/2006: version 0.3.0 released
|
||||
30/01/2006: version 0.2.4 released
|
||||
24/01/2006: version 0.2.3 released
|
||||
16/01/2006: version 0.2.2 released
|
||||
14/01/2006: version 0.2.1 released
|
||||
11/01/2006: version 0.2.0 released
|
||||
07/01/2006: gui code refactored
|
||||
29/12/2005: version 0.1.2 released
|
||||
28/12/2005: code added on KDE SVN
|
||||
27/12/2005: version 0.1.1 released
|
||||
26/12/2005: version 0.1.0 released
|
@ -0,0 +1,27 @@
|
||||
INCLUDES = -I$(top_srcdir)/keep/common -I$(top_builddir)/keep/common $(all_includes)
|
||||
|
||||
METASOURCES = AUTO
|
||||
|
||||
bin_PROGRAMS = keep
|
||||
keep_SOURCES = main.cpp keepmainwindow.cpp backuplistwidget.cpp\
|
||||
restorebackupwizard.cpp addbackupwizard.cpp\
|
||||
actionview.ui forcebackupdialogview.ui forcebackupdialog.cpp backupconfigdialog.cpp logview.ui logdialog.cpp includeexcludeview.ui includeexcludedialog.cpp\
|
||||
advancedbackupconfigview.ui generalconfigview.ui\
|
||||
advancedbackupconfigdialog.cpp\
|
||||
addbackupwizard1view.ui addbackupwizard2view.ui\
|
||||
addbackupwizard3view.ui restorebackupwizard1view.ui\
|
||||
restorebackupwizard2view.ui restorebackupwizard3view.ui backuplistview.ui
|
||||
keep_LDADD = $(top_builddir)/keep/common/libkeep.la $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_KIO)
|
||||
keep_LDFLAGS = $(KDE_RPATH) $(all_libraries)
|
||||
|
||||
noinst_HEADERS = keepmainwindow.h addbackupwizard.h logdialog.h\
|
||||
restorebackupwizard.h forcebackupdialog.h\
|
||||
backupconfigdialog.h backuplistwidget.h\
|
||||
advancedbackupconfigdialog.h includeexcludedialog.h
|
||||
|
||||
KDE_ICON = keep
|
||||
|
||||
xdg_apps_DATA = keep.desktop
|
||||
|
||||
shellrcdir = $(kde_datadir)/keep
|
||||
shellrc_DATA = keepui.rc
|
@ -0,0 +1,528 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>ActionView</class>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>ActionView</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>454</width>
|
||||
<height>459</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLayoutWidget" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>layout22</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QGroupBox">
|
||||
<property name="name">
|
||||
<cstring>m_grpSystem</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Backup system:</string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLayoutWidget" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>layout21</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout15</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="KPushButton">
|
||||
<property name="name">
|
||||
<cstring>m_btnAddWizard</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>35</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>32767</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KActiveLabel">
|
||||
<property name="name">
|
||||
<cstring>m_lblDispWizard</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><i>Add directory to backup</i></string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout16</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="KPushButton">
|
||||
<property name="name">
|
||||
<cstring>m_btnRestoreWizard</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>35</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>35</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KActiveLabel">
|
||||
<property name="name">
|
||||
<cstring>m_lblDispForce</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><i>Restore a backup</i></string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout17</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="KPushButton">
|
||||
<property name="name">
|
||||
<cstring>m_btnForce</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>35</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>32767</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KActiveLabel">
|
||||
<property name="name">
|
||||
<cstring>m_btnDispClear</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><i>Backup now</i></string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout15</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="KPushButton">
|
||||
<property name="name">
|
||||
<cstring>m_btnBackupConfig</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>35</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>32767</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KActiveLabel">
|
||||
<property name="name">
|
||||
<cstring>m_btnDispClear_2</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><i>Edit backup list</i></string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout15_4</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="KPushButton">
|
||||
<property name="name">
|
||||
<cstring>m_btnLog</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>0</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>35</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>35</width>
|
||||
<height>32767</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string></string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KActiveLabel">
|
||||
<property name="name">
|
||||
<cstring>m_btnDispLog</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>0</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><i>View backup log</i></string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<widget class="QGroupBox">
|
||||
<property name="name">
|
||||
<cstring>m_grpDaemon</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Backup daemon:</string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLayoutWidget" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>layout13</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout5</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="KLed">
|
||||
<property name="name">
|
||||
<cstring>m_ledDaemonState</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>4</hsizetype>
|
||||
<vsizetype>4</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="look">
|
||||
<enum>Flat</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KActiveLabel">
|
||||
<property name="name">
|
||||
<cstring>m_lblDispDaemonState</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Keep daemon state:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KActiveLabel">
|
||||
<property name="name">
|
||||
<cstring>m_lblDaemonState</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><p align="right"><b>unknown</b></p></string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
<widget class="Line">
|
||||
<property name="name">
|
||||
<cstring>line2</cstring>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>HLine</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>Sunken</enum>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout4</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="KPushButton">
|
||||
<property name="name">
|
||||
<cstring>m_btnLoadDaemon</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Load</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KPushButton">
|
||||
<property name="name">
|
||||
<cstring>m_btnUnloadDaemon</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Unload</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KPushButton">
|
||||
<property name="name">
|
||||
<cstring>m_btnReloadDaemon</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Reload</string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
<cstring>spacer1</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>85</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</vbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
</customwidgets>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
<includehints>
|
||||
<includehint>kpushbutton.h</includehint>
|
||||
<includehint>kactivelabel.h</includehint>
|
||||
<includehint>kpushbutton.h</includehint>
|
||||
<includehint>kactivelabel.h</includehint>
|
||||
<includehint>kpushbutton.h</includehint>
|
||||
<includehint>kactivelabel.h</includehint>
|
||||
<includehint>kpushbutton.h</includehint>
|
||||
<includehint>kactivelabel.h</includehint>
|
||||
<includehint>kpushbutton.h</includehint>
|
||||
<includehint>kactivelabel.h</includehint>
|
||||
<includehint>kled.h</includehint>
|
||||
<includehint>kactivelabel.h</includehint>
|
||||
<includehint>kactivelabel.h</includehint>
|
||||
<includehint>kpushbutton.h</includehint>
|
||||
<includehint>kpushbutton.h</includehint>
|
||||
<includehint>kpushbutton.h</includehint>
|
||||
</includehints>
|
||||
</UI>
|
@ -0,0 +1,188 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "addbackupwizard.h"
|
||||
|
||||
#include <qpushbutton.h>
|
||||
#include <kiconloader.h>
|
||||
#include <qcheckbox.h>
|
||||
#include <kurlrequester.h>
|
||||
#include <knuminput.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
AddBackupWizard::AddBackupWizard(QWidget *parent,const char* name): KWizard( parent, name, true)
|
||||
{
|
||||
initView();
|
||||
resize( minimumSizeHint() );
|
||||
|
||||
setNextEnabled(page1,false);
|
||||
setNextEnabled(page2,false);
|
||||
setFinishEnabled(page3, false);
|
||||
|
||||
this->setCaption("Add a backup");
|
||||
|
||||
initConnections();
|
||||
}
|
||||
|
||||
AddBackupWizard::AddBackupWizard(Backup backup,QWidget *parent,const char* name): KWizard( parent, name, true)
|
||||
{
|
||||
initView();
|
||||
|
||||
this->setCaption("Edit backup");
|
||||
|
||||
addBackupWizard1View->source->setURL(backup.source());
|
||||
addBackupWizard1View->useIncludeExclude->setChecked(backup.useIncludeExclude());
|
||||
addBackupWizard2View->dest->setURL(backup.dest());
|
||||
addBackupWizard3View->interval->setValue(backup.interval());
|
||||
addBackupWizard3View->deleteAfter->setValue(backup.deleteAfter());
|
||||
addBackupWizard3View->neverDelete->setChecked(backup.neverDelete());
|
||||
addBackupWizard3View->useCompression->setChecked(backup.useCompression());
|
||||
addBackupWizard3View->excludeSpecialFiles->setChecked(backup.excludeSpecialFiles());
|
||||
addBackupWizard3View->useAdvancedConfig->setChecked(backup.useAdvancedConfig());
|
||||
|
||||
includeExcludeDialog->setIncludeExcludeList(backup.includeExcludeList());
|
||||
advancedBackupConfigDialog->setOptionList(backup.optionList());
|
||||
|
||||
resize( minimumSizeHint() );
|
||||
|
||||
setNextEnabled(page1,true);
|
||||
setNextEnabled(page2,true);
|
||||
setFinishEnabled(page3, true);
|
||||
|
||||
initConnections();
|
||||
}
|
||||
|
||||
void AddBackupWizard::initView()
|
||||
{
|
||||
advancedBackupConfigDialog = new AdvancedBackupConfigDialog(this);
|
||||
includeExcludeDialog = new IncludeExcludeDialog(this);
|
||||
|
||||
KIconLoader icons;
|
||||
this->setIcon( icons.loadIcon( "wizard",KIcon::Small ));
|
||||
|
||||
setupPage1();
|
||||
setupPage2();
|
||||
setupPage3();
|
||||
}
|
||||
|
||||
void AddBackupWizard::initConnections()
|
||||
{
|
||||
connect( addBackupWizard1View->source, SIGNAL( textChanged(const QString&)), this, SLOT( slotPage1Changed() ) );
|
||||
connect( addBackupWizard2View->dest, SIGNAL( textChanged(const QString&)), this, SLOT( slotPage2Changed() ) );
|
||||
connect( addBackupWizard3View->advancedConfig, SIGNAL( clicked()),this,SLOT(slotShowAdvancedConfig()));
|
||||
connect( addBackupWizard1View->includeExclude, SIGNAL( clicked()),this,SLOT(slotShowIncludeExclude()));
|
||||
connect( finishButton(), SIGNAL( clicked()), this, SLOT( slotFinishClicked() ) );
|
||||
}
|
||||
|
||||
void AddBackupWizard::setupPage1()
|
||||
{
|
||||
page1 = new QHBox( this );
|
||||
page1->setSpacing(0);
|
||||
page1->setMargin(0);
|
||||
|
||||
addBackupWizard1View = new AddBackupWizard1View(page1,"addBackupWizard1View");
|
||||
addBackupWizard1View->source->setMode(KFile::Directory);
|
||||
KIconLoader *icons = KGlobal::iconLoader();
|
||||
addBackupWizard1View->includeExclude->setPixmap(icons->loadIcon("configure",KIcon::Toolbar,16));
|
||||
|
||||
addPage( page1, "Directory to backup" );
|
||||
}
|
||||
|
||||
void AddBackupWizard::setupPage2()
|
||||
{
|
||||
page2 = new QHBox( this );
|
||||
page2->setSpacing(0);
|
||||
page2->setMargin(0);
|
||||
|
||||
addBackupWizard2View = new AddBackupWizard2View(page2,"addBackupWizard2View");
|
||||
addBackupWizard2View->dest->setMode(KFile::Directory);
|
||||
|
||||
addPage( page2, "Backup location" );
|
||||
}
|
||||
|
||||
void AddBackupWizard::setupPage3()
|
||||
{
|
||||
page3 = new QHBox( this );
|
||||
page3->setSpacing(0);
|
||||
page3->setMargin(0);
|
||||
|
||||
addBackupWizard3View = new AddBackupWizard3View(page3,"addBackupWizard3View");
|
||||
KIconLoader *icons = KGlobal::iconLoader();
|
||||
addBackupWizard3View->advancedConfig->setPixmap(icons->loadIcon("configure",KIcon::Toolbar,16));
|
||||
|
||||
addPage( page3, "Backup options" );
|
||||
}
|
||||
|
||||
void AddBackupWizard::slotPage1Changed()
|
||||
{
|
||||
setNextEnabled(page1,false);
|
||||
setFinishEnabled(page3,false);
|
||||
if ( addBackupWizard1View->source->url() != "" )
|
||||
{
|
||||
setNextEnabled(page1,true);
|
||||
if ( addBackupWizard2View->dest->url() != "" )
|
||||
setFinishEnabled(page3,true);
|
||||
}
|
||||
}
|
||||
|
||||
void AddBackupWizard::slotPage2Changed()
|
||||
{
|
||||
setNextEnabled(page2,false);
|
||||
setFinishEnabled(page3,false);
|
||||
if ( addBackupWizard2View->dest->url() != "" )
|
||||
{
|
||||
setNextEnabled(page2,true);
|
||||
if ( addBackupWizard1View->source->url() != "" )
|
||||
setFinishEnabled(page3,true);
|
||||
}
|
||||
}
|
||||
|
||||
void AddBackupWizard::slotShowAdvancedConfig()
|
||||
{
|
||||
advancedBackupConfigDialog->show();
|
||||
}
|
||||
|
||||
void AddBackupWizard::slotShowIncludeExclude()
|
||||
{
|
||||
includeExcludeDialog->show();
|
||||
}
|
||||
|
||||
Backup AddBackupWizard::backup()
|
||||
{
|
||||
QString source = addBackupWizard1View->source->url();
|
||||
QString dest = addBackupWizard2View->dest->url();
|
||||
int interval = addBackupWizard3View->interval->value();
|
||||
int deleteAfter = addBackupWizard3View->deleteAfter->value();
|
||||
bool neverDelete = addBackupWizard3View->neverDelete->isChecked();
|
||||
bool useCompression = addBackupWizard3View->useCompression->isChecked();
|
||||
bool excludeSpecialFiles = addBackupWizard3View->excludeSpecialFiles->isChecked();
|
||||
bool useAdvancedConfig = addBackupWizard3View->useAdvancedConfig->isChecked();
|
||||
QStringList optionList = advancedBackupConfigDialog->optionList();
|
||||
bool useIncludeExclude = addBackupWizard1View->useIncludeExclude->isChecked();
|
||||
QStringList includeExcludeList = includeExcludeDialog->includeExcludeList();
|
||||
Backup backup(source,dest,interval,deleteAfter,neverDelete,useCompression,excludeSpecialFiles,useAdvancedConfig,optionList,useIncludeExclude,includeExcludeList);
|
||||
|
||||
return backup;
|
||||
}
|
||||
|
||||
void AddBackupWizard::slotFinishClicked()
|
||||
{
|
||||
emit backupSetted(backup());
|
||||
}
|
||||
|
||||
#include "addbackupwizard.moc"
|
@ -0,0 +1,69 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _ADDBACKUPWIZARD_H_
|
||||
#define _ADDBACKUPWIZARD_H_
|
||||
|
||||
#include <kwizard.h>
|
||||
#include <qhbox.h>
|
||||
|
||||
#include "backup.h"
|
||||
#include "advancedbackupconfigdialog.h"
|
||||
#include "includeexcludedialog.h"
|
||||
#include "addbackupwizard1view.h"
|
||||
#include "addbackupwizard2view.h"
|
||||
#include "addbackupwizard3view.h"
|
||||
|
||||
class AddBackupWizard: public KWizard
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AddBackupWizard(QWidget *parent, const char *name);
|
||||
AddBackupWizard(Backup backup,QWidget *parent, const char *name);
|
||||
|
||||
Backup backup();
|
||||
|
||||
public slots:
|
||||
void slotPage1Changed();
|
||||
void slotPage2Changed();
|
||||
|
||||
void slotShowAdvancedConfig();
|
||||
void slotShowIncludeExclude();
|
||||
void slotFinishClicked();
|
||||
|
||||
signals:
|
||||
void backupSetted(Backup backup);
|
||||
|
||||
private:
|
||||
// init GUI
|
||||
void setupPage1();
|
||||
void setupPage2();
|
||||
void setupPage3();
|
||||
|
||||
void initView();
|
||||
void initConnections();
|
||||
|
||||
QHBox *page1,*page2,*page3;
|
||||
AddBackupWizard1View *addBackupWizard1View;
|
||||
AddBackupWizard2View *addBackupWizard2View;
|
||||
AddBackupWizard3View *addBackupWizard3View;
|
||||
AdvancedBackupConfigDialog *advancedBackupConfigDialog;
|
||||
IncludeExcludeDialog *includeExcludeDialog;
|
||||
};
|
||||
|
||||
#endif
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,92 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "advancedbackupconfigdialog.h"
|
||||
|
||||
#include <klocale.h>
|
||||
#include <qlayout.h>
|
||||
#include <kurl.h>
|
||||
#include <dcopref.h>
|
||||
#include <kdebug.h>
|
||||
#include <kactivelabel.h>
|
||||
#include <kmimetype.h>
|
||||
#include <qpixmap.h>
|
||||
#include <kapplication.h>
|
||||
#include <kiconloader.h>
|
||||
#include <qstringlist.h>
|
||||
#include <kactionselector.h>
|
||||
|
||||
AdvancedBackupConfigDialog::AdvancedBackupConfigDialog(QWidget *parent):KDialogBase(Plain, i18n("Advanced Backup Configuration"),
|
||||
Help|Ok, Ok, parent, "advancedBackupConfigDialog", true, false)
|
||||
{
|
||||
QGridLayout *topLayout = new QGridLayout(plainPage());
|
||||
m_advancedBackupConfigView = new AdvancedBackupConfigView(plainPage());
|
||||
|
||||
topLayout->addWidget( m_advancedBackupConfigView,0,0 );
|
||||
m_advancedBackupConfigView->optionList->availableListBox()->insertStringList(allOptionList());
|
||||
resize( QSize(350,450).expandedTo(minimumSizeHint()) );
|
||||
}
|
||||
|
||||
QStringList AdvancedBackupConfigDialog::optionList()
|
||||
{
|
||||
QStringList options;
|
||||
for (uint i=0;i<m_advancedBackupConfigView->optionList->selectedListBox()->count();i++)
|
||||
{
|
||||
options.append(m_advancedBackupConfigView->optionList->selectedListBox()->text(i));
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
void AdvancedBackupConfigDialog::setOptionList(QStringList optionList)
|
||||
{
|
||||
QStringList alloptions = allOptionList();
|
||||
QStringList available;
|
||||
for ( QStringList::Iterator it = alloptions.begin(); it != alloptions.end(); ++it )
|
||||
{
|
||||
if ( optionList.grep(*it).size() == 0 )
|
||||
{
|
||||
available.append(*it);
|
||||
}
|
||||
}
|
||||
m_advancedBackupConfigView->optionList->availableListBox()->clear();
|
||||
m_advancedBackupConfigView->optionList->availableListBox()->insertStringList(available);
|
||||
m_advancedBackupConfigView->optionList->selectedListBox()->clear();
|
||||
m_advancedBackupConfigView->optionList->selectedListBox()->insertStringList(optionList);
|
||||
}
|
||||
|
||||
QStringList AdvancedBackupConfigDialog::allOptionList()
|
||||
{
|
||||
QStringList options;
|
||||
options.append("--no-hard-links");
|
||||
options.append("--exclude-special-files");
|
||||
options.append("--exclude-device-files");
|
||||
options.append("--exclude-fifos");
|
||||
options.append("--exclude-symbolic-links");
|
||||
options.append("--exclude-sockets");
|
||||
options.append("--never-drop-acls");
|
||||
options.append("--no-compare-inode");
|
||||
options.append("--no-file-statistics");
|
||||
options.append("--preserve-numerical-ids");
|
||||
options.append("--ssh-no-compression");
|
||||
options.append("--no-compression");
|
||||
options.append("--include-special-files");
|
||||
options.append("--include-symbolic-links");
|
||||
return options;
|
||||
}
|
||||
|
||||
#include "advancedbackupconfigdialog.moc"
|
@ -0,0 +1,43 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _ADVANCEDBACKUPCONFIGDIALOG_H_
|
||||
#define _ADVANCEDBACKUPCONFIGDIALOG_H_
|
||||
|
||||
#include <kdialogbase.h>
|
||||
|
||||
#include "advancedbackupconfigview.h"
|
||||
|
||||
class AdvancedBackupConfigDialog: public KDialogBase
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AdvancedBackupConfigDialog(QWidget *parent);
|
||||
~AdvancedBackupConfigDialog() {};
|
||||
|
||||
QStringList optionList();
|
||||
void setOptionList(QStringList optionList);
|
||||
|
||||
private:
|
||||
QStringList allOptionList();
|
||||
AdvancedBackupConfigView *m_advancedBackupConfigView;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,90 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>AdvancedBackupConfigView</class>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>AdvancedBackupConfigView</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>401</width>
|
||||
<height>449</height>
|
||||
</rect>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QLayoutWidget" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>layout3</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="KActiveLabel">
|
||||
<property name="name">
|
||||
<cstring>kActiveLabel1</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Choose the options you want to use during the backup process:</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Line">
|
||||
<property name="name">
|
||||
<cstring>line1</cstring>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>HLine</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>Sunken</enum>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KActionSelector">
|
||||
<property name="name">
|
||||
<cstring>optionList</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>7</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
</customwidgets>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
<includehints>
|
||||
<includehint>kactivelabel.h</includehint>
|
||||
<includehint>kactionselector.h</includehint>
|
||||
</includehints>
|
||||
</UI>
|
@ -0,0 +1,68 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "backupconfigdialog.h"
|
||||
|
||||
#include <klocale.h>
|
||||
#include <qlayout.h>
|
||||
#include <kurl.h>
|
||||
#include <dcopref.h>
|
||||
#include <kdebug.h>
|
||||
#include <kactivelabel.h>
|
||||
#include <kmimetype.h>
|
||||
#include <qpixmap.h>
|
||||
#include <kcombobox.h>
|
||||
#include <klineedit.h>
|
||||
#include <kprogress.h>
|
||||
#include <qlabel.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <qcheckbox.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <kapplication.h>
|
||||
#include <kiconloader.h>
|
||||
#include <qvaluelist.h>
|
||||
|
||||
#include "backupconfig.h"
|
||||
|
||||
BackupConfigDialog::BackupConfigDialog(QWidget *parent):KDialogBase(Plain, i18n("Configure backups"),
|
||||
Help|Cancel|Ok, Cancel, parent, "configBackups", true, false)
|
||||
{
|
||||
KIconLoader *icons = KGlobal::iconLoader();
|
||||
|
||||
|
||||
QFrame *page = plainPage();
|
||||
QVBoxLayout *topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
|
||||
m_backupListWidget = new BackupListWidget(page,"backupListWidget");
|
||||
topLayout->addWidget( m_backupListWidget );
|
||||
setMainWidget(page);
|
||||
|
||||
connect( this, SIGNAL( okClicked()),this, SLOT(saveSettings()));
|
||||
}
|
||||
|
||||
void BackupConfigDialog::saveSettings()
|
||||
{
|
||||
m_backupListWidget->slotSaveSettings();
|
||||
}
|
||||
|
||||
void BackupConfigDialog::readSettings()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#include "backupconfigdialog.moc"
|
@ -0,0 +1,44 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _BACKUPCONFIGDIALOG_H_
|
||||
#define _BACKUPCONFIGDIALOG_H_
|
||||
|
||||
#include <kdialogbase.h>
|
||||
|
||||
#include "backuplistwidget.h"
|
||||
|
||||
class BackupConfigDialog: public KDialogBase
|
||||
{
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
BackupConfigDialog(QWidget *parent);
|
||||
~BackupConfigDialog() {};
|
||||
|
||||
public slots:
|
||||
void readSettings();
|
||||
void saveSettings();
|
||||
|
||||
private:
|
||||
BackupListWidget *m_backupListWidget;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,157 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>BackupListView</class>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>BackupListView</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>545</width>
|
||||
<height>619</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QLayoutWidget" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>layout4</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="KListView">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Source</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Destination</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Backup Interval</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Delete After</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<property name="name">
|
||||
<cstring>m_lstBackup</cstring>
|
||||
</property>
|
||||
<property name="resizeMode">
|
||||
<enum>LastColumn</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout3</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="KPushButton">
|
||||
<property name="name">
|
||||
<cstring>m_btnAdd</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KPushButton">
|
||||
<property name="name">
|
||||
<cstring>m_btnEdit</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Edit</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KPushButton">
|
||||
<property name="name">
|
||||
<cstring>m_btnRemove</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
<cstring>spacer1</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>480</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</vbox>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
</customwidgets>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
<includehints>
|
||||
<includehint>klistview.h</includehint>
|
||||
<includehint>kpushbutton.h</includehint>
|
||||
<includehint>kpushbutton.h</includehint>
|
||||
<includehint>kpushbutton.h</includehint>
|
||||
</includehints>
|
||||
</UI>
|
@ -0,0 +1,114 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2006 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "backuplistwidget.h"
|
||||
|
||||
#include <qpushbutton.h>
|
||||
#include <klistbox.h>
|
||||
#include <qstringlist.h>
|
||||
#include <kurlrequester.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
#include "backuplistviewitem.h"
|
||||
#include "listviewtooltip.h"
|
||||
#include "addbackupwizard.h"
|
||||
#include "backupconfig.h"
|
||||
|
||||
BackupListWidget::BackupListWidget(QWidget *parent,char *name): BackupListView(parent,name)
|
||||
{
|
||||
QToolTip::remove(m_lstBackup);
|
||||
new ListViewToolTip(m_lstBackup);
|
||||
slotReadSettings();
|
||||
|
||||
connect( m_btnAdd, SIGNAL( clicked()), this, SLOT( slotAddClicked() ) );
|
||||
connect( m_btnRemove, SIGNAL( clicked()), this, SLOT( slotRemoveClicked() ) );
|
||||
connect( m_btnEdit, SIGNAL( clicked()), this, SLOT( slotEditClicked() ) );
|
||||
}
|
||||
|
||||
BackupListWidget::~BackupListWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void BackupListWidget::slotReadSettings()
|
||||
{
|
||||
m_lstBackup->clear();
|
||||
BackupConfig *backupConfig = new BackupConfig();
|
||||
QValueList<Backup> backupList = backupConfig->backupList();
|
||||
QValueList<Backup>::iterator it;
|
||||
for ( it = backupList.begin(); it != backupList.end(); ++it )
|
||||
{
|
||||
BackupListViewItem *item = new BackupListViewItem(m_lstBackup,*it);
|
||||
}
|
||||
delete backupConfig;
|
||||
}
|
||||
|
||||
void BackupListWidget::slotSaveSettings()
|
||||
{
|
||||
QValueList<Backup> backupList;
|
||||
QListViewItemIterator it( m_lstBackup );
|
||||
while ( it.current() ) {
|
||||
QListViewItem *item = it.current();
|
||||
BackupListViewItem *backupItem = static_cast<BackupListViewItem*>(item);
|
||||
backupList.append(backupItem->backup());
|
||||
++it;
|
||||
}
|
||||
BackupConfig *backupConfig = new BackupConfig();
|
||||
backupConfig->setBackupList(backupList);
|
||||
delete backupConfig;
|
||||
}
|
||||
|
||||
void BackupListWidget::slotAddClicked()
|
||||
{
|
||||
AddBackupWizard *wizard = new AddBackupWizard(this,"addBackupWizard");
|
||||
connect(wizard,SIGNAL(backupSetted(Backup) ), this, SLOT(slotAddBackup(Backup)));
|
||||
wizard->show();
|
||||
}
|
||||
|
||||
void BackupListWidget::slotEditClicked()
|
||||
{
|
||||
QListViewItem *item = m_lstBackup->currentItem();
|
||||
if ( item )
|
||||
{
|
||||
BackupListViewItem *backupItem = static_cast<BackupListViewItem*>(item);
|
||||
AddBackupWizard *wizard = new AddBackupWizard(backupItem->backup(),this,"addBackupWizard");
|
||||
connect(wizard,SIGNAL(backupSetted(Backup) ), this, SLOT(slotUpdateBackup(Backup)));
|
||||
wizard->show();
|
||||
}
|
||||
}
|
||||
|
||||
void BackupListWidget::slotRemoveClicked()
|
||||
{
|
||||
m_lstBackup->removeItem(m_lstBackup->currentItem());
|
||||
}
|
||||
|
||||
void BackupListWidget::slotAddBackup(Backup backup)
|
||||
{
|
||||
BackupListViewItem *item = new BackupListViewItem(m_lstBackup,backup);
|
||||
}
|
||||
|
||||
void BackupListWidget::slotUpdateBackup(Backup backup)
|
||||
{
|
||||
QListViewItem *item = m_lstBackup->currentItem();
|
||||
if ( item )
|
||||
{
|
||||
BackupListViewItem *backupItem = static_cast<BackupListViewItem*>(item);
|
||||
backupItem->setBackup(backup);
|
||||
}
|
||||
}
|
||||
|
||||
#include "backuplistwidget.moc"
|
@ -0,0 +1,43 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _BACKUPLISTWIDGET_H_
|
||||
#define _BACKUPLISTWIDGET_H_
|
||||
|
||||
#include "backuplistview.h"
|
||||
#include "backup.h"
|
||||
|
||||
class BackupListWidget: public BackupListView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BackupListWidget(QWidget *parent, char *name);
|
||||
~BackupListWidget();
|
||||
|
||||
public slots:
|
||||
void slotReadSettings();
|
||||
void slotSaveSettings();
|
||||
void slotAddClicked();
|
||||
void slotRemoveClicked();
|
||||
void slotEditClicked();
|
||||
void slotAddBackup(Backup backup);
|
||||
void slotUpdateBackup(Backup backup);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,99 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "forcebackupdialog.h"
|
||||
|
||||
#include <klocale.h>
|
||||
#include <qlayout.h>
|
||||
#include <kurl.h>
|
||||
#include <dcopref.h>
|
||||
#include <kdebug.h>
|
||||
#include <kactivelabel.h>
|
||||
#include <kmimetype.h>
|
||||
#include <qpixmap.h>
|
||||
#include <kcombobox.h>
|
||||
#include <klineedit.h>
|
||||
#include <kprogress.h>
|
||||
#include <qlabel.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <qcheckbox.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <kapplication.h>
|
||||
#include <kiconloader.h>
|
||||
#include <qvaluelist.h>
|
||||
#include <kmessagebox.h>
|
||||
|
||||
#include "backupconfig.h"
|
||||
#include "backuplistviewitem.h"
|
||||
|
||||
ForceBackupDialog::ForceBackupDialog(QWidget *parent):KDialogBase(Plain, i18n("Backup now"),
|
||||
Help|Cancel|Ok, Cancel, parent, "forceBackupDialog", true, false)
|
||||
{
|
||||
QGridLayout* toplayout = new QGridLayout(plainPage());
|
||||
m_view = new ForceBackupDialogView(plainPage());
|
||||
toplayout->addWidget(m_view,0,0);
|
||||
|
||||
loadBackupList();
|
||||
|
||||
m_manager = new RDBManager();
|
||||
connect( m_manager, SIGNAL(backupError(Backup,QString)), this, SLOT(slotBackupError(Backup,QString)) );
|
||||
|
||||
connect( this, SIGNAL(okClicked()), this, SLOT(slotForceBackup()));
|
||||
}
|
||||
|
||||
ForceBackupDialog::~ForceBackupDialog()
|
||||
{
|
||||
delete m_manager;
|
||||
}
|
||||
|
||||
void ForceBackupDialog::loadBackupList()
|
||||
{
|
||||
BackupConfig backupConfig;
|
||||
QValueList<Backup> backupList = backupConfig.backupList();
|
||||
QValueList<Backup>::iterator it;
|
||||
for ( it = backupList.begin(); it != backupList.end(); ++it )
|
||||
{
|
||||
new BackupListViewItem(m_view->m_lstBackup,*it);
|
||||
}
|
||||
}
|
||||
|
||||
void ForceBackupDialog::slotForceBackup()
|
||||
{
|
||||
QValueList<Backup> backupList;
|
||||
QListViewItemIterator it( m_view->m_lstBackup );
|
||||
while ( it.current() )
|
||||
{
|
||||
QListViewItem *item = it.current();
|
||||
if ( item->isSelected() )
|
||||
{
|
||||
BackupListViewItem *backupItem = static_cast<BackupListViewItem*>(item);
|
||||
backupList.append(backupItem->backup());
|
||||
}
|
||||
++it;
|
||||
}
|
||||
RDBManager *manager;
|
||||
m_manager->slotForceBackup(backupList);
|
||||
}
|
||||
|
||||
void ForceBackupDialog::slotBackupError(Backup backup,QString errorMessage)
|
||||
{
|
||||
KMessageBox::error(this,i18n("<p><b>An error occured making %1 backup:</b></p><p>%2</p>").arg(backup.source()).arg(errorMessage));
|
||||
}
|
||||
|
||||
#include "forcebackupdialog.moc"
|
@ -0,0 +1,48 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _FORCEBACKUPDIALOG_H_
|
||||
#define _FORCEBACKUPDIALOG_H_
|
||||
|
||||
#include <kdialogbase.h>
|
||||
|
||||
#include "forcebackupdialogview.h"
|
||||
#include "rdbmanager.h"
|
||||
#include "backup.h"
|
||||
|
||||
class ForceBackupDialog: public KDialogBase
|
||||
{
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ForceBackupDialog(QWidget *parent);
|
||||
~ForceBackupDialog();
|
||||
|
||||
public slots:
|
||||
void slotForceBackup();
|
||||
void slotBackupError(Backup backup,QString errorMessage);
|
||||
|
||||
private:
|
||||
void loadBackupList();
|
||||
ForceBackupDialogView * m_view;
|
||||
RDBManager *m_manager;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,129 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>ForceBackupDialogView</class>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>ForceBackupDialogView</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>543</width>
|
||||
<height>354</height>
|
||||
</rect>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QLayoutWidget" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>layout21</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="KActiveLabel">
|
||||
<property name="name">
|
||||
<cstring>kActiveLabel6</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Select the sources to backup now.</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Line">
|
||||
<property name="name">
|
||||
<cstring>line1</cstring>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>HLine</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>Sunken</enum>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KListView">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Source</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Destination</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Backup Interval</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Delete After</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<property name="name">
|
||||
<cstring>m_lstBackup</cstring>
|
||||
</property>
|
||||
<property name="selectionMode" stdset="0">
|
||||
<enum>Multi</enum>
|
||||
</property>
|
||||
<property name="resizeMode">
|
||||
<enum>LastColumn</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
</customwidgets>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
<includehints>
|
||||
<includehint>kactivelabel.h</includehint>
|
||||
<includehint>klistview.h</includehint>
|
||||
</includehints>
|
||||
</UI>
|
@ -0,0 +1,175 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>GeneralConfigView</class>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>GeneralConfigView</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>348</width>
|
||||
<height>415</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="caption">
|
||||
<string>GeneralConfigView</string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLayoutWidget" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>layout6</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QGroupBox">
|
||||
<property name="name">
|
||||
<cstring>groupBox4</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Notifications</string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLayoutWidget" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>layout7</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>kcfg_NotifyBackupError</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Notify backup error</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>kcfg_NotifyBackupSuccess</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Notify backup success</string>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<widget class="QGroupBox">
|
||||
<property name="name">
|
||||
<cstring>groupBox4_2</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Rdiff-backup priority</string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLayoutWidget" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>layout5</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>kcfg_ControlRDBPriority</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Control rdiff-backup priority</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout4</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="KIntNumInput">
|
||||
<property name="name">
|
||||
<cstring>kcfg_RDBPriority</cstring>
|
||||
</property>
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minValue">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maxValue">
|
||||
<number>20</number>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KActiveLabel">
|
||||
<property name="name">
|
||||
<cstring>lab_RDBPriority</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Rdiff-backup niceness</string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
<cstring>spacer4</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>120</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</vbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>kcfg_ControlRDBPriority</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>kcfg_RDBPriority</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
</connection>
|
||||
</connections>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
<includehints>
|
||||
<includehint>knuminput.h</includehint>
|
||||
<includehint>knuminput.h</includehint>
|
||||
<includehint>kactivelabel.h</includehint>
|
||||
</includehints>
|
||||
</UI>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,106 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2006 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "includeexcludedialog.h"
|
||||
|
||||
#include <klocale.h>
|
||||
#include <qlayout.h>
|
||||
#include <kurl.h>
|
||||
#include <dcopref.h>
|
||||
#include <kdebug.h>
|
||||
#include <kactivelabel.h>
|
||||
#include <kmimetype.h>
|
||||
#include <qpixmap.h>
|
||||
#include <kapplication.h>
|
||||
#include <kpushbutton.h>
|
||||
#include <kiconloader.h>
|
||||
#include <qstringlist.h>
|
||||
#include <kactionselector.h>
|
||||
#include <klistview.h>
|
||||
#include <kurlrequester.h>
|
||||
|
||||
#include "includeexcludeitem.h"
|
||||
|
||||
IncludeExcludeDialog::IncludeExcludeDialog(QWidget *parent):KDialogBase(Plain, i18n("Inclusion/Exclusion Configuration"),
|
||||
Help|Ok, Ok, parent, "includeExcludeDialog", true, false)
|
||||
{
|
||||
QGridLayout *topLayout = new QGridLayout(plainPage());
|
||||
m_view = new IncludeExcludeView(plainPage());
|
||||
|
||||
topLayout->addWidget( m_view,0,0 );
|
||||
|
||||
KIconLoader *icons = KGlobal::iconLoader();
|
||||
m_view->remove->setPixmap(icons->loadIcon("remove",KIcon::Toolbar,22));
|
||||
|
||||
m_view->includeExcludeList->setSorting(-1);
|
||||
|
||||
connect(m_view->include,SIGNAL(clicked()),this,SLOT(slotInclude()));
|
||||
connect(m_view->exclude,SIGNAL(clicked()),this,SLOT(slotExclude()));
|
||||
connect(m_view->remove,SIGNAL(clicked()),this,SLOT(slotRemove()));
|
||||
|
||||
resize( QSize(450,450).expandedTo(minimumSizeHint()) );
|
||||
}
|
||||
|
||||
QStringList IncludeExcludeDialog::includeExcludeList()
|
||||
{
|
||||
QStringList includeExcludeList;
|
||||
QListViewItemIterator it( m_view->includeExcludeList );
|
||||
while ( it.current() ) {
|
||||
QListViewItem *item = it.current();
|
||||
IncludeExcludeItem *includeExcludeItem = static_cast<IncludeExcludeItem*>(item);
|
||||
includeExcludeList.append(includeExcludeItem->includeExclude());
|
||||
++it;
|
||||
}
|
||||
return includeExcludeList;
|
||||
}
|
||||
|
||||
void IncludeExcludeDialog::setIncludeExcludeList(QStringList includeExcludeList)
|
||||
{
|
||||
m_view->includeExcludeList->clear();
|
||||
QStringList::iterator it;
|
||||
IncludeExcludeItem *lastItem;
|
||||
for ( it = includeExcludeList.begin(); it != includeExcludeList.end(); ++it )
|
||||
{
|
||||
if ( it == includeExcludeList.begin() )
|
||||
lastItem = new IncludeExcludeItem(m_view->includeExcludeList,*it);
|
||||
else
|
||||
{
|
||||
IncludeExcludeItem *item = new IncludeExcludeItem(m_view->includeExcludeList,lastItem,*it);
|
||||
lastItem = item;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void IncludeExcludeDialog::slotInclude()
|
||||
{
|
||||
IncludeExcludeItem *item = new IncludeExcludeItem( m_view->includeExcludeList,"I" + m_view->itemURL->url() );
|
||||
}
|
||||
|
||||
void IncludeExcludeDialog::slotExclude()
|
||||
{
|
||||
IncludeExcludeItem *item = new IncludeExcludeItem( m_view->includeExcludeList,"E" + m_view->itemURL->url() );
|
||||
}
|
||||
|
||||
|
||||
void IncludeExcludeDialog::slotRemove()
|
||||
{
|
||||
m_view->includeExcludeList->takeItem(m_view->includeExcludeList->selectedItem());
|
||||
}
|
||||
|
||||
#include "includeexcludedialog.moc"
|
@ -0,0 +1,48 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2006 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _INCLUDEEXCLUDEDIALOG_H_
|
||||
#define _INCLUDEEXCLUDEDIALOG_H_
|
||||
|
||||
#include <kdialogbase.h>
|
||||
#include <kpopupmenu.h>
|
||||
|
||||
#include "includeexcludeview.h"
|
||||
|
||||
class IncludeExcludeDialog: public KDialogBase
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
IncludeExcludeDialog(QWidget *parent);
|
||||
~IncludeExcludeDialog() {};
|
||||
|
||||
QStringList includeExcludeList();
|
||||
void setIncludeExcludeList(QStringList includeExcludeList);
|
||||
|
||||
public slots:
|
||||
void slotInclude();
|
||||
void slotExclude();
|
||||
void slotRemove();
|
||||
|
||||
private:
|
||||
IncludeExcludeView *m_view;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,216 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>IncludeExcludeView</class>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>IncludeExcludeView</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>532</width>
|
||||
<height>589</height>
|
||||
</rect>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QLayoutWidget" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>layout6</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="KActiveLabel">
|
||||
<property name="name">
|
||||
<cstring>kActiveLabel1</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Select the files/directories you want to include/exclude. You can use * (wildcard) generic character. You can drag and drop the items to tune the priority order.</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KURLRequester">
|
||||
<property name="name">
|
||||
<cstring>itemURL</cstring>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>7</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout18</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
<cstring>spacer5</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>61</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<widget class="KPushButton">
|
||||
<property name="name">
|
||||
<cstring>include</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Include</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="KPushButton">
|
||||
<property name="name">
|
||||
<cstring>exclude</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Exclude</string>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
<widget class="QGroupBox">
|
||||
<property name="name">
|
||||
<cstring>groupBox3</cstring>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Include/Exclude list:</string>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLayoutWidget" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>layout7</cstring>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="KListView">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Item</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Action</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<property name="name">
|
||||
<cstring>includeExcludeList</cstring>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizeMode">
|
||||
<enum>LastColumn</enum>
|
||||
</property>
|
||||
<property name="dragEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>layout3</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="KPushButton">
|
||||
<property name="name">
|
||||
<cstring>remove</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
<cstring>spacer2</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>121</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</vbox>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
</customwidgets>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
<includehints>
|
||||
<includehint>kactivelabel.h</includehint>
|
||||
<includehint>kurlrequester.h</includehint>
|
||||
<includehint>klineedit.h</includehint>
|
||||
<includehint>kpushbutton.h</includehint>
|
||||
<includehint>kpushbutton.h</includehint>
|
||||
<includehint>kpushbutton.h</includehint>
|
||||
<includehint>klistview.h</includehint>
|
||||
<includehint>kpushbutton.h</includehint>
|
||||
</includehints>
|
||||
</UI>
|
@ -0,0 +1,39 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Exec=keep
|
||||
Icon=keep
|
||||
GenericName=Backup System
|
||||
GenericName[bg]=Резервен копие на системата
|
||||
GenericName[br]=Gwareziñ ar reizhiad
|
||||
GenericName[cs]=Zálohování systému
|
||||
GenericName[cy]=System cadw wrth gefn
|
||||
GenericName[da]=Sikkerhedskopieringssystem
|
||||
GenericName[de]=Datensicherungssystem
|
||||
GenericName[el]=Σύστημα λήψης αντιγράφων ασφαλείας
|
||||
GenericName[es]=Sistema de copia de seguridad
|
||||
GenericName[et]=Varundamissüsteem
|
||||
GenericName[fr]=Sauvegarde du système
|
||||
GenericName[ga]=Córas Cúltaca
|
||||
GenericName[gl]=Sistema de Cópias de Seguridade
|
||||
GenericName[it]=Sistema copia di sicurezza
|
||||
GenericName[ja]=バックアップシステム
|
||||
GenericName[ka]=სისტემის სარეზერვო ასლი
|
||||
GenericName[lt]=Atsarginių kopijų programa
|
||||
GenericName[nl]=Backupsysteem
|
||||
GenericName[pl]=Narzędzie do kopii zapasowych
|
||||
GenericName[pt]=Sistema de Cópias de Segurança
|
||||
GenericName[sk]=Zálohovací systém
|
||||
GenericName[sr]=Систем за архивирање
|
||||
GenericName[sr@Latn]=Sistem za arhiviranje
|
||||
GenericName[sv]=Säkerhetskopieringssystem
|
||||
GenericName[xx]=xxBackup Systemxx
|
||||
Terminal=false
|
||||
Name=Keep
|
||||
Name[cy]=Cadw
|
||||
Name[fr]=Keep
|
||||
Name[ka]=დატოვება
|
||||
Name[lt]=Nekeisti
|
||||
Name[xx]=xxKeepxx
|
||||
X-DCOP-ServiceType=Unique
|
||||
Categories=Qt;KDE;Application;System;
|
||||
Encoding=UTF-8
|
@ -0,0 +1,283 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "keepmainwindow.h"
|
||||
|
||||
#include <qcolor.h>
|
||||
#include <qlayout.h>
|
||||
#include <qvariant.h>
|
||||
#include <dcopclient.h>
|
||||
#include <kactioncollection.h>
|
||||
#include <kstdaction.h>
|
||||
#include <kdebug.h>
|
||||
#include <klocale.h>
|
||||
#include <kactivelabel.h>
|
||||
#include <kapp.h>
|
||||
#include <kled.h>
|
||||
#include <kpushbutton.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <kiconloader.h>
|
||||
#include <kconfigdialog.h>
|
||||
|
||||
#include "backupconfig.h"
|
||||
#include "addbackupwizard.h"
|
||||
#include "restorebackupwizard.h"
|
||||
#include "forcebackupdialog.h"
|
||||
#include "backupconfigdialog.h"
|
||||
#include "generalconfigview.h"
|
||||
#include "rdbmanager.h"
|
||||
#include "keepsettings.h"
|
||||
#include "logdialog.h"
|
||||
|
||||
KeepMainWindow::KeepMainWindow(QWidget *parent, const char *name): KMainWindow(parent,name)
|
||||
{
|
||||
setCaption(i18n("Backup System"));
|
||||
|
||||
m_actionView = new ActionView(this);
|
||||
KIconLoader *icons = KGlobal::iconLoader();
|
||||
m_actionView->m_btnAddWizard->setPixmap(icons->loadIcon("add_backup",KIcon::Toolbar,32));
|
||||
m_actionView->m_btnRestoreWizard->setPixmap(icons->loadIcon("restore_dir",KIcon::Toolbar,32));
|
||||
m_actionView->m_btnForce->setPixmap(icons->loadIcon("force_backup",KIcon::Toolbar,32));
|
||||
m_actionView->m_btnBackupConfig->setPixmap(icons->loadIcon("configure",KIcon::Toolbar,32));
|
||||
m_actionView->m_btnLog->setPixmap(icons->loadIcon("log",KIcon::Toolbar,32));
|
||||
|
||||
slotRefreshGUI();
|
||||
|
||||
setCentralWidget(m_actionView);
|
||||
|
||||
initActions();
|
||||
initConnections();
|
||||
|
||||
resize( minimumSizeHint() );
|
||||
|
||||
createGUI(0L);
|
||||
|
||||
RDBManager manager;
|
||||
if ( !manager.isRDB() )
|
||||
slotCheckRDB();
|
||||
}
|
||||
|
||||
KeepMainWindow::~KeepMainWindow()
|
||||
{
|
||||
}
|
||||
|
||||
void KeepMainWindow::initActions()
|
||||
{
|
||||
KStdAction::quit(this, SLOT(close()), actionCollection());
|
||||
new KAction( i18n("Check rdiff-backup"), "info", "", this, SLOT(slotCheckRDB()), actionCollection(), "check_rdiff-backup" );
|
||||
new KAction( i18n("Configure backups"), "configure", "", this, SLOT(slotConfigureBackup()), actionCollection(), "configure_backups" );
|
||||
new KAction( i18n("Configure"), "configure", "", this, SLOT(slotConfigure()), actionCollection(), "configure_keep" );
|
||||
new KAction( i18n("Add Backup"), "add_backup", "", this, SLOT(slotAddBackupWizard()), actionCollection(), "add_backup" );
|
||||
new KAction( i18n("Restore Backup"), "restore_dir", "", this, SLOT(slotRestoreBackupWizard()), actionCollection(), "restore_backup" );
|
||||
new KAction( i18n("Backup Now"), "force_backup", "", this, SLOT(slotForceBackup()), actionCollection(), "force_backup" );
|
||||
new KAction( i18n("View log"), "log", "", this, SLOT(slotViewLog()), actionCollection(), "view_log");
|
||||
}
|
||||
|
||||
void KeepMainWindow::initConnections()
|
||||
{
|
||||
connect( m_actionView->m_btnAddWizard, SIGNAL( clicked()), this, SLOT( slotAddBackupWizard() ) );
|
||||
connect( m_actionView->m_btnRestoreWizard, SIGNAL( clicked()), this, SLOT( slotRestoreBackupWizard() ) );
|
||||
connect( m_actionView->m_btnForce, SIGNAL( clicked()), this, SLOT( slotForceBackup() ) );
|
||||
connect( m_actionView->m_btnBackupConfig, SIGNAL( clicked()), this, SLOT( slotConfigureBackup() ) );
|
||||
connect( m_actionView->m_btnLog, SIGNAL( clicked()), this, SLOT( slotViewLog() ) );
|
||||
connect( m_actionView->m_btnLoadDaemon, SIGNAL( clicked()), this, SLOT( slotLoadDaemon() ) );
|
||||
connect( m_actionView->m_btnUnloadDaemon, SIGNAL( clicked()), this, SLOT( slotUnloadDaemon() ) );
|
||||
connect( m_actionView->m_btnReloadDaemon, SIGNAL( clicked()), this, SLOT( slotReloadDaemon() ) );
|
||||
}
|
||||
|
||||
void KeepMainWindow::slotRefreshGUI()
|
||||
{
|
||||
// Sets the Keep Daemon (KDED) State
|
||||
if ( backupSystemRunning() )
|
||||
{
|
||||
m_actionView->m_lblDaemonState->setText(i18n("<p align=\"right\"><b>Ok</b></p>"));
|
||||
m_actionView->m_btnLoadDaemon->setEnabled(false);
|
||||
m_actionView->m_btnUnloadDaemon->setEnabled(true);
|
||||
m_actionView->m_btnReloadDaemon->setEnabled(true);
|
||||
slotDaemonAlertState(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_actionView->m_lblDaemonState->setText(i18n("<p align=\"right\"><b>Not Running</b></p>"));
|
||||
m_actionView->m_btnLoadDaemon->setEnabled(true);
|
||||
m_actionView->m_btnUnloadDaemon->setEnabled(false);
|
||||
m_actionView->m_btnReloadDaemon->setEnabled(false);
|
||||
slotDaemonAlertState(true);
|
||||
}
|
||||
}
|
||||
|
||||
void KeepMainWindow::slotCheckRDB()
|
||||
{
|
||||
RDBManager manager;
|
||||
if ( manager.isRDB() )
|
||||
KMessageBox::information(this, i18n("<b>The application rdiff-backup has been detected on your system.</b><br><br> You're running version %1 of rdiff-backup.").arg(manager.RDBVersion()));
|
||||
else
|
||||
KMessageBox::error(this,i18n("<b>The application rdiff-backup has not been detected on your system.</b><br><br>If rdiff-backup is not installed, Keep will not be able to make backups. To fix this problem, install rdiff-backup on your system."));
|
||||
|
||||
}
|
||||
|
||||
void KeepMainWindow::slotForceBackup()
|
||||
{
|
||||
ForceBackupDialog *force = new ForceBackupDialog(this);
|
||||
force->show();
|
||||
}
|
||||
|
||||
void KeepMainWindow::slotViewLog()
|
||||
{
|
||||
LogDialog *logDialog = new LogDialog(this);
|
||||
logDialog->show();
|
||||
}
|
||||
|
||||
void KeepMainWindow::slotConfigureBackup()
|
||||
{
|
||||
BackupConfigDialog *backupConfig = new BackupConfigDialog(this);
|
||||
backupConfig->show();
|
||||
}
|
||||
|
||||
void KeepMainWindow::slotConfigure()
|
||||
{
|
||||
//An instance of your dialog could be already created and could be cached,
|
||||
//in which case you want to display the cached dialog instead of creating
|
||||
//another one
|
||||
if ( KConfigDialog::showDialog( "settings" ) )
|
||||
return;
|
||||
|
||||
//KConfigDialog didn't find an instance of this dialog, so lets create it :
|
||||
KConfigDialog* dialog = new KConfigDialog( this, "settings", KeepSettings::self() );
|
||||
GeneralConfigView* generalConfigView = new GeneralConfigView( 0, "generalConfigView" );
|
||||
|
||||
dialog->addPage( generalConfigView, i18n("General"), "general" );
|
||||
|
||||
dialog->show();
|
||||
}
|
||||
|
||||
void KeepMainWindow::slotAddBackupWizard()
|
||||
{
|
||||
AddBackupWizard *addBackupWizard = new AddBackupWizard(this, "addBackupWizard");
|
||||
connect( addBackupWizard, SIGNAL( backupSetted(Backup)), this, SLOT( slotAddBackup(Backup) ) );
|
||||
addBackupWizard->show();
|
||||
}
|
||||
|
||||
void KeepMainWindow::slotAddBackup(Backup backup)
|
||||
{
|
||||
BackupConfig *backupConfig = new BackupConfig();
|
||||
backupConfig->addBackup(backup);
|
||||
delete backupConfig;
|
||||
}
|
||||
|
||||
void KeepMainWindow::slotRestoreBackupWizard()
|
||||
{
|
||||
RestoreBackupWizard *restoreBackupWizard = new RestoreBackupWizard(this, "restoreBackupWizard");
|
||||
restoreBackupWizard->show();
|
||||
}
|
||||
|
||||
void KeepMainWindow::slotDaemonAlertState(bool state)
|
||||
{
|
||||
if ( !state )
|
||||
{
|
||||
m_actionView->m_ledDaemonState->setColor(Qt::green);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_actionView->m_ledDaemonState->setColor(Qt::red);
|
||||
}
|
||||
}
|
||||
|
||||
bool KeepMainWindow::backupSystemRunning()
|
||||
{
|
||||
QCStringList modules;
|
||||
QCString replyType;
|
||||
QByteArray replyData;
|
||||
|
||||
if ( !kapp->dcopClient()->call( "kded", "kded", "loadedModules()", QByteArray(), replyType, replyData ) )
|
||||
return false;
|
||||
else
|
||||
{
|
||||
if ( replyType == "QCStringList" )
|
||||
{
|
||||
QDataStream reply( replyData, IO_ReadOnly );
|
||||
reply >> modules;
|
||||
}
|
||||
}
|
||||
QCStringList::ConstIterator end( modules.end() );
|
||||
for ( QCStringList::ConstIterator it = modules.begin(); it != end; ++it )
|
||||
{
|
||||
if ( *it == "keep" )
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void KeepMainWindow::slotLoadDaemon()
|
||||
{
|
||||
QCString service = "keep";
|
||||
|
||||
QByteArray data, replyData;
|
||||
QCString replyType;
|
||||
QDataStream arg( data, IO_WriteOnly );
|
||||
arg << service;
|
||||
if ( kapp->dcopClient()->call( "kded", "kded", "loadModule(QCString)", data, replyType, replyData ) )
|
||||
{
|
||||
QDataStream reply( replyData, IO_ReadOnly );
|
||||
if ( replyType == "bool" )
|
||||
{
|
||||
bool result;
|
||||
reply >> result;
|
||||
if ( !result )
|
||||
{
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
KMessageBox::error( this, i18n( "Incorrect reply from KDED." ) );
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
KMessageBox::error( this, i18n( "Unable to contact KDED." ) );
|
||||
return;
|
||||
}
|
||||
slotRefreshGUI();
|
||||
}
|
||||
|
||||
void KeepMainWindow::slotUnloadDaemon()
|
||||
{
|
||||
QCString service = "keep";
|
||||
|
||||
QByteArray data;
|
||||
QDataStream arg( data, IO_WriteOnly );
|
||||
|
||||
arg << service;
|
||||
if ( !kapp->dcopClient()->send( "kded", "kded", "unloadModule(QCString)", data ) )
|
||||
{
|
||||
KMessageBox::error( this, i18n( "Unable to stop service." ) );
|
||||
return;
|
||||
}
|
||||
slotRefreshGUI();
|
||||
}
|
||||
|
||||
void KeepMainWindow::slotReloadDaemon()
|
||||
{
|
||||
slotUnloadDaemon();
|
||||
slotLoadDaemon();
|
||||
}
|
||||
|
||||
#include "keepmainwindow.moc"
|
@ -0,0 +1,65 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _KEEPMAINWINDOW_H_
|
||||
#define _KEEPMAINWINDOW_H_
|
||||
|
||||
#include <kmainwindow.h>
|
||||
#include <ktabwidget.h>
|
||||
#include <qhbox.h>
|
||||
|
||||
#include "backup.h"
|
||||
#include "actionview.h"
|
||||
|
||||
class KeepMainWindow: public KMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KeepMainWindow(QWidget *parent, const char *name);
|
||||
~KeepMainWindow();
|
||||
|
||||
public slots:
|
||||
void slotConfigure();
|
||||
void slotConfigureBackup();
|
||||
void slotViewLog();
|
||||
|
||||
void slotDaemonAlertState(bool state);
|
||||
|
||||
void slotLoadDaemon();
|
||||
void slotUnloadDaemon();
|
||||
void slotReloadDaemon();
|
||||
|
||||
void slotAddBackupWizard();
|
||||
void slotAddBackup(Backup backup);
|
||||
|
||||
void slotRestoreBackupWizard();
|
||||
|
||||
void slotForceBackup();
|
||||
|
||||
void slotCheckRDB();
|
||||
|
||||
void slotRefreshGUI();
|
||||
private:
|
||||
void initActions();
|
||||
void initConnections();
|
||||
bool backupSystemRunning();
|
||||
|
||||
ActionView *m_actionView;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,18 @@
|
||||
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
|
||||
<kpartgui name="keep" version="1">
|
||||
<MenuBar>
|
||||
<Menu name="file"><text>&File</text>
|
||||
<Action name="restore_backup" />
|
||||
<Action name="add_backup" />
|
||||
<Action name="force_backup" />
|
||||
<Separator/>
|
||||
<Action name="view_log" />
|
||||
</Menu>
|
||||
<Menu name="settings"><text>&Settings</text>
|
||||
<Action name="check_rdiff-backup" />
|
||||
<Separator/>
|
||||
<Action name="configure_backups" />
|
||||
<Action name="configure_keep" />
|
||||
</Menu>
|
||||
</MenuBar>
|
||||
</kpartgui>
|
Binary file not shown.
@ -0,0 +1,75 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "logdialog.h"
|
||||
|
||||
#include <klocale.h>
|
||||
#include <qlayout.h>
|
||||
#include <kstandarddirs.h>
|
||||
#include <dcopref.h>
|
||||
#include <kdebug.h>
|
||||
#include <kactivelabel.h>
|
||||
#include <klistview.h>
|
||||
#include <qpixmap.h>
|
||||
#include <kcombobox.h>
|
||||
#include <qfile.h>
|
||||
#include <qlabel.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <qcheckbox.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <kapplication.h>
|
||||
#include <kiconloader.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
#include "logview.h"
|
||||
|
||||
LogDialog::LogDialog(QWidget *parent): KDialogBase(Plain, i18n("View log"),
|
||||
Help|Ok, Cancel, parent, "logDialog", true, false)
|
||||
{
|
||||
m_logFilePath = locateLocal( "data", "keep/keep.log", true );
|
||||
|
||||
QFrame *page = plainPage();
|
||||
QVBoxLayout *topLayout = new QVBoxLayout( page, 0, KDialog::spacingHint() );
|
||||
m_view = new LogView(page,"logDialog");
|
||||
topLayout->addWidget( m_view );
|
||||
setMainWidget(page);
|
||||
|
||||
m_view->logList->setSorting(0,false);
|
||||
|
||||
slotLoadLog();
|
||||
resize(600,400);
|
||||
}
|
||||
|
||||
void LogDialog::slotLoadLog()
|
||||
{
|
||||
m_view->logList->clear();
|
||||
QFile file( m_logFilePath );
|
||||
if ( file.open( IO_ReadOnly ) ) {
|
||||
QTextStream stream( &file );
|
||||
QString line;
|
||||
while ( !stream.atEnd() ) {
|
||||
line = stream.readLine(); // line of text excluding '\n'
|
||||
QStringList params = QStringList::split("\t",line);
|
||||
KListViewItem *item = new KListViewItem(m_view->logList,params[0],params[1],params[2]);
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
|
||||
#include "logdialog.moc"
|
@ -0,0 +1,43 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _LOGDIALOG_H_
|
||||
#define _LOGDIALOG_H_
|
||||
|
||||
#include <kdialogbase.h>
|
||||
|
||||
#include "logview.h"
|
||||
|
||||
class LogDialog: public KDialogBase
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
LogDialog(QWidget *parent);
|
||||
~LogDialog() {};
|
||||
|
||||
public slots:
|
||||
void slotLoadLog();
|
||||
|
||||
private:
|
||||
LogView *m_view;
|
||||
QString m_logFilePath;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,86 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>LogView</class>
|
||||
<widget class="QWidget">
|
||||
<property name="name">
|
||||
<cstring>LogView</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>422</width>
|
||||
<height>422</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy>
|
||||
<hsizetype>1</hsizetype>
|
||||
<vsizetype>1</vsizetype>
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<grid>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="QLayoutWidget" row="0" column="0">
|
||||
<property name="name">
|
||||
<cstring>layout2</cstring>
|
||||
</property>
|
||||
<vbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<widget class="KListView">
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Date</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Event</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Backup</string>
|
||||
</property>
|
||||
<property name="clickable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="resizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</column>
|
||||
<property name="name">
|
||||
<cstring>logList</cstring>
|
||||
</property>
|
||||
<property name="resizeMode">
|
||||
<enum>LastColumn</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</vbox>
|
||||
</widget>
|
||||
</grid>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
</customwidgets>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
<includehints>
|
||||
<includehint>klistview.h</includehint>
|
||||
</includehints>
|
||||
</UI>
|
@ -0,0 +1,59 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include <klocale.h>
|
||||
#include <kcmdlineargs.h>
|
||||
#include <kwin.h>
|
||||
#include <kaboutdata.h>
|
||||
#include <kuniqueapplication.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
#include "keepmainwindow.h"
|
||||
|
||||
static const char *description =
|
||||
I18N_NOOP( "KDE Backup System" );
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
KAboutData aboutData( "keep", I18N_NOOP( "Keep" ),"0.4.0", description, KAboutData::License_GPL_V2,
|
||||
"(c) 2005 Jean-Rémy Falleri" );
|
||||
aboutData.addAuthor( "Jean-Rémy Falleri", I18N_NOOP( "Maintainer" ),
|
||||
"jr.falleri@laposte.net" );
|
||||
aboutData.addCredit("Anthony Mercatante",I18N_NOOP("Ubuntu packages"));
|
||||
aboutData.addCredit("John Eckerson", I18N_NOOP("Application wording"));
|
||||
aboutData.addCredit("auxsvr", I18N_NOOP("Useful patches"));
|
||||
|
||||
KCmdLineArgs::init( argc, argv, &aboutData );
|
||||
KUniqueApplication::addCmdLineOptions();
|
||||
|
||||
if ( !KUniqueApplication::start() )
|
||||
{
|
||||
kdDebug() << "Already running, exiting." << endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
KUniqueApplication app;
|
||||
app.disableSessionManagement();
|
||||
|
||||
KeepMainWindow *keep = new KeepMainWindow( 0, "keep" );
|
||||
keep->show();
|
||||
app.setMainWidget( keep );
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
@ -0,0 +1,293 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "restorebackupwizard.h"
|
||||
|
||||
#include <qpushbutton.h>
|
||||
#include <kiconloader.h>
|
||||
#include <klistview.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <klocale.h>
|
||||
#include <kactivelabel.h>
|
||||
#include <qcheckbox.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <kurlrequester.h>
|
||||
#include <qvaluelist.h>
|
||||
#include <qdir.h>
|
||||
#include <kmessagebox.h>
|
||||
|
||||
#include "backuplistviewitem.h"
|
||||
#include "backupconfig.h"
|
||||
|
||||
#include "listviewtooltip.h"
|
||||
#include "incrementlistviewitem.h"
|
||||
|
||||
RestoreBackupWizard::RestoreBackupWizard(QWidget *parent,const char* name): KWizard( parent, name, true)
|
||||
{
|
||||
m_manager = new RDBManager();
|
||||
connect( m_manager, SIGNAL(backupError(Backup,QString)), this, SLOT(slotRestoreError(Backup,QString)) );
|
||||
|
||||
KIconLoader icons;
|
||||
this->setIcon( icons.loadIcon( "wizard",KIcon::Small ));
|
||||
this->setCaption("Restore a backup");
|
||||
|
||||
m_popup = new KPopupMenu(this);
|
||||
m_popup->insertTitle(i18n("Menu"));
|
||||
m_popup->insertItem(i18n("Show differences destination/backup"), this, SLOT(slotShowDiff()));
|
||||
m_popup->insertItem(i18n("List changed files"), this, SLOT(slotShowChanged()));
|
||||
m_popup->insertItem(i18n("List files"), this, SLOT(slotShowList()));
|
||||
|
||||
setupPage1();
|
||||
setupPage2();
|
||||
setupPage3();
|
||||
|
||||
initConnections();
|
||||
|
||||
setNextEnabled(page1,false);
|
||||
setNextEnabled(page2,true);
|
||||
setFinishEnabled(page3, false);
|
||||
|
||||
resize( minimumSizeHint() );
|
||||
}
|
||||
|
||||
RestoreBackupWizard::~RestoreBackupWizard()
|
||||
{
|
||||
delete m_manager;
|
||||
}
|
||||
|
||||
void RestoreBackupWizard::initConnections()
|
||||
{
|
||||
// If custom source setted
|
||||
connect(restoreBackupWizard1View->btnCustomSource, SIGNAL( toggled(bool)),this,SLOT(slotCustomSourceChecked(bool)));
|
||||
|
||||
// Date selection popup menu
|
||||
connect(restoreBackupWizard3View->incrementList, SIGNAL(contextMenu (KListView *, QListViewItem *, const QPoint &)), this, SLOT(slotContextMenu(KListView *,QListViewItem*,const QPoint&)));
|
||||
|
||||
// Page 1 changes
|
||||
connect(restoreBackupWizard1View->m_lstBackup,SIGNAL(selectionChanged()),this,SLOT(slotPage1Changed()));
|
||||
connect(restoreBackupWizard1View->btnCustomSource,SIGNAL(toggled(bool)),this,SLOT(slotPage1Changed()));
|
||||
connect(restoreBackupWizard1View->customSource,SIGNAL(textChanged(const QString &)),this,SLOT(slotPage1Changed()));
|
||||
|
||||
// Page 2 changes
|
||||
connect(restoreBackupWizard2View->btnCustomDest,SIGNAL(toggled(bool)),this,SLOT(slotPage2Changed()));
|
||||
connect(restoreBackupWizard2View->customDest,SIGNAL(textChanged(const QString &)),this,SLOT(slotPage2Changed()));
|
||||
|
||||
// Page 3 Changes
|
||||
connect(restoreBackupWizard3View->incrementList,SIGNAL(selectionChanged()),this,SLOT(slotPage3Changed()));
|
||||
|
||||
// Finish button
|
||||
connect(finishButton(),SIGNAL(clicked()),this,SLOT(slotRestoreBackup()));
|
||||
}
|
||||
|
||||
void RestoreBackupWizard::slotPage1Changed()
|
||||
{
|
||||
setNextEnabled(page1,false);
|
||||
Backup b;
|
||||
// Checks if a standard backup is selected.
|
||||
if ( !restoreBackupWizard1View->btnCustomSource->isChecked() )
|
||||
{
|
||||
QListViewItem *item = restoreBackupWizard1View->m_lstBackup->selectedItem();
|
||||
if ( item )
|
||||
{
|
||||
BackupListViewItem *backupItem = static_cast<BackupListViewItem*>(item);
|
||||
b = backupItem->backup();
|
||||
}
|
||||
}
|
||||
// If not, checks if a custom source
|
||||
else
|
||||
{
|
||||
if ( restoreBackupWizard1View->customSource->url() != "" )
|
||||
b.setDest(restoreBackupWizard1View->customSource->url());
|
||||
}
|
||||
if ( b.dest() != "" )
|
||||
{
|
||||
RDBManager manager;
|
||||
QDateTime lastBackup = manager.lastIncrement(b);
|
||||
restoreBackupWizard3View->lblLastBackup->setText(lastBackup.toString(Qt::LocalDate));
|
||||
QValueList<QDateTime> increments = manager.incrementList(b);
|
||||
if ( increments.size() != 0 )
|
||||
{
|
||||
restoreBackupWizard3View->incrementList->clear();
|
||||
QValueList<QDateTime>::iterator it;
|
||||
for ( it = increments.begin(); it != increments.end(); ++it )
|
||||
{
|
||||
IncrementListViewItem *item = new IncrementListViewItem(restoreBackupWizard3View->incrementList,(*it));
|
||||
}
|
||||
setBackup(b);
|
||||
setNextEnabled(page1,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RestoreBackupWizard::slotPage2Changed()
|
||||
{
|
||||
setNextEnabled(page2,false);
|
||||
if ( !restoreBackupWizard2View->btnCustomDest->isChecked() )
|
||||
{
|
||||
QListViewItem *item = restoreBackupWizard1View->m_lstBackup->selectedItem();
|
||||
BackupListViewItem *backupItem = static_cast<BackupListViewItem*>(item);
|
||||
setBackup(backupItem->backup());
|
||||
setNextEnabled(page2,true);
|
||||
}
|
||||
else
|
||||
{
|
||||
QDir dir( restoreBackupWizard2View->customDest->url() );
|
||||
if ( dir.exists() && restoreBackupWizard2View->customDest->url() != "" )
|
||||
{
|
||||
Backup b = backup();
|
||||
b.setSource(restoreBackupWizard2View->customDest->url());
|
||||
setBackup(b);
|
||||
setNextEnabled(page2,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RestoreBackupWizard::slotPage3Changed()
|
||||
{
|
||||
setFinishEnabled(page3,false);
|
||||
QListViewItem *item = restoreBackupWizard3View->incrementList->selectedItem();
|
||||
if ( item )
|
||||
setFinishEnabled(page3,true);
|
||||
}
|
||||
|
||||
void RestoreBackupWizard::slotCustomSourceChecked(bool value)
|
||||
{
|
||||
if ( value )
|
||||
{
|
||||
restoreBackupWizard2View->btnCustomDest->setChecked(true);
|
||||
restoreBackupWizard2View->btnCustomDest->setEnabled(false);
|
||||
}
|
||||
else
|
||||
restoreBackupWizard2View->btnCustomDest->setEnabled(true);
|
||||
}
|
||||
|
||||
void RestoreBackupWizard::setupPage1()
|
||||
{
|
||||
page1 = new QHBox( this );
|
||||
page1->setSpacing(0);
|
||||
page1->setMargin(0);
|
||||
|
||||
restoreBackupWizard1View = new RestoreBackupWizard1View(page1,"restoreBackupWizard1View");
|
||||
BackupConfig *backupConfig = new BackupConfig();
|
||||
QValueList<Backup> backupList = backupConfig->backupList();
|
||||
QValueList<Backup>::iterator it;
|
||||
for ( it = backupList.begin(); it != backupList.end(); ++it )
|
||||
{
|
||||
new BackupListViewItem(restoreBackupWizard1View->m_lstBackup,*it);
|
||||
}
|
||||
|
||||
QToolTip::remove(restoreBackupWizard1View->m_lstBackup);
|
||||
new ListViewToolTip(restoreBackupWizard1View->m_lstBackup);
|
||||
|
||||
restoreBackupWizard1View->customSource->setMode(KFile::Directory);
|
||||
|
||||
addPage( page1, "Directory to restore" );
|
||||
delete backupConfig;
|
||||
}
|
||||
|
||||
void RestoreBackupWizard::setupPage2()
|
||||
{
|
||||
page2 = new QHBox( this );
|
||||
page2->setSpacing(0);
|
||||
page2->setMargin(0);
|
||||
|
||||
restoreBackupWizard2View = new RestoreBackupWizard2View(page2,"restoreBackupWizard2View");
|
||||
|
||||
restoreBackupWizard2View->customDest->setMode(KFile::Directory);
|
||||
|
||||
addPage(page2, "Destination directory" );
|
||||
}
|
||||
|
||||
void RestoreBackupWizard::setupPage3()
|
||||
{
|
||||
page3 = new QHBox( this );
|
||||
page3->setSpacing(0);
|
||||
page3->setMargin(0);
|
||||
|
||||
restoreBackupWizard3View = new RestoreBackupWizard3View(page3,"restoreBackupWizard3View");
|
||||
|
||||
restoreBackupWizard3View->incrementList->setSorting(0,false);
|
||||
restoreBackupWizard3View->lblDate->setText(QDateTime::currentDateTime().toString(Qt::LocalDate));
|
||||
addPage( page3, "Date to restore" );
|
||||
}
|
||||
|
||||
void RestoreBackupWizard::slotContextMenu(KListView *list,QListViewItem *item,const QPoint&p)
|
||||
{
|
||||
m_popup->popup(p, 1);
|
||||
}
|
||||
|
||||
Backup RestoreBackupWizard::backup()
|
||||
{
|
||||
return m_backup;
|
||||
}
|
||||
|
||||
void RestoreBackupWizard::setBackup(Backup backup)
|
||||
{
|
||||
m_backup = backup;
|
||||
}
|
||||
|
||||
void RestoreBackupWizard::slotShowDiff()
|
||||
{
|
||||
Backup b = backup();
|
||||
QListViewItem *item2 = restoreBackupWizard3View->incrementList->selectedItem();
|
||||
IncrementListViewItem *incrementItem = static_cast<IncrementListViewItem*>(item2);
|
||||
QDateTime date = incrementItem->date();
|
||||
QString diff = m_manager->compareAtTime(b,date);
|
||||
QString message = "<p><b>" + i18n("List of modifications since the selected increment:") + "</b></p><p>" + diff + "</p>";
|
||||
KMessageBox::information(this,message,i18n("Modifications"));
|
||||
}
|
||||
|
||||
void RestoreBackupWizard::slotShowChanged()
|
||||
{
|
||||
Backup b = backup();
|
||||
QListViewItem *item2 = restoreBackupWizard3View->incrementList->selectedItem();
|
||||
IncrementListViewItem *incrementItem = static_cast<IncrementListViewItem*>(item2);
|
||||
QDateTime date = incrementItem->date();
|
||||
QString changed = m_manager->listChangedSince(b,date);
|
||||
if ( changed == "" )
|
||||
changed = i18n("Nothing.");
|
||||
QString message = "<p><b>" + i18n("List of changed files since the selected increment:") + "</b></p><p>" + changed + "</p>";
|
||||
KMessageBox::information(this,message,i18n("Changed files"));
|
||||
}
|
||||
|
||||
void RestoreBackupWizard::slotShowList()
|
||||
{
|
||||
Backup b = backup();
|
||||
QListViewItem *item2 = restoreBackupWizard3View->incrementList->selectedItem();
|
||||
IncrementListViewItem *incrementItem = static_cast<IncrementListViewItem*>(item2);
|
||||
QDateTime date = incrementItem->date();
|
||||
QString list = m_manager->listAtTime(b,date);
|
||||
QString message = "<p><b>" + i18n("List of files in the selected increment:") + "</b></p><p>" + list + "</p>";
|
||||
KMessageBox::information(this,message,i18n("List of files"));
|
||||
}
|
||||
|
||||
void RestoreBackupWizard::slotRestoreBackup()
|
||||
{
|
||||
Backup b = backup();
|
||||
QListViewItem *item2 = restoreBackupWizard3View->incrementList->selectedItem();
|
||||
IncrementListViewItem *incrementItem = static_cast<IncrementListViewItem*>(item2);
|
||||
QDateTime date = incrementItem->date();
|
||||
m_manager->slotRestoreBackup(b,date);
|
||||
}
|
||||
|
||||
void RestoreBackupWizard::slotRestoreError(Backup backup,QString errorMessage)
|
||||
{
|
||||
KMessageBox::error(this,i18n("<p><b>An error occured restoring %1 backup:</b></p><p>%2</p>").arg(backup.dest()).arg(errorMessage));
|
||||
}
|
||||
|
||||
#include "restorebackupwizard.moc"
|
@ -0,0 +1,73 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _RESTOREBACKUPWIZARD_H_
|
||||
#define _RESTOREBACKUPWIZARD_H_
|
||||
|
||||
#include <kwizard.h>
|
||||
#include <kpopupmenu.h>
|
||||
#include <qhbox.h>
|
||||
|
||||
#include "restorebackupwizard1view.h"
|
||||
#include "restorebackupwizard2view.h"
|
||||
#include "restorebackupwizard3view.h"
|
||||
#include "backup.h"
|
||||
#include "rdbmanager.h"
|
||||
|
||||
class RestoreBackupWizard: public KWizard
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
RestoreBackupWizard(QWidget *parent, const char *name);
|
||||
~RestoreBackupWizard();
|
||||
|
||||
Backup backup();
|
||||
void setBackup(Backup backup);
|
||||
|
||||
protected slots:
|
||||
void slotContextMenu(KListView *list,QListViewItem * item,const QPoint &point);
|
||||
void slotPage1Changed();
|
||||
void slotPage2Changed();
|
||||
void slotPage3Changed();
|
||||
|
||||
void slotCustomSourceChecked(bool value);
|
||||
|
||||
void slotShowDiff();
|
||||
void slotShowChanged();
|
||||
void slotShowList();
|
||||
|
||||
void slotRestoreBackup();
|
||||
void slotRestoreError(Backup backup,QString errorMessage);
|
||||
|
||||
private:
|
||||
// init GUI
|
||||
void setupPage1();
|
||||
void setupPage2();
|
||||
void setupPage3();
|
||||
void initConnections();
|
||||
|
||||
KPopupMenu *m_popup;
|
||||
QHBox *page1,*page2,*page3;
|
||||
RestoreBackupWizard1View *restoreBackupWizard1View ;
|
||||
RestoreBackupWizard2View *restoreBackupWizard2View;
|
||||
RestoreBackupWizard3View *restoreBackupWizard3View;
|
||||
Backup m_backup;
|
||||
RDBManager *m_manager;
|
||||
};
|
||||
|
||||
#endif
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,14 @@
|
||||
INCLUDES = $(all_includes)
|
||||
METASOURCES = AUTO
|
||||
|
||||
noinst_LTLIBRARIES = libkeep.la
|
||||
|
||||
libkeep_la_SOURCES = keepsettings.kcfgc backuplistviewitem.cpp\
|
||||
backup.cpp backupconfig.cpp rdblistener.cpp\
|
||||
rdbmanager.cpp incrementlistviewitem.cpp includeexcludeitem.cpp
|
||||
|
||||
noinst_HEADERS = backuplistviewitem.h backup.h\
|
||||
backupconfig.h listviewtooltip.h rdblistener.h\
|
||||
rdbmanager.h incrementlistviewitem.h includeexcludeitem.h
|
||||
|
||||
kde_kcfg_DATA = keepsettings.kcfg
|
@ -0,0 +1,177 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include <klocale.h>
|
||||
#include <kdebug.h>
|
||||
|
||||
#include "backup.h"
|
||||
|
||||
Backup::Backup()
|
||||
{
|
||||
}
|
||||
|
||||
Backup::Backup( QString source, QString dest, int interval, int deleteAfter, bool neverDelete,bool useCompression, bool excludeSpecialFiles,bool useAdvancedConfig,QStringList optionList,bool useIncludeExclude,QStringList includeExcludeList)
|
||||
{
|
||||
m_source = source;
|
||||
m_dest = dest;
|
||||
m_interval = interval;
|
||||
m_deleteAfter = deleteAfter;
|
||||
m_neverDelete = neverDelete;
|
||||
m_useCompression = useCompression;
|
||||
m_excludeSpecialFiles = excludeSpecialFiles;
|
||||
m_useAdvancedConfig = useAdvancedConfig;
|
||||
m_optionList = optionList;
|
||||
m_useIncludeExclude = useIncludeExclude;
|
||||
m_includeExcludeList = includeExcludeList;
|
||||
}
|
||||
Backup::~Backup()
|
||||
{
|
||||
}
|
||||
|
||||
QString Backup::source()
|
||||
{
|
||||
return m_source;
|
||||
}
|
||||
|
||||
void Backup::setSource(QString source)
|
||||
{
|
||||
m_source = source;
|
||||
}
|
||||
|
||||
QString Backup::dest()
|
||||
{
|
||||
return m_dest;
|
||||
}
|
||||
|
||||
void Backup::setDest(QString dest)
|
||||
{
|
||||
m_dest = dest;
|
||||
}
|
||||
|
||||
int Backup::interval()
|
||||
{
|
||||
return m_interval;
|
||||
}
|
||||
|
||||
void Backup::setInterval(int interval)
|
||||
{
|
||||
m_interval = interval;
|
||||
}
|
||||
|
||||
int Backup::deleteAfter()
|
||||
{
|
||||
return m_deleteAfter;
|
||||
}
|
||||
|
||||
void Backup::setDeleteAfter(int deleteAfter)
|
||||
{
|
||||
m_deleteAfter = deleteAfter;
|
||||
}
|
||||
|
||||
bool Backup::neverDelete()
|
||||
{
|
||||
return m_neverDelete;
|
||||
}
|
||||
|
||||
void Backup::setNeverDelete(bool neverDelete)
|
||||
{
|
||||
m_neverDelete = neverDelete;
|
||||
}
|
||||
|
||||
bool Backup::useCompression()
|
||||
{
|
||||
return m_useCompression;
|
||||
}
|
||||
|
||||
void Backup::setUseCompression(bool useCompression)
|
||||
{
|
||||
m_useCompression = useCompression;
|
||||
}
|
||||
|
||||
bool Backup::excludeSpecialFiles()
|
||||
{
|
||||
return m_excludeSpecialFiles;
|
||||
}
|
||||
|
||||
void Backup::setExcludeSpecialFiles(bool excludeSpecialFiles)
|
||||
{
|
||||
m_excludeSpecialFiles = excludeSpecialFiles;
|
||||
}
|
||||
|
||||
bool Backup::useAdvancedConfig()
|
||||
{
|
||||
return m_useAdvancedConfig;
|
||||
}
|
||||
|
||||
void Backup::setUseAdvancedConfig(bool useAdvancedConfig)
|
||||
{
|
||||
m_useAdvancedConfig = useAdvancedConfig;
|
||||
}
|
||||
|
||||
QStringList Backup::optionList()
|
||||
{
|
||||
return m_optionList;
|
||||
}
|
||||
|
||||
void Backup::setOptionList(QStringList optionList)
|
||||
{
|
||||
m_optionList = optionList;
|
||||
}
|
||||
|
||||
bool Backup::useIncludeExclude()
|
||||
{
|
||||
return m_useIncludeExclude;
|
||||
}
|
||||
|
||||
void Backup::setUseIncludeExclude(bool useIncludeExclude)
|
||||
{
|
||||
m_useIncludeExclude = useIncludeExclude;
|
||||
}
|
||||
|
||||
QStringList Backup::includeExcludeList()
|
||||
{
|
||||
return m_includeExcludeList;
|
||||
}
|
||||
|
||||
void Backup::setIncludeExcludeList(QStringList includeExcludeList)
|
||||
{
|
||||
m_includeExcludeList = includeExcludeList;
|
||||
}
|
||||
|
||||
QString Backup::htmlDesc()
|
||||
{
|
||||
QString del;
|
||||
QString compression;
|
||||
if ( m_neverDelete )
|
||||
del = i18n("Never delete");
|
||||
else
|
||||
del = i18n("%1 days").arg(m_deleteAfter);
|
||||
if ( m_useCompression )
|
||||
compression = i18n("Yes");
|
||||
else
|
||||
compression = i18n("No");
|
||||
QString html = "<p><b>" + i18n("Source directory:") + "</b><br>"
|
||||
+ m_source + "<br><b>" + i18n("Destination directory:") + "</b><br>"
|
||||
+ m_dest + "</p><p><b>" + i18n("Interval:") + "</b> " + i18n("%1 days").arg(m_interval)
|
||||
+ "<br><b>" + i18n("Delete after:") + "</b> " + del
|
||||
+ "<br><b>" + i18n("Use compression:") + "</b> " + compression
|
||||
+ "</p>";
|
||||
return html;
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,70 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _BACKUP_H_
|
||||
#define _BACKUP_H_
|
||||
|
||||
#include <qstringlist.h>
|
||||
|
||||
class Backup
|
||||
{
|
||||
public:
|
||||
Backup( QString source, QString dest, int m_interval, int m_deleteAfter, bool m_neverDelete,bool useCompression,bool excludeSpecialFiles,bool useAdvancedConfig,QStringList optionList,bool useIncludeExclude,QStringList includeExcludeList);
|
||||
Backup();
|
||||
~Backup();
|
||||
|
||||
QString source();
|
||||
void setSource(QString source);
|
||||
QString dest();
|
||||
void setDest(QString dest);
|
||||
int interval();
|
||||
void setInterval(int interval);
|
||||
int deleteAfter();
|
||||
void setDeleteAfter(int deleteAfter);
|
||||
bool neverDelete();
|
||||
void setNeverDelete(bool neverDelete);
|
||||
bool useCompression();
|
||||
void setUseCompression(bool useCompression);
|
||||
bool excludeSpecialFiles();
|
||||
void setExcludeSpecialFiles(bool excludeSpecialFiles);
|
||||
bool useAdvancedConfig();
|
||||
void setUseAdvancedConfig(bool useAdvancedConfig);
|
||||
QStringList optionList();
|
||||
void setOptionList(QStringList optionList);
|
||||
bool useIncludeExclude();
|
||||
void setUseIncludeExclude(bool useIncludeExclude);
|
||||
QStringList includeExcludeList();
|
||||
void setIncludeExcludeList(QStringList includeExcludeList);
|
||||
|
||||
QString htmlDesc();
|
||||
|
||||
private:
|
||||
QString m_source;
|
||||
QString m_dest;
|
||||
int m_interval;
|
||||
int m_deleteAfter;
|
||||
bool m_neverDelete;
|
||||
bool m_useCompression;
|
||||
bool m_excludeSpecialFiles;
|
||||
bool m_useAdvancedConfig;
|
||||
QStringList m_optionList;
|
||||
bool m_useIncludeExclude;
|
||||
QStringList m_includeExcludeList;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,101 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "backupconfig.h"
|
||||
|
||||
#include <kdebug.h>
|
||||
|
||||
BackupConfig::BackupConfig()
|
||||
{
|
||||
m_config = new KConfig( "keepbackuplist.rc", false );
|
||||
}
|
||||
|
||||
BackupConfig::~BackupConfig()
|
||||
{
|
||||
delete m_config;
|
||||
}
|
||||
|
||||
void BackupConfig::addBackup(Backup backup)
|
||||
{
|
||||
int id = generateId();
|
||||
|
||||
m_config->setGroup( ("Backup_" + QString::number(id)) );
|
||||
m_config->writeEntry( "Source", backup.source());
|
||||
m_config->writeEntry( "Dest", backup.dest());
|
||||
m_config->writeEntry( "Interval", backup.interval());
|
||||
m_config->writeEntry( "DeleteAfter", backup.deleteAfter());
|
||||
m_config->writeEntry( "NeverDelete", backup.neverDelete());
|
||||
m_config->writeEntry( "UseCompression", backup.useCompression());
|
||||
m_config->writeEntry( "ExcludeSpecialFiles", backup.excludeSpecialFiles());
|
||||
m_config->writeEntry( "UseAdvancedConfig", backup.useAdvancedConfig());
|
||||
m_config->writeEntry( "OptionList", backup.optionList());
|
||||
m_config->writeEntry( "UseIncludeExclude", backup.useIncludeExclude());
|
||||
m_config->writeEntry( "IncludeExcludeList", backup.includeExcludeList());
|
||||
|
||||
m_config->sync();
|
||||
}
|
||||
|
||||
QValueList<Backup> BackupConfig::backupList()
|
||||
{
|
||||
QValueList<Backup> backupList;
|
||||
QStringList groupList = m_config->groupList();
|
||||
QStringList backupNameList = groupList.grep("Backup_");
|
||||
for ( QStringList::Iterator it = backupNameList.begin(); it != backupNameList.end(); ++it ) {
|
||||
m_config->setGroup(*it);
|
||||
QString source = m_config->readEntry("Source");
|
||||
QString dest = m_config->readEntry("Dest");
|
||||
int interval = m_config->readNumEntry("Interval");
|
||||
int deleteAfter = m_config->readNumEntry("DeleteAfter");
|
||||
bool neverDelete = m_config->readBoolEntry("NeverDelete");
|
||||
bool useCompression = m_config->readBoolEntry("UseCompression");
|
||||
bool excludeSpecialFiles = m_config->readBoolEntry("ExcludeSpecialFiles");
|
||||
bool useAdvancedConfig = m_config->readBoolEntry("UseAdvancedConfig");
|
||||
QStringList optionList = m_config->readListEntry( "OptionList");
|
||||
bool useIncludeExclude = m_config->readBoolEntry("UseIncludeExclude");
|
||||
QStringList includeExcludeList = m_config->readListEntry("IncludeExcludeList");
|
||||
|
||||
backupList.append(Backup(source,dest,interval,deleteAfter,neverDelete,useCompression,excludeSpecialFiles,useAdvancedConfig,optionList,useIncludeExclude,includeExcludeList));
|
||||
}
|
||||
return backupList;
|
||||
}
|
||||
|
||||
void BackupConfig::setBackupList(QValueList<Backup> backups)
|
||||
{
|
||||
QStringList groupList = m_config->groupList();
|
||||
QStringList backupNameList = groupList.grep("Backup_");
|
||||
for ( QStringList::Iterator it = backupNameList.begin(); it != backupNameList.end(); ++it ) {
|
||||
m_config->deleteGroup(*it);
|
||||
}
|
||||
m_config->sync();
|
||||
QValueList<Backup>::iterator it;
|
||||
for ( it = backups.begin(); it != backups.end(); ++it )
|
||||
{
|
||||
addBackup(*it);
|
||||
}
|
||||
}
|
||||
|
||||
int BackupConfig::generateId()
|
||||
{
|
||||
m_config->setGroup("General");
|
||||
int id = m_config->readNumEntry("LastId",0);
|
||||
int newid = id + 1;
|
||||
m_config->writeEntry( "LastId", newid);
|
||||
m_config->sync();
|
||||
return newid;
|
||||
}
|
||||
|
@ -0,0 +1,46 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _BACKUPCONFIG_H_
|
||||
#define _BACKUPCONFIG_H_
|
||||
|
||||
#include <qvaluelist.h>
|
||||
#include <qobject.h>
|
||||
#include <kconfig.h>
|
||||
|
||||
#include "backup.h"
|
||||
|
||||
class BackupConfig: public QObject
|
||||
{
|
||||
public:
|
||||
BackupConfig();
|
||||
~BackupConfig();
|
||||
|
||||
void addBackup(Backup backup);
|
||||
QValueList<Backup> backupList();
|
||||
void setBackupList(QValueList<Backup> backups);
|
||||
|
||||
private:
|
||||
KConfig *m_config;
|
||||
int generateId();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
@ -0,0 +1,58 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2006 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "backuplistviewitem.h"
|
||||
|
||||
#include <klocale.h>
|
||||
#include <qdir.h>
|
||||
#include <klistview.h>
|
||||
|
||||
BackupListViewItem::BackupListViewItem(KListView *parent,Backup &backup): QListViewItem (parent)
|
||||
{
|
||||
setBackup(backup);
|
||||
}
|
||||
|
||||
BackupListViewItem::~BackupListViewItem()
|
||||
{
|
||||
}
|
||||
|
||||
Backup BackupListViewItem::backup()
|
||||
{
|
||||
return m_backup;
|
||||
}
|
||||
|
||||
void BackupListViewItem::setBackup(Backup backup)
|
||||
{
|
||||
m_backup = backup;
|
||||
setBackupText();
|
||||
}
|
||||
|
||||
void BackupListViewItem::setBackupText()
|
||||
{
|
||||
setText(0, QDir(m_backup.source()).dirName() );
|
||||
setText(1, QDir(m_backup.dest()).dirName() );
|
||||
setText(2, i18n("%1 days").arg(m_backup.interval()));
|
||||
QString deleteAfter;
|
||||
if ( m_backup.neverDelete() == true )
|
||||
deleteAfter = i18n("Never");
|
||||
else
|
||||
deleteAfter = i18n("%1 days").arg(m_backup.deleteAfter());
|
||||
setText(3, deleteAfter);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,41 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2006 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _BACKUPLISTVIEWITEM_H_
|
||||
#define _BACKUPLISTVIEWITEM_H_
|
||||
|
||||
#include <klistview.h>
|
||||
|
||||
#include "backup.h"
|
||||
|
||||
class BackupListViewItem : public QListViewItem
|
||||
{
|
||||
public:
|
||||
BackupListViewItem(KListView *parent,Backup &backup);
|
||||
~BackupListViewItem();
|
||||
|
||||
Backup backup();
|
||||
void setBackup(Backup backup);
|
||||
|
||||
private:
|
||||
Backup m_backup;
|
||||
void setBackupText();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,62 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2006 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "includeexcludeitem.h"
|
||||
|
||||
#include <klocale.h>
|
||||
#include <qdir.h>
|
||||
#include <klistview.h>
|
||||
|
||||
IncludeExcludeItem::IncludeExcludeItem(KListView *parent,QString includeExclude): QListViewItem (parent)
|
||||
{
|
||||
setIncludeExclude(includeExclude);
|
||||
}
|
||||
|
||||
IncludeExcludeItem::IncludeExcludeItem(KListView *parent,IncludeExcludeItem *item,QString includeExclude): QListViewItem (parent,item)
|
||||
{
|
||||
setIncludeExclude(includeExclude);
|
||||
}
|
||||
|
||||
|
||||
IncludeExcludeItem::~IncludeExcludeItem()
|
||||
{
|
||||
}
|
||||
|
||||
QString IncludeExcludeItem::includeExclude()
|
||||
{
|
||||
return m_includeExclude;
|
||||
}
|
||||
|
||||
void IncludeExcludeItem::setIncludeExclude(QString includeExclude)
|
||||
{
|
||||
m_includeExclude = includeExclude;
|
||||
setIncludeExcludeText();
|
||||
}
|
||||
|
||||
void IncludeExcludeItem::setIncludeExcludeText()
|
||||
{
|
||||
QString type = m_includeExclude.left(1);
|
||||
QString file = m_includeExclude.right(m_includeExclude.length() - 1);
|
||||
setText(0, file);
|
||||
if ( type == "I" )
|
||||
setText(1,i18n("Included"));
|
||||
else if ( type == "E")
|
||||
setText(1,i18n("Excluded"));
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,42 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2006 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _INCLUDEEXCLUDEITEM_H_
|
||||
#define _INCLUDEEXCLUDEITEM_H_
|
||||
|
||||
#include <klistview.h>
|
||||
|
||||
#include "backup.h"
|
||||
|
||||
class IncludeExcludeItem : public QListViewItem
|
||||
{
|
||||
public:
|
||||
IncludeExcludeItem(KListView *parent,QString includeExclude);
|
||||
IncludeExcludeItem(KListView *parent,IncludeExcludeItem *item,QString includeExclude);
|
||||
~IncludeExcludeItem();
|
||||
|
||||
QString includeExclude();
|
||||
void setIncludeExclude(QString includeExclude);
|
||||
|
||||
private:
|
||||
QString m_includeExclude;
|
||||
void setIncludeExcludeText();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,56 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2006 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "incrementlistviewitem.h"
|
||||
|
||||
#include <klocale.h>
|
||||
#include <qdir.h>
|
||||
#include <klistview.h>
|
||||
|
||||
IncrementListViewItem::IncrementListViewItem(KListView *parent,QDateTime date): QListViewItem (parent)
|
||||
{
|
||||
setDate(date);
|
||||
}
|
||||
|
||||
IncrementListViewItem::IncrementListViewItem(KListView *parent,QListViewItem *item,QDateTime date): QListViewItem (parent,item)
|
||||
{
|
||||
setDate(date);
|
||||
}
|
||||
|
||||
|
||||
IncrementListViewItem::~IncrementListViewItem()
|
||||
{
|
||||
}
|
||||
|
||||
QDateTime IncrementListViewItem::date()
|
||||
{
|
||||
return m_date;
|
||||
}
|
||||
|
||||
void IncrementListViewItem::setDate(QDateTime date)
|
||||
{
|
||||
m_date = date;
|
||||
setDateText();
|
||||
}
|
||||
|
||||
void IncrementListViewItem::setDateText()
|
||||
{
|
||||
setText(0, m_date.toString(Qt::LocalDate) );
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,41 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2006 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _INCREMENTLISTVIEWITEM_H_
|
||||
#define _INCREMENTLISTVIEWITEM_H_
|
||||
|
||||
#include <klistview.h>
|
||||
#include <qdatetime.h>
|
||||
|
||||
|
||||
class IncrementListViewItem : public QListViewItem
|
||||
{
|
||||
public:
|
||||
IncrementListViewItem(KListView *parent, QDateTime date);
|
||||
IncrementListViewItem(KListView *parent, QListViewItem *item,QDateTime date);
|
||||
~IncrementListViewItem();
|
||||
|
||||
QDateTime date();
|
||||
void setDate(QDateTime date);
|
||||
|
||||
private:
|
||||
QDateTime m_date;
|
||||
void setDateText();
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
|
||||
<kcfg>
|
||||
<kcfgfile name="keeprc" />
|
||||
<group name="General">
|
||||
<entry name="NotifyBackupError" type="Bool">
|
||||
<label>Notify backup error.</label>
|
||||
<default>true</default>
|
||||
<whatsthis>Notify backup error.</whatsthis>
|
||||
</entry>
|
||||
<entry name="NotifyBackupSuccess" type="Bool">
|
||||
<label>Notify backup success.</label>
|
||||
<default>false</default>
|
||||
<whatsthis>Notify backup success.</whatsthis>
|
||||
</entry>
|
||||
<entry name="ControlRDBPriority" type="Bool">
|
||||
<label>Control rdiff-backup priority</label>
|
||||
<default>false</default>
|
||||
<whatsthis>Control rdiff-backup priority</whatsthis>
|
||||
</entry>
|
||||
<entry name="RDBPriority" type="Int">
|
||||
<label>Rdiff-backup priority"</label>
|
||||
<default>0</default>
|
||||
<whatsthis>Rdiff-backup priority</whatsthis>
|
||||
</entry>
|
||||
</group>
|
||||
</kcfg>
|
@ -0,0 +1,4 @@
|
||||
ClassName=KeepSettings
|
||||
File=keepsettings.kcfg
|
||||
Mutators=true
|
||||
Singleton=true
|
@ -0,0 +1,81 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2006 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
|
||||
#ifndef _LISTVIEWTOOLTIP_H_
|
||||
#define _LISTVIEWTOOLTIP_H_
|
||||
|
||||
#include <qtooltip.h>
|
||||
#include <qlistview.h>
|
||||
#include <qheader.h>
|
||||
|
||||
#include "backuplistviewitem.h"
|
||||
#include "backup.h"
|
||||
|
||||
class ListViewToolTip : public QToolTip
|
||||
{
|
||||
public:
|
||||
ListViewToolTip(QListView* parent);
|
||||
|
||||
protected:
|
||||
void maybeTip( const QPoint& p );
|
||||
|
||||
private:
|
||||
QListView* listView;
|
||||
};
|
||||
|
||||
inline ListViewToolTip::ListViewToolTip( QListView* parent ): QToolTip( parent->viewport() ), listView( parent ) {}
|
||||
|
||||
inline void ListViewToolTip::maybeTip( const QPoint& p ) {
|
||||
if ( !listView )
|
||||
return;
|
||||
|
||||
QListViewItem* item = listView->itemAt( p );
|
||||
if ( !item )
|
||||
return;
|
||||
|
||||
const QRect itemRect = listView->itemRect( item );
|
||||
if ( !itemRect.isValid() )
|
||||
return;
|
||||
|
||||
const int col = listView->header()->sectionAt( p.x() );
|
||||
if ( col == -1 )
|
||||
return;
|
||||
|
||||
const QRect headerRect = listView->header()->sectionRect( col );
|
||||
if ( !headerRect.isValid() )
|
||||
return;
|
||||
|
||||
const QRect cellRect( headerRect.left(), itemRect.top(),headerRect.width(), itemRect.height());
|
||||
|
||||
BackupListViewItem* backupItem = static_cast<BackupListViewItem*>(item);
|
||||
|
||||
QString tipStr = backupItem->backup().htmlDesc();
|
||||
/*
|
||||
if( col == 0 )
|
||||
tipStr = QString( "Contents of this cell: <b>%1</b>" ).arg(item->text( 0 ) );
|
||||
else if( col == 1 )
|
||||
tipStr = QString( "Contents of that cell: <em>%1</em>" ).arg(item->text( 1 ) );
|
||||
else
|
||||
tipStr = QString( "Something else" );
|
||||
*/
|
||||
tip( cellRect, tipStr );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -0,0 +1,58 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2006 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "rdblistener.h"
|
||||
|
||||
RDBListener::RDBListener()
|
||||
{
|
||||
m_isOk = true;
|
||||
}
|
||||
|
||||
|
||||
void RDBListener::receivedStdErr(KProcess *proc, char *buffer, int buflen)
|
||||
{
|
||||
m_isOk = false;
|
||||
m_stdErr.append(buffer);
|
||||
}
|
||||
|
||||
void RDBListener::receivedStdOut(KProcess *proc, char *buffer, int buflen)
|
||||
{
|
||||
m_stdOut.append(buffer);
|
||||
}
|
||||
|
||||
QString RDBListener::errorMessage()
|
||||
{
|
||||
return m_stdErr.join("").simplifyWhiteSpace();
|
||||
}
|
||||
|
||||
QStringList RDBListener::stdErr()
|
||||
{
|
||||
return m_stdErr;
|
||||
}
|
||||
|
||||
QStringList RDBListener::stdOut()
|
||||
{
|
||||
return m_stdOut;
|
||||
}
|
||||
|
||||
bool RDBListener::isOk()
|
||||
{
|
||||
return m_isOk;
|
||||
}
|
||||
|
||||
#include "rdblistener.moc"
|
@ -0,0 +1,47 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2006 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _RDBLISTENER_H_
|
||||
#define _RDBLISTENER_H_
|
||||
|
||||
#include <qstringlist.h>
|
||||
|
||||
#include <qobject.h>
|
||||
#include <kprocess.h>
|
||||
|
||||
class RDBListener: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
RDBListener();
|
||||
QStringList stdOut();
|
||||
QStringList stdErr();
|
||||
QString errorMessage();
|
||||
bool isOk();
|
||||
|
||||
public slots:
|
||||
void receivedStdOut(KProcess *proc, char *buffer, int buflen);
|
||||
void receivedStdErr(KProcess *proc, char *buffer, int buflen);
|
||||
|
||||
private:
|
||||
QStringList m_stdOut;
|
||||
QStringList m_stdErr;
|
||||
bool m_isOk;
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,388 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2006 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "rdbmanager.h"
|
||||
|
||||
#include <kprocess.h>
|
||||
#include <kdebug.h>
|
||||
#include <qfile.h>
|
||||
#include <keepsettings.h>
|
||||
|
||||
RDBManager::RDBManager()
|
||||
{
|
||||
}
|
||||
|
||||
RDBManager::~RDBManager()
|
||||
{
|
||||
}
|
||||
|
||||
void RDBManager::slotCheckBackup()
|
||||
{
|
||||
QValueList<Backup> backups = outdatedBackupList();
|
||||
QValueList<Backup>::iterator it;
|
||||
for ( it = backups.begin(); it != backups.end(); ++it )
|
||||
{
|
||||
doBackup(*it);
|
||||
}
|
||||
}
|
||||
|
||||
void RDBManager::slotForceBackup(QValueList<Backup> backupList)
|
||||
{
|
||||
QValueList<Backup>::iterator it;
|
||||
for ( it = backupList.begin(); it != backupList.end(); ++it )
|
||||
{
|
||||
doBackup(*it);
|
||||
}
|
||||
}
|
||||
|
||||
QString RDBManager::compareAtTime(Backup backup, QDateTime date)
|
||||
{
|
||||
// Gets the rdiff-backup process
|
||||
KProcess *proc = RDBProcess();
|
||||
// Adds the options
|
||||
*proc << "--compare-at-time";
|
||||
*proc << QString::number(date.toTime_t()); // increment date
|
||||
// Adds source and dest
|
||||
*proc << QFile::encodeName(KProcess::quote(backup.source()));
|
||||
*proc << QFile::encodeName(KProcess::quote(backup.dest()));
|
||||
// Adds the listener
|
||||
RDBListener *listen = new RDBListener();
|
||||
connect(proc,SIGNAL(receivedStdout(KProcess *,char *,int)),listen,SLOT(receivedStdOut(KProcess *,char *,int)));
|
||||
// Starts the process
|
||||
if ( !proc->start(KProcess::Block, KProcess::AllOutput) )
|
||||
kdDebug() << "Error starting rdiff-backup" << endl;
|
||||
|
||||
QStringList output = listen->stdOut();
|
||||
QStringList::iterator it = output.begin();
|
||||
|
||||
kdDebug() << "Executed process: " << proc->args() << endl;
|
||||
|
||||
delete listen;
|
||||
delete proc;
|
||||
|
||||
return (*it);
|
||||
}
|
||||
|
||||
QString RDBManager::listChangedSince(Backup backup, QDateTime date)
|
||||
{
|
||||
// Gets the rdiff-backup process
|
||||
KProcess *proc = RDBProcess();
|
||||
// Adds the options
|
||||
*proc << "--list-changed-since";
|
||||
*proc << QString::number(date.toTime_t()); // increment date
|
||||
// Adds the dest
|
||||
*proc << QFile::encodeName(KProcess::quote(backup.dest()));
|
||||
// Adds a listener
|
||||
RDBListener *listen = new RDBListener();
|
||||
connect(proc,SIGNAL(receivedStdout(KProcess *,char *,int)),listen,SLOT(receivedStdOut(KProcess *,char *,int)));
|
||||
// Starts the process
|
||||
if ( !proc->start(KProcess::Block, KProcess::AllOutput) )
|
||||
kdDebug() << "Error starting rdiff-backup" << endl;
|
||||
|
||||
QStringList output = listen->stdOut();
|
||||
QStringList::iterator it = output.begin();
|
||||
|
||||
kdDebug() << "Executed process: " << proc->args() << endl;
|
||||
|
||||
delete listen;
|
||||
delete proc;
|
||||
|
||||
return (*it);
|
||||
}
|
||||
|
||||
QString RDBManager::listAtTime(Backup backup, QDateTime date)
|
||||
{
|
||||
// Gets the rdiff-backup process
|
||||
KProcess *proc = RDBProcess();
|
||||
// Adds the options
|
||||
*proc << "--list-at-time";
|
||||
*proc << QString::number(date.toTime_t()); // increment date
|
||||
// Adds the dest
|
||||
*proc << QFile::encodeName(KProcess::quote(backup.dest()));
|
||||
// Adds a listener
|
||||
RDBListener *listen = new RDBListener();
|
||||
connect(proc,SIGNAL(receivedStdout(KProcess *,char *,int)),listen,SLOT(receivedStdOut(KProcess *,char *,int)));
|
||||
// Starts the process
|
||||
if ( !proc->start(KProcess::Block, KProcess::AllOutput) )
|
||||
kdDebug() << "Error starting rdiff-backup" << endl;
|
||||
|
||||
QStringList output = listen->stdOut();
|
||||
QStringList::iterator it = output.begin();
|
||||
|
||||
kdDebug() << "Executed process: " << proc->args() << endl;
|
||||
|
||||
delete listen;
|
||||
delete proc;
|
||||
|
||||
return (*it);
|
||||
}
|
||||
|
||||
QValueList<QDateTime> RDBManager::incrementList(Backup backup)
|
||||
{
|
||||
// Gets the rdiff-backup process
|
||||
KProcess *proc = RDBProcess();
|
||||
// Adds the options
|
||||
*proc << "--list-increments";
|
||||
*proc << "-v2";
|
||||
*proc << "--parsable-output";
|
||||
// Adds the dest
|
||||
*proc << QFile::encodeName(KProcess::quote(backup.dest()));
|
||||
// Adds a listener
|
||||
RDBListener *listen = new RDBListener();
|
||||
connect(proc,SIGNAL(receivedStdout(KProcess *,char *,int)),listen,SLOT(receivedStdOut(KProcess *,char *,int)));
|
||||
// Starts the process
|
||||
if ( !proc->start(KProcess::Block, KProcess::AllOutput) )
|
||||
kdDebug() << "Error starting rdiff-backup" << endl;
|
||||
|
||||
QStringList output = listen->stdOut();
|
||||
QStringList::iterator it = output.begin();
|
||||
|
||||
QStringList lines = QStringList::split("\n",*it);
|
||||
QValueList<QDateTime> dateList;
|
||||
|
||||
QStringList::iterator it2 = output.begin();
|
||||
for ( it2 = lines.begin(); it2 != lines.end(); ++it2 )
|
||||
{
|
||||
QStringList field = QStringList::split(" ",*it2);
|
||||
QStringList::iterator dateStr = field.begin();
|
||||
long timestamp = (*dateStr).toUInt();
|
||||
QDateTime datetime;
|
||||
datetime.setTime_t(timestamp);
|
||||
dateList.append(datetime);
|
||||
}
|
||||
|
||||
kdDebug() << "Executed process: " << proc->args() << endl;
|
||||
|
||||
delete listen;
|
||||
delete proc;
|
||||
|
||||
return dateList;
|
||||
}
|
||||
|
||||
QDateTime RDBManager::lastIncrement(Backup backup)
|
||||
{
|
||||
QValueList<QDateTime> increments = incrementList(backup);
|
||||
QDateTime last = increments.last();
|
||||
return last;
|
||||
}
|
||||
|
||||
QValueList<Backup> RDBManager::outdatedBackupList()
|
||||
{
|
||||
BackupConfig config;
|
||||
QValueList<Backup> backups = config.backupList();
|
||||
QValueList<Backup> outdated;
|
||||
QValueList<Backup>::iterator it;
|
||||
kdDebug() << "Detecting outdated backup." << endl;
|
||||
for ( it = backups.begin(); it != backups.end(); ++it )
|
||||
{
|
||||
QDateTime last = lastIncrement(*it);
|
||||
QDate today = QDate::currentDate();
|
||||
if ( last.date().daysTo(today) >= (*it).interval() )
|
||||
{
|
||||
kdDebug() << "Detected outdated backup: " << (*it).source() << endl;
|
||||
outdated.append(*it);
|
||||
}
|
||||
}
|
||||
return outdated;
|
||||
}
|
||||
|
||||
void RDBManager::slotRestoreBackup(Backup backup,QDateTime time)
|
||||
{
|
||||
// Gets the rdiff-backup process
|
||||
KProcess *proc = RDBProcess();
|
||||
// Adds the options
|
||||
*proc << "--force";
|
||||
*proc << "--restore-as-of";
|
||||
*proc << QString::number(time.toTime_t()); // Date of the increment to restore
|
||||
// Adds source and dest
|
||||
*proc << QFile::encodeName(KProcess::quote(backup.dest()));
|
||||
*proc << QFile::encodeName(KProcess::quote(backup.source()));
|
||||
// Adds a listener (for output recording)
|
||||
RDBListener *listen = new RDBListener();
|
||||
connect(proc,SIGNAL(receivedStdout(KProcess *,char *,int)),listen,SLOT(receivedStdOut(KProcess *,char *,int)));
|
||||
connect(proc,SIGNAL(receivedStderr(KProcess *,char *,int)),listen,SLOT(receivedStdErr(KProcess *,char *,int)));
|
||||
// Starts the process
|
||||
if ( !proc->start(KProcess::Block, KProcess::AllOutput) )
|
||||
kdDebug() << "Error starting rdiff-backup" << endl;
|
||||
|
||||
kdDebug() << "Executed process: " << proc->args() << endl;
|
||||
|
||||
if ( !listen->isOk() )
|
||||
{
|
||||
kdDebug() << "Error message: " << listen->errorMessage() << endl;
|
||||
emit backupError(backup,listen->errorMessage());
|
||||
}
|
||||
|
||||
delete listen;
|
||||
delete proc;
|
||||
}
|
||||
|
||||
bool RDBManager::isRDB()
|
||||
{
|
||||
// Gets the rdiff-backup process
|
||||
KProcess *proc = RDBProcess();
|
||||
*proc << "-V";
|
||||
// Adds a listener (for output recording)
|
||||
RDBListener *listen = new RDBListener();
|
||||
connect(proc,SIGNAL(receivedStdout(KProcess *,char *,int)),listen,SLOT(receivedStdOut(KProcess *,char *,int)));
|
||||
// Starts the process
|
||||
if ( !proc->start(KProcess::Block, KProcess::AllOutput) )
|
||||
kdDebug() << "Error starting rdiff-backup" << endl;
|
||||
|
||||
QStringList outList = listen->stdOut();
|
||||
QStringList::iterator out = outList.begin();
|
||||
|
||||
kdDebug() << "Executed process: " << proc->args() << endl;
|
||||
|
||||
delete listen;
|
||||
delete proc;
|
||||
|
||||
if ( *out == "" )
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
QString RDBManager::RDBVersion()
|
||||
{
|
||||
// Gets the rdiff-backup process
|
||||
KProcess *proc = RDBProcess();
|
||||
*proc << "-V";
|
||||
// Adds a listener (for output recording)
|
||||
RDBListener *listen = new RDBListener();
|
||||
connect(proc,SIGNAL(receivedStdout(KProcess *,char *,int)),listen,SLOT(receivedStdOut(KProcess *,char *,int)));
|
||||
// Starts the process
|
||||
if ( !proc->start(KProcess::Block, KProcess::AllOutput) )
|
||||
kdDebug() << "Error starting rdiff-backup" << endl;
|
||||
|
||||
QStringList outList = listen->stdOut();
|
||||
QStringList::iterator out = outList.begin();
|
||||
|
||||
kdDebug() << "Executed process: " << proc->args() << endl;
|
||||
|
||||
delete listen;
|
||||
delete proc;
|
||||
|
||||
return (*out).mid(13,5);
|
||||
}
|
||||
|
||||
void RDBManager::doBackup(Backup backup)
|
||||
{
|
||||
// Gets the rdiff-backup process
|
||||
KProcess *proc = RDBProcess(KeepSettings::controlRDBPriority,KeepSettings::rDBPriority());
|
||||
// Adds include and exclude
|
||||
if ( backup.useIncludeExclude() )
|
||||
{
|
||||
QStringList includeExcludeList = backup.includeExcludeList();
|
||||
QStringList::iterator it;
|
||||
for ( it = includeExcludeList.begin(); it != includeExcludeList.end(); ++it )
|
||||
{
|
||||
QString type = (*it).left(1);
|
||||
QString file = (*it).right((*it).length() - 1);
|
||||
if ( type == "I" )
|
||||
{
|
||||
*proc << "--include";
|
||||
*proc << QFile::encodeName(KProcess::quote(file));
|
||||
}
|
||||
else if ( type == "E" )
|
||||
{
|
||||
*proc << "--exclude";
|
||||
*proc << QFile::encodeName(KProcess::quote(file));
|
||||
}
|
||||
}
|
||||
}
|
||||
// Adds the option
|
||||
// For simple mode
|
||||
if ( !backup.useAdvancedConfig() )
|
||||
{
|
||||
if ( !backup.useCompression() )
|
||||
*proc << "--no-compression";
|
||||
|
||||
if ( backup.excludeSpecialFiles() )
|
||||
*proc << "--exclude-special-files";
|
||||
}
|
||||
// For advanced mode
|
||||
else
|
||||
{
|
||||
QStringList optionList = backup.optionList();
|
||||
for ( QStringList::Iterator it = optionList.begin(); it != optionList.end(); ++it )
|
||||
{
|
||||
*proc << *it;
|
||||
}
|
||||
}
|
||||
// Adds source and dest
|
||||
*proc << QFile::encodeName(KProcess::quote(backup.source()));
|
||||
*proc << QFile::encodeName(KProcess::quote(backup.dest()));
|
||||
// Adds a listener (for output recording)
|
||||
RDBListener *listen = new RDBListener();
|
||||
connect(proc,SIGNAL(receivedStdout(KProcess *,char *,int)),listen,SLOT(receivedStdOut(KProcess *,char *,int)));
|
||||
connect(proc,SIGNAL(receivedStderr(KProcess *,char *,int)),listen,SLOT(receivedStdErr(KProcess *,char *,int)));
|
||||
// Starts the process
|
||||
if ( !proc->start(KProcess::Block, KProcess::AllOutput) )
|
||||
kdDebug() << "Error starting rdiff-backup" << endl;
|
||||
|
||||
kdDebug() << "Executed process: " << proc->args() << endl;
|
||||
kdDebug() << "Process status: " << listen->isOk() << endl;
|
||||
|
||||
if ( !listen->isOk() )
|
||||
{
|
||||
kdDebug() << "Error message: " << listen->errorMessage() << endl;
|
||||
emit backupError(backup,listen->errorMessage());
|
||||
}
|
||||
else
|
||||
emit backupSuccess(backup);
|
||||
|
||||
delete listen;
|
||||
delete proc;
|
||||
|
||||
if ( !backup.neverDelete() )
|
||||
{
|
||||
removeOldIncrements(backup);
|
||||
}
|
||||
}
|
||||
|
||||
void RDBManager::removeOldIncrements(Backup backup)
|
||||
{
|
||||
// Gets the rdiff-backup process
|
||||
KProcess *proc = RDBProcess();
|
||||
// Adds the options
|
||||
*proc << "--remove-older-than" << QString("%1").arg(backup.deleteAfter()) + "D";
|
||||
// Adds dest
|
||||
*proc << backup.dest();
|
||||
// Starts the process
|
||||
if ( !proc->start(KProcess::Block, KProcess::AllOutput) )
|
||||
kdDebug() << "Error starting rdiff-backup" << endl;
|
||||
|
||||
kdDebug() << "Executed process: " << proc->args() << endl;
|
||||
|
||||
delete proc;
|
||||
}
|
||||
|
||||
KProcess *RDBManager::RDBProcess(bool isNice,int niceLevel)
|
||||
{
|
||||
KProcess *proc = new KProcess();
|
||||
proc->setUseShell(true);
|
||||
if ( isNice )
|
||||
{
|
||||
*proc << "nice" << "-n" << QString("%1").arg(niceLevel);
|
||||
}
|
||||
*proc << "rdiff-backup";
|
||||
|
||||
return proc;
|
||||
}
|
||||
|
||||
#include "rdbmanager.moc"
|
@ -0,0 +1,62 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2006 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _RDBMANAGER_H_
|
||||
#define _RDBMANAGER_H_
|
||||
|
||||
#include <qvaluelist.h>
|
||||
#include <qobject.h>
|
||||
#include <qdatetime.h>
|
||||
|
||||
#include "backupconfig.h"
|
||||
#include "rdblistener.h"
|
||||
|
||||
class RDBManager: public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
RDBManager();
|
||||
~RDBManager();
|
||||
|
||||
QValueList<QDateTime> incrementList(Backup backup);
|
||||
QValueList<Backup> outdatedBackupList();
|
||||
QDateTime lastIncrement(Backup backup);
|
||||
|
||||
QString compareAtTime(Backup backup, QDateTime date);
|
||||
QString listChangedSince(Backup backup, QDateTime date);
|
||||
QString listAtTime(Backup backup, QDateTime date);
|
||||
|
||||
bool isRDB();
|
||||
QString RDBVersion();
|
||||
|
||||
public slots:
|
||||
void slotCheckBackup();
|
||||
void slotForceBackup(QValueList<Backup> backupList);
|
||||
void slotRestoreBackup(Backup backup,QDateTime time);
|
||||
|
||||
signals:
|
||||
void backupError(Backup backup,QString errorMessage);
|
||||
void backupSuccess(Backup backup);
|
||||
|
||||
private:
|
||||
void doBackup(Backup backup);
|
||||
void removeOldIncrements(Backup backup);
|
||||
KProcess * RDBProcess(bool isNice=false,int niceLevel=0);
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,2 @@
|
||||
keepicondir = $(kde_datadir)/keep/icons
|
||||
keepicon_ICON = AUTO
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,13 @@
|
||||
INCLUDES = -I$(top_srcdir)/keep/common -I$(top_builddir)/keep/common $(all_includes)
|
||||
|
||||
kde_module_LTLIBRARIES = kded_keep.la
|
||||
kded_keep_la_LDFLAGS = -module -avoid-version $(all_libraries)
|
||||
kded_keep_la_LIBADD = $(top_builddir)/keep/common/libkeep.la $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO)
|
||||
kded_keep_la_SOURCES = keepkded.cpp keepkded.skel
|
||||
|
||||
noinst_HEADERS = keepkded.h
|
||||
|
||||
METASOURCES = AUTO
|
||||
|
||||
services_DATA = keep.desktop
|
||||
servicesdir = $(kde_servicesdir)/kded
|
@ -0,0 +1,56 @@
|
||||
[Desktop Entry]
|
||||
Encoding=UTF-8
|
||||
Type=Service
|
||||
ServiceTypes=KDEDModule
|
||||
X-KDE-ModuleType=Library
|
||||
X-KDE-Library=keep
|
||||
X-KDE-FactoryName=keep
|
||||
X-KDE-Kded-autoload=true
|
||||
X-KDE-Kded-load-on-demand=false
|
||||
Name=Keep daemon
|
||||
Name[bg]=Keep демон
|
||||
Name[br]=Diaoul Keep
|
||||
Name[cs]=Démon keep
|
||||
Name[da]=Keep-dæmon
|
||||
Name[de]=Keep-Dienst
|
||||
Name[el]=Δαίμονας Keep
|
||||
Name[es]=Demonio Keep
|
||||
Name[et]=Keepi deemon
|
||||
Name[fr]=Démon Keep
|
||||
Name[ga]=Deamhan Keep
|
||||
Name[gl]=Servizo Keep
|
||||
Name[it]=Demone Keep
|
||||
Name[ja]=Keep デーモン
|
||||
Name[ka]=დემონის დატოვება
|
||||
Name[lt]=Nekeisti tarnybos
|
||||
Name[nl]=Keep-daemon
|
||||
Name[pl]=Demon Keep
|
||||
Name[pt]=Servidor do Keep
|
||||
Name[sr]=Keep демон
|
||||
Name[sr@Latn]=Keep demon
|
||||
Name[sv]=Keep-demon
|
||||
Name[xx]=xxKeep daemonxx
|
||||
Comment=Backup System
|
||||
Comment[bg]=Резервно копие на системата
|
||||
Comment[br]=Gwareziñ ar reizhiad
|
||||
Comment[cs]=Zálohování systému
|
||||
Comment[cy]=System cadw wrth gefn
|
||||
Comment[da]=Sikkerhedskopieringssystem
|
||||
Comment[de]=Datensicherungssystem
|
||||
Comment[el]=Σύστημα λήψης αντιγράφων ασφαλείας
|
||||
Comment[es]=Sistema de copia de seguridad
|
||||
Comment[et]=Varundamissüsteem
|
||||
Comment[ga]=Córas Cúltaca
|
||||
Comment[gl]=Sistema de Cópias de Seguridade
|
||||
Comment[it]=Sistema copie di sicurezza
|
||||
Comment[ja]=バックアップシステム
|
||||
Comment[ka]=სისტემის სარეზერვო ასლი
|
||||
Comment[lt]=Daryti sistemos atsarginę kopiją
|
||||
Comment[nl]=Backupsysteem
|
||||
Comment[pl]=Program do tworzenia kopii zapasowych
|
||||
Comment[pt]=Sistema de Cópias de Segurança
|
||||
Comment[sk]=Zálohovací systém
|
||||
Comment[sr]=Систем за архивирање
|
||||
Comment[sr@Latn]=Sistem za arhiviranje
|
||||
Comment[sv]=Säkerhetskopieringssystem
|
||||
Comment[xx]=xxBackup Systemxx
|
@ -0,0 +1,100 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#include "keepkded.h"
|
||||
|
||||
#include <qdir.h>
|
||||
#include <qfile.h>
|
||||
#include <qfileinfo.h>
|
||||
#include <qdatetime.h>
|
||||
#include <kdebug.h>
|
||||
#include <kprocess.h>
|
||||
#include <krun.h>
|
||||
#include <kmessagebox.h>
|
||||
#include <kstdguiitem.h>
|
||||
#include <kstandarddirs.h>
|
||||
#include <knotifyclient.h>
|
||||
#include <klocale.h>
|
||||
#include <keepsettings.h>
|
||||
|
||||
KeepKded::KeepKded(const QCString &name): KDEDModule(name)
|
||||
{
|
||||
m_logFilePath = locateLocal( "data", "keep/keep.log", true );
|
||||
|
||||
m_manager = new RDBManager();
|
||||
connect( m_manager, SIGNAL(backupError(Backup,QString)), this, SLOT(slotBackupError(Backup,QString)) );
|
||||
connect( m_manager, SIGNAL(backupSuccess(Backup)), this, SLOT(slotBackupSuccess(Backup)) );
|
||||
|
||||
slotCheckBackup();
|
||||
|
||||
m_timer = new QTimer(this);
|
||||
connect( m_timer, SIGNAL(timeout()), this, SLOT(slotCheckBackup()) );
|
||||
m_timer->start( 1000 * 60 * 60 );
|
||||
}
|
||||
|
||||
KeepKded::~KeepKded()
|
||||
{
|
||||
delete m_manager;
|
||||
}
|
||||
|
||||
void KeepKded::slotBackupError(Backup backup,QString errorMessage)
|
||||
{
|
||||
if ( KeepSettings::notifyBackupError() )
|
||||
{
|
||||
KNotifyClient::userEvent(0,i18n("<p><b>An error occured making %1 backup:</b></p><p>%2</p>").arg(backup.source()).arg(errorMessage),16,4);
|
||||
}
|
||||
log("Backup Error",backup.source(),errorMessage);
|
||||
}
|
||||
|
||||
void KeepKded::slotBackupSuccess(Backup backup)
|
||||
{
|
||||
if ( KeepSettings::notifyBackupSuccess() )
|
||||
{
|
||||
KNotifyClient::userEvent(0,i18n("<p><b>Backup %1 successfully backuped to %2</b></p>").arg(backup.source()).arg(backup.dest()),16,1);
|
||||
}
|
||||
log("Backup Success",backup.source(),"Successfully backuped to: " + backup.dest() );
|
||||
}
|
||||
|
||||
void KeepKded::log(QString type,QString backup,QString message)
|
||||
{
|
||||
QString logMessage = QDateTime::currentDateTime().toString(Qt::ISODate) + "\t" + type + "\t" + backup + "\t" + message;
|
||||
QFile file( m_logFilePath );
|
||||
if ( file.open(IO_WriteOnly | IO_Append) )
|
||||
{
|
||||
QTextStream stream( &file );
|
||||
stream << logMessage << "\n";
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
|
||||
void KeepKded::slotCheckBackup()
|
||||
{
|
||||
kdDebug(7020) << "Launching previous backup analyse." << endl;
|
||||
m_manager->slotCheckBackup();
|
||||
}
|
||||
|
||||
extern "C"
|
||||
{
|
||||
KDE_EXPORT KDEDModule *create_keep(const QCString &name)
|
||||
{
|
||||
return new KeepKded(name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#include "keepkded.moc"
|
@ -0,0 +1,49 @@
|
||||
/* This file is part of the Keep project
|
||||
Copyright (C) 2005 Jean-Rémy Falleri <jr.falleri@laposte.net>
|
||||
|
||||
Keep is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Keep is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Keep; if not, write to the
|
||||
Free Software Foundation, Inc.,
|
||||
51 Franklin Steet, Fifth Floor, Boston, MA 02110-1301, USA. */
|
||||
|
||||
#ifndef _KEEPKDED_H_
|
||||
#define _KEEPKDED_H_
|
||||
|
||||
#include <kdedmodule.h>
|
||||
#include <qstring.h>
|
||||
|
||||
#include "rdbmanager.h"
|
||||
|
||||
class KeepKded: public KDEDModule
|
||||
{
|
||||
Q_OBJECT
|
||||
K_DCOP
|
||||
|
||||
public:
|
||||
KeepKded( const QCString &name );
|
||||
virtual ~KeepKded();
|
||||
|
||||
public slots:
|
||||
void slotCheckBackup();
|
||||
void slotBackupError(Backup backup, QString ErrorMessage);
|
||||
void slotBackupSuccess(Backup backup);
|
||||
|
||||
private:
|
||||
QTimer *m_timer;
|
||||
QString m_logFilePath;
|
||||
RDBManager *m_manager;
|
||||
void log(QString type,QString backup,QString message);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -0,0 +1 @@
|
||||
SUBDIRS = $(AUTODIRS)
|
@ -0,0 +1,3 @@
|
||||
KDE_LANG = bg
|
||||
SUBDIRS = $(AUTODIRS)
|
||||
POFILES = AUTO
|
@ -0,0 +1,3 @@
|
||||
KDE_LANG = br
|
||||
SUBDIRS = $(AUTODIRS)
|
||||
POFILES = AUTO
|