Skip to content

Commit

Permalink
Merge pull request #757 from marhkb/gnome-circle/a11y
Browse files Browse the repository at this point in the history
Gnome-circle/a11y
  • Loading branch information
marhkb authored Dec 13, 2023
2 parents 1d1c39a + 9ba5fd4 commit 8d86651
Show file tree
Hide file tree
Showing 44 changed files with 126 additions and 144 deletions.
2 changes: 1 addition & 1 deletion Pods.doap
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns="http://usefulinc.com/ns/doap#">

<name xml:lang="en">Pods</name>
<shortdesc xml:lang="en">Keep track of your podman containers</shortdesc>
<shortdesc xml:lang="en">Manage your Podman containers</shortdesc>
<homepage rdf:resource="https://github.com/marhkb/pods" />
<bug-database rdf:resource="https://github.com/marhkb/pods/issues"/>
<programming-language>Rust</programming-language>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Pods
</h1>

<p align="center"><strong>Keep track of your podman containers</strong></p>
<p align="center"><strong>Manage your Podman containers</strong></p>

<p align="center">
<a href="https://flathub.org/apps/details/com.github.marhkb.Pods">
Expand Down
2 changes: 1 addition & 1 deletion data/com.github.marhkb.Pods.desktop.in.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Desktop Entry]
Name=Pods
Comment=Keep track of your podman containers
Comment=Manage your Podman containers
Type=Application
Exec=pods
Terminal=false
Expand Down
2 changes: 1 addition & 1 deletion data/com.github.marhkb.Pods.metainfo.xml.in.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<metadata_license>CC0</metadata_license>
<project_license>GPL-3.0</project_license>
<name>Pods</name>
<summary>Keep track of your podman containers</summary>
<summary>Manage your Podman containers</summary>
<description>
<p>Pods is a frontend for podman. It uses libadwaita for its user interface and strives to meet the design principles of GNOME.</p>
<p>With Pods you can, among other things:</p>
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ fn init() {
widget::PropertyWidgetRow::static_type();
widget::RandomNameEntryRow::static_type();
widget::ScalableTextView::static_type();
widget::SeparatorRow::static_type();
widget::SourceViewSearchWidget::static_type();
widget::Spinner::static_type();
widget::TextSearchEntry::static_type();
Expand Down
2 changes: 1 addition & 1 deletion src/model/connection_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ impl ConnectionManager {

if imp.connections.borrow().values().any(|c| c.name() == name) {
return Err(anyhow::anyhow!(gettext!(
"Connection '{}' already exists.",
"Connection '{}' already exists",
name
)));
}
Expand Down
1 change: 0 additions & 1 deletion src/resources.gresource.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
<file compressed="true" preprocess="xml-stripblanks">widget/property_row.ui</file>
<file compressed="true" preprocess="xml-stripblanks">widget/property_widget_row.ui</file>
<file compressed="true" preprocess="xml-stripblanks">widget/random_name_entry_row.ui</file>
<file compressed="true" preprocess="xml-stripblanks">widget/separator_row.ui</file>
<file compressed="true" preprocess="xml-stripblanks">widget/source_view_search_widget.ui</file>
<file compressed="true" preprocess="xml-stripblanks">widget/spinner.ui</file>
<file compressed="true" preprocess="xml-stripblanks">widget/text_search_entry.ui</file>
Expand Down
20 changes: 18 additions & 2 deletions src/view/client_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,22 @@ mod imp {
)
.build();

self.sidebar_list_box.set_header_func(|row, _| {
row.set_header(
row.child()
.filter(|child| {
child.is::<view::InfoRow>() || child.is::<view::SearchRow>()
})
.map(|_| {
gtk::Separator::builder()
.orientation(gtk::Orientation::Horizontal)
.hexpand(true)
.build()
})
.as_ref(),
);
});

self.color_bin
.style_context()
.add_provider(&self.css_provider, gtk::STYLE_PROVIDER_PRIORITY_APPLICATION);
Expand Down Expand Up @@ -186,8 +202,8 @@ mod imp {
"pods" => 1,
"images" => 2,
"volumes" => 3,
"info" => 5,
"search" => 7,
"info" => 4,
"search" => 5,
_ => unreachable!(),
},
)
Expand Down
8 changes: 0 additions & 8 deletions src/view/client_view.ui
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,6 @@
</object>
</child>

<child>
<object class="PdsSeparatorRow"/>
</child>

<child>
<object class="PdsInfoRow">
<binding name="client">
Expand All @@ -161,10 +157,6 @@
</object>
</child>

<child>
<object class="PdsSeparatorRow"/>
</child>

<child>
<object class="PdsSearchRow"/>
</child>
Expand Down
2 changes: 1 addition & 1 deletion src/view/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub(crate) fn show_ongoing_actions_warning_dialog(
.heading(heading)
.body_use_markup(true)
.body(gettext(
"There are ongoing actions whose progress will be irretrievably lost.",
"There are ongoing actions whose progress will be irretrievably lost",
))
.transient_for(&utils::root(widget))
.build();
Expand Down
30 changes: 28 additions & 2 deletions src/view/connection_creation_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ mod imp {
#[template_child]
pub(super) custom_url_radio_button: TemplateChild<gtk::CheckButton>,
#[template_child]
pub(super) url_entry_row: TemplateChild<adw::EntryRow>,
pub(super) custom_url_entry_row: TemplateChild<adw::EntryRow>,
#[template_child]
pub(super) color_dialog_button: TemplateChild<gtk::ColorDialogButton>,
#[template_child]
Expand Down Expand Up @@ -181,6 +181,32 @@ mod imp {
fn on_name_entry_row_changed(&self) {
self.obj().update_actions();
}

#[template_callback]
fn on_custom_url_entry_row_activated(&self) {
self.custom_url_radio_button.set_active(true);
}

#[template_callback]
fn on_custom_url_entry_row_changed(&self) {
self.custom_url_radio_button.set_active(true);
}

#[template_callback]
fn on_custom_url_entry_key_pressed(
&self,
key: gdk::Key,
_: u32,
_: gdk::ModifierType,
_: &gtk::EventControllerKey,
) -> glib::Propagation {
if key == gdk::Key::space {
self.custom_url_radio_button.set_active(true);
glib::Propagation::Stop
} else {
glib::Propagation::Proceed
}
}
}
}

Expand Down Expand Up @@ -222,7 +248,7 @@ impl ConnectionCreationPage {
if let Err(e) = self.connection_manager().try_connect(
imp.name_entry_row.text().as_str(),
if imp.custom_url_radio_button.is_active() {
imp.url_entry_row.text().into()
imp.custom_url_entry_row.text().into()
} else {
utils::unix_socket_url()
}
Expand Down
43 changes: 22 additions & 21 deletions src/view/connection_creation_page.ui
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,15 @@
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">URL</property>
<property name="description" translatable="yes">Choose how you want to connect to Podman.</property>
<property name="description" translatable="yes">Choose how to connect to Podman</property>

<child>
<object class="AdwActionRow" id="unix_socket_url_row">
<property name="title" translatable="yes">Unix Socket</property>
<property name="activatable-widget">unix_socket_radio_button</property>

<child type="prefix">
<object class="GtkCheckButton">
<object class="GtkCheckButton" id="unix_socket_radio_button">
<property name="active">True</property>
<property name="group">custom_url_radio_button</property>
<property name="valign">center</property>
Expand Down Expand Up @@ -251,32 +252,32 @@
</child>

<child>
<object class="AdwExpanderRow">
<property name="activatable">False</property>
<property name="enable-expansion" bind-source="custom_url_radio_button" bind-property="active" bind-flags="sync-create|bidirectional"/>
<property name="title" translatable="yes">Custom</property>
<object class="AdwEntryRow" id="custom_url_entry_row">
<signal name="entry-activated" handler="on_custom_url_entry_row_activated" swapped="true"/>
<signal name="changed" handler="on_custom_url_entry_row_changed" swapped="true"/>
<property name="title" translatable="yes">Custom URL</property>

<child type="prefix">
<object class="GtkCheckButton" id="custom_url_radio_button">
<property name="valign">center</property>
</object>
</child>

<child>
<object class="AdwEntryRow" id="url_entry_row">
<property name="title" translatable="yes">Connection String</property>

<child type="suffix">
<object class="GtkButton">
<style>
<class name="flat"/>
</style>
<property name="action-name">connection-creation-page.show-custom-info-dialog</property>
<property name="icon-name">dialog-information-symbolic</property>
<property name="valign">center</property>
</object>
</child>
<child type="suffix">
<object class="GtkButton">
<style>
<class name="flat"/>
</style>
<property name="action-name">connection-creation-page.show-custom-info-dialog</property>
<property name="icon-name">dialog-information-symbolic</property>
<property name="valign">center</property>
</object>
</child>

<child>
<object class="GtkEventControllerKey">
<signal name="key-pressed" handler="on_custom_url_entry_key_pressed" swapped="true"/>
<property name="propagation-phase">capture</property>
</object>
</child>

Expand All @@ -293,7 +294,7 @@
<object class="AdwActionRow">
<property name="activatable-widget">color_switch</property>
<property name="title" translatable="yes">Color</property>
<property name="subtitle" translatable="yes">Set the color of this connection.</property>
<property name="subtitle" translatable="yes">Set the color of this connection</property>

<child>
<object class="GtkBox">
Expand Down
4 changes: 2 additions & 2 deletions src/view/container_commit_page.ui
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
<child>
<object class="AdwSwitchRow" id="pause_switch_row">
<property name="title" translatable="yes">Pause</property>
<property name="subtitle" translatable="yes">Pause the container before committing it.</property>
<property name="subtitle" translatable="yes">Pause the container before committing it</property>
</object>
</child>

Expand All @@ -132,7 +132,7 @@
<child>
<object class="AdwPreferencesGroup">
<property name="title" translatable="yes">Changes</property>
<property name="description" translatable="yes">Instructions to apply while committing in Dockerfile format (i.e. "CMD=/bin/foo").</property>
<property name="description" translatable="yes">Instructions to apply while committing in Dockerfile format (i.e. "CMD=/bin/foo")</property>
<child>
<object class="GtkListBox" id="changes_list_box">
<style>
Expand Down
12 changes: 6 additions & 6 deletions src/view/container_creation_page.ui
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@

<child>
<object class="AdwSwitchRow" id="pull_latest_image_switch_row">
<property name="title" translatable="yes">Pull latest image</property>
<property name="title" translatable="yes">Pull Latest Image</property>
</object>
</child>

Expand All @@ -165,7 +165,7 @@
<child>
<object class="AdwExpanderRow">
<property name="enable-expansion" bind-source="memory_switch" bind-property="active" bind-flags="sync-create"/>
<property name="title" translatable="yes">Memory limit</property>
<property name="title" translatable="yes">Memory Limit</property>
<child type="action">
<object class="GtkSwitch" id="memory_switch">
<property name="valign">center</property>
Expand Down Expand Up @@ -357,7 +357,7 @@
<child>
<object class="AdwSpinRow">
<property name="title" translatable="yes">Interval</property>
<property name="subtitle" translatable="yes">Interval in seconds how often health check is run.</property>
<property name="subtitle" translatable="yes">Health check interval in seconds</property>
<property name="numeric">True</property>
<property name="adjustment">
<object class="GtkAdjustment" id="health_check_interval_value">
Expand All @@ -374,7 +374,7 @@
<child>
<object class="AdwSpinRow">
<property name="title" translatable="yes">Timeout</property>
<property name="subtitle" translatable="yes">The maximum time in seconds allowed to complete the health check before an interval is considered failed.</property>
<property name="subtitle" translatable="yes">Seconds allowed to complete the command before it fails</property>
<property name="numeric">True</property>
<property name="adjustment">
<object class="GtkAdjustment" id="health_check_timeout_value">
Expand All @@ -391,7 +391,7 @@
<child>
<object class="AdwSpinRow">
<property name="title" translatable="yes">Start Period</property>
<property name="subtitle" translatable="yes">The initialization time in seconds needed for a container to bootstrap.</property>
<property name="subtitle" translatable="yes">Initial delay of the command in seconds to grant the container time to boot</property>
<property name="numeric">True</property>
<property name="adjustment">
<object class="GtkAdjustment" id="health_check_start_period_value">
Expand All @@ -408,7 +408,7 @@
<child>
<object class="AdwSpinRow">
<property name="title" translatable="yes">Retries</property>
<property name="subtitle" translatable="yes">The number of retries allowed before a healthcheck is considered to be unhealthy.</property>
<property name="subtitle" translatable="yes">Number of retries allowed before a healthcheck fails</property>
<property name="numeric">True</property>
<property name="adjustment">
<object class="GtkAdjustment" id="health_check_retries_value">
Expand Down
Loading

0 comments on commit 8d86651

Please sign in to comment.