few more windows issues
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "dialog.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <window.h>
|
||||
#include <windows.h>
|
||||
#elif __unix__
|
||||
#else
|
||||
#include "toast.h"
|
||||
@@ -67,15 +67,9 @@ namespace anm2ed
|
||||
#endif
|
||||
}
|
||||
|
||||
void Dialog::reset()
|
||||
{
|
||||
*this = Dialog(this->window);
|
||||
}
|
||||
void Dialog::reset() { *this = Dialog(this->window); }
|
||||
|
||||
bool Dialog::is_selected(dialog::Type type)
|
||||
{
|
||||
return this->type == type && !path.empty();
|
||||
}
|
||||
bool Dialog::is_selected(dialog::Type type) { return this->type == type && !path.empty(); }
|
||||
|
||||
void Dialog::set_string_to_selected_path(std::string& string, dialog::Type type)
|
||||
{
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace anm2ed
|
||||
bool Document::autosave(std::string* errorString)
|
||||
{
|
||||
auto autosavePath = autosave_path_get();
|
||||
if (anm2.serialize(autosavePath, errorString))
|
||||
if (anm2.serialize(autosavePath.string(), errorString))
|
||||
{
|
||||
autosaveHash = hash;
|
||||
lastAutosaveTime = 0.0f;
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace anm2ed::imgui
|
||||
auto label = std::format(FILE_LABEL_FORMAT, file.filename().string(), file.string());
|
||||
|
||||
ImGui::PushID(i);
|
||||
if (ImGui::MenuItem(label.c_str())) manager.open(file);
|
||||
if (ImGui::MenuItem(label.c_str())) manager.open(file.string());
|
||||
ImGui::PopID();
|
||||
}
|
||||
|
||||
@@ -68,8 +68,8 @@ namespace anm2ed::imgui
|
||||
|
||||
if (ImGui::MenuItem("Save As", settings.shortcutSaveAs.c_str(), false, document))
|
||||
dialog.file_save(dialog::ANM2_SAVE);
|
||||
if (ImGui::MenuItem("Explore XML Location", nullptr, false, document))
|
||||
dialog.file_explorer_open(document->directory_get().string());
|
||||
if (ImGui::MenuItem("Explore XML Location", nullptr, false, document))
|
||||
dialog.file_explorer_open(document->directory_get().string());
|
||||
|
||||
ImGui::Separator();
|
||||
if (ImGui::MenuItem("Exit", settings.shortcutExit.c_str())) isQuitting = true;
|
||||
|
||||
@@ -54,8 +54,8 @@ namespace anm2ed
|
||||
{
|
||||
std::string errorString{};
|
||||
document->path = !path.empty() ? path : document->path.string();
|
||||
document->save(document->path, &errorString);
|
||||
recent_file_add(document->path);
|
||||
document->save(document->path.string(), &errorString);
|
||||
recent_file_add(document->path.string());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,5 +6,6 @@ namespace anm2ed::util::string
|
||||
{
|
||||
std::string to_lower(const std::string&);
|
||||
std::string backslash_replace(const std::string&);
|
||||
std::string quote(const std::string&);
|
||||
bool to_bool(const std::string&);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user