2015-06-15 18:14:07 -04:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "SlateFileDialogsPrivatePCH.h"
|
2015-06-18 19:27:23 -04:00
|
|
|
#include "SlateBasics.h"
|
2015-06-15 18:14:07 -04:00
|
|
|
#include "SlateFileDialogs.h"
|
|
|
|
|
#include "SlateFileDlgWindow.h"
|
2015-06-18 19:27:23 -04:00
|
|
|
#include "SlateFileDialogsStyles.h"
|
2015-06-15 18:14:07 -04:00
|
|
|
|
|
|
|
|
void FSlateFileDialogsModule::StartupModule()
|
|
|
|
|
{
|
|
|
|
|
SlateFileDialog = new FSlateFileDialogsModule();
|
2015-06-18 19:27:23 -04:00
|
|
|
|
|
|
|
|
FileDialogStyle = new FSlateFileDialogsStyle;
|
|
|
|
|
FileDialogStyle->Initialize();
|
2015-06-15 18:14:07 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FSlateFileDialogsModule::ShutdownModule()
|
|
|
|
|
{
|
|
|
|
|
if (SlateFileDialog != NULL)
|
|
|
|
|
{
|
2015-06-18 19:27:23 -04:00
|
|
|
FileDialogStyle->Shutdown();
|
|
|
|
|
delete FileDialogStyle;
|
|
|
|
|
|
2015-06-15 18:14:07 -04:00
|
|
|
delete SlateFileDialog;
|
|
|
|
|
SlateFileDialog = NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool FSlateFileDialogsModule::OpenFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
|
|
|
|
|
const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames, int32& OutFilterIndex)
|
|
|
|
|
{
|
2015-06-18 19:27:23 -04:00
|
|
|
FSlateFileDlgWindow dialog(FileDialogStyle);
|
2015-06-15 18:14:07 -04:00
|
|
|
return dialog.OpenFileDialog(ParentWindowHandle, DialogTitle, DefaultPath, DefaultFile, FileTypes, Flags, OutFilenames, OutFilterIndex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool FSlateFileDialogsModule::OpenFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
|
|
|
|
|
const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames)
|
|
|
|
|
{
|
2015-06-18 19:27:23 -04:00
|
|
|
FSlateFileDlgWindow dialog(FileDialogStyle);
|
2015-06-15 18:14:07 -04:00
|
|
|
return dialog.OpenFileDialog(ParentWindowHandle, DialogTitle, DefaultPath, DefaultFile, FileTypes, Flags, OutFilenames);
|
|
|
|
|
}
|
|
|
|
|
|
2015-06-18 19:27:23 -04:00
|
|
|
|
2015-06-15 18:14:07 -04:00
|
|
|
bool FSlateFileDialogsModule::OpenDirectoryDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
|
|
|
|
|
FString& OutFoldername)
|
|
|
|
|
{
|
2015-06-18 19:27:23 -04:00
|
|
|
FSlateFileDlgWindow dialog(FileDialogStyle);
|
2015-06-15 18:14:07 -04:00
|
|
|
return dialog.OpenDirectoryDialog(ParentWindowHandle, DialogTitle, DefaultPath, OutFoldername);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool FSlateFileDialogsModule::SaveFileDialog(const void* ParentWindowHandle, const FString& DialogTitle, const FString& DefaultPath,
|
|
|
|
|
const FString& DefaultFile, const FString& FileTypes, uint32 Flags, TArray<FString>& OutFilenames)
|
|
|
|
|
{
|
2015-06-18 19:27:23 -04:00
|
|
|
FSlateFileDlgWindow dialog(FileDialogStyle);
|
2015-06-15 18:14:07 -04:00
|
|
|
return dialog.SaveFileDialog(ParentWindowHandle, DialogTitle, DefaultPath, DefaultFile, FileTypes, Flags, OutFilenames);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ISlateFileDialogsModule* FSlateFileDialogsModule::Get()
|
|
|
|
|
{
|
|
|
|
|
return SlateFileDialog;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IMPLEMENT_MODULE(FSlateFileDialogsModule, SlateFileDialogs);
|