Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 75674
Collapse All | Expand All

(-)gtkskan-0.2-orig/configure (-38 / +136 lines)
Lines 1355-1373 Link Here
1355
done
1355
done
1356
1356
1357
1357
1358
# Extract the first word of "gtk-config", so it can be a program name with args.
1358
1359
set dummy gtk-config; ac_word=$2
1359
  succeeded=no
1360
1361
  if test -z "$PKG_CONFIG"; then
1362
    # Extract the first word of "pkg-config", so it can be a program name with args.
1363
set dummy pkg-config; ac_word=$2
1360
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1364
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1361
echo "configure:1362: checking for $ac_word" >&5
1365
echo "configure:1366: checking for $ac_word" >&5
1362
if eval "test \"`echo '$''{'ac_cv_path_gtkpath'+set}'`\" = set"; then
1366
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
1363
  echo $ac_n "(cached) $ac_c" 1>&6
1367
  echo $ac_n "(cached) $ac_c" 1>&6
1364
else
1368
else
1365
  case "$gtkpath" in
1369
  case "$PKG_CONFIG" in
1366
  /*)
1370
  /*)
1367
  ac_cv_path_gtkpath="$gtkpath" # Let the user override the test with a path.
1371
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
1368
  ;;
1372
  ;;
1369
  ?:/*)			 
1373
  ?:/*)			 
1370
  ac_cv_path_gtkpath="$gtkpath" # Let the user override the test with a dos path.
1374
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
1371
  ;;
1375
  ;;
1372
  *)
1376
  *)
1373
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
1377
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
Lines 1375-1414 Link Here
1375
  for ac_dir in $ac_dummy; do 
1379
  for ac_dir in $ac_dummy; do 
1376
    test -z "$ac_dir" && ac_dir=.
1380
    test -z "$ac_dir" && ac_dir=.
1377
    if test -f $ac_dir/$ac_word; then
1381
    if test -f $ac_dir/$ac_word; then
1378
      ac_cv_path_gtkpath="$ac_dir/$ac_word"
1382
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
1379
      break
1383
      break
1380
    fi
1384
    fi
1381
  done
1385
  done
1382
  IFS="$ac_save_ifs"
1386
  IFS="$ac_save_ifs"
1387
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
1383
  ;;
1388
  ;;
1384
esac
1389
esac
1385
fi
1390
fi
1386
gtkpath="$ac_cv_path_gtkpath"
1391
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
1387
if test -n "$gtkpath"; then
1392
if test -n "$PKG_CONFIG"; then
1388
  echo "$ac_t""$gtkpath" 1>&6
1393
  echo "$ac_t""$PKG_CONFIG" 1>&6
1389
else
1394
else
1390
  echo "$ac_t""no" 1>&6
1395
  echo "$ac_t""no" 1>&6
1391
fi
1396
fi
1392
1397
1393
echo $ac_n "checking for GTK compile flags""... $ac_c" 1>&6
1398
  fi
1394
echo "configure:1395: checking for GTK compile flags" >&5
1395
GTK_CFLAGS=`$gtkpath --cflags 2>/dev/null`
1396
GTK_LDFLAGS=`$gtkpath --libs gthread 2>/dev/null`
1397
echo "$ac_t""ok" 1>&6
1398
1399
1399
# Extract the first word of "gnome-config", so it can be a program name with args.
1400
  if test "$PKG_CONFIG" = "no" ; then
1400
set dummy gnome-config; ac_word=$2
1401
     echo "*** The pkg-config script could not be found. Make sure it is"
1402
     echo "*** in your path, or set the PKG_CONFIG environment variable"
1403
     echo "*** to the full path to pkg-config."
1404
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
1405
  else
1406
     PKG_CONFIG_MIN_VERSION=0.9.0
1407
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
1408
        echo $ac_n "checking for gtk+-2.0 >= 2.4.0 ""... $ac_c" 1>&6
1409
echo "configure:1410: checking for gtk+-2.0 >= 2.4.0 " >&5
1410
1411
        if $PKG_CONFIG --exists "gtk+-2.0 >= 2.4.0 " ; then
1412
            echo "$ac_t""yes" 1>&6
1413
            succeeded=yes
1414
1415
            echo $ac_n "checking GTK_CFLAGS""... $ac_c" 1>&6
1416
echo "configure:1417: checking GTK_CFLAGS" >&5
1417
            GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.4.0 "`
1418
            echo "$ac_t""$GTK_CFLAGS" 1>&6
1419
1420
            echo $ac_n "checking GTK_LIBS""... $ac_c" 1>&6
1421
echo "configure:1422: checking GTK_LIBS" >&5
1422
            GTK_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.4.0 "`
1423
            echo "$ac_t""$GTK_LIBS" 1>&6
1424
        else
1425
            GTK_CFLAGS=""
1426
            GTK_LIBS=""
1427
            ## If we have a custom action on failure, don't print errors, but 
1428
            ## do set a variable so people can do so.
1429
            GTK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gtk+-2.0 >= 2.4.0 "`
1430
            echo $GTK_PKG_ERRORS
1431
        fi
1432
1433
        
1434
        
1435
     else
1436
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
1437
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
1438
     fi
1439
  fi
1440
1441
  if test $succeeded = yes; then
1442
     :
1443
  else
1444
     { echo "configure: error: Library requirements (gtk+-2.0 >= 2.4.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
1445
  fi
1446
  
1447
  succeeded=no
1448
1449
  if test -z "$PKG_CONFIG"; then
1450
    # Extract the first word of "pkg-config", so it can be a program name with args.
1451
set dummy pkg-config; ac_word=$2
1401
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1452
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1402
echo "configure:1403: checking for $ac_word" >&5
1453
echo "configure:1454: checking for $ac_word" >&5
1403
if eval "test \"`echo '$''{'ac_cv_path_gnomepath'+set}'`\" = set"; then
1454
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
1404
  echo $ac_n "(cached) $ac_c" 1>&6
1455
  echo $ac_n "(cached) $ac_c" 1>&6
1405
else
1456
else
1406
  case "$gnomepath" in
1457
  case "$PKG_CONFIG" in
1407
  /*)
1458
  /*)
1408
  ac_cv_path_gnomepath="$gnomepath" # Let the user override the test with a path.
1459
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
1409
  ;;
1460
  ;;
1410
  ?:/*)			 
1461
  ?:/*)			 
1411
  ac_cv_path_gnomepath="$gnomepath" # Let the user override the test with a dos path.
1462
  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a dos path.
1412
  ;;
1463
  ;;
1413
  *)
1464
  *)
1414
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
1465
  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
Lines 1416-1446 Link Here
1416
  for ac_dir in $ac_dummy; do 
1467
  for ac_dir in $ac_dummy; do 
1417
    test -z "$ac_dir" && ac_dir=.
1468
    test -z "$ac_dir" && ac_dir=.
1418
    if test -f $ac_dir/$ac_word; then
1469
    if test -f $ac_dir/$ac_word; then
1419
      ac_cv_path_gnomepath="$ac_dir/$ac_word"
1470
      ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
1420
      break
1471
      break
1421
    fi
1472
    fi
1422
  done
1473
  done
1423
  IFS="$ac_save_ifs"
1474
  IFS="$ac_save_ifs"
1475
  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
1424
  ;;
1476
  ;;
1425
esac
1477
esac
1426
fi
1478
fi
1427
gnomepath="$ac_cv_path_gnomepath"
1479
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
1428
if test -n "$gnomepath"; then
1480
if test -n "$PKG_CONFIG"; then
1429
  echo "$ac_t""$gnomepath" 1>&6
1481
  echo "$ac_t""$PKG_CONFIG" 1>&6
1430
else
1482
else
1431
  echo "$ac_t""no" 1>&6
1483
  echo "$ac_t""no" 1>&6
1432
fi
1484
fi
1433
1485
1434
echo $ac_n "checking for Gnome compile flags""... $ac_c" 1>&6
1486
  fi
1435
echo "configure:1436: checking for Gnome compile flags" >&5
1487
1436
GNOME_CFLAGS=`$gnomepath gnome --cflags 2>/dev/null`
1488
  if test "$PKG_CONFIG" = "no" ; then
1437
GNOME_LDFLAGS=`$gnomepath gnome --libs 2>/dev/null`
1489
     echo "*** The pkg-config script could not be found. Make sure it is"
1438
echo "$ac_t""ok" 1>&6
1490
     echo "*** in your path, or set the PKG_CONFIG environment variable"
1491
     echo "*** to the full path to pkg-config."
1492
     echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
1493
  else
1494
     PKG_CONFIG_MIN_VERSION=0.9.0
1495
     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
1496
        echo $ac_n "checking for gconf-2.0 >= 0.15.0 ""... $ac_c" 1>&6
1497
echo "configure:1498: checking for gconf-2.0 >= 0.15.0 " >&5
1498
1499
        if $PKG_CONFIG --exists "gconf-2.0 >= 0.15.0 " ; then
1500
            echo "$ac_t""yes" 1>&6
1501
            succeeded=yes
1502
1503
            echo $ac_n "checking GCONF_CFLAGS""... $ac_c" 1>&6
1504
echo "configure:1505: checking GCONF_CFLAGS" >&5
1505
            GCONF_CFLAGS=`$PKG_CONFIG --cflags "gconf-2.0 >= 0.15.0 "`
1506
            echo "$ac_t""$GCONF_CFLAGS" 1>&6
1507
1508
            echo $ac_n "checking GCONF_LIBS""... $ac_c" 1>&6
1509
echo "configure:1510: checking GCONF_LIBS" >&5
1510
            GCONF_LIBS=`$PKG_CONFIG --libs "gconf-2.0 >= 0.15.0 "`
1511
            echo "$ac_t""$GCONF_LIBS" 1>&6
1512
        else
1513
            GCONF_CFLAGS=""
1514
            GCONF_LIBS=""
1515
            ## If we have a custom action on failure, don't print errors, but 
1516
            ## do set a variable so people can do so.
1517
            GCONF_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "gconf-2.0 >= 0.15.0 "`
1518
            echo $GCONF_PKG_ERRORS
1519
        fi
1520
1521
        
1522
        
1523
     else
1524
        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
1525
        echo "*** See http://www.freedesktop.org/software/pkgconfig"
1526
     fi
1527
  fi
1439
1528
1529
  if test $succeeded = yes; then
1530
     :
1531
  else
1532
     { echo "configure: error: Library requirements (gconf-2.0 >= 0.15.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; }
1533
  fi
1534
  
1440
# Extract the first word of "esd-config", so it can be a program name with args.
1535
# Extract the first word of "esd-config", so it can be a program name with args.
1441
set dummy esd-config; ac_word=$2
1536
set dummy esd-config; ac_word=$2
1442
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1537
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
1443
echo "configure:1444: checking for $ac_word" >&5
1538
echo "configure:1539: checking for $ac_word" >&5
1444
if eval "test \"`echo '$''{'ac_cv_path_esdpath'+set}'`\" = set"; then
1539
if eval "test \"`echo '$''{'ac_cv_path_esdpath'+set}'`\" = set"; then
1445
  echo $ac_n "(cached) $ac_c" 1>&6
1540
  echo $ac_n "(cached) $ac_c" 1>&6
1446
else
1541
else
Lines 1473-1485 Link Here
1473
fi
1568
fi
1474
1569
1475
echo $ac_n "checking for ESD compile flags""... $ac_c" 1>&6
1570
echo $ac_n "checking for ESD compile flags""... $ac_c" 1>&6
1476
echo "configure:1477: checking for ESD compile flags" >&5
1571
echo "configure:1572: checking for ESD compile flags" >&5
1477
ESD_CFLAGS=`$esdpath --cflags 2>/dev/null`
1572
ESD_CFLAGS=`$esdpath --cflags 2>/dev/null`
1478
ESD_LDFLAGS=`$esdpath --libs 2>/dev/null`
1573
ESD_LDFLAGS=`$esdpath --libs 2>/dev/null`
1479
echo "$ac_t""ok" 1>&6
1574
echo "$ac_t""ok" 1>&6
1480
1575
1481
LIBS="$LIBS $ESD_LDFLAGS $GTK_LDFLAGS $GNOME_LDFLAGS"
1576
LIBS="$LIBS $ESD_LDFLAGS $GTK_LIBS $GCONF_LIBS"
1482
CFLAGS="$CFLAGS $ESD_CFLAGS $GTK_CFLAGS $GNOME_CFLAGS"
1577
CFLAGS="$CFLAGS $ESD_CFLAGS $GTK_CFLAGS $GCONF_CFLAGS"
1483
1578
1484
trap '' 1 2 15
1579
trap '' 1 2 15
1485
cat > confcache <<\EOF
1580
cat > confcache <<\EOF
Lines 1636-1643 Link Here
1636
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
1731
s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
1637
s%@INSTALL_DATA@%$INSTALL_DATA%g
1732
s%@INSTALL_DATA@%$INSTALL_DATA%g
1638
s%@CPP@%$CPP%g
1733
s%@CPP@%$CPP%g
1639
s%@gtkpath@%$gtkpath%g
1734
s%@PKG_CONFIG@%$PKG_CONFIG%g
1640
s%@gnomepath@%$gnomepath%g
1735
s%@GTK_CFLAGS@%$GTK_CFLAGS%g
1736
s%@GTK_LIBS@%$GTK_LIBS%g
1737
s%@GCONF_CFLAGS@%$GCONF_CFLAGS%g
1738
s%@GCONF_LIBS@%$GCONF_LIBS%g
1641
s%@esdpath@%$esdpath%g
1739
s%@esdpath@%$esdpath%g
1642
1740
1643
CEOF
1741
CEOF
(-)gtkskan-0.2-orig/configure.in (-13 / +4 lines)
Lines 24-40 Link Here
24
AC_PROG_GCC_TRADITIONAL
24
AC_PROG_GCC_TRADITIONAL
25
AC_CHECK_FUNCS(select socket strdup strerror)
25
AC_CHECK_FUNCS(select socket strdup strerror)
26
26
27
AC_PATH_PROG(gtkpath, gtk-config)
27
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4.0 )  dnl what version ?
28
AC_MSG_CHECKING(for GTK compile flags)
28
PKG_CHECK_MODULES(GCONF, gconf-2.0 >= 0.15.0 )  dnl what version ?
29
GTK_CFLAGS=`$gtkpath --cflags 2>/dev/null`
30
GTK_LDFLAGS=`$gtkpath --libs gthread 2>/dev/null`
31
AC_MSG_RESULT(ok)
32
33
AC_PATH_PROG(gnomepath, gnome-config)
34
AC_MSG_CHECKING(for Gnome compile flags)
35
GNOME_CFLAGS=`$gnomepath gnome --cflags 2>/dev/null`
36
GNOME_LDFLAGS=`$gnomepath gnome --libs 2>/dev/null`
37
AC_MSG_RESULT(ok)
38
29
39
AC_PATH_PROG(esdpath, esd-config)
30
AC_PATH_PROG(esdpath, esd-config)
40
AC_MSG_CHECKING(for ESD compile flags)
31
AC_MSG_CHECKING(for ESD compile flags)
Lines 42-49 Link Here
42
ESD_LDFLAGS=`$esdpath --libs 2>/dev/null`
33
ESD_LDFLAGS=`$esdpath --libs 2>/dev/null`
43
AC_MSG_RESULT(ok)
34
AC_MSG_RESULT(ok)
44
35
45
LIBS="$LIBS $ESD_LDFLAGS $GTK_LDFLAGS $GNOME_LDFLAGS"
36
LIBS="$LIBS $ESD_LDFLAGS $GTK_LIBS $GCONF_LIBS"
46
CFLAGS="$CFLAGS $ESD_CFLAGS $GTK_CFLAGS $GNOME_CFLAGS"
37
CFLAGS="$CFLAGS $ESD_CFLAGS $GTK_CFLAGS $GCONF_CFLAGS"
47
38
48
AC_OUTPUT([
39
AC_OUTPUT([
49
Makefile
40
Makefile
(-)gtkskan-0.2-orig/src/Makefile.in (-1 / +1 lines)
Lines 19-25 Link Here
19
CPPFLAGS = @CPPFLAGS@
19
CPPFLAGS = @CPPFLAGS@
20
CFLAGS = $(CPPFLAGS) @CFLAGS@ $(DEFINES)
20
CFLAGS = $(CPPFLAGS) @CFLAGS@ $(DEFINES)
21
LIBS = @LIBS@
21
LIBS = @LIBS@
22
LDFLAGS = @LDFLAGS@ $(GNOME_LDFLAGS) $(LIBS) 
22
LDFLAGS = @LDFLAGS@ $(GCONF2_LDFLAGS) $(LIBS) 
23
INSTALL =  @INSTALL@ 
23
INSTALL =  @INSTALL@ 
24
WIRELESS_TOOLS_DIR = wireless_tools.22
24
WIRELESS_TOOLS_DIR = wireless_tools.22
25
LIBNMEA = nmea/libnmea.a
25
LIBNMEA = nmea/libnmea.a
(-)gtkskan-0.2-orig/src/nmea/Makefile (-2 / +2 lines)
Lines 16-24 Link Here
16
16
17
CC = gcc
17
CC = gcc
18
CPPFLAGS = 
18
CPPFLAGS = 
19
CFLAGS = $(CPPFLAGS) -g -O2  -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/include -DNEED_GNOMESUPPORT_H -I/usr/lib/gnome-libs/include -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include $(DEFINES)
19
CFLAGS = $(CPPFLAGS) -g -O2  -DXTHREADS -D_REENTRANT -DXUSE_MTSAFE_API -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/X11R6/include -I/usr/include/atk-1.0 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -DORBIT2=1 -pthread -I/usr/include/gconf/2 -I/usr/include/orbit-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   $(DEFINES)
20
LDFLAGS = 
20
LDFLAGS = 
21
INSTALL =  /usr/bin/install -c 
21
INSTALL =  /bin/install -c 
22
22
23
# these need static libs: -lXext -lX11
23
# these need static libs: -lXext -lX11
24
24
(-)gtkskan-0.2-orig/src/skan.c (-8 / +5 lines)
Lines 176-186 Link Here
176
    gtk_widget_show (menubar);
176
    gtk_widget_show (menubar);
177
                       
177
                       
178
    // K,: now for the toolbar
178
    // K,: now for the toolbar
179
    toolbar = gtk_toolbar_new ( GTK_ORIENTATION_HORIZONTAL,
179
    toolbar = gtk_toolbar_new ( );
180
                                GTK_TOOLBAR_BOTH );
180
    gtk_toolbar_set_orientation ( GTK_TOOLBAR(toolbar), GTK_ORIENTATION_HORIZONTAL );
181
    gtk_container_set_border_width ( GTK_CONTAINER ( toolbar ) , 1 );
181
    gtk_toolbar_set_style ( GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH );
182
    gtk_toolbar_set_space_size ( GTK_TOOLBAR ( toolbar ), 0 );
182
    gtk_container_set_border_width ( GTK_CONTAINER(toolbar), 1 );
183
         
183
184
    // And now for the go pixmap icon dealy
184
    // And now for the go pixmap icon dealy
185
    style = gtk_widget_get_style( window );
185
    style = gtk_widget_get_style( window );
186
186
Lines 254-262 Link Here
254
			"Exit", "Exit gtkskan", "Private", iconw,
254
			"Exit", "Exit gtkskan", "Private", iconw,
255
				GTK_SIGNAL_FUNC (destroy), NULL );
255
				GTK_SIGNAL_FUNC (destroy), NULL );
256
256
257
	
258
    gtk_toolbar_set_space_size (GTK_TOOLBAR(toolbar), 6);
259
    
260
    // Add the toolbar to the vbox (box1) and a seperator
257
    // Add the toolbar to the vbox (box1) and a seperator
261
    gtk_box_pack_start(GTK_BOX (box1), toolbar, FALSE, FALSE, 0);
258
    gtk_box_pack_start(GTK_BOX (box1), toolbar, FALSE, FALSE, 0);
262
    gtk_widget_show(toolbar);
259
    gtk_widget_show(toolbar);
(-)gtkskan-0.2-orig/src/skan_config.c (-20 / +45 lines)
Lines 1-36 Link Here
1
/* gtkskan configuration gui and meaty bits */
1
/* gtkskan configuration gui and meaty bits */
2
2
3
#include <gtk/gtk.h>
3
#include <gtk/gtk.h>
4
#include <libgnome/libgnome.h>
4
#include <gconf/gconf.h>
5
#include <gconf/gconf-client.h>
6
#include <stdio.h>
5
#include "skan_config.h"
7
#include "skan_config.h"
6
8
7
extern gtkskan_config_t skan_conf;
9
extern gtkskan_config_t skan_conf;
8
extern GtkWidget *main_window;
10
extern GtkWidget *main_window;
9
11
10
void gtkskan_load_config(gtkskan_config_t *skan_config) {
12
void gtkskan_load_config(gtkskan_config_t *skan_config) {
11
	gboolean def;
13
	GConfClient *gconf=NULL;
12
	GString *foo = g_string_new(NULL);
14
	GConfValue *value;
13
	
15
	
14
	skan_config->interface =
16
	/* default values */
15
		gnome_config_get_string_with_default("/gtkskan/config/interface=eth0", 
17
	skan_config->interface=g_strdup("eth0");
16
			&def);
18
	skan_config->sound=TRUE;
17
	skan_config->sound =
19
	skan_config->snd_path=g_strdup(DATA_DIR "/netfound.wav" );
18
		gnome_config_get_bool_with_default("/gtkskan/config/sound=TRUE", &def);
20
19
	
21
	if (!(gconf=gconf_client_get_default ()))
20
	g_string_assign(foo, "/gtkskan/config/snd_path=");
22
	{ /* we failed to contact gconfd */
21
	g_string_append(foo, DATA_DIR);
23
		return;
22
	g_string_append(foo, "/netfound.wav");
24
	}
23
	skan_config->snd_path = gnome_config_get_string_with_default(
25
24
			foo->str, &def);
26
	if ((value=gconf_client_get(gconf, "/apps/gtkskan/interface", NULL)))
25
	g_string_free(foo, TRUE);
27
	{
26
28
		g_free(skan_config->interface);
29
		skan_config->interface=g_strdup(gconf_value_get_string(value));
30
		gconf_value_free(value);
31
	}
32
33
	if ((value=gconf_client_get(gconf, "/apps/gtkskan/sound", NULL)))
34
	{
35
		skan_config->sound = gconf_value_get_bool(value);
36
		gconf_value_free(value);
37
	}
38
39
	if ((value=gconf_client_get(gconf, "/apps/gtkskan/snd_path", NULL)))
40
	{
41
		g_free(skan_config->snd_path);
42
		skan_config->snd_path=g_strdup(gconf_value_get_string(value));
43
		gconf_value_free(value);
44
	}
45
	g_object_unref(gconf);
27
}
46
}
28
47
29
void gtkskan_save_config(gtkskan_config_t *skan_config) {
48
void gtkskan_save_config(gtkskan_config_t *skan_config) {
30
	gnome_config_set_string("/gtkskan/config/interface", skan_config->interface);
49
	GConfClient *gconf=NULL;
31
	gnome_config_set_bool("/gtkskan/config/sound", skan_config->sound);
50
32
	gnome_config_set_string("/gtkskan/config/snd_path", skan_config->snd_path);
51
	if (!(gconf=gconf_client_get_default ()))
33
	gnome_config_sync();
52
	{ /* we failed to contact gconfd */
53
		return;
54
	}
55
	gconf_client_set_string(gconf, "/apps/gtkskan/interface", skan_config->interface, NULL);
56
	gconf_client_set_bool(gconf, "/apps/gtkskan/sound", skan_config->sound, NULL);
57
	gconf_client_set_string(gconf, "/apps/gtkskan/snd_path", skan_config->snd_path, NULL);
58
	g_object_unref(gconf);
34
}
59
}
35
60
36
GList * gtkskan_get_interface_list(void) {
61
GList * gtkskan_get_interface_list(void) {

Return to bug 75674