diff --git a/com.experimentalcraft.NekoPlayer.yml b/com.experimentalcraft.NekoPlayer.yml index 8cfeaa3..2888750 100644 --- a/com.experimentalcraft.NekoPlayer.yml +++ b/com.experimentalcraft.NekoPlayer.yml @@ -14,6 +14,18 @@ modules: - type: git url: https://codeberg.org/soundtouch/soundtouch.git tag: 2.3.2 + - name: libportal + buildsystem: meson + config-opts: + - -Dvapi=false + - -Ddocs=false + - -Dtests=false + - -Dintrospection=false + - -Dbackends=[] + sources: + - type: archive + url: https://github.com/flatpak/libportal/releases/download/0.6/libportal-0.6.tar.xz + sha256: 88a12c3ba71bc31acff7238c280de697d609cebc50830c3766776ec35abc6566 - name: player buildsystem: meson builddir: true diff --git a/file_browser.cpp b/file_browser.cpp index d1bb89d..6fab8f2 100644 --- a/file_browser.cpp +++ b/file_browser.cpp @@ -72,7 +72,7 @@ void FileBrowser::Open() { #ifdef PORTALS open = true; if (save) { - xdp_portal_save_file(portal, NULL, title.c_str(), "", pwd.c_str(), "", variant, NULL, NULL, XDP_SAVE_FILE_FLAG_NONE, NULL, &FileBrowser::FileBrowserSaveCallback, this); + xdp_portal_save_file(portal, NULL, title.c_str(), NULL, pwd.c_str(), NULL, variant, NULL, NULL, XDP_SAVE_FILE_FLAG_NONE, NULL, &FileBrowser::FileBrowserSaveCallback, this); } else { xdp_portal_open_file(portal, NULL, title.c_str(), variant, NULL, NULL, XDP_OPEN_FILE_FLAG_NONE, NULL, &FileBrowser::FileBrowserOpenCallback, this); } @@ -106,7 +106,7 @@ void FileBrowser::FileBrowserOpenCallback(GObject *src, GAsyncResult *res, gpoin str = str.substr(string("file://").length()); } self->open = false; - self->selected = path(str); + self->selected.emplace(path(str)); } void FileBrowser::FileBrowserSaveCallback(GObject *src, GAsyncResult *res, gpointer data) { @@ -134,7 +134,7 @@ void FileBrowser::FileBrowserSaveCallback(GObject *src, GAsyncResult *res, gpoin str = str.substr(string("file://").length()); } self->open = false; - self->selected = path(str); + self->selected.emplace(path(str)); } #endif diff --git a/theme.cpp b/theme.cpp index 975b1e5..a23cd7f 100644 --- a/theme.cpp +++ b/theme.cpp @@ -187,10 +187,12 @@ bool Theme::ShowEditor(bool* open, Theme* &theme) { path filename = selected_path.filename(); copy_file(selected_path, theme->themeDir / filename); theme->availableThemes.insert(filename); + importDialog.ClearSelected(); } if (exportDialog.HasSelected()) { - path selected_path = importDialog.GetSelected(); + path selected_path = exportDialog.GetSelected(); theme->Save(selected_path); + exportDialog.ClearSelected(); } if (loadOpen) { ImGui::OpenPopup("Load..."); @@ -298,6 +300,7 @@ void Theme::Apply(float hue) { } } void Theme::Save(string path) { + printf("Saving theme to %s...\n", path.c_str()); { Json::Value config; std::ofstream stream; @@ -344,7 +347,7 @@ void Theme::Save(string path) { updateAvailableThemes(); } void Theme::Save(path path) { - Save(path.string()); + Save((string)path.string()); } void Theme::updateAvailableThemes() { themeDir = path(prefPath) / path("themes");