diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java | 38 | ||||
-rw-r--r-- | src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java | 68 |
2 files changed, 91 insertions, 15 deletions
diff --git a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java index 32e508f..493e371 100644 --- a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java +++ b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java @@ -50,6 +50,7 @@ public class GeneralConfigurationPanel private JComboBox notifConfigComboBox; private JComboBox localesConfigComboBox; + private JCheckBox updateCheckBox; public GeneralConfigurationPanel() { @@ -507,6 +508,26 @@ public class GeneralConfigurationPanel valuePanel.add(warnLabel); } } + if(!OSUtils.IS_MAC)// if we are not running mac + { + updateCheckBox = new SIPCommCheckBox(); + mainPanel.add(updateCheckBox); + mainPanel.add(new JSeparator()); + mainPanel.add(Box.createVerticalStrut(10)); + updateCheckBox.setText( + Resources.getString("plugin.generalconfig.CHECK_FOR_UPDATES")); + updateCheckBox.addActionListener(new ActionListener() { + + public void actionPerformed(ActionEvent e) + { + GeneralConfigPluginActivator.getConfigurationService() + .setProperty( + "net.java.sip.communicator.plugin.updatechecker.ENABLED", + Boolean.toString( + ((JCheckBox)e.getSource()).isSelected())); + } + }); + } // { // JPanel transparencyPanel = new JPanel(); // BorderLayout transparencyPanelLayout @@ -564,6 +585,9 @@ public class GeneralConfigurationPanel } } + /** + * Init default values. + */ private void initDefaults() { groupMessagesCheckBox.setSelected( @@ -597,8 +621,19 @@ public class GeneralConfigurationPanel bringToFrontCheckBox.setSelected( ConfigurationManager.isAutoPopupNewMessage()); + + if(!OSUtils.IS_MAC)// if we are not running mac + { + updateCheckBox.setSelected( + GeneralConfigPluginActivator.getConfigurationService().getBoolean(( + "net.java.sip.communicator.plugin.updatechecker.ENABLED"), true)); + } } + /** + * Returns the application name. + * @return + */ private String getApplicationName() { return Resources.getSettingsString("service.gui.APPLICATION_NAME"); @@ -692,6 +727,9 @@ public class GeneralConfigurationPanel } } + /** + * Init auto start checkbox. + */ private void initAutoStartCheckBox() { try diff --git a/src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java b/src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java index da1e5f4..dc22c2b 100644 --- a/src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java +++ b/src/net/java/sip/communicator/plugin/updatechecker/UpdateCheckActivator.java @@ -62,6 +62,12 @@ public class UpdateCheckActivator private static final String UPDATE_PASSWORD_CONFIG = "net.java.sip.communicator.plugin.updatechecker.UPDATE_SITE_PASSWORD"; + /** + * Property indicating whether update check is enabled. + */ + private static final String UPDATECHECKER_ENABLED = + "net.java.sip.communicator.plugin.updatechecker.ENABLED"; + static { removeDownloadRestrictions(); @@ -85,17 +91,23 @@ public class UpdateCheckActivator logger.logExit(); } + // check whether we are enabled + if(!getConfigurationService().getBoolean(UPDATECHECKER_ENABLED, true)) + return; + Thread updateThread = new Thread(new UpdateCheckThread()); updateThread.setDaemon(true); updateThread.start(); } /** - * stop the bundle - */ - public void stop(BundleContext bundleContext) throws Exception - { - } + * Stop the bundle. Nothing to stop for now. + * @param bundleContext + * @throws Exception + */ + public void stop(BundleContext bundleContext) + throws Exception + {} /** * Returns the <tt>BrowserLauncherService</tt> obtained from the bundle @@ -182,6 +194,10 @@ public class UpdateCheckActivator return uiService; } + /** + * Returns resource service. + * @return the resource service. + */ public static ResourceManagementService getResources() { if (resourcesService == null) @@ -201,8 +217,7 @@ public class UpdateCheckActivator /** * Check the first link as files on the web are sorted by date - * @param currentVersionStr - * @return + * @return whether we are using the latest version or not. */ private boolean isNewestVersion() { @@ -589,10 +604,17 @@ public class UpdateCheckActivator private class UpdateMenuButtonComponent extends AbstractPluginComponent { + /** + * The menu item to use. + */ private final JMenuItem updateMenuItem = new JMenuItem(getResources(). getI18NString("plugin.updatechecker.UPDATE_MENU_ENTRY")); + /** + * Creates update menu component. + * @param container + */ UpdateMenuButtonComponent(Container container) { super(container); @@ -624,23 +646,39 @@ public class UpdateCheckActivator private static class DummyTrustManager implements X509TrustManager { - - public void checkClientTrusted(X509Certificate[] arg0, String arg1) + /** + * Not used. + * @param chain + * @param authType + * @throws CertificateException + */ + public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException - { - } - - public void checkServerTrusted(X509Certificate[] arg0, String arg1) + {} + + /** + * Not used. + * @param chain + * @param authType + * @throws CertificateException + */ + public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException - { - } + {} + /** + * Accepts everything. + * @return + */ public X509Certificate[] getAcceptedIssuers() { return null; } } + /** + * The thread that do the actual checking. + */ private class UpdateCheckThread implements Runnable { |