mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +00:00
Added GuiTextEditPopup support to GuiApplicationUpdater
This commit is contained in:
parent
e1e8420306
commit
d0346d8c28
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "EmulationStation.h"
|
||||
#include "guis/GuiTextEditKeyboardPopup.h"
|
||||
#include "guis/GuiTextEditPopup.h"
|
||||
#include "utils/PlatformUtil.h"
|
||||
|
||||
#include <SDL2/SDL_timer.h>
|
||||
|
@ -124,14 +125,12 @@ GuiApplicationUpdater::GuiApplicationUpdater()
|
|||
std::string currentDownloadDirectory {
|
||||
Utils::FileSystem::getParent(mDownloadPackageFilename)};
|
||||
#endif
|
||||
mWindow->pushGui(new GuiTextEditKeyboardPopup(
|
||||
getHelpStyle(), 0.0f, "ENTER DOWNLOAD DIRECTORY", currentDownloadDirectory,
|
||||
[this, currentDownloadDirectory](std::string newDownloadDirectory) {
|
||||
auto directoryFunc = [this,
|
||||
currentDownloadDirectory](std::string newDownloadDirectory) {
|
||||
if (currentDownloadDirectory != newDownloadDirectory) {
|
||||
newDownloadDirectory.erase(
|
||||
// Remove trailing / and \ characters.
|
||||
std::find_if(newDownloadDirectory.rbegin(),
|
||||
newDownloadDirectory.rend(),
|
||||
std::find_if(newDownloadDirectory.rbegin(), newDownloadDirectory.rend(),
|
||||
[](char c) { return c != '/' && c != '\\'; })
|
||||
.base(),
|
||||
newDownloadDirectory.end());
|
||||
|
@ -154,8 +153,17 @@ GuiApplicationUpdater::GuiApplicationUpdater()
|
|||
Utils::FileSystem::getParent(mDownloadPackageFilename));
|
||||
#endif
|
||||
}
|
||||
},
|
||||
false));
|
||||
};
|
||||
if (Settings::getInstance()->getBool("VirtualKeyboard")) {
|
||||
mWindow->pushGui(new GuiTextEditKeyboardPopup(
|
||||
getHelpStyle(), 0.0f, "ENTER DOWNLOAD DIRECTORY", currentDownloadDirectory,
|
||||
directoryFunc, false));
|
||||
}
|
||||
else {
|
||||
mWindow->pushGui(
|
||||
new GuiTextEditPopup(getHelpStyle(), "ENTER DOWNLOAD DIRECTORY",
|
||||
currentDownloadDirectory, directoryFunc, false));
|
||||
}
|
||||
});
|
||||
buttons.push_back(mButton2);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue