Browse Source

Merge with master

tags/0.6.3m1rc1
Gregory Holmes 15 years ago
parent
commit
71bd401e5b
100 changed files with 1021 additions and 376 deletions
  1. 1
    1
      BuildAll.sh
  2. 2
    2
      UpdateCopyright.sh
  3. 15
    0
      build-jar.xml
  4. 2
    0
      build.xml
  5. 1
    1
      checkstyle/dmdirc.license
  6. 57
    18
      createPluginJar.sh
  7. 65
    24
      installer/jar/makeJar.sh
  8. 2
    2
      installer/linux/installerstub.sh
  9. 72
    24
      installer/linux/makeInstallerLinux.sh
  10. 1
    1
      installer/linux/setup.sh
  11. 178
    0
      installer/linux/uninstall.sh
  12. 1
    1
      installer/osx/DMDirc-Apple.c
  13. 72
    24
      installer/osx/makeInstallerOSX.sh
  14. 88
    48
      installer/release.sh
  15. 1
    1
      installer/windows/Launcher.dpr
  16. 1
    1
      installer/windows/Setup.dpr
  17. 86
    34
      installer/windows/makeInstallerWindows.sh
  18. 45
    25
      launcher/unix/DMDirc.sh
  19. BIN
      launcher/windows/DMDirc.exe
  20. BIN
      launcher/windows/DMDircUpdater.exe
  21. 1
    1
      launcher/windows/version.rc
  22. BIN
      lib/junit-3.8.1.jar
  23. BIN
      lib/miglayout-3.6.3.jar
  24. 0
    6
      nbproject/build-impl.xml
  25. 7
    11
      nbproject/project.properties
  26. 1
    1
      src/com/dmdirc/CertificateManager.java
  27. 16
    28
      src/com/dmdirc/Channel.java
  28. 1
    1
      src/com/dmdirc/ChannelClientProperty.java
  29. 1
    1
      src/com/dmdirc/ChannelEventHandler.java
  30. 1
    1
      src/com/dmdirc/CustomWindow.java
  31. 1
    1
      src/com/dmdirc/EventHandler.java
  32. 1
    1
      src/com/dmdirc/FrameContainer.java
  33. 1
    1
      src/com/dmdirc/FrameContainerComparator.java
  34. 1
    1
      src/com/dmdirc/GlobalWindow.java
  35. 1
    1
      src/com/dmdirc/IgnoreList.java
  36. 1
    1
      src/com/dmdirc/Invite.java
  37. 108
    15
      src/com/dmdirc/Main.java
  38. 1
    1
      src/com/dmdirc/MessageTarget.java
  39. 1
    1
      src/com/dmdirc/ParserFactory.java
  40. 1
    1
      src/com/dmdirc/Precondition.java
  41. 8
    17
      src/com/dmdirc/Query.java
  42. 1
    1
      src/com/dmdirc/Raw.java
  43. 9
    4
      src/com/dmdirc/Server.java
  44. 1
    1
      src/com/dmdirc/ServerEventHandler.java
  45. 1
    1
      src/com/dmdirc/ServerManager.java
  46. 1
    1
      src/com/dmdirc/ServerState.java
  47. 1
    1
      src/com/dmdirc/ServerStatus.java
  48. 1
    1
      src/com/dmdirc/Topic.java
  49. 39
    3
      src/com/dmdirc/WritableFrameContainer.java
  50. 1
    1
      src/com/dmdirc/actions/Action.java
  51. 2
    2
      src/com/dmdirc/actions/ActionComponentChain.java
  52. 1
    1
      src/com/dmdirc/actions/ActionCondition.java
  53. 1
    2
      src/com/dmdirc/actions/ActionGroup.java
  54. 1
    1
      src/com/dmdirc/actions/ActionManager.java
  55. 1
    1
      src/com/dmdirc/actions/ActionModel.java
  56. 1
    1
      src/com/dmdirc/actions/ActionSubstitutor.java
  57. 1
    2
      src/com/dmdirc/actions/ActionTypeComparator.java
  58. 1
    1
      src/com/dmdirc/actions/ConditionTree.java
  59. 1
    1
      src/com/dmdirc/actions/ConditionTreeFactory.java
  60. 1
    1
      src/com/dmdirc/actions/CoreActionComparison.java
  61. 2
    2
      src/com/dmdirc/actions/CoreActionComponent.java
  62. 1
    1
      src/com/dmdirc/actions/CoreActionType.java
  63. 1
    1
      src/com/dmdirc/actions/interfaces/ActionComparison.java
  64. 1
    1
      src/com/dmdirc/actions/interfaces/ActionComponent.java
  65. 1
    1
      src/com/dmdirc/actions/interfaces/ActionMetaType.java
  66. 1
    1
      src/com/dmdirc/actions/interfaces/ActionType.java
  67. 1
    1
      src/com/dmdirc/actions/metatypes/ActionEvents.java
  68. 1
    1
      src/com/dmdirc/actions/metatypes/ChannelEvents.java
  69. 1
    1
      src/com/dmdirc/actions/metatypes/ClientEvents.java
  70. 1
    1
      src/com/dmdirc/actions/metatypes/PluginEvents.java
  71. 1
    1
      src/com/dmdirc/actions/metatypes/QueryEvents.java
  72. 1
    1
      src/com/dmdirc/actions/metatypes/ServerEvents.java
  73. 1
    1
      src/com/dmdirc/actions/package-info.java
  74. 1
    1
      src/com/dmdirc/actions/wrappers/Alias.java
  75. 1
    1
      src/com/dmdirc/actions/wrappers/AliasWrapper.java
  76. 1
    1
      src/com/dmdirc/actions/wrappers/PerformWrapper.java
  77. 1
    1
      src/com/dmdirc/actions/wrappers/package-info.java
  78. 1
    1
      src/com/dmdirc/addons/addonbrowser/AddonInfo.java
  79. 2
    2
      src/com/dmdirc/addons/addonbrowser/AddonInfoListCellRenderer.java
  80. 2
    2
      src/com/dmdirc/addons/addonbrowser/BrowserPlugin.java
  81. 3
    3
      src/com/dmdirc/addons/addonbrowser/BrowserWindow.java
  82. 1
    1
      src/com/dmdirc/addons/addonbrowser/InstallListener.java
  83. 32
    0
      src/com/dmdirc/addons/addonbrowser/plugin.config
  84. 1
    1
      src/com/dmdirc/addons/audio/AudioCommand.java
  85. 1
    1
      src/com/dmdirc/addons/audio/AudioPlayer.java
  86. 1
    1
      src/com/dmdirc/addons/audio/AudioPlugin.java
  87. 1
    1
      src/com/dmdirc/addons/audio/BeepCommand.java
  88. 25
    0
      src/com/dmdirc/addons/audio/plugin.config
  89. 2
    3
      src/com/dmdirc/addons/dcc/DCC.java
  90. 1
    1
      src/com/dmdirc/addons/dcc/DCCChat.java
  91. 1
    1
      src/com/dmdirc/addons/dcc/DCCChatInterface.java
  92. 1
    1
      src/com/dmdirc/addons/dcc/DCCChatWindow.java
  93. 1
    1
      src/com/dmdirc/addons/dcc/DCCCommand.java
  94. 3
    3
      src/com/dmdirc/addons/dcc/DCCFrame.java
  95. 11
    6
      src/com/dmdirc/addons/dcc/DCCPlugin.java
  96. 1
    1
      src/com/dmdirc/addons/dcc/DCCSend.java
  97. 1
    1
      src/com/dmdirc/addons/dcc/DCCSendInterface.java
  98. 1
    1
      src/com/dmdirc/addons/dcc/DCCSendWindow.java
  99. 1
    1
      src/com/dmdirc/addons/dcc/actions/DCCActions.java
  100. 0
    0
      src/com/dmdirc/addons/dcc/actions/DCCEvents.java

+ 1
- 1
BuildAll.sh View File

93
 else
93
 else
94
 	# Build installers
94
 	# Build installers
95
 	cd "${MYDIR}/installer"
95
 	cd "${MYDIR}/installer"
96
-	./release.sh --jar "${MYDIR}/dist/DMDirc.jar" --opt "--tag ${FILEDATA}" trunk
96
+	./release.sh --jar "${MYDIR}/dist/DMDirc.jar" --opt "--extra ${FILEDATA}" trunk
97
 	cd "${MYDIR}"
97
 	cd "${MYDIR}"
98
 	
98
 	
99
 	if [ ! -e "${MYDIR}/installer/output/DMDirc-Setup-${FILEDATA}.exe" -o  ! -e "${MYDIR}/installer/output/DMDirc-Setup-${FILEDATA}.run" -o ! -e "${MYDIR}/installer/output/DMDirc-${FILEDATA}.dmg" -o ! -e "${MYDIR}/installer/output/DMDirc-${FILEDATA}.jar" ]; then
99
 	if [ ! -e "${MYDIR}/installer/output/DMDirc-Setup-${FILEDATA}.exe" -o  ! -e "${MYDIR}/installer/output/DMDirc-Setup-${FILEDATA}.run" -o ! -e "${MYDIR}/installer/output/DMDirc-${FILEDATA}.dmg" -o ! -e "${MYDIR}/installer/output/DMDirc-${FILEDATA}.jar" ]; then

+ 2
- 2
UpdateCopyright.sh View File

1
 #!/bin/sh
1
 #!/bin/sh
2
 # Update Copyright headers in all files.
2
 # Update Copyright headers in all files.
3
 
3
 
4
-OLD="2006-2007"
5
-NEW="2006-2008"
4
+OLD="2006-2008"
5
+NEW="2006-2009"
6
 
6
 
7
 grep -iR "${OLD}" ./* | grep -v /.svn/ | grep -v "Binary file" | grep -v UpdateCopyright.sh | grep -v update.sh | awk -F: '{print "echo \"Updating \\\""$1"\\\"\"\nsed -i \"s/'${OLD}'/'${NEW}'/g\" \""$1"\""}' > update.sh
7
 grep -iR "${OLD}" ./* | grep -v /.svn/ | grep -v "Binary file" | grep -v UpdateCopyright.sh | grep -v update.sh | awk -F: '{print "echo \"Updating \\\""$1"\\\"\"\nsed -i \"s/'${OLD}'/'${NEW}'/g\" \""$1"\""}' > update.sh
8
 sh update.sh
8
 sh update.sh

+ 15
- 0
build-jar.xml View File

1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<project name="DMDirc-jar" default="default" basedir=".">
3
+
4
+    <!-- Netbeans property files -->
5
+    <property file="nbproject/project.properties"/>
6
+    <property file="nbproject/private/private.properties"/>
7
+    <property file="${user.properties.file}"/>
8
+    
9
+    <target name="-addjarlibs">
10
+        <jar destfile="plugins/ui_swing.jar" compress="${jar.compress}" keepcompression="true" update="true">
11
+            <zipfileset src="${file.reference.miglayout.jar}" includes="net/miginfocom/layout/**,net/miginfocom/swing/**"/>
12
+        </jar>
13
+    </target>
14
+
15
+</project>

+ 2
- 0
build.xml View File

6
 
6
 
7
     <import file="nbproject/build-impl.xml"/>
7
     <import file="nbproject/build-impl.xml"/>
8
     <import file="build-installer.xml"/>
8
     <import file="build-installer.xml"/>
9
+    <import file="build-jar.xml"/>
9
     <import file="build-plugins.xml"/>
10
     <import file="build-plugins.xml"/>
10
     <import file="build-reports.xml"/>
11
     <import file="build-reports.xml"/>
11
     <import file="build-svn.xml"/>
12
     <import file="build-svn.xml"/>
14
     <target name="-post-compile" depends="-unsvn, build-plugins"/>
15
     <target name="-post-compile" depends="-unsvn, build-plugins"/>
15
     <target name="-pre-compile" depends="-addsvn"/>
16
     <target name="-pre-compile" depends="-addsvn"/>
16
     <target name="-post-test-run" depends="-do-test-reports"/>
17
     <target name="-post-test-run" depends="-do-test-reports"/>
18
+    <target name="-post-jar" depends="-addjarlibs"/>
17
 
19
 
18
 </project>
20
 </project>

+ 1
- 1
checkstyle/dmdirc.license View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 57
- 18
createPluginJar.sh View File

7
 	exit;
7
 	exit;
8
 fi
8
 fi
9
 
9
 
10
+srcdir=${PWD}
10
 pluginname=${1}
11
 pluginname=${1}
11
 foldername=${pluginname//.//}
12
 foldername=${pluginname//.//}
12
 
13
 
14
+newer=`find src/${foldername} -type f -newer ${srcdir}/plugins/${2}.jar 2>&1 | wc -l`
15
+
16
+if [ $newer -eq 0 ]; then
17
+	echo "${2}.jar appears to be up-to-date";
18
+	exit 0;
19
+fi
20
+
13
 echo "Creating ${2}.jar for ${pluginname} (${foldername})"
21
 echo "Creating ${2}.jar for ${pluginname} (${foldername})"
14
 
22
 
15
-if [ ! -e src/${foldername}/plugin.info ]; then
16
-	echo "no plugin.info found";
23
+if [ ! -e src/${foldername}/plugin.info -a ! -e src/${foldername}/plugin.config ]; then
24
+	echo "no plugin.info or plugin.config found";
17
 	exit 0;
25
 	exit 0;
18
 fi
26
 fi
19
 
27
 
20
 #echo "looking for classes"
28
 #echo "looking for classes"
21
-srcdir=${PWD}
22
 TMPDIR=`mktemp -d`
29
 TMPDIR=`mktemp -d`
23
 #echo "Using temp dir: ${TMPDIR}"
30
 #echo "Using temp dir: ${TMPDIR}"
24
 cd $TMPDIR
31
 cd $TMPDIR
25
 
32
 
26
 mkdir META-INF
33
 mkdir META-INF
27
-cp ${srcdir}/src/${foldername}/plugin.info META-INF/
34
+if [ -e ${srcdir}/src/${foldername}/plugin.info ]; then
35
+	cp ${srcdir}/src/${foldername}/plugin.info META-INF/
36
+fi;
37
+if [ -e ${srcdir}/src/${foldername}/plugin.config ]; then
38
+	cp ${srcdir}/src/${foldername}/plugin.config META-INF/
39
+fi;
28
 
40
 
29
 # Add the SVN version if there's no version specified and we know the SVN rev
41
 # Add the SVN version if there's no version specified and we know the SVN rev
30
-if ! grep "^version=" META-INF/plugin.info >/dev/null; then
31
-	SVN=`which svn`	
32
-	SVNREV=`$SVN info $srcdir/src/$foldername 2>&1 | grep "Last Changed Rev"`
33
-        SVNREV=${SVNREV##*: }
34
-        echo "" >> META-INF/plugin.info
35
-
36
-	if [ -n "$SVNREV" ]; then
37
-		echo "version=$SVNREV" >> META-INF/plugin.info;
38
-	else
39
-		echo "version=0" >> META-INF/plugin.info;
42
+if [ -e META-INF/plugin.info ]; then
43
+	if ! grep "^version=" META-INF/plugin.info >/dev/null; then
44
+		SVN=`which svn`	
45
+		SVNREV=`$SVN info $srcdir/src/$foldername 2>&1 | grep "Last Changed Rev"`
46
+		SVNREV=${SVNREV##*: }
47
+		echo "" >> META-INF/plugin.info
48
+	
49
+		if [ -n "$SVNREV" ]; then
50
+			echo "version=$SVNREV" >> META-INF/plugin.info;
51
+		else
52
+			echo "version=0" >> META-INF/plugin.info;
53
+		fi
54
+	
55
+		if ! grep "^friendlyversion=" META-INF/plugin.info >/dev/null; then
56
+			echo "friendlyversion=$SVNREV" >> META-INF/plugin.info
57
+		fi
40
 	fi
58
 	fi
59
+fi;
41
 
60
 
42
-	if ! grep "^friendlyversion=" META-INF/plugin.info >/dev/null; then
43
-		echo "friendlyversion=$SVNREV" >> META-INF/plugin.info
61
+# Do the same for plugin.config
62
+# This is rudimentary, it a version: section already exists (eg to specify
63
+# friendlyversion) then it won't add the number= key.
64
+if [ -e META-INF/plugin.config ]; then
65
+	if ! grep "^version:" META-INF/plugin.config >/dev/null; then
66
+		SVN=`which svn`	
67
+		SVNREV=`$SVN info $srcdir/src/$foldername 2>&1 | grep "Last Changed Rev"`
68
+		SVNREV=${SVNREV##*: }
69
+		echo "" >> META-INF/plugin.config
70
+		echo "" >> META-INF/plugin.config
71
+	
72
+		echo "version:" >> META-INF/plugin.config;
73
+		if [ -n "$SVNREV" ]; then
74
+			echo "  number=$SVNREV" >> META-INF/plugin.config;
75
+		else
76
+			echo "  number=0" >> META-INF/plugin.config;
77
+		fi
78
+		
79
+		# Add to keysections list
80
+		sed 's/keysections:/keysections:\n  version/g' META-INF/plugin.config > META-INF/plugin.config.temp
81
+		rm -Rf META-INF/plugin.config
82
+		mv META-INF/plugin.config.temp META-INF/plugin.config
44
 	fi
83
 	fi
45
-fi
84
+fi;
46
 
85
 
47
 foo=`echo $foldername | sed -e 's/\/[^\/]*$//g'`
86
 foo=`echo $foldername | sed -e 's/\/[^\/]*$//g'`
48
 mkdir -p $foo
87
 mkdir -p $foo
51
 cd $TMPDIR
90
 cd $TMPDIR
52
 mkdir -p ${srcdir}/plugins/
91
 mkdir -p ${srcdir}/plugins/
53
 rm -Rf ${srcdir}/plugins/${2}.jar
92
 rm -Rf ${srcdir}/plugins/${2}.jar
54
-jar -cvf ${srcdir}/src/${foldername}/${2}.jar META-INF/plugin.info >/dev/null
93
+jar -cvf ${srcdir}/src/${foldername}/${2}.jar META-INF >/dev/null
55
 bit=""
94
 bit=""
56
 while [ 1 -eq 1 ]; do
95
 while [ 1 -eq 1 ]; do
57
 	bit=${bit}/*
96
 	bit=${bit}/*

+ 65
- 24
installer/jar/makeJar.sh View File

3
 # This script generates a jar file for a release version of DMDirc
3
 # This script generates a jar file for a release version of DMDirc
4
 #
4
 #
5
 # DMDirc - Open Source IRC Client
5
 # DMDirc - Open Source IRC Client
6
-# Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
6
+# Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
7
 #
7
 #
8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
9
 # of this software and associated documentation files (the "Software"), to deal
9
 # of this software and associated documentation files (the "Software"), to deal
28
 # full name of the file to output to
28
 # full name of the file to output to
29
 RUNNAME="${PWD}/${FILENAME}.jar"
29
 RUNNAME="${PWD}/${FILENAME}.jar"
30
 
30
 
31
+# Are we a git working copy, or SVN?
32
+if [ -e ".svn" ]; then
33
+	isSVN=1
34
+else
35
+	isSVN=0
36
+fi;
37
+
31
 # Go!
38
 # Go!
32
 echo "-----------"
39
 echo "-----------"
33
 if [ -e "${RUNNAME}" ]; then
40
 if [ -e "${RUNNAME}" ]; then
46
 	echo "-c, --compile             Recompile the .jar file (otherwise use the existing file from dist/)"
53
 	echo "-c, --compile             Recompile the .jar file (otherwise use the existing file from dist/)"
47
 	echo "    --jar <file>          use <file> as DMDirc.jar (ie just add the plugins to it and rename)"
54
 	echo "    --jar <file>          use <file> as DMDirc.jar (ie just add the plugins to it and rename)"
48
 	echo "    --current             Use the current folder as the base for the build"
55
 	echo "    --current             Use the current folder as the base for the build"
49
-	echo "-t, --tag <tag>           Tag to add to final name to distinguish this build from a standard build"
56
+	echo "-e, --extra <tag>         Tag to add to final name to distinguish this build from a standard build"
50
 	echo "-k, --keep                Keep the existing source tree when compiling"
57
 	echo "-k, --keep                Keep the existing source tree when compiling"
51
 	echo "                          (don't svn update beforehand)"
58
 	echo "                          (don't svn update beforehand)"
52
 	echo "---------------------"
59
 	echo "---------------------"
60
 finalTag=""
67
 finalTag=""
61
 BRANCH="0"
68
 BRANCH="0"
62
 plugins=""
69
 plugins=""
63
-location="../../../"
70
+if [ $isSVN -eq 1 ]; then
71
+	location="../../../"
72
+	current=""
73
+else
74
+	location="../../"
75
+	current="1"
76
+fi;
64
 jarfile=""
77
 jarfile=""
65
-current=""
66
 jre=""
78
 jre=""
67
 jrename="jre" # Filename for JRE without the .bin
79
 jrename="jre" # Filename for JRE without the .bin
80
+TAGGED=""
68
 while test -n "$1"; do
81
 while test -n "$1"; do
69
 	case "$1" in
82
 	case "$1" in
70
 		--plugins|-p)
83
 		--plugins|-p)
86
 			shift
99
 			shift
87
 			isRelease=${1}
100
 			isRelease=${1}
88
 			;;
101
 			;;
89
-		--tag|-t)
102
+		--extra|-e)
90
 			shift
103
 			shift
91
 			finalTag=${1}
104
 			finalTag=${1}
92
 			RUNNAME="${PWD}/${FILENAME}-${1}.jar"
105
 			RUNNAME="${PWD}/${FILENAME}-${1}.jar"
100
 		--branch|-b)
113
 		--branch|-b)
101
 			BRANCH="1"
114
 			BRANCH="1"
102
 			;;
115
 			;;
116
+		--tag|-t)
117
+			shift
118
+			REGEX="^[0-9]+(\.[0-9]+(\.[0-9]+)?)?$"
119
+			CHECKTAG=`echo ${1} | egrep "${REGEX}"`
120
+			if [ "" = "${CHECKTAG}" ]; then
121
+				echo "Specified tag ("${1}") is invalid."
122
+				exit 1;
123
+			fi;
124
+			TAGGED="${1}"
125
+			;;
103
 	esac
126
 	esac
104
 	shift
127
 	shift
105
 done
128
 done
109
 	jarPath="${location}"
132
 	jarPath="${location}"
110
 fi
133
 fi
111
 if [ "${isRelease}" != "" ]; then
134
 if [ "${isRelease}" != "" ]; then
112
-	if [ "${BRANCH}" != "0" ]; then
113
-		if [ -e "${location}/${isRelease}" ]; then
114
-			jarPath="${location}/${isRelease}"
115
-		else
116
-			echo "Branch "${isRelease}" not found."
117
-			exit 1;
118
-		fi
119
-	else
120
-		if [ -e "${location}/${isRelease}" ]; then
121
-			jarPath="${location}/${isRelease}"
135
+	if [ $isSVN -eq 1 ]; then
136
+		if [ "${BRANCH}" != "0" ]; then
137
+			if [ -e "${location}/${isRelease}" ]; then
138
+				jarPath="${location}/${isRelease}"
139
+			else
140
+				echo "Branch "${isRelease}" not found."
141
+				exit 1;
142
+			fi
122
 		else
143
 		else
123
-			echo "Tag "${isRelease}" not found."
124
-			exit 1;
125
-		fi
126
-	fi
144
+			if [ -e "${location}/${isRelease}" ]; then
145
+				jarPath="${location}/${isRelease}"
146
+			else
147
+				echo "Tag "${isRelease}" not found."
148
+				exit 1;
149
+			fi
150
+		fi;
151
+	fi	
127
 fi
152
 fi
128
 
153
 
129
 if [ "" = "${jarfile}" ]; then
154
 if [ "" = "${jarfile}" ]; then
133
 		OLDPWD=${PWD}
158
 		OLDPWD=${PWD}
134
 		cd ${jarPath}
159
 		cd ${jarPath}
135
 		if [ "${updateSVN}" = "true" ]; then
160
 		if [ "${updateSVN}" = "true" ]; then
136
-			svn update
161
+			if [ $isSVN -eq 1 ]; then
162
+				svn update
163
+			fi;
137
 		fi
164
 		fi
138
 		ant clean jar
165
 		ant clean jar
139
 		if [ ! -e "dist/DMDirc.jar" ]; then
166
 		if [ ! -e "dist/DMDirc.jar" ]; then
158
 done
185
 done
159
 jar -uvf "${RUNNAME}" ${pluginList}
186
 jar -uvf "${RUNNAME}" ${pluginList}
160
 rm -Rf plugins;
187
 rm -Rf plugins;
161
-
188
+doRename=0
162
 if [ "${isRelease}" != "" ]; then
189
 if [ "${isRelease}" != "" ]; then
163
-	if [ "${BRANCH}" = "1" ]; then
164
-		isRelease=branch-${isRelease}
165
-	fi;
190
+	doRename=1
191
+elif [ $isSVN -eq 0 -a "${TAGGED}" != "" ]; then
192
+	doRename=1	
193
+fi;
194
+
195
+if [ ${doRename} -eq 1 ]; then
196
+	if [ $isSVN -eq 1 ]; then
197
+		if [ "${BRANCH}" = "1" ]; then
198
+			isRelease=branch-${isRelease}
199
+		fi;
200
+	else
201
+		if [ "${TAGGED}" = "" ]; then
202
+			isRelease=branch-${isRelease}
203
+		else
204
+			isRelease=${TAGGED}
205
+		fi;
206
+	fi
166
 	if [ "" != "${finalTag}" ]; then
207
 	if [ "" != "${finalTag}" ]; then
167
 		finalTag="-${finalTag}"
208
 		finalTag="-${finalTag}"
168
 	fi;
209
 	fi;

+ 2
- 2
installer/linux/installerstub.sh View File

3
 # This script installs dmdirc
3
 # This script installs dmdirc
4
 #
4
 #
5
 # DMDirc - Open Source IRC Client
5
 # DMDirc - Open Source IRC Client
6
-# Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
6
+# Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
7
 #
7
 #
8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
9
 # of this software and associated documentation files (the "Software"), to deal
9
 # of this software and associated documentation files (the "Software"), to deal
401
 echo "Installation Completed."
401
 echo "Installation Completed."
402
 # Job Done!
402
 # Job Done!
403
 exit 0;
403
 exit 0;
404
-###END STUB###
404
+###END STUB###

+ 72
- 24
installer/linux/makeInstallerLinux.sh View File

3
 # This script generates a .run file that will install DMDirc
3
 # This script generates a .run file that will install DMDirc
4
 #
4
 #
5
 # DMDirc - Open Source IRC Client
5
 # DMDirc - Open Source IRC Client
6
-# Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
6
+# Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
7
 #
7
 #
8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
9
 # of this software and associated documentation files (the "Software"), to deal
9
 # of this software and associated documentation files (the "Software"), to deal
28
 # full name of the file to output to
28
 # full name of the file to output to
29
 RUNNAME="${PWD}/${INSTALLERNAME}.run"
29
 RUNNAME="${PWD}/${INSTALLERNAME}.run"
30
 
30
 
31
+# Are we a git working copy, or SVN?
32
+if [ -e ".svn" ]; then
33
+	isSVN=1
34
+else
35
+	isSVN=0
36
+fi;
37
+
31
 # Find out what params we should pass to things.
38
 # Find out what params we should pass to things.
32
 # Solaris has a nice and ancient version of grep in /usr/bin
39
 # Solaris has a nice and ancient version of grep in /usr/bin
33
 grep -na "" /dev/null >/dev/null 2>&1
40
 grep -na "" /dev/null >/dev/null 2>&1
110
 	echo "    --jre64               Include the 64-Bit JRE in this installer"
117
 	echo "    --jre64               Include the 64-Bit JRE in this installer"
111
 	echo "    --jar <file>          use <file> as DMDirc.jar"
118
 	echo "    --jar <file>          use <file> as DMDirc.jar"
112
 	echo "    --current             Use the current folder as the base for the build"
119
 	echo "    --current             Use the current folder as the base for the build"
113
-	echo "-t, --tag <tag>           Tag to add to final exe name to distinguish this build from a standard build"
120
+	echo "-e, --extra <tag>         Tag to add to final exe name to distinguish this build from a standard build"
114
 	echo "-k, --keep                Keep the existing source tree when compiling"
121
 	echo "-k, --keep                Keep the existing source tree when compiling"
115
 	echo "                          (don't svn update beforehand)"
122
 	echo "                          (don't svn update beforehand)"
116
 	echo "---------------------"
123
 	echo "---------------------"
124
 finalTag=""
131
 finalTag=""
125
 BRANCH="0"
132
 BRANCH="0"
126
 plugins=""
133
 plugins=""
127
-location="../../../"
134
+if [ $isSVN -eq 1 ]; then
135
+	location="../../../"
136
+	current=""
137
+else
138
+	location="../../"
139
+	current="1"
140
+fi;
128
 jarfile=""
141
 jarfile=""
129
-current=""
130
 jre=""
142
 jre=""
131
 jrename="jre" # Filename for JRE without the .bin
143
 jrename="jre" # Filename for JRE without the .bin
144
+TAGGED=""
132
 while test -n "$1"; do
145
 while test -n "$1"; do
133
 	case "$1" in
146
 	case "$1" in
134
 		--plugins|-p)
147
 		--plugins|-p)
157
 			shift
170
 			shift
158
 			isRelease=${1}
171
 			isRelease=${1}
159
 			;;
172
 			;;
160
-		--tag|-t)
173
+		--extra|-e)
161
 			shift
174
 			shift
162
 			finalTag=${1}
175
 			finalTag=${1}
163
 			RUNNAME="${PWD}/${INSTALLERNAME}-${1}.run"
176
 			RUNNAME="${PWD}/${INSTALLERNAME}-${1}.run"
171
 		--branch|-b)
184
 		--branch|-b)
172
 			BRANCH="1"
185
 			BRANCH="1"
173
 			;;
186
 			;;
187
+		--tag|-t)
188
+			shift
189
+			REGEX="^[0-9]+(\.[0-9]+(\.[0-9]+)?)?$"
190
+			CHECKTAG=`echo ${1} | egrep "${REGEX}"`
191
+			if [ "" = "${CHECKTAG}" ]; then
192
+				echo "Specified tag ("${1}") is invalid."
193
+				exit 1;
194
+			fi;
195
+			TAGGED="${1}"
196
+			;;
174
 	esac
197
 	esac
175
 	shift
198
 	shift
176
 done
199
 done
180
 	jarPath="${location}"
203
 	jarPath="${location}"
181
 fi
204
 fi
182
 if [ "${isRelease}" != "" ]; then
205
 if [ "${isRelease}" != "" ]; then
183
-	if [ "${BRANCH}" != "0" ]; then
184
-		if [ -e "${location}/${isRelease}" ]; then
185
-			jarPath="${location}/${isRelease}"
186
-		else
187
-			echo "Branch "${isRelease}" not found."
188
-			exit 1;
189
-		fi
190
-	else
191
-		if [ -e "${location}/${isRelease}" ]; then
192
-			jarPath="${location}/${isRelease}"
206
+	if [ $isSVN -eq 1 ]; then
207
+		if [ "${BRANCH}" != "0" ]; then
208
+			if [ -e "${location}/${isRelease}" ]; then
209
+				jarPath="${location}/${isRelease}"
210
+			else
211
+				echo "Branch "${isRelease}" not found."
212
+				exit 1;
213
+			fi
193
 		else
214
 		else
194
-			echo "Tag "${isRelease}" not found."
195
-			exit 1;
215
+			if [ -e "${location}/${isRelease}" ]; then
216
+				jarPath="${location}/${isRelease}"
217
+			else
218
+				echo "Tag "${isRelease}" not found."
219
+				exit 1;
220
+			fi
196
 		fi
221
 		fi
197
-	fi
222
+	fi;
198
 fi
223
 fi
199
 
224
 
200
 if [ "" = "${jarfile}" ]; then
225
 if [ "" = "${jarfile}" ]; then
241
 cat installerstub.sh > ${RUNNAME}
266
 cat installerstub.sh > ${RUNNAME}
242
 
267
 
243
 # Add release info.
268
 # Add release info.
244
-awk '{gsub(/###ADDITIONAL_STUFF###/,"isRelease=\"'${isRelease}'\"");print}' ${RUNNAME} > ${RUNNAME}.tmp
245
-mv ${RUNNAME}.tmp ${RUNNAME}
269
+if [ $isSVN -eq 1 ]; then
270
+	awk '{gsub(/###ADDITIONAL_STUFF###/,"isRelease=\"'${isRelease}'\"");print}' ${RUNNAME} > ${RUNNAME}.tmp
271
+	mv ${RUNNAME}.tmp ${RUNNAME}
272
+elif [ "${TAGGED}" != "" ]; then
273
+	awk '{gsub(/###ADDITIONAL_STUFF###/,"isRelease=\"'${TAGGED}'\"");print}' ${RUNNAME} > ${RUNNAME}.tmp
274
+	mv ${RUNNAME}.tmp ${RUNNAME}
275
+fi;
246
 
276
 
247
 FILES="DMDirc.jar";
277
 FILES="DMDirc.jar";
248
 echo "Compressing files.."
278
 echo "Compressing files.."
303
 	FILES="${FILES} DMDirc.sh"
333
 	FILES="${FILES} DMDirc.sh"
304
 fi
334
 fi
305
 
335
 
336
+if [ -e "uninstall.sh" ]; then
337
+	FILES="${FILES} uninstall.sh"
338
+fi
339
+
306
 compress $FILES
340
 compress $FILES
307
 
341
 
308
 MD5BIN=`which md5sum`
342
 MD5BIN=`which md5sum`
363
 echo "Chmodding"
397
 echo "Chmodding"
364
 chmod a+x ${RUNNAME}
398
 chmod a+x ${RUNNAME}
365
 
399
 
366
-
400
+doRename=0
367
 if [ "${isRelease}" != "" ]; then
401
 if [ "${isRelease}" != "" ]; then
368
-	if [ "${BRANCH}" = "1" ]; then
369
-		isRelease=branch-${isRelease}
370
-	fi;
402
+	doRename=1
403
+elif [ $isSVN -eq 0 -a "${TAGGED}" != "" ]; then
404
+	doRename=1	
405
+fi;
406
+
407
+if [ ${doRename} -eq 1 ]; then
408
+	if [ $isSVN -eq 1 ]; then
409
+		if [ "${BRANCH}" = "1" ]; then
410
+			isRelease=branch-${isRelease}
411
+		fi;
412
+	else
413
+		if [ "${TAGGED}" = "" ]; then
414
+			isRelease=branch-${isRelease}
415
+		else
416
+			isRelease=${TAGGED}
417
+		fi;
418
+	fi
371
 	if [ "" != "${finalTag}" ]; then
419
 	if [ "" != "${finalTag}" ]; then
372
 		finalTag="-${finalTag}"
420
 		finalTag="-${finalTag}"
373
 	fi;
421
 	fi;

+ 1
- 1
installer/linux/setup.sh View File

3
 # This script launches the dmdirc java-based installer.
3
 # This script launches the dmdirc java-based installer.
4
 #
4
 #
5
 # DMDirc - Open Source IRC Client
5
 # DMDirc - Open Source IRC Client
6
-# Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
6
+# Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
7
 #
7
 #
8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
9
 # of this software and associated documentation files (the "Software"), to deal
9
 # of this software and associated documentation files (the "Software"), to deal

+ 178
- 0
installer/linux/uninstall.sh View File

1
+#!/bin/sh
2
+
3
+if [ ! -e .uninstall.conf ]; then
4
+	echo "No .uninstall.conf found, unable to continue."
5
+	exit 1;
6
+else
7
+	INSTALLED_AS_ROOT=""
8
+	INSTALL_LOCATION=""
9
+	
10
+	. .uninstall.conf
11
+fi;
12
+
13
+PIDOF=`which pidof`
14
+if [ -z "${PIDOF}" ]; then
15
+	# For some reason some distros hide pidof...
16
+	if [ -e /sbin/pidof ]; then
17
+		PIDOF=/sbin/pidof
18
+	elif [ -e /usr/sbin/pidof ]; then
19
+		PIDOF=/usr/sbin/pidof
20
+	fi;
21
+fi;
22
+
23
+## Helper Functions
24
+if [ -n "${PIDOF}" ]; then
25
+	ISKDE=`${PIDOF} -x -s kdeinit`
26
+	ISGNOME=`${PIDOF} -x -s gnome-panel`
27
+else
28
+	ISKDE=`pgrep kdeinit`
29
+	ISGNOME=`pgrep gnome-panel`
30
+fi;
31
+
32
+KDIALOG=`which kdialog`
33
+ZENITY=`which zenity`
34
+DIALOG=`which dialog`
35
+JAVA=`which java`
36
+
37
+messagedialog() {
38
+	# Send message to console.
39
+	echo ""
40
+	echo "-----------------------------------------------------------------------"
41
+	echo "DMDirc: ${1}"
42
+	echo "-----------------------------------------------------------------------"
43
+	echo "${2}"
44
+	echo "-----------------------------------------------------------------------"
45
+
46
+	if [ "" != "${ISKDE}" -a "" != "${KDIALOG}" -a "" != "${DISPLAY}" ]; then
47
+		echo "Dialog on Display: ${DISPLAY}"
48
+		${KDIALOG} --title "DMDirc: ${1}" --msgbox "${2}"
49
+	elif [ "" != "${ISGNOME}" -a "" != "${ZENITY}" -a "" != "${DISPLAY}" ]; then
50
+		echo "Dialog on Display: ${DISPLAY}"
51
+		${ZENITY} --info --title "DMDirc: ${1}" --text "${2}"
52
+	elif [ "" != "${DIALOG}" ]; then
53
+		${DIALOG} --title "DMDirc: ${1}" --msgbox "${2}" 8 40
54
+	fi
55
+}
56
+
57
+questiondialog() {
58
+	# Send question to console.
59
+	echo ""
60
+	echo "-----------------------------------------------------------------------"
61
+	echo "DMDirc: ${1}"
62
+	echo "-----------------------------------------------------------------------"
63
+	echo "${2}"
64
+	echo "-----------------------------------------------------------------------"
65
+
66
+	if [ "" != "${ISKDE}" -a "" != "${KDIALOG}" -a "" != "${DISPLAY}" ]; then
67
+		echo "Dialog on Display: ${DISPLAY}"
68
+		${KDIALOG} --title "DMDirc: ${1}" --yesno "${2}"
69
+	elif [ "" != "${ISGNOME}" -a "" != "${ZENITY}" -a "" != "${DISPLAY}" ]; then
70
+		echo "Dialog on Display: ${DISPLAY}"
71
+		${ZENITY} --question --title "DMDirc: ${1}" --text "${2}"
72
+	elif [ "" != "${DIALOG}" ]; then
73
+		${DIALOG} --title "DMDirc: ${1}" --yesno "${2}" 8 40
74
+	else
75
+		echo "Unable to show Dialog for question, assuming no"
76
+		return 1
77
+	fi
78
+}
79
+
80
+errordialog() {
81
+	# Send error to console.
82
+	echo ""
83
+	echo "-----------------------------------------------------------------------"
84
+	echo "[Error] DMDirc: ${1}"
85
+	echo "-----------------------------------------------------------------------"
86
+	echo "${2}"
87
+	echo "-----------------------------------------------------------------------"
88
+
89
+	if [ "" != "${ISKDE}" -a "" != "${KDIALOG}" -a "" != "${DISPLAY}" ]; then
90
+		echo "Dialog on Display: ${DISPLAY}"
91
+		${KDIALOG} --title "DMDirc: ${1}" --error "${2}"
92
+	elif [ "" != "${ISGNOME}" -a "" != "${ZENITY}" -a "" != "${DISPLAY}" ]; then
93
+		echo "Dialog on Display: ${DISPLAY}"
94
+		${ZENITY} --error --title "DMDirc: ${1}" --text "${2}"
95
+	elif [ "" != "${DIALOG}" ]; then
96
+		${DIALOG} --title "[Error] DMDirc: ${1}" --msgbox "${2}" 8 40
97
+	fi
98
+}
99
+
100
+if [ ${INSTALLED_AS_ROOT} -eq 1 ]; then
101
+	USER=`whoami`
102
+	if [ "${USER}" != "root" ]; then
103
+		errordialog "Uninstaller" "Uninstall Aborted. Only root can use this script"
104
+		exit 1;
105
+	fi
106
+fi
107
+
108
+questiondialog "Uninstaller" "Are you sure you want to uninstall DMDirc?"
109
+if [ $? -ne 0 ]; then
110
+	messagedialog "Uninstaller" "Uninstall Aborted."
111
+	echo "Uninstall Aborted"
112
+	exit 1;
113
+fi
114
+
115
+${JAVA} -jar ${INSTALL_LOCATION}/DMDirc.jar -k
116
+
117
+if [ $? -eq 0 ]; then
118
+	errordialog "Uninstaller" "Uninstall Aborted - DMDirc is still running. Please close DMDirc before continuing"
119
+	echo "Uninstall Aborted - DMDirc already running."
120
+	exit 1;
121
+fi
122
+
123
+echo "Uninstalling DMDirc"
124
+echo "Removing Shortcuts.."
125
+
126
+TOOL=`which gconftool-2`
127
+COMMAND=""
128
+FILENAME=""
129
+if [ ${INSTALLED_AS_ROOT} -eq 1 ]; then
130
+	COMMAND="${TOOL} --config-source=`${TOOL} --get-default-source`"
131
+	FILENAME="/usr/share/services/irc.protocol"
132
+	rm -Rfv /usr/share/applications/DMDirc.desktop
133
+else
134
+	COMMAND="${TOOL}"
135
+	FILENAME="${HOME}/.kde/share/services/irc.protocol"
136
+	rm -Rfv ${HOME}/.local/share/applications/DMDirc.desktop
137
+	rm -Rfv ${HOME}/Desktop/DMDirc.desktop
138
+fi;
139
+
140
+if [ "${TOOL}" != "" ]; then
141
+	CURRENT=`${COMMAND} --get /desktop/gnome/url-handlers/irc/command`
142
+	if [ "${CURRENT}" = "\"${INSTALL_LOCATION}/DMDirc.sh\" -e -c %s" ]; then
143
+		echo "Removing Gnome Protocol Handler"
144
+		${COMMAND} --unset /desktop/gnome/url-handlers/irc/enabled
145
+		${COMMAND} --unset /desktop/gnome/url-handlers/irc/command
146
+	else
147
+		echo "Not Removing Gnome Protocol Handler"
148
+	fi
149
+fi
150
+
151
+if [ -e "${FILENAME}" ]; then
152
+	CURRENT=`grep DMDirc ${FILENAME}`
153
+	if [ "" != "${CURRENT}" ]; then
154
+		echo "Removing KDE Protocol Handler"
155
+		rm -Rfv ${FILENAME}
156
+	else
157
+		echo "Not Removing KDE Protocol Handler"
158
+	fi
159
+fi
160
+
161
+echo "Removing Installation Directory"
162
+
163
+rm -Rfv ${INSTALL_LOCATION}
164
+
165
+PROFILEDIR="${HOME}/.DMDirc"
166
+
167
+if [ -e ${PROFILEDIR}/dmdirc.config ]; then
168
+	questiondialog "Uninstaller" "A DMDirc profile has been detected (${PROFILEDIR}) Do you want to delete it aswell?"
169
+	if [ $? -eq 0 ]; then
170
+		rm -Rfv "${PROFILEDIR}"
171
+	fi
172
+fi
173
+
174
+messagedialog "Uninstaller" "DMDirc Uninstalled Successfully"
175
+
176
+echo "Done."
177
+
178
+exit 0;

+ 1
- 1
installer/osx/DMDirc-Apple.c View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 72
- 24
installer/osx/makeInstallerOSX.sh View File

3
 # This script generates a .dmg file that includes dmdirc
3
 # This script generates a .dmg file that includes dmdirc
4
 #
4
 #
5
 # DMDirc - Open Source IRC Client
5
 # DMDirc - Open Source IRC Client
6
-# Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
6
+# Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
7
 #
7
 #
8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
9
 # of this software and associated documentation files (the "Software"), to deal
9
 # of this software and associated documentation files (the "Software"), to deal
28
 # full name of the file to output to
28
 # full name of the file to output to
29
 RUNNAME="${PWD}/${INSTALLERNAME}.dmg"
29
 RUNNAME="${PWD}/${INSTALLERNAME}.dmg"
30
 
30
 
31
+# Are we a git working copy, or SVN?
32
+if [ -e ".svn" ]; then
33
+	isSVN=1
34
+else
35
+	isSVN=0
36
+fi;
37
+
31
 # Linux needs an entry in fstab to allow normal users to mount things (like a
38
 # Linux needs an entry in fstab to allow normal users to mount things (like a
32
 # dmg image).
39
 # dmg image).
33
 # These 2 config vars choose what dir and file we mount so that fstab can be
40
 # These 2 config vars choose what dir and file we mount so that fstab can be
105
 	echo "-c, --compile             Recompile the .jar file"
112
 	echo "-c, --compile             Recompile the .jar file"
106
 	echo "    --jar <file>          use <file> as DMDirc.jar"
113
 	echo "    --jar <file>          use <file> as DMDirc.jar"
107
 	echo "    --current             Use the current folder as the base for the build"
114
 	echo "    --current             Use the current folder as the base for the build"
108
-	echo "-t, --tag <tag>           Tag to add to final exe name to distinguish this build from a standard build"
115
+	echo "-e, --extra <tag>         Tag to add to final exe name to distinguish this build from a standard build"
109
 	echo "-k, --keep                Keep the existing source tree when compiling"
116
 	echo "-k, --keep                Keep the existing source tree when compiling"
110
 	echo "                          (don't svn update beforehand)"
117
 	echo "                          (don't svn update beforehand)"
111
 	echo "---------------------"
118
 	echo "---------------------"
119
 finalTag=""
126
 finalTag=""
120
 BRANCH="0"
127
 BRANCH="0"
121
 plugins=""
128
 plugins=""
122
-location="../../../"
129
+if [ $isSVN -eq 1 ]; then
130
+	location="../../../"
131
+	current=""
132
+else
133
+	location="../../"
134
+	current="1"
135
+fi;
123
 jarfile=""
136
 jarfile=""
124
-current=""
137
+TAGGED=""
125
 while test -n "$1"; do
138
 while test -n "$1"; do
126
 	case "$1" in
139
 	case "$1" in
127
 		--plugins|-p)
140
 		--plugins|-p)
143
 			shift
156
 			shift
144
 			isRelease=${1}
157
 			isRelease=${1}
145
 			;;
158
 			;;
146
-		--tag|-t)
159
+		--extra|-e)
147
 			shift
160
 			shift
148
 			finalTag=${1}
161
 			finalTag=${1}
149
 			RUNNAME="${PWD}/${INSTALLERNAME}-${1}.dmg"
162
 			RUNNAME="${PWD}/${INSTALLERNAME}-${1}.dmg"
157
 		--branch|-b)
170
 		--branch|-b)
158
 			BRANCH="1"
171
 			BRANCH="1"
159
 			;;
172
 			;;
173
+		--tag|-t)
174
+			shift
175
+			REGEX="^[0-9]+(\.[0-9]+(\.[0-9]+)?)?$"
176
+			CHECKTAG=`echo ${1} | egrep "${REGEX}"`
177
+			if [ "" = "${CHECKTAG}" ]; then
178
+				echo "Specified tag ("${1}") is invalid."
179
+				exit 1;
180
+			fi;
181
+			TAGGED="${1}"
182
+			;;
160
 	esac
183
 	esac
161
 	shift
184
 	shift
162
 done
185
 done
166
 	jarPath="${location}"
189
 	jarPath="${location}"
167
 fi
190
 fi
168
 if [ "${isRelease}" != "" ]; then
191
 if [ "${isRelease}" != "" ]; then
169
-	if [ "${BRANCH}" != "0" ]; then
170
-		if [ -e "${location}/${isRelease}" ]; then
171
-			jarPath="${location}/${isRelease}"
192
+	if [ $isSVN -eq 1 ]; then
193
+		if [ "${BRANCH}" != "0" ]; then
194
+			if [ -e "${location}/${isRelease}" ]; then
195
+				jarPath="${location}/${isRelease}"
196
+			else
197
+				echo "Branch "${isRelease}" not found."
198
+				exit 1;
199
+			fi
172
 		else
200
 		else
173
-			echo "Branch "${isRelease}" not found."
174
-			exit 1;
175
-		fi
176
-	else
177
-		if [ -e "${location}/${isRelease}" ]; then
178
-			jarPath="${location}/${isRelease}"
179
-		else
180
-			echo "Tag "${isRelease}" not found."
181
-			exit 1;
201
+			if [ -e "${location}/${isRelease}" ]; then
202
+				jarPath="${location}/${isRelease}"
203
+			else
204
+				echo "Tag "${isRelease}" not found."
205
+				exit 1;
206
+			fi
182
 		fi
207
 		fi
183
 	fi
208
 	fi
184
 fi
209
 fi
238
 echo "Creating meta files"
263
 echo "Creating meta files"
239
 echo "APPLDMDI" > ${CONTENTSDIR}/PkgInfo
264
 echo "APPLDMDI" > ${CONTENTSDIR}/PkgInfo
240
 
265
 
266
+doRename=0
241
 if [ "${isRelease}" != "" ]; then
267
 if [ "${isRelease}" != "" ]; then
242
-	if [ "${BRANCH}" = "1" ]; then
243
-		bundleVersion=branch-${isRelease}
268
+	doRename=1
269
+elif [ $isSVN -eq 0 -a "${TAGGED}" != "" ]; then
270
+	doRename=1	
271
+fi;
272
+
273
+if [ ${doRename} -eq 1 ]; then
274
+	if [ $isSVN -eq 1 ]; then
275
+		if [ "${BRANCH}" = "1" ]; then
276
+			bundleVersion=branch-${isRelease}
277
+		else
278
+			bundleVersion=${isRelease}
279
+		fi;
244
 	else
280
 	else
245
-		bundleVersion=${isRelease}
281
+		if [ "${TAGGED}" = "" ]; then
282
+			bundleVersion=branch-${isRelease}
283
+		else
284
+			bundleVersion=${TAGGED}
285
+		fi;
246
 	fi
286
 	fi
247
 else
287
 else
248
 	bundleVersion="trunk-"`date +%Y%m%d_%H%M%S`
288
 	bundleVersion="trunk-"`date +%Y%m%d_%H%M%S`
436
 
476
 
437
 echo "DMG Creation complete!"
477
 echo "DMG Creation complete!"
438
 
478
 
439
-if [ "${isRelease}" != "" ]; then
440
-	if [ "${BRANCH}" = "1" ]; then
441
-		isRelease=branch-${isRelease}
442
-	fi;
479
+if [ ${doRename} -eq 1 ]; then
480
+	if [ $isSVN -eq 1 ]; then
481
+		if [ "${BRANCH}" = "1" ]; then
482
+			isRelease=branch-${isRelease}
483
+		fi;
484
+	else
485
+		if [ "${TAGGED}" = "" ]; then
486
+			isRelease=branch-${isRelease}
487
+		else
488
+			isRelease=${TAGGED}
489
+		fi;
490
+	fi
443
 	if [ "" != "${finalTag}" ]; then
491
 	if [ "" != "${finalTag}" ]; then
444
 		finalTag="-${finalTag}"
492
 		finalTag="-${finalTag}"
445
 	fi;
493
 	fi;

+ 88
- 48
installer/release.sh View File

1
 #!/bin/sh
1
 #!/bin/sh
2
 
2
 
3
 # Jar names of plugins to add to ALL installers. (* means all)
3
 # Jar names of plugins to add to ALL installers. (* means all)
4
-plugins="dcc.jar dns.jar identd.jar lagdisplay.jar logging.jar systray.jar timeplugin.jar osdplugin.jar"
4
+plugins="ui_swing.jar ui_dummy.jar dcc.jar dns.jar identd.jar lagdisplay.jar logging.jar systray.jar timeplugin.jar osdplugin.jar"
5
 
5
 
6
 # Additional Jar names of plugins to add to only Windows installers. (* means all)
6
 # Additional Jar names of plugins to add to only Windows installers. (* means all)
7
 plugins_windows=""
7
 plugins_windows=""
12
 # Additional Jar names of plugins to add to only osx installers. (* means all)
12
 # Additional Jar names of plugins to add to only osx installers. (* means all)
13
 plugins_osx=""
13
 plugins_osx=""
14
 
14
 
15
+# Are we a git working copy, or SVN?
16
+if [ -e ".svn" ]; then
17
+	isSVN=1
18
+else
19
+	isSVN=0
20
+fi;
21
+
22
+
15
 showHelp() {
23
 showHelp() {
16
 	echo "This will generate the different DMDirc installers."
24
 	echo "This will generate the different DMDirc installers."
17
-	echo "Usage: ${0} [params] <release>"
18
-	echo "Release can be either 'trunk', 'this', a valid tag, or a branch (if -b is passed)"
25
+	if [ ${isSVN} -eq 1 ]; then
26
+		echo "Usage: ${0} [params] <release>"
27
+		echo "Release can be either 'trunk', 'this', a valid tag, or a branch (if -b is passed)"
28
+	else
29
+		echo "Usage: ${0} [params]"
30
+	fi;
19
 	echo "The following params are known:"
31
 	echo "The following params are known:"
20
 	echo "---------------------"
32
 	echo "---------------------"
21
-	echo "-b,  --branch                       <release> is a branch"
33
+	if [ ${isSVN} -eq 1 ]; then
34
+		echo "-b,  --branch                       <release> is a branch"
35
+	else
36
+		echo "-t,  --tag <release>                This is a tagged release"
37
+	fi;
22
 	echo "     --jar <file>                   Use <file> instead of compiling a jar."
38
 	echo "     --jar <file>                   Use <file> instead of compiling a jar."
23
 	echo "     --fulljar <file>               Use <file> instead of compiling a jar, and don't run makeJar on it."
39
 	echo "     --fulljar <file>               Use <file> instead of compiling a jar, and don't run makeJar on it."
24
 	echo "     --jre                          Include a jre in the installers."
40
 	echo "     --jre                          Include a jre in the installers."
45
 BUILDTARGET=""
61
 BUILDTARGET=""
46
 UPLOAD="0"
62
 UPLOAD="0"
47
 TAG="0"
63
 TAG="0"
64
+TAGGED=""
48
 while test -n "$1"; do
65
 while test -n "$1"; do
49
 	LAST=${1}
66
 	LAST=${1}
50
 	case "$1" in
67
 	case "$1" in
93
 		--branch|-b)
110
 		--branch|-b)
94
 			BRANCH="-b "
111
 			BRANCH="-b "
95
 			;;
112
 			;;
113
+		--tag|-t)
114
+			shift
115
+			REGEX="^[0-9]+(\.[0-9]+(\.[0-9]+)?)?$"
116
+			CHECKTAG=`echo ${1} | egrep "${REGEX}"`
117
+			if [ "" = "${CHECKTAG}" ]; then
118
+				echo "Specified tag ("${1}") is invalid."
119
+				exit 1;
120
+			fi;
121
+			TAGGED="-t ${1} "
122
+			;;
96
 	esac
123
 	esac
97
 	shift
124
 	shift
98
 done
125
 done
99
 
126
 
127
+if [ ! -e output ]; then
128
+	mkdir output
129
+fi;
130
+
100
 if [ "${plugins}" = "*" -o "${plugins_linux}" = "*" -o "${plugins_windows}" = "*" -o "${plugins_osx}" = "*" ]; then
131
 if [ "${plugins}" = "*" -o "${plugins_linux}" = "*" -o "${plugins_windows}" = "*" -o "${plugins_osx}" = "*" ]; then
101
 	echo "Something is all.";
132
 	echo "Something is all.";
102
 	allPlugins=""
133
 	allPlugins=""
109
 	if [ "${plugins_osx}" = "*" ]; then plugins_osx=${allPlugins}; fi
140
 	if [ "${plugins_osx}" = "*" ]; then plugins_osx=${allPlugins}; fi
110
 fi;
141
 fi;
111
 
142
 
112
-VERSION=""
113
-if [ "${LAST}" != "" ]; then
114
-	if [ "${LAST}" = "trunk" ]; then
115
-		VERSION="Trunk"
116
-		RELEASE=""
117
-	elif [ "${LAST}" = "this" ]; then
118
-		# Work out what type of build this is!
119
-		thisDIR=${PWD}
120
-		cd ..
121
-		tempDIR=${PWD##*/}
122
-		if [ "${tempDIR}" = "trunk" ]; then
143
+if [ ${isSVN} -eq 1 ]; then
144
+	VERSION=""
145
+	if [ "${LAST}" != "" ]; then
146
+		if [ "${LAST}" = "trunk" ]; then
123
 			VERSION="Trunk"
