mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-14 20:45: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:
parent
13f77d87d0
commit
9b1432cda7
2 changed files with 11 additions and 9 deletions
|
@ -100,5 +100,5 @@ RESID_SYNCHRONIZE_ACTIONS_MERGE_LABEL=Merge
|
||||||
RESID_SYNCHRONIZE_ACTIONS_MERGE_ALL_LABEL=Merge All
|
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?
|
||||||
|
|
||||||
|
|
|
@ -81,16 +81,18 @@ public class Synchronizer implements ISynchronizer {
|
||||||
// user should be prompted before disconnect or he/she will lose team synch info
|
// user should be prompted before disconnect or he/she will lose team synch info
|
||||||
if (connector.isConnected(project)){
|
if (connector.isConnected(project)){
|
||||||
|
|
||||||
String msg = NLS.bind(SystemImportExportResources.RESID_SYNCHRONIZE_DISCONNECT_WARNING, project.getName());
|
RepositoryProvider provider = RepositoryProvider.getProvider(project);
|
||||||
SystemMessage msgObj = new SimpleSystemMessage(RemoteImportExportPlugin.PLUGIN_ID, IStatus.WARNING, msg);
|
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);
|
SystemMessageDialog dlg = new SystemMessageDialog(SystemBasePlugin.getActiveWorkbenchShell(), msgObj);
|
||||||
if (dlg.openQuestionNoException(true)){
|
if (!dlg.openQuestionNoException(true)){
|
||||||
connector.disconnect(project);
|
return false;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connector.disconnect(project);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue