Skip to content
Snippets Groups Projects
Commit 4c923911 authored by bartvbl's avatar bartvbl
Browse files

I did a booboo

parent 4992796e
No related branches found
No related tags found
No related merge requests found
......@@ -121,9 +121,9 @@ class AnimationWindow {
void show_message(std::string title, std::string message, TDT4102::MessageType type = TDT4102::MessageType::INFO) const;
bool show_yesno_dialog(std::string title, std::string message, TDT4102::MessageType type = TDT4102::MessageType::QUESTION) const;
void show_notification(std::string title, std::string message, TDT4102::MessageType type = TDT4102::MessageType::INFO) const;
std::filesystem::path show_open_file_dialog(std::string title, std::string initialDirectory = std::filesystem::current_path()) const;
std::filesystem::path show_select_directory_dialog(std::string title, std::string initialDirectory = std::filesystem::current_path()) const;
std::filesystem::path show_save_file_dialog(std::string title, std::string initialDirectory = std::filesystem::current_path()) const;
std::filesystem::path show_open_file_dialog(std::string title, std::filesystem::path initialDirectory = std::filesystem::current_path()) const;
std::filesystem::path show_select_directory_dialog(std::string title, std::filesystem::path initialDirectory = std::filesystem::current_path()) const;
std::filesystem::path show_save_file_dialog(std::string title, std::filesystem::path initialDirectory = std::filesystem::current_path()) const;
// Getters for the window dimensions
int width() const;
......
......@@ -368,22 +368,22 @@ void TDT4102::AnimationWindow::show_notification(std::string title, std::string
pfd::notify(title, message, messageIcon);
}
std::filesystem::path TDT4102::AnimationWindow::show_open_file_dialog(std::string title, std::string initialDirectory) const {
std::vector<std::string> selectedFiles = pfd::open_file(title, initialDirectory).result();
std::filesystem::path TDT4102::AnimationWindow::show_open_file_dialog(std::string title, std::filesystem::path initialDirectory) const {
std::vector<std::string> selectedFiles = pfd::open_file(title, initialDirectory.string()).result();
if(selectedFiles.empty()) {
throw std::runtime_error("No file was selected!");
}
return selectedFiles.at(0);
return std::filesystem::path(selectedFiles.at(0));
}
std::filesystem::path TDT4102::AnimationWindow::show_select_directory_dialog(std::string title, std::string initialDirectory) const {
std::string selectedFile = pfd::select_folder(title, initialDirectory).result();
return selectedFile;
std::filesystem::path TDT4102::AnimationWindow::show_select_directory_dialog(std::string title, std::filesystem::path initialDirectory) const {
std::string selectedFile = pfd::select_folder(title, initialDirectory.string()).result();
return std::filesystem::path(selectedFile);
}
std::filesystem::path TDT4102::AnimationWindow::show_save_file_dialog(std::string title, std::string initialDirectory) const {
std::string selectedFile = pfd::save_file(title, initialDirectory).result();
return selectedFile;
std::filesystem::path TDT4102::AnimationWindow::show_save_file_dialog(std::string title, std::filesystem::path initialDirectory) const {
std::string selectedFile = pfd::save_file(title, initialDirectory.string()).result();
return std::filesystem::path(selectedFile);
}
TDT4102::Point TDT4102::AnimationWindow::getWindowDimensions() const {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment