Skip to content

Commit

Permalink
Merge pull request #835 from marhkb/fix/panels/search/show-all
Browse files Browse the repository at this point in the history
Fix/panels/search/show all
  • Loading branch information
marhkb authored Oct 10, 2024
2 parents cee3a5c + abce831 commit fde1c46
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 8 deletions.
7 changes: 6 additions & 1 deletion src/view/containers_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ mod imp {
);

klass.install_action(ACTION_SHOW_ALL_CONTAINERS, None, |widget, _, _| {
widget.set_show_only_running_containers(false);
widget.show_all_containers();
});
}

Expand Down Expand Up @@ -493,6 +493,11 @@ impl ContainersPanel {
.and_then(model::ContainerList::client)
}

pub(crate) fn show_all_containers(&self) {
self.set_show_only_running_containers(false);
self.set_search_mode(false);
}

pub(crate) fn set_search_mode(&self, value: bool) {
self.imp().search_bar.set_search_mode(value);
}
Expand Down
2 changes: 1 addition & 1 deletion src/view/containers_panel.ui
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
<property name="child">
<object class="AdwStatusPage">
<property name="icon-name">package-x-generic-symbolic</property>
<property name="title" translatable="yes">No Running Containers</property>
<property name="title" translatable="yes">No Matching Containers</property>

<child>
<object class="GtkButton">
Expand Down
7 changes: 6 additions & 1 deletion src/view/images_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ mod imp {
);

klass.install_action(ACTION_SHOW_ALL_IMAGES, None, |widget, _, _| {
widget.set_hide_intermediate_images(false);
widget.show_all_images();
});
}

Expand Down Expand Up @@ -419,6 +419,11 @@ impl Default for ImagesPanel {
}

impl ImagesPanel {
pub(crate) fn show_all_images(&self) {
self.set_hide_intermediate_images(false);
self.set_search_mode(false);
}

pub(crate) fn set_search_mode(&self, value: bool) {
self.imp().search_bar.set_search_mode(value);
}
Expand Down
2 changes: 1 addition & 1 deletion src/view/images_panel.ui
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
<property name="child">
<object class="AdwStatusPage">
<property name="icon-name">image-x-generic-symbolic</property>
<property name="title" translatable="yes">No Tagged Images</property>
<property name="title" translatable="yes">No Matching Images</property>

<child>
<object class="GtkButton">
Expand Down
7 changes: 6 additions & 1 deletion src/view/pods_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ mod imp {
);

klass.install_action(ACTION_SHOW_ALL_PODS, None, |widget, _, _| {
widget.set_show_only_running_pods(false);
widget.show_all_pods();
});
}

Expand Down Expand Up @@ -420,6 +420,11 @@ impl Default for PodsPanel {
}

impl PodsPanel {
pub(crate) fn show_all_pods(&self) {
self.set_show_only_running_pods(false);
self.set_search_mode(false);
}

pub(crate) fn set_search_mode(&self, value: bool) {
self.imp().search_bar.set_search_mode(value);
}
Expand Down
2 changes: 1 addition & 1 deletion src/view/pods_panel.ui
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
<property name="child">
<object class="AdwStatusPage">
<property name="icon-name">pods-symbolic</property>
<property name="title" translatable="yes">No Running Pods</property>
<property name="title" translatable="yes">No Matching Pods</property>

<child>
<object class="GtkButton">
Expand Down
7 changes: 6 additions & 1 deletion src/view/volumes_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ mod imp {
);

klass.install_action(ACTION_SHOW_ALL_VOLUMES, None, |widget, _, _| {
widget.set_show_only_used_volumes(false);
widget.show_all_volumes();
});
}

Expand Down Expand Up @@ -398,6 +398,11 @@ impl Default for VolumesPanel {
}

impl VolumesPanel {
pub(crate) fn show_all_volumes(&self) {
self.set_show_only_used_volumes(false);
self.set_search_mode(false);
}

pub(crate) fn set_search_mode(&self, value: bool) {
self.imp().search_bar.set_search_mode(value);
}
Expand Down
2 changes: 1 addition & 1 deletion src/view/volumes_panel.ui
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
<property name="child">
<object class="AdwStatusPage">
<property name="icon-name">drive-harddisk-symbolic</property>
<property name="title" translatable="yes">No Volumes in Use</property>
<property name="title" translatable="yes">No Matching Volumes</property>

<child>
<object class="GtkButton">
Expand Down

0 comments on commit fde1c46

Please sign in to comment.