summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--.travis.yml4
-rw-r--r--configure.ac19
-rw-r--r--share/misc/Makefile.am16
-rw-r--r--share/misc/htm-mime.xml3
-rw-r--r--share/misc/htm.desktop2
-rw-r--r--src/Makefile.am4
-rw-r--r--src/common/modes.c2
-rw-r--r--src/common/textevents.in6
-rw-r--r--src/htm/Makefile.am12
-rw-r--r--src/htm/thememan.in3
11 files changed, 67 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
index 3b1e882b..df260d40 100644
--- a/.gitignore
+++ b/.gitignore
@@ -44,7 +44,11 @@ src/common/textenums.h
 src/common/textevents.h
 src/fe-gtk/hexchat
 src/fe-text/hexchat-text
+src/htm/Main.resources
 src/htm/thememan.exe
+src/htm/thememan.exe.config
+src/htm/thememan.exe.mdb
+src/htm/thememan
 stamp-h1
 *.a
 *.o
diff --git a/.travis.yml b/.travis.yml
index b5127bf0..58f1b965 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,10 +2,10 @@ language: c
 compiler: gcc
 before_script:
     - sudo apt-get build-dep -qq xchat
-    - sudo apt-get install -qq libnotify-dev libproxy-dev libpci-dev libcanberra-dev
+    - sudo apt-get install -qq libnotify-dev libproxy-dev libpci-dev libcanberra-dev monodevelop
 script: 
     - ./autogen.sh
-    - ./configure --enable-textfe
+    - ./configure --enable-textfe --with-theme-manager
     - make
 notifications:
     irc:
diff --git a/configure.ac b/configure.ac
index 75f885e4..4e47cf7e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -21,6 +21,7 @@ AC_PROG_CPP
 AM_PROG_AS
 AM_DISABLE_STATIC
 AC_PROG_LIBTOOL
+AC_PATH_PROG(MDTOOL, mdtool, no)
 
 dnl -----------------------------------------------------------
 dnl Language Support
@@ -185,6 +186,20 @@ AC_ARG_ENABLE(minimal-flags,
 	[AS_HELP_STRING([--enable-minimal-flags],[only add those CFLAGS that are really needed or not intrusive (default: no)])],
         minimalflags=$enableval, minimalflags=no)
 
+AC_ARG_WITH(theme-manager,
+	[AS_HELP_STRING([--with-theme-manager],[compile theme manager (needs monodevelop, default: off)])],
+		theme_manager=$withval, theme_manager=no)
+
+
+
+dnl *********************************************************************
+dnl ** THEME-MANAGER ****************************************************
+dnl *********************************************************************
+if test "x$theme_manager" != "xno" ; then
+	if test "x$MDTOOL" = "xno"; then
+		AC_MSG_ERROR([No "mdtool" found, you need to install monodevelop!])
+	fi
+fi
 
 
 dnl *********************************************************************
@@ -669,6 +684,7 @@ AM_CONDITIONAL(DO_FISHLIM, test "x$fishlim" = "xyes")
 AM_CONDITIONAL(DO_SYSINFO, test "x$sysinfo" = "xyes")
 AM_CONDITIONAL(USE_DBUS, test "x$dbus" = "xyes")
 #AM_CONDITIONAL(DO_GCONF, test "x$GCONFTOOL" != "xno")
+AM_CONDITIONAL(WITH_TM, test "x$theme_manager" != "xno")
 
 dnl *********************************************************************
 dnl ** SOCKS5 ***********************************************************
@@ -952,6 +968,8 @@ src/common/Makefile
 src/common/dbus/Makefile
 src/fe-text/Makefile
 src/fe-gtk/Makefile
+src/htm/Makefile
+src/htm/thememan
 src/pixmaps/Makefile
 plugins/Makefile
 plugins/python/Makefile
@@ -972,6 +990,7 @@ echo HexChat $VERSION
 echo
 echo GTK+ interface ........ : $gtkfe
 echo Text interface ........ : $textfe
+echo Theme manager ......... : $theme_manager
 echo
 echo MMX tinting ........... : $mmx
 echo XShm tinting .......... : $shm
diff --git a/share/misc/Makefile.am b/share/misc/Makefile.am
index eec37250..32206a34 100644
--- a/share/misc/Makefile.am
+++ b/share/misc/Makefile.am
@@ -1,3 +1,19 @@
 util_DATA = hexchat.desktop
 utildir = $(datadir)/applications
 
