mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 08:25:35 +00:00
GUI: FileBrowser: support initial filename
Certain callers may want to specify a default filename for their savegames. This is used in Director, where the file browser can be constructed with the filename field prefilled.
This commit is contained in:
parent
9b6d9b0c27
commit
1100f490ee
@ -38,7 +38,7 @@ enum {
|
||||
kChooseCmd = 'Chos'
|
||||
};
|
||||
|
||||
FileBrowserDialog::FileBrowserDialog(const char *title, const char *fileExtension, int mode, const char *fileMask)
|
||||
FileBrowserDialog::FileBrowserDialog(const char *title, const char *fileExtension, int mode, const char *fileMask, const char *initialFilename)
|
||||
: Dialog("FileBrowser"), _mode(mode), _fileExt(fileExtension) {
|
||||
|
||||
if (fileMask == NULL) {
|
||||
@ -52,7 +52,7 @@ FileBrowserDialog::FileBrowserDialog(const char *title, const char *fileExtensio
|
||||
new StaticTextWidget(this, "FileBrowser.Headline", title ? Common::convertToU32String(title) :
|
||||
mode == kFBModeLoad ? _("Choose file for loading") : _("Enter filename for saving"));
|
||||
|
||||
_fileName = new EditTextWidget(this, "FileBrowser.Filename", Common::U32String());
|
||||
_fileName = new EditTextWidget(this, "FileBrowser.Filename", Common::U32String(initialFilename));
|
||||
|
||||
if (mode == kFBModeLoad)
|
||||
_fileName->setEnabled(false);
|
||||
|
@ -38,7 +38,7 @@ enum {
|
||||
|
||||
class FileBrowserDialog : public Dialog {
|
||||
public:
|
||||
FileBrowserDialog(const char *title, const char *fileExtension, int mode, const char *fileMask = NULL);
|
||||
FileBrowserDialog(const char *title, const char *fileExtension, int mode, const char *fileMask = NULL, const char *initialFilename = NULL);
|
||||
|
||||
void open() override;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user