Search in sources :

Example 1 with ISVNClientWrapper

use of org.tigris.subversion.clientadapter.ISVNClientWrapper in project subclipse by subclipse.

the class Preferences method setSvnClientConfigDir.

/**
 * set the svn client config dir
 *
 * @param configDir
 */
private void setSvnClientConfigDir(String configDir) {
    if (SVNUIPlugin.getPlugin().passwordStoresConfiguredOnLinux() && !SVNUIPlugin.getPlugin().getDialogSettings().getBoolean(UnsupportedPasswordStoresDialog.SETTING_DO_NOT_SHOW_AGAIN)) {
        if (!SVNUIPlugin.TEST_MODE) {
            ISVNClientWrapper clientWrapper = Activator.getDefault().getClientWrapper("javahl");
            String version = null;
            if (clientWrapper != null) {
                version = clientWrapper.getVersionString();
            }
            boolean bugFixed = version != null && new SvnVersion(version).isNewerThanOrEqualTo(SvnVersion.VERSION_1_8_11);
            if (!bugFixed) {
                Display.getDefault().syncExec(new Runnable() {

                    public void run() {
                        UnsupportedPasswordStoresDialog dialog = new UnsupportedPasswordStoresDialog(Display.getDefault().getActiveShell());
                        if (dialog.open() == UnsupportedPasswordStoresDialog.OK) {
                            try {
                                SVNUIPlugin.getPlugin().clearPasswordStoresFromConfiguration(false);
                            } catch (Exception e) {
                                SVNUIPlugin.log(IStatus.ERROR, e.getMessage(), e);
                                MessageDialog.openError(Display.getDefault().getActiveShell(), Messages.Preferences_0, e.getMessage());
                            }
                        } else {
                            SVNUIPlugin.getPlugin().getDialogSettings().put(UnsupportedPasswordStoresDialog.SETTING_DO_NOT_SHOW_AGAIN, dialog.isDoNotShowAgain());
                        }
                    }
                });
            }
        }
    }
    SVNProviderPlugin plugin = SVNProviderPlugin.getPlugin();
    SVNClientManager svnClientManager = plugin.getSVNClientManager();
    if (configDir == null || "".equals(configDir)) {
        // $NON-NLS-1$
        svnClientManager.setConfigDir(null);
    } else {
        File configDirFile = new File(configDir);
        svnClientManager.setConfigDir(configDirFile);
    }
}
Also used : SVNProviderPlugin(org.tigris.subversion.subclipse.core.SVNProviderPlugin) UnsupportedPasswordStoresDialog(org.tigris.subversion.subclipse.ui.dialogs.UnsupportedPasswordStoresDialog) File(java.io.File) SVNClientManager(org.tigris.subversion.subclipse.core.SVNClientManager) ISVNClientWrapper(org.tigris.subversion.clientadapter.ISVNClientWrapper)

Aggregations

File (java.io.File)1 ISVNClientWrapper (org.tigris.subversion.clientadapter.ISVNClientWrapper)1 SVNClientManager (org.tigris.subversion.subclipse.core.SVNClientManager)1 SVNProviderPlugin (org.tigris.subversion.subclipse.core.SVNProviderPlugin)1 UnsupportedPasswordStoresDialog (org.tigris.subversion.subclipse.ui.dialogs.UnsupportedPasswordStoresDialog)1