mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 07:05:39 +00:00
Added logic for handling local theme repository changes to GuiThemeDownloader
This commit is contained in:
parent
08ca3d8f4b
commit
eede78daf7
|
@ -305,7 +305,7 @@ bool GuiThemeDownloader::fetchRepository(std::pair<std::string, std::string> rep
|
||||||
|
|
||||||
if (statusEntryCount != 0) {
|
if (statusEntryCount != 0) {
|
||||||
if (allowReset) {
|
if (allowReset) {
|
||||||
LOG(LogWarning) << "Repository \"" << mRepositoryName
|
LOG(LogInfo) << "Repository \"" << mRepositoryName
|
||||||
<< "\" contains local changes, performing hard reset";
|
<< "\" contains local changes, performing hard reset";
|
||||||
git_object* objectHead {nullptr};
|
git_object* objectHead {nullptr};
|
||||||
errorCode = git_revparse_single(&objectHead, repository, "HEAD");
|
errorCode = git_revparse_single(&objectHead, repository, "HEAD");
|
||||||
|
@ -515,7 +515,7 @@ void GuiThemeDownloader::populateGUI()
|
||||||
std::promise<bool>().swap(mPromise);
|
std::promise<bool>().swap(mPromise);
|
||||||
mFuture = mPromise.get_future();
|
mFuture = mPromise.get_future();
|
||||||
mFetchThread = std::thread(&GuiThemeDownloader::fetchRepository, this,
|
mFetchThread = std::thread(&GuiThemeDownloader::fetchRepository, this,
|
||||||
std::make_pair(theme.reponame, theme.url), true);
|
std::make_pair(theme.reponame, theme.url), false);
|
||||||
});
|
});
|
||||||
mList->addRow(row);
|
mList->addRow(row);
|
||||||
}
|
}
|
||||||
|
@ -557,6 +557,25 @@ void GuiThemeDownloader::update(int deltaTime)
|
||||||
0.75f :
|
0.75f :
|
||||||
0.45f * (1.778f / mRenderer->getScreenAspectRatio()))));
|
0.45f * (1.778f / mRenderer->getScreenAspectRatio()))));
|
||||||
}
|
}
|
||||||
|
else if (mRepositoryError == RepositoryError::HAS_LOCAL_CHANGES) {
|
||||||
|
mWindow->pushGui(new GuiMsgBox(
|
||||||
|
getHelpStyle(),
|
||||||
|
"THEME REPOSITORY \"" + mRepositoryName +
|
||||||
|
"\" CONTAINS LOCAL CHANGES. PROCEED TO OVERWRITE YOUR CHANGES "
|
||||||
|
"OR ABORT TO SKIP ALL UPDATES FOR THIS THEME",
|
||||||
|
"PROCEED",
|
||||||
|
[this] {
|
||||||
|
std::promise<bool>().swap(mPromise);
|
||||||
|
mFuture = mPromise.get_future();
|
||||||
|
mFetchThread =
|
||||||
|
std::thread(&GuiThemeDownloader::fetchRepository, this,
|
||||||
|
std::make_pair(mRepositoryName, mUrl), true);
|
||||||
|
},
|
||||||
|
"ABORT", [] { return; }, "", nullptr, true, true,
|
||||||
|
(mRenderer->getIsVerticalOrientation() ?
|
||||||
|
0.75f :
|
||||||
|
0.45f * (1.778f / mRenderer->getScreenAspectRatio()))));
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
std::string errorMessage {"ERROR: "};
|
std::string errorMessage {"ERROR: "};
|
||||||
errorMessage.append(Utils::String::toUpper(mErrorMessage));
|
errorMessage.append(Utils::String::toUpper(mErrorMessage));
|
||||||
|
|
Loading…
Reference in a new issue