mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
merge major restructuring of the gnome code from the rlbig branch.
This code originally from a large patch from Rob Browning. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1647 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
40375e930f
commit
d50032670e
@ -23,7 +23,10 @@ MOTIF_OBJS += $(addprefix obj/motif/,${MOTIF_SRCS:.c=.o})
|
||||
QT_OBJS := $(addprefix obj/qt/,${COMMON_SRCS:.c=.o})
|
||||
QT_OBJS += $(addprefix obj/qt/,${QT_SRCS:.cpp=.o})
|
||||
|
||||
GTK_CFLAGS := $(shell gtk-config --cflags)
|
||||
ifdef GNOME_CONFIG_BIN
|
||||
GNOME_CFLAGS += $(shell ${GNOME_CONFIG_BIN} --cflags gnomeui)
|
||||
endif
|
||||
|
||||
QT_FLAGS :=
|
||||
|
||||
%.c : %.h
|
||||
@ -51,12 +54,12 @@ obj/%.o: %.c
|
||||
|
||||
obj/motif/%.o: %.c
|
||||
@if [ ! -e $(dir $@) ]; then mkdir -p $(dir $@); fi
|
||||
$(CC) -Wp,-MD,$(basename $@).d.tmp -c $(CFLAGS) -DMOTIF -o $@ $<
|
||||
$(CC) -Wp,-MD,$(basename $@).d.tmp -c $(CFLAGS) ${MOTIF_CFLAGS} -DMOTIF -o $@ $<
|
||||
${cleanupdeps}
|
||||
|
||||
obj/gnome/%.o: %.c
|
||||
@if [ ! -e $(dir $@) ]; then mkdir -p $(dir $@); fi
|
||||
$(CC) -Wp,-MD,$(basename $@).d.tmp -c $(CFLAGS) ${GTK_CFLAGS} -DGNOME -o $@ $<
|
||||
$(CC) -Wp,-MD,$(basename $@).d.tmp -c $(CFLAGS) ${GNOME_CFLAGS} -DGNOME -o $@ $<
|
||||
${cleanupdeps}
|
||||
|
||||
obj/qt/%.o: %.cpp
|
||||
|
@ -42,4 +42,4 @@ GNC_CONFIGDIR=@GNC_CONFIGDIR@
|
||||
GNC_SHAREDIR=@GNC_SHAREDIR@
|
||||
|
||||
HAVE_PLOTUTILS=@HAVE_PLOTUTILS@
|
||||
LIBNANA = @LIBNANA@ # -lnana, if defined
|
||||
GNOME_CONFIG_BIN=@GNOME_CONFIG_BIN@
|
||||
|
1
README
1
README
@ -170,6 +170,7 @@ guile -- Provides main extension language infrastructure.
|
||||
ftp://ftp.gnucash.org/pub/gnucash/extra_libs/TAR/guile-core-19980818.tar.gz
|
||||
guile-core-19980818-1.i386.rpm works
|
||||
guile-1.3.1-1 from redhat.com/pub/rawhide works ...
|
||||
slib -- scheme libraries for guile. Need version slib2c0 or later.
|
||||
eperl -- embeddedPerl needed for Reports. The menu item "Reports" will not
|
||||
work witout this.
|
||||
version eperl-2.2.14 works well with perl 5.00404
|
||||
|
220
configure
vendored
220
configure
vendored
@ -1180,6 +1180,43 @@ if test "${with_gnome_config+set}" = set; then
|
||||
fi
|
||||
|
||||
|
||||
# If the user hasn't specified the binary, then try to find it.
|
||||
if test x"${GNOME_CONFIG_BIN}" = x
|
||||
then
|
||||
# Extract the first word of "gnome-config", so it can be a program name with args.
|
||||
set dummy gnome-config; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1190: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG_BIN'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
case "$GNOME_CONFIG_BIN" in
|
||||
/*)
|
||||
ac_cv_path_GNOME_CONFIG_BIN="$GNOME_CONFIG_BIN" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
ac_cv_path_GNOME_CONFIG_BIN="$ac_dir/$ac_word"
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
test -z "$ac_cv_path_GNOME_CONFIG_BIN" && ac_cv_path_GNOME_CONFIG_BIN="GNOME_CONFIG_NOT_FOUND"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
GNOME_CONFIG_BIN="$ac_cv_path_GNOME_CONFIG_BIN"
|
||||
if test -n "$GNOME_CONFIG_BIN"; then
|
||||
echo "$ac_t""$GNOME_CONFIG_BIN" 1>&6
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
# Let the user specify a guile-config executable.
|
||||
# XXX My guile-1.3 doesn't have a guile-config, but maybe I'm
|
||||
@ -1206,7 +1243,7 @@ LIBS="$LIBS -lm"
|
||||
# important.
|
||||
|
||||
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
|
||||
echo "configure:1210: checking how to run the C preprocessor" >&5
|
||||
echo "configure:1247: checking how to run the C preprocessor" >&5
|
||||
# On Suns, sometimes $CPP names a directory.
|
||||
if test -n "$CPP" && test -d "$CPP"; then
|
||||
CPP=
|
||||
@ -1221,13 +1258,13 @@ else
|
||||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||
# not just through cpp.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1225 "configure"
|
||||
#line 1262 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1268: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@ -1238,13 +1275,13 @@ else
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1242 "configure"
|
||||
#line 1279 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@ -1271,7 +1308,7 @@ echo "$ac_t""$CPP" 1>&6
|
||||
# Uses ac_ vars as temps to allow command line to override cache and checks.
|
||||
# --without-x overrides everything else, but does not touch the cache.
|
||||
echo $ac_n "checking for X""... $ac_c" 1>&6
|
||||
echo "configure:1275: checking for X" >&5
|
||||
echo "configure:1312: checking for X" >&5
|
||||
|
||||
# Check whether --with-x or --without-x was given.
|
||||
if test "${with_x+set}" = set; then
|
||||
@ -1333,12 +1370,12 @@ if test "$ac_x_includes" = NO; then
|
||||
|
||||
# First, try using that file with no special directory specified.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1337 "configure"
|
||||
#line 1374 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$x_direct_test_include>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1342: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1379: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
@ -1407,14 +1444,14 @@ if test "$ac_x_libraries" = NO; then
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-l$x_direct_test_library $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1411 "configure"
|
||||
#line 1448 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
${x_direct_test_function}()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
LIBS="$ac_save_LIBS"
|
||||
# We can link X programs with no special library path.
|
||||
@ -1520,17 +1557,17 @@ else
|
||||
case "`(uname -sr) 2>/dev/null`" in
|
||||
"SunOS 5"*)
|
||||
echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6
|
||||
echo "configure:1524: checking whether -R must be followed by a space" >&5
|
||||
echo "configure:1561: checking whether -R must be followed by a space" >&5
|
||||
ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1527 "configure"
|
||||
#line 1564 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
ac_R_nospace=yes
|
||||
else
|
||||
@ -1546,14 +1583,14 @@ rm -f conftest*
|
||||
else
|
||||
LIBS="$ac_xsave_LIBS -R $x_libraries"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1550 "configure"
|
||||
#line 1587 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
ac_R_space=yes
|
||||
else
|
||||
@ -1585,7 +1622,7 @@ rm -f conftest*
|
||||
# libraries were built with DECnet support. And karl@cs.umb.edu says
|
||||
# the Alpha needs dnet_stub (dnet does not exist).
|
||||
echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
|
||||
echo "configure:1589: checking for dnet_ntoa in -ldnet" >&5
|
||||
echo "configure:1626: checking for dnet_ntoa in -ldnet" >&5
|
||||
ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -1593,7 +1630,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-ldnet $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1597 "configure"
|
||||
#line 1634 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -1604,7 +1641,7 @@ int main() {
|
||||
dnet_ntoa()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -1626,7 +1663,7 @@ fi
|
||||
|
||||
if test $ac_cv_lib_dnet_dnet_ntoa = no; then
|
||||
echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
|
||||
echo "configure:1630: checking for dnet_ntoa in -ldnet_stub" >&5
|
||||
echo "configure:1667: checking for dnet_ntoa in -ldnet_stub" >&5
|
||||
ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -1634,7 +1671,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-ldnet_stub $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1638 "configure"
|
||||
#line 1675 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -1645,7 +1682,7 @@ int main() {
|
||||
dnet_ntoa()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1649: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -1674,12 +1711,12 @@ fi
|
||||
# The nsl library prevents programs from opening the X display
|
||||
# on Irix 5.2, according to dickey@clark.net.
|
||||
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
|
||||
echo "configure:1678: checking for gethostbyname" >&5
|
||||
echo "configure:1715: checking for gethostbyname" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1683 "configure"
|
||||
#line 1720 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char gethostbyname(); below. */
|
||||
@ -1702,7 +1739,7 @@ gethostbyname();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_gethostbyname=yes"
|
||||
else
|
||||
@ -1723,7 +1760,7 @@ fi
|
||||
|
||||
if test $ac_cv_func_gethostbyname = no; then
|
||||
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
|
||||
echo "configure:1727: checking for gethostbyname in -lnsl" >&5
|
||||
echo "configure:1764: checking for gethostbyname in -lnsl" >&5
|
||||
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -1731,7 +1768,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lnsl $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1735 "configure"
|
||||
#line 1772 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -1742,7 +1779,7 @@ int main() {
|
||||
gethostbyname()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -1772,12 +1809,12 @@ fi
|
||||
# -lsocket must be given before -lnsl if both are needed.
|
||||
# We assume that if connect needs -lnsl, so does gethostbyname.
|
||||
echo $ac_n "checking for connect""... $ac_c" 1>&6
|
||||
echo "configure:1776: checking for connect" >&5
|
||||
echo "configure:1813: checking for connect" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1781 "configure"
|
||||
#line 1818 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char connect(); below. */
|
||||
@ -1800,7 +1837,7 @@ connect();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1804: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1841: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_connect=yes"
|
||||
else
|
||||
@ -1821,7 +1858,7 @@ fi
|
||||
|
||||
if test $ac_cv_func_connect = no; then
|
||||
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
|
||||
echo "configure:1825: checking for connect in -lsocket" >&5
|
||||
echo "configure:1862: checking for connect in -lsocket" >&5
|
||||
ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -1829,7 +1866,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1833 "configure"
|
||||
#line 1870 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -1840,7 +1877,7 @@ int main() {
|
||||
connect()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1844: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -1864,12 +1901,12 @@ fi
|
||||
|
||||
# gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
|
||||
echo $ac_n "checking for remove""... $ac_c" 1>&6
|
||||
echo "configure:1868: checking for remove" >&5
|
||||
echo "configure:1905: checking for remove" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1873 "configure"
|
||||
#line 1910 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char remove(); below. */
|
||||
@ -1892,7 +1929,7 @@ remove();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1896: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_remove=yes"
|
||||
else
|
||||
@ -1913,7 +1950,7 @@ fi
|
||||
|
||||
if test $ac_cv_func_remove = no; then
|
||||
echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
|
||||
echo "configure:1917: checking for remove in -lposix" >&5
|
||||
echo "configure:1954: checking for remove in -lposix" >&5
|
||||
ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -1921,7 +1958,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lposix $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1925 "configure"
|
||||
#line 1962 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -1932,7 +1969,7 @@ int main() {
|
||||
remove()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1936: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1973: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -1956,12 +1993,12 @@ fi
|
||||
|
||||
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
|
||||
echo $ac_n "checking for shmat""... $ac_c" 1>&6
|
||||
echo "configure:1960: checking for shmat" >&5
|
||||
echo "configure:1997: checking for shmat" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1965 "configure"
|
||||
#line 2002 "configure"
|
||||
#include "confdefs.h"
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char shmat(); below. */
|
||||
@ -1984,7 +2021,7 @@ shmat();
|
||||
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1988: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:2025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_func_shmat=yes"
|
||||
else
|
||||
@ -2005,7 +2042,7 @@ fi
|
||||
|
||||
if test $ac_cv_func_shmat = no; then
|
||||
echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
|
||||
echo "configure:2009: checking for shmat in -lipc" >&5
|
||||
echo "configure:2046: checking for shmat in -lipc" >&5
|
||||
ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -2013,7 +2050,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lipc $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2017 "configure"
|
||||
#line 2054 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -2024,7 +2061,7 @@ int main() {
|
||||
shmat()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:2065: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -2057,7 +2094,7 @@ fi
|
||||
# libraries we check for below, so use a different variable.
|
||||
# --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
|
||||
echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
|
||||
echo "configure:2061: checking for IceConnectionNumber in -lICE" >&5
|
||||
echo "configure:2098: checking for IceConnectionNumber in -lICE" >&5
|
||||
ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -2065,7 +2102,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lICE $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2069 "configure"
|
||||
#line 2106 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -2076,7 +2113,7 @@ int main() {
|
||||
IceConnectionNumber()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:2117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -2140,6 +2177,10 @@ fi
|
||||
### Gnome libs -- these are needed for the gnome builds only
|
||||
# Let the user specify gnome paths:
|
||||
# -I...libgnomesupport is to fix bug in gnome-1.3 release
|
||||
#
|
||||
# I believe all the gnome configuration can and should be superceded by
|
||||
# --with-gnome-config.
|
||||
|
||||
# Check whether --with-gnome or --without-gnome was given.
|
||||
if test "${with_gnome+set}" = set; then
|
||||
withval="$with_gnome"
|
||||
@ -2189,7 +2230,7 @@ fi
|
||||
# the XmHTML widget needs libz, libjpeg, libpng and libm
|
||||
# it also uses #ifdef's not #if's so DONT #def to zero.
|
||||
echo $ac_n "checking for deflateEnd in -lz""... $ac_c" 1>&6
|
||||
echo "configure:2193: checking for deflateEnd in -lz" >&5
|
||||
echo "configure:2234: checking for deflateEnd in -lz" >&5
|
||||
ac_lib_var=`echo z'_'deflateEnd | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -2197,7 +2238,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lz $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2201 "configure"
|
||||
#line 2242 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -2208,7 +2249,7 @@ int main() {
|
||||
deflateEnd()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2212: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:2253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -2232,7 +2273,7 @@ else
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for jpeg_read_scanlines in -ljpeg""... $ac_c" 1>&6
|
||||
echo "configure:2236: checking for jpeg_read_scanlines in -ljpeg" >&5
|
||||
echo "configure:2277: checking for jpeg_read_scanlines in -ljpeg" >&5
|
||||
ac_lib_var=`echo jpeg'_'jpeg_read_scanlines | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -2240,7 +2281,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-ljpeg $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2244 "configure"
|
||||
#line 2285 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -2251,7 +2292,7 @@ int main() {
|
||||
jpeg_read_scanlines()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:2296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -2275,7 +2316,7 @@ else
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for png_read_image in -lpng""... $ac_c" 1>&6
|
||||
echo "configure:2279: checking for png_read_image in -lpng" >&5
|
||||
echo "configure:2320: checking for png_read_image in -lpng" >&5
|
||||
ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -2283,7 +2324,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lpng $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2287 "configure"
|
||||
#line 2328 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -2294,7 +2335,7 @@ int main() {
|
||||
png_read_image()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2298: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:2339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -2324,7 +2365,7 @@ fi
|
||||
# LIBS="-lXmu -lXt -lXext $X_PRE_LIBS -lX11 $X_LIBS $X_EXTRA_LIBS $LIBS"
|
||||
|
||||
echo $ac_n "checking for XpmReadFileToXpmImage in -lXpm""... $ac_c" 1>&6
|
||||
echo "configure:2328: checking for XpmReadFileToXpmImage in -lXpm" >&5
|
||||
echo "configure:2369: checking for XpmReadFileToXpmImage in -lXpm" >&5
|
||||
ac_lib_var=`echo Xpm'_'XpmReadFileToXpmImage | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -2332,7 +2373,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lXpm -L$x_libraries -lX11 $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2336 "configure"
|
||||
#line 2377 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -2343,7 +2384,7 @@ int main() {
|
||||
XpmReadFileToXpmImage()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2347: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:2388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -2374,7 +2415,7 @@ fi
|
||||
# Don't build the xmhtml source if user already has it installed...
|
||||
# this is ugly, there must be a nicer way of setting this up ...
|
||||
echo $ac_n "checking for XmHTMLTextScrollToLine in -lXmHTML""... $ac_c" 1>&6
|
||||
echo "configure:2378: checking for XmHTMLTextScrollToLine in -lXmHTML" >&5
|
||||
echo "configure:2419: checking for XmHTMLTextScrollToLine in -lXmHTML" >&5
|
||||
ac_lib_var=`echo XmHTML'_'XmHTMLTextScrollToLine | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -2382,7 +2423,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lXmHTML $X_PRE_LIBS $MOTIF_LIBS $X_EXTRA_LIBS $X_LIBS $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2386 "configure"
|
||||
#line 2427 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -2393,7 +2434,7 @@ int main() {
|
||||
XmHTMLTextScrollToLine()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:2438: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -2428,17 +2469,17 @@ for ac_hdr in nana.h
|
||||
do
|
||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||
echo "configure:2432: checking for $ac_hdr" >&5
|
||||
echo "configure:2473: checking for $ac_hdr" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2437 "configure"
|
||||
#line 2478 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <$ac_hdr>
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:2442: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:2483: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
rm -rf conftest*
|
||||
@ -2465,7 +2506,7 @@ fi
|
||||
done
|
||||
|
||||
echo $ac_n "checking for L_buffer_create in -lnana""... $ac_c" 1>&6
|
||||
echo "configure:2469: checking for L_buffer_create in -lnana" >&5
|
||||
echo "configure:2510: checking for L_buffer_create in -lnana" >&5
|
||||
ac_lib_var=`echo nana'_'L_buffer_create | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -2473,7 +2514,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lnana $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2477 "configure"
|
||||
#line 2518 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -2484,7 +2525,7 @@ int main() {
|
||||
L_buffer_create()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:2529: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -2509,7 +2550,7 @@ fi
|
||||
### ------------------------------------------------------------------------------
|
||||
# If readline exists, just assume that guile needs it. It probably does.
|
||||
echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
|
||||
echo "configure:2513: checking for readline in -lreadline" >&5
|
||||
echo "configure:2554: checking for readline in -lreadline" >&5
|
||||
ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -2517,7 +2558,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lreadline $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2521 "configure"
|
||||
#line 2562 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -2528,7 +2569,7 @@ int main() {
|
||||
readline()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2532: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:2573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -2564,11 +2605,11 @@ fi
|
||||
# results, so one failure makes all further attempts fail.
|
||||
|
||||
echo $ac_n "checking for guile""... $ac_c" 1>&6
|
||||
echo "configure:2568: checking for guile" >&5
|
||||
echo "configure:2609: checking for guile" >&5
|
||||
|
||||
GNC_LIBS_SAFE=${LIBS}
|
||||
echo $ac_n "checking for guile""... $ac_c" 1>&6
|
||||
echo "configure:2572: checking for guile" >&5
|
||||
echo "configure:2613: checking for guile" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_guile'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@ -2581,14 +2622,14 @@ else
|
||||
else
|
||||
LIBS="${GNC_TEST_LIBS} ${GNC_LIBS_SAFE}"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2585 "configure"
|
||||
#line 2626 "configure"
|
||||
#include "confdefs.h"
|
||||
#include<guile/gh.h>
|
||||
int main() {
|
||||
gh_eval_file;
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:2633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
GUILELIBS="${GNC_TEST_LIBS}"
|
||||
else
|
||||
@ -2615,7 +2656,7 @@ fi
|
||||
### Plotutils
|
||||
|
||||
echo $ac_n "checking for openpl in -lplot""... $ac_c" 1>&6
|
||||
echo "configure:2619: checking for openpl in -lplot" >&5
|
||||
echo "configure:2660: checking for openpl in -lplot" >&5
|
||||
ac_lib_var=`echo plot'_'openpl | sed 'y%./+-%__p_%'`
|
||||
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@ -2623,7 +2664,7 @@ else
|
||||
ac_save_LIBS="$LIBS"
|
||||
LIBS="-lplot $X_PRE_LIBS $MOTIF_LIBS $X_EXTRA_LIBS -lXaw $X_LIBS $LIBS"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 2627 "configure"
|
||||
#line 2668 "configure"
|
||||
#include "confdefs.h"
|
||||
/* Override any gcc2 internal prototype to avoid an error. */
|
||||
/* We use char because int might match the return type of a gcc2
|
||||
@ -2634,7 +2675,7 @@ int main() {
|
||||
openpl()
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:2638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:2679: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||
else
|
||||
@ -2653,9 +2694,10 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
|
||||
#define HAVE_PLOTUTILS 1
|
||||
EOF
|
||||
|
||||
HAVE_PLOTUTILS=1
|
||||
LIBS="-lplot $LIBS"
|
||||
X_LIBS="-lXaw $X_LIBS"
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define PLOTUTILS_LIBS "-lXaw -lXt -lplot"
|
||||
EOF
|
||||
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
@ -2663,6 +2705,7 @@ fi
|
||||
|
||||
# We need this in at least one of the Makefile.in's
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -2711,7 +2754,14 @@ GNC_RUNTIME_CONFIGDIR=`eval echo ${GNC_CONFIGDIR}`
|
||||
|
||||
|
||||
|
||||
# *******************************************
|
||||
# UGLY HACK
|
||||
|
||||
GTKSHEET_DIR="gtksheet-5.7"
|
||||
|
||||
|
||||
CFLAGS="${CFLAGS} -Werror"
|
||||
|
||||
*******************************************
|
||||
|
||||
|
||||
trap '' 1 2 15
|
||||
@ -2831,6 +2881,7 @@ trap 'rm -fr `echo "Makefile
|
||||
src/swig/guile/Makefile
|
||||
src/swig/perl5/Makefile
|
||||
lib/Makefile
|
||||
lib/${GTKSHEET_DIR}/Makefile
|
||||
lib/Xbae-4.6.2-linas/Makefile
|
||||
lib/Xbae-4.6.2-linas/src/Makefile
|
||||
lib/ComboBox-1.33/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
|
||||
@ -2884,6 +2935,7 @@ s%@LIBNANA@%$LIBNANA%g
|
||||
s%@GUILE_INC@%$GUILE_INC%g
|
||||
s%@GUILELIBS@%$GUILELIBS%g
|
||||
s%@HAVE_PLOTUTILS@%$HAVE_PLOTUTILS%g
|
||||
s%@PLOTUTILS_LIBS@%$PLOTUTILS_LIBS%g
|
||||
s%@MOTIF_LIBS@%$MOTIF_LIBS%g
|
||||
s%@GNC_DOCDIR@%$GNC_DOCDIR%g
|
||||
s%@GNC_BINDIR@%$GNC_BINDIR%g
|
||||
@ -2892,6 +2944,7 @@ s%@GNC_CONFIGDIR@%$GNC_CONFIGDIR%g
|
||||
s%@GNC_SHAREDIR@%$GNC_SHAREDIR%g
|
||||
s%@GNC_RUNTIME_SHAREDIR@%$GNC_RUNTIME_SHAREDIR%g
|
||||
s%@GNC_RUNTIME_CONFIGDIR@%$GNC_RUNTIME_CONFIGDIR%g
|
||||
s%@GTKSHEET_DIR@%$GTKSHEET_DIR%g
|
||||
|
||||
CEOF
|
||||
EOF
|
||||
@ -2949,6 +3002,7 @@ CONFIG_FILES=\${CONFIG_FILES-"Makefile
|
||||
src/swig/guile/Makefile
|
||||
src/swig/perl5/Makefile
|
||||
lib/Makefile
|
||||
lib/${GTKSHEET_DIR}/Makefile
|
||||
lib/Xbae-4.6.2-linas/Makefile
|
||||
lib/Xbae-4.6.2-linas/src/Makefile
|
||||
lib/ComboBox-1.33/Makefile"}
|
||||
|
25
configure.in
25
configure.in
@ -122,6 +122,12 @@ GNOME_CONFIG_BIN="gnome-config"
|
||||
AC_ARG_WITH( gnome-config,
|
||||
[ --with-gnome-config=executable which gnome-config to use to find gnome ],
|
||||
GNOME_CONFIG_BIN="$with_gnome_config")
|
||||
|
||||
# If the user hasn't specified the binary, then try to find it.
|
||||
if test x"${GNOME_CONFIG_BIN}" = x
|
||||
then
|
||||
AC_PATH_PROG(GNOME_CONFIG_BIN, gnome-config, GNOME_CONFIG_NOT_FOUND)
|
||||
fi
|
||||
AC_SUBST(GNOME_CONFIG_BIN)
|
||||
|
||||
# Let the user specify a guile-config executable.
|
||||
@ -181,6 +187,10 @@ AC_ARG_WITH( motif-libraries,
|
||||
### Gnome libs -- these are needed for the gnome builds only
|
||||
# Let the user specify gnome paths:
|
||||
# -I...libgnomesupport is to fix bug in gnome-1.3 release
|
||||
#
|
||||
# I believe all the gnome configuration can and should be superceded by
|
||||
# --with-gnome-config.
|
||||
|
||||
AC_ARG_WITH( gnome,
|
||||
[ --with-gnome=PATH specify where to look for gnome includes and libs],
|
||||
X_LIBS="${X_LIBS} -L$with_gnome/lib" X_CFLAGS="$X_CFLAGS -I$with_gnome/include -I$with_gnome/lib/gnome-libs/include" )
|
||||
@ -291,14 +301,13 @@ AC_SUBST(GUILELIBS)
|
||||
|
||||
AC_CHECK_LIB(plot, openpl,
|
||||
AC_DEFINE(HAVE_PLOTUTILS,1)
|
||||
HAVE_PLOTUTILS=1
|
||||
LIBS="-lplot $LIBS"
|
||||
X_LIBS="-lXaw $X_LIBS",
|
||||
AC_DEFINE(PLOTUTILS_LIBS,"-lXaw -lXt -lplot"),
|
||||
,
|
||||
$X_PRE_LIBS $MOTIF_LIBS $X_EXTRA_LIBS -lXaw $X_LIBS)
|
||||
|
||||
# We need this in at least one of the Makefile.in's
|
||||
AC_SUBST(HAVE_PLOTUTILS)
|
||||
AC_SUBST(PLOTUTILS_LIBS)
|
||||
|
||||
AC_SUBST(MOTIF_LIBS)
|
||||
|
||||
@ -347,7 +356,14 @@ GNC_RUNTIME_CONFIGDIR=`eval echo ${GNC_CONFIGDIR}`
|
||||
AC_SUBST(GNC_RUNTIME_SHAREDIR)
|
||||
AC_SUBST(GNC_RUNTIME_CONFIGDIR)
|
||||
|
||||
# *******************************************
|
||||
# UGLY HACK
|
||||
|
||||
GTKSHEET_DIR="gtksheet-5.7"
|
||||
AC_SUBST(GTKSHEET_DIR)
|
||||
|
||||
CFLAGS="${CFLAGS} -Werror"
|
||||
|
||||
*******************************************
|
||||
AC_CONFIG_HEADER(config.h)
|
||||
|
||||
AC_OUTPUT(Makefile
|
||||
@ -366,6 +382,7 @@ AC_OUTPUT(Makefile
|
||||
src/swig/guile/Makefile
|
||||
src/swig/perl5/Makefile
|
||||
lib/Makefile
|
||||
lib/${GTKSHEET_DIR}/Makefile
|
||||
lib/Xbae-4.6.2-linas/Makefile
|
||||
lib/Xbae-4.6.2-linas/src/Makefile
|
||||
lib/ComboBox-1.33/Makefile)
|
||||
|
14
gnucash.gdb-cmds
Normal file
14
gnucash.gdb-cmds
Normal file
@ -0,0 +1,14 @@
|
||||
# You can debug gnucash by running gdb as "gdb -x gnucash.gdb-cmds"
|
||||
# and then executing "run-gnucash somefile".
|
||||
|
||||
file gnucash.bin
|
||||
|
||||
define run-gnucash
|
||||
set args --debug \
|
||||
--startup-dir ./share/scm/startup \
|
||||
--share-dir ./share \
|
||||
--config-dir ./etc \
|
||||
--load-path \
|
||||
"(\"(./share/scm)\")" --doc-path "(\"(./Docs)\"\"(./Reports)\")" $arg0
|
||||
run
|
||||
end
|
52
src/AccWindow.h
Normal file
52
src/AccWindow.h
Normal file
@ -0,0 +1,52 @@
|
||||
/********************************************************************\
|
||||
* AccWindow.h -- window for creating new accounts for xacc *
|
||||
* (X-Accountant) *
|
||||
* Copyright (C) 1997 Robin D. Clark *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program 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 this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
* Author: Rob Clark *
|
||||
* Internet: rclark@cs.hmc.edu *
|
||||
* Address: 609 8th Street *
|
||||
* Huntington Beach, CA 92648-4632 *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef __XACC_NEWACCWINDOW_H__
|
||||
#define __XACC_NEWACCWINDOW_H__
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "Account.h"
|
||||
#include "Group.h"
|
||||
|
||||
/** PROTOTYPES ******************************************************/
|
||||
typedef struct _accwindow AccWindow;
|
||||
typedef struct _editaccwindow EditAccWindow;
|
||||
typedef struct _editnoteswindow EditNotesWindow;
|
||||
|
||||
AccWindow * accWindow( AccountGroup *grp);
|
||||
EditAccWindow * editAccWindow( Account *account );
|
||||
EditNotesWindow * editNotesWindow (Account *acc);
|
||||
|
||||
|
||||
/*
|
||||
* The xaccDestroyEditAccWindow() subroutine can be called from
|
||||
* anywhere to shut down the Register window. Used primarily when
|
||||
* destroying the underlying account.
|
||||
*/
|
||||
void xaccDestroyEditAccWindow (Account *);
|
||||
void xaccDestroyEditNotesWindow (Account *);
|
||||
|
||||
#endif /* __XACC_NEWACCWINDOW_H__ */
|
@ -1,6 +1,5 @@
|
||||
/********************************************************************\
|
||||
* xtutil.h -- utility functions that are used everywhere else for *
|
||||
* xacc (X-Accountant) *
|
||||
* AdjBWindow.h -- the adjust balance window *
|
||||
* Copyright (C) 1997 Robin D. Clark *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
@ -23,28 +22,26 @@
|
||||
* Huntington Beach, CA 92648-4632 *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef __XACC_XT_UTIL_H__
|
||||
#define __XACC_XT_UTIL_H__
|
||||
|
||||
#include <gnome.h>
|
||||
#include <stdlib.h>
|
||||
#ifndef __XACC_ADJBWINDOW_H__
|
||||
#define __XACC_ADJBWINDOW_H__
|
||||
|
||||
#include "config.h"
|
||||
|
||||
/** PROTOTYPES ******************************************************/
|
||||
#include "Account.h"
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* The adjBWindow() subroutine creates the "adjust-balance" dialog
|
||||
* for the indicated account, if that dialog is not already mapped.
|
||||
* If the dialog already esits, it returns with a no-op.
|
||||
*
|
||||
* The xaccDestroyAdjBWindow() subroutine can be called from
|
||||
* anywhere to shut down the Register window. Used primarily when
|
||||
* destroying the underlying account.
|
||||
*/
|
||||
|
||||
void dateCB( Widget mw, XtPointer cd, XtPointer cb );
|
||||
void amountCB( Widget mw, XtPointer cd, XtPointer cb );
|
||||
void noeditCB( Widget mw, XtPointer cd, XtPointer cb );
|
||||
void destroyShellCB( Widget w, XtPointer cd, XtPointer cb );
|
||||
void setBusyCursor( GtkWidget *w );
|
||||
void unsetBusyCursor( GtkWidget *w );
|
||||
void errorBox( GtkWidget *parent, const char *message );
|
||||
typedef struct _AdjBWindow AdjBWindow;
|
||||
|
||||
#endif
|
||||
AdjBWindow *adjBWindow(Account *account);
|
||||
void xaccDestroyAdjBWindow (Account *);
|
||||
|
||||
gboolean verifyBox( GtkWidget *parent, const char *text );
|
||||
|
||||
#endif /* __XACC_XT_UTIL_H__ */
|
||||
#endif /* __XACC_ADJBWINDOW_H__ */
|
78
src/Destroy.c
Normal file
78
src/Destroy.c
Normal file
@ -0,0 +1,78 @@
|
||||
/*******************************************************************\
|
||||
* Destroy.c -- utilities for the window destruction (X-Accountant) *
|
||||
* Copyright (C) 1997 Linas Vepstas *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program 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 this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "Account.h"
|
||||
#include "AccWindow.h"
|
||||
#include "AdjBWindow.h"
|
||||
#include "Destroy.h"
|
||||
#include "Group.h"
|
||||
#include "LedgerUtils.h"
|
||||
#include "MultiLedger.h"
|
||||
#include "RecnWindow.h"
|
||||
#include "util.h"
|
||||
|
||||
|
||||
/* ------------------------------------------------------ */
|
||||
void
|
||||
xaccAccountWindowDestroy (Account *acc)
|
||||
{
|
||||
int i;
|
||||
AccountGroup *acc_children;
|
||||
|
||||
if (!acc) return;
|
||||
|
||||
/* recursively destroy windows associated with children */
|
||||
acc_children = xaccAccountGetChildren (acc);
|
||||
if (acc_children) {
|
||||
int nacc = xaccGroupGetNumAccounts (acc_children);
|
||||
for (i=0; i<nacc; i++) {
|
||||
Account *child = xaccGroupGetAccount (acc_children, i);
|
||||
xaccAccountWindowDestroy (child);
|
||||
}
|
||||
}
|
||||
|
||||
xaccDestroyLedgerDisplay (acc);
|
||||
xaccDestroyRecnWindow (acc);
|
||||
xaccDestroyAdjBWindow (acc);
|
||||
xaccDestroyEditAccWindow (acc);
|
||||
xaccDestroyEditNotesWindow (acc);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------ */
|
||||
|
||||
void
|
||||
xaccGroupWindowDestroy (AccountGroup *grp)
|
||||
{
|
||||
int i;
|
||||
int nacc;
|
||||
|
||||
if (!grp) return;
|
||||
|
||||
/* recursively destroy windows associated with children */
|
||||
nacc = xaccGroupGetNumAccounts (grp);
|
||||
for (i=0; i<nacc; i++) {
|
||||
Account *acc = xaccGroupGetAccount (grp, i);
|
||||
xaccAccountWindowDestroy (acc);
|
||||
}
|
||||
}
|
||||
|
||||
/************************** END OF FILE *************************/
|
34
src/Destroy.h
Normal file
34
src/Destroy.h
Normal file
@ -0,0 +1,34 @@
|
||||
/*******************************************************************\
|
||||
* Destroy.h -- utilities for the window destruction (X-Accountant) *
|
||||
* Copyright (C) 1997 Linas Vepstas *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program 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 this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
|
||||
#ifndef __XACC_DESTROY_H__
|
||||
#define __XACC_DESTROY_H__
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "Account.h"
|
||||
#include "Group.h"
|
||||
|
||||
void xaccAccountWindowDestroy (Account *acc);
|
||||
void xaccGroupWindowDestroy (AccountGroup *grp);
|
||||
|
||||
|
||||
#endif /* __XACC_DESTROY_H__ */
|
@ -1,7 +1,6 @@
|
||||
/********************************************************************\
|
||||
* FileBox.c -- the gnome file dialog box *
|
||||
* FileBox.c -- the file dialog box *
|
||||
* Copyright (C) 1997 Robin D. Clark *
|
||||
* Copyright (C) 1998 Rob Browning <rlb@cs.utexas.edu> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
@ -16,16 +15,19 @@
|
||||
* You should have received a copy of the GNU General Public License*
|
||||
* along with this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
* Author: Rob Clark *
|
||||
* Internet: rclark@cs.hmc.edu *
|
||||
* Address: 609 8th Street *
|
||||
* Huntington Beach, CA 92648-4632 *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef __FILEBOX_H__
|
||||
#define __FILEBOX_H__
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
/** PROTOTYPES ******************************************************/
|
||||
char *fileBox( GtkWidget parent, char * title, char * filter );
|
||||
char *fileBox( const char * title, const char * filter );
|
||||
|
||||
#endif
|
509
src/FileDialog.c
Normal file
509
src/FileDialog.c
Normal file
@ -0,0 +1,509 @@
|
||||
/********************************************************************\
|
||||
* FileDialog.c -- file-handling utility dialogs for gnucash. *
|
||||
* *
|
||||
* Copyright (C) 1997 Robin D. Clark *
|
||||
* Copyright (C) 1998, 1999 Linas Vepstas *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program 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 this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
\********************************************************************/
|
||||
|
||||
/*
|
||||
* hack alert -- the contents of this file are 99.997% motif independent.
|
||||
* this file should be moved to a neutral directory, and recycled for use
|
||||
* with the gtk/gnome code.
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "FileBox.h"
|
||||
#include "FileDialog.h"
|
||||
#include "FileIO.h"
|
||||
#include "Group.h"
|
||||
#include "messages.h"
|
||||
#include "Session.h"
|
||||
#include "TransLog.h"
|
||||
#include "Destroy.h"
|
||||
#include "util.h"
|
||||
#include "ui-callbacks.h"
|
||||
|
||||
/* This static indicates the debugging module that this .o belongs to. */
|
||||
// static short module = MOD_GUI;
|
||||
|
||||
/** GLOBALS *********************************************************/
|
||||
Session *current_session = NULL;
|
||||
AccountGroup *topgroup = NULL; /* the current top of the heriarchy */
|
||||
|
||||
/********************************************************************\
|
||||
* fileMenubarCB -- handles file menubar choices *
|
||||
\********************************************************************/
|
||||
|
||||
#define SHOW_IO_ERR_MSG(io_error) { \
|
||||
switch (io_error) { \
|
||||
case ERR_FILEIO_NO_ERROR: \
|
||||
break; \
|
||||
case ERR_FILEIO_FILE_NOT_FOUND: \
|
||||
sprintf (buf, FILE_NOT_FOUND_MSG, newfile); \
|
||||
errorBox (buf); \
|
||||
uh_oh = 1; \
|
||||
break; \
|
||||
case ERR_FILEIO_FILE_EMPTY: \
|
||||
sprintf (buf, FILE_EMPTY_MSG, newfile); \
|
||||
errorBox (buf); \
|
||||
uh_oh = 1; \
|
||||
break; \
|
||||
case ERR_FILEIO_FILE_TOO_NEW: \
|
||||
errorBox ( FILE_TOO_NEW_MSG); \
|
||||
uh_oh = 1; \
|
||||
break; \
|
||||
case ERR_FILEIO_FILE_TOO_OLD: \
|
||||
if (!verifyBox( FILE_TOO_OLD_MSG )) { \
|
||||
xaccFreeAccountGroup (newgrp); \
|
||||
newgrp = NULL; \
|
||||
uh_oh = 1; \
|
||||
} \
|
||||
break; \
|
||||
case ERR_FILEIO_FILE_BAD_READ: \
|
||||
if (!verifyBox( FILE_BAD_READ_MSG )) { \
|
||||
xaccFreeAccountGroup (newgrp); \
|
||||
newgrp = NULL; \
|
||||
uh_oh = 1; \
|
||||
} \
|
||||
break; \
|
||||
default: \
|
||||
break; \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#define SHOW_LOCK_ERR_MSG(session) \
|
||||
{ \
|
||||
int norr = xaccSessionGetError (session); \
|
||||
if (ETXTBSY == norr) \
|
||||
{ \
|
||||
sprintf (buf, FMB_LOCKED_MSG, newfile); \
|
||||
errorBox (buf); \
|
||||
uh_oh = 1; \
|
||||
} \
|
||||
else \
|
||||
if (norr) \
|
||||
{ \
|
||||
sprintf (buf, FMB_INVALID_MSG, newfile); \
|
||||
errorBox (buf); \
|
||||
uh_oh = 1; \
|
||||
} \
|
||||
} \
|
||||
|
||||
/* ======================================================== */
|
||||
|
||||
void
|
||||
gncFileNew (void)
|
||||
{
|
||||
Session *sess;
|
||||
AccountGroup *grp;
|
||||
|
||||
/* If user attempts to start a new session before saving
|
||||
* results of the last one, prompt them to clean up thier
|
||||
* act. */
|
||||
gncFileQuerySave ();
|
||||
|
||||
sess = current_session;
|
||||
grp = xaccSessionGetGroup (sess);
|
||||
/* if session not yet started ... */
|
||||
if (!grp) grp = topgroup;
|
||||
|
||||
/* when starting new everything, destroy old stuff first */
|
||||
/* destroy open windows first, before destroying the group itself */
|
||||
xaccGroupWindowDestroy (grp);
|
||||
|
||||
/* close any ongoing file sessions, if any */
|
||||
xaccSessionEnd (sess);
|
||||
xaccSessionDestroy (sess);
|
||||
current_session = NULL;
|
||||
topgroup = NULL;
|
||||
|
||||
/* disable logging while we move over to the new set of accounts to
|
||||
* edit; the mass deletetion of accounts and transactions during
|
||||
* switchover is not something we want to keep in a journal. */
|
||||
xaccLogDisable();
|
||||
xaccFreeAccountGroup (grp);
|
||||
xaccLogEnable();
|
||||
grp = xaccMallocAccountGroup();
|
||||
topgroup = grp;
|
||||
}
|
||||
|
||||
/* ======================================================== */
|
||||
|
||||
void
|
||||
gncFileQuerySave (void)
|
||||
{
|
||||
Session *sess;
|
||||
AccountGroup *grp;
|
||||
|
||||
sess = current_session;
|
||||
grp = xaccSessionGetGroup (sess);
|
||||
/* if session not yet started ... */
|
||||
if (!grp) grp = topgroup;
|
||||
|
||||
/* If user wants to mess around before finishing business with
|
||||
* the old file, give em a chance to figure out what's up.
|
||||
* Pose the question as a "while" loop, so that if user screws
|
||||
* up the file-selection dialog, we don't blow em out of the water;
|
||||
* instead, give them another chance to say "no" to the verify box.
|
||||
*/
|
||||
while ( xaccAccountGroupNotSaved (grp) )
|
||||
{
|
||||
if( verifyBox( FMB_SAVE_MSG) )
|
||||
{
|
||||
gncFileSave ();
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* ======================================================== */
|
||||
/* private utilities for file open; done in two stages */
|
||||
|
||||
static void
|
||||
gncPostFileOpen (const char * filename)
|
||||
{
|
||||
Session *newsess;
|
||||
AccountGroup *oldgrp;
|
||||
int io_error, uh_oh=0;
|
||||
char buf[BUFSIZE];
|
||||
AccountGroup *newgrp;
|
||||
char * newfile;
|
||||
|
||||
if (!filename) return;
|
||||
newfile = xaccResolveFilePath (filename);
|
||||
if (!newfile) return;
|
||||
|
||||
/* -------------- BEGIN CORE SESSION CODE ------------- */
|
||||
/* -- this code is almost identical in FileOpen and FileSaveAs -- */
|
||||
oldgrp = xaccSessionGetGroup (current_session);
|
||||
/* if session not yet started ... */
|
||||
if (!oldgrp) oldgrp = topgroup;
|
||||
|
||||
/* load the accounts from the users datafile */
|
||||
/* but first, check to make sure we've got a session going ... */
|
||||
newsess = xaccMallocSession ();
|
||||
|
||||
/* disable logging while we move over to the new set of accounts to
|
||||
* edit; the mass deletetion of accounts and transactions during
|
||||
* switchover is not something we want to keep in a journal. */
|
||||
xaccLogDisable();
|
||||
newgrp = xaccSessionBeginFile (newsess, newfile);
|
||||
xaccLogEnable();
|
||||
|
||||
/* check for session errors, put up appropriate dialog */
|
||||
SHOW_LOCK_ERR_MSG (newsess);
|
||||
|
||||
/* check for i/o error, put up appropriate error message */
|
||||
io_error = xaccGetFileIOError();
|
||||
SHOW_IO_ERR_MSG(io_error);
|
||||
|
||||
/* Umm, came up empty-handed, i.e. the file was not found. */
|
||||
/* This is almost certainly not what the user wanted. */
|
||||
if (!newgrp && !io_error)
|
||||
{
|
||||
sprintf (buf, FILE_NOT_FOUND_MSG, newfile);
|
||||
errorBox ( buf);
|
||||
uh_oh = 1;
|
||||
}
|
||||
|
||||
/* going down -- abandon ship */
|
||||
if (uh_oh)
|
||||
{
|
||||
xaccSessionEnd (newsess);
|
||||
xaccSessionDestroy (newsess);
|
||||
|
||||
/* well, no matter what, I think its a good idea to have
|
||||
* a topgroup around. For example, early in the gnucash startup
|
||||
* sequence, the user opens a file ... if this open fails for any
|
||||
* reason, we don't want to leave them high & dry without a topgroup,
|
||||
* because if user continues, then bad things will happen ...
|
||||
*/
|
||||
if (NULL == topgroup)
|
||||
{
|
||||
topgroup = xaccMallocAccountGroup();
|
||||
}
|
||||
free (newfile);
|
||||
return;
|
||||
}
|
||||
|
||||
/* if we got to here, then we've successfully gotten a new session */
|
||||
/* close up the old file session (if any) */
|
||||
xaccSessionEnd (current_session);
|
||||
xaccSessionDestroy (current_session);
|
||||
current_session = newsess;
|
||||
/* --------------- END CORE SESSION CODE -------------- */
|
||||
|
||||
/* clean up old stuff, and then we're outta here. */
|
||||
xaccLogDisable();
|
||||
xaccLogSetBaseName (newfile);
|
||||
/* destroy open windows first, before destroying the group itself */
|
||||
xaccGroupWindowDestroy (oldgrp);
|
||||
xaccFreeAccountGroup (oldgrp);
|
||||
topgroup = newgrp;
|
||||
xaccLogEnable();
|
||||
|
||||
free (newfile);
|
||||
}
|
||||
|
||||
/* ======================================================== */
|
||||
|
||||
void
|
||||
gncFileOpen (void)
|
||||
{
|
||||
char * newfile;
|
||||
|
||||
gncFileQuerySave ();
|
||||
newfile = fileBox( OPEN_STR, "*.xac");
|
||||
gncPostFileOpen (newfile);
|
||||
|
||||
/* This dialogue can show up early in the startup process.
|
||||
* If the user fails to pick a file (by e.g. hitting the cancel
|
||||
* button), we might be left with a null topgroup, which leads
|
||||
* to nastiness when user goes to create thier very first account.
|
||||
* Don't leave thier ass in a sling, give them what they need.
|
||||
*/
|
||||
if (NULL == topgroup)
|
||||
{
|
||||
topgroup = xaccMallocAccountGroup();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gncFileOpenFile (const char * newfile)
|
||||
{
|
||||
if (!newfile) return;
|
||||
gncFileQuerySave ();
|
||||
gncPostFileOpen (newfile);
|
||||
}
|
||||
|
||||
/* ======================================================== */
|
||||
|
||||
void
|
||||
gncFileQIFImport (void)
|
||||
{
|
||||
char * newfile;
|
||||
char buf[BUFSIZE];
|
||||
int io_error, uh_oh = 0;
|
||||
AccountGroup *newgrp;
|
||||
|
||||
newfile = fileBox( OPEN_STR, "*.qif");
|
||||
if (!newfile) return;
|
||||
|
||||
/* load the accounts from the file the user specified */
|
||||
newgrp = xaccReadQIFAccountGroup (newfile);
|
||||
|
||||
/* check for i/o error, put up appropriate error message */
|
||||
io_error = xaccGetQIFIOError();
|
||||
SHOW_IO_ERR_MSG(io_error);
|
||||
|
||||
if (uh_oh) return;
|
||||
|
||||
if( NULL == topgroup ) {
|
||||
/* no topgroup exists */
|
||||
topgroup = xaccMallocAccountGroup();
|
||||
}
|
||||
|
||||
/* since quicken will not export all accounts
|
||||
* into one file, we must merge them in one by one */
|
||||
xaccConcatGroups (topgroup, newgrp);
|
||||
xaccMergeAccounts (topgroup);
|
||||
xaccConsolidateGrpTransactions (topgroup);
|
||||
}
|
||||
|
||||
/* ======================================================== */
|
||||
static int been_here_before = 0;
|
||||
|
||||
void
|
||||
gncFileSave (void)
|
||||
{
|
||||
AccountGroup *newgrp = NULL;
|
||||
char * newfile;
|
||||
char buf[BUFSIZE];
|
||||
int io_error, norr, uh_oh = 0;
|
||||
/* hack alert -- Somehow make sure all in-progress edits get committed! */
|
||||
|
||||
/* if no session exists, then we don't have a filename/path
|
||||
* to save to. Get one now. */
|
||||
if ((NULL == current_session) ||
|
||||
(NULL == xaccSessionGetGroup (current_session)))
|
||||
{
|
||||
gncFileSaveAs();
|
||||
return;
|
||||
}
|
||||
|
||||
/* use the current session to save to file */
|
||||
xaccSessionSave (current_session);
|
||||
|
||||
/* in theory, no error should have occured, but just in case,
|
||||
* we're gonna check and handle ... */
|
||||
norr = xaccSessionGetError (current_session);
|
||||
if (norr)
|
||||
{
|
||||
if (been_here_before) return;
|
||||
been_here_before = 1;
|
||||
gncFileSaveAs(); /* been_here prevents infinite recuirsion */
|
||||
been_here_before = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* check for i/o error, put up appropriate error message */
|
||||
io_error = xaccGetFileIOError();
|
||||
newfile = xaccSessionGetFilePath(current_session);
|
||||
SHOW_IO_ERR_MSG(io_error);
|
||||
|
||||
/* going down -- abandon ship */
|
||||
if (uh_oh) return;
|
||||
|
||||
xaccAccountGroupMarkSaved (topgroup);
|
||||
}
|
||||
|
||||
/* ======================================================== */
|
||||
|
||||
void
|
||||
gncFileSaveAs (void)
|
||||
{
|
||||
Session *newsess;
|
||||
AccountGroup *oldgrp;
|
||||
char * newfile;
|
||||
AccountGroup *newgrp;
|
||||
char * oldfile;
|
||||
char buf[BUFSIZE];
|
||||
int io_error, uh_oh = 0;
|
||||
|
||||
newfile = fileBox( SAVE_STR, "*.xac");
|
||||
if (!newfile) return;
|
||||
|
||||
/* check to see if the user did something silly,
|
||||
* like specifying the same file as the current file ...
|
||||
* if so, then just do that, instead of the below,
|
||||
* which assumes a tuly new name was given.
|
||||
*/
|
||||
newfile = xaccResolveFilePath (newfile);
|
||||
assert (newfile); /* deep doodoo if resolve failed */
|
||||
oldfile = xaccSessionGetFilePath (current_session);
|
||||
if (oldfile && !strcmp (oldfile, newfile))
|
||||
{
|
||||
free (newfile);
|
||||
gncFileSave ();
|
||||
return;
|
||||
}
|
||||
|
||||
/* -------------- BEGIN CORE SESSION CODE ------------- */
|
||||
/* -- this code identical in FileOpen and FileSaveAs -- */
|
||||
oldgrp = xaccSessionGetGroup (current_session);
|
||||
/* if session not yet started ... */
|
||||
if (!oldgrp) oldgrp = topgroup;
|
||||
|
||||
/* create a new session ... */
|
||||
newsess = xaccMallocSession ();
|
||||
|
||||
/* disable logging while we move over to the new set of accounts to
|
||||
* edit; the mass deletetion of accounts and transactions during
|
||||
* switchover is not something we want to keep in a journal. */
|
||||
xaccLogDisable();
|
||||
newgrp = xaccSessionBeginFile (newsess, newfile);
|
||||
xaccLogEnable();
|
||||
|
||||
/* check for session errors (e.g. file locked by another user) */
|
||||
SHOW_LOCK_ERR_MSG (newsess);
|
||||
|
||||
/* check for i/o error, put up appropriate error message */
|
||||
io_error = xaccGetFileIOError();
|
||||
SHOW_IO_ERR_MSG(io_error);
|
||||
|
||||
/* going down -- abandon ship */
|
||||
if (uh_oh)
|
||||
{
|
||||
xaccSessionEnd (newsess);
|
||||
xaccSessionDestroy (newsess);
|
||||
|
||||
/* well, no matter what, I think its a good idea to have
|
||||
* a topgroup around. For example, early in the gnucash startup
|
||||
* sequence, the user opens a file ... if this open fails for any
|
||||
* reason, we don't want to leave them high & dry without a topgroup,
|
||||
* because if user continues, then bad things will happen ...
|
||||
*/
|
||||
if (NULL == topgroup)
|
||||
{
|
||||
topgroup = xaccMallocAccountGroup();
|
||||
}
|
||||
free (newfile);
|
||||
return;
|
||||
}
|
||||
|
||||
/* if we got to here, then we've successfully gotten a new session */
|
||||
/* close up the old file session (if any) */
|
||||
xaccSessionEnd (current_session);
|
||||
xaccSessionDestroy (current_session);
|
||||
current_session = newsess;
|
||||
/* --------------- END CORE SESSION CODE -------------- */
|
||||
|
||||
/* oops ... file already exists ... ask user what to do... */
|
||||
if (newgrp)
|
||||
{
|
||||
char *tmpmsg;
|
||||
tmpmsg = alloca (strlen (FMB_EEXIST_MSG) + strlen (newfile));
|
||||
sprintf (tmpmsg, FMB_EEXIST_MSG, newfile);
|
||||
/* if user says cancel, we should break out */
|
||||
if (! verifyBox ( tmpmsg)) return;
|
||||
|
||||
/* Whoa-ok. Blow away the previous file.
|
||||
* Do not disable logging ... we want to capture the
|
||||
* old file in the log, just in case the user later
|
||||
* decides it was all a big mistake. */
|
||||
xaccSessionSetGroup (newsess, NULL);
|
||||
/* xaccLogDisable(); no don't disable, keep logging on */
|
||||
xaccFreeAccountGroup (newgrp);
|
||||
}
|
||||
|
||||
/* OK, save the data to the file ... */
|
||||
xaccLogSetBaseName (newfile);
|
||||
xaccSessionSetGroup (newsess, oldgrp);
|
||||
gncFileSave ();
|
||||
free (newfile);
|
||||
}
|
||||
|
||||
/* ======================================================== */
|
||||
|
||||
void
|
||||
gncFileQuit (void)
|
||||
{
|
||||
AccountGroup *grp;
|
||||
|
||||
grp = xaccSessionGetGroup (current_session);
|
||||
/* if session not yet started ... */
|
||||
if (!grp) grp = topgroup;
|
||||
|
||||
/* disable logging; the mass deletetion of accounts and transactions
|
||||
* during shutdown is not something we want to keep in a journal. */
|
||||
xaccLogDisable();
|
||||
|
||||
xaccSessionEnd (current_session);
|
||||
xaccSessionDestroy (current_session);
|
||||
current_session = NULL;
|
||||
xaccGroupWindowDestroy (grp);
|
||||
xaccFreeAccountGroup (grp);
|
||||
topgroup = NULL;
|
||||
|
||||
}
|
||||
|
||||
/********************* END OF FILE **********************************/
|
61
src/FileDialog.h
Normal file
61
src/FileDialog.h
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* FILE:
|
||||
* FileDialog.h
|
||||
*
|
||||
* FUNCTION:
|
||||
* A set of file-handling utility dialogs for GUI menubars and menubuttons.
|
||||
* These utilities will "do the right thing" when used in the "File..."
|
||||
* pulldown menu, for the "New", "Open", "Save", "SaveAs", etc. menu entires.
|
||||
* In particular, they will verify that old files don't get clobbered,
|
||||
* they'll put up dialogue boxes to ask the user to confirm thier actions,
|
||||
* etc.
|
||||
*
|
||||
* These utilities are written in a GUI-independent fashion, and should
|
||||
* work just fine with the Motif, gnome/gtk and Qt interfaces.
|
||||
* These utilities are appropriate for direct invocation from guile.
|
||||
* (they should be wrapped by swig).
|
||||
*
|
||||
* HISTORY:
|
||||
* Derived from Rob Clark's original MainWindow.c code, Dec 1998
|
||||
*/
|
||||
|
||||
/********************************************************************\
|
||||
* Copyright (C) 1997 Robin D. Clark *
|
||||
* Copyright (C) 1998 Linas Vepstas *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program 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 this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef __GNC_FILE_DIALOG_H__
|
||||
#define __GNC_FILE_DIALOG_H__
|
||||
|
||||
#include "Group.h"
|
||||
#include "Session.h"
|
||||
|
||||
void gncFileNew (void);
|
||||
void gncFileOpen (void);
|
||||
void gncFileQIFImport (void);
|
||||
void gncFileSave (void);
|
||||
void gncFileSaveAs (void);
|
||||
|
||||
void gncFileOpenFile (const char *);
|
||||
|
||||
void gncFileQuerySave (void);
|
||||
void gncFileQuit (void);
|
||||
|
||||
extern Session *current_session;
|
||||
extern AccountGroup *topgroup;
|
||||
|
||||
#endif /* __GNC_FILE_DIALOG_H__ */
|
@ -1,5 +1,6 @@
|
||||
/********************************************************************\
|
||||
* top-level.h -- main for xacc (X-Accountant) *
|
||||
* MainWindow.h -- the main window, and associated helper functions *
|
||||
* and callback functions for xacc (X-Accountant *
|
||||
* Copyright (C) 1997 Robin D. Clark *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
@ -22,29 +23,26 @@
|
||||
* Huntington Beach, CA 92648-4632 *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef __TOP_LEVEL_H__
|
||||
#define __TOP_LEVEL_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#ifndef __MAINWINDOW_H__
|
||||
#define __MAINWINDOW_H__
|
||||
|
||||
#include "config.h"
|
||||
#include "Group.h"
|
||||
#include "ui-callbacks.h"
|
||||
|
||||
/** STRUCTS *********************************************************/
|
||||
/** GLOBALS *********************************************************/
|
||||
typedef enum {
|
||||
HMB_ABOUT,
|
||||
HMB_ACC,
|
||||
HMB_REGWIN,
|
||||
HMB_RECNWIN,
|
||||
HMB_ADJBWIN,
|
||||
HMB_MAIN,
|
||||
HMB_LIC,
|
||||
} gncHelpTypes;
|
||||
|
||||
/** PROTOTYPES ******************************************************/
|
||||
|
||||
/** GLOBALS *********************************************************/
|
||||
extern AccountGroup *topgroup;
|
||||
void mainWindow();
|
||||
void gnc_show_help(const gncHelpTypes t);
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
Local Variables:
|
||||
tab-width: 2
|
||||
indent-tabs-mode: nil
|
||||
mode: c-mode
|
||||
c-indentation-style: gnu
|
||||
eval: (c-set-offset 'block-open '-)
|
||||
End:
|
||||
*/
|
@ -23,14 +23,25 @@
|
||||
|
||||
include @top_srcdir@/Makefile.init
|
||||
|
||||
INCLPATH = -I.. -I./engine -I./register -Ireports -I@srcdir@/../include -I@prefix@/include
|
||||
CFLAGS = @CFLAGS@ @X_CFLAGS@ ${INCLPATH} ${CPPFLAGS}
|
||||
INCLPATH = -I. \
|
||||
-I.. \
|
||||
-I./engine \
|
||||
-I./register \
|
||||
-Ireports \
|
||||
-I@srcdir@/../include \
|
||||
-I@prefix@/include
|
||||
|
||||
GNOME_CFLAGS += -I./gnome
|
||||
MOTIF_CFLAGS += -I./motif
|
||||
|
||||
CFLAGS = @CFLAGS@ @X_CFLAGS@ ${INCLPATH} ${CPPFLAGS}
|
||||
|
||||
######################################################################
|
||||
# See Makefile.common for information about these variables.
|
||||
COMMON_SRCS := MultiLedger.c SplitLedger.c
|
||||
COMMON_SRCS := MultiLedger.c SplitLedger.c Destroy.c
|
||||
CLEAN_SUBDIRS := engine gnome motif register guile reports swig qt scm
|
||||
MOTIF_SRCS := FileDialog.c
|
||||
GNOME_SRCS := FileDialog.c
|
||||
######################################################################
|
||||
|
||||
all: default
|
||||
@ -45,7 +56,7 @@ motif: ${MOTIF_OBJS}
|
||||
@cd engine; $(MAKE) default
|
||||
@cd register; $(MAKE) motif
|
||||
@cd reports; $(MAKE) default
|
||||
@cd swig; $(MAKE) default
|
||||
@cd swig; $(MAKE) motif
|
||||
@cd guile; $(MAKE) default
|
||||
@cd motif; $(MAKE) motif
|
||||
|
||||
@ -53,7 +64,7 @@ gnome: ${GNOME_OBJS}
|
||||
@cd engine; $(MAKE) default
|
||||
@cd register; $(MAKE) gnome
|
||||
@cd reports; $(MAKE) default
|
||||
@cd swig; $(MAKE) default
|
||||
@cd swig; $(MAKE) gnome
|
||||
@cd guile; $(MAKE) default
|
||||
@cd gnome; $(MAKE) gnome
|
||||
|
||||
|
@ -391,7 +391,7 @@ xaccLedgerDisplayRefresh (xaccLedgerDisplay *regData)
|
||||
/* provide some convenience data for the ture GUI window.
|
||||
* If the GUI wants to display yet other stuff, its on its own.
|
||||
*/
|
||||
xaccAccountRecomputeBalance(regData->leader);
|
||||
/* xaccAccountRecomputeBalance(regData->leader); */
|
||||
regData->balance = xaccAccountGetBalance (regData->leader);
|
||||
regData->clearedBalance = xaccAccountGetClearedBalance (regData->leader);
|
||||
regData->reconciledBalance = xaccAccountGetReconciledBalance (regData->leader);
|
||||
|
@ -119,6 +119,14 @@ extern void xaccRegisterRefresh (SplitRegister *);
|
||||
*/
|
||||
extern void xaccLedgerDisplayClose (xaccLedgerDisplay *);
|
||||
|
||||
/********************************************************************\
|
||||
* sort of a quick hack involving the layout of the register.
|
||||
\********************************************************************/
|
||||
|
||||
extern void xaccRegisterCountHack (SplitRegister *splitreg);
|
||||
|
||||
extern void xaccDestroyLedgerDisplay (Account *acc);
|
||||
|
||||
#endif /* __MULTI_LEDGER_H__ */
|
||||
|
||||
/************************** END OF FILE *************************/
|
||||
|
@ -25,12 +25,9 @@
|
||||
#ifndef __REGWINDOW_H__
|
||||
#define __REGWINDOW_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "Account.h"
|
||||
#include "MultiLedger.h"
|
||||
|
||||
/** GLOBALS *********************************************************/
|
||||
|
||||
@ -39,15 +36,8 @@ typedef struct _RegWindow RegWindow;
|
||||
|
||||
/** PROTOTYPES ******************************************************/
|
||||
void accRefresh (Account *);
|
||||
RegWindow *regWindowSimple( Account *account );
|
||||
RegWindow *regWindowAccGroup( Account *account_group );
|
||||
RegWindow *regWindowLedger( xaccLedgerDisplay *ledger);
|
||||
|
||||
/*
|
||||
* The xaccDestroyRegWindow() subroutine can be called from
|
||||
* anywhere to shut down the Register window. Used primarily when
|
||||
* destroying the underlying account.
|
||||
*/
|
||||
void xaccDestroyRegWindow (Account *);
|
||||
RegWindow *regWindowSimple(Account *account);
|
||||
RegWindow *regWindowAccGroup(Account *account_group);
|
||||
// RegWindow *regWindowLedger (Widget parent, xaccLedgerDisplay *);
|
||||
|
||||
#endif
|
@ -70,6 +70,7 @@
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "ui-callbacks.h"
|
||||
#include "SplitLedger.h"
|
||||
#include "messages.h"
|
||||
#include "MultiLedger.h"
|
||||
|
8
src/TODO
Normal file
8
src/TODO
Normal file
@ -0,0 +1,8 @@
|
||||
-*-text-*-
|
||||
|
||||
Need to centralize shutdown. *everyone* should be calling either
|
||||
gnc:shutdown or gnc_shutdown, and that function should be smart enough
|
||||
to DTRT (like gncQuerySave, closing the GUI through a common
|
||||
gnc_ui_shutdown function, etc.). We also have to decide at what point
|
||||
the user's hooks should be called...
|
||||
|
108
src/gnome/AccWindow.c
Normal file
108
src/gnome/AccWindow.c
Normal file
@ -0,0 +1,108 @@
|
||||
/********************************************************************\
|
||||
* AccWindow.c -- window for creating new accounts for xacc *
|
||||
* (X-Accountant) *
|
||||
* Copyright (C) 1997 Robin D. Clark *
|
||||
* Copyright (C) 1997, 1998, 1999 Linas Vepstas *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program 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 this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
* Author: Rob Clark *
|
||||
* Internet: rclark@cs.hmc.edu *
|
||||
* Address: 609 8th Street *
|
||||
* Huntington Beach, CA 92648-4632 *
|
||||
\********************************************************************/
|
||||
|
||||
#include <nana.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "AccWindow.h"
|
||||
|
||||
/* Please look at ../motif/AccWindow.c for info on what should be
|
||||
going on in these functions */
|
||||
|
||||
/********************************************************************\
|
||||
* accWindow *
|
||||
* opens up a window to create a new account... the account is *
|
||||
* actually created in the "create" callback *
|
||||
* *
|
||||
* Args: parent - the parent of the window to be created *
|
||||
* Return: none *
|
||||
\********************************************************************/
|
||||
AccWindow *
|
||||
accWindow (AccountGroup *grp) {
|
||||
AccWindow *accData = NULL;
|
||||
|
||||
L("STUB: accWindow needs to be written for GNOME.\n");
|
||||
|
||||
return accData;
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
* editAccWindow *
|
||||
* opens up a window to edit an account *
|
||||
* *
|
||||
* Args: parent - the parent of the window to be created *
|
||||
* account - the account to edit *
|
||||
* Return: none *
|
||||
\********************************************************************/
|
||||
EditAccWindow *
|
||||
editAccWindow( Account *acc ) {
|
||||
EditAccWindow *editAccData = NULL;
|
||||
|
||||
L("STUB: editAccWindow needs to be written for GNOME.\n");
|
||||
|
||||
return editAccData;
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
* Don't delete any structures -- the close callback wil do this *
|
||||
\********************************************************************/
|
||||
|
||||
void
|
||||
xaccDestroyEditAccWindow (Account * acc) {
|
||||
|
||||
L("STUB: xaccDestroyEditAccWindow needs to be written for GNOME.\n");
|
||||
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
* *
|
||||
\********************************************************************/
|
||||
|
||||
EditNotesWindow *
|
||||
editNotesWindow (Account *acc) {
|
||||
EditNotesWindow *enw = NULL;
|
||||
|
||||
L("STUB: editNotesWindow needs to be written for GNOME.\n");
|
||||
|
||||
return enw;
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
* don't delete any structures; the close callack will do this *
|
||||
\********************************************************************/
|
||||
|
||||
void
|
||||
xaccDestroyEditNotesWindow (Account *acc) {
|
||||
|
||||
L("STUB: xaccDestroyEditNotesWindow needs to be written for GNOME.\n");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/********************** END OF FILE *********************************\
|
||||
\********************************************************************/
|
@ -19,24 +19,25 @@
|
||||
\********************************************************************/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "AccInfo.h"
|
||||
#include "Account.h"
|
||||
#include "Add_Dialog.h"
|
||||
#include "MenuBar.h"
|
||||
#include "messages.h"
|
||||
#include "top-level.h"
|
||||
#include "Transaction.h"
|
||||
#include "MainWindowP.h"
|
||||
#include "Add_Dialog.h"
|
||||
|
||||
/** Globals *********************************************************/
|
||||
|
||||
|
||||
add_account_dialog
|
||||
*add_account_dialog_init ( )
|
||||
{
|
||||
return ( g_malloc ( sizeof ( add_account_dialog ) ) );
|
||||
*add_account_dialog_init() {
|
||||
return(g_malloc ( sizeof ( add_account_dialog )));
|
||||
}
|
||||
|
||||
|
||||
@ -54,6 +55,8 @@ add_account_toggle_callback (GtkWidget *widget, gpointer data)
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
static void
|
||||
add_account_omenu_update ( GtkWidget *widget, gpointer data )
|
||||
{
|
||||
@ -66,6 +69,8 @@ add_account_omenu_update ( GtkWidget *widget, gpointer data )
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static void
|
||||
add_account_dialog_okclicked_cb(GtkWidget * dialog, gpointer data)
|
||||
{
|
||||
@ -115,7 +120,7 @@ add_account_dialog_okclicked_cb(GtkWidget * dialog, gpointer data)
|
||||
if (info->parent_account) {
|
||||
xaccInsertSubAccount (info->parent_account, account);
|
||||
} else {
|
||||
xaccGroupInsertAccount( topgroup, account );
|
||||
xaccGroupInsertAccount(xaccSessionGetGroup(current_session), account );
|
||||
}
|
||||
xaccAccountCommitEdit (account);
|
||||
|
||||
@ -139,6 +144,8 @@ add_account_dialog_destroy ( GtkWidget *ignore, GnomeDialog *dialog )
|
||||
//gtk_widget_destroy ( GTK_WIDGET(dialog) );
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
static void
|
||||
build_omenu ( GtkMenu *menu, add_account_dialog *accWindow, Account *acct,
|
||||
int is_submenu )
|
||||
@ -156,8 +163,8 @@ build_omenu ( GtkMenu *menu, add_account_dialog *accWindow, Account *acct,
|
||||
|
||||
if ( is_submenu == -1 )
|
||||
{
|
||||
omenu = gtk_option_menu_new ();
|
||||
menu = gtk_menu_new ();
|
||||
omenu = gtk_option_menu_new();
|
||||
menu = GTK_MENU(gtk_menu_new());
|
||||
}
|
||||
|
||||
menuitem = gtk_radio_menu_item_new_with_label (omenu_group, "New TopLevel Account" );
|
||||
@ -188,8 +195,10 @@ build_omenu ( GtkMenu *menu, add_account_dialog *accWindow, Account *acct,
|
||||
gtk_widget_show ( omenu );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void
|
||||
create_add_account_dialog (AccountGroup *acct)
|
||||
create_add_account_dialog (Account *acct)
|
||||
{
|
||||
GtkWidget *button;
|
||||
add_account_dialog *accWindow;
|
||||
|
@ -26,7 +26,6 @@
|
||||
#ifndef __ADD_DIALOG_H__
|
||||
#define __ADD_DIALOG_H__
|
||||
|
||||
#include "Account.h"
|
||||
#include "Group.h"
|
||||
#include "MainWindow.h"
|
||||
|
||||
@ -48,13 +47,13 @@ struct _add_account_dialog
|
||||
GtkWidget *separator;
|
||||
|
||||
Account *parent_account;
|
||||
gint *type;
|
||||
gint type;
|
||||
|
||||
};
|
||||
|
||||
typedef struct _add_account_dialog add_account_dialog;
|
||||
|
||||
void create_add_account_dialog ( AccountGroup * );
|
||||
void create_add_account_dialog ( Account * );
|
||||
add_account_dialog *add_account_dialog_init ( void );
|
||||
void add_account_dialog_destroy ( GtkWidget *, GnomeDialog * );
|
||||
|
||||
|
63
src/gnome/AdjBWindow.c
Normal file
63
src/gnome/AdjBWindow.c
Normal file
@ -0,0 +1,63 @@
|
||||
/********************************************************************\
|
||||
* AdjBWindow.c -- the adjust balance window *
|
||||
* Copyright (C) 1997 Robin D. Clark *
|
||||
* Copyright (C) 1998 Linas Vepstas *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program 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 this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
* Author: Rob Clark *
|
||||
* Internet: rclark@cs.hmc.edu *
|
||||
* Address: 609 8th Street *
|
||||
* Huntington Beach, CA 92648-4632 *
|
||||
\********************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <nana.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "AdjBWindow.h"
|
||||
|
||||
/********************************************************************\
|
||||
* adjBWindow *
|
||||
* opens up the window to adjust the balance *
|
||||
* *
|
||||
* Args: parent - the parent of this window *
|
||||
* account - the account to adjust *
|
||||
* Return: adjBData - the instance of this AdjBWindow *
|
||||
\********************************************************************/
|
||||
AdjBWindow *
|
||||
adjBWindow( Account *acc ) {
|
||||
AdjBWindow *adjBData = NULL;
|
||||
|
||||
L("STUB: adjBWindow needs to be written for GNOME.\n");
|
||||
|
||||
return adjBData;
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
* Don't delete any structures, the close callback will do this *
|
||||
\********************************************************************/
|
||||
|
||||
void
|
||||
xaccDestroyAdjBWindow (Account *acc) {
|
||||
|
||||
L("STUB: xaccDestroyAdjBWindow needs to be written for GNOME.\n");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/******************** END OF FILE ***********************************\
|
||||
\********************************************************************/
|
@ -30,14 +30,13 @@
|
||||
#include "FileBox.h"
|
||||
#include "messages.h"
|
||||
#include "util.h"
|
||||
#include "xtutil.h"
|
||||
|
||||
/** GLOBALS *********************************************************/
|
||||
//extern XtAppContext app;
|
||||
//Boolean done=True;
|
||||
|
||||
static GtkWidget *filebox = NULL;
|
||||
static gint filebox_quit;
|
||||
/*static GtkWidget *filebox = NULL;*/
|
||||
/*static gint filebox_quit;*/
|
||||
|
||||
/* This static indicates the debugging module that this .o belongs to. */
|
||||
static short module = MOD_GUI;
|
||||
@ -63,32 +62,32 @@ void closeBoxCB( GtkWidget mw, gpointer *data );
|
||||
* done - whether fileBox should return *
|
||||
\********************************************************************/
|
||||
char *
|
||||
fileBox( GtkWidget parent, char * title, char * filter)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
fileBox(const char * title, const char * filter) {
|
||||
|
||||
L("STUB: FileBox not implemented for GNOME yet...\n");
|
||||
return NULL;
|
||||
|
||||
#if 0
|
||||
GtkWidget *dialog = gtk_file_selection_new(title);
|
||||
char* fileName = NULL;
|
||||
|
||||
// if( !done )
|
||||
// return NULL; /* Don't open if there already is
|
||||
// * an instance of fileBox */
|
||||
|
||||
// done = False;
|
||||
|
||||
ENTER("fileBox");
|
||||
|
||||
fileName = gtk_file_selection_get_filename (GTK_FILE_SELECTION (dialog));
|
||||
|
||||
gtk_widget_show(GTK_FILE_SELECTION(dialog));
|
||||
gtk_widget_show(GTK_WIDGET(dialog));
|
||||
|
||||
/* Check to see if this is a valid datafile */
|
||||
if ( fileName == NULL )
|
||||
return;
|
||||
return NULL;
|
||||
|
||||
// done = True;
|
||||
|
||||
LEAVE("fileBox");
|
||||
return fileName;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
* fileBoxCB *
|
||||
@ -104,7 +103,7 @@ fileBox( GtkWidget parent, char * title, char * filter)
|
||||
void
|
||||
fileBoxCB( GtkWidget mw, gpointer *data )
|
||||
{
|
||||
char **fileName = (char **)data;
|
||||
/*char **fileName = (char **)data;*/
|
||||
ENTER("fileBoxCB");
|
||||
|
||||
/* NEED CALLBACK CODE DARNIT */
|
||||
|
@ -18,16 +18,30 @@
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
\********************************************************************/
|
||||
|
||||
#include <nana.h>
|
||||
#include <gnome.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gnucash.h"
|
||||
#include "options-dialog.h"
|
||||
#include "Add_Dialog.h"
|
||||
#include "MainWindow.h"
|
||||
#include "MenuBar.h"
|
||||
#include "MenuCommands.h"
|
||||
#include "messages.h"
|
||||
#include "RegWindow.h"
|
||||
#include "top-level.h"
|
||||
#include "version.h"
|
||||
#include "MainWindow.h"
|
||||
#include "MainWindowP.h"
|
||||
|
||||
/** STRUCTURES ******************************************************/
|
||||
struct _main_window {
|
||||
GtkTree *maintree;
|
||||
GtkTree *root_item;
|
||||
};
|
||||
|
||||
typedef struct _main_window main_window;
|
||||
|
||||
/** GLOBALS **********************************************************/
|
||||
main_window *mwindow;
|
||||
@ -69,33 +83,6 @@ refreshMainWindow()
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* refresh_tree *
|
||||
* refreshes the main window *
|
||||
* *
|
||||
* Args: tree - the tree that will get destroyed.. *
|
||||
* Returns: nothing *
|
||||
\********************************************************************/
|
||||
void
|
||||
gnc_ui_refresh_tree()
|
||||
{
|
||||
/** This is ugly... how do we do this nicer? */
|
||||
GList *items;
|
||||
|
||||
mwindow->maintree = GTK_TREE_ROOT_TREE ( mwindow->maintree );
|
||||
|
||||
items = GTK_TREE_SELECTION ( mwindow->maintree );
|
||||
|
||||
gtk_tree_clear_items ( mwindow->maintree, 0, g_list_length(items) );
|
||||
|
||||
mwindow->root_item = mwindow->maintree;
|
||||
|
||||
gnc_ui_acct_tree_fill(GTK_TREE_ITEM(mwindow->root_item), topgroup, -1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* acct_tree_fill *
|
||||
* fills the tree with accounts, name ($balance) *
|
||||
@ -106,25 +93,22 @@ gnc_ui_refresh_tree()
|
||||
* Returns: nothing *
|
||||
\********************************************************************/
|
||||
void
|
||||
gnc_ui_acct_tree_fill(GtkWidget *item, AccountGroup *accts, int subtree)
|
||||
gnc_ui_acct_tree_fill(GtkTree *item, AccountGroup *accts, int subtree)
|
||||
{
|
||||
int accounts_in_group = xaccGroupGetNumAccounts(accts);
|
||||
int current_account;
|
||||
GtkWidget* item_subtree;
|
||||
GtkWidget* tree_item;
|
||||
GtkTree* item_subtree;
|
||||
GtkTreeItem* tree_item;
|
||||
int no_root_item;
|
||||
|
||||
if ( subtree == -1 )
|
||||
{
|
||||
|
||||
if ( subtree == -1 ) {
|
||||
item_subtree = item;
|
||||
no_root_item = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
item_subtree = gtk_tree_new();
|
||||
} else {
|
||||
item_subtree = GTK_TREE(gtk_tree_new());
|
||||
no_root_item = 0;
|
||||
}
|
||||
|
||||
|
||||
for( current_account=0;
|
||||
current_account < accounts_in_group;
|
||||
current_account++ )
|
||||
@ -140,13 +124,13 @@ gnc_ui_acct_tree_fill(GtkWidget *item, AccountGroup *accts, int subtree)
|
||||
|
||||
sprintf (buffer, "%s ($%.2f)", rowstrs[0], xaccAccountGetBalance(acc));
|
||||
|
||||
tree_item = gtk_tree_item_new_with_label( buffer );
|
||||
tree_item = GTK_TREE_ITEM(gtk_tree_item_new_with_label( buffer ));
|
||||
/* Set the tree item to point to the actual account so we can reach it
|
||||
trivially when the user selects the row. (Should we use
|
||||
gtk_*_data_full and have a destroy notify?) */
|
||||
gtk_object_set_user_data(GTK_OBJECT(tree_item), acc);
|
||||
|
||||
gtk_tree_append(GTK_TREE(item_subtree), tree_item );
|
||||
gtk_tree_append(GTK_TREE(item_subtree), GTK_WIDGET(tree_item));
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (tree_item),
|
||||
"button_press_event",
|
||||
@ -159,14 +143,40 @@ gnc_ui_acct_tree_fill(GtkWidget *item, AccountGroup *accts, int subtree)
|
||||
gnc_ui_acct_tree_fill ( GTK_TREE(tree_item), acc_children, 1 );
|
||||
}
|
||||
|
||||
gtk_widget_show ( tree_item );
|
||||
gtk_widget_show(GTK_WIDGET(tree_item));
|
||||
|
||||
}
|
||||
|
||||
if(!no_root_item)
|
||||
{
|
||||
gtk_tree_item_set_subtree(GTK_TREE_ITEM(item), item_subtree);
|
||||
if(!no_root_item) {
|
||||
gtk_tree_item_set_subtree(GTK_TREE_ITEM(item), GTK_WIDGET(item_subtree));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
* refresh_tree *
|
||||
* refreshes the main window *
|
||||
* *
|
||||
* Args: tree - the tree that will get destroyed.. *
|
||||
* Returns: nothing *
|
||||
\********************************************************************/
|
||||
void
|
||||
gnc_ui_refresh_tree() {
|
||||
|
||||
/** This is ugly... how do we do this nicer? */
|
||||
GList *items;
|
||||
|
||||
mwindow->maintree = GTK_TREE_ROOT_TREE ( mwindow->maintree );
|
||||
|
||||
items = GTK_TREE_SELECTION ( mwindow->maintree );
|
||||
|
||||
gtk_tree_clear_items ( mwindow->maintree, 0, g_list_length(items) );
|
||||
|
||||
mwindow->root_item = mwindow->maintree;
|
||||
|
||||
gnc_ui_acct_tree_fill(mwindow->root_item,
|
||||
xaccSessionGetGroup(current_session),
|
||||
-1);
|
||||
|
||||
}
|
||||
|
||||
@ -176,7 +186,7 @@ static void
|
||||
gnc_ui_about_cb (GtkWidget *widget, gpointer data)
|
||||
{
|
||||
GtkWidget *about;
|
||||
gchar *authors[] = {
|
||||
const gchar *authors[] = {
|
||||
/* Here should be your names */
|
||||
"Rob Clark",
|
||||
"Linas Vepstas",
|
||||
@ -211,6 +221,8 @@ gnc_ui_help_cb ( GtkWidget *widget, gpointer data )
|
||||
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
/* Some dialog stubs to be worked on */
|
||||
/* We might want to move these to there own file =\ */
|
||||
|
||||
@ -220,40 +232,7 @@ gnc_ui_file_new_cb ( GtkWidget *widget, gpointer data )
|
||||
|
||||
}
|
||||
|
||||
/* Options dialog... this should house all of the config options */
|
||||
/* like where the docs reside, and whatever else is deemed necessary */
|
||||
static void
|
||||
gnc_ui_options_cb ( GtkWidget *widget, gpointer data )
|
||||
{
|
||||
GnomePropertyBox *box;
|
||||
GtkWidget *w, *label, *box2;
|
||||
|
||||
box = GNOME_PROPERTY_BOX(gnome_property_box_new());
|
||||
w = gtk_button_new_with_label("Click me (Page #1)");
|
||||
|
||||
box2 = gtk_vbox_new ( FALSE, 1 );
|
||||
gtk_box_pack_start(GTK_BOX(box2), w, FALSE, FALSE, 0);
|
||||
|
||||
gtk_widget_show ( box2 );
|
||||
|
||||
gtk_widget_show(w);
|
||||
label = gtk_label_new("Config Box 1");
|
||||
gtk_widget_show(label);
|
||||
|
||||
gnome_property_box_append_page(box, box2, label);
|
||||
w = gtk_button_new_with_label("Click me (Page #2)");
|
||||
gtk_widget_show(w);
|
||||
|
||||
label = gtk_label_new("Config Box 2");
|
||||
gtk_widget_show(label);
|
||||
|
||||
gnome_property_box_append_page(box, w, label);
|
||||
|
||||
gtk_widget_set_usize ( GTK_WIDGET(box), 500, 400 );
|
||||
gtk_widget_set_usize ( GTK_WIDGET(box2), 225, 225 );
|
||||
|
||||
gtk_widget_show(GTK_WIDGET(box));
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
gnc_ui_add_account ( GtkWidget *widget, gpointer data )
|
||||
@ -266,7 +245,7 @@ gnc_ui_add_account ( GtkWidget *widget, gpointer data )
|
||||
{
|
||||
if ( selection->data != NULL )
|
||||
{
|
||||
AccountGroup *acc = gtk_object_get_user_data(GTK_OBJECT(selection->data));
|
||||
Account *acc = gtk_object_get_user_data(GTK_OBJECT(selection->data));
|
||||
create_add_account_dialog(acc);
|
||||
}
|
||||
|
||||
@ -349,9 +328,18 @@ gnc_ui_mainWindow_toolbar_open ( GtkWidget *widget, gpointer data )
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
quit_menu_item_helper() {
|
||||
gnc_shutdown(0);
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_ui_options_cb ( GtkWidget *widget, gpointer data ) {
|
||||
gnc_show_options_dialog();
|
||||
}
|
||||
|
||||
void
|
||||
gnc_ui_mainWindow(AccountGroup *accts)
|
||||
{
|
||||
mainWindow() {
|
||||
|
||||
GtkWidget *scrolled_win;
|
||||
GtkWidget *main_vbox;
|
||||
@ -359,6 +347,7 @@ gnc_ui_mainWindow(AccountGroup *accts)
|
||||
GtkWidget *menubar;
|
||||
GtkWidget *clist;
|
||||
GtkWidget *notebook;
|
||||
AccountGroup *accts = xaccSessionGetGroup(current_session);
|
||||
int nmenu_items;
|
||||
/*GtkAcceleratorTable *accel;*/
|
||||
|
||||
@ -378,7 +367,7 @@ gnc_ui_mainWindow(AccountGroup *accts)
|
||||
{"<Main>/File/Save", "<control>S", file_cmd_save, NULL},
|
||||
{"<Main>/File/Save as", NULL, NULL, NULL},
|
||||
{"<Main>/File/<separator>", NULL, NULL, NULL},
|
||||
{"<Main>/File/Quit", "<control>Q", gnucash_shutdown, NULL },
|
||||
{"<Main>/File/Quit", "<control>Q", quit_menu_item_helper, NULL },
|
||||
{"<Main>/Options/Preferences..", "<control>A", gnc_ui_options_cb, NULL},
|
||||
{"<Main>/Help/Help", NULL, gnc_ui_help_cb, NULL},
|
||||
{"<Main>/Help/<separator>", NULL, NULL, NULL},
|
||||
@ -388,9 +377,9 @@ gnc_ui_mainWindow(AccountGroup *accts)
|
||||
MenuBar *main_menu_bar;
|
||||
|
||||
mwindow = g_malloc ( sizeof ( main_window ) );
|
||||
mwindow->maintree = gtk_tree_new ( );
|
||||
mwindow->maintree = GTK_TREE(gtk_tree_new());
|
||||
|
||||
mwindow->root_item = GTK_WIDGET ( mwindow->maintree );
|
||||
mwindow->root_item = mwindow->maintree;
|
||||
|
||||
/* Create the toolbar, and hook up the buttons to the tree widget */
|
||||
{
|
||||
@ -410,7 +399,7 @@ gnc_ui_mainWindow(AccountGroup *accts)
|
||||
GNOMEUIINFO_ITEM_DATA(N_("Delete"), N_("Delete selected account."),
|
||||
gnc_ui_delete_account_cb, mwindow->root_item, GNOME_APP_PIXMAP_NONE),
|
||||
GNOMEUIINFO_ITEM(N_("Exit"), N_("Exit GnuCash."),
|
||||
gnucash_shutdown, GNOME_APP_PIXMAP_NONE),
|
||||
gnc_shutdown, GNOME_APP_PIXMAP_NONE),
|
||||
GNOMEUIINFO_END
|
||||
};
|
||||
|
||||
@ -464,7 +453,8 @@ gnc_ui_mainWindow(AccountGroup *accts)
|
||||
//gtk_window_add_accelerator_table(GTK_WINDOW(window), accel);
|
||||
gnome_app_set_menus ( GNOME_APP (app), GTK_MENU_BAR (menubar));
|
||||
gtk_container_add( GTK_CONTAINER( main_vbox ), notebook );
|
||||
gtk_container_add(GTK_CONTAINER(scrolled_win), mwindow->maintree);
|
||||
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_win),
|
||||
GTK_WIDGET(mwindow->maintree));
|
||||
|
||||
/* Append some pages to notebook */
|
||||
{
|
||||
@ -478,7 +468,7 @@ gnc_ui_mainWindow(AccountGroup *accts)
|
||||
|
||||
//gtk_widget_show(clist_vbox);
|
||||
gtk_widget_show(menubar);
|
||||
gtk_widget_show(mwindow->maintree);
|
||||
gtk_widget_show(GTK_WIDGET(mwindow->maintree));
|
||||
|
||||
/* Setup some callbacks */
|
||||
|
||||
@ -501,32 +491,34 @@ gnc_ui_mainWindow(AccountGroup *accts)
|
||||
/* OLD_GNOME_CODE */
|
||||
|
||||
void
|
||||
gnucash_shutdown (GtkWidget *widget, gpointer *data)
|
||||
{
|
||||
if ( xaccAccountGroupNotSaved(topgroup) )
|
||||
{
|
||||
GtkWidget *msgbox;
|
||||
msgbox = gnome_message_box_new ( FMB_SAVE_MSG,
|
||||
GNOME_MESSAGE_BOX_ERROR,
|
||||
GNOME_STOCK_BUTTON_OK,
|
||||
GNOME_STOCK_BUTTON_CANCEL, NULL );
|
||||
gnome_dialog_button_connect (GNOME_DIALOG (msgbox), 0,
|
||||
GTK_SIGNAL_FUNC (file_cmd_save),
|
||||
NULL);
|
||||
gnome_dialog_button_connect (GNOME_DIALOG (msgbox), 0,
|
||||
GTK_SIGNAL_FUNC (file_cmd_quit),
|
||||
NULL);
|
||||
gnome_dialog_button_connect (GNOME_DIALOG (msgbox), 1,
|
||||
GTK_SIGNAL_FUNC (file_cmd_quit),
|
||||
NULL);
|
||||
gtk_widget_show ( msgbox );
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
gnc_ui_shutdown (GtkWidget *widget, gpointer *data) {
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
/* FIXME: This was the old shutdown code. It probably needs to be
|
||||
migrated to whatever function is being called by gncFileQuerySave() */
|
||||
|
||||
GtkWidget *msgbox;
|
||||
msgbox = gnome_message_box_new ( FMB_SAVE_MSG,
|
||||
GNOME_MESSAGE_BOX_ERROR,
|
||||
GNOME_STOCK_BUTTON_OK,
|
||||
GNOME_STOCK_BUTTON_CANCEL, NULL );
|
||||
gnome_dialog_button_connect (GNOME_DIALOG (msgbox), 0,
|
||||
GTK_SIGNAL_FUNC (file_cmd_save),
|
||||
NULL);
|
||||
gnome_dialog_button_connect (GNOME_DIALOG (msgbox), 0,
|
||||
GTK_SIGNAL_FUNC (file_cmd_quit),
|
||||
NULL);
|
||||
gnome_dialog_button_connect (GNOME_DIALOG (msgbox), 1,
|
||||
GTK_SIGNAL_FUNC (file_cmd_quit),
|
||||
NULL);
|
||||
gtk_widget_show ( msgbox );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/********************* END OF FILE **********************************/
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
/********************************************************************\
|
||||
* MainWindow.h -- the main window, and associated helper functions *
|
||||
* and callback functions for xacc (X-Accountant *
|
||||
/*******************************************************************\
|
||||
* MainWindowP.h -- private GNOME main window functions *
|
||||
* Copyright (C) 1997 Robin D. Clark *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
@ -23,39 +22,20 @@
|
||||
* Huntington Beach, CA 92648-4632 *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef __MAINWINDOW_H__
|
||||
#define __MAINWINDOW_H__
|
||||
#ifndef __MAINWINDOWP_H__
|
||||
#define __MAINWINDOWP_H__
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "Group.h"
|
||||
#include "config.h"
|
||||
|
||||
/** HELP STUFF: *****************************************************/
|
||||
#define HELP_VAR "XACC_HELP"
|
||||
#define HH_ABOUT "xacc-about.html"
|
||||
#define HH_ACC "xacc-accwin.html"
|
||||
#define HH_REGWIN "xacc-regwin.html"
|
||||
#define HH_RECNWIN "xacc-recnwin.html"
|
||||
#define HH_ADJBWIN "xacc-adjbwin.html"
|
||||
#define HH_MAIN "xacc-main.html"
|
||||
#define HH_GPL "xacc-gpl.html"
|
||||
|
||||
|
||||
/** STRUCTURES ******************************************************/
|
||||
struct _main_window
|
||||
{
|
||||
GtkWidget *maintree;
|
||||
GtkWidget *root_item;
|
||||
};
|
||||
|
||||
typedef struct _main_window main_window;
|
||||
|
||||
/** PROTOTYPES ******************************************************/
|
||||
void gnc_ui_refreshMainWindow( void );
|
||||
void gnc_ui_mainWindow(AccountGroup *);
|
||||
void xaccMainWindowAddAccount ( GtkWidget * );
|
||||
void gnc_ui_refresh_tree ( void );
|
||||
void gnc_ui_acct_tree_fill ( GtkWidget *, AccountGroup *, int );
|
||||
void gnc_ui_acct_tree_fill ( GtkTree *, AccountGroup *, int );
|
||||
|
||||
#if 0
|
||||
|
||||
/** GLOBALS *********************************************************/
|
||||
enum {
|
||||
@ -89,6 +69,8 @@ enum {
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
Local Variables:
|
||||
tab-width: 2
|
@ -24,54 +24,57 @@
|
||||
|
||||
include @top_srcdir@/Makefile.init
|
||||
|
||||
INCLPATH = -I.. \
|
||||
-I../.. \
|
||||
-I../engine \
|
||||
-I../register \
|
||||
-I../swig \
|
||||
-I../guile \
|
||||
-I@srcdir@/../../include \
|
||||
-I$(includedir)
|
||||
GTKSHEET_DIR := @GTKSHEET_DIR@
|
||||
|
||||
CFLAGS = @CFLAGS@ @X_CFLAGS@ ${INCLPATH} \
|
||||
$(shell @GNOME_CONFIG_BIN@ --cflags gnome)
|
||||
INCLPATH := -I.. \
|
||||
-I../.. \
|
||||
-I../guile \
|
||||
-I../engine \
|
||||
-I../register \
|
||||
-I../reports \
|
||||
-I@srcdir@/../../include \
|
||||
-I${includedir}
|
||||
|
||||
# All the other GNOME CFLAGS are handled in Makefile.common now
|
||||
CFLAGS = @CFLAGS@ ${INCLPATH}
|
||||
LDFLAGS = @LDFLAGS@
|
||||
|
||||
GUILELIBS = @GUILELIBS@
|
||||
LIBS = -L$(prefix)/lib @X_PRE_LIBS@ @X_LIBS@ \
|
||||
$(shell @GNOME_CONFIG_BIN@ --libs gtk) @X_EXTRA_LIBS@ -lgnomeui \
|
||||
$(shell @GNOME_CONFIG_BIN@ --libs gnome gnomeui ) \
|
||||
$(GUILELIBS) ${LIBNANA} @LIBS@ # -lintl
|
||||
LIBS = -L$(prefix)/lib @LIBS@ \
|
||||
$(shell ${GNOME_CONFIG_BIN} --libs gnomeui) $(GUILELIBS)
|
||||
|
||||
GNOMELIBS = @GNOMELIBS@
|
||||
GTKLIBS = @GTKLIBS@
|
||||
ifeq (${HAVE_PLOTUTILS},1)
|
||||
LIBS += @PLOTUTILS_LIBS@
|
||||
endif
|
||||
|
||||
TARGET = ../../gnucash.gnome
|
||||
STATIC = ../../gnucash.gnome.static
|
||||
|
||||
OTHER_OBJS := ../obj/gnome/*.o ../engine/obj/*.o ../register/obj/gnome/*.o \
|
||||
../guile/obj/*.o ../swig/guile/gnucash-all-guile_wrap.o \
|
||||
../swig/obj/*.o
|
||||
# Have to use wildcard here otherwise filters below won't get the expanded
|
||||
# text to work on...
|
||||
OTHER_OBJS += $(wildcard @top_srcdir@/lib/${GTKSHEET_DIR}/obj/gnome/*.o)
|
||||
OTHER_OBJS += $(wildcard @top_srcdir@/src/obj/gnome/*.o)
|
||||
OTHER_OBJS += $(wildcard @top_srcdir@/src/engine/obj/*.o)
|
||||
OTHER_OBJS += $(wildcard @top_srcdir@/src/register/obj/gnome/*.o)
|
||||
OTHER_OBJS += $(wildcard @top_srcdir@/src/reports/obj/*.o)
|
||||
OTHER_OBJS += $(wildcard @top_srcdir@/src/guile/obj/*.o)
|
||||
OTHER_OBJS += @top_srcdir@/src/swig/guile/obj/gnome/gnucash-gnome-guile_wrap.o
|
||||
OTHER_OBJS += $(wildcard @top_srcdir@/src/swig/obj/*.o)
|
||||
|
||||
######################################################################
|
||||
# See Makefile.common for information about these variables.
|
||||
GNOME_SRCS := top-level.c MainWindow.c MenuBar.c RegWindow.c Add_Dialog.c xtutil.c \
|
||||
RecnWindow.c MenuCommands.c FileBox.c
|
||||
GNOME_SRCS := top-level.c MainWindow.c MenuBar.c RegWindow.c Add_Dialog.c \
|
||||
xtutil.c RecnWindow.c MenuCommands.c FileBox.c \
|
||||
options-dialog.c AccWindow.c AdjBWindow.c
|
||||
######################################################################
|
||||
|
||||
default: $(TARGET)
|
||||
all: gnome
|
||||
|
||||
# This inclusion must come after the first target, and after the
|
||||
# definitions of *_SRCS, etc., but before the usage of *_OBJS.
|
||||
include @top_srcdir@/Makefile.common
|
||||
|
||||
gnome: default
|
||||
gnome: @top_srcdir@/gnucash.gnome
|
||||
@top_srcdir@/gnucash.gnome: ${GNOME_OBJS} ${OTHER_OBJS}
|
||||
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
gnome.static: $(STATIC)
|
||||
|
||||
$(TARGET): ${GNOME_OBJS} ${OTHER_OBJS}
|
||||
$(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
|
||||
|
||||
$(STATIC): ${GNOME_OBJS} ${OTHER_OBJS}
|
||||
$(CC) -static -o $@ $^ $(LDFLAGS) $(LIBS)
|
||||
gnome.static: @top_srcdir@/gnucash.gnome.static
|
||||
@top_srcdir@/gnucash.motif.static: ${GNOME_OBJS} ${OTHER_OBJS}
|
||||
$(CC) -static $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
|
@ -32,12 +32,11 @@
|
||||
#include "date.h"
|
||||
#include "Group.h"
|
||||
#include "MultiLedger.h"
|
||||
#include "RecnWindow.h"
|
||||
#include "RegWindow.h"
|
||||
#include "MainWindow.h"
|
||||
#include "messages.h"
|
||||
#include "util.h"
|
||||
#include "xtutil.h"
|
||||
#include "RecnWindow.h"
|
||||
|
||||
/** STRUCTS *********************************************************/
|
||||
struct _RecnWindow
|
||||
@ -379,7 +378,7 @@ startRecnWindow(GtkWidget *parent, Account *acc, double *diff)
|
||||
if(sscanf(str, "%lf", &val ) == 1) {
|
||||
*diff = dendBalance - val;
|
||||
} else {
|
||||
errorBox(dialog, "Ending balance must be a number.");
|
||||
errorBox("Ending balance must be a number.");
|
||||
result = -1;
|
||||
}
|
||||
}
|
||||
@ -562,7 +561,7 @@ recn_ok_cb_set_reconciled_helper(gpointer item, gpointer data) {
|
||||
GtkListItem *li = GTK_LIST_ITEM(item);
|
||||
GtkCheckButton *checkbutton = GTK_CHECK_BUTTON(li->item.bin.child);
|
||||
Split *split = gtk_object_get_user_data(GTK_OBJECT(checkbutton));
|
||||
const char recn = xaccSplitGetReconcile(split);
|
||||
/*const char recn = xaccSplitGetReconcile(split);*/
|
||||
|
||||
if(GTK_TOGGLE_BUTTON(checkbutton)->active) {
|
||||
xaccSplitSetReconcile (split, YREC);
|
||||
|
@ -49,7 +49,6 @@
|
||||
#include "table-html.h"
|
||||
#include "Transaction.h"
|
||||
#include "util.h"
|
||||
#include "xtutil.h"
|
||||
|
||||
/** STRUCTS *********************************************************/
|
||||
/* The RegWindow struct contains info needed by an instance of an open
|
||||
@ -750,7 +749,7 @@ deleteCB(GtkWidget *widget, gpointer data)
|
||||
* permanent damage */
|
||||
trans = xaccSplitGetParent (split);
|
||||
sprintf (buf, TRANS_DEL_MSG, xaccSplitGetMemo (split), xaccTransGetDescription (trans));
|
||||
if (!verifyBox(toplevel, buf)) return;
|
||||
if (!verifyBox(buf)) return;
|
||||
|
||||
/* make a copy of all of the accounts that will be
|
||||
* affected by this deletion, so that we can update
|
||||
|
370
src/gnome/options-dialog.c
Normal file
370
src/gnome/options-dialog.c
Normal file
@ -0,0 +1,370 @@
|
||||
#include <guile/gh.h>
|
||||
#include <gnome.h>
|
||||
|
||||
#include "options-dialog.h"
|
||||
|
||||
/* Note that in general, passing SCM values to the GTK/GNOME callbacks
|
||||
as the "data" value requires you to make sure that that pointer is
|
||||
also known in some other way to Guile. Otherwise the GC won't know
|
||||
about it, and may accidentally garbage collect it while you're
|
||||
still using it. Here we should be safe, though, because all of the
|
||||
SCM values are also stored on the Guile side as part of the
|
||||
configuration-item which is stored in the main configuration-item
|
||||
list. If you notice any SCM values that you think aren't
|
||||
protected, let me know. */
|
||||
|
||||
/*
|
||||
TODO:
|
||||
|
||||
Need options_dirty to keep from calling all the setters on a close
|
||||
even if nothing has changed.
|
||||
|
||||
Right now the semantics are that changes take effect for most values
|
||||
immediately, and when you click apply for strings. This may not be
|
||||
what we want in the long run...
|
||||
|
||||
Add callback for OK button.
|
||||
|
||||
Add verify functions for strings
|
||||
|
||||
Add string handlers...
|
||||
|
||||
Change this around so that each UI button, etc only calls:
|
||||
|
||||
(gnc:options-dialog-ok)
|
||||
(gnc:options-dialog-apply)
|
||||
(gnc:options-dialog-close)
|
||||
|
||||
(gnc:options-dialog-item-get-ui-value)
|
||||
(gnc:options-dialog-item-refresh-ui-value)
|
||||
|
||||
*/
|
||||
|
||||
|
||||
static GnomePropertyBox *options_dialog = NULL;
|
||||
|
||||
static gint
|
||||
show_option_documentation(GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data) {
|
||||
gnome_ok_dialog((char *) data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static gint
|
||||
call_boolean_ui_apply_func(GtkWidget *widget, gpointer data) {
|
||||
|
||||
SCM setter_func = (SCM) data;
|
||||
if(GTK_TOGGLE_BUTTON(widget)->active) {
|
||||
gh_call1(setter_func, SCM_BOOL_T);
|
||||
} else {
|
||||
gh_call1(setter_func, SCM_BOOL_F);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
extract_configuration_item_parts(SCM item,
|
||||
char **item_type,
|
||||
char **item_name,
|
||||
char **documentation,
|
||||
SCM *value_getter,
|
||||
SCM *value_setter,
|
||||
SCM *default_value_getter,
|
||||
GtkWidget **w) {
|
||||
/* Cache these */
|
||||
static SCM type_getter;
|
||||
static SCM name_getter;
|
||||
static SCM documentation_getter;
|
||||
static SCM get_value_getter;
|
||||
static SCM get_value_setter;
|
||||
static SCM get_default_value_getter;
|
||||
static SCM widget_getter;
|
||||
static gboolean getters_inited = FALSE;
|
||||
|
||||
if(!getters_inited) {
|
||||
type_getter = gh_eval_str("gnc:configuration-option-type");
|
||||
name_getter = gh_eval_str("gnc:configuration-option-name");
|
||||
documentation_getter = gh_eval_str("gnc:configuration-option-documentation");
|
||||
get_value_getter = gh_eval_str("gnc:configuration-option-getter");
|
||||
get_value_setter = gh_eval_str("gnc:configuration-option-setter");
|
||||
get_default_value_getter =
|
||||
gh_eval_str("gnc:configuration-option-default-getter");
|
||||
widget_getter =
|
||||
gh_eval_str("gnc:configuration-option-widget-get");
|
||||
|
||||
getters_inited = TRUE;
|
||||
}
|
||||
|
||||
if(item_type) {
|
||||
*item_type = gh_symbol2newstr(gh_call1(type_getter, item), NULL);
|
||||
}
|
||||
if(item_name) {
|
||||
*item_name = gh_scm2newstr(gh_call1(name_getter, item), NULL);
|
||||
}
|
||||
if(documentation) {
|
||||
*documentation = gh_scm2newstr(gh_call1(documentation_getter, item), NULL);
|
||||
}
|
||||
if(value_getter) {
|
||||
*value_getter = gh_call1(get_value_getter, item);
|
||||
}
|
||||
if(value_setter) {
|
||||
*value_setter = gh_call1(get_value_setter, item);
|
||||
}
|
||||
if(default_value_getter) {
|
||||
*default_value_getter = gh_call1(get_default_value_getter, item);
|
||||
}
|
||||
if(w) {
|
||||
*w = (GtkWidget *) gh_scm2ulong(gh_call1(widget_getter, item));
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
call_reset_to_default_func(GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data) {
|
||||
SCM item = (SCM) data;
|
||||
SCM value_setter;
|
||||
SCM default_value_getter;
|
||||
|
||||
extract_configuration_item_parts(item,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
&value_setter,
|
||||
&default_value_getter,
|
||||
NULL);
|
||||
|
||||
{
|
||||
SCM default_value = gh_call0(default_value_getter);
|
||||
gh_call1(value_setter, default_value);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
_gnc_options_dialog_item_refresh_ui_(SCM item) {
|
||||
|
||||
if(options_dialog) {
|
||||
|
||||
char *item_type;
|
||||
SCM value_getter;
|
||||
GtkWidget *w;
|
||||
|
||||
extract_configuration_item_parts(item,
|
||||
&item_type,
|
||||
NULL,
|
||||
NULL,
|
||||
&value_getter,
|
||||
NULL,
|
||||
NULL,
|
||||
&w);
|
||||
|
||||
if(strcmp(item_type, "boolean")) {
|
||||
gboolean current_state = gh_scm2bool(gh_call0(value_getter));
|
||||
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(w), current_state);
|
||||
} else {
|
||||
fprintf(stderr, "Unknown type for refresh. Ignoring.\n");
|
||||
}
|
||||
free(item_type);
|
||||
}
|
||||
}
|
||||
|
||||
SCM
|
||||
_gnc_options_dialog_item_get_ui_value_(SCM item) {
|
||||
SCM result = 0;
|
||||
if(options_dialog) {
|
||||
char *item_type;
|
||||
SCM value_getter;
|
||||
GtkWidget *w;
|
||||
|
||||
extract_configuration_item_parts(item,
|
||||
&item_type,
|
||||
NULL,
|
||||
NULL,
|
||||
&value_getter,
|
||||
NULL,
|
||||
NULL,
|
||||
&w);
|
||||
|
||||
if(strcmp(item_type, "boolean")) {
|
||||
result = gh_bool2scm(GTK_TOGGLE_BUTTON(w)->active);
|
||||
} else {
|
||||
fprintf(stderr, "Unknown type for refresh. Ignoring.\n");
|
||||
result = SCM_UNDEFINED;
|
||||
}
|
||||
free(item_type);
|
||||
}
|
||||
return(result);
|
||||
}
|
||||
|
||||
void
|
||||
_gnc_options_dialog_add_item_(GtkBox *page_w, SCM item) {
|
||||
|
||||
char *item_type;
|
||||
char *item_name;
|
||||
char *item_documentation;
|
||||
SCM item_value_getter;
|
||||
SCM item_value_setter;
|
||||
SCM item_default_value_getter;
|
||||
gboolean known_type = FALSE;
|
||||
|
||||
extract_configuration_item_parts(item,
|
||||
&item_type,
|
||||
&item_name,
|
||||
&item_documentation,
|
||||
&item_value_getter,
|
||||
&item_value_setter,
|
||||
&item_default_value_getter,
|
||||
NULL);
|
||||
{
|
||||
/* Horizontal box to hold all the UI items. */
|
||||
GtkWidget *hbox = gtk_hbox_new(FALSE, 1);
|
||||
GtkWidget *value_widget = NULL;
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(page_w), GTK_WIDGET(hbox), FALSE, FALSE, 3);
|
||||
|
||||
if(strcmp(item_type, "boolean") == 0) {
|
||||
gboolean current_state;
|
||||
|
||||
value_widget = gtk_check_button_new_with_label(item_name);
|
||||
current_state = gh_scm2bool(gh_call0(item_value_getter));
|
||||
|
||||
gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(value_widget),
|
||||
current_state);
|
||||
gtk_signal_connect (GTK_OBJECT (value_widget),
|
||||
"toggled",
|
||||
(GtkSignalFunc) call_boolean_ui_apply_func,
|
||||
(gpointer) item_value_setter);
|
||||
known_type = TRUE;
|
||||
} else {
|
||||
gchar *label_name = g_strdup_printf("%s: <unknown-type>", item_name);
|
||||
value_widget = gtk_label_new(label_name);
|
||||
}
|
||||
|
||||
gtk_widget_show(value_widget);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), value_widget, FALSE, FALSE, 3);
|
||||
|
||||
{
|
||||
static SCM item_widget_setter;
|
||||
static gboolean setter_inited = FALSE;
|
||||
if(!setter_inited) {
|
||||
item_widget_setter = gh_eval_str("gnc:configuration-option-widget-set!");
|
||||
setter_inited = TRUE;
|
||||
}
|
||||
/* HACK: gh_ulong2scm might not always be OK for pointers... */
|
||||
gh_call2(item_widget_setter, item,
|
||||
gh_ulong2scm((unsigned long) value_widget));
|
||||
}
|
||||
|
||||
{
|
||||
GtkWidget *help_button = gtk_button_new_with_label("Help");
|
||||
gtk_widget_show(help_button);
|
||||
gtk_box_pack_end(GTK_BOX(hbox), help_button, FALSE, FALSE, 3);
|
||||
gtk_signal_connect (GTK_OBJECT (help_button),
|
||||
"button_press_event",
|
||||
(GtkSignalFunc) show_option_documentation,
|
||||
(gpointer) g_strdup(item_documentation));
|
||||
}
|
||||
|
||||
|
||||
if(known_type) {
|
||||
GtkWidget *default_button = gtk_button_new_with_label("Set to default");
|
||||
gtk_widget_show(default_button);
|
||||
gtk_box_pack_end(GTK_BOX(hbox), default_button, FALSE, FALSE, 3);
|
||||
gtk_signal_connect (GTK_OBJECT (default_button),
|
||||
"button_press_event",
|
||||
(GtkSignalFunc) call_reset_to_default_func,
|
||||
(gpointer) item);
|
||||
}
|
||||
gtk_widget_show(hbox);
|
||||
}
|
||||
free(item_type);
|
||||
free(item_name);
|
||||
free(item_documentation);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
_gnc_options_dialog_add_page_(const char label[]) {
|
||||
|
||||
GtkWidget *page_label;
|
||||
GtkWidget *page_content_box;
|
||||
|
||||
page_label = gtk_label_new(label);
|
||||
gtk_widget_show(page_label);
|
||||
page_content_box = gtk_vbox_new ( FALSE, 1 );
|
||||
gtk_widget_show (page_content_box);
|
||||
|
||||
gnome_property_box_append_page(options_dialog, page_content_box, page_label);
|
||||
|
||||
//gtk_widget_set_usize ( GTK_WIDGET(box2), 225, 225 );
|
||||
return(page_content_box);
|
||||
}
|
||||
|
||||
static void
|
||||
build_options_dialog_contents() {
|
||||
const char builder_name[] = "gnc_:build-options-dialog";
|
||||
|
||||
/* FIXME: We should be using this, but it doesn't work. I think
|
||||
it's a module namespace issue...*/
|
||||
/*SCM scm_builder = gh_lookup(builder_name);*/
|
||||
|
||||
SCM scm_builder = gh_eval_str((char *) builder_name);
|
||||
|
||||
if(gh_procedure_p(scm_builder)) {
|
||||
gh_call0(scm_builder);
|
||||
} else {
|
||||
fprintf(stderr, "gnucash: function lookup failed %s\n", builder_name);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
options_dialog_close_cb(GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data) {
|
||||
gh_eval_str("(gnc:options-dialog-cancel-clicked)");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static gint
|
||||
options_dialog_ok_cb(GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
gpointer data) {
|
||||
gh_eval_str("(gnc:options-dialog-ok-clicked)");
|
||||
|
||||
/* Need to return a value that determines if we succeed... If we
|
||||
don't, don't close the window...*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/* Options dialog... this should house all of the config options */
|
||||
/* like where the docs reside, and whatever else is deemed necessary */
|
||||
void
|
||||
gnc_show_options_dialog() {
|
||||
|
||||
if(!options_dialog) {
|
||||
gh_eval_str("(gnc:options-dialog-clear-cancel-actions)");
|
||||
gh_eval_str("(gnc:options-dialog-clear-apply-actions)");
|
||||
|
||||
options_dialog = GNOME_PROPERTY_BOX(gnome_property_box_new());
|
||||
gnome_dialog_close_hides (GNOME_DIALOG(options_dialog), TRUE);
|
||||
|
||||
build_options_dialog_contents();
|
||||
|
||||
gtk_widget_set_usize ( GTK_WIDGET(options_dialog), 500, 400 );
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (options_dialog->cancel_button),
|
||||
"button_press_event",
|
||||
(GtkSignalFunc) options_dialog_close_cb,
|
||||
(gpointer) NULL);
|
||||
}
|
||||
gtk_widget_show(GTK_WIDGET(options_dialog));
|
||||
gdk_window_raise(GTK_WIDGET(options_dialog)->window);
|
||||
}
|
||||
|
31
src/gnome/options-dialog.h
Normal file
31
src/gnome/options-dialog.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef __OPTIONS_DIALOG_H__
|
||||
#define __OPTIONS_DIALOG_H__
|
||||
|
||||
#include <gnome.h>
|
||||
#include <guile/gh.h>
|
||||
|
||||
void gnc_show_options_dialog();
|
||||
|
||||
/* private */
|
||||
|
||||
GtkWidget *_gnc_options_dialog_add_page_(const char label[]);
|
||||
void _gnc_options_dialog_add_item_(GtkBox *page_w, SCM item);
|
||||
|
||||
void _gnc_options_dialog_item_refresh_ui_(SCM item);
|
||||
SCM _gnc_options_dialog_item_get_ui_value_(SCM item);
|
||||
|
||||
#endif /* __OPTIONS_DIALOG_H__ */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*-*-top-level-c-*-**************************************************\
|
||||
* main.c -- main for xacc (X-Accountant) *
|
||||
/********************************************************************\
|
||||
* top-level.c -- main for xacc (X-Accountant) *
|
||||
* Copyright (C) 1997 Robin D. Clark *
|
||||
* Copyright (C) 1998 Linas Vepstas *
|
||||
* *
|
||||
@ -27,28 +27,29 @@
|
||||
|
||||
#include "Account.h"
|
||||
#include "FileIO.h"
|
||||
#include "FileBox.h"
|
||||
#include "FileDialog.h"
|
||||
#include "Group.h"
|
||||
#include "top-level.h"
|
||||
#include "MainWindow.h"
|
||||
#include "messages.h"
|
||||
#include "Transaction.h"
|
||||
#include "TransLog.h"
|
||||
#include "util.h"
|
||||
#include "xtutil.h"
|
||||
#include "top-level.h"
|
||||
|
||||
/** PROTOTYPES ******************************************************/
|
||||
|
||||
/** GLOBALS *********************************************************/
|
||||
|
||||
char *datafile = NULL;
|
||||
AccountGroup *toplevel;
|
||||
//Boolean realized = False; /* Has the toplevel been realized? */
|
||||
GtkWidget *app;
|
||||
|
||||
AccountGroup *topgroup = NULL;
|
||||
gncUIWidget gnc_get_ui_data() {
|
||||
return app;
|
||||
}
|
||||
|
||||
/* These gnucash_lowlev and gnucash_ui functions are just hacks to get
|
||||
the guile stuff up and running. Expect a more formal definition of
|
||||
what they should do soo, and expect that the open/select functions
|
||||
what they should do soon, and expect that the open/select functions
|
||||
will be merged with the code in FMB_OPEN in MainWindow.c */
|
||||
|
||||
int
|
||||
@ -75,14 +76,13 @@ gnucash_lowlev_app_init()
|
||||
{
|
||||
int fake_argc = 1;
|
||||
char *fake_argv[] = {"gnucash"};
|
||||
int fake_index;
|
||||
|
||||
/* We're going to have to have other ways to handle X and GUI
|
||||
specific args...
|
||||
|
||||
For now, use fake_argv and fake_argc...
|
||||
*/
|
||||
gnome_init("GnuCash", NULL, fake_argc, fake_argv, 0, &fake_index);
|
||||
gnome_init("GnuCash", NULL, fake_argc, fake_argv);
|
||||
app = gnome_app_new ( "gnucash", "GnuCash" );
|
||||
|
||||
{
|
||||
@ -104,11 +104,9 @@ int
|
||||
gnucash_lowlev_app_main()
|
||||
{
|
||||
/* Make main window */
|
||||
gnc_ui_mainWindow(topgroup);
|
||||
mainWindow();
|
||||
|
||||
/* Draw toplevel */
|
||||
gtk_widget_realize (app);
|
||||
//realized = TRUE;
|
||||
|
||||
/* Enter gnome event loop */
|
||||
gtk_main();
|
||||
@ -116,46 +114,18 @@ gnucash_lowlev_app_main()
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* hack alert -- all we do below is rename some functions ... fix this someday */
|
||||
|
||||
int
|
||||
gnucash_ui_open_file(const char name[]) {
|
||||
/* FIXME: This should really be calling gncFileOpenFile from
|
||||
FileDialog.c */
|
||||
/* FIXME: This code looks gui-independent to me ...
|
||||
* (nothing in thisroutine depends on motif/gtk/etc.)
|
||||
*/
|
||||
|
||||
datafile = name;
|
||||
|
||||
if( NULL != datafile )
|
||||
{
|
||||
xaccLogSetBaseName (datafile);
|
||||
topgroup = xaccReadAccountGroup (datafile); /* load accounts from file */
|
||||
}
|
||||
|
||||
/* FIXME: this should not really be here. We should make
|
||||
gnc_ui_select_file more independent. You should be able to call
|
||||
it at any time and have it DTRT. Code should be stolen from
|
||||
MainWindow.c FMB_OPEN. In fact, that whole callback routine
|
||||
should probably be broken up into sub-functions that we can use
|
||||
from the Guile level.
|
||||
In fact, this has lready been done for the motif version,
|
||||
and some minor makefile cleaup will allow the same fixes to be used here.
|
||||
Take a good look at FileDialog.c for the actual code ...
|
||||
*/
|
||||
if( NULL == topgroup )
|
||||
{
|
||||
topgroup = xaccMallocAccountGroup(); /* the file could not be found */
|
||||
}
|
||||
return (topgroup != NULL);
|
||||
|
||||
gncFileOpenFile(name);
|
||||
return (1);
|
||||
}
|
||||
|
||||
int
|
||||
gnucash_ui_select_file() {
|
||||
|
||||
datafile = fileBox( toplevel, OPEN_STR, "*.xac" );
|
||||
gnucash_ui_open_file(datafile);
|
||||
return (topgroup != NULL);
|
||||
gncFileOpen();
|
||||
return (1);
|
||||
}
|
||||
|
||||
/****************** END OF FILE **********************/
|
||||
|
@ -23,10 +23,14 @@
|
||||
* Huntington Beach, CA 92648-4632 *
|
||||
\********************************************************************/
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "messages.h"
|
||||
#include "util.h"
|
||||
#include "xtutil.h"
|
||||
#include "ui-callbacks.h"
|
||||
#include "top-level.h"
|
||||
|
||||
#if 0
|
||||
|
||||
@ -247,10 +251,9 @@ verify_cb_no(GtkWidget *w, gpointer data) {
|
||||
* text - the message to display *
|
||||
* Return: none *
|
||||
\********************************************************************/
|
||||
gboolean
|
||||
verifyBox(GtkWidget *parent, const char *text)
|
||||
{
|
||||
|
||||
gncBool
|
||||
verifyBox(const char *text) {
|
||||
GtkWidget *parent = gnc_get_ui_data();
|
||||
GtkWidget *verify_box = NULL;
|
||||
GtkWidget *verify_text = NULL;
|
||||
struct verify_callback_data result;
|
||||
@ -308,9 +311,8 @@ error_cb_ok(GtkWidget *w, gpointer data) {
|
||||
* Return: none *
|
||||
\********************************************************************/
|
||||
void
|
||||
errorBox(GtkWidget *parent, const char *message )
|
||||
{
|
||||
|
||||
errorBox(const char *message) {
|
||||
GtkWidget *parent = gnc_get_ui_data();
|
||||
GtkWidget *error_box = NULL;
|
||||
GtkWidget *error_text = NULL;
|
||||
gboolean finished = FALSE;
|
||||
|
@ -23,11 +23,15 @@
|
||||
|
||||
include @top_srcdir@/Makefile.init
|
||||
|
||||
INCLPATH = -I@srcdir@/../.. \
|
||||
-I@srcdir@/../../include \
|
||||
-I@srcdir@/../engine \
|
||||
-I@srcdir@/../../lib/ComboBox-1.33 \
|
||||
-I@srcdir@/../../lib/Xbae-4.6.2-linas \
|
||||
GTKSHEET_DIR := @GTKSHEET_DIR@
|
||||
|
||||
INCLPATH = -I@top_srcdir@/ \
|
||||
-I@top_srcdir@/src \
|
||||
-I@top_srcdir@/include \
|
||||
-I@top_srcdir@/src/engine \
|
||||
-I@top_srcdir@/lib/${GTKSHEET_DIR} \
|
||||
-I@top_srcdir@/lib/ComboBox-1.33 \
|
||||
-I@top_srcdir@/lib/Xbae-4.6.2-linas \
|
||||
-I@prefix@/include
|
||||
|
||||
|
||||
|
@ -98,6 +98,7 @@ void xaccInitComboCell (ComboCell *cell)
|
||||
static
|
||||
void destroyCombo (BasicCell *bcell)
|
||||
{
|
||||
#if OLD_CLIST_REG
|
||||
ComboCell *cell = (ComboCell *) bcell;
|
||||
PopBox *box = (PopBox *) (cell->cell.gui_private);
|
||||
|
||||
@ -109,12 +110,13 @@ void destroyCombo (BasicCell *bcell)
|
||||
matter) code is an ugly hack that should go away when we have a
|
||||
real table widget... */
|
||||
|
||||
|
||||
if (!(cell->cell.realize) && box && box->table && box->table->entry_frame) {
|
||||
gtk_container_remove(GTK_CONTAINER(box->table->entry_frame),
|
||||
GTK_WIDGET(box->combobox));
|
||||
gtk_container_add(GTK_CONTAINER(box->table->entry_frame),
|
||||
GTK_WIDGET(box->table->entry_widget));
|
||||
|
||||
|
||||
/* allow the widget to be shown again */
|
||||
cell->cell.realize = realizeCombo;
|
||||
cell->cell.move = NULL;
|
||||
@ -122,6 +124,7 @@ void destroyCombo (BasicCell *bcell)
|
||||
cell->cell.leave_cell = NULL;
|
||||
cell->cell.destroy = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* =============================================== */
|
||||
@ -154,8 +157,11 @@ void
|
||||
xaccAddComboCellMenuItem (ComboCell *cell, char * menustr)
|
||||
{
|
||||
PopBox *box = (PopBox *) cell->cell.gui_private;
|
||||
GtkList *comboitems = GTK_LIST(box->combobox->list);
|
||||
|
||||
/*
|
||||
GtkList *comboitems = GTK_LIST(box->combobox->list);
|
||||
*/
|
||||
|
||||
if (!cell) return;
|
||||
if (!menustr) return;
|
||||
|
||||
@ -250,6 +256,7 @@ const char * enterCombo (BasicCell *bcell, const char *value)
|
||||
|
||||
if(!choice) choice = "";
|
||||
|
||||
#if OLD_CLIST_REG
|
||||
if(GTK_WIDGET(box->table->entry_widget)->parent ==
|
||||
box->table->entry_frame) {
|
||||
gtk_container_remove(GTK_CONTAINER(box->table->entry_frame),
|
||||
@ -259,11 +266,14 @@ const char * enterCombo (BasicCell *bcell, const char *value)
|
||||
GTK_WIDGET(box->combobox));
|
||||
|
||||
gtk_entry_set_text(GTK_ENTRY(box->combobox->entry), choice);
|
||||
#endif
|
||||
} else {
|
||||
#if OLD_CLIST_REG
|
||||
gtk_container_remove(GTK_CONTAINER(box->table->entry_frame),
|
||||
GTK_WIDGET(box->combobox));
|
||||
gtk_container_add(GTK_CONTAINER(box->table->entry_frame),
|
||||
GTK_WIDGET(box->table->entry_widget));
|
||||
#endif
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@ -276,7 +286,10 @@ const char * leaveCombo (BasicCell *bcell, const char *value)
|
||||
{
|
||||
ComboCell *cell = (ComboCell *) bcell;
|
||||
PopBox *box = (PopBox *) (cell->cell.gui_private);
|
||||
|
||||
#if OLD_CLIST_REG
|
||||
gchar *text;
|
||||
#endif
|
||||
|
||||
/* check for a valid mapping of the widget.
|
||||
Note that if the combo box value is set to
|
||||
@ -287,6 +300,7 @@ const char * leaveCombo (BasicCell *bcell, const char *value)
|
||||
We want to ignore these. */
|
||||
if ((0 > box->currow) || (0 > box->curcol)) return NULL;
|
||||
|
||||
#if OLD_CLIST_REG
|
||||
text = gtk_entry_get_text(GTK_ENTRY(box->combobox->entry));
|
||||
|
||||
/* be sure to set the string into the matrix widget as well,
|
||||
@ -303,7 +317,7 @@ const char * leaveCombo (BasicCell *bcell, const char *value)
|
||||
GTK_WIDGET(box->combobox));
|
||||
gtk_container_add(GTK_CONTAINER(box->table->entry_frame),
|
||||
GTK_WIDGET(box->table->entry_widget));
|
||||
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
#include "basiccell.h"
|
||||
#include "recncell.h"
|
||||
#include "ui-callbacks.h"
|
||||
|
||||
/* hack alert -- I am uncomfortable with including engine
|
||||
* stuff here; all code in this directory should really be
|
||||
@ -48,14 +49,14 @@ ToggleRecn (BasicCell *_cell, const char *cur_val)
|
||||
BasicCell *cell = (BasicCell *) _cell;
|
||||
char buff[2];
|
||||
|
||||
/* throw up a popup if the user tries to undo a reconciled transcation */
|
||||
/* hack alert -- this sets a new precedent ... verifyBox is defined in
|
||||
* both the motif and the gtk subdirs; I don't think I like it that way.
|
||||
* anyway, that's why we don't have a prototype for this ... let the compiler
|
||||
* warn us, remind us to deal with this ...
|
||||
*/
|
||||
/* throw up a popup if the user tries to undo a reconciled transcation
|
||||
hack alert -- this sets a new precedent ... verifyBox is defined in
|
||||
both the motif and the gtk subdirs; I don't think I like it that way.
|
||||
|
||||
Now it's in ui-callbacks.h which is UI independent, but that's
|
||||
still perhaps not optimal... */
|
||||
if(cur_val[0] == YREC) {
|
||||
if(!verifyBox(NULL, "Really change state of reconciled transaction?")) {
|
||||
if(!verifyBox("Really change state of reconciled transaction?")) {
|
||||
return strdup(cur_val);
|
||||
}
|
||||
}
|
||||
|
@ -41,30 +41,27 @@
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "gtksheet.h"
|
||||
|
||||
#include "cellblock.h"
|
||||
#include "table-allgui.h"
|
||||
#include "table-gtk.h"
|
||||
#include "util.h"
|
||||
|
||||
#if 0
|
||||
|
||||
/* The XrmQuarks are used to figure out the direction of
|
||||
* traversal from cell to cell */
|
||||
|
||||
//static XrmQuark QPointer, QLeft, QRight, QUp, QDown;
|
||||
//static Boolean haveQuarks = False;
|
||||
|
||||
#endif
|
||||
/* This static indicates the debugging module that this .o belongs to. */
|
||||
static short module = MOD_REGISTER;
|
||||
|
||||
/* ==================================================== */
|
||||
|
||||
void
|
||||
xaccNextTabGroup (Table *table, GtkWidget * w)
|
||||
{
|
||||
xaccNextTabGroup (Table *table, GtkWidget * w) {
|
||||
table->next_tab_group = w;
|
||||
}
|
||||
|
||||
/* ==================================================== */
|
||||
|
||||
#if 0
|
||||
|
||||
static int
|
||||
verify_cell_interaction_OK(Table *table, const int row, const int col)
|
||||
{
|
||||
@ -105,8 +102,8 @@ verify_cell_interaction_OK(Table *table, const int row, const int col)
|
||||
} else {
|
||||
/* if cell is marked as output-only,
|
||||
* then don't call callbacks */
|
||||
if (0 == (XACC_CELL_ALLOW_INPUT & ((arr->cells[rel_row][rel_col])->input_output)))
|
||||
{
|
||||
if (0 == (XACC_CELL_ALLOW_INPUT &
|
||||
((arr->cells[rel_row][rel_col])->input_output))) {
|
||||
invalid = TRUE;
|
||||
}
|
||||
}
|
||||
@ -122,14 +119,16 @@ verify_cell_interaction_OK(Table *table, const int row, const int col)
|
||||
* been performed. */
|
||||
|
||||
static void
|
||||
cell_entered(Table *table, const int row, const int col)
|
||||
{
|
||||
cell_entered(Table *table, const int row, const int col) {
|
||||
|
||||
#if OLD_CLIST_REG
|
||||
|
||||
CellBlock *arr;
|
||||
int rel_row, rel_col;
|
||||
const char * (*enter) (BasicCell *, const char *);
|
||||
gchar *text;
|
||||
GtkCList *cl = GTK_CLIST(table->table_widget);
|
||||
|
||||
|
||||
fprintf(stderr, "cell_entered: %d %d\n", row - 1, col);
|
||||
|
||||
gtk_clist_get_text(cl, row - 1, col, &text);
|
||||
@ -148,10 +147,10 @@ cell_entered(Table *table, const int row, const int col)
|
||||
gdk_pixmap_unref(pm);
|
||||
gdk_bitmap_unref(mask);
|
||||
}
|
||||
|
||||
|
||||
gtk_frame_set_label(GTK_FRAME(table->entry_frame),
|
||||
cl->column[col].title);
|
||||
|
||||
|
||||
/* Have to block and unblock here because we don't want a callback
|
||||
for this "edit" */
|
||||
{
|
||||
@ -206,6 +205,8 @@ cell_entered(Table *table, const int row, const int col)
|
||||
* traversed out of if a traverse even happens */
|
||||
table->prev_phys_traverse_row = row;
|
||||
table->prev_phys_traverse_col = col;
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ==================================================== */
|
||||
@ -214,7 +215,7 @@ static void
|
||||
compute_string_single_change(const gchar *a, const gchar *b, gchar **result) {
|
||||
/* Compute the change from a to b assuming that the changed region
|
||||
is contiguous. This is only a guess, the solution is
|
||||
ambiguous. */
|
||||
inherently ambiguous. */
|
||||
|
||||
const gint a_len = strlen(a);
|
||||
const gint b_len = strlen(b);
|
||||
@ -252,6 +253,7 @@ compute_string_single_change(const gchar *a, const gchar *b, gchar **result) {
|
||||
static void
|
||||
cell_modified(Table *table, const int row, const int col)
|
||||
{
|
||||
#if OLD_CLIST_REG
|
||||
|
||||
CellBlock *arr;
|
||||
GtkEntry *entry = GTK_ENTRY(table->entry_widget);
|
||||
@ -327,13 +329,17 @@ cell_modified(Table *table, const int row, const int col)
|
||||
g_free(table->prev_entry_text);
|
||||
table->prev_entry_text = g_strdup(final_text);
|
||||
g_free((gchar *) change);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ==================================================== */
|
||||
|
||||
static void
|
||||
cell_left(Table *table, const int row, const int col)
|
||||
{
|
||||
cell_left(Table *table, const int row, const int col) {
|
||||
|
||||
#if OLD_CLIST_REG
|
||||
|
||||
CellBlock *arr;
|
||||
int rel_row, rel_col;
|
||||
const char * (*leave) (BasicCell *, const char *);
|
||||
@ -400,16 +406,20 @@ cell_left(Table *table, const int row, const int col)
|
||||
table->entries[row][col] = newval;
|
||||
(arr->cells[rel_row][rel_col])->changed = 0xffffffff;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
|
||||
/* ==================================================== */
|
||||
|
||||
static void
|
||||
traverseCB (GtkWidget * mw, gpointer cd, gpointer cb)
|
||||
{
|
||||
Table *table;
|
||||
traverseCB (GtkWidget * mw, gpointer cd, gpointer cb) {
|
||||
|
||||
Table *table;
|
||||
CellBlock *arr;
|
||||
XbaeMatrixTraverseCellCallbackStruct *cbs;
|
||||
int row, col;
|
||||
@ -484,10 +494,34 @@ traverseCB (GtkWidget * mw, gpointer cd, gpointer cb)
|
||||
|
||||
/* ==================================================== */
|
||||
|
||||
static void
|
||||
table_activate_cell_cb(GtkSheet *s, gint row, gint column, gpointer data) {
|
||||
L("activate_cell %d %d\n", row, column);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
table_set_cell_cb(GtkSheet *s, gint row, gint column, gpointer data) {
|
||||
L("set_cell %d %d\n", row, column);
|
||||
}
|
||||
|
||||
static void
|
||||
table_changed_cb(GtkSheet *s, gint row, gint column, gpointer data) {
|
||||
L("changed %d %d\n", row, column);
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
static int counter;
|
||||
|
||||
static void
|
||||
table_edit_entry_cb(GtkEntry *entry, gpointer user_data) {
|
||||
|
||||
#if OLD_CLIST_REG
|
||||
|
||||
Table *table = (Table *) user_data;
|
||||
const int row = table->current_row;
|
||||
const int col = table->current_col;
|
||||
@ -508,6 +542,9 @@ table_edit_entry_cb(GtkEntry *entry, gpointer user_data) {
|
||||
cell_modified(table, row + 1, col);
|
||||
printf(" cm: out %d\n", xxx);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/* ==================================================== */
|
||||
@ -515,6 +552,9 @@ table_edit_entry_cb(GtkEntry *entry, gpointer user_data) {
|
||||
static void
|
||||
table_select_row_cb(GtkCList *cl, gint row, gint column, GdkEventButton *e,
|
||||
gpointer user_data) {
|
||||
|
||||
#if OLD_CLIST_REG
|
||||
|
||||
Table *table = (Table *) user_data;
|
||||
|
||||
fprintf(stderr, "table_select_row_cb: %d %d\n", row, column);
|
||||
@ -536,18 +576,21 @@ table_select_row_cb(GtkCList *cl, gint row, gint column, GdkEventButton *e,
|
||||
cell_entered(table, row + 1, column);
|
||||
printf(" ce: out %d\n", xxx);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* ==================================================== */
|
||||
|
||||
GtkWidget *
|
||||
xaccCreateTable (Table *table, GtkWidget * parent)
|
||||
{
|
||||
xaccCreateTable (Table *table, GtkWidget *parent) {
|
||||
|
||||
CellBlock *curs;
|
||||
unsigned char * alignments;
|
||||
short * widths;
|
||||
int num_header_rows = 0;
|
||||
int i;
|
||||
|
||||
if (!table) return 0;
|
||||
|
||||
@ -558,19 +601,6 @@ xaccCreateTable (Table *table, GtkWidget * parent)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* if quarks have not yet been initialized for this
|
||||
* application, initialize them now. */
|
||||
if (!haveQuarks) {
|
||||
QPointer = XrmPermStringToQuark ("Pointer");
|
||||
QLeft = XrmPermStringToQuark ("Left");
|
||||
QRight = XrmPermStringToQuark ("Right");
|
||||
QUp = XrmPermStringToQuark ("Up");
|
||||
QDown = XrmPermStringToQuark ("Down");
|
||||
haveQuarks = True;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* The 0'th row of the handlers is defined as the header */
|
||||
alignments = NULL;
|
||||
widths = NULL;
|
||||
@ -598,38 +628,72 @@ xaccCreateTable (Table *table, GtkWidget * parent)
|
||||
/* We don't ref this vbox because we never use it in our code again */
|
||||
vbox = gtk_vbox_new(FALSE, 0);
|
||||
gtk_container_add(GTK_CONTAINER(parent), vbox);
|
||||
|
||||
if(num_header_rows == 0) {
|
||||
reg = gtk_clist_new(table->num_phys_cols);
|
||||
gtk_widget_ref(reg);
|
||||
} else {
|
||||
reg = gtk_clist_new_with_titles(table->num_phys_cols,
|
||||
table->entries[0]);
|
||||
gtk_widget_ref(reg);
|
||||
gtk_clist_freeze(GTK_CLIST(reg));
|
||||
for(i = 0; i < table->num_phys_cols; i++) {
|
||||
|
||||
/* Widths are in units of characters, not pixels, so we have
|
||||
this hack. It should be fixed later... */
|
||||
gtk_clist_set_column_width(GTK_CLIST(reg), i, widths[i] * 5);
|
||||
|
||||
reg = gtk_sheet_new(table->num_phys_rows - num_header_rows,
|
||||
table->num_phys_cols,
|
||||
"THE REGISTER");
|
||||
gtk_sheet_hide_row_titles(GTK_SHEET(reg));
|
||||
gtk_sheet_show_column_titles(GTK_SHEET(reg));
|
||||
gtk_widget_ref(reg);
|
||||
|
||||
gtk_sheet_freeze(GTK_SHEET(reg));
|
||||
|
||||
/* Set the column titles */
|
||||
if(num_header_rows == 1) {
|
||||
int col;
|
||||
for(col = 0; col < table->num_phys_cols; col++) {
|
||||
gtk_sheet_set_column_title(GTK_SHEET(reg), col, table->entries[0][col]);
|
||||
}
|
||||
gtk_clist_thaw(GTK_CLIST(reg));
|
||||
}
|
||||
// gtk_clist_set_policy(GTK_CLIST(reg),
|
||||
// GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
||||
|
||||
gtk_clist_freeze(GTK_CLIST(reg));
|
||||
for(i = num_header_rows; i < table->num_phys_rows; i++) {
|
||||
gtk_clist_append(GTK_CLIST(reg), table->entries[i]);
|
||||
|
||||
{
|
||||
int row, col;
|
||||
|
||||
/* Set the column widths */
|
||||
for(col = 0; col < table->num_phys_cols; col++) {
|
||||
/* HACK: Widths are in units of characters, not pixels, so we
|
||||
have this. It should be fixed later... */
|
||||
const int char_width =
|
||||
gdk_char_width (GTK_WIDGET(reg)->style->font,(gchar)'X');
|
||||
const int col_width = (widths[col] < 2) ? 2 : widths[col];
|
||||
|
||||
gtk_sheet_set_column_width(GTK_SHEET(reg),
|
||||
col,
|
||||
col_width * char_width);
|
||||
}
|
||||
|
||||
/* GTK_SHEET_SET_FLAGS(reg, GTK_SHEET_FLAGS(reg) & SHEET_AUTORESIZE); */
|
||||
|
||||
/* Set the cell contents */
|
||||
for(row = num_header_rows; row < table->num_phys_rows; row++) {
|
||||
for(col = 0; col < table->num_phys_cols; col++) {
|
||||
gtk_sheet_set_cell(GTK_SHEET(reg),
|
||||
row, col,
|
||||
GTK_JUSTIFY_LEFT,
|
||||
table->entries[row][col]);
|
||||
}
|
||||
}
|
||||
}
|
||||
gtk_clist_set_selection_mode(GTK_CLIST(reg), GTK_SELECTION_BROWSE);
|
||||
gtk_clist_thaw(GTK_CLIST(reg));
|
||||
gtk_sheet_thaw(GTK_SHEET(reg));
|
||||
|
||||
/* size?
|
||||
alignments?
|
||||
grid type?
|
||||
shadow type?
|
||||
*/
|
||||
gtk_box_pack_start(GTK_BOX(vbox), reg, TRUE, TRUE, 0);
|
||||
gtk_widget_show(reg);
|
||||
gtk_widget_show(vbox);
|
||||
|
||||
table->table_widget = reg;
|
||||
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (reg), "activate_cell",
|
||||
GTK_SIGNAL_FUNC (table_activate_cell_cb),
|
||||
(gpointer) table);
|
||||
gtk_signal_connect (GTK_OBJECT (reg), "set_cell",
|
||||
GTK_SIGNAL_FUNC (table_set_cell_cb),
|
||||
(gpointer) table);
|
||||
gtk_signal_connect (GTK_OBJECT (reg), "changed",
|
||||
GTK_SIGNAL_FUNC (table_changed_cb),
|
||||
(gpointer) table);
|
||||
|
||||
#if OLD_CLIST_REG
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (reg), "select_row",
|
||||
GTK_SIGNAL_FUNC (table_select_row_cb),
|
||||
@ -641,11 +705,6 @@ xaccCreateTable (Table *table, GtkWidget * parent)
|
||||
// GTK_SIGNAL_FUNC (table_unselect_row_cb),
|
||||
// (gpointer) table);
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(vbox), reg, TRUE, TRUE, 0);
|
||||
gtk_widget_show(reg);
|
||||
|
||||
table->table_widget = reg;
|
||||
|
||||
{
|
||||
GtkWidget *entry_frame = NULL;
|
||||
GtkWidget *entry_widget = NULL;
|
||||
@ -675,6 +734,7 @@ xaccCreateTable (Table *table, GtkWidget * parent)
|
||||
table->entry_frame = entry_frame;
|
||||
table->entry_widget = entry_widget;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* initialize any cell gui elements now, if any */
|
||||
@ -706,7 +766,7 @@ xaccCreateCursor (Table * table, CellBlock *curs)
|
||||
void (*gtk_realize) (BasicCell *, void *gui, int pixel_width);
|
||||
gtk_realize = cell->realize;
|
||||
if (gtk_realize) {
|
||||
int pixel_width;
|
||||
/* int pixel_width; */
|
||||
/* cl->column[col].width */
|
||||
/*pixel_width = XbaeMatrixGetColumnPixelWidth (reg, j);*/
|
||||
/*gtk_realize (cell, ((void *) reg), pixel_width);*/
|
||||
@ -719,50 +779,155 @@ xaccCreateCursor (Table * table, CellBlock *curs)
|
||||
|
||||
/* ==================================================== */
|
||||
|
||||
void
|
||||
xaccRefreshTableGUI (Table * table)
|
||||
{
|
||||
CellBlock *curs;
|
||||
GtkCList * reg;
|
||||
int num_header_rows = 0;
|
||||
int i, j;
|
||||
static inline void
|
||||
set_cell_color(GtkSheet *reg, Table *table, guint row, guint col,
|
||||
const uint32 argb,
|
||||
void (*setter)(GtkSheet *s, GtkSheetRange r, GdkColor *c)) {
|
||||
|
||||
/* You might be able to make this much faster by caching colors
|
||||
rather than re-allocating them every time, but this is much
|
||||
quicker to implement, and it's easier to check for correctness.
|
||||
See the motif code for the other approach. Also, note that
|
||||
*both* implementations could be sped up if there was a finer
|
||||
grained interface where the engine would just tell the UI to
|
||||
change the color on particular items when appropriate, but at the
|
||||
cost of added complexity. */
|
||||
|
||||
gboolean success;
|
||||
GdkColor color;
|
||||
GdkColormap *cmap;
|
||||
|
||||
color.red = (argb & 0xff0000) >> 8;
|
||||
color.green = argb & 0xff00;
|
||||
color.blue = (argb & 0xff) << 8;
|
||||
|
||||
cmap = gtk_widget_get_colormap(GTK_WIDGET(reg));
|
||||
I(cmap);
|
||||
|
||||
success = gdk_color_alloc(cmap, &color);
|
||||
I(success);
|
||||
|
||||
{
|
||||
GtkSheetRange range;
|
||||
range.row0 = range.rowi = row;
|
||||
range.col0 = range.coli = col;
|
||||
setter(reg, range, &color);
|
||||
/* HACK: I need to figure out the color allocation semantics...*/
|
||||
/* gdk_color_free(&color); */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void
|
||||
xaccRefreshTableGUI (Table * table) {
|
||||
|
||||
printf("xaccRefreshTableGUI(%p)\n", table);
|
||||
if (!table) return;
|
||||
if (!(table->table_widget)) return;
|
||||
|
||||
/* The 0'th row of the handlers is defined as the header */
|
||||
curs = table->handlers[0][0];
|
||||
num_header_rows = curs->numRows;
|
||||
reg = GTK_CLIST(table->table_widget);
|
||||
DEBUGCMD ({int i;
|
||||
printf (" refresh numphysrows=%d numphyscols=%d =========================\n",
|
||||
table->num_phys_rows,table->num_phys_cols);
|
||||
for (i=0; i<table->num_phys_rows; i++) {
|
||||
printf ("cell %d\tcolor: 0x%x\tact:%s\tdescr: %s\tpay: %s\n", i,
|
||||
table->bg_colors[i][3],
|
||||
table->entries[i][2],
|
||||
table->entries[i][3],
|
||||
table->entries[i][5]);
|
||||
}});
|
||||
|
||||
printf (" refresh numphysrows=%d numphyscols=%d \n",
|
||||
table->num_phys_rows, table->num_phys_cols);
|
||||
|
||||
for (i = num_header_rows; i < table->num_phys_rows; i++) {
|
||||
printf ("cell %d act:%s descr: %s \n",
|
||||
i, table->entries[i][2],
|
||||
table->entries[i][3]);
|
||||
}
|
||||
|
||||
gtk_clist_freeze(reg);
|
||||
|
||||
/* Adjust table to have the right number of rows */
|
||||
while(reg->rows < (table->num_phys_rows - num_header_rows)) {
|
||||
gtk_clist_append(reg, NULL);
|
||||
}
|
||||
while(reg->rows > (table->num_phys_rows - num_header_rows)) {
|
||||
gtk_clist_remove(reg, 0);
|
||||
}
|
||||
|
||||
for(i = num_header_rows; i < table->num_phys_rows; i++)
|
||||
{
|
||||
for(j = 0; j < table->num_phys_cols; j++) {
|
||||
gtk_clist_set_text(reg, i - num_header_rows, j, table->entries[i][j]);
|
||||
}
|
||||
}
|
||||
/* The 0'th row of the handlers is defined as the header */
|
||||
GtkSheet *reg = GTK_SHEET(table->table_widget);
|
||||
CellBlock *curs = table->handlers[0][0];
|
||||
int num_header_rows = curs->numRows;
|
||||
|
||||
gtk_sheet_freeze(reg);
|
||||
|
||||
/* Adjust table to have the right number of rows */
|
||||
{
|
||||
/* maxrow is actually the maximum index, not the total number of rows */
|
||||
glong diffrows =
|
||||
(reg->maxrow + 1) - (table->num_phys_rows - num_header_rows);
|
||||
gint table_row, row, col;
|
||||
|
||||
if(diffrows > 0) {
|
||||
gtk_sheet_add_row(reg, diffrows);
|
||||
} else if(diffrows < 0) {
|
||||
gtk_sheet_delete_rows(reg, 0, diffrows);
|
||||
}
|
||||
|
||||
/* Set the per-cell contents, colors, etc. */
|
||||
for(table_row = num_header_rows, row = 0;
|
||||
table_row < table->num_phys_rows;
|
||||
table_row++, row++) {
|
||||
for(col = 0; col < table->num_phys_cols; col++) {
|
||||
|
||||
gtk_sheet_set_cell(reg, row, col, GTK_JUSTIFY_LEFT,
|
||||
table->entries[table_row][col]);
|
||||
|
||||
gtk_clist_thaw(reg);
|
||||
|
||||
/* You might be able to make this *much* faster by caching
|
||||
colors. */
|
||||
set_cell_color(reg, table, row, col,
|
||||
table->bg_colors[table_row][col],
|
||||
gtk_sheet_range_set_background);
|
||||
|
||||
set_cell_color(reg, table, row, col,
|
||||
table->fg_colors[table_row][col],
|
||||
gtk_sheet_range_set_foreground);
|
||||
|
||||
set_cell_color(reg, table, row, col,
|
||||
/* this really should be win->default_style->black */
|
||||
0,
|
||||
gtk_sheet_range_set_border_color);
|
||||
|
||||
/* Turn on all the borders */
|
||||
{
|
||||
GtkSheetRange r;
|
||||
r.row0 = row;
|
||||
r.rowi = row + 1;
|
||||
r.col0 = col;
|
||||
r.coli = col + 1;
|
||||
|
||||
gtk_sheet_range_set_border(reg, r,
|
||||
CELL_TOP_BORDER | CELL_BOTTOM_BORDER |
|
||||
CELL_LEFT_BORDER | CELL_RIGHT_BORDER,
|
||||
1, GDK_LINE_SOLID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* This is more efficient than the above, but it won't work
|
||||
unless gtksheet changes its semantics */
|
||||
|
||||
/* Turn on all the borders */
|
||||
for(row = 0; row <= reg->maxrow; row++) {
|
||||
GtkSheetRange r;
|
||||
r.row0 = row;
|
||||
r.rowi = row + 1;
|
||||
r.col0 = 0;
|
||||
r.coli = reg->maxcol;
|
||||
|
||||
L("Setting border for (%d %d) (%d %d)\n",
|
||||
r.row0, r.rowi, r.col0, r.coli);
|
||||
gtk_sheet_range_set_border(reg, r, CELL_TOP_BORDER, 1, GDK_LINE_SOLID);
|
||||
}
|
||||
for(col = 0; col <= reg->maxcol; col++) {
|
||||
GtkSheetRange r;
|
||||
r.row0 = 0;
|
||||
r.rowi = reg->maxrow;
|
||||
r.col0 = col;
|
||||
r.coli = col + 1;
|
||||
|
||||
gtk_sheet_range_set_border(reg, r, CELL_LEFT_BORDER, 1, GDK_LINE_SOLID);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
gtk_sheet_thaw(reg);
|
||||
}
|
||||
}
|
||||
|
||||
/* ================== end of file ======================= */
|
||||
|
@ -48,15 +48,17 @@
|
||||
* routines in the file table-allgui.c, where they are called,
|
||||
* respectively, last, and first, just as "real" constructors &
|
||||
* destructors would be
|
||||
*/
|
||||
|
||||
TODO:
|
||||
|
||||
- Still need prev_entry_text?
|
||||
|
||||
*/
|
||||
|
||||
#define TABLE_PRIVATE_DATA \
|
||||
/* Gtk-only private table members */ \
|
||||
GtkWidget *table_widget; /* the CList */ \
|
||||
GtkWidget *entry_frame; /* the editing widget frame */ \
|
||||
GtkWidget *entry_widget; /* the current cell editing widget */\
|
||||
\
|
||||
GtkWidget *table_widget; /* the Sheet */ \
|
||||
\
|
||||
/* Current editing cell */ \
|
||||
int current_col; \
|
||||
int current_row; \
|
||||
@ -66,12 +68,8 @@
|
||||
\
|
||||
GtkWidget *next_tab_group; /* where to traverse in the end */ \
|
||||
|
||||
|
||||
|
||||
#define TABLE_PRIVATE_DATA_INIT(table) { \
|
||||
table->table_widget = NULL; \
|
||||
table->entry_frame = NULL; \
|
||||
table->entry_widget = NULL; \
|
||||
\
|
||||
table->current_col = -1; /* coords ignoring header lines */ \
|
||||
table->current_row = -1; \
|
||||
@ -86,13 +84,10 @@
|
||||
\
|
||||
/* Let GTK know we're finished with this */ \
|
||||
if(table->table_widget) gtk_widget_unref(table->table_widget); \
|
||||
if(table->entry_frame) gtk_widget_unref(table->entry_frame); \
|
||||
if(table->entry_widget) gtk_widget_unref(table->entry_widget); \
|
||||
table->table_widget = NULL; \
|
||||
table->entry_frame = NULL; \
|
||||
table->entry_widget = NULL; \
|
||||
\
|
||||
g_free(table->prev_entry_text); table->prev_entry_text = NULL; \
|
||||
g_free(table->prev_entry_text); \
|
||||
table->prev_entry_text = NULL; \
|
||||
}
|
||||
|
||||
/* nothing to resize */
|
||||
|
57
src/top-level.h
Normal file
57
src/top-level.h
Normal file
@ -0,0 +1,57 @@
|
||||
/********************************************************************\
|
||||
* top-level.h -- main for gnucash (X-Accountant) *
|
||||
* Copyright (C) 1997 Robin D. Clark *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program 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 this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
* Author: Rob Clark *
|
||||
* Internet: rclark@cs.hmc.edu *
|
||||
* Address: 609 8th Street *
|
||||
* Huntington Beach, CA 92648-4632 *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef __TOP_LEVEL_H__
|
||||
#define __TOP_LEVEL_H__
|
||||
|
||||
#include "config.h"
|
||||
#include "Group.h"
|
||||
#include "Session.h"
|
||||
#include "gnc-common.h"
|
||||
|
||||
/** HELP STUFF: *****************************************************/
|
||||
#define HH_ABOUT "xacc-about.html"
|
||||
#define HH_ACC "xacc-accwin.html"
|
||||
#define HH_REGWIN "xacc-regwin.html"
|
||||
#define HH_RECNWIN "xacc-recnwin.html"
|
||||
#define HH_ADJBWIN "xacc-adjbwin.html"
|
||||
#define HH_MAIN "xacc-main.html"
|
||||
#define HH_GPL "xacc-gpl.html"
|
||||
|
||||
/** STRUCTS *********************************************************/
|
||||
|
||||
/** PROTOTYPES ******************************************************/
|
||||
|
||||
/** GLOBALS *********************************************************/
|
||||
extern Session *current_session;
|
||||
|
||||
#if defined(MOTIF)
|
||||
extern gncUIWidget gnc_get_ui_data();
|
||||
#elif defined(GNOME)
|
||||
extern gncUIWidget gnc_get_ui_data();
|
||||
#endif
|
||||
|
||||
extern void gnc_ui_shutdown();
|
||||
|
||||
#endif
|
39
src/ui-callbacks.h
Normal file
39
src/ui-callbacks.h
Normal file
@ -0,0 +1,39 @@
|
||||
/********************************************************************\
|
||||
* ui-callbacks.h *
|
||||
* Copyright (C) 1997 Robin D. Clark *
|
||||
* Copyright (C) 1999 Rob Browning <rlb@cs.utexas.edu> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program 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 this program; if not, write to the Free Software *
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* *
|
||||
* Author: Rob Clark *
|
||||
* Internet: rclark@cs.hmc.edu *
|
||||
* Address: 609 8th Street *
|
||||
* Huntington Beach, CA 92648-4632 *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef __UI_CALLBACKS_H__
|
||||
#define __UI_CALLBACKS_H__
|
||||
|
||||
#include <gnc-common.h>
|
||||
|
||||
void refreshMainWindow( void );
|
||||
|
||||
gncBool verifyBox( const char *text );
|
||||
void errorBox( const char *message );
|
||||
void setBusyCursor( gncUIWidget w );
|
||||
void unsetBusyCursor( gncUIWidget w );
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user