1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-14 12:35:22 +02:00

[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
This commit is contained in:
David McKnight 2009-04-28 15:37:24 +00:00
parent 13f77d87d0
commit 9b1432cda7
2 changed files with 11 additions and 9 deletions

View file

@ -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?

View file

@ -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);
}
}