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,7 +93,7 @@ if [ ! -e "$MYDIR/dist/DMDirc.jar" ]; then
93 93
 else
94 94
 	# Build installers
95 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 97
 	cd "${MYDIR}"
98 98
 	
99 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,8 +1,8 @@
1 1
 #!/bin/sh
2 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 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 8
 sh update.sh

+ 15
- 0
build-jar.xml View File

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

+ 1
- 1
checkstyle/dmdirc.license View File

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

+ 57
- 18
createPluginJar.sh View File

@@ -7,42 +7,81 @@ if [ "${1}" = "" -o "${2}" = "" ]; then
7 7
 	exit;
8 8
 fi
9 9
 
10
+srcdir=${PWD}
10 11
 pluginname=${1}
11 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 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 25
 	exit 0;
18 26
 fi
19 27
 
20 28
 #echo "looking for classes"
21
-srcdir=${PWD}
22 29
 TMPDIR=`mktemp -d`
23 30
 #echo "Using temp dir: ${TMPDIR}"
24 31
 cd $TMPDIR
25 32
 
26 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 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 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 83
 	fi
45
-fi
84
+fi;
46 85
 
47 86
 foo=`echo $foldername | sed -e 's/\/[^\/]*$//g'`
48 87
 mkdir -p $foo
@@ -51,7 +90,7 @@ ln -s ${srcdir}/build/classes/${foldername} .
51 90
 cd $TMPDIR
52 91
 mkdir -p ${srcdir}/plugins/
53 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 94
 bit=""
56 95
 while [ 1 -eq 1 ]; do
