diff options
author | Sebastien Estienne <sebastien.estienne@gmail.com> | 2005-09-17 13:40:38 +0000 |
---|---|---|
committer | Sebastien Estienne <sebastien.estienne@gmail.com> | 2005-09-17 13:40:38 +0000 |
commit | 7b771b3f042669e5d763864dd69560c4e2a5bb8d (patch) | |
tree | ad437ce2f8d59b478c5f73409158d71ac49098ae | |
parent | 4da077afd60d5591b24a32b1082139516fd9f2c2 (diff) |
* updated docs
* added a schema
git-svn-id: file:///home/lennart/svn/public/service-discovery-applet/trunk@13 3be567f1-68ff-0310-b24a-ad7cc433fd2f
-rw-r--r-- | INSTALL | 2 | ||||
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | README | 2 | ||||
-rwxr-xr-x | bootstrap.sh | 3 | ||||
-rw-r--r-- | configure.ac | 44 | ||||
-rw-r--r-- | schemas/Makefile.am | 16 | ||||
-rw-r--r-- | schemas/service-discovery-applet.schemas | 50 | ||||
-rwxr-xr-x | src/service-discovery-applet.in | 34 |
8 files changed, 126 insertions, 26 deletions
@@ -1 +1 @@ -./configure --prefix=/usr && make && make install +./configure --prefix=/usr --sysconfdir=/etc && make && make install diff --git a/Makefile.am b/Makefile.am index b3ef3b1..fe4946f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,6 +2,7 @@ SUBDIRS = \ common \ src \ icons \ + schemas \ scripts \ servers @@ -4,8 +4,6 @@ You should test that the applet is functionning with the following command: $ /usr/bin/service-discovery-applet -window before trying to put it in your panel -To add support for more service type, edit $(prefix)/bin/service-discovery-applet, and look the following variable: "type_browsed" - To add actions when you click on a specified service, add a file in $(prefix)/share/service-discovery-applet/scripts, you must name it type.sh (eg: _ssh._tcp.sh), look at the included scripts to know how to access ADDRESS, PORT and TXT records. To add icons for services in the applet, just drop a png named TYPE.png (eg: _ssh._tcp.png) in $(prefix)/share/service-discovery-applet/icons diff --git a/bootstrap.sh b/bootstrap.sh index 04b8a22..d920bac 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -37,11 +37,8 @@ else rm -f config.cache run_versioned aclocal "$VERSION" -I common - autoheader run_versioned automake "$VERSION" -a -c --foreign autoconf -Wall ./configure "$@" - - make clean fi diff --git a/configure.ac b/configure.ac index 5f293d7..7adf226 100644 --- a/configure.ac +++ b/configure.ac @@ -1,36 +1,66 @@ -AC_PREREQ(2.57) -AC_INIT([service-discovery-applet], [0.1], [sebastien (dot) estienne (at) gmail (dot) com]) +AC_PREREQ(2.59) +AC_INIT([service-discovery-applet],[0.1],[sebastien (dot) estienne (at) gmail (dot) com]) AC_CONFIG_SRCDIR([src/service-discovery-applet.in]) -AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([foreign 1.9 -Wall]) AC_SUBST(VERSION) AM_MAINTAINER_MODE +dnl ======================================================== +dnl Check for python and some modules +dnl ======================================================== AM_PATH_PYTHON([2.4]) AM_CHECK_PYMOD(gtk,,,[AC_MSG_ERROR(Could not find Python module pygtk)]) AM_CHECK_PYMOD(dbus,,,[AC_MSG_ERROR(Could not find Python module dbus)]) AM_CHECK_PYMOD(avahi,,,[AC_MSG_ERROR(Could not find Python module avahi)]) -AM_CHECK_PYMOD(gnomeapplet,,,[AC_MSG_ERROR(Could not find Python module gnomeapplet)]) +# disable because it needs a DISPLAY +# AM_CHECK_PYMOD(gnomeapplet,,,[AC_MSG_ERROR(Could not find Python module gnomeapplet)]) +dnl ======================================================== +dnl Directory where services' scripts will be installed +dnl ======================================================== SCRIPTSDIR="${datadir}/${PACKAGE}/scripts/" AC_SUBST(SCRIPTSDIR) +dnl ======================================================== +dnl Directory where services' icons will be installed +dnl ======================================================== ICONSDIR="${datadir}/${PACKAGE}/icons/" AC_SUBST(ICONSDIR) +dnl ======================================================== +dnl Directory where glade interfaces will be installed +dnl ======================================================== INTERFACESDIR="${datadir}/${PACKAGE}/interfaces/" AC_SUBST(INTERFACESDIR) +dnl ======================================================== +dnl This is to check correct gconf installation +dnl ======================================================== +AM_GCONF_SOURCE_2 + +dnl ======================================================== AC_CONFIG_FILES([ Makefile common/Makefile - src/Makefile - scripts/Makefile - servers/Makefile icons/Makefile icons/24x24/Makefile icons/48x48/Makefile + schemas/Makefile + scripts/Makefile + servers/Makefile + src/Makefile ]) AC_OUTPUT + +dnl ======================================================== +dnl Summary +dnl ======================================================== +echo " + ---{ $PACKAGE_NAME $VERSION }--- + + prefix: ${prefix} + sysconfdir: ${sysconfdir} + gconf config source: ${GCONF_SCHEMA_CONFIG_SOURCE} +" diff --git a/schemas/Makefile.am b/schemas/Makefile.am new file mode 100644 index 0000000..207c0a3 --- /dev/null +++ b/schemas/Makefile.am @@ -0,0 +1,16 @@ +SCHEMAS_FILE = service-discovery-applet.schemas + +EXTRA_DIST = $(SCHEMAS_FILE) + +schemasdir = $(GCONF_SCHEMA_FILE_DIR) +schemas_DATA = $(SCHEMAS_FILE) + +install-schemas: + GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) gconftool-2 --makefile-install-rule $(SCHEMAS_FILE) 2>&1 > /dev/null + gconftool-2 --shutdown + +if GCONF_SCHEMAS_INSTALL +install-data-local: install-schemas +else +install-data-local: +endif diff --git a/schemas/service-discovery-applet.schemas b/schemas/service-discovery-applet.schemas new file mode 100644 index 0000000..563f51f --- /dev/null +++ b/schemas/service-discovery-applet.schemas @@ -0,0 +1,50 @@ +<gconfschemafile> + <schemalist> + <schema> + <key>/schemas/apps/service-discovery-applet/options/show_notifications</key> + <applyto>/apps/service-discovery-applet/options/show_notifications</applyto> + <owner>service-discovery-applet</owner> + <type>bool</type> + <default>TRUE</default> + <locale name="C"> + <short>Display notifications.</short> + <long> + Use the notification deamon to notify the user when a service is discovered. + </long> + </locale> + </schema> + <schema> + <key>/schemas/apps/service-discovery-applet/services/_ssh._tcp</key> + <applyto>/apps/service-discovery-applet/services/_ssh._tcp</applyto> + <owner>service-discovery-applet</owner> + <type>bool</type> + <default>TRUE</default> + <locale name="C"> + <short></short> + <long></long> + </locale> + </schema> + <schema> + <key>/schemas/apps/service-discovery-applet/services/_https._tcp</key> + <applyto>/apps/service-discovery-applet/services/_https._tcp</applyto> + <owner>service-discovery-applet</owner> + <type>bool</type> + <default>TRUE</default> + <locale name="C"> + <short></short> + <long></long> + </locale> + </schema> + <schema> + <key>/schemas/apps/service-discovery-applet/services/_http._tcp</key> + <applyto>/apps/service-discovery-applet/services/_http._tcp</applyto> + <owner>service-discovery-applet</owner> + <type>bool</type> + <default>TRUE</default> + <locale name="C"> + <short></short> + <long></long> + </locale> + </schema> + </schemalist> +</gconfschemafile> diff --git a/src/service-discovery-applet.in b/src/service-discovery-applet.in index 54cb45e..14d3668 100755 --- a/src/service-discovery-applet.in +++ b/src/service-discovery-applet.in @@ -27,22 +27,30 @@ import sys import pygtk pygtk.require('2.0') +def error_msg(msg): + d = gtk.MessageDialog(parent=None, flags=gtk.DIALOG_MODAL, + type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK) + d.set_markup(msg) + d.show_all() + d.run() + d.destroy() + try: - import avahi, gobject, dbus + import avahi + import dbus + import gtk + import gnomeapplet + import gnome.ui + from gconf import client, client_get_default except ImportError: - print "Sorry, to use this tool you need to install Avahi, pygtk and python-dbus." - sys.exit(1) + error_msg("Sorry, to use this tool you need to install Avahi, pygtk and python-dbus.") + try: import dbus.glib except ImportError, e: pass -import gtk -import gnomeapplet -import gnome -import gnome.ui -import gconf # Gconf Paths gc_options = "/apps/service-discovery-applet/options" @@ -68,7 +76,6 @@ zc_pretty_name = {'_ssh._tcp' : 'SSH Servers', menuZC = gtk.ImageMenuItem() menubar = gtk.MenuBar() - def siocgifname(interface): global server @@ -225,7 +232,7 @@ def on_change_background(panelapplet, backgroundtype, color, pixmap): # s3.bg_pixmap[gtk.STATE_NORMAL] = pixmap if backgroundtype == gnomeapplet.COLOR_BACKGROUND: - print "COLOR_BACKGROUP" + print "COLOR_BACKGROUND" if backgroundtype == gnomeapplet.NO_BACKGROUND: print "NO_BACKGROUND" @@ -342,10 +349,10 @@ def ServiceDiscoveryApplet_factory(applet, iid): gc_client.notify_add (gc_services, gc_services_cb,None) # Applet MenuItem - menuZC = gtk.ImageMenuItem() - menuZC.add(gtk.Label('ZeroConf')) image = gtk.Image() image.set_from_file("@iconsdir@/24x24/service-discovery-applet.png") + menuZC = gtk.ImageMenuItem() + menuZC.add(gtk.Label('ZeroConf')) menuZC.set_image(image) menuZC.set_right_justified(True) menuZC.set_submenu(service_menu); @@ -367,8 +374,9 @@ def ServiceDiscoveryApplet_factory(applet, iid): menubar.add(menuZC) #expand the applet with the panel -# applet.connect("change_background", on_change_background) + applet.connect("change_background", on_change_background) applet.set_applet_flags(gnomeapplet.EXPAND_MINOR) + #applet.add(menuZC) applet.add(menubar) applet.show_all() |