[libpanel] save-dialog-row: show save progress during operations
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libpanel] save-dialog-row: show save progress during operations
- Date: Tue, 13 Sep 2022 22:22:59 +0000 (UTC)
commit d721c56cc90070531a29aa44b9d2b057d16a3fa4
Author: Christian Hergert <chergert redhat com>
Date: Tue Sep 13 15:21:09 2022 -0700
save-dialog-row: show save progress during operations
src/panel-save-dialog-row.c | 23 +++++++++++++++++++++++
src/panel-save-dialog-row.ui | 2 +-
2 files changed, 24 insertions(+), 1 deletion(-)
---
diff --git a/src/panel-save-dialog-row.c b/src/panel-save-dialog-row.c
index 749ecba..bafc367 100644
--- a/src/panel-save-dialog-row.c
+++ b/src/panel-save-dialog-row.c
@@ -83,6 +83,23 @@ map_title_with_draft (GBinding *binding,
return TRUE;
}
+static gboolean
+map_progress_to_visible (GBinding *binding,
+ const GValue *from_value,
+ GValue *to_value,
+ gpointer user_data)
+{
+ double value;
+
+ g_assert (G_IS_BINDING (binding));
+ g_assert (G_VALUE_HOLDS_DOUBLE (from_value));
+ g_assert (G_VALUE_HOLDS_BOOLEAN (to_value));
+
+ value = g_value_get_double (from_value);
+ g_value_set_boolean (to_value, value > .0);
+ return TRUE;
+}
+
static void
panel_save_dialog_row_set_delegate (PanelSaveDialogRow *self,
PanelSaveDelegate *delegate)
@@ -98,6 +115,12 @@ panel_save_dialog_row_set_delegate (PanelSaveDialogRow *self,
delegate, NULL);
g_object_bind_property (delegate, "subtitle", self, "subtitle",
G_BINDING_SYNC_CREATE);
+ g_object_bind_property (delegate, "progress", self->progress, "progress",
+ G_BINDING_SYNC_CREATE);
+ g_object_bind_property_full (delegate, "progress", self->progress, "visible",
+ G_BINDING_SYNC_CREATE,
+ map_progress_to_visible, NULL,
+ NULL, NULL);
}
static void
diff --git a/src/panel-save-dialog-row.ui b/src/panel-save-dialog-row.ui
index 327db22..eb6d69f 100644
--- a/src/panel-save-dialog-row.ui
+++ b/src/panel-save-dialog-row.ui
@@ -11,7 +11,7 @@
</child>
<child type="suffix">
<object class="PanelProgressIcon" id="progress">
- <property name="progress">.66</property>
+ <property name="visible">false</property>
<property name="valign">center</property>
<property name="margin-start">6</property>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]