diff options
12 files changed, 111 insertions, 23 deletions
@@ -45,7 +45,7 @@ <property name="inst.resrc" value="${sc.basedir}/resources/install"/> <property name='j2se_api' value='http://java.sun.com/j2se/1.5/docs/api' /> <property name='maxwarns' value='10000' /> - <property name='java.net.preferIPv6Addresses' value='true' /> + <property name='java.net.preferIPv6Addresses' value='false' /> <!-- set the build label property and make it take the cc bild into account --> <condition property="build.label" @@ -746,8 +746,8 @@ <sysproperty key="java.net.preferIPv6Addresses" value="${java.net.preferIPv6Addresses}"/> - <!--sysproperty key="net.java.sip.communicator.SC_HOME_DIR_LOCATION" - value="${user.home}/schome"/--> + <sysproperty key="net.java.sip.communicator.SC_HOME_DIR_LOCATION" + value="${user.home}/schome"/> <!-- this is a temporary option that would need to disappear once we finalize jingle --> diff --git a/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java b/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java index 51cb586..7908e54 100644 --- a/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java +++ b/src/net/java/sip/communicator/impl/resources/ResourceManagementServiceImpl.java @@ -25,7 +25,7 @@ import org.osgi.framework.*; * @author Damian Minkov * @author Yana Stamcheva * @author Lubomir Marinov - * @author Adam Netocny, CircleTech, s.r.o. + * @author Adam Netocny */ public class ResourceManagementServiceImpl implements ResourceManagementService, @@ -34,13 +34,34 @@ public class ResourceManagementServiceImpl private static Logger logger = Logger.getLogger(ResourceManagementServiceImpl.class); + /** + * Resources for currently loaded <tt>ColorPack</tt>. + */ private Map<String, String> colorResources; + + /** + * Currently loaded color pack. + */ private ResourcePack colorPack = null; + /** + * Resources for currently loaded <tt>ImagePack</tt>. + */ private Map<String, String> imageResources; + + /** + * Currently loaded image pack. + */ private ResourcePack imagePack = null; + /** + * Resources for currently loaded <tt>LanguagePack</tt>. + */ private Map<String, String> languageResources; + + /** + * Currently loaded language pack. + */ private LanguagePack languagePack = null; /** @@ -50,13 +71,34 @@ public class ResourceManagementServiceImpl */ private Locale languageLocale; + /** + * Resources for currently loaded <tt>SettingsPack</tt>. + */ private Map<String, String> settingsResources; + + /** + * Currently loaded settings pack. + */ private ResourcePack settingsPack = null; + /** + * Resources for currently loaded <tt>SoundPack</tt>. + */ private Map<String, String> soundResources; + + /** + * Currently loaded sound pack. + */ private ResourcePack soundPack = null; + /** + * Resources for currently loaded <tt>SkinPack</tt>. + */ private Map<String, String> skinResources; + + /** + * Currently loaded <tt>SkinPack</tt>. + */ private SkinPack skinPack = null; /** @@ -125,6 +167,7 @@ public class ResourceManagementServiceImpl /** * Searches for the <tt>ResourcePack</tt> corresponding to the given * <tt>className</tt> and <tt></tt>. + * * @param className The name of the resource class. * @param typeName The name of the type we're looking for. * For example: RESOURCE_NAME_DEFAULT_VALUE @@ -176,6 +219,8 @@ public class ResourceManagementServiceImpl /** * Handles all <tt>ServiceEvent</tt>s corresponding to <tt>ResourcePack</tt> * being registered or unregistered. + * + * @param event the <tt>ServiceEvent</tt> that notified us */ public void serviceChanged(ServiceEvent event) { @@ -760,6 +805,7 @@ public class ResourceManagementServiceImpl /** * Builds a new skin bundle from the zip file content. + * * @param zipFile Zip file with skin information. * @return <tt>File</tt> for the bundle. * @throws Exception When something goes wrong. diff --git a/src/net/java/sip/communicator/impl/resources/util/SkinJarBuilder.java b/src/net/java/sip/communicator/impl/resources/util/SkinJarBuilder.java index b657fe7..a84e5ea 100644 --- a/src/net/java/sip/communicator/impl/resources/util/SkinJarBuilder.java +++ b/src/net/java/sip/communicator/impl/resources/util/SkinJarBuilder.java @@ -12,12 +12,13 @@ import java.util.zip.*; /** * Class for building of skin bundles from zip files. - * @author Adam Netocny, CircleTech, s.r.o. + * @author Adam Netocny */ public class SkinJarBuilder { /** * Creates bundle from zip file. + * * @param zip Zip file with skin contents. * @return Jar <tt>File</tt>. * @throws Exception When something goes wrong. @@ -47,6 +48,10 @@ public class SkinJarBuilder /** * Creates a copy of skinresources.jar in temp folder. + * + * @return the location of the temp file. + * @throws IOException Is thrown if the jar cannot be located or if a file + * operation goes wrong. */ private static File cpTmp() throws IOException @@ -81,9 +86,13 @@ public class SkinJarBuilder /** * Unzip given file to temp folder. + * + * @param zip ZIP <tt>File</tt> to be unzipped. + * @return temporary directory with the content of the ZIP file. + * @throws IOException Is thrown if a file operation goes wrong. */ private static File unzipIntoTmp(File zip) - throws Exception + throws IOException { File dest = File.createTempFile("zip", null); @@ -131,7 +140,11 @@ public class SkinJarBuilder } /** - * Inserts files into zip file. + * Inserts files into ZIP file. + * + * @param jar Destination ZIP file to store the data. + * @param tmpDir Folder which contains the data. + * @throws IOException Is thrown if a file operation goes wrong. */ private static void insertIntoZip(File jar, File tmpDir) throws IOException @@ -173,7 +186,11 @@ public class SkinJarBuilder } /** - * Zip the content of a folder. + * Zips the content of a folder. + * @param dir2zip Path to the directory with the data to be stored. + * @param zos Opened <tt>ZipOutputStream</tt> in which will be information + * stored. + * @throws IOException Is thrown if a file operation goes wrong. */ private static void zipDir(String dir2zip, ZipOutputStream zos) throws IOException @@ -183,7 +200,12 @@ public class SkinJarBuilder } /** - * Zip a file. + * Zips a file. + * @param directory Path to the dir with the data to be stored. + * @param base Base path for cutting paths into zip entries. + * @param zos Opened <tt>ZipOutputStream</tt> in which will be information + * stored. + * @throws IOException Is thrown if a file operation goes wrong. */ private static final void zip(File directory, File base, ZipOutputStream zos) throws IOException @@ -212,7 +234,9 @@ public class SkinJarBuilder } /** - * Deletes a dir with all subdirs. + * Deletes a directory with all its sub-directories. + * + * @param tmp the directory to be deleted */ private static void deleteDir(File tmp) { @@ -237,6 +261,10 @@ public class SkinJarBuilder /** * Tests if the content of a folder has the same structure as the skin * content. + * + * @param tmpDir Directory to be tested. + * @return <tt>true</tt> - if the directory contains valid skin, else + * <tt>false</tt>. */ private static boolean test(File tmpDir) { @@ -330,8 +358,10 @@ public class SkinJarBuilder } /** - * Moves to toplevel dir for unziped files. (e.g. /dir/info.propreties will - * be changed to /info.properties.) + * Moves to top level directory for unziped files. (e.g. + * /dir/info.propreties will be changed to /info.properties.) + * @param tmpDir Directory in which is the skin unzipped. + * @return the top level directory */ private static File findBase(File tmpDir) { @@ -357,9 +387,21 @@ public class SkinJarBuilder if (!test) { - if (list.length == 1) + if (list.length != 0) { - return list[0]; + File tmp = null; + for (File f : list) + { + if(f.isDirectory()) + { + File tmp2 = findBase(f); + if(tmp2 != null && tmp == null) + { + tmp = tmp2; + } + } + } + return tmp; } else { diff --git a/src/net/java/sip/communicator/plugin/skinmanager/ManageButtonsPanel.java b/src/net/java/sip/communicator/plugin/skinmanager/ManageButtonsPanel.java index 34eaac1..a29bbce 100644 --- a/src/net/java/sip/communicator/plugin/skinmanager/ManageButtonsPanel.java +++ b/src/net/java/sip/communicator/plugin/skinmanager/ManageButtonsPanel.java @@ -21,7 +21,7 @@ import org.osgi.framework.*; * The panel containing all buttons for the <tt>PluginManagerConfigForm</tt>. * * @author Yana Stamcheva - * @author Adam Netocony, CircleTech, s.r.o. + * @author Adam Netocony */ public class ManageButtonsPanel extends TransparentPanel diff --git a/src/net/java/sip/communicator/plugin/skinmanager/SkinListCellRenderer.java b/src/net/java/sip/communicator/plugin/skinmanager/SkinListCellRenderer.java index 0a3faf2..7d3c696 100644 --- a/src/net/java/sip/communicator/plugin/skinmanager/SkinListCellRenderer.java +++ b/src/net/java/sip/communicator/plugin/skinmanager/SkinListCellRenderer.java @@ -25,7 +25,7 @@ import org.osgi.framework.*; * The cell border and background are repainted. * * @author Yana Stamcheva - * @author Adam Netocny, CircleTech, s.r.o. + * @author Adam Netocny */ public class SkinListCellRenderer extends JPanel diff --git a/src/net/java/sip/communicator/plugin/skinmanager/SkinManagerPanel.java b/src/net/java/sip/communicator/plugin/skinmanager/SkinManagerPanel.java index f1b3efc..8eecd17 100644 --- a/src/net/java/sip/communicator/plugin/skinmanager/SkinManagerPanel.java +++ b/src/net/java/sip/communicator/plugin/skinmanager/SkinManagerPanel.java @@ -18,7 +18,7 @@ import org.osgi.framework.*; /** * @author Yana Stamcheva - * @author Adam Netocny, CircleTech, s.r.o. + * @author Adam Netocny */ public class SkinManagerPanel extends TransparentPanel diff --git a/src/net/java/sip/communicator/plugin/skinmanager/SkinTableModel.java b/src/net/java/sip/communicator/plugin/skinmanager/SkinTableModel.java index eacb2d3..28768fd 100644 --- a/src/net/java/sip/communicator/plugin/skinmanager/SkinTableModel.java +++ b/src/net/java/sip/communicator/plugin/skinmanager/SkinTableModel.java @@ -16,7 +16,7 @@ import org.osgi.framework.*; * The <tt>TableModel</tt> of the table containing all plug-ins. * * @author Yana Stamcheva - * @author Adam Netocny, CircleTech, s.r.o. + * @author Adam Netocny */ public class SkinTableModel extends AbstractTableModel diff --git a/src/net/java/sip/communicator/plugin/skinmanager/skinmanager.manifest.mf b/src/net/java/sip/communicator/plugin/skinmanager/skinmanager.manifest.mf index 8919efa..21f7705 100644 --- a/src/net/java/sip/communicator/plugin/skinmanager/skinmanager.manifest.mf +++ b/src/net/java/sip/communicator/plugin/skinmanager/skinmanager.manifest.mf @@ -1,7 +1,7 @@ Bundle-Activator: net.java.sip.communicator.plugin.skinmanager.SkinManagerActivator Bundle-Name: Skin Manager plugin Bundle-Description: Manage all SIP Communicator skins. -Bundle-Vendor: sip-communicator.org, Adam Netocny, CircleTech, s.r.o. +Bundle-Vendor: sip-communicator.org Bundle-Version: 0.0.1 System-Bundle: yes Import-Package: org.osgi.framework, diff --git a/src/net/java/sip/communicator/plugin/skinresourcepack/SkinResourcesPack.java b/src/net/java/sip/communicator/plugin/skinresourcepack/SkinResourcesPack.java index 232182b..3bfbcbf 100644 --- a/src/net/java/sip/communicator/plugin/skinresourcepack/SkinResourcesPack.java +++ b/src/net/java/sip/communicator/plugin/skinresourcepack/SkinResourcesPack.java @@ -16,7 +16,7 @@ import net.java.sip.communicator.util.*; /** * The skin resource pack. - * @author Adam Netocny, CircleTech, s.r.o. + * @author Adam Netocny */ public class SkinResourcesPack implements BundleActivator, SkinPack diff --git a/src/net/java/sip/communicator/plugin/skinresourcepack/skinresourcepack.manifest.mf b/src/net/java/sip/communicator/plugin/skinresourcepack/skinresourcepack.manifest.mf index 25145bf..a1b4bad 100644 --- a/src/net/java/sip/communicator/plugin/skinresourcepack/skinresourcepack.manifest.mf +++ b/src/net/java/sip/communicator/plugin/skinresourcepack/skinresourcepack.manifest.mf @@ -6,4 +6,4 @@ Bundle-Version: 0.0.1 System-Bundle: no Import-Package: org.osgi.framework, net.java.sip.communicator.service.resources, - net.java.sip.communicator.util + net.java.sip.communicator.util
\ No newline at end of file diff --git a/src/net/java/sip/communicator/service/resources/ResourceManagementService.java b/src/net/java/sip/communicator/service/resources/ResourceManagementService.java index a89135b..024211c 100644 --- a/src/net/java/sip/communicator/service/resources/ResourceManagementService.java +++ b/src/net/java/sip/communicator/service/resources/ResourceManagementService.java @@ -18,7 +18,7 @@ import javax.swing.*; * some configurations. * * @author Damian Minkov - * @author Adam Netocny, CircleTech, s.r.o. + * @author Adam Netocny */ public interface ResourceManagementService { diff --git a/src/net/java/sip/communicator/service/resources/SkinPack.java b/src/net/java/sip/communicator/service/resources/SkinPack.java index 56f033f..bedd6fa 100644 --- a/src/net/java/sip/communicator/service/resources/SkinPack.java +++ b/src/net/java/sip/communicator/service/resources/SkinPack.java @@ -10,7 +10,7 @@ import java.util.*; /** * Default Skin Pack interface. - * @author Adam Netocny, CircleTech, s.r.o. + * @author Adam Netocny */ public interface SkinPack extends ResourcePack |