switch to libcosmics builtin rfd instead of our own
This commit is contained in:
parent
66e33be26c
commit
54ef90442e
80
Cargo.lock
generated
80
Cargo.lock
generated
|
@ -324,25 +324,6 @@ dependencies = [
|
||||||
"libloading 0.8.6",
|
"libloading 0.8.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "ashpd"
|
|
||||||
version = "0.6.8"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "4ac22eda5891cc086690cb6fa10121c0390de0e3b04eb269f2d766b00d3f2d81"
|
|
||||||
dependencies = [
|
|
||||||
"async-fs 2.1.2",
|
|
||||||
"async-net",
|
|
||||||
"enumflags2",
|
|
||||||
"futures-channel",
|
|
||||||
"futures-util",
|
|
||||||
"once_cell",
|
|
||||||
"rand",
|
|
||||||
"serde",
|
|
||||||
"serde_repr",
|
|
||||||
"url",
|
|
||||||
"zbus 3.15.2",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ashpd"
|
name = "ashpd"
|
||||||
version = "0.8.1"
|
version = "0.8.1"
|
||||||
|
@ -424,18 +405,6 @@ dependencies = [
|
||||||
"slab",
|
"slab",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "async-fs"
|
|
||||||
version = "1.6.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06"
|
|
||||||
dependencies = [
|
|
||||||
"async-lock 2.8.0",
|
|
||||||
"autocfg",
|
|
||||||
"blocking",
|
|
||||||
"futures-lite 1.13.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-fs"
|
name = "async-fs"
|
||||||
version = "2.1.2"
|
version = "2.1.2"
|
||||||
|
@ -506,17 +475,6 @@ dependencies = [
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "async-net"
|
|
||||||
version = "2.0.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7"
|
|
||||||
dependencies = [
|
|
||||||
"async-io 2.4.0",
|
|
||||||
"blocking",
|
|
||||||
"futures-lite 2.6.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-process"
|
name = "async-process"
|
||||||
version = "1.8.1"
|
version = "1.8.1"
|
||||||
|
@ -4077,7 +4035,7 @@ dependencies = [
|
||||||
"image",
|
"image",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"palette 0.7.6",
|
"palette 0.7.6",
|
||||||
"rfd 0.14.1",
|
"rfd",
|
||||||
"ron 0.8.1",
|
"ron 0.8.1",
|
||||||
"serde",
|
"serde",
|
||||||
"slotmap",
|
"slotmap",
|
||||||
|
@ -4217,7 +4175,6 @@ dependencies = [
|
||||||
"libcosmic",
|
"libcosmic",
|
||||||
"miette",
|
"miette",
|
||||||
"pretty_assertions",
|
"pretty_assertions",
|
||||||
"rfd 0.12.1",
|
|
||||||
"rodio",
|
"rodio",
|
||||||
"ron 0.8.1",
|
"ron 0.8.1",
|
||||||
"serde",
|
"serde",
|
||||||
|
@ -4228,6 +4185,7 @@ dependencies = [
|
||||||
"tokio",
|
"tokio",
|
||||||
"tracing",
|
"tracing",
|
||||||
"tracing-subscriber",
|
"tracing-subscriber",
|
||||||
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -5877,31 +5835,6 @@ dependencies = [
|
||||||
"usvg",
|
"usvg",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "rfd"
|
|
||||||
version = "0.12.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "3c9e7b57df6e8472152674607f6cc68aa14a748a3157a857a94f516e11aeacc2"
|
|
||||||
dependencies = [
|
|
||||||
"ashpd 0.6.8",
|
|
||||||
"async-io 1.13.0",
|
|
||||||
"block",
|
|
||||||
"dispatch",
|
|
||||||
"futures-util",
|
|
||||||
"js-sys",
|
|
||||||
"log",
|
|
||||||
"objc",
|
|
||||||
"objc-foundation",
|
|
||||||
"objc_id",
|
|
||||||
"pollster",
|
|
||||||
"raw-window-handle 0.5.2",
|
|
||||||
"urlencoding",
|
|
||||||
"wasm-bindgen",
|
|
||||||
"wasm-bindgen-futures",
|
|
||||||
"web-sys",
|
|
||||||
"windows-sys 0.48.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rfd"
|
name = "rfd"
|
||||||
version = "0.14.1"
|
version = "0.14.1"
|
||||||
|
@ -8948,15 +8881,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6"
|
checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-broadcast 0.5.1",
|
"async-broadcast 0.5.1",
|
||||||
"async-executor",
|
|
||||||
"async-fs 1.6.0",
|
|
||||||
"async-io 1.13.0",
|
|
||||||
"async-lock 2.8.0",
|
|
||||||
"async-process 1.8.1",
|
"async-process 1.8.1",
|
||||||
"async-recursion",
|
"async-recursion",
|
||||||
"async-task",
|
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"blocking",
|
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"derivative",
|
"derivative",
|
||||||
"enumflags2",
|
"enumflags2",
|
||||||
|
@ -8991,7 +8918,7 @@ checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-broadcast 0.7.2",
|
"async-broadcast 0.7.2",
|
||||||
"async-executor",
|
"async-executor",
|
||||||
"async-fs 2.1.2",
|
"async-fs",
|
||||||
"async-io 2.4.0",
|
"async-io 2.4.0",
|
||||||
"async-lock 3.4.0",
|
"async-lock 3.4.0",
|
||||||
"async-process 2.3.0",
|
"async-process 2.3.0",
|
||||||
|
@ -9192,7 +9119,6 @@ dependencies = [
|
||||||
"libc",
|
"libc",
|
||||||
"serde",
|
"serde",
|
||||||
"static_assertions",
|
"static_assertions",
|
||||||
"url",
|
|
||||||
"zvariant_derive 3.15.2",
|
"zvariant_derive 3.15.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ description = "A cli presentation system"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "4.5.20", features = ["debug", "derive"] }
|
clap = { version = "4.5.20", features = ["debug", "derive"] }
|
||||||
libcosmic = { git = "https://github.com/pop-os/libcosmic", features = ["debug", "winit", "tokio", "xdg-portal", "dbus-config", "a11y", "wgpu", "multi-window", "single-instance"] }
|
libcosmic = { git = "https://github.com/pop-os/libcosmic", features = ["debug", "winit", "tokio", "rfd", "dbus-config", "a11y", "wgpu", "multi-window", "single-instance"] }
|
||||||
lexpr = "0.2.7"
|
lexpr = "0.2.7"
|
||||||
miette = { version = "7.2.0", features = ["fancy"] }
|
miette = { version = "7.2.0", features = ["fancy"] }
|
||||||
pretty_assertions = "1.4.1"
|
pretty_assertions = "1.4.1"
|
||||||
|
@ -28,5 +28,6 @@ rodio = { version = "0.20.1", features = ["symphonia-all", "tracing"] }
|
||||||
gstreamer = "0.23.3"
|
gstreamer = "0.23.3"
|
||||||
gstreamer-app = "0.23.3"
|
gstreamer-app = "0.23.3"
|
||||||
cosmic-time = "0.2.0"
|
cosmic-time = "0.2.0"
|
||||||
rfd = { version = "0.12.1", features = ["xdg-portal"], default-features = false }
|
url = "2"
|
||||||
|
# rfd = { version = "0.12.1", features = ["xdg-portal"], default-features = false }
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
use cosmic::dialog::ashpd::url::Url;
|
// use cosmic::dialog::ashpd::url::Url;
|
||||||
use crisp::types::{Keyword, Symbol, Value};
|
use crisp::types::{Keyword, Symbol, Value};
|
||||||
|
use gstreamer::query::Uri;
|
||||||
use iced_video_player::Video;
|
use iced_video_player::Video;
|
||||||
use miette::{miette, Result};
|
use miette::{miette, Result};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
@ -58,7 +59,7 @@ impl TryFrom<Background> for Video {
|
||||||
value: Background,
|
value: Background,
|
||||||
) -> std::result::Result<Self, Self::Error> {
|
) -> std::result::Result<Self, Self::Error> {
|
||||||
Video::new(
|
Video::new(
|
||||||
&Url::from_file_path(value.path)
|
&url::Url::from_file_path(value.path)
|
||||||
.map_err(|_| ParseError::BackgroundNotVideo)?,
|
.map_err(|_| ParseError::BackgroundNotVideo)?,
|
||||||
)
|
)
|
||||||
.map_err(|_| ParseError::BackgroundNotVideo)
|
.map_err(|_| ParseError::BackgroundNotVideo)
|
||||||
|
|
22
src/main.rs
22
src/main.rs
|
@ -455,29 +455,7 @@ impl cosmic::Application for App {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Message::Library(message) => {
|
Message::Library(message) => {
|
||||||
<<<<<<< HEAD
|
|
||||||
// debug!(?message);
|
|
||||||
let (mut kind, mut index): (LibraryKind, i32) =
|
|
||||||
(LibraryKind::Song, 0);
|
|
||||||
let mut opened_item = false;
|
|
||||||
match message {
|
|
||||||
library::Message::OpenItem(item) => {
|
|
||||||
let Some(item) = item else {
|
|
||||||
return ().into();
|
|
||||||
};
|
|
||||||
debug!("opening: {:?}", item);
|
|
||||||
kind = item.0;
|
|
||||||
index = item.1;
|
|
||||||
opened_item = true;
|
|
||||||
}
|
|
||||||
_ => {
|
|
||||||
// debug!("none");
|
|
||||||
()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
=======
|
|
||||||
let mut song = Song::default();
|
let mut song = Song::default();
|
||||||
>>>>>>> 93b021e (fixed lots of bugs by return Action enums in song_editor and library)
|
|
||||||
if let Some(library) = &mut self.library {
|
if let Some(library) = &mut self.library {
|
||||||
match library.update(message) {
|
match library.update(message) {
|
||||||
library::Action::OpenItem(None) => {
|
library::Action::OpenItem(None) => {
|
||||||
|
|
|
@ -2,7 +2,6 @@ use miette::{miette, IntoDiagnostic, Result};
|
||||||
use std::{fs::File, io::BufReader, path::PathBuf, sync::Arc};
|
use std::{fs::File, io::BufReader, path::PathBuf, sync::Arc};
|
||||||
|
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
dialog::ashpd::url::Url,
|
|
||||||
iced::{
|
iced::{
|
||||||
alignment::Horizontal,
|
alignment::Horizontal,
|
||||||
font::{Family, Stretch, Style, Weight},
|
font::{Family, Stretch, Style, Weight},
|
||||||
|
@ -26,6 +25,7 @@ use cosmic::{
|
||||||
use iced_video_player::{gst_pbutils, Position, Video, VideoPlayer};
|
use iced_video_player::{gst_pbutils, Position, Video, VideoPlayer};
|
||||||
use rodio::{Decoder, OutputStream, Sink};
|
use rodio::{Decoder, OutputStream, Sink};
|
||||||
use tracing::{debug, error, info, warn};
|
use tracing::{debug, error, info, warn};
|
||||||
|
use url::Url;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
core::{service_items::ServiceItemModel, slide::Slide},
|
core::{service_items::ServiceItemModel, slide::Slide},
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use std::{io, path::PathBuf};
|
use std::{io, path::PathBuf};
|
||||||
|
|
||||||
use cosmic::{
|
use cosmic::{
|
||||||
|
dialog::file_chooser::open::Dialog,
|
||||||
iced::{
|
iced::{
|
||||||
font::{Family, Stretch, Style, Weight},
|
font::{Family, Stretch, Style, Weight},
|
||||||
Font, Length,
|
Font, Length,
|
||||||
|
@ -432,12 +433,18 @@ impl Default for SongEditor {
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn pick_background() -> Result<PathBuf, SongError> {
|
async fn pick_background() -> Result<PathBuf, SongError> {
|
||||||
rfd::AsyncFileDialog::new()
|
let dialog = Dialog::new().title("Choose a background...");
|
||||||
.set_title("Choose a background...")
|
dialog
|
||||||
.pick_file()
|
.open_file()
|
||||||
.await
|
.await
|
||||||
.ok_or(SongError::DialogClosed)
|
.map_err(|_| SongError::DialogClosed)
|
||||||
.map(|file| file.path().to_owned())
|
.map(|file| file.url().to_file_path().unwrap())
|
||||||
|
// rfd::AsyncFileDialog::new()
|
||||||
|
// .set_title("Choose a background...")
|
||||||
|
// .pick_file()
|
||||||
|
// .await
|
||||||
|
// .ok_or(SongError::DialogClosed)
|
||||||
|
// .map(|file| file.path().to_owned())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
Loading…
Reference in a new issue