57 96
 	bit=${bit}/*

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

@@ -3,7 +3,7 @@
3 3
 # This script generates a jar file for a release version of DMDirc
4 4
 #
5 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 8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
9 9
 # of this software and associated documentation files (the "Software"), to deal
@@ -28,6 +28,13 @@ FILENAME=DMDirc
28 28
 # full name of the file to output to
29 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 38
 # Go!
32 39
 echo "-----------"
33 40
 if [ -e "${RUNNAME}" ]; then
@@ -46,7 +53,7 @@ showHelp() {
46 53
 	echo "-c, --compile             Recompile the .jar file (otherwise use the existing file from dist/)"
47 54
 	echo "    --jar <file>          use <file> as DMDirc.jar (ie just add the plugins to it and rename)"
48 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 57
 	echo "-k, --keep                Keep the existing source tree when compiling"
51 58
 	echo "                          (don't svn update beforehand)"
52 59
 	echo "---------------------"
@@ -60,11 +67,17 @@ isRelease=""
60 67
 finalTag=""
61 68
 BRANCH="0"
62 69
 plugins=""
63
-location="../../../"
70
+if [ $isSVN -eq 1 ]; then
71
+	location="../../../"
72
+	current=""
73
+else
74
+	location="../../"
75
+	current="1"
76
+fi;
64 77
 jarfile=""
65
-current=""
66 78
 jre=""
67 79
 jrename="jre" # Filename for JRE without the .bin
80
+TAGGED=""
68 81
 while test -n "$1"; do
69 82
 	case "$1" in
70 83
 		--plugins|-p)
@@ -86,7 +99,7 @@ while test -n "$1"; do
86 99
 			shift
87 100
 			isRelease=${1}
88 101
 			;;
89
-		--tag|-t)
102
+		--extra|-e)
90 103
 			shift
91 104
 			finalTag=${1}
92 105
 			RUNNAME="${PWD}/${FILENAME}-${1}.jar"
@@ -100,6 +113,16 @@ while test -n "$1"; do
100 113
 		--branch|-b)
101 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 126
 	esac
104 127
 	shift
105 128
 done
@@ -109,21 +132,23 @@ else
109 132
 	jarPath="${location}"
110 133
 fi
111 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 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 152
 fi
128 153
 
129 154
 if [ "" = "${jarfile}" ]; then
@@ -133,7 +158,9 @@ if [ "" = "${jarfile}" ]; then
133 158
 		OLDPWD=${PWD}
134 159
 		cd ${jarPath}
135 160
 		if [ "${updateSVN}" = "true" ]; then
136
-			svn update
161
+			if [ $isSVN -eq 1 ]; then
162
+				svn update
163
+			fi;
137 164
 		fi
138 165
 		ant clean jar
139 166
 		if [ ! -e "dist/DMDirc.jar" ]; then
@@ -158,11 +185,25 @@ for plugin in ${plugins}; do
158 185
 done
159 186
 jar -uvf "${RUNNAME}" ${pluginList}
160 187
 rm -Rf plugins;
161
-
188
+doRename=0
162 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 207
 	if [ "" != "${finalTag}" ]; then
167 208
 		finalTag="-${finalTag}"
168 209
 	fi;

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

@@ -3,7 +3,7 @@
3 3
 # This script installs dmdirc
4 4
 #
5 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 8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
9 9
 # of this software and associated documentation files (the "Software"), to deal
@@ -401,4 +401,4 @@ rm -Rf ${TEMPDIR}
401 401
 echo "Installation Completed."
402 402
 # Job Done!
403 403
 exit 0;
404
-###END STUB###
404
+###END STUB###

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

@@ -3,7 +3,7 @@
3 3
 # This script generates a .run file that will install DMDirc
4 4
 #
5 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 8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
9 9
 # of this software and associated documentation files (the "Software"), to deal
@@ -28,6 +28,13 @@ INSTALLERNAME=DMDirc-Setup
28 28
 # full name of the file to output to
29 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 38
 # Find out what params we should pass to things.
32 39
 # Solaris has a nice and ancient version of grep in /usr/bin
33 40
 grep -na "" /dev/null >/dev/null 2>&1
@@ -110,7 +117,7 @@ showHelp() {
110 117
 	echo "    --jre64               Include the 64-Bit JRE in this installer"
111 118
 	echo "    --jar <file>          use <file> as DMDirc.jar"
112 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 121
 	echo "-k, --keep                Keep the existing source tree when compiling"
115 122
 	echo "                          (don't svn update beforehand)"
116 123
 	echo "---------------------"
@@ -124,11 +131,17 @@ isRelease=""
124 131
 finalTag=""
125 132
 BRANCH="0"
126 133
 plugins=""
127
-location="../../../"
134
+if [ $isSVN -eq 1 ]; then
135
+	location="../../../"
136
+	current=""
137
+else
138
+	location="../../"
139
+	current="1"
140
+fi;
128 141
 jarfile=""
129
-current=""
130 142
 jre=""
131 143
 jrename="jre" # Filename for JRE without the .bin
144
+TAGGED=""
132 145
 while test -n "$1"; do
133 146
 	case "$1" in
134 147
 		--plugins|-p)
@@ -157,7 +170,7 @@ while test -n "$1"; do
157 170
 			shift
158 171
 			isRelease=${1}
159 172
 			;;
160
-		--tag|-t)
173
+		--extra|-e)
161 174
 			shift
162 175
 			finalTag=${1}
163 176
 			RUNNAME="${PWD}/${INSTALLERNAME}-${1}.run"
@@ -171,6 +184,16 @@ while test -n "$1"; do
171 184
 		--branch|-b)
172 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 197
 	esac
175 198
 	shift
176 199
 done
@@ -180,21 +203,23 @@ else
180 203
 	jarPath="${location}"
181 204
 fi
182 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 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 221
 		fi
197
-	fi
222
+	fi;
198 223
 fi
199 224
 
200 225
 if [ "" = "${jarfile}" ]; then
@@ -241,8 +266,13 @@ echo "Adding stub.."
241 266
 cat installerstub.sh > ${RUNNAME}
242 267
 
243 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 277
 FILES="DMDirc.jar";
248 278
 echo "Compressing files.."
@@ -303,6 +333,10 @@ if [ -e "${jarPath}/launcher/unix" ]; then
303 333
 	FILES="${FILES} DMDirc.sh"
304 334
 fi
305 335
 
336
+if [ -e "uninstall.sh" ]; then
337
+	FILES="${FILES} uninstall.sh"
338
+fi
339
+
306 340
 compress $FILES
307 341
 
308 342
 MD5BIN=`which md5sum`
@@ -363,11 +397,25 @@ fi;
363 397
 echo "Chmodding"
364 398
 chmod a+x ${RUNNAME}
365 399
 
366
-
400
+doRename=0
367 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 419
 	if [ "" != "${finalTag}" ]; then
372 420
 		finalTag="-${finalTag}"
373 421
 	fi;

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

@@ -3,7 +3,7 @@
3 3
 # This script launches the dmdirc java-based installer.
4 4
 #
5 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 8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
9 9
 # of this software and associated documentation files (the "Software"), to deal

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

@@ -0,0 +1,178 @@
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,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -3,7 +3,7 @@
3 3
 # This script generates a .dmg file that includes dmdirc
4 4
 #
5 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 8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
9 9
 # of this software and associated documentation files (the "Software"), to deal
@@ -28,6 +28,13 @@ INSTALLERNAME=DMDirc
28 28
 # full name of the file to output to
29 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 38
 # Linux needs an entry in fstab to allow normal users to mount things (like a
32 39
 # dmg image).
33 40
 # These 2 config vars choose what dir and file we mount so that fstab can be
@@ -105,7 +112,7 @@ showHelp() {
105 112
 	echo "-c, --compile             Recompile the .jar file"
106 113
 	echo "    --jar <file>          use <file> as DMDirc.jar"
107 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 116
 	echo "-k, --keep                Keep the existing source tree when compiling"
110 117
 	echo "                          (don't svn update beforehand)"
111 118
 	echo "---------------------"
@@ -119,9 +126,15 @@ isRelease=""
119 126
 finalTag=""
120 127
 BRANCH="0"
121 128
 plugins=""
122
-location="../../../"
129
+if [ $isSVN -eq 1 ]; then
130
+	location="../../../"
131
+	current=""
132
+else
133
+	location="../../"
134
+	current="1"
135
+fi;
123 136
 jarfile=""
124
-current=""
137
+TAGGED=""
125 138
 while test -n "$1"; do
126 139
 	case "$1" in
127 140
 		--plugins|-p)
@@ -143,7 +156,7 @@ while test -n "$1"; do
143 156
 			shift
144 157
 			isRelease=${1}
145 158
 			;;
146
-		--tag|-t)
159
+		--extra|-e)
147 160
 			shift
148 161
 			finalTag=${1}
149 162
 			RUNNAME="${PWD}/${INSTALLERNAME}-${1}.dmg"
@@ -157,6 +170,16 @@ while test -n "$1"; do
157 170
 		--branch|-b)
158 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 183
 	esac
161 184
 	shift
162 185
 done
@@ -166,19 +189,21 @@ else
166 189
 	jarPath="${location}"
167 190
 fi
168 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 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 207
 		fi
183 208
 	fi
184 209
 fi
@@ -238,11 +263,26 @@ mkdir -pv ${MACOSDIR}
238 263
 echo "Creating meta files"
239 264
 echo "APPLDMDI" > ${CONTENTSDIR}/PkgInfo
240 265
 
266
+doRename=0
241 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 280
 	else
245
-		bundleVersion=${isRelease}
281
+		if [ "${TAGGED}" = "" ]; then
282
+			bundleVersion=branch-${isRelease}
283
+		else
284
+			bundleVersion=${TAGGED}
285
+		fi;
246 286
 	fi
247 287
 else
248 288
 	bundleVersion="trunk-"`date +%Y%m%d_%H%M%S`
@@ -436,10 +476,18 @@ fi;
436 476
 
437 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 491
 	if [ "" != "${finalTag}" ]; then
444 492
 		finalTag="-${finalTag}"
445 493
 	fi;

+ 88
- 48
installer/release.sh View File

@@ -1,7 +1,7 @@
1 1
 #!/bin/sh
2 2
 
3 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 6
 # Additional Jar names of plugins to add to only Windows installers. (* means all)
7 7
 plugins_windows=""
@@ -12,13 +12,29 @@ plugins_linux=""
12 12
 # Additional Jar names of plugins to add to only osx installers. (* means all)
13 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 23
 showHelp() {
16 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 31
 	echo "The following params are known:"
20 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 38
 	echo "     --jar <file>                   Use <file> instead of compiling a jar."
23 39
 	echo "     --fulljar <file>               Use <file> instead of compiling a jar, and don't run makeJar on it."
24 40
 	echo "     --jre                          Include a jre in the installers."
@@ -45,6 +61,7 @@ FULLJAR=""
45 61
 BUILDTARGET=""
46 62
 UPLOAD="0"
47 63
 TAG="0"
64
+TAGGED=""
48 65
 while test -n "$1"; do
49 66
 	LAST=${1}
50 67
 	case "$1" in
@@ -93,10 +110,24 @@ while test -n "$1"; do
93 110
 		--branch|-b)
94 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 123
 	esac
97 124
 	shift
98 125
 done
99 126
 
127
+if [ ! -e output ]; then
128
+	mkdir output
129
+fi;
130
+
100 131
 if [ "${plugins}" = "*" -o "${plugins_linux}" = "*" -o "${plugins_windows}" = "*" -o "${plugins_osx}" = "*" ]; then
101 132
 	echo "Something is all.";
102 133
 	allPlugins=""
@@ -109,53 +140,62 @@ if [ "${plugins}" = "*" -o "${plugins_linux}" = "*" -o "${plugins_windows}" = "*
109 140
 	if [ "${plugins_osx}" = "*" ]; then plugins_osx=${allPlugins}; fi
110 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 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 152
 			cd ..
129 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 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 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 190
 	fi
154 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 200
 JAR=`which jar`
161 201
 JAVAC=`which javac`
@@ -196,7 +236,7 @@ if [ "" = "${FULLJAR}" ]; then
196 236
 	echo "Building Release Jar"
197 237
 	echo "================================================================"
198 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 240
 	RESULT=${?}
201 241
 	cd ${THISDIR}
202 242
 
@@ -214,7 +254,7 @@ if [ "linux" = "${BUILDTARGET}" -o "" = "${BUILDTARGET}" ]; then
214 254
 	echo "Building linux installer"
215 255
 	echo "================================================================"
216 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 258
 	cd ${THISDIR}
219 259
 fi;
220 260
 
@@ -223,7 +263,7 @@ if [ "windows" = "${BUILDTARGET}" -o "" = "${BUILDTARGET}" ]; then
223 263
 	echo "Building Windows installer"
224 264
 	echo "================================================================"
225 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 267
 	cd ${THISDIR}
228 268
 fi;
229 269
 
@@ -232,7 +272,7 @@ if [ "osx" = "${BUILDTARGET}" -o "" = "${BUILDTARGET}" ]; then
232 272
 	echo "Building OSX Bundle"
233 273
 	echo "================================================================"
234 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 276
 	cd ${THISDIR}
237 277
 fi;
238 278
 

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

@@ -2,7 +2,7 @@
2 2
  * This application launches the dmdirc java-based installer.
3 3
  * 
4 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 7
  * Permission is hereby granted, free of charge, to any person obtaining a copy
8 8
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -2,7 +2,7 @@
2 2
  * This application launches the dmdirc java-based installer.
3 3
  * 
4 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 7
  * Permission is hereby granted, free of charge, to any person obtaining a copy
8 8
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -3,7 +3,7 @@
3 3
 # This script generates a .exe file that will install DMDirc
4 4
 #
5 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 8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
9 9
 # of this software and associated documentation files (the "Software"), to deal
@@ -35,6 +35,13 @@ INTNAME="${PWD}/${INTNAME}"
35 35
 # Get 7zip path
36 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 45
 if [ "" = "${ZIP}" ]; then
39 46
 	echo "7Zip not found, failing."
40 47
 	exit 1;
@@ -98,11 +105,17 @@ signEXE="true"
98 105
 compilerFlags="-Xs -XX -O2 -Or -Op1"
99 106
 BRANCH="0"
100 107
 plugins=""
101
-location="../../../"
108
+if [ $isSVN -eq 1 ]; then
109
+	location="../../../"
110
+	current=""
111
+else
112
+	location="../../"
113
+	current="1"
114
+fi;
102 115
 jarfile=""
103
-current=""
104 116
 jre=""
105 117
 jrename="jre" # Filename for JRE without the .exe
118
+TAGGED=""
106 119
 
107 120
 showHelp() {
108 121
 	echo "This will generate a DMDirc installer for a windows based system."
@@ -112,11 +125,11 @@ showHelp() {
112 125
 	echo "-r, --release <version>   Generate a file based on an svn tag (or branch with -b aswell)"
113 126
 	echo "-b, --branch              Release in -r is a branch "
114 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 129
 	echo "-p, --plugins <plugins>   What plugins to add to the jar file"
117 130
 	echo "-c, --compile             Recompile the .jar file"
118 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 133
 	echo "-f, --flags <flags>       Extra flags to pass to the compiler"
121 134
 	echo "    --jre                 Include the JRE in this installer"
122 135
 	echo "    --jar <file>          use <file> as DMDirc.jar"
@@ -160,14 +173,14 @@ while test -n "$1"; do
160 173
 		--setup|-s)
161 174
 			compileSetup="true"
162 175
 			;;
163
-		-e)
176
+		-o)
164 177
 			useOldSetup="true"
165 178
 			;;
166 179
 		--release|-r)
167 180
 			shift
168 181
 			isRelease=${1}
169 182
 			;;
170
-		--tag|-t)
183
+		--extra|-e)
171 184
 			shift
172 185
 			finalTag="-${1}"
173 186
 			;;
@@ -190,6 +203,16 @@ while test -n "$1"; do
190 203
 		--branch|-b)
191 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 216
 	esac
194 217
 	shift
195 218
 done
@@ -212,19 +235,21 @@ else
212 235
 	jarPath="${location}"
213 236
 fi
214 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 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 253
 		fi
229 254
 	fi
230 255
 fi
@@ -268,8 +293,11 @@ else
268 293
 	rm -Rf plugins;
269 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 302
 FILES=""
275 303
 # Icon Res file
@@ -284,19 +312,25 @@ echo "extractor RCDATA extractor.exe" > files.rc
284 312
 
285 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 321
 # Version Numbers
288
-if [ "" = "${1}" ]; then
322
+if [ "" = "${NUM}" ]; then
289 323
 	MAJORVER="0"
290 324
 	MINORVER="0"
291 325
 	RELEASE="0"
292
-	TEXTVER="Trunk"
326
+	TEXTVER="${isRelease}"
293 327
 	PRIVATE="1"
294 328
 	USER=`whoami`
295 329
 	HOST=`hostname`
296 330
 	DATE=`date`
297 331
 else
298
-	MAJORVER=${1%%.*}
299
-	SUBVER=${1#*.}
332
+	MAJORVER=${NUM%%.*}
333
+	SUBVER=${NUM#*.}
300 334
 	DOT=`expr index "${SUBVER}" .`
301 335
 	if [ "${DOT}" = "0" ]; then
302 336
 		MINORVER=${SUBVER}
@@ -305,7 +339,7 @@ else
305 339
 		MINORVER=${SUBVER%%.*}
306 340
 		RELEASE=${SUBVER##*.}
307 341
 	fi
308
-	TEXTVER=$1
342
+	TEXTVER=$NUM
309 343
 	PRIVATE="0"
310 344
 fi;
311 345
 
@@ -346,7 +380,7 @@ echo "			VALUE \"FileDescription\", \"Uninstaller for DMDirc\"" >> uninstallvers
346 380
 
347 381
 echo "			VALUE \"FileVersion\", \"2.0\"" > version.rc.2
348 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 384
 echo "			VALUE \"OriginalFilename\", \"$2\"" >> version.rc.2
351 385
 echo "			VALUE \"ProductName\", \"DMDirc\"" >> version.rc.2
352 386
 echo "			VALUE \"ProductVersion\", \"${TEXTVER}\"" >> version.rc.2
@@ -517,10 +551,13 @@ echo "Creating config.."
517 551
 echo ";!@Install@!UTF-8!" > 7zip.conf
518 552
 if [ "${isRelease}" != "" ]; then
519 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 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 561
 fi;
525 562
 echo "ExecuteFile=\"Setup.exe\"" >> 7zip.conf
526 563
 echo ";!@InstallEnd@!" >> 7zip.conf
@@ -538,12 +575,27 @@ fi;
538 575
 echo "Creating .exe"
539 576
 cat 7zS.sfx 7zip.conf "${INTNAME}" > "${RUNNAME}"
540 577
 
578
+doRename=0
541 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 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 599
 	ORIGNAME="DMDirc-${releaseTag}-Setup${finalTag}.exe"
548 600
 else
549 601
 	ORIGNAME="${INSTALLNAME}${finalTag}.exe"

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

@@ -3,7 +3,7 @@
3 3
 # This script launches dmdirc and attempts to update the jar file if needed.
4 4
 #
5 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 8
 # Permission is hereby granted, free of charge, to any person obtaining a copy
9 9
 # of this software and associated documentation files (the "Software"), to deal
@@ -168,10 +168,12 @@ else
168 168
 	jar=`dirname $0`/DMDirc.jar
169 169
 fi
170 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 173
 echo "---------------------"
172 174
 echo "DMDirc - Open Source IRC Client"
173 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 177
 echo "---------------------"
176 178
 if [ "${ISOSX}" = "1" ]; then
177 179
 	echo "Running on OS X."
@@ -344,21 +346,20 @@ if [ "${ISOSX}" = "1" ]; then
344 346
 		JAVA="/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/java"
345 347
 	fi;
346 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 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 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 363
 fi;
363 364
 
364 365
 if [ "" != "${JAVA}" ]; then
@@ -384,17 +385,36 @@ if [ -e "${jar}" ]; then
384 385
 	# error message to be printed.
385 386
 	${JAVA} -jar ${jar} --help >/dev/null 2>&1
386 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 417
 		fi;
396
-		errordialog "Unable to launch dmdirc!" "${ERROR}";
397
-		exit 1;
398 418
 	fi
399 419
 
400 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,7 +15,7 @@ BEGIN
15 15
 			VALUE "FileDescription", "Launcher for DMDirc"
16 16
 			VALUE "FileVersion", "2.0"
17 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 19
 			VALUE "OriginalFilename", "$2"
20 20
 			VALUE "ProductName", "DMDirc Launcher"
21 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,12 +57,6 @@ is divided into following sections:
57 57
                 </not>
58 58
             </and>
59 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 60
         <condition property="have.tests">
67 61
             <or>
68 62
                 <available file="${test.src.dir}"/>

+ 7
- 11
nbproject/project.properties View File

@@ -1,14 +1,11 @@
1
-application.title=DMDirc
2
-application.vendor=greboid
3 1
 file.reference.fest-assert-1.0a1.jar=lib/fest-assert-1.0a1.jar
4 2
 file.reference.fest-reflect-0.4.jar=lib/fest-reflect-0.4.jar
5 3
 file.reference.fest-swing-1.0b1.jar=lib/fest-swing-1.0b1.jar
6 4
 file.reference.fest-swing-junit-1.0b1.jar=lib/fest-swing-junit-1.0b1.jar
7 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 10
 doccheck.path=doccheck.jar
14 11
 doccheck.dir=reports/doccheck/
@@ -35,7 +32,7 @@ dist.jar.excludes=com/dmdirc/addons/**
35 32
 excludes=
36 33
 includes=**
37 34
 jar.compress=false
38
-javac.classpath=
35
+javac.classpath=${file.reference.miglayout.jar}
39 36
 # Space-separated list of extra javac options
40 37
 javac.compilerargs=-Xlint:all
41 38
 javac.deprecation=true
@@ -44,8 +41,7 @@ javac.target=1.6
44 41
 javac.test.classpath=\
45 42
     ${javac.classpath}:\
46 43
     ${build.classes.dir}:\
47
-    ${libs.junit.classpath}:\
48
-    ${file.reference.junit-4.1.jar}:\
44
+    ${file.reference.junit-4.jar}:\
49 45
     ${file.reference.fest-swing-junit-1.0b1.jar}:\
50 46
     ${file.reference.fest-swing-1.0b1.jar}:\
51 47
     ${file.reference.fest-assert-1.0a1.jar}:\
@@ -76,7 +72,7 @@ run.jvmargs=
76 72
 run.test.classpath=\
77 73
     ${javac.test.classpath}:\
78 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 77
 src.dir=src
82 78
 test.src.dir=test

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
@@ -163,31 +163,19 @@ public final class Channel extends MessageTarget
163 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 166
         final ClientInfo me = server.getParser().getMyself();
175
-        final String modes = getModes(channelInfo.getUser(me));
176 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 170
             final StringBuffer buff = new StringBuffer("channelSelfMessage");
180 171
 
181 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,7 +197,7 @@ public final class Channel extends MessageTarget
209 197
         }
210 198
 
211 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 202
         if (server.getParser().getMaxLength("PRIVMSG", getChannelInfo().getName())
215 203
                 <= action.length()) {
@@ -220,8 +208,8 @@ public final class Channel extends MessageTarget
220 208
             ActionManager.processEvent(CoreActionType.CHANNEL_SELF_ACTION, buff,
221 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 214
             channelInfo.sendAction(window.getTranscoder().encode(action));
227 215
         }
@@ -509,7 +497,7 @@ public final class Channel extends MessageTarget
509 497
      * @param showColours Whether or not to show colours
510 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 501
             final boolean showColours) {
514 502
         if (client == null) {
515 503
             // WTF?
@@ -517,10 +505,11 @@ public final class Channel extends MessageTarget
517 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 514
         if (showColours) {
526 515
             final Map map = client.getMap();
@@ -537,7 +526,7 @@ public final class Channel extends MessageTarget
537 526
             }
538 527
 
539 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,7 +549,6 @@ public final class Channel extends MessageTarget
560 549
             // Format ChannelClientInfos
561 550
 
562 551
             final ChannelClientInfo clientInfo = (ChannelClientInfo) arg;
563
-            args.add(getModes(clientInfo));
564 552
             args.addAll(Arrays.asList(getDetails(clientInfo, showColours)));
565 553
 
566 554
             return true;

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
@@ -26,19 +26,25 @@ import com.dmdirc.actions.ActionManager;
26 26
 import com.dmdirc.actions.CoreActionType;
27 27
 import com.dmdirc.commandline.CommandLineParser;
28 28
 import com.dmdirc.commandparser.CommandManager;
29
+import com.dmdirc.config.ConfigManager;
29 30
 import com.dmdirc.config.IdentityManager;
30 31
 import com.dmdirc.logger.DMDircExceptionHandler;
31 32
 import com.dmdirc.logger.ErrorLevel;
32 33
 import com.dmdirc.logger.Logger;
33 34
 import com.dmdirc.plugins.PluginManager;
35
+import com.dmdirc.plugins.Service;
34 36
 import com.dmdirc.ui.themes.ThemeManager;
35
-import com.dmdirc.ui.dummy.DummyController;
36 37
 import com.dmdirc.ui.interfaces.UIController;
37
-import com.dmdirc.ui.swing.SwingController;
38
+import com.dmdirc.ui.NoUIDialog;
38 39
 import com.dmdirc.updater.UpdateChannel;
39 40
 import com.dmdirc.updater.UpdateChecker;
41
+import com.dmdirc.util.resourcemanager.ResourceManager;
40 42
 
41 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 48
 import java.util.Timer;
43 49
 import java.util.TimerTask;
44 50
 
@@ -96,8 +102,10 @@ public final class Main {
96 102
         Thread.setDefaultUncaughtExceptionHandler(new DMDircExceptionHandler());
97 103
 
98 104
         final CommandLineParser clp = new CommandLineParser(args);
99
-
105
+        
100 106
         IdentityManager.load();
107
+
108
+        final PluginManager pm = PluginManager.getPluginManager();
101 109
         
102 110
         ThemeManager.loadThemes();
103 111
 
@@ -105,13 +113,15 @@ public final class Main {
105 113
 
106 114
         CommandManager.initCommands();
107 115
 
116
+        loadUI(pm, IdentityManager.getGlobalConfig(), true);
117
+
108 118
         getUI().initUISettings();
109 119
 
110 120
         doFirstRun();
111 121
 
112 122
         ActionManager.init();
113 123
 
114
-        PluginManager.getPluginManager();
124
+        pm.doAutoLoad();
115 125
 
116 126
         ActionManager.loadActions();
117 127
 
@@ -135,6 +145,53 @@ public final class Main {
135 145
             }
136 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 197
      * Executes the first run or migration wizards as required.
@@ -182,14 +239,6 @@ public final class Main {
182 239
      * @return The client's UI controller
183 240
      */
