[jajuk] 04/06: new patches for 1.10.9

Felix Natter fnatter-guest at moszumanska.debian.org
Sun Mar 20 03:18:10 UTC 2016


This is an automated email from the git hooks/post-receive script.

fnatter-guest pushed a commit to branch master
in repository jajuk.

commit 9b7be85181c1c4fb4cdc913fa42728dca8cba942
Author: Felix Natter <fnatter at gmx.net>
Date:   Sun Mar 20 04:10:57 2016 +0100

    new patches for 1.10.9
---
 debian/patches/01_build.patch                      | 135 ++++++++++
 debian/patches/01_override_manifest.diff           |  24 --
 debian/patches/02_jaudiotagger.patch               |  15 ++
 debian/patches/02_lastfm_fix_0_1_0.diff            | 184 --------------
 .../patches/03_remove_WindowsHotKeyManager.patch   | 278 +++++++++++++++++++++
 debian/patches/03_validation.diff                  | 130 ----------
 debian/patches/04_disable_update_check.patch       |  43 ++++
 debian/patches/04_java8_compatibility.diff         |  36 ---
 debian/patches/series                              |   8 +-
 9 files changed, 475 insertions(+), 378 deletions(-)

diff --git a/debian/patches/01_build.patch b/debian/patches/01_build.patch
new file mode 100644
index 0000000..3a940d2
--- /dev/null
+++ b/debian/patches/01_build.patch
@@ -0,0 +1,135 @@
+Description: add build script build_enduser.xml from jajuk develop branch (1.11)
+  (the 1.10 ant script is broken)
+Author: Felix Natter <fnatter at gmx.net>
+Forwarded: not-needed
+Last-Update: 2016-03-11
+
+--- /dev/null
++++ b/build_enduser.xml
+@@ -0,0 +1,126 @@
++<?xml version='1.0' encoding='UTF-8'?>
++<!--Ant script for users (target package_jar) only -->
++
++<project default='package_jar' name='jajuk' basedir='.'>
++	<!--Distribution release -->
++	<property name='version' value='1.10.9' />
++
++	<!-- Name of the directory that will contain the jajuk.jar file once compiled -->
++	<property name='dist.dir' value='bin'/>
++
++	<!-- Location of the tests results -->
++	<property name="test.report.dir" value="test-reports"/>
++
++	<target name='clean' description='o Clean up previous build files'>
++		<delete failonerror='false' dir='${dist.dir}' />
++	  	<delete failonerror='false' dir='${test.report.dir}' />	
++		<mkdir dir='${dist.dir}' />
++		<mkdir dir='${test.report.dir}'/>
++	</target>
++	
++	<target name='compile' depends="clean">
++		<echo message='Compile the code' />
++		<javac destdir='${dist.dir}' source='1.7' target='1.7' deprecation='false' debug='false' optimize='true'  encoding='UTF-8'>
++			<src>
++				<pathelement path='src/main/java'>
++				</pathelement>
++			</src>
++			<classpath>
++			  <!--
++				<fileset dir='lib'>
++					<include name='*.jar' />
++				</fileset>
++				-->
++				<fileset dir='/usr/share/java'>
++					<include name='animation.jar' />
++					<include name='basicplayer.jar' />
++					<include name='cobra.jar' />
++					<include name='commons-codec.jar' />
++					<include name='commons-collections3.jar' />
++					<!--<include name='commons-httpclient.jar' />-->
++					<include name='commons-logging.jar' />
++					<!--<include name='entagged-tageditor.jar' />--><!--??-->
++					<include name='jaudiotagger.jar' />
++					<include name='jcommon.jar' />
++					<include name='jfreechart.jar' />
++					<include name='jl.jar' /> <!--??-->
++					<include name='jmactritonusspi.jar' />
++					<include name='jogg.jar' />
++					<include name='jorbis.jar' />
++					<include name='jspeex.jar' />
++					<include name='log4j-1.2.jar' />
++					<include name='mp3spi.jar' />
++					<include name='substance.jar' />
++					<include name='swingx.jar' />
++					<include name='tritonus_share.jar' />
++					<include name='vldocking.jar' />
++					<include name='vorbisspi.jar' />
++					<include name='jna.jar' /> <!--??-->
++					<include name='dbus.jar' />
++					<include name='miglayout.jar' />
++					<include name='jhlabs-filters.jar' /><!--??-->
++					<include name='lastfm.jar' />
++					<include name='commons-lang.jar' />
++					<include name='commons-io.jar' />
++					<include name='xstream.jar' />
++					<include name='guava.jar' />
++					<include name='qdwizard.jar' />
++				</fileset>
++			</classpath>
++		</javac>
++	</target>
++
++	<target name='compile_all' depends="clean">
++                <echo message='Compile the code and the tests' />
++                <javac destdir='${dist.dir}' source='1.7' target='1.7' deprecation='false' debug='false' optimize='true'  encoding='UTF-8'>
++                        <src>
++                                <pathelement path='src'>
++                                </pathelement>
++                        </src>
++                        <classpath>
++                                <fileset dir='lib'>
++                                        <include name='*.jar' />
++                                </fileset>
++                        </classpath>
++                </javac>
++        </target>
++
++	<target name='package_jar' description='o Create Jajuk jar file' depends='clean,compile'>
++		<echo message='Building Jajuk release: ${version} using Java ${java.specification.version}' />
++                <echo message='Basedir: ${basedir}' />	
++		<jar jarfile='${dist.dir}/jajuk.jar' manifest='debian/MANIFEST.MF' compress='true'>
++			<fileset dir='${dist.dir}' />
++			<fileset dir='src/main/resources'/>
++		</jar>
++		<!-- Make the jajuk bash script executable -->
++		<chmod file='jajuk' perm='ugo+rx' />
++		<echo message='jajuk.jar had been successfully built in: ${dist.dir}/jajuk.jar' />
++	</target>
++
++	<target name="tests" depends="compile_all"> 
++		<junit printsummary="on" fork="true" haltonfailure="no" timeout="60000">
++			<formatter type="xml" /> 
++			<batchtest todir="${test.report.dir}"> 
++				<fileset dir="src/test/java"> 
++					<include name="**/*Test*.java" />
++
++					<!-- Exclude test helpers, not test themselve -->
++					<exclude name="**/ConstTest.java" />
++					<exclude name="**/JajukTestCase.java" />
++					<exclude name="**/TestHelpers.java" />
++					<exclude name="**/ThreadTestHelper.java" />
++
++					<!-- exclude system-specific tests -->
++					<exclude name="**/TestDBusSupportImpl.java" />
++				</fileset> 
++			</batchtest> 
++			<classpath>
++				<fileset dir='lib'>
++					<include name='*.jar' />
++                </fileset>
++				<pathelement location="bin"/>
++				<pathelement location="src/main/resources"/>
++            </classpath>
++		</junit> 
++	</target>
++</project>
diff --git a/debian/patches/01_override_manifest.diff b/debian/patches/01_override_manifest.diff
deleted file mode 100644
index fad9c73..0000000
--- a/debian/patches/01_override_manifest.diff
+++ /dev/null
@@ -1,24 +0,0 @@
-Description: Move MANIFEST.MF definition to a property in
- src/scripts/build.xml
-Author: Damien Raude-Morvan <drazzib at debian.org>
-Last-Update: 2011-03-26
-Forwarded: no
---- a/src/scripts/build.xml
-+++ b/src/scripts/build.xml
-@@ -71,6 +71,7 @@
- 	<property name='distjarname' value='jajuk-java-installer-' />
- 	<property name='sourcesdist' value='${sourcesdir}/jajuk-sources-${version}.zip' />
- 	<property name='mplayerdir' value='/tmp/mplayer' />
-+	<property name='manifest' value='${srcdir}/packaging/MANIFEST.MF' />
- 
- 	<!-- This used to be the intermediate directory used to build war file, we used a persisitent 
-  	directory to use jar files in next war (each war contains current and previous jars for 
-@@ -254,7 +255,7 @@
- 
- 	<target name='package_jar' description='o Create Jajuk jar file' depends='startup,clean,mkdist_jar,compile'>
- 		<echo message='Create Jajuk jar file' />
--		<jar jarfile='${distdir}/bin/${jarname}' excludes='**/package.html' manifest='${srcdir}/packaging/MANIFEST.MF' compress='true'>
-+		<jar jarfile='${distdir}/bin/${jarname}' excludes='**/package.html' manifest='${manifest}' compress='true'>
- 			<fileset dir='${distdir}/${classdir}' />
- 		</jar>
- 		<delete dir='${distdir}/${classdir}' />
diff --git a/debian/patches/02_jaudiotagger.patch b/debian/patches/02_jaudiotagger.patch
new file mode 100644
index 0000000..c71df13
--- /dev/null
+++ b/debian/patches/02_jaudiotagger.patch
@@ -0,0 +1,15 @@
+Description: make jajuk-1.10 compile with jaudiotagger 2.0.3
+Author: Felix Natter <fnatter at gmx.net>
+Forwarded: not-needed
+Last-Update: 2016-03-10
+--- a/src/main/java/org/jajuk/services/tags/JAudioTaggerTagImpl.java
++++ b/src/main/java/org/jajuk/services/tags/JAudioTaggerTagImpl.java
+@@ -49,7 +49,7 @@
+ import org.jaudiotagger.tag.TagField;
+ import org.jaudiotagger.tag.id3.ID3v1Tag;
+ import org.jaudiotagger.tag.id3.ID3v24Tag;
+-import org.jaudiotagger.tag.images.Artwork;
++import org.jaudiotagger.tag.datatype.Artwork;
+ 
+ /**
+  * .
diff --git a/debian/patches/02_lastfm_fix_0_1_0.diff b/debian/patches/02_lastfm_fix_0_1_0.diff
deleted file mode 100644
index dc6555d..0000000
--- a/debian/patches/02_lastfm_fix_0_1_0.diff
+++ /dev/null
@@ -1,184 +0,0 @@
-Description: Package change from lastfm Java lib from 
- net.roarsoftware.lastfm to de.umass.lastfm
-Author: Damien Raude-Morvan <drazzib at debian.org>
-Last-Update: 2011-08-21
-Forwarded: no
---- a/src/main/java/ext/services/lastfm/LastFmAlbum.java
-+++ b/src/main/java/ext/services/lastfm/LastFmAlbum.java
-@@ -33,10 +33,10 @@
- 
- import javax.swing.ImageIcon;
- 
--import net.roarsoftware.lastfm.Album;
--import net.roarsoftware.lastfm.ImageSize;
--import net.roarsoftware.lastfm.Playlist;
--import net.roarsoftware.lastfm.Track;
-+import de.umass.lastfm.Album;
-+import de.umass.lastfm.ImageSize;
-+import de.umass.lastfm.Playlist;
-+import de.umass.lastfm.Track;
- 
- import org.jajuk.util.UtilString;
- 
---- a/src/main/java/ext/services/lastfm/LastFmAlbumList.java
-+++ b/src/main/java/ext/services/lastfm/LastFmAlbumList.java
-@@ -27,7 +27,7 @@
- import java.util.Collection;
- import java.util.List;
- 
--import net.roarsoftware.lastfm.Album;
-+import de.umass.lastfm.Album;
- 
- /**
-  * The Class LastFmAlbumList.
---- a/src/main/java/ext/services/lastfm/LastFmArtist.java
-+++ b/src/main/java/ext/services/lastfm/LastFmArtist.java
-@@ -25,8 +25,8 @@
- 
- import javax.swing.ImageIcon;
- 
--import net.roarsoftware.lastfm.Artist;
--import net.roarsoftware.lastfm.ImageSize;
-+import de.umass.lastfm.Artist;
-+import de.umass.lastfm.ImageSize;
- 
- /**
-  * The Class LastFmArtist.
---- a/src/main/java/ext/services/lastfm/LastFmCache.java
-+++ b/src/main/java/ext/services/lastfm/LastFmCache.java
-@@ -35,7 +35,7 @@
- 
- import javax.swing.ImageIcon;
- 
--import net.roarsoftware.lastfm.scrobble.SubmissionData;
-+import de.umass.lastfm.scrobble.SubmissionData;
- 
- import org.apache.commons.io.FileUtils;
- import org.jajuk.services.core.SessionService;
---- a/src/main/java/ext/services/lastfm/LastFmService.java
-+++ b/src/main/java/ext/services/lastfm/LastFmService.java
-@@ -33,16 +33,17 @@
- import java.util.Locale;
- import java.util.Set;
- 
--import net.roarsoftware.lastfm.Album;
--import net.roarsoftware.lastfm.Artist;
--import net.roarsoftware.lastfm.Caller;
--import net.roarsoftware.lastfm.ImageSize;
--import net.roarsoftware.lastfm.PaginatedResult;
--import net.roarsoftware.lastfm.Playlist;
--import net.roarsoftware.lastfm.scrobble.ResponseStatus;
--import net.roarsoftware.lastfm.scrobble.Scrobbler;
--import net.roarsoftware.lastfm.scrobble.Source;
--import net.roarsoftware.lastfm.scrobble.SubmissionData;
-+import de.umass.lastfm.Album;
-+import de.umass.lastfm.Artist;
-+import de.umass.lastfm.Caller;
-+import de.umass.lastfm.ImageSize;
-+import de.umass.lastfm.PaginatedResult;
-+import de.umass.lastfm.Playlist;
-+import de.umass.lastfm.Tag;
-+import de.umass.lastfm.scrobble.ResponseStatus;
-+import de.umass.lastfm.scrobble.Scrobbler;
-+import de.umass.lastfm.scrobble.Source;
-+import de.umass.lastfm.scrobble.SubmissionData;
- 
- import org.apache.commons.lang.StringEscapeUtils;
- import org.apache.commons.lang.StringUtils;
-@@ -279,11 +280,11 @@
-    * 
-    * @return the artist top tag
-    */
--  public String getArtistTopTag(String artist) {
-+  public Tag getArtistTopTag(String artist) {
-     try {
--      Collection<String> topTags = Artist.getTopTags(artist, UtilString.rot13(API_KEY));
--      List<String> tags = new ArrayList<String>(topTags);
--      return tags.isEmpty() ? "" : tags.get(0);
-+      Collection<Tag> topTags = Artist.getTopTags(artist, UtilString.rot13(API_KEY));
-+      List<Tag> tags = new ArrayList<Tag>(topTags);
-+      return tags.isEmpty() ? null : tags.get(0);
-     } catch (Exception e) {
-       Log.error(e);
-     }
-@@ -398,9 +399,9 @@
-     try {
-       Proxy proxy = DownloadManager.getProxy();
-       // Try to get from Artist.getImages() method
--      PaginatedResult<net.roarsoftware.lastfm.Image> images = Artist.getImages(artistName, 1, 1,
-+      PaginatedResult<de.umass.lastfm.Image> images = Artist.getImages(artistName, 1, 1,
-           UtilString.rot13(API_KEY));
--      List<net.roarsoftware.lastfm.Image> imageList = new ArrayList<net.roarsoftware.lastfm.Image>(
-+      List<de.umass.lastfm.Image> imageList = new ArrayList<de.umass.lastfm.Image>(
-           images.getPageResults());
-       if (!imageList.isEmpty()) {
-         Set<ImageSize> sizes = imageList.get(0).availableSizes();
-@@ -455,7 +456,8 @@
-       String wikiText = lastFmCache.retrieveArtistWiki(artist);
-       if (wikiText == null) {
- 
--        Artist a = Artist.getInfo(artist, locale, UtilString.rot13(API_KEY));
-+	String userName = null;
-+        Artist a = Artist.getInfo(artist, locale, userName, UtilString.rot13(API_KEY));
-         wikiText = a != null ? a.getWikiSummary() : "";
-         if (wikiText != null) {
-           wikiText = wikiText.replaceAll("<.*?>", "");
---- a/src/main/java/ext/services/lastfm/LastFmSimilarArtists.java
-+++ b/src/main/java/ext/services/lastfm/LastFmSimilarArtists.java
-@@ -29,8 +29,8 @@
- import java.util.Comparator;
- import java.util.List;
- 
--import net.roarsoftware.lastfm.Artist;
--import net.roarsoftware.lastfm.ImageSize;
-+import de.umass.lastfm.Artist;
-+import de.umass.lastfm.ImageSize;
- 
- /**
-  * The Class LastFmSimilarArtists.
---- a/src/main/java/ext/services/lastfm/LastFmTrack.java
-+++ b/src/main/java/ext/services/lastfm/LastFmTrack.java
-@@ -23,7 +23,7 @@
- 
- package ext.services.lastfm;
- 
--import net.roarsoftware.lastfm.Track;
-+import de.umass.lastfm.Track;
- 
- /**
-  * The Class LastFmTrack.
---- a/src/test/java/ext/services/lastfm/TestLastFmAlbum.java
-+++ b/src/test/java/ext/services/lastfm/TestLastFmAlbum.java
-@@ -25,9 +25,9 @@
- import java.util.ArrayList;
- import java.util.Locale;
- 
--import net.roarsoftware.lastfm.Album;
--import net.roarsoftware.lastfm.CallException;
--import net.roarsoftware.lastfm.Playlist;
-+import de.umass.lastfm.Album;
-+import de.umass.lastfm.CallException;
-+import de.umass.lastfm.Playlist;
- 
- import org.jajuk.JUnitHelpers;
- import org.jajuk.JajukTestCase;
-@@ -45,7 +45,7 @@
-   /**
-    * Test method for.
-    *
--   * {@link ext.services.lastfm.LastFmAlbum#getAlbum(net.roarsoftware.lastfm.Album, net.roarsoftware.lastfm.Playlist)}
-+   * {@link ext.services.lastfm.LastFmAlbum#getAlbum(de.umass.lastfm.Album, de.umass.lastfm.Playlist)}
-    * .
-    */
-   public void testGetAlbum() {
---- a/src/test/java/ext/services/lastfm/TestLastFmAlbumList.java
-+++ b/src/test/java/ext/services/lastfm/TestLastFmAlbumList.java
-@@ -23,7 +23,7 @@
- import java.util.ArrayList;
- import java.util.List;
- 
--import net.roarsoftware.lastfm.Album;
-+import de.umass.lastfm.Album;
- 
- import org.jajuk.JajukTestCase;
- import org.jajuk.util.UtilString;
diff --git a/debian/patches/03_remove_WindowsHotKeyManager.patch b/debian/patches/03_remove_WindowsHotKeyManager.patch
new file mode 100644
index 0000000..d15aa0e
--- /dev/null
+++ b/debian/patches/03_remove_WindowsHotKeyManager.patch
@@ -0,0 +1,278 @@
+Description: do not compile WindowsHotKeyManager.java
+Author: Felix Natter <fnatter at gmx.net>
+Forwarded: not-needed
+Last-Update: 2016-03-11
+
+--- a/src/main/java/org/jajuk/ui/actions/WindowsHotKeyManager.java
++++ b/src/main/java/org/jajuk/ui/actions/WindowsHotKeyManager.java
+@@ -18,137 +18,137 @@
+  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+  *  
+  */
+-package org.jajuk.ui.actions;
++// package org.jajuk.ui.actions;
+ 
+-import com.melloware.jintellitype.HotkeyListener;
+-import com.melloware.jintellitype.IntellitypeListener;
+-import com.melloware.jintellitype.JIntellitype;
+-import com.melloware.jintellitype.JIntellitypeConstants;
+-
+-import java.util.HashMap;
+-import java.util.Map;
+-
+-import javax.swing.AbstractAction;
+-import javax.swing.KeyStroke;
+-
+-import org.jajuk.events.JajukEvent;
+-import org.jajuk.events.JajukEvents;
+-import org.jajuk.events.ObservationManager;
+-import org.jajuk.util.Conf;
+-import org.jajuk.util.Const;
+-import org.jajuk.util.log.Log;
+-
+-/**
+- * This manager contains all windows-specific code dealing with hotkeys
+- * <p>
+- * Delete this class before compiling if you want to build jajuk without
+- * Jintellitype jar
+- * </p>.
+- */
+-public abstract class WindowsHotKeyManager extends AbstractAction {
+-  /** Generated serialVersionUID. */
+-  private static final long serialVersionUID = -6948447651091264530L;
+-  /** Maps hotkeylisteners with the event ID. */
+-  private static Map<Integer, JajukAction> hmIndexAction = new HashMap<Integer, JajukAction>(20);
+-  /** Jintellitype object used for hotkeys and intellitype events management under windows only. */
+-  private static JIntellitype jintellitype;
+-
+-  /**
+-   * Register j intellitype.
+-   * 
+-   */
+-  public static void registerJIntellitype() {
+-    jintellitype = JIntellitype.getInstance();
+-    // assign this class to be a IntellitypeListener
+-    jintellitype.addIntellitypeListener(new IntellitypeListener() {
+-      /*
+-       * (non-Javadoc)
+-       * 
+-       * @see com.melloware.jintellitype.IntellitypeListener#onIntellitype(int)
+-       */
+-      @Override
+-      public void onIntellitype(int aCommand) {
+-        try {
+-          // Perform right action according to intellitype command
+-          switch (aCommand) {
+-          case JIntellitypeConstants.APPCOMMAND_MEDIA_NEXTTRACK:
+-            ActionManager.getAction(JajukActions.NEXT_TRACK).perform(null);
+-            break;
+-          case JIntellitypeConstants.APPCOMMAND_MEDIA_PLAY_PAUSE:
+-            ActionManager.getAction(JajukActions.PAUSE_RESUME_TRACK).perform(null);
+-            break;
+-          case JIntellitypeConstants.APPCOMMAND_MEDIA_PREVIOUSTRACK:
+-            ActionManager.getAction(JajukActions.PREVIOUS_TRACK).perform(null);
+-            break;
+-          case JIntellitypeConstants.APPCOMMAND_MEDIA_STOP:
+-            ActionManager.getAction(JajukActions.STOP_TRACK).perform(null);
+-            break;
+-          case JIntellitypeConstants.APPCOMMAND_VOLUME_DOWN:
+-            ActionManager.getAction(JajukActions.DECREASE_VOLUME).perform(null);
+-            break;
+-          case JIntellitypeConstants.APPCOMMAND_VOLUME_UP:
+-            ActionManager.getAction(JajukActions.INCREASE_VOLUME).perform(null);
+-            break;
+-          case JIntellitypeConstants.APPCOMMAND_VOLUME_MUTE:
+-            Log.debug("System mute");
+-            // Ignore this to fix issue #1042, mute concurrency between the OS
+-            // key trapper and JIntellitype
+-            break;
+-          default:
+-            Log.debug("Undefined INTELLITYPE message caught " + Integer.toString(aCommand));
+-            break;
+-          }
+-        } catch (Throwable e2) {
+-          Log.error(e2);
+-        }
+-      }
+-    });
+-  }
+-
+-  /**
+-   * Register hot key.
+-   * 
+-   * 
+-   * @param stroke 
+-   * @param ab 
+-   */
+-  public static void registerHotKey(KeyStroke stroke, final JajukAction ab) {
+-    // under windows, use hotkey that can be used even when window
+-    // has not the focus. Note that all keys are nor hotkeys (given
+-    // by bHotkey flag)
+-    int index = hmIndexAction.size() - 1;
+-    jintellitype.registerSwingHotKey(index + 1, stroke.getModifiers(), stroke.getKeyCode());
+-    // register the action with its index
+-    hmIndexAction.put(index + 1, ab);
+-    // add the listener
+-    jintellitype.addHotKeyListener(new HotkeyListener() {
+-      @Override
+-      public void onHotKey(int key) {
+-        // Leave if user disabled hotkeys
+-        if (!Conf.getBoolean(Const.CONF_OPTIONS_HOTKEYS)) {
+-          return;
+-        }
+-        // Check it is the right listener that caught the event
+-        if (ab.equals(hmIndexAction.get(key))) {
+-          try {
+-            // Call action itself
+-            ab.perform(null);
+-          } catch (Throwable e2) {
+-            Log.error(e2);
+-          } finally {
+-            ObservationManager.notify(new JajukEvent(JajukEvents.QUEUE_NEED_REFRESH));
+-          }
+-        }
+-      }
+-    });
+-  }
+-
+-  /**
+-   * Free Jintellipad resources.
+-   */
+-  public static void cleanup() {
+-    if (jintellitype != null) {
+-      jintellitype.cleanUp();
+-    }
+-  }
+-}
++// import com.melloware.jintellitype.HotkeyListener;
++// import com.melloware.jintellitype.IntellitypeListener;
++// import com.melloware.jintellitype.JIntellitype;
++// import com.melloware.jintellitype.JIntellitypeConstants;
++
++// import java.util.HashMap;
++// import java.util.Map;
++
++// import javax.swing.AbstractAction;
++// import javax.swing.KeyStroke;
++
++// import org.jajuk.events.JajukEvent;
++// import org.jajuk.events.JajukEvents;
++// import org.jajuk.events.ObservationManager;
++// import org.jajuk.util.Conf;
++// import org.jajuk.util.Const;
++// import org.jajuk.util.log.Log;
++
++// /**
++//  * This manager contains all windows-specific code dealing with hotkeys
++//  * <p>
++//  * Delete this class before compiling if you want to build jajuk without
++//  * Jintellitype jar
++//  * </p>.
++//  */
++// public abstract class WindowsHotKeyManager extends AbstractAction {
++//   /** Generated serialVersionUID. */
++//   private static final long serialVersionUID = -6948447651091264530L;
++//   /** Maps hotkeylisteners with the event ID. */
++//   private static Map<Integer, JajukAction> hmIndexAction = new HashMap<Integer, JajukAction>(20);
++//   /** Jintellitype object used for hotkeys and intellitype events management under windows only. */
++//   private static JIntellitype jintellitype;
++
++//   /**
++//    * Register j intellitype.
++//    * 
++//    */
++//   public static void registerJIntellitype() {
++//     jintellitype = JIntellitype.getInstance();
++//     // assign this class to be a IntellitypeListener
++//     jintellitype.addIntellitypeListener(new IntellitypeListener() {
++//       /*
++//        * (non-Javadoc)
++//        * 
++//        * @see com.melloware.jintellitype.IntellitypeListener#onIntellitype(int)
++//        */
++//       @Override
++//       public void onIntellitype(int aCommand) {
++//         try {
++//           // Perform right action according to intellitype command
++//           switch (aCommand) {
++//           case JIntellitypeConstants.APPCOMMAND_MEDIA_NEXTTRACK:
++//             ActionManager.getAction(JajukActions.NEXT_TRACK).perform(null);
++//             break;
++//           case JIntellitypeConstants.APPCOMMAND_MEDIA_PLAY_PAUSE:
++//             ActionManager.getAction(JajukActions.PAUSE_RESUME_TRACK).perform(null);
++//             break;
++//           case JIntellitypeConstants.APPCOMMAND_MEDIA_PREVIOUSTRACK:
++//             ActionManager.getAction(JajukActions.PREVIOUS_TRACK).perform(null);
++//             break;
++//           case JIntellitypeConstants.APPCOMMAND_MEDIA_STOP:
++//             ActionManager.getAction(JajukActions.STOP_TRACK).perform(null);
++//             break;
++//           case JIntellitypeConstants.APPCOMMAND_VOLUME_DOWN:
++//             ActionManager.getAction(JajukActions.DECREASE_VOLUME).perform(null);
++//             break;
++//           case JIntellitypeConstants.APPCOMMAND_VOLUME_UP:
++//             ActionManager.getAction(JajukActions.INCREASE_VOLUME).perform(null);
++//             break;
++//           case JIntellitypeConstants.APPCOMMAND_VOLUME_MUTE:
++//             Log.debug("System mute");
++//             // Ignore this to fix issue #1042, mute concurrency between the OS
++//             // key trapper and JIntellitype
++//             break;
++//           default:
++//             Log.debug("Undefined INTELLITYPE message caught " + Integer.toString(aCommand));
++//             break;
++//           }
++//         } catch (Throwable e2) {
++//           Log.error(e2);
++//         }
++//       }
++//     });
++//   }
++
++//   /**
++//    * Register hot key.
++//    * 
++//    * 
++//    * @param stroke 
++//    * @param ab 
++//    */
++//   public static void registerHotKey(KeyStroke stroke, final JajukAction ab) {
++//     // under windows, use hotkey that can be used even when window
++//     // has not the focus. Note that all keys are nor hotkeys (given
++//     // by bHotkey flag)
++//     int index = hmIndexAction.size() - 1;
++//     jintellitype.registerSwingHotKey(index + 1, stroke.getModifiers(), stroke.getKeyCode());
++//     // register the action with its index
++//     hmIndexAction.put(index + 1, ab);
++//     // add the listener
++//     jintellitype.addHotKeyListener(new HotkeyListener() {
++//       @Override
++//       public void onHotKey(int key) {
++//         // Leave if user disabled hotkeys
++//         if (!Conf.getBoolean(Const.CONF_OPTIONS_HOTKEYS)) {
++//           return;
++//         }
++//         // Check it is the right listener that caught the event
++//         if (ab.equals(hmIndexAction.get(key))) {
++//           try {
++//             // Call action itself
++//             ab.perform(null);
++//           } catch (Throwable e2) {
++//             Log.error(e2);
++//           } finally {
++//             ObservationManager.notify(new JajukEvent(JajukEvents.QUEUE_NEED_REFRESH));
++//           }
++//         }
++//       }
++//     });
++//   }
++
++//   /**
++//    * Free Jintellipad resources.
++//    */
++//   public static void cleanup() {
++//     if (jintellitype != null) {
++//       jintellitype.cleanUp();
++//     }
++//   }
++// }
diff --git a/debian/patches/03_validation.diff b/debian/patches/03_validation.diff
deleted file mode 100644
index 07725ea..0000000
--- a/debian/patches/03_validation.diff
+++ /dev/null
@@ -1,130 +0,0 @@
-Build against the newer libsimple-validation-java API.
-
---- a/src/main/java/org/jajuk/ui/wizard/DeviceWizard.java
-+++ b/src/main/java/org/jajuk/ui/wizard/DeviceWizard.java
-@@ -41,7 +41,8 @@
- import javax.swing.JLabel;
- import javax.swing.JRadioButton;
- import javax.swing.JTextField;
--
-+import javax.swing.event.ChangeEvent;
-+import javax.swing.event.ChangeListener;
- import net.miginfocom.swing.MigLayout;
- 
- import org.jajuk.base.Device;
-@@ -66,9 +67,10 @@
- import org.netbeans.validation.api.Problems;
- import org.netbeans.validation.api.Severity;
- import org.netbeans.validation.api.Validator;
--import org.netbeans.validation.api.builtin.Validators;
-+import org.netbeans.validation.api.AbstractValidator;
-+import org.netbeans.validation.api.builtin.stringvalidation.StringValidators;
- import org.netbeans.validation.api.ui.ValidationGroup;
--import org.netbeans.validation.api.ui.ValidationPanel;
-+import org.netbeans.validation.api.ui.swing.ValidationPanel;
- 
- /**
-  * Device creation wizard.
-@@ -135,6 +137,8 @@
-   /** Validation group. */
-   private ValidationGroup vg;
- 
-+  private ChangeListener vglistener;
-+
-   /**
-    * Device wizard by default, is used for void configuration.
-    */
-@@ -211,15 +215,22 @@
-     bgSynchro.add(jrbBidirSynchro);
-     bgSynchro.add(jrbUnidirSynchro);
- 
-+    // buttons
-+    okp = new OKCancelPanel(this);
-+    okp.getOKButton().setEnabled(false);
-+
-     // Validation
-     ValidationPanel vp = new ValidationPanel();
-     vg = vp.getValidationGroup();
- 
-     installValidators();
- 
--    // buttons
--    okp = new OKCancelPanel(this);
--    okp.getOKButton().setEnabled(false);
-+    vp.addChangeListener(new ChangeListener() {
-+	    public void stateChanged(ChangeEvent changeEvent) {
-+		ValidationPanel v = (ValidationPanel)changeEvent.getSource();
-+		okp.getOKButton().setEnabled(v.getProblem()==null);
-+	    }
-+	});
- 
-     // Add items
-     setLayout(new MigLayout("insets 10,gapx 10, gapy 15", "[][grow]"));
-@@ -259,51 +270,40 @@
-   @SuppressWarnings("unchecked")
-   private void installValidators() {
-     // Auto-refresh interval validation : should be 0 or a double >= 0.5
--    vg.add(jtfAutoRefresh, Validators.REQUIRE_NON_NEGATIVE_NUMBER, Validators.NO_WHITESPACE,
--        Validators.REQUIRE_VALID_NUMBER, new Validator<String>() {
-+    vg.add(jtfAutoRefresh, StringValidators.REQUIRE_NON_NEGATIVE_NUMBER, StringValidators.NO_WHITESPACE,
-+        StringValidators.REQUIRE_VALID_NUMBER, new AbstractValidator<String>(String.class) {
-           @Override
--          public boolean validate(Problems problems, String compName, String model) {
-+          public void validate(Problems problems, String compName, String model) {
-             try {
-               double value = nformat.parse(model).doubleValue();
-               // If value is zero, validate the user input
-               boolean resu = (value == 0 || value >= 0.5d);
-               // If a problem occurred, add this problem to the problem stack
-               if (!resu) {
--                Problem problem = new Problem(Messages.getString("DeviceWizard.55"), Severity.FATAL);
--                problems.add(problem);
-+                problems.add(Messages.getString("DeviceWizard.55"), Severity.FATAL);
-               }
--              // Disable the wizard OK button if user selection is not in the
--              // right interval or if previous validators thrown an error
--              // already
--              okp.getOKButton().setEnabled(resu && problems.isEmpty());
--              return resu;
-+              return;
-             } catch (Exception e) {
-               // This happen when the text field is not yet populated (model is
-               // void). Note that wrong number format issues are already handled
-               // by the previous Validators
--              okp.getOKButton().setEnabled(false);
--              return true;
-+              return;
-             }
-           }
-         });
- 
-     // Validate device name
--    vg.add(jtfName, Validators.REQUIRE_NON_EMPTY_STRING);
--    vg.add(jtfName, new Validator<String>() {
-+    vg.add(jtfName, StringValidators.REQUIRE_NON_EMPTY_STRING);
-+    vg.add(jtfName,  new AbstractValidator<String>(String.class) {
-       @Override
--      public boolean validate(Problems problems, String compName, String model) {
--        // By default, we disable the OK button, we re-enable it only if the
--        // name is OK
--        okp.getOKButton().setEnabled(false);
--        for (Device deviceToCheck : DeviceManager.getInstance().getDevices()) {
--          // check for a new device with an existing name
--          if (bNew && (jtfName.getText().equalsIgnoreCase(deviceToCheck.getName()))) {
--            problems.add(new Problem(Messages.getErrorMessage(19), Severity.FATAL));
--            return false;
--          }
--        }
--        okp.getOKButton().setEnabled(problems.isEmpty());
--        return true;
-+      public void validate(Problems problems, String compName, String model) {
-+	  for (Device deviceToCheck : DeviceManager.getInstance().getDevices()) {
-+	      // check for a new device with an existing name
-+	      if (bNew && (jtfName.getText().equalsIgnoreCase(deviceToCheck.getName()))) {
-+		  problems.add(new Problem(Messages.getErrorMessage(19), Severity.FATAL));
-+		  return;
-+	      }
-+	  }
-       }
-     });
-   }
diff --git a/debian/patches/04_disable_update_check.patch b/debian/patches/04_disable_update_check.patch
new file mode 100644
index 0000000..18981fc
--- /dev/null
+++ b/debian/patches/04_disable_update_check.patch
@@ -0,0 +1,43 @@
+Description: disable jajuk's update check
+Author: Felix Natter <fnatter at gmx.net>
+Forwarded: not-needed
+Reviewed-by: Bertrand Florat <bertrand at florat.net>
+Last-Update: 2016-03-12
+
+--- a/src/main/java/org/jajuk/ui/actions/ActionManager.java
++++ b/src/main/java/org/jajuk/ui/actions/ActionManager.java
+@@ -239,4 +239,4 @@
+   public void enable(JajukAction action, boolean enable) {
+     action.enable(enable);
+   }
+-}
+\ No newline at end of file
++}
+--- a/src/main/java/org/jajuk/Main.java
++++ b/src/main/java/org/jajuk/Main.java
+@@ -121,7 +121,7 @@
+       // Set default fonts
+       FontManager.getInstance().setDefaultFont();
+       // Detect current release
+-      UpgradeManager.detectRelease();
++      //UpgradeManager.detectRelease();
+       // Set actual log verbosity. Depends on:
+       // Conf.load
+       if (!SessionService.isTestMode()) {
+--- a/src/main/java/org/jajuk/ui/actions/CheckForUpdateAction.java
++++ b/src/main/java/org/jajuk/ui/actions/CheckForUpdateAction.java
+@@ -50,6 +50,7 @@
+    */
+   @Override
+   public void perform(ActionEvent evt) throws JajukException {
++      /*
+     new Thread("CheckForUpdateAction") {
+       @Override
+       public void run() {
+@@ -66,5 +67,6 @@
+         }
+       }
+     }.start();
++      */
+   }
+ }
diff --git a/debian/patches/04_java8_compatibility.diff b/debian/patches/04_java8_compatibility.diff
deleted file mode 100644
index 17b0bdb..0000000
--- a/debian/patches/04_java8_compatibility.diff
+++ /dev/null
@@ -1,36 +0,0 @@
-Description: Modifies the build script to recognize Java 8
-Author: Emmanuel Bourg <ebourg at pache.org>
-Forwarded: no
---- a/src/scripts/build.xml
-+++ b/src/scripts/build.xml
-@@ -52,6 +52,7 @@
- 	<!--CONST-->
- 	<property name='jajuk.java.build.version6' value='1.6' />
- 	<property name='jajuk.java.build.version7' value='1.7' />
-+	<property name='jajuk.java.build.version8' value='1.8' />
- 	<property name='rootdir' value='/tmp/jajuk-dist' />
- 	<property name='installdir' value='/usr/share/jajuk/' />
- 	<property name='jnidir' value='/usr/lib/jajuk/' />
-@@ -81,19 +82,20 @@
- 	<property name='srcdir' value='${basedir}/src' />
- 
- 	<target name='get-jvm'>
--		<echo message='Verifying Java Version used for building, found version ${java.specification.version}, expecting ${jajuk.java.build.version6} or ${jajuk.java.build.version7}' />
-+		<echo message='Verifying Java Version used for building, found version ${java.specification.version}, expecting ${jajuk.java.build.version6}, ${jajuk.java.build.version7} or ${jajuk.java.build.version8}' />
- 		<condition property='jvm.not.ok'>
- 			<not>
- 				<or>
- 					<equals arg1='${java.specification.version}' arg2='${jajuk.java.build.version6}' />
- 					<equals arg1='${java.specification.version}' arg2='${jajuk.java.build.version7}' />
-+					<equals arg1='${java.specification.version}' arg2='${jajuk.java.build.version8}' />
- 				</or>
- 			</not>
- 		</condition>
- 	</target>
- 
- 	<target name='check-jvm' depends='get-jvm' if='jvm.not.ok'>
--		<fail message='Wrong Java version used for building: ${java.specification.version}, the build requires version ${jajuk.java.build.version6} or ${jajuk.java.build.version7}' />
-+		<fail message='Wrong Java version used for building: ${java.specification.version}, the build requires version ${jajuk.java.build.version6}, ${jajuk.java.build.version7} or ${jajuk.java.build.version8}' />
- 	</target>
- 
- 	<target name='startup' depends='check-jvm'>
diff --git a/debian/patches/series b/debian/patches/series
index ff96e38..e1dc43e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,4 @@
-01_override_manifest.diff
-02_lastfm_fix_0_1_0.diff
-03_validation.diff
-04_java8_compatibility.diff
+01_build.patch
+02_jaudiotagger.patch
+03_remove_WindowsHotKeyManager.patch
+04_disable_update_check.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jajuk.git



More information about the pkg-java-commits mailing list