147
 			VERSION="Trunk"
124
-			echo "This is a trunk release.";
125
-		else
126
-			echo "This is not a trunk release.";
127
-			VERSION=${tempDIR}
148
+			RELEASE=""
149
+		elif [ "${LAST}" = "this" ]; then
150
+			# Work out what type of build this is!
151
+			thisDIR=${PWD}
128
 			cd ..
152
 			cd ..
129
 			tempDIR=${PWD##*/}
153
 			tempDIR=${PWD##*/}
130
-			if [ "${tempDIR}" = "tags" ]; then
131
-				echo "Release of tag "${version}
132
-				RELEASE="-r "${VERSION}
133
-				TAG="1"
134
-			elif [ "${tempDIR}" = "branches" ]; then
135
-				echo "Release of branch "${version}
136
-				BRANCH="-b "
137
-				RELEASE="-r "${VERSION}
154
+			if [ "${tempDIR}" = "trunk" ]; then
155
+				VERSION="Trunk"
156
+				echo "This is a trunk release.";
138
 			else
157
 			else
139
-				VERSION="Unknown"
140
-				echo "Unknown release target - Building as trunk build"
141
-				OPT="--current ${OPT}"
142
-			fi
143
-		fi;
144
-		cd ${thisDIR}
145
-	elif [ "${BRANCH}" != "" -a ! -e "../../branches/"${LAST} ]; then
146
-		echo "Branch '"${LAST}"' not found."
147
-		exit 1;
148
-	elif [ "${BRANCH}" = "" -a ! -e "../../tags/"${LAST} ]; then
149
-		echo "Tag '"${LAST}"' not found."
150
-		exit 1;
158
+				echo "This is not a trunk release.";
159
+				VERSION=${tempDIR}
160
+				cd ..
161
+				tempDIR=${PWD##*/}
162
+				if [ "${tempDIR}" = "tags" ]; then
163
+					echo "Release of tag "${version}
164
+					RELEASE="-r "${VERSION}
165
+					TAG="1"
166
+				elif [ "${tempDIR}" = "branches" ]; then
167
+					echo "Release of branch "${version}
168
+					BRANCH="-b "
169
+					RELEASE="-r "${VERSION}
170
+				else
171
+					VERSION="Unknown"
172
+					echo "Unknown release target - Building as trunk build"
173
+					OPT="--current ${OPT}"
174
+				fi
175
+			fi;
176
+			cd ${thisDIR}
177
+		elif [ "${BRANCH}" != "" -a ! -e "../../branches/"${LAST} ]; then
178
+			echo "Branch '"${LAST}"' not found."
179
+			exit 1;
180
+		elif [ "${BRANCH}" = "" -a ! -e "../../tags/"${LAST} ]; then
181
+			echo "Tag '"${LAST}"' not found."
182
+			exit 1;
183
+		else
184
+			RELEASE="-r "${LAST}
185
+		fi
151
 	else
186
 	else
152
-		RELEASE="-r "${LAST}
187
+		echo "Usage: ${0} [params] <release>"
188
+		echo "Release can be either 'this', 'trunk' or a valid tag. (see ${0} --help for further information)"
189
+		exit 1;
153
 	fi
190
 	fi
154
 else
191
 else
155
-	echo "Usage: ${0} [params] <release>"
156
-	echo "Release can be either 'this', 'trunk' or a valid tag. (see ${0} --help for further information)"
157
-	exit 1;
158
-fi
192
+	VERSION=`git branch | grep ^* | sed "s/^* //g"`
193
+	if [ "${VERSION}" = "master" ]; then
194
+		RELEASE=""
195
+	else
196
+		RELEASE="-r ${VERSION}"
197
+	fi;
198
+fi;
159
 
199
 
160
 JAR=`which jar`
200
 JAR=`which jar`
161
 JAVAC=`which javac`
201
 JAVAC=`which javac`
196
 	echo "Building Release Jar"
236
 	echo "Building Release Jar"
197
 	echo "================================================================"
237
 	echo "================================================================"
198
 	cd jar
238
 	cd jar
199
-	./makeJar.sh ${OPT}${JARFILE}${JRE}-c -k -s ${BRANCH}${RELEASE} -p "${plugins}"
239
+	./makeJar.sh ${OPT}${JARFILE}${JRE}-c -k -s ${TAGGED}${BRANCH}${RELEASE} -p "${plugins}"
200
 	RESULT=${?}
240
 	RESULT=${?}
201
 	cd ${THISDIR}
241
 	cd ${THISDIR}
202
 
242
 
214
 	echo "Building linux installer"
254
 	echo "Building linux installer"
215
 	echo "================================================================"
255
 	echo "================================================================"
216
 	cd linux
256
 	cd linux
217
-	./makeInstallerLinux.sh ${OPT}${JARFILE}${JRE}-k ${BRANCH}${RELEASE} -p "${plugins_linux}"
257
+	./makeInstallerLinux.sh ${OPT}${JARFILE}${JRE}-k ${TAGGED}${BRANCH}${RELEASE} -p "${plugins_linux}"
218
 	cd ${THISDIR}
258
 	cd ${THISDIR}
219
 fi;
259
 fi;
220
 
260
 
223
 	echo "Building Windows installer"
263
 	echo "Building Windows installer"
224
 	echo "================================================================"
264
 	echo "================================================================"
225
 	cd windows
265
 	cd windows
226
-	./makeInstallerWindows.sh ${OPT}${JARFILE}${JRE}-k -s ${BRANCH}${RELEASE} -p "${plugins_windows}"
266
+	./makeInstallerWindows.sh ${OPT}${JARFILE}${JRE}-k -s ${TAGGED}${BRANCH}${RELEASE} -p "${plugins_windows}"
227
 	cd ${THISDIR}
267
 	cd ${THISDIR}
228
 fi;
268
 fi;
229
 
269
 
232
 	echo "Building OSX Bundle"
272
 	echo "Building OSX Bundle"
233
 	echo "================================================================"
273
 	echo "================================================================"
234
 	cd osx
274
 	cd osx
235
-	./makeInstallerOSX.sh ${OPT}${JARFILE}-k -s ${BRANCH}${RELEASE} -p "${plugins_osx}"
275
+	./makeInstallerOSX.sh ${OPT}${JARFILE}-k -s ${TAGGED}${BRANCH}${RELEASE} -p "${plugins_osx}"
236
 	cd ${THISDIR}
276
 	cd ${THISDIR}
237
 fi;
277
 fi;
238
 
278
 

+ 1
- 1
installer/windows/Launcher.dpr View File

2
  * This application launches the dmdirc java-based installer.
2
  * This application launches the dmdirc java-based installer.
3
  * 
3
  * 
4
  * DMDirc - Open Source IRC Client
4
  * DMDirc - Open Source IRC Client
5
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
5
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
6
  * 
6
  * 
7
  * Permission is hereby granted, free of charge, to any person obtaining a copy
7
  * Permission is hereby granted, free of charge, to any person obtaining a copy
8
  * of this software and associated documentation files (the "Software"), to deal
8
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
installer/windows/Setup.dpr View File

2
  * This application launches the dmdirc java-based installer.
2
  * This application launches the dmdirc java-based installer.
3
  * 
3
  * 
4
  * DMDirc - Open Source IRC Client
4
  * DMDirc - Open Source IRC Client
5
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
5
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
6
  * 
6
  * 
7
  * Permission is hereby granted, free of charge, to any person obtaining a copy
7
  * Permission is hereby granted, free of charge, to any person obtaining a copy
8
  * of this software and associated documentation files (the "Software"), to deal
8
  * of this software and associated documentation files (the "Software"), to deal

+ 86
- 34
installer/windows/makeInstallerWindows.sh View File

3
 # This script generates a .exe file that will install DMDirc
3
 # This script generates a .exe file that will install DMDirc
4
 #
4
 #
5
 # DMDirc - Open Source IRC Client
5
 # DMDirc - Open Source IRC Client
6
-# Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
6
+# Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
7
 #
7
 #
8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
9
 # of this software and associated documentation files (the "Software"), to deal
9
 # of this software and associated documentation files (the "Software"), to deal
35
 # Get 7zip path
35
 # Get 7zip path
36
 ZIP=`which 7z`
36
 ZIP=`which 7z`
37
 
37
 
38
+# Are we a git working copy, or SVN?
39
+if [ -e ".svn" ]; then
40
+	isSVN=1
41
+else
42
+	isSVN=0
43
+fi;
44
+
38
 if [ "" = "${ZIP}" ]; then
45
 if [ "" = "${ZIP}" ]; then
39
 	echo "7Zip not found, failing."
46
 	echo "7Zip not found, failing."
40
 	exit 1;
47
 	exit 1;
98
 compilerFlags="-Xs -XX -O2 -Or -Op1"
105
 compilerFlags="-Xs -XX -O2 -Or -Op1"
99
 BRANCH="0"
106
 BRANCH="0"
100
 plugins=""
107
 plugins=""
101
-location="../../../"
108
+if [ $isSVN -eq 1 ]; then
109
+	location="../../../"
110
+	current=""
111
+else
112
+	location="../../"
113
+	current="1"
114
+fi;
102
 jarfile=""
115
 jarfile=""
103
-current=""
104
 jre=""
116
 jre=""
105
 jrename="jre" # Filename for JRE without the .exe
117
 jrename="jre" # Filename for JRE without the .exe
118
+TAGGED=""
106
 
119
 
107
 showHelp() {
120
 showHelp() {
108
 	echo "This will generate a DMDirc installer for a windows based system."
121
 	echo "This will generate a DMDirc installer for a windows based system."
112
 	echo "-r, --release <version>   Generate a file based on an svn tag (or branch with -b aswell)"
125
 	echo "-r, --release <version>   Generate a file based on an svn tag (or branch with -b aswell)"
113
 	echo "-b, --branch              Release in -r is a branch "
126
 	echo "-b, --branch              Release in -r is a branch "
114
 	echo "-s, --setup               Recompile the .exe file"
127
 	echo "-s, --setup               Recompile the .exe file"
115
-	echo "-e,                       If setup.exe compile fails, use old version"
128
+	echo "-o,                       If setup.exe compile fails, use old version"
116
 	echo "-p, --plugins <plugins>   What plugins to add to the jar file"
129
 	echo "-p, --plugins <plugins>   What plugins to add to the jar file"
117
 	echo "-c, --compile             Recompile the .jar file"
130
 	echo "-c, --compile             Recompile the .jar file"
118
 	echo "-u, --unsigned            Don't sign the exe"
131
 	echo "-u, --unsigned            Don't sign the exe"
119
-	echo "-t, --tag <tag>           Tag to add to final exe name to distinguish this build from a standard build"
132
+	echo "-e, --extra <tag>         Tag to add to final exe name to distinguish this build from a standard build"
120
 	echo "-f, --flags <flags>       Extra flags to pass to the compiler"
133
 	echo "-f, --flags <flags>       Extra flags to pass to the compiler"
121
 	echo "    --jre                 Include the JRE in this installer"
134
 	echo "    --jre                 Include the JRE in this installer"
122
 	echo "    --jar <file>          use <file> as DMDirc.jar"
135
 	echo "    --jar <file>          use <file> as DMDirc.jar"
160
 		--setup|-s)
173
 		--setup|-s)
161
 			compileSetup="true"
174
 			compileSetup="true"
162
 			;;
175
 			;;
163
-		-e)
176
+		-o)
164
 			useOldSetup="true"
177
 			useOldSetup="true"
165
 			;;
178
 			;;
166
 		--release|-r)
