Skip to content

Commit

Permalink
chore: Update GNOME deps
Browse files Browse the repository at this point in the history
  • Loading branch information
marhkb committed Jul 21, 2023
1 parent 854684e commit 8d2e55f
Show file tree
Hide file tree
Showing 33 changed files with 532 additions and 442 deletions.
225 changes: 79 additions & 146 deletions Cargo.lock

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,34 @@ name = "pods"
version = "1.3.0-dev"
authors = ["Marcus Behrendt <marcus.behrendt.86@gmail.com>"]
edition = "2021"
# links = "libadwaita-1"

[dependencies]
adw = { version = "0.3", package = "libadwaita", features = ["v1_3"] }
adw = { git = "https://gitlab.gnome.org/World/Rust/libadwaita-rs", package = "libadwaita", features = ["v1_4"] }
anyhow = "1"
ashpd = { version = "0.4", default-features = false, features = ["gtk4", "tokio"] }
ashpd = { git = "https://github.com/bilelmoussaoui/ashpd.git", default-features = false, features = ["gtk4", "tokio"] }
futures = { version = "0.3", default-features = false }
gettext-rs = { version = "0.7", features = ["gettext-system"] }
gtk = { version = "0.6", package = "gtk4", features = ["gnome_44"] }
gtk = { git = "https://github.com/gtk-rs/gtk4-rs.git", package = "gtk4", features = ["gnome_44"] }
indexmap = { version = "1", features = ["serde"] }
log = "0.4"
names = { version = "0.14", default-features = false }
once_cell = "1"
oo7 = { version = "0.1", default-features = false, features = ["native_crypto", "tokio"] }
panel = { version = "0.2", package = "libpanel" }
panel = { git = "https://gitlab.gnome.org/World/Rust/libpanel-rs.git", package = "libpanel", features = ["adw_v1_2"] }
# panel = { version = "0.2", package = "libpanel" }
paste = "1"
podman-api = { git = "https://github.com/vv9k/podman-api-rs.git", commit = "363d945b9b9905c50dfa0bfe0f9331f9fdeef079", default-features = false }
regex = "1"
serde = "1"
serde_json = "1"
sourceview5 = "0.6"
sourceview5 = { git = "https://gitlab.gnome.org/World/Rust/sourceview5-rs.git" }
# sourceview5 = "0.6"
syslog = "6"
tokio = "1"
tokio-tar = "0.3"
vte = { version = "0.11", default-features = false }
vte4 = "0.6"
# vte4 = "0.6"

[profile.release]
lto = true
Expand Down
75 changes: 75 additions & 0 deletions build-aux/com.github.marhkb.Pods.Devel.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,81 @@
"*.a"
],
"modules": [
{
"name": "gtk",
"buildsystem": "meson",
"config-opts": [
"-Dintrospection=disabled",
"-Dbuild-demos=false",
"-Dbuild-testsuite=false",
"-Dbuild-examples=false",
"-Dbuild-tests=false"
],
"sources": [
{
"type": "git",
"url": "https://gitlab.gnome.org/GNOME/gtk.git",
"tag": "4.11.4"
}
]
},
{
"name": "appstream",
"buildsystem": "meson",
"config-opts": [
"-Dstemming=false",
"-Dapidocs=false"
],
"sources": [
{
"type": "git",
"url": "https://github.com/ximion/appstream.git",
"branch": "main"
}
],
"modules": [
{
"name": "libyaml",
"buildsystem": "autotools",
"sources": [
{
"type": "git",
"url": "https://github.com/yaml/libyaml.git"
}
]
},
{
"name": "libxmlb",
"buildsystem": "meson",
"config-opts": [
"-Dgtkdoc=false"
],
"sources": [
{
"type": "git",
"url": "https://github.com/hughsie/libxmlb.git",
"branch": "main"
}
]
}
]
},
{
"name": "libadwaita",
"buildsystem": "meson",
"config-opts": [
"-Dvapi=false",
"-Dtests=false",
"-Dexamples=false"
],
"sources": [
{
"type": "git",
"url": "https://gitlab.gnome.org/GNOME/libadwaita.git",
"tag": "1.4.alpha"
}
]
},
{
"name": "libpanel",
"buildsystem": "meson",
Expand Down
8 changes: 4 additions & 4 deletions src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ mod imp {

glib::timeout_add_seconds_local(
10,
clone!(@weak obj => @default-return glib::Continue(false), move || {
clone!(@weak obj => @default-return glib::ControlFlow::Break, move || {
obj.tick();
glib::Continue(true)
glib::ControlFlow::Continue
}),
);
}
Expand Down Expand Up @@ -207,11 +207,11 @@ impl Application {

let controller = gtk::EventControllerKey::new();
controller.connect_key_pressed(clone!(
@weak dialog => @default-return glib::signal::Inhibit(true), move |_, key, _, modifier| {
@weak dialog => @default-return glib::ControlFlow::Break, move |_, key, _, modifier| {
if key == gdk::Key::w && modifier == gdk::ModifierType::CONTROL_MASK{
dialog.close();
}
glib::signal::Inhibit(false)
glib::ControlFlow::Continue
}
));
dialog.add_controller(controller);
Expand Down
76 changes: 37 additions & 39 deletions src/model/action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,35 +216,33 @@ impl Action {
image,
move |image| stream::Abortable::new(image.push(&opts), abort_registration).boxed(),
clone!(
@weak obj => @default-return glib::Continue(false),
@weak obj => @default-return glib::ControlFlow::Break,
move |result: podman::Result<String>|
{
glib::Continue(
match result.map_err(anyhow::Error::from).and_then(|line| {
serde_json::from_str::<Report>(&line).map_err(anyhow::Error::from)
}) {
Ok(report) => match report.stream {
Some(line) => {
match result.map_err(anyhow::Error::from).and_then(|line| {
serde_json::from_str::<Report>(&line).map_err(anyhow::Error::from)
}) {
Ok(report) => match report.stream {
Some(line) => {
obj.insert(&line);
glib::ControlFlow::Continue
}
None => {
if let Some(line) = report.error {
log::error!("Error on pushing image: {line}");
obj.insert(&line);
true
}
None => {
if let Some(line) = report.error {
log::error!("Error on pushing image: {line}");
obj.insert(&line);
}
obj.set_state(State::Failed);
false
}
},
Err(e) => {
log::error!("Error on pushing image: {e}");
obj.insert_line(&e.to_string());
obj.set_state(State::Failed);
false
glib::ControlFlow::Break
}
},
)
Err(e) => {
log::error!("Error on pushing image: {e}");
obj.insert_line(&e.to_string());
obj.set_state(State::Failed);
glib::ControlFlow::Break
}
}
}),
clone!(@weak obj => move || {
if obj.state() != State::Failed {
Expand Down Expand Up @@ -281,21 +279,21 @@ impl Action {
}
},
clone!(
@weak obj, @weak client => @default-return glib::Continue(false),
@weak obj, @weak client => @default-return glib::ControlFlow::Break,
move |result: podman::Result<podman::models::ImageBuildLibpod200Response>|
{
glib::Continue(match result {
match result {
Ok(stream) => {
obj.insert(&stream.stream);
true
glib::ControlFlow::Continue
}
Err(e) => {
log::error!("Error on building image: {e}");
obj.insert_line(&e.to_string());
obj.set_state(State::Failed);
false
glib::ControlFlow::Break
},
})
}
}),
clone!(@weak obj, @weak client => move || {
let output = obj.output();
Expand Down Expand Up @@ -585,21 +583,21 @@ impl Action {
clone!(
@weak obj,
@strong buf
=> @default-return glib::Continue(false), move |result: podman::Result<Vec<u8>>|
=> @default-return glib::ControlFlow::Break, move |result: podman::Result<Vec<u8>>|
{
glib::Continue(match result {
match result {
Ok(chunk) => {
let mut buf = buf.lock().unwrap();
buf.extend(chunk);
obj.replace_last_line(&gettext!("Size: {}", glib::format_size(buf.len() as u64)));
true
glib::ControlFlow::Continue
}
Err(e) => {
obj.insert_line(&e.to_string());
obj.set_state(State::Failed);
false
glib::ControlFlow::Break
}
})
}
}),
clone!(@weak obj => move || {
let mut buf_ = Vec::<u8>::new();
Expand Down Expand Up @@ -696,35 +694,35 @@ impl Action {
client.podman().images(),
move |images| stream::Abortable::new(images.pull(&opts), abort_registration).boxed(),
clone!(
@weak self as obj, @weak client => @default-return glib::Continue(false),
@weak self as obj, @weak client => @default-return glib::ControlFlow::Break,
move |result: podman::Result<podman::models::LibpodImagesPullReport>|
{
glib::Continue(match result {
match result {
Ok(report) => match report.error {
Some(error) => {
log::error!("Error on downloading image: {error}");
obj.insert_line(&error);
obj.set_state(State::Failed);
false
glib::ControlFlow::Break
}
None => match report.stream {
Some(stream) => {
obj.insert(&stream);
true
glib::ControlFlow::Continue
}
None => {
op.clone()(obj, client, report);
false
glib::ControlFlow::Break
}
}
}
Err(e) => {
log::error!("Error on downloading image: {e}");
obj.insert_line(&e.to_string());
obj.set_state(State::Failed);
false
glib::ControlFlow::Break
},
})
}
}),
);

Expand Down
14 changes: 7 additions & 7 deletions src/model/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,10 @@ impl Client {
.boxed()
},
clone!(
@weak self as obj => @default-return glib::Continue(false),
@weak self as obj => @default-return glib::ControlFlow::Break,
move |result: podman::Result<podman::models::Event>|
{
glib::Continue(match result {
match result {
Ok(event) => {
log::debug!("Event: {event:?}");
match event.typ.as_str() {
Expand All @@ -391,14 +391,14 @@ impl Client {
}),
other => log::warn!("Unhandled event type: {other}"),
}
true
glib::ControlFlow::Continue
}
Err(e) => {
log::error!("Stopping image event stream due to error: {e}");
finish_op.clone()(e);
false
glib::ControlFlow::Break
}
})
}
}),
);
}
Expand All @@ -408,7 +408,7 @@ impl Client {
fn start_refresh_interval(&self) {
glib::timeout_add_seconds_local(
SYNC_INTERVAL,
clone!(@weak self as obj => @default-return glib::Continue(false), move || {
clone!(@weak self as obj => @default-return glib::ControlFlow::Break, move || {
log::debug!("Syncing images, containers and pods");

obj.image_list().refresh(|_| {});
Expand All @@ -417,7 +417,7 @@ impl Client {

log::debug!("Sleeping for {SYNC_INTERVAL} until next sync");

glib::Continue(true)
glib::ControlFlow::Continue
}),
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/model/container_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ mod imp {
.boxed()
},
clone!(
@weak obj => @default-return glib::Continue(false),
@weak obj => @default-return glib::ControlFlow::Break,
move |result: podman::Result<podman::models::ContainerStats200Response>|
{
match result
Expand Down Expand Up @@ -144,7 +144,7 @@ mod imp {
Err(e) => log::warn!("Error occurred on receiving stats stream element: {e}"),
}

glib::Continue(true)
glib::ControlFlow::Continue
}),
);

Expand Down
Loading

0 comments on commit 8d2e55f

Please sign in to comment.