From 9b1432cda7297470b75ff96e403586133ad4c6f0 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Tue, 28 Apr 2009 15:37:24 +0000 Subject: [PATCH] [272708] [import/export] fix various bugs with the synchronization support -added warning message for user who is about to disconnect from an existing team provider --- .../SystemImportExportResources.properties | 2 +- .../synchronize/provisional/Synchronizer.java | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/SystemImportExportResources.properties b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/SystemImportExportResources.properties index f3b91c6bb0e..e7e98a2d3be 100644 --- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/SystemImportExportResources.properties +++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/importexport/SystemImportExportResources.properties @@ -100,5 +100,5 @@ RESID_SYNCHRONIZE_ACTIONS_MERGE_LABEL=Merge RESID_SYNCHRONIZE_ACTIONS_MERGE_ALL_LABEL=Merge All -RESID_SYNCHRONIZE_DISCONNECT_WARNING=This operation will remove previous team sharing settings you had with {0}. Are you sure you want to do this? +RESID_SYNCHRONIZE_DISCONNECT_WARNING=This operation will remove previous team provider settings that were set for project {0}. Are you sure you want to do this? diff --git a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/synchronize/provisional/Synchronizer.java b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/synchronize/provisional/Synchronizer.java index 6b254d605d8..7be9974e91a 100644 --- a/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/synchronize/provisional/Synchronizer.java +++ b/rse/plugins/org.eclipse.rse.importexport/src/org/eclipse/rse/internal/synchronize/provisional/Synchronizer.java @@ -81,16 +81,18 @@ public class Synchronizer implements ISynchronizer { // user should be prompted before disconnect or he/she will lose team synch info if (connector.isConnected(project)){ - String msg = NLS.bind(SystemImportExportResources.RESID_SYNCHRONIZE_DISCONNECT_WARNING, project.getName()); - SystemMessage msgObj = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.WARNING, msg); + RepositoryProvider provider = RepositoryProvider.getProvider(project); + if (!(provider instanceof FileSystemProvider)){ + String msg = NLS.bind(SystemImportExportResources.RESID_SYNCHRONIZE_DISCONNECT_WARNING, project.getName()); + SystemMessage msgObj = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.WARNING, msg); - SystemMessageDialog dlg = new SystemMessageDialog(SystemBasePlugin.getActiveWorkbenchShell(), msgObj); - if (dlg.openQuestionNoException(true)){ - connector.disconnect(project); - } - else { - return false; + SystemMessageDialog dlg = new SystemMessageDialog(SystemBasePlugin.getActiveWorkbenchShell(), msgObj); + if (!dlg.openQuestionNoException(true)){ + return false; + } } + + connector.disconnect(project); } }