179
 		--release|-r)
167
 			shift
180
 			shift
168
 			isRelease=${1}
181
 			isRelease=${1}
169
 			;;
182
 			;;
170
-		--tag|-t)
183
+		--extra|-e)
171
 			shift
184
 			shift
172
 			finalTag="-${1}"
185
 			finalTag="-${1}"
173
 			;;
186
 			;;
190
 		--branch|-b)
203
 		--branch|-b)
191
 			BRANCH="1"
204
 			BRANCH="1"
192
 			;;
205
 			;;
206
+		--tag|-t)
207
+			shift
208
+			REGEX="^[0-9]+(\.[0-9]+(\.[0-9]+)?)?$"
209
+			CHECKTAG=`echo ${1} | egrep "${REGEX}"`
210
+			if [ "" = "${CHECKTAG}" ]; then
211
+				echo "Specified tag ("${1}") is invalid."
212
+				exit 1;
213
+			fi;
214
+			TAGGED="${1}"
215
+			;;
193
 	esac
216
 	esac
194
 	shift
217
 	shift
195
 done
218
 done
212
 	jarPath="${location}"
235
 	jarPath="${location}"
213
 fi
236
 fi
214
 if [ "${isRelease}" != "" ]; then
237
 if [ "${isRelease}" != "" ]; then
