Auto-push to remote when loading new patch

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-12-31 18:02:08 +00:00
parent d0a354a411
commit abf1d4455a
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0

View file

@ -643,6 +643,10 @@ void loadPathDialog(const std::string& path, const bool asTemplate)
APP->patch->path = ""; APP->patch->path = "";
APP->history->setSaved(); APP->history->setSaved();
} }
if (remoteUtils::RemoteDetails* const remoteDetails = remoteUtils::getRemote())
if (remoteDetails->autoDeploy)
remoteUtils::sendFullPatchToRemote(remoteDetails);
}); });
#endif #endif
} }
@ -668,6 +672,10 @@ void loadSelectionDialog()
} }
std::free(pathC); std::free(pathC);
if (remoteUtils::RemoteDetails* const remoteDetails = remoteUtils::getRemote())
if (remoteDetails->autoDeploy)
remoteUtils::sendFullPatchToRemote(remoteDetails);
}); });
} }
@ -676,6 +684,10 @@ void loadTemplateDialog()
#ifndef HEADLESS_BEHAVIOUR #ifndef HEADLESS_BEHAVIOUR
promptClear("The current patch is unsaved. Clear it and start a new patch?", []() { promptClear("The current patch is unsaved. Clear it and start a new patch?", []() {
APP->patch->loadTemplate(); APP->patch->loadTemplate();
if (remoteUtils::RemoteDetails* const remoteDetails = remoteUtils::getRemote())
if (remoteDetails->autoDeploy)
remoteUtils::sendFullPatchToRemote(remoteDetails);
}); });
#endif #endif
} }
@ -687,6 +699,10 @@ void revertDialog()
return; return;
promptClear("Revert patch to the last saved state?", []{ promptClear("Revert patch to the last saved state?", []{
APP->patch->loadAction(APP->patch->path); APP->patch->loadAction(APP->patch->path);
if (remoteUtils::RemoteDetails* const remoteDetails = remoteUtils::getRemote())
if (remoteDetails->autoDeploy)
remoteUtils::sendFullPatchToRemote(remoteDetails);
}); });
#endif #endif
} }