mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Perforce: prompt about offline state before commit or update
This commit is contained in:
+15
@@ -129,6 +129,11 @@ public abstract class AbstractCommonCheckinAction extends AbstractVcsAction {
|
||||
return;
|
||||
}
|
||||
|
||||
/*if (! checkEnvironments(plVcsManager)) {
|
||||
presentation.setEnabled(false);
|
||||
return;
|
||||
}*/
|
||||
|
||||
if (! approximatelyHasRoots(vcsContext)) {
|
||||
presentation.setEnabled(false);
|
||||
return;
|
||||
@@ -141,6 +146,16 @@ public abstract class AbstractCommonCheckinAction extends AbstractVcsAction {
|
||||
presentation.setVisible(true);
|
||||
}
|
||||
|
||||
/*protected static boolean checkEnvironments(ProjectLevelVcsManager plVcsManager) {
|
||||
final AbstractVcs[] allActiveVcss = plVcsManager.getAllActiveVcss();
|
||||
for (AbstractVcs vcs : allActiveVcss) {
|
||||
if (vcs.getCheckinEnvironment() != null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}*/
|
||||
|
||||
protected boolean forceSyncUpdate(final AnActionEvent e) {
|
||||
return true;
|
||||
}
|
||||
|
||||
+6
-4
@@ -91,10 +91,6 @@ public abstract class AbstractCommonUpdateAction extends AbstractVcsAction {
|
||||
|
||||
final Map<AbstractVcs, Collection<FilePath>> vcsToVirtualFiles = createVcsToFilesMap(roots, project);
|
||||
|
||||
if (showUpdateOptions || OptionsDialog.shiftIsPressed(context.getModifiers())) {
|
||||
showOptionsDialog(vcsToVirtualFiles, project, context);
|
||||
}
|
||||
|
||||
for (AbstractVcs vcs : vcsToVirtualFiles.keySet()) {
|
||||
final UpdateEnvironment updateEnvironment = myActionInfo.getEnvironment(vcs);
|
||||
if ((updateEnvironment != null) && (! updateEnvironment.validateOptions(vcsToVirtualFiles.get(vcs)))) {
|
||||
@@ -103,6 +99,10 @@ public abstract class AbstractCommonUpdateAction extends AbstractVcsAction {
|
||||
}
|
||||
}
|
||||
|
||||
if (showUpdateOptions || OptionsDialog.shiftIsPressed(context.getModifiers())) {
|
||||
showOptionsDialog(vcsToVirtualFiles, project, context);
|
||||
}
|
||||
|
||||
if (ApplicationManager.getApplication().isDispatchThread()) {
|
||||
ApplicationManager.getApplication().saveAll();
|
||||
}
|
||||
@@ -257,6 +257,7 @@ public abstract class AbstractCommonUpdateAction extends AbstractVcsAction {
|
||||
if (supportingVcsesAreEmpty(vcsManager, myActionInfo)) {
|
||||
presentation.setVisible(myAlwaysVisible);
|
||||
presentation.setEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
if (filterRootsBeforeAction()) {
|
||||
@@ -264,6 +265,7 @@ public abstract class AbstractCommonUpdateAction extends AbstractVcsAction {
|
||||
if (roots.length == 0) {
|
||||
presentation.setVisible(myAlwaysVisible);
|
||||
presentation.setEnabled(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user