215
-	if [ "${BRANCH}" != "0" ]; then
216
-		if [ -e "${location}/${isRelease}" ]; then
217
-			jarPath="${location}/${isRelease}"
218
-		else
219
-			echo "Branch "${isRelease}" not found."
220
-			exit 1;
221
-		fi
222
-	else
223
-		if [ -e "${location}/${isRelease}" ]; then
224
-			jarPath="${location}/${isRelease}"
238
+	if [ $isSVN -eq 1 ]; then
239
+		if [ "${BRANCH}" != "0" ]; then
240
+			if [ -e "${location}/${isRelease}" ]; then
241
+				jarPath="${location}/${isRelease}"
242
+			else
243
+				echo "Branch "${isRelease}" not found."
244
+				exit 1;
245
+			fi
225
 		else
246
 		else
226
-			echo "Tag "${isRelease}" not found."
227
-			exit 1;
247
+			if [ -e "${location}/${isRelease}" ]; then
248
+				jarPath="${location}/${isRelease}"
249
+			else
250
+				echo "Tag "${isRelease}" not found."
251
+				exit 1;
252
+			fi
228
 		fi
253
 		fi
229
 	fi
254
 	fi
230
 fi
255
 fi
268
 	rm -Rf plugins;
293
 	rm -Rf plugins;
269
 fi
294
 fi
270
 
295
 
271
-
272
-echo "	ReleaseNumber: String = '${isRelease}';" > SetupConsts.inc
296
+if [ $isSVN -eq 1 -o "${TAGGED}" = "" ]; then
297
+	echo "	ReleaseNumber: String = '${isRelease}';" > SetupConsts.inc
298
+else
299
+	echo "	ReleaseNumber: String = '${TAGGED}';" > SetupConsts.inc
300
+fi;
273
 
301
 
274
 FILES=""
302
 FILES=""
275
 # Icon Res file
303
 # Icon Res file
284
 
312
 
285
 COMPILER_IS_BROKEN="0";
313
 COMPILER_IS_BROKEN="0";
286
 
314
 
315
+if [ $isSVN -eq 1 -o "${TAGGED}" = "" ]; then
316
+	NUM="${1}"
317
+else
318
+	NUM="${TAGGED}"
319
+fi;
320
+
287
 # Version Numbers
321
 # Version Numbers
288
-if [ "" = "${1}" ]; then
322
+if [ "" = "${NUM}" ]; then
289
 	MAJORVER="0"
323
 	MAJORVER="0"
290
 	MINORVER="0"
324
 	MINORVER="0"
291
 	RELEASE="0"
325
 	RELEASE="0"
292
-	TEXTVER="Trunk"
326
+	TEXTVER="${isRelease}"
293
 	PRIVATE="1"
327
 	PRIVATE="1"
294
 	USER=`whoami`
328
 	USER=`whoami`
295
 	HOST=`hostname`
329
 	HOST=`hostname`
296
 	DATE=`date`
330
 	DATE=`date`
297
 else
331
 else
298
-	MAJORVER=${1%%.*}
299
-	SUBVER=${1#*.}
332
+	MAJORVER=${NUM%%.*}
333
+	SUBVER=${NUM#*.}
300
 	DOT=`expr index "${SUBVER}" .`
334
 	DOT=`expr index "${SUBVER}" .`
301
 	if [ "${DOT}" = "0" ]; then
335
 	if [ "${DOT}" = "0" ]; then
302
 		MINORVER=${SUBVER}
336
 		MINORVER=${SUBVER}
305
 		MINORVER=${SUBVER%%.*}
339
 		MINORVER=${SUBVER%%.*}
306
 		RELEASE=${SUBVER##*.}
340
 		RELEASE=${SUBVER##*.}
307
 	fi
341
 	fi
308
-	TEXTVER=$1
342
+	TEXTVER=$NUM
309
 	PRIVATE="0"
343
 	PRIVATE="0"
310
 fi;
344
 fi;
311
 
345
 
346
 
380
 
347
 echo "			VALUE \"FileVersion\", \"2.0\"" > version.rc.2
381
 echo "			VALUE \"FileVersion\", \"2.0\"" > version.rc.2
348
 echo "			VALUE \"InternalName\", \"DMDirc.jar\"" >> version.rc.2
382
 echo "			VALUE \"InternalName\", \"DMDirc.jar\"" >> version.rc.2
349
-echo "			VALUE \"LegalCopyright\", \"Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes\"" >> version.rc.2
383
+echo "			VALUE \"LegalCopyright\", \"Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes\"" >> version.rc.2
350
 echo "			VALUE \"OriginalFilename\", \"$2\"" >> version.rc.2
384
 echo "			VALUE \"OriginalFilename\", \"$2\"" >> version.rc.2
351
 echo "			VALUE \"ProductName\", \"DMDirc\"" >> version.rc.2
385
 echo "			VALUE \"ProductName\", \"DMDirc\"" >> version.rc.2
352
 echo "			VALUE \"ProductVersion\", \"${TEXTVER}\"" >> version.rc.2
386
 echo "			VALUE \"ProductVersion\", \"${TEXTVER}\"" >> version.rc.2
517
 echo ";!@Install@!UTF-8!" > 7zip.conf
551
 echo ";!@Install@!UTF-8!" > 7zip.conf
518
 if [ "${isRelease}" != "" ]; then
552
 if [ "${isRelease}" != "" ]; then
519
 	echo "Title=\"DMDirc Installation "${isRelease}"\"" >> 7zip.conf
553
 	echo "Title=\"DMDirc Installation "${isRelease}"\"" >> 7zip.conf
520
-#	echo "BeginPrompt=\"Do you want to install DMDirc "${isRelease}"?\"" >> 7zip.conf
554
+	echo "BeginPrompt=\"Do you want to install DMDirc "${isRelease}"?\"" >> 7zip.conf
555
+elif [ "${TAGGED}" != "" ]; then
556
+	echo "Title=\"DMDirc Installation "${TAGGED}"\"" >> 7zip.conf
557
+	echo "BeginPrompt=\"Do you want to install DMDirc "${TAGGED}"?\"" >> 7zip.conf
521
 else
558
 else
522
-	echo "Title=\"DMDirc Installation\"" > 7zip.conf
523
-#	echo "BeginPrompt=\"Do you want to install DMDirc?\"" >> 7zip.conf
559
+	echo "Title=\"DMDirc Installation\"" >> 7zip.conf
560
+	echo "BeginPrompt=\"Do you want to install DMDirc?\"" >> 7zip.conf
524
 fi;
561
 fi;
525
 echo "ExecuteFile=\"Setup.exe\"" >> 7zip.conf
562
 echo "ExecuteFile=\"Setup.exe\"" >> 7zip.conf
526
 echo ";!@InstallEnd@!" >> 7zip.conf
563
 echo ";!@InstallEnd@!" >> 7zip.conf
538
 echo "Creating .exe"
575
 echo "Creating .exe"
539
 cat 7zS.sfx 7zip.conf "${INTNAME}" > "${RUNNAME}"
576
 cat 7zS.sfx 7zip.conf "${INTNAME}" > "${RUNNAME}"
540
 
577
 
578
+doRename=0
541
 if [ "${isRelease}" != "" ]; then
579
 if [ "${isRelease}" != "" ]; then
542
-	if [ "${BRANCH}" = "1" ]; then
543
-		releaseTag=branch-${isRelease}
580
+	doRename=1
581
+elif [ $isSVN -eq 0 -a "${TAGGED}" != "" ]; then
582
+	doRename=1
583
+fi;
584
+
585
+if [ ${doRename} -eq 1 ]; then
586
+	if [ $isSVN -eq 1 ]; then
587
+		if [ "${BRANCH}" = "1" ]; then
588
+			releaseTag=branch-${isRelease}
589
+		else
590
+			releaseTag=${isRelease}
591
+		fi;
544
 	else
592
 	else
545
-		releaseTag=${isRelease};
546
-	fi;
593
+		if [ "${TAGGED}" = "" ]; then
594
+			releaseTag=branch-${isRelease}
595
+		else
596
+			releaseTag=${TAGGED}
597
+		fi;
598
+	fi
547
 	ORIGNAME="DMDirc-${releaseTag}-Setup${finalTag}.exe"
599
 	ORIGNAME="DMDirc-${releaseTag}-Setup${finalTag}.exe"
548
 else
600
 else
549
 	ORIGNAME="${INSTALLNAME}${finalTag}.exe"
601
 	ORIGNAME="${INSTALLNAME}${finalTag}.exe"

+ 45
- 25
launcher/unix/DMDirc.sh View File

3
 # This script launches dmdirc and attempts to update the jar file if needed.
3
 # This script launches dmdirc and attempts to update the jar file if needed.
4
 #
4
 #
5
 # DMDirc - Open Source IRC Client
5
 # DMDirc - Open Source IRC Client
6
-# Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
6
+# Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
7
 #
7
 #
8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
9
 # of this software and associated documentation files (the "Software"), to deal
9
 # of this software and associated documentation files (the "Software"), to deal
168
 	jar=`dirname $0`/DMDirc.jar
168
 	jar=`dirname $0`/DMDirc.jar
169
 fi
169
 fi
170
 launcherUpdater=${profiledir}/updateLauncher.sh
170
 launcherUpdater=${profiledir}/updateLauncher.sh
171
+BSDJava1="/usr/local/jdk1.6.0/jre/bin/java"
172
+BSDJava2="/usr/local/diablo-jdk1.6.0/jre/bin/java"
171
 echo "---------------------"
173
 echo "---------------------"
172
 echo "DMDirc - Open Source IRC Client"
174
 echo "DMDirc - Open Source IRC Client"
173
 echo "Launcher Version: ${LAUNCHERVERSION}"
175
 echo "Launcher Version: ${LAUNCHERVERSION}"
174
-echo "Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes"
176
+echo "Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes"
175
 echo "---------------------"
177
 echo "---------------------"
176
 if [ "${ISOSX}" = "1" ]; then
178
 if [ "${ISOSX}" = "1" ]; then
177
 	echo "Running on OS X."
179
 	echo "Running on OS X."
344
 		JAVA="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java"
346
 		JAVA="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java"
345
 	fi;
347
 	fi;
346
 else
348
 else
347
-	# Location where ports on FreeBSD/PCBSD installs java6
348
-	# check it first, because it isn't added to the path automatically
349
-	JAVA="/usr/local/jdk1.6.0/jre/bin/java"
349
+	if [ -e "${HOME}/.profile" ]; then
350
+		# Source the profile incase java can't be found otherwise
351
+		. ${HOME}/.profile
352
+	fi;
353
+	JAVA=`which java`
350
 	if [ ! -e "${JAVA}" ]; then
354
 	if [ ! -e "${JAVA}" ]; then
351
-		# Try alternative BSD Location
352
-		JAVA="/usr/local/diablo-jdk1.6.0/jre/bin/java"
355
+		# Location where ports on FreeBSD/PCBSD installs java6
356
+		# check it first, because it isn't added to the path automatically
357
+		JAVA=${BSDJava1}
353
 		if [ ! -e "${JAVA}" ]; then
358
 		if [ ! -e "${JAVA}" ]; then
354
-			# Look in path
355
-			if [ -e "${HOME}/.profile" ]; then
356
-				# Source the profile incase java can't be found otherwise
357
-				. ${HOME}/.profile
358
-			fi;
359
-			JAVA=`which java`
360
-		fi
361
-	fi
359
+			# Try alternative BSD Location
360
+			JAVA=${BSDJava2}
361
+		fi;
362
+	fi;
362
 fi;
363
 fi;
363
 
364
 
364
 if [ "" != "${JAVA}" ]; then
365
 if [ "" != "${JAVA}" ]; then
384
 	# error message to be printed.
385
 	# error message to be printed.
385
 	${JAVA} -jar ${jar} --help >/dev/null 2>&1
386
 	${JAVA} -jar ${jar} --help >/dev/null 2>&1
386
 	if [ $? -ne 0 ]; then
387
 	if [ $? -ne 0 ]; then
387
-		echo "Failed."
388
-		ERROR="Sorry, the currently installed version of java is not compatible with DMDirc.";
389
-		ERROR=${ERROR}"\n";
390
-		if [ "${ISOSX}" = "1" ]; then
391
-			ERROR=${ERROR}"\nDMDirc requires a 1.6.0 compatible JVM.";
392
-		else
393
-			ERROR=${ERROR}"\nDMDirc requires a 1.6.0 compatible JVM, you can get one from: http://www.java.com";
394
-			ERROR=${ERROR}"\nor reinstall DMDirc and let the installer install one for you.";
388
+		FAILED=1
389
+		# If we are on BSD, check to see if there is alternative versions of java
390
+		# than the one in the path.
391
+		if [ "`echo ${KERNEL} | grep -i BSD`" != "" ]; then
392
+			if [ "${JAVA}" != "${BSDJava1}" -a "${JAVA}" != "${BSDJava2}" ]; then
393
+				JAVA=${BSDJava1}
394
+				if [ ! -e "${JAVA}" ]; then
395
+					JAVA=${BSDJava2}
396
+				fi;
397
+				# Now check to see if DMDirc runs again.
398
+				${JAVA} -jar ${jar} --help >/dev/null 2>&1
399
+				if [ $? -eq 0 ]; then
400
+					# It runs!
401
+					FAILED=0
402
+				fi;
403
+			fi;
404
+		fi;
405
+		if [ ${FAILED} -eq 1 ]; then
406
+			echo "Failed."
407
+			ERROR="Sorry, the currently installed version of java is not compatible with DMDirc.";
408
+			ERROR=${ERROR}"\n";
409
+			if [ "${ISOSX}" = "1" ]; then
410
+				ERROR=${ERROR}"\nDMDirc requires a 1.6.0 compatible JVM.";
411
+			else
412
+				ERROR=${ERROR}"\nDMDirc requires a 1.6.0 compatible JVM, you can get one from: http://www.java.com";
413
+				ERROR=${ERROR}"\nor reinstall DMDirc and let the installer install one for you.";
414
+			fi;
415
+			errordialog "Unable to launch dmdirc!" "${ERROR}";
416
+			exit 1;
395
 		fi;
417
 		fi;
396
-		errordialog "Unable to launch dmdirc!" "${ERROR}";
397
-		exit 1;
398
 	fi
418
 	fi
399
 
419
 
400
 	# Now we can run the client for real, this allows stderr/stdout output
420
 	# Now we can run the client for real, this allows stderr/stdout output

BIN
launcher/windows/DMDirc.exe View File


BIN
launcher/windows/DMDircUpdater.exe View File


+ 1
- 1
launcher/windows/version.rc View File

15
 			VALUE "FileDescription", "Launcher for DMDirc"
15
 			VALUE "FileDescription", "Launcher for DMDirc"
16
 			VALUE "FileVersion", "2.0"
16
 			VALUE "FileVersion", "2.0"
17
 			VALUE "InternalName", "DMDirc.exe"
17
 			VALUE "InternalName", "DMDirc.exe"
18
-			VALUE "LegalCopyright", "Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes"
18
+			VALUE "LegalCopyright", "Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes"
19
 			VALUE "OriginalFilename", "$2"
19
 			VALUE "OriginalFilename", "$2"
20
 			VALUE "ProductName", "DMDirc Launcher"
20
 			VALUE "ProductName", "DMDirc Launcher"
21
 		END
21
 		END

BIN
lib/junit-3.8.1.jar View File


BIN
lib/miglayout-3.6.3.jar View File


+ 0
- 6
nbproject/build-impl.xml View File

57
                 </not>
57
                 </not>
58
             </and>
58
             </and>
59
         </condition>
59
         </condition>
60
-        <condition property="manifest.available+main.class+mkdist.available">
61
-            <and>
62
-                <istrue value="${manifest.available+main.class}"/>
63
-                <isset property="libs.CopyLibs.classpath"/>
64
-            </and>
65
-        </condition>
66
         <condition property="have.tests">
60
         <condition property="have.tests">
67
             <or>
61
             <or>
68
                 <available file="${test.src.dir}"/>
62
                 <available file="${test.src.dir}"/>

+ 7
- 11
nbproject/project.properties View File

1
-application.title=DMDirc
2
-application.vendor=greboid
3
 file.reference.fest-assert-1.0a1.jar=lib/fest-assert-1.0a1.jar
1
 file.reference.fest-assert-1.0a1.jar=lib/fest-assert-1.0a1.jar
4
 file.reference.fest-reflect-0.4.jar=lib/fest-reflect-0.4.jar
2
 file.reference.fest-reflect-0.4.jar=lib/fest-reflect-0.4.jar
5
 file.reference.fest-swing-1.0b1.jar=lib/fest-swing-1.0b1.jar
3
 file.reference.fest-swing-1.0b1.jar=lib/fest-swing-1.0b1.jar
6
 file.reference.fest-swing-junit-1.0b1.jar=lib/fest-swing-junit-1.0b1.jar
4
 file.reference.fest-swing-junit-1.0b1.jar=lib/fest-swing-junit-1.0b1.jar
7
 file.reference.fest-util-0.4.jar=lib/fest-util-0.4.jar
5
 file.reference.fest-util-0.4.jar=lib/fest-util-0.4.jar
8
-
9
-file.reference.junit-4.1.jar=lib/junit-4.1.jar
10
-libs.junit.classpath=/usr/share/java/junit.jar
11
-libs.junit.javadoc=
6
+file.reference.miglayout.jar=lib/miglayout-3.6.3.jar
7
+file.reference.junit-4.jar=lib/junit-4.1.jar
8
+file.reference.junit-3.jar=lib/junit-3.8.1.jar
12
 
9
 
13
 doccheck.path=doccheck.jar
10
 doccheck.path=doccheck.jar
14
 doccheck.dir=reports/doccheck/
11
 doccheck.dir=reports/doccheck/
35
 excludes=
32
 excludes=
36
 includes=**
33
 includes=**
37
 jar.compress=false
34
 jar.compress=false
38
-javac.classpath=
35
+javac.classpath=${file.reference.miglayout.jar}
39
 # Space-separated list of extra javac options
36
 # Space-separated list of extra javac options
40
 javac.compilerargs=-Xlint:all
37
 javac.compilerargs=-Xlint:all
41
 javac.deprecation=true
38
 javac.deprecation=true
44
 javac.test.classpath=\
41
 javac.test.classpath=\
45
     ${javac.classpath}:\
42
     ${javac.classpath}:\
46
     ${build.classes.dir}:\
43
     ${build.classes.dir}:\
47
-    ${libs.junit.classpath}:\
48
-    ${file.reference.junit-4.1.jar}:\
44
+    ${file.reference.junit-4.jar}:\
49
     ${file.reference.fest-swing-junit-1.0b1.jar}:\
45
     ${file.reference.fest-swing-junit-1.0b1.jar}:\
50
     ${file.reference.fest-swing-1.0b1.jar}:\
46
     ${file.reference.fest-swing-1.0b1.jar}:\
51
     ${file.reference.fest-assert-1.0a1.jar}:\
47
     ${file.reference.fest-assert-1.0a1.jar}:\
76
 run.test.classpath=\
72
 run.test.classpath=\
77
     ${javac.test.classpath}:\
73
     ${javac.test.classpath}:\
78
     ${build.test.classes.dir}:\
74
     ${build.test.classes.dir}:\
79
-    ${libs.junit.classpath}:\
80
-    ${file.reference.junit-4.1.jar}
75
+    ${file.reference.junit-4.jar}:\
76
+    ${file.reference.junit-4.jar}
81
 src.dir=src
77
 src.dir=src
82
 test.src.dir=test
78
 test.src.dir=test

+ 1
- 1
src/com/dmdirc/CertificateManager.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 16
- 28
src/com/dmdirc/Channel.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
163
             return;
163
             return;
164
         }
164
         }
165
 
165
 
166
-        if (line.indexOf('\n') > -1) {
167
-            for (String part : line.split("\n")) {
168
-                sendLine(part);
169
-            }
170
-
171
-            return;
172
-        }
173
-
174
         final ClientInfo me = server.getParser().getMyself();
166
         final ClientInfo me = server.getParser().getMyself();
175
-        final String modes = getModes(channelInfo.getUser(me));
176
         final String[] details = getDetails(channelInfo.getUser(me), showColours);
167
         final String[] details = getDetails(channelInfo.getUser(me), showColours);
177
 
168
 
178
-        if (line.length() <= getMaxLineLength()) {
169
+        for (String part : splitLine(window.getTranscoder().encode(line))) {
179
             final StringBuffer buff = new StringBuffer("channelSelfMessage");
170
             final StringBuffer buff = new StringBuffer("channelSelfMessage");
180
 
171
 
181
             ActionManager.processEvent(CoreActionType.CHANNEL_SELF_MESSAGE, buff,
172
             ActionManager.processEvent(CoreActionType.CHANNEL_SELF_MESSAGE, buff,
182
-                    this, channelInfo.getUser(me), line);
173
+                    this, channelInfo.getUser(me), part);
183
 
174
 
184
-            addLine(buff, modes, details[0], details[1], details[2],
185
-                    window.getTranscoder().encode(line), channelInfo);
175
+            addLine(buff, details[0], details[1], details[2], details[3],
176
+                    part, channelInfo);
186
 
177
 
187
-            channelInfo.sendMessage(window.getTranscoder().encode(line));
188
-        } else {
189
-            sendLine(line.substring(0, getMaxLineLength()));
190
-            sendLine(line.substring(getMaxLineLength()));
178
+            channelInfo.sendMessage(part);
191
         }
179
         }
192
     }
180
     }
193
 
181
 
209
         }
197
         }
210
 
198
 
211
         final ClientInfo me = server.getParser().getMyself();
199
         final ClientInfo me = server.getParser().getMyself();
212
-        final String modes = channelInfo.getUser(me).getImportantModePrefix();
200
+        final String[] details = getDetails(channelInfo.getUser(me), showColours);
213
 
201
 
214
         if (server.getParser().getMaxLength("PRIVMSG", getChannelInfo().getName())
202
         if (server.getParser().getMaxLength("PRIVMSG", getChannelInfo().getName())
215
                 <= action.length()) {
203
                 <= action.length()) {
220
             ActionManager.processEvent(CoreActionType.CHANNEL_SELF_ACTION, buff,
208
             ActionManager.processEvent(CoreActionType.CHANNEL_SELF_ACTION, buff,
221
                     this, channelInfo.getUser(me), action);
209
                     this, channelInfo.getUser(me), action);
222
 
210
 
223
-            addLine(buff, modes, me.getNickname(), me.getIdent(),
224
-                    me.getHost(), window.getTranscoder().encode(action), channelInfo);
211
+            addLine(buff, details[0], details[1], details[2], details[3],
212
+                    window.getTranscoder().encode(action), channelInfo);
225
 
213
 
226
             channelInfo.sendAction(window.getTranscoder().encode(action));
214
             channelInfo.sendAction(window.getTranscoder().encode(action));
227
         }
215
         }
509
      * @param showColours Whether or not to show colours
497
      * @param showColours Whether or not to show colours
510
      * @return A string[] containing displayable components
498
      * @return A string[] containing displayable components
511
      */
499
      */
512
-    private static String[] getDetails(final ChannelClientInfo client,
500
+    private String[] getDetails(final ChannelClientInfo client,
513
             final boolean showColours) {
501
             final boolean showColours) {
514
         if (client == null) {
502
         if (client == null) {
515
             // WTF?
503
             // WTF?
517
                      + " null ChannelClientInfo");
505
                      + " null ChannelClientInfo");
518
         }
506
         }
519
 
507
 
520
-        final String[] res = new String[3];
521
-        res[0] = Styliser.CODE_NICKNAME + client.getNickname() + Styliser.CODE_NICKNAME;
522
-        res[1] = client.getClient().getIdent();
523
-        res[2] = client.getClient().getHost();
508
+        final String[] res = new String[4];
509
+        res[0] = getModes(client);
510
+        res[1] = Styliser.CODE_NICKNAME + client.getNickname() + Styliser.CODE_NICKNAME;
511
+        res[2] = client.getClient().getIdent();
512
+        res[3] = client.getClient().getHost();
524
 
513
 
525
         if (showColours) {
514
         if (showColours) {
526
             final Map map = client.getMap();
515
             final Map map = client.getMap();
537
             }
526
             }
538
 
527
 
539
             if (prefix != null) {
528
             if (prefix != null) {
540
-                res[0] = prefix + res[0] + Styliser.CODE_HEXCOLOUR;
529
+                res[1] = prefix + res[1] + Styliser.CODE_HEXCOLOUR;
541
             }
530
             }
542
         }
531
         }
543
 
532
 
560
             // Format ChannelClientInfos
549
             // Format ChannelClientInfos
561
 
550
 
562
             final ChannelClientInfo clientInfo = (ChannelClientInfo) arg;
551
             final ChannelClientInfo clientInfo = (ChannelClientInfo) arg;
563
-            args.add(getModes(clientInfo));
564
             args.addAll(Arrays.asList(getDetails(clientInfo, showColours)));
552
             args.addAll(Arrays.asList(getDetails(clientInfo, showColours)));
565
 
553
 
566
             return true;
554
             return true;

+ 1
- 1
src/com/dmdirc/ChannelClientProperty.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/ChannelEventHandler.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/CustomWindow.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/EventHandler.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/FrameContainer.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/FrameContainerComparator.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/GlobalWindow.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/IgnoreList.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/Invite.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 108
- 15
src/com/dmdirc/Main.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
26
 import com.dmdirc.actions.CoreActionType;
26
 import com.dmdirc.actions.CoreActionType;
27
 import com.dmdirc.commandline.CommandLineParser;
27
 import com.dmdirc.commandline.CommandLineParser;
28
 import com.dmdirc.commandparser.CommandManager;
28
 import com.dmdirc.commandparser.CommandManager;
29
+import com.dmdirc.config.ConfigManager;
29
 import com.dmdirc.config.IdentityManager;
30
 import com.dmdirc.config.IdentityManager;
30
 import com.dmdirc.logger.DMDircExceptionHandler;
31
 import com.dmdirc.logger.DMDircExceptionHandler;
31
 import com.dmdirc.logger.ErrorLevel;
32
 import com.dmdirc.logger.ErrorLevel;
32
 import com.dmdirc.logger.Logger;
33
 import com.dmdirc.logger.Logger;
33
 import com.dmdirc.plugins.PluginManager;
34
 import com.dmdirc.plugins.PluginManager;
35
+import com.dmdirc.plugins.Service;
34
 import com.dmdirc.ui.themes.ThemeManager;
36
 import com.dmdirc.ui.themes.ThemeManager;
35
-import com.dmdirc.ui.dummy.DummyController;
36
 import com.dmdirc.ui.interfaces.UIController;
37
 import com.dmdirc.ui.interfaces.UIController;
37
-import com.dmdirc.ui.swing.SwingController;
38
+import com.dmdirc.ui.NoUIDialog;
38
 import com.dmdirc.updater.UpdateChannel;
39
 import com.dmdirc.updater.UpdateChannel;
39
 import com.dmdirc.updater.UpdateChecker;
40
 import com.dmdirc.updater.UpdateChecker;
41
+import com.dmdirc.util.resourcemanager.ResourceManager;
40
 
42
 
41
 import java.awt.GraphicsEnvironment;
43
 import java.awt.GraphicsEnvironment;
44
+import java.io.File;
45
+import java.io.IOException;
46
+import java.util.List;
47
+import java.util.Map;
42
 import java.util.Timer;
48
 import java.util.Timer;
43
 import java.util.TimerTask;
49
 import java.util.TimerTask;
44
 
50
 
96
         Thread.setDefaultUncaughtExceptionHandler(new DMDircExceptionHandler());
102
         Thread.setDefaultUncaughtExceptionHandler(new DMDircExceptionHandler());
97
 
103
 
98
         final CommandLineParser clp = new CommandLineParser(args);
104
         final CommandLineParser clp = new CommandLineParser(args);
99
-
105
+        
100
         IdentityManager.load();
106
         IdentityManager.load();
107
+
108
+        final PluginManager pm = PluginManager.getPluginManager();
101
         
109
         
102
         ThemeManager.loadThemes();
110
         ThemeManager.loadThemes();
103
 
111
 
105
 
113
 
106
         CommandManager.initCommands();
114
         CommandManager.initCommands();
107
 
115
 
116
+        loadUI(pm, IdentityManager.getGlobalConfig(), true);
117
+
108
         getUI().initUISettings();
118
         getUI().initUISettings();
109
 
119
 
110
         doFirstRun();
120
         doFirstRun();
111
 
121
 
112
         ActionManager.init();
122
         ActionManager.init();
113
 
123
 
114
-        PluginManager.getPluginManager();
124
+        pm.doAutoLoad();
115
 
125
 
116
         ActionManager.loadActions();
126
         ActionManager.loadActions();
117
 
127
 
135
             }
145
             }
136
         }, "Shutdown thread"));        
146
         }, "Shutdown thread"));        
137
     }
147
     }
148
+
149
+    /**
150
+     * Attempts to find and activate a service which provides a UI that we
151
+     * can use.
152
+     *
153
+     * @param pm The plugin manager to use to load plugins
154
+     * @param cm The config manager to use to retrieve settings
155
+     * @param tryExtracting If no suitable plugins are found and tryExtracting
156
+     * is true, the method will try extracting core UI plugins bundled with
157
+     * DMDirc before giving up.
158
+     */
159
+    protected static void loadUI(final PluginManager pm, final ConfigManager cm,
160
+            final boolean tryExtracting) {
161
+        final List<Service> uis = pm.getServicesByType("ui");
162
+        final String desired = cm.getOption("general", "ui", "swing");
163
+
164
+        // First try: go for our desired service type
165
+        for (Service service : uis) {
166
+            if (service.getName().equals(desired) && service.activate()) {
167
+                return;
168
+            }
169
+        }
170
+
171
+        // Second try: go for any service type
172
+        for (Service service : uis) {
173
+            if (service.activate()) {
174
+                return;
175
+            }
176
+        }
177
+
178
+        // Third try: extract some core plugins and go again
179
+        if (tryExtracting) {
180
+            extractCorePlugins("ui_");
181
+            pm.getPossiblePluginInfos(true);
182
+
183
+            loadUI(pm, cm, false);
184
+            return;
185
+        }
186
+
187
+        if (!GraphicsEnvironment.isHeadless()) {
188
+            // Show a dialog informing the user that no UI was found.
189
+            NoUIDialog.displayBlocking();
190
+        }
191
+
192
+        // Can't find any
193
+        throw new IllegalStateException("No UIs could be loaded");
194
+    }
138
     
195
     
139
     /**
196
     /**
140
      * Executes the first run or migration wizards as required.
197
      * Executes the first run or migration wizards as required.
182
      * @return The client's UI controller
239
      * @return The client's UI controller
183
      */
240
      */
184
     public static UIController getUI() {
241
     public static UIController getUI() {
185
-        if (controller == null) {
186
-            if (GraphicsEnvironment.isHeadless()) {
187
-                controller = new DummyController();
188
-            } else {
189
-                controller = new SwingController();
190
-            }
191
-        }
192
-
193
         return controller;
242
         return controller;
194
     }
243
     }
195
 
244
 
198
      *
247
      *
199
      * @param newController The new UI Controller
248
      * @param newController The new UI Controller
200
      */
249
      */
201
-    public static void setUI(final UIController newController) {
202
-        controller = newController;
250
+    public static synchronized void setUI(final UIController newController) {
251
+        if (controller == null) {
252
+            controller = newController;
253
+        } else {
254
+            throw new IllegalStateException("User interface is already set");
255
+        }
203
     }
256
     }
204
 
257
 
205
     /**
258
     /**
237
         configdir = newdir;
290
         configdir = newdir;
238
     }
291
     }
239
 
292
 
293
+    /**
294
+     * Extracts plugins bundled with DMDirc to the user's profile's plugin
295
+     * directory.
296
+     *
297
+     * @param prefix If non-null, only plugins whose file name starts with
298
+     * this prefix will be extracted.
299
+     */
300
+    public static void extractCorePlugins(final String prefix) {
301
+        final Map<String, byte[]> resources = ResourceManager.getResourceManager()
302
+                .getResourcesStartingWithAsBytes("plugins");
303
+        for (Map.Entry<String, byte[]> resource : resources.entrySet()) {
304
+            try {
305
+                final String resourceName = Main.getConfigDir() + "plugins"
306
+                        + resource.getKey().substring(7);
307
+
308
+                if (prefix != null && !resource.getKey().substring(7).startsWith(prefix)) {
309
+                    continue;
310
+                }
311
+
312
+                final File newDir = new File(resourceName.substring(0,
313
+                        resourceName.lastIndexOf('/')) + "/");
314
+
315
+                if (!newDir.exists()) {
316
+                    newDir.mkdirs();
317
+                }
318
+
319
+                final File newFile = new File(newDir,
320
+                        resourceName.substring(resourceName.lastIndexOf('/') + 1,
321
+                        resourceName.length()));
322
+
323
+                if (!newFile.isDirectory()) {
324
+                    ResourceManager.getResourceManager().
325
+                            resourceToFile(resource.getValue(), newFile);
326
+                }
327
+            } catch (IOException ex) {
328
+                Logger.userError(ErrorLevel.LOW, "Failed to extract plugins", ex);
329
+            }
330
+        }
331
+    }
332
+
240
 }
333
 }

+ 1
- 1
src/com/dmdirc/MessageTarget.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/ParserFactory.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/Precondition.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 8
- 17
src/com/dmdirc/Query.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
136
             return;
136
             return;
137
         }
137
         }
138
 
138
 
139
-        if (line.indexOf('\n') > -1) {
140
-            for (String part : line.split("\n")) {
141
-                sendLine(part);
142
-            }
143
-
144
-            return;
145
-        }
146
-
147
         final ClientInfo client = server.getParser().getMyself();
139
         final ClientInfo client = server.getParser().getMyself();
148
 
140
 
149
-        if (line.length() <= getMaxLineLength()) {
150
-            server.getParser().sendMessage(ClientInfo.parseHost(host), window.getTranscoder().encode(line));
141
+        for (String part : splitLine(window.getTranscoder().encode(line))) {
142
+            server.getParser().sendMessage(ClientInfo.parseHost(host),
143
+                    part);
151
 
144
 
152
             final StringBuffer buff = new StringBuffer("querySelfMessage");
145
             final StringBuffer buff = new StringBuffer("querySelfMessage");
153
 
146
 
154
-            ActionManager.processEvent(CoreActionType.QUERY_SELF_MESSAGE, buff, this, line);
147
+            ActionManager.processEvent(CoreActionType.QUERY_SELF_MESSAGE, buff, this, part);
155
 
148
 
156
             addLine(buff, client.getNickname(), client.getIdent(),
149
             addLine(buff, client.getNickname(), client.getIdent(),
157
-                    client.getHost(), window.getTranscoder().encode(line));
158
-        } else {
159
-            sendLine(line.substring(0, getMaxLineLength()));
160
-            sendLine(line.substring(getMaxLineLength()));
150
+                    client.getHost(), part);
161
         }
151
         }
162
     }
152
     }
163
 
153
 
164
     /** {@inheritDoc} */
154
     /** {@inheritDoc} */
165
     @Override
155
     @Override
166
     public int getMaxLineLength() {
156
     public int getMaxLineLength() {
167
-        return server.getParser().getMaxLength("PRIVMSG", host);
157
+        return server.getState() == ServerState.CONNECTED ? server.getParser()
158
+                .getMaxLength("PRIVMSG", host) : -1;
168
     }
159
     }
169
 
160
 
170
     /**
161
     /**

+ 1
- 1
src/com/dmdirc/Raw.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 9
- 4
src/com/dmdirc/Server.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
1271
      */
1271
      */
1272
     @Precondition("State is CONNECTING")
1272
     @Precondition("State is CONNECTING")
