few more windows issues

This commit is contained in:
2025-11-11 19:00:00 -05:00
parent 993f92e412
commit 517a8262a6
5 changed files with 10 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
#include "dialog.h" #include "dialog.h"
#ifdef _WIN32 #ifdef _WIN32
#include <window.h> #include <windows.h>
#elif __unix__ #elif __unix__
#else #else
#include "toast.h" #include "toast.h"
@@ -67,15 +67,9 @@ namespace anm2ed
#endif #endif
} }
void Dialog::reset() void Dialog::reset() { *this = Dialog(this->window); }
{
*this = Dialog(this->window);
}
bool Dialog::is_selected(dialog::Type type) bool Dialog::is_selected(dialog::Type type) { return this->type == type && !path.empty(); }
{
return this->type == type && !path.empty();
}
void Dialog::set_string_to_selected_path(std::string& string, dialog::Type type) void Dialog::set_string_to_selected_path(std::string& string, dialog::Type type)
{ {

View File

@@ -102,7 +102,7 @@ namespace anm2ed
bool Document::autosave(std::string* errorString) bool Document::autosave(std::string* errorString)
{ {
auto autosavePath = autosave_path_get(); auto autosavePath = autosave_path_get();
if (anm2.serialize(autosavePath, errorString)) if (anm2.serialize(autosavePath.string(), errorString))
{ {
autosaveHash = hash; autosaveHash = hash;
lastAutosaveTime = 0.0f; lastAutosaveTime = 0.0f;

View File

@@ -50,7 +50,7 @@ namespace anm2ed::imgui
auto label = std::format(FILE_LABEL_FORMAT, file.filename().string(), file.string()); auto label = std::format(FILE_LABEL_FORMAT, file.filename().string(), file.string());
ImGui::PushID(i); ImGui::PushID(i);
if (ImGui::MenuItem(label.c_str())) manager.open(file); if (ImGui::MenuItem(label.c_str())) manager.open(file.string());
ImGui::PopID(); ImGui::PopID();
} }
@@ -68,8 +68,8 @@ namespace anm2ed::imgui
if (ImGui::MenuItem("Save As", settings.shortcutSaveAs.c_str(), false, document)) if (ImGui::MenuItem("Save As", settings.shortcutSaveAs.c_str(), false, document))
dialog.file_save(dialog::ANM2_SAVE); dialog.file_save(dialog::ANM2_SAVE);
if (ImGui::MenuItem("Explore XML Location", nullptr, false, document)) if (ImGui::MenuItem("Explore XML Location", nullptr, false, document))
dialog.file_explorer_open(document->directory_get().string()); dialog.file_explorer_open(document->directory_get().string());
ImGui::Separator(); ImGui::Separator();
if (ImGui::MenuItem("Exit", settings.shortcutExit.c_str())) isQuitting = true; if (ImGui::MenuItem("Exit", settings.shortcutExit.c_str())) isQuitting = true;

View File

@@ -54,8 +54,8 @@ namespace anm2ed
{ {
std::string errorString{}; std::string errorString{};
document->path = !path.empty() ? path : document->path.string(); document->path = !path.empty() ? path : document->path.string();
document->save(document->path, &errorString); document->save(document->path.string(), &errorString);
recent_file_add(document->path); recent_file_add(document->path.string());
} }
} }

View File

@@ -6,5 +6,6 @@ namespace anm2ed::util::string
{ {
std::string to_lower(const std::string&); std::string to_lower(const std::string&);
std::string backslash_replace(const std::string&); std::string backslash_replace(const std::string&);
std::string quote(const std::string&);
bool to_bool(const std::string&); bool to_bool(const std::string&);
} }