184 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 242
         return controller;
194 243
     }
195 244
 
@@ -198,8 +247,12 @@ public final class Main {
198 247
      *
199 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,4 +290,44 @@ public final class Main {
237 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,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
@@ -136,35 +136,26 @@ public final class Query extends MessageTarget implements
136 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 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 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 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 154
     /** {@inheritDoc} */
165 155
     @Override
166 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,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
@@ -1271,11 +1271,16 @@ public final class Server extends WritableFrameContainer implements Serializable
1271 1271
      */
1272 1272
     @Precondition("State is CONNECTING")
1273 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 1280
         synchronized (this) {
1275 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 1286
             myState.transition(ServerState.CONNECTED);

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
@@ -81,6 +81,40 @@ public abstract class WritableFrameContainer extends FrameContainer {
81 81
      * @return The maximum line length for this container
82 82
      */
83 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 120
      * Returns the number of lines that the specified string would be sent as.
@@ -96,7 +130,8 @@ public abstract class WritableFrameContainer extends FrameContainer {
96 130
             if (splitLine.isEmpty() || getMaxLineLength() <= 0) {
97 131
                 lines++;
98 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,7 +246,8 @@ public abstract class WritableFrameContainer extends FrameContainer {
211 246
         } else if (target.startsWith("window:")) {
212 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 252
             if (targetWindow == null) {
217 253
                 targetWindow = new CustomWindow(windowName, windowName,

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
@@ -24,8 +24,8 @@ package com.dmdirc.actions;
24 24
 
25 25
 import com.dmdirc.actions.interfaces.ActionComponent;
26 26
 import com.dmdirc.Precondition;
27
-
28 27
 import com.dmdirc.logger.Logger;
28
+
29 29
 import java.util.ArrayList;
30 30
 import java.util.List;
31 31
 

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
@@ -25,7 +25,6 @@ package com.dmdirc.actions;
25 25
 import com.dmdirc.config.prefs.PreferencesSetting;
26 26
 
27 27
 import java.util.ArrayList;
28
-import java.util.Collection;
29 28
 import java.util.HashMap;
30 29
 import java.util.Iterator;
31 30
 import java.util.List;

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
@@ -25,7 +25,6 @@ package com.dmdirc.actions;
25 25
 import com.dmdirc.actions.interfaces.ActionType;
26 26
 
27 27
 import java.io.Serializable;
28
-
29 28
 import java.util.Comparator;
30 29
 
31 30
 /**

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
@@ -30,9 +30,9 @@ import com.dmdirc.Server;
30 30
 import com.dmdirc.logger.ErrorLevel;
31 31
 import com.dmdirc.logger.Logger;
32 32
 import com.dmdirc.parser.irc.ChannelClientInfo;
33
-
34 33
 import com.dmdirc.parser.irc.ClientInfo;
35 34
 import com.dmdirc.ui.messages.Styliser;
35
+
36 36
 import java.awt.Color;
37 37
 import java.awt.event.KeyEvent;
38 38
 import java.util.Calendar;

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 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,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
@@ -22,7 +22,7 @@
22 22
 
23 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 26
 import java.awt.Color;
27 27
 import java.awt.Component;
28 28
 import java.awt.Font;

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@ package com.dmdirc.addons.addonbrowser;
24 24
 
25 25
 import com.dmdirc.config.prefs.PreferencesManager;
26 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 29
 import java.awt.Component;
30 30
 import java.awt.event.ActionEvent;

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
@@ -24,8 +24,8 @@ package com.dmdirc.addons.addonbrowser;
24 24
 
25 25
 import com.dmdirc.Main;
26 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 29
 import com.dmdirc.util.ConfigFile;
30 30
 import com.dmdirc.util.InvalidConfigFileException;
31 31
 

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -0,0 +1,32 @@
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,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -0,0 +1,25 @@
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,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
@@ -112,12 +112,11 @@ public abstract class DCC implements Runnable {
112 112
 	 * @throws IOException If the listen socket can't be created
113 113
 	 */
114 114
 	public void listen() throws IOException {
115
-		listen = true;
116
-
117 115
 		serverSocketSem.acquireUninterruptibly();
118 116
 		serverSocket = new ServerSocket(0, 1);
119 117
 		serverSocketSem.release();
120 118
 
119
+		listen = true;
121 120
 		connect();
122 121
 	}
123 122
 

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
@@ -33,8 +33,8 @@ import com.dmdirc.commandparser.parsers.GlobalCommandParser;
33 33
 import com.dmdirc.config.IdentityManager;
34 34
 import com.dmdirc.ui.WindowManager;
35 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 39
 import java.awt.Container;
40 40
 

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal
@@ -41,12 +41,12 @@ import com.dmdirc.parser.irc.ClientInfo;
41 41
 import com.dmdirc.parser.irc.IRCParser;
42 42
 import com.dmdirc.plugins.Plugin;
43 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 46
 import com.dmdirc.addons.dcc.kde.KFileChooser;
47 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 50
 import java.io.File;
51 51
 import java.io.IOException;
52 52
 
@@ -319,9 +319,14 @@ public final class DCCPlugin extends Plugin implements ActionListener {
319 319
 					DCCSend send = DCCSend.findByToken(token);
320 320
 					
321 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 330
 					} else {
326 331
 						final boolean newSend = send == null;
327 332
 						if (newSend) {

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 5
  * of this software and associated documentation files (the "Software"), to deal

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

@@ -1,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 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,5 +1,5 @@
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 4
  * Permission is hereby granted, free of charge, to any person obtaining a copy
5 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