+if WITH_TM
+util_DATA += htm.desktop
+mime_DATA = htm-mime.xml
+mimedir = $(datadir)/mime/packages
+
+UPDATE_MIME_DATABASE = update-mime-database "$(datadir)/mime" || :
+UPDATE_DESKTOP_DATABASE = update-desktop-database -q "$(datadir)/applications" || :
+
+install-data-hook:
+	$(UPDATE_MIME_DATABASE);
+	$(UPDATE_DESKTOP_DATABASE);
+
+uninstall-hook:
+	$(UPDATE_MIME_DATABASE);
+	$(UPDATE_DESKTOP_DATABASE);
+endif
diff --git a/share/misc/htm-mime.xml b/share/misc/htm-mime.xml
index 1201aaf3..f76b689b 100644
--- a/share/misc/htm-mime.xml
+++ b/share/misc/htm-mime.xml
@@ -2,6 +2,7 @@
  <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
    <mime-type type="application/x-hct">  
    <comment>HexChat theme archives</comment>
-   <glob pattern="*.hct"/>
+   <icon name="hexchat" />
+   <glob pattern="*.hct" weight="100" />
   </mime-type>
  </mime-info>
diff --git a/share/misc/htm.desktop b/share/misc/htm.desktop
index 535b7f4c..53cac289 100644
--- a/share/misc/htm.desktop
+++ b/share/misc/htm.desktop
@@ -1,6 +1,6 @@
 [Desktop Entry]
 Name=HexChat Theme Manager
-Exec=mono /usr/bin/thememan %f
+Exec=thememan %f
 Icon=hexchat
 Terminal=false
 Type=Application
diff --git a/src/Makefile.am b/src/Makefile.am
index 78856692..6cb77148 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -12,3 +12,7 @@ gtk_fe = fe-gtk
 endif
 
 SUBDIRS = pixmaps common $(gtk_fe) $(text_fe)
+
+if WITH_TM
+SUBDIRS += htm
+endif
diff --git a/src/common/modes.c b/src/common/modes.c
index 420f3e8c..416805c3 100644
--- a/src/common/modes.c
+++ b/src/common/modes.c
@@ -848,7 +848,7 @@ inbound_005 (server * serv, char *word[], const message_tags_data *tags_data)
 				serv->p_cmp = (void *)g_ascii_strcasecmp;
 		} else if (strncmp (word[w], "CHARSET=", 8) == 0)
 		{
-			if (g_ascii_strcasecmp (word[w] + 8, "UTF-8") == 0)
+			if (g_ascii_strncasecmp (word[w] + 8, "UTF-8", 5) == 0)
 			{
 				server_set_encoding (serv, "UTF-8");
 			}
diff --git a/src/common/textevents.in b/src/common/textevents.in
index b4242ca7..52b9e2ff 100644
--- a/src/common/textevents.in
+++ b/src/common/textevents.in
@@ -493,7 +493,7 @@ pevt_invited_help
 Join
 XP_TE_JOIN
 pevt_join_help
-%C23*$t$1 ($3) has joined
+%C23*$t$1 ($3%C23) has joined
 3
 
 Keyword
@@ -625,13 +625,13 @@ n0
 Part
 XP_TE_PART
 pevt_part_help
-%C24*$t$1 ($2) has left
+%C24*$t$1 ($2%C24) has left
 3
 
 Part with Reason
 XP_TE_PARTREASON
 pevt_partreason_help
-%C24*$t$1 ($2) has left ($4)
+%C24*$t$1 ($2%C24) has left ($4)
 4
 
 Ping Reply
diff --git a/src/htm/Makefile.am b/src/htm/Makefile.am
new file mode 100644
index 00000000..85480402
--- /dev/null
+++ b/src/htm/Makefile.am
@@ -0,0 +1,12 @@
+MDTOOL_OPTS = --verbose
+
+theme_SCRIPTS = thememan.exe thememan
+themedir = $(bindir)
+
+thememan.exe: htm-mono.csproj
+	$(MDTOOL) $(MDTOOL_OPTS) build $<
+
+clean-local:
+	rm -f thememan.exe thememan.exe.config thememan.exe.mdb thememan Main.resources
+
+EXTRA_DIST = thememan.in
diff --git a/src/htm/thememan.in b/src/htm/thememan.in
new file mode 100644
index 00000000..f6f80df6
--- /dev/null
+++ b/src/htm/thememan.in
@@ -0,0 +1,3 @@
+#!/bin/sh
+exec_prefix="@exec_prefix@"
+exec mono "@bindir@/thememan.exe" "$@"