1273
     public void onPost005() {
1273
     public void onPost005() {
1274
+        if (myState.getState() != ServerState.CONNECTING) {
1275
+            // Shouldn't happen
1276
+            throw new IllegalStateException("Received onPost005 while not "
1277
+                    + "connecting\n\n" + myState.getTransitionHistory());
1278
+        }
1279
+
1274
         synchronized (this) {
1280
         synchronized (this) {
1275
             if (myState.getState() != ServerState.CONNECTING) {
1281
             if (myState.getState() != ServerState.CONNECTING) {
1276
-                // Shouldn't happen
1277
-                throw new IllegalStateException("Received onPost005 while not "
1278
-                        + "connecting\n\nState: " + myState);
1282
+                // We've transitioned while waiting for the lock. Just abort.
1283
+                return;
1279
             }
1284
             }
1280
 
1285
 
1281
             myState.transition(ServerState.CONNECTED);
1286
             myState.transition(ServerState.CONNECTED);

+ 1
- 1
src/com/dmdirc/ServerEventHandler.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/ServerManager.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/ServerState.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/ServerStatus.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/Topic.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 39
- 3
src/com/dmdirc/WritableFrameContainer.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
81
      * @return The maximum line length for this container
81
      * @return The maximum line length for this container
82
      */
82
      */
83
     public abstract int getMaxLineLength();
83
     public abstract int getMaxLineLength();
84
+
85
+    /**
86
+     * Splits the specified line into chunks that contain a number of bytes
87
+     * less than or equal to the value returned by {@link #getMaxLineLength()}.
88
+     *
89
+     * @param line The line to be split
90
+     * @return An ordered list of chunks of the desired length
91
+     */
92
+    protected List<String> splitLine(final String line) {
93
+        final List<String> result = new ArrayList<String>();
94
+
95
+        if (line.indexOf('\n') > -1) {
96
+            for (String part : line.split("\n")) {
97
+                result.addAll(splitLine(part));
98
+            }
99
+        } else {
100
+            final StringBuilder remaining = new StringBuilder(line);
101
+
102
+            while (remaining.toString().getBytes().length > getMaxLineLength()) {
103
+                int number = Math.min(remaining.length(), getMaxLineLength());
104
+
105
+                while (remaining.substring(0, number).getBytes().length > getMaxLineLength()) {
106
+                    number--;
107
+                }
108
+
109
+                result.add(remaining.substring(0, number));
110
+                remaining.delete(0, number);
111
+            }
112
+
113
+            result.add(remaining.toString());
114
+        }
115
+
116
+        return result;
117
+    }
84
     
118
     
85
     /**
119
     /**
86
      * Returns the number of lines that the specified string would be sent as.
120
      * Returns the number of lines that the specified string would be sent as.
96
             if (splitLine.isEmpty() || getMaxLineLength() <= 0) {
130
             if (splitLine.isEmpty() || getMaxLineLength() <= 0) {
97
                 lines++;
131
                 lines++;
98
             } else {
132
             } else {
99
-                lines += (int) Math.ceil(splitLine.length() / (double) getMaxLineLength());
133
+                lines += (int) Math.ceil(splitLine.getBytes().length
134
+                        / (double) getMaxLineLength());
100
             }
135
             }
101
         }
136
         }
102
         
137
         
211
         } else if (target.startsWith("window:")) {
246
         } else if (target.startsWith("window:")) {
212
             final String windowName = target.substring(7);
247
             final String windowName = target.substring(7);
213
 
248
 
214
-            Window targetWindow = WindowManager.findCustomWindow(getServer().getFrame(), windowName);
249
+            Window targetWindow = WindowManager.findCustomWindow(getServer().getFrame(),
250
+                    windowName);
215
 
251
 
216
             if (targetWindow == null) {
252
             if (targetWindow == null) {
217
                 targetWindow = new CustomWindow(windowName, windowName,
253
                 targetWindow = new CustomWindow(windowName, windowName,

+ 1
- 1
src/com/dmdirc/actions/Action.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 2
- 2
src/com/dmdirc/actions/ActionComponentChain.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
24
 
24
 
25
 import com.dmdirc.actions.interfaces.ActionComponent;
25
 import com.dmdirc.actions.interfaces.ActionComponent;
26
 import com.dmdirc.Precondition;
26
 import com.dmdirc.Precondition;
27
-
28
 import com.dmdirc.logger.Logger;
27
 import com.dmdirc.logger.Logger;
28
+
29
 import java.util.ArrayList;
29
 import java.util.ArrayList;
30
 import java.util.List;
30
 import java.util.List;
31
 
31
 

+ 1
- 1
src/com/dmdirc/actions/ActionCondition.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 2
src/com/dmdirc/actions/ActionGroup.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
25
 import com.dmdirc.config.prefs.PreferencesSetting;
25
 import com.dmdirc.config.prefs.PreferencesSetting;
26
 
26
 
27
 import java.util.ArrayList;
27
 import java.util.ArrayList;
28
-import java.util.Collection;
29
 import java.util.HashMap;
28
 import java.util.HashMap;
30
 import java.util.Iterator;
29
 import java.util.Iterator;
31
 import java.util.List;
30
 import java.util.List;

+ 1
- 1
src/com/dmdirc/actions/ActionManager.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/ActionModel.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/ActionSubstitutor.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 2
src/com/dmdirc/actions/ActionTypeComparator.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
25
 import com.dmdirc.actions.interfaces.ActionType;
25
 import com.dmdirc.actions.interfaces.ActionType;
26
 
26
 
27
 import java.io.Serializable;
27
 import java.io.Serializable;
28
-
29
 import java.util.Comparator;
28
 import java.util.Comparator;
30
 
29
 
31
 /**
30
 /**

+ 1
- 1
src/com/dmdirc/actions/ConditionTree.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/ConditionTreeFactory.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/CoreActionComparison.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 2
- 2
src/com/dmdirc/actions/CoreActionComponent.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
30
 import com.dmdirc.logger.ErrorLevel;
30
 import com.dmdirc.logger.ErrorLevel;
31
 import com.dmdirc.logger.Logger;
31
 import com.dmdirc.logger.Logger;
32
 import com.dmdirc.parser.irc.ChannelClientInfo;
32
 import com.dmdirc.parser.irc.ChannelClientInfo;
33
-
34
 import com.dmdirc.parser.irc.ClientInfo;
33
 import com.dmdirc.parser.irc.ClientInfo;
35
 import com.dmdirc.ui.messages.Styliser;
34
 import com.dmdirc.ui.messages.Styliser;
35
+
36
 import java.awt.Color;
36
 import java.awt.Color;
37
 import java.awt.event.KeyEvent;
37
 import java.awt.event.KeyEvent;
38
 import java.util.Calendar;
38
 import java.util.Calendar;

+ 1
- 1
src/com/dmdirc/actions/CoreActionType.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/interfaces/ActionComparison.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/interfaces/ActionComponent.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/interfaces/ActionMetaType.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/interfaces/ActionType.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/metatypes/ActionEvents.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/metatypes/ChannelEvents.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/metatypes/ClientEvents.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/metatypes/PluginEvents.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/metatypes/QueryEvents.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/metatypes/ServerEvents.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/package-info.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/wrappers/Alias.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/wrappers/AliasWrapper.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/wrappers/PerformWrapper.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/actions/wrappers/package-info.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/addons/addonbrowser/AddonInfo.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 2
- 2
src/com/dmdirc/addons/addonbrowser/AddonInfoListCellRenderer.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  * 
3
  * 
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
22
 
22
 
23
 package com.dmdirc.addons.addonbrowser;
23
 package com.dmdirc.addons.addonbrowser;
24
 
24
 
25
-import com.dmdirc.ui.swing.components.TextLabel;
25
+import com.dmdirc.addons.ui_swing.components.TextLabel;
26
 import java.awt.Color;
26
 import java.awt.Color;
27
 import java.awt.Component;
27
 import java.awt.Component;
28
 import java.awt.Font;
28
 import java.awt.Font;

+ 2
- 2
src/com/dmdirc/addons/addonbrowser/BrowserPlugin.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
24
 
24
 
25
 import com.dmdirc.config.prefs.PreferencesManager;
25
 import com.dmdirc.config.prefs.PreferencesManager;
26
 import com.dmdirc.plugins.Plugin;
26
 import com.dmdirc.plugins.Plugin;
27
-import com.dmdirc.ui.swing.components.pluginpanel.PluginPanel;
27
+import com.dmdirc.addons.ui_swing.components.pluginpanel.PluginPanel;
28
 
28
 
29
 import java.awt.Component;
29
 import java.awt.Component;
30
 import java.awt.event.ActionEvent;
30
 import java.awt.event.ActionEvent;

+ 3
- 3
src/com/dmdirc/addons/addonbrowser/BrowserWindow.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
24
 
24
 
25
 import com.dmdirc.Main;
25
 import com.dmdirc.Main;
26
 import com.dmdirc.addons.addonbrowser.AddonInfo.AddonType;
26
 import com.dmdirc.addons.addonbrowser.AddonInfo.AddonType;
27
-import com.dmdirc.ui.swing.SwingController;
28
-import com.dmdirc.ui.swing.components.LoggingSwingWorker;
27
+import com.dmdirc.addons.ui_swing.SwingController;
28
+import com.dmdirc.addons.ui_swing.components.LoggingSwingWorker;
29
 import com.dmdirc.util.ConfigFile;
29
 import com.dmdirc.util.ConfigFile;
30
 import com.dmdirc.util.InvalidConfigFileException;
30
 import com.dmdirc.util.InvalidConfigFileException;
31
 
31
 

+ 1
- 1
src/com/dmdirc/addons/addonbrowser/InstallListener.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  * 
3
  * 
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 32
- 0
src/com/dmdirc/addons/addonbrowser/plugin.config View File

1
+# This is a DMDirc configuration file.
2
+
3
+# This section indicates which sections below take key/value
4
+# pairs, rather than a simple list. It should be placed above
5
+# any sections that take key/values.
6
+keysections:
7
+  metadata
8
+  requires
9
+  updates
10
+#  version
11
+
12
+metadata:
13
+  author=Chris <chris@dmdirc.com>
14
+  mainclass=com.dmdirc.addons.addonbrowser.BrowserPlugin
15
+  description=Browse and download addons from within DMDirc
16
+  name=addonbrowser
17
+  nicename=Addon Browser
18
+
19
+requires:
20
+  parent=ui_swing
21
+
22
+updates:
23
+  id=26
24
+
25
+#version:
26
+#  friendly=0.1
27
+
28
+provides:
29
+  addonbrowser component
30
+
31
+required-services:
32
+  swing ui

+ 1
- 1
src/com/dmdirc/addons/audio/AudioCommand.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/addons/audio/AudioPlayer.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/addons/audio/AudioPlugin.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/addons/audio/BeepCommand.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 25
- 0
src/com/dmdirc/addons/audio/plugin.config View File

1
+# This is a DMDirc configuration file.
2
+
3
+# This section indicates which sections below take key/value
4
+# pairs, rather than a simple list. It should be placed above
5
+# any sections that take key/values.
6
+keysections:
7
+  metadata
8
+  updates
9
+#  version
10
+
11
+metadata:
12
+  author=Shane <shane@dmdirc.com>
13
+  mainclass=com.dmdirc.addons.audio.AudioPlugin
14
+  description=Allows playing audio files
15
+  name=audio
16
+  nicename=Audio Plugin
17
+
18
+updates:
19
+  id=14
20
+
21
+#version:
22
+#  friendly=0.2
23
+
24
+provides:
25
+  audio command

+ 2
- 3
src/com/dmdirc/addons/dcc/DCC.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
112
 	 * @throws IOException If the listen socket can't be created
112
 	 * @throws IOException If the listen socket can't be created
113
 	 */
113
 	 */
114
 	public void listen() throws IOException {
114
 	public void listen() throws IOException {
115
-		listen = true;
116
-
117
 		serverSocketSem.acquireUninterruptibly();
115
 		serverSocketSem.acquireUninterruptibly();
118
 		serverSocket = new ServerSocket(0, 1);
116
 		serverSocket = new ServerSocket(0, 1);
119
 		serverSocketSem.release();
117
 		serverSocketSem.release();
120
 
118
 
119
+		listen = true;
121
 		connect();
120
 		connect();
122
 	}
121
 	}
123
 
122
 

+ 1
- 1
src/com/dmdirc/addons/dcc/DCCChat.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/addons/dcc/DCCChatInterface.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/addons/dcc/DCCChatWindow.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/addons/dcc/DCCCommand.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 3
- 3
src/com/dmdirc/addons/dcc/DCCFrame.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
33
 import com.dmdirc.config.IdentityManager;
33
 import com.dmdirc.config.IdentityManager;
34
 import com.dmdirc.ui.WindowManager;
34
 import com.dmdirc.ui.WindowManager;
35
 import com.dmdirc.ui.interfaces.InputWindow;
35
 import com.dmdirc.ui.interfaces.InputWindow;
36
-import com.dmdirc.ui.swing.components.InputTextFrame;
37
-import com.dmdirc.ui.swing.components.TextFrame;
36
+import com.dmdirc.addons.ui_swing.components.InputTextFrame;
37
+import com.dmdirc.addons.ui_swing.components.TextFrame;
38
 
38
 
39
 import java.awt.Container;
39
 import java.awt.Container;
40
 
40
 

+ 11
- 6
src/com/dmdirc/addons/dcc/DCCPlugin.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal
41
 import com.dmdirc.parser.irc.IRCParser;
41
 import com.dmdirc.parser.irc.IRCParser;
42
 import com.dmdirc.plugins.Plugin;
42
 import com.dmdirc.plugins.Plugin;
43
 import com.dmdirc.ui.WindowManager;
43
 import com.dmdirc.ui.WindowManager;
44
-import com.dmdirc.ui.swing.components.TextFrame;
44
+import com.dmdirc.addons.ui_swing.components.TextFrame;
45
 
45
 
46
 import com.dmdirc.addons.dcc.kde.KFileChooser;
46
 import com.dmdirc.addons.dcc.kde.KFileChooser;
47
 import com.dmdirc.addons.dcc.actions.DCCActions;
47
 import com.dmdirc.addons.dcc.actions.DCCActions;
48
 
48
 
49
-import com.dmdirc.ui.swing.components.TextLabel;
49
+import com.dmdirc.addons.ui_swing.components.TextLabel;
50
 import java.io.File;
50
 import java.io.File;
51
 import java.io.IOException;
51
 import java.io.IOException;
52
 
52
 
319
 					DCCSend send = DCCSend.findByToken(token);
319
 					DCCSend send = DCCSend.findByToken(token);
320
 					
320
 					
321
 					if (send == null && !dontAsk) {
321
 					if (send == null && !dontAsk) {
322
-						ActionManager.processEvent(DCCActions.DCC_SEND_REQUEST, null, ((Server)arguments[0]), nickname, filename);
323
-						askQuestion("User "+nickname+" on "+((Server)arguments[0]).toString()+" would like to send you a file over DCC.\n\nFile: "+filename+"\n\nDo you want to continue?", "DCC Send Request", JOptionPane.YES_OPTION, type, format, arguments);
324
-						return;
322
+						if (!token.isEmpty() && !port.equals(0)) {
323
+							// This is a reverse DCC Send that we no longer care about.
324
+							return;
325
+						} else {
326
+							ActionManager.processEvent(DCCActions.DCC_SEND_REQUEST, null, ((Server)arguments[0]), nickname, filename);
327
+							askQuestion("User "+nickname+" on "+((Server)arguments[0]).toString()+" would like to send you a file over DCC.\n\nFile: "+filename+"\n\nDo you want to continue?", "DCC Send Request", JOptionPane.YES_OPTION, type, format, arguments);
328
+							return;
329
+						}
325
 					} else {
330
 					} else {
326
 						final boolean newSend = send == null;
331
 						final boolean newSend = send == null;
327
 						if (newSend) {
332
 						if (newSend) {

+ 1
- 1
src/com/dmdirc/addons/dcc/DCCSend.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/addons/dcc/DCCSendInterface.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/addons/dcc/DCCSendWindow.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 1
- 1
src/com/dmdirc/addons/dcc/actions/DCCActions.java View File

1
 /*
1
 /*
2
- * Copyright (c) 2006-2008 Chris Smith, Shane Mc Cormack, Gregory Holmes
2
+ * Copyright (c) 2006-2009 Chris Smith, Shane Mc Cormack, Gregory Holmes
3
  *
3
  *
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5
  * of this software and associated documentation files (the "Software"), to deal
5
  * of this software and associated documentation files (the "Software"), to deal

+ 0
- 0
src/com/dmdirc/addons/dcc/actions/DCCEvents.java View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save