summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aclocal.m445
-rw-r--r--configure.ac2
-rw-r--r--src/Makefile.am48
-rw-r--r--src/session-get.c6
-rw-r--r--src/session-get.h2
-rw-r--r--src/trg-status-bar.c7
6 files changed, 97 insertions, 13 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 9bb5ab9..c464731 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -19,6 +19,51 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
+dnl AM_GCONF_SOURCE_2
+dnl Defines GCONF_SCHEMA_CONFIG_SOURCE which is where you should install schemas
+dnl (i.e. pass to gconftool-2
+dnl Defines GCONF_SCHEMA_FILE_DIR which is a filesystem directory where
+dnl you should install foo.schemas files
+dnl
+
+AC_DEFUN([AM_GCONF_SOURCE_2],
+[
+ if test "x$GCONF_SCHEMA_INSTALL_SOURCE" = "x"; then
+ GCONF_SCHEMA_CONFIG_SOURCE=`gconftool-2 --get-default-source`
+ else
+ GCONF_SCHEMA_CONFIG_SOURCE=$GCONF_SCHEMA_INSTALL_SOURCE
+ fi
+
+ AC_ARG_WITH([gconf-source],
+ AC_HELP_STRING([--with-gconf-source=sourceaddress],
+ [Config database for installing schema files.]),
+ [GCONF_SCHEMA_CONFIG_SOURCE="$withval"],)
+
+ AC_SUBST(GCONF_SCHEMA_CONFIG_SOURCE)
+ AC_MSG_RESULT([Using config source $GCONF_SCHEMA_CONFIG_SOURCE for schema installation])
+
+ if test "x$GCONF_SCHEMA_FILE_DIR" = "x"; then
+ GCONF_SCHEMA_FILE_DIR='$(sysconfdir)/gconf/schemas'
+ fi
+
+ AC_ARG_WITH([gconf-schema-file-dir],
+ AC_HELP_STRING([--with-gconf-schema-file-dir=dir],
+ [Directory for installing schema files.]),
+ [GCONF_SCHEMA_FILE_DIR="$withval"],)
+
+ AC_SUBST(GCONF_SCHEMA_FILE_DIR)
+ AC_MSG_RESULT([Using $GCONF_SCHEMA_FILE_DIR as install directory for schema files])
+
+ AC_ARG_ENABLE(schemas-install,
+ AC_HELP_STRING([--disable-schemas-install],
+ [Disable the schemas installation]),
+ [case ${enableval} in
+ yes|no) ;;
+ *) AC_MSG_ERROR([bad value ${enableval} for --enable-schemas-install]) ;;
+ esac])
+ AM_CONDITIONAL([GCONF_SCHEMAS_INSTALL], [test "$enable_schemas_install" != no])
+])
+
# LIBCURL_CHECK_CONFIG ([DEFAULT-ACTION], [MINIMUM-VERSION],
# [ACTION-IF-YES], [ACTION-IF-NO])
# ----------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 28309f7..acc8c8d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,4 +39,6 @@ AM_CONDITIONAL([HAVE_GEOIP], [test "x$have_geoip" = "xyes"])
AC_TYPE_SIZE_T
+AM_GCONF_SOURCE_2
+
AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
index 501062b..c31c94d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,3 +1,13 @@
+NULL =
+
+public_icons_themes = \
+ hicolor \
+ $(NULL)
+
+public_icons = \
+ hicolor_apps_scalable_transmission-remote-gtk.svg \
+ $(NULL)
+
EXTRA_DIST = transmission-remote-gtk.desktop.in
CLEANFILES = transmission-remote-gtk.desktop
@@ -7,9 +17,6 @@ desktop_DATA = transmission-remote-gtk.desktop
schemadir = @GCONF_SCHEMA_FILE_DIR@
schema_DATA = transmission-remote-gtk.schemas
-svgiconsdir = /usr/share/icons/hicolor/scalable/apps/
-svgicons_DATA = transmission-remote-gtk.svg
-
bin_PROGRAMS = transmission-remote-gtk
INCLUDES = --pedantic -Wall -I.. -O2 $(jsonglib_CFLAGS) $(gthread_CFLAGS) $(gtk_CFLAGS) $(gconf_CFLAGS) $(gio_CFLAGS) $(unique_CFLAGS) $(notify_CFLAGS)
@@ -24,8 +31,41 @@ transmission_remote_gtk_SOURCES = main.c requests.c base64.c json.c http.c dispa
transmission_remote_gtk_LDFLAGS = -lcurl $(jsonglib_LIBS) $(gtk_LIBS) $(gthread_LIBS) $(GEOIP_LIBS) $(gconf_LIBS) $(gio_LIBS) $(unique_LIBS) $(notify_LIBS)
-install-data-local:
+install-data-local: install-icons update-icon-cache
GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) gconftool-2 --makefile-install-rule $(srcdir)/$(schema_DATA)
+gtk_update_icon_cache = gtk-update-icon-cache -f -t
+
+update-icon-cache:
+ @-if test -z "$(DESTDIR)"; then \
+ echo "Updating Gtk icon cache."; \
+ for theme in $(public_icons_themes); do \
+ $(gtk_update_icon_cache) $(datadir)/icons/$$theme; \
+ done; \
+ else \
+ echo "*** Icon cache not updated. After (un)install, run this:"; \
+ for theme in $(public_icons_themes); do \
+ echo "*** $(gtk_update_icon_cache) $(datadir)/icons/$$theme"; \
+ done; \
+ fi
+
+install-icons:
+ for icon in $(public_icons); do \
+ THEME=`echo $$icon | cut -d_ -f1`; \
+ CONTEXT=`echo $$icon | cut -d_ -f2`; \
+ SIZE=`echo $$icon | cut -d_ -f3`; \
+ ICONFILE=`echo $$icon | cut -d_ -f4`; \
+ mkdir -p $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT; \
+ $(INSTALL_DATA) $(srcdir)/$$icon $(DESTDIR)$(datadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \
+ done; \
+ for icon in $(private_icons); do \
+ THEME=`echo $$icon | cut -d_ -f1`; \
+ CONTEXT=`echo $$icon | cut -d_ -f2`; \
+ SIZE=`echo $$icon | cut -d_ -f3`; \
+ ICONFILE=`echo $$icon | cut -d_ -f4`; \
+ mkdir -p $(DESTDIR)$(pkgdatadir)/icons/$$THEME/$$SIZE/$$CONTEXT; \
+ $(INSTALL_DATA) $(srcdir)/$$icon $(DESTDIR)$(pkgdatadir)/icons/$$THEME/$$SIZE/$$CONTEXT/$$ICONFILE; \
+ done
+
transmission-remote-gtk.desktop: transmission-remote-gtk.desktop.in
sed -e 's,@bindir\@,$(bindir),g' $< > $@
diff --git a/src/session-get.c b/src/session-get.c
index f1e5d46..8ee4ab7 100644
--- a/src/session-get.c
+++ b/src/session-get.c
@@ -24,10 +24,10 @@
#include "protocol-constants.h"
#include "session-get.h"
-int session_get_version(JsonObject * s, float *version, int *revision)
+int session_get_version(JsonObject * s, float *version)
{
- return sscanf(json_object_get_string_member(s, SGET_VERSION),
- "%f (%d)", version, revision);
+ const gchar *versionStr = json_object_get_string_member(s, SGET_VERSION);
+ return sscanf(versionStr, "%f", version);
}
gboolean session_get_pex_enabled(JsonObject * s)
diff --git a/src/session-get.h b/src/session-get.h
index 71f2a52..bbd31f2 100644
--- a/src/session-get.h
+++ b/src/session-get.h
@@ -62,7 +62,7 @@
const gchar *session_get_torrent_done_filename(JsonObject * s);
gboolean session_get_torrent_done_enabled(JsonObject * s);
gint64 session_get_cache_size_mb(JsonObject * s);
-int session_get_version(JsonObject * s, float *version, int *revision);
+int session_get_version(JsonObject * s, float *version);
gboolean session_get_pex_enabled(JsonObject * s);
gboolean session_get_lpd_enabled(JsonObject * s);
const gchar *session_get_download_dir(JsonObject * s);
diff --git a/src/trg-status-bar.c b/src/trg-status-bar.c
index d980bac..d6e4cab 100644
--- a/src/trg-status-bar.c
+++ b/src/trg-status-bar.c
@@ -68,13 +68,10 @@ void trg_status_bar_connect(TrgStatusBar * sb, JsonObject * session)
{
gchar *statusMsg;
float version;
- int revision;
- session_get_version(session, &version, &revision);
+ session_get_version(session, &version);
statusMsg =
- g_strdup_printf
- ("Connected to Transmission %g (r%d), getting torrents...",
- version, revision);
+ g_strdup_printf("Connected to Transmission %g, getting torrents...", version);
g_printf("%s\n", statusMsg);
trg_status_bar_push_connection_msg(sb, statusMsg);
g_free(statusMsg);