[gnome-todo] Adapt to GTK4 API changes
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo] Adapt to GTK4 API changes
- Date: Fri, 25 Sep 2020 20:31:44 +0000 (UTC)
commit 499c46cb8dbc5aa8d732619a004200be7aa713cb
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Fri Sep 25 17:29:50 2020 -0300
Adapt to GTK4 API changes
src/gui/gtd-new-task-row.c | 6 +++++-
src/gui/gtd-plugin-dialog-row.ui | 24 ++++++++++++------------
src/gui/gtd-provider-popover.ui | 28 ++++++++++++++--------------
src/gui/gtd-provider-row.ui | 20 ++++++++++----------
src/gui/gtd-provider-selector.c | 8 ++++----
src/gui/gtd-provider-selector.ui | 2 +-
src/gui/gtd-task-row.c | 8 ++++----
src/plugins/background/ui/preferences.ui | 24 ++++++++++++------------
tests/interactive/test-filter-sort.c | 8 ++++----
9 files changed, 66 insertions(+), 62 deletions(-)
---
diff --git a/src/gui/gtd-new-task-row.c b/src/gui/gtd-new-task-row.c
index 7e775ea..cd1aa59 100644
--- a/src/gui/gtd-new-task-row.c
+++ b/src/gui/gtd-new-task-row.c
@@ -243,7 +243,11 @@ gtd_new_task_row_dispose (GObject *object)
self->tasklist_popover = NULL;
}
- g_clear_pointer (&self->entry, gtk_widget_unparent);
+ if (self->entry)
+ {
+ gtk_widget_unparent (GTK_WIDGET (self->entry));
+ self->entry = NULL;
+ }
G_OBJECT_CLASS (gtd_new_task_row_parent_class)->dispose (object);
}
diff --git a/src/gui/gtd-plugin-dialog-row.ui b/src/gui/gtd-plugin-dialog-row.ui
index bf073bf..0d14aef 100644
--- a/src/gui/gtd-plugin-dialog-row.ui
+++ b/src/gui/gtd-plugin-dialog-row.ui
@@ -15,8 +15,8 @@
<property name="pixel_size">32</property>
<property name="icon_name">application-system-symbolic</property>
<layout>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="column">0</property>
+ <property name="row">0</property>
<property name="row-span">2</property>
</layout>
</object>
@@ -26,8 +26,8 @@
<property name="hexpand">1</property>
<property name="xalign">0</property>
<layout>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="column">1</property>
+ <property name="row">0</property>
</layout>
</object>
</child>
@@ -39,8 +39,8 @@
<class name="dim-label"/>
</style>
<layout>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="column">1</property>
+ <property name="row">1</property>
</layout>
</object>
</child>
@@ -52,8 +52,8 @@
<property name="icon_name">dialog-warning-symbolic</property>
<property name="pixel_size">16</property>
<layout>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
+ <property name="column">2</property>
+ <property name="row">0</property>
<property name="row-span">2</property>
</layout>
</object>
@@ -64,8 +64,8 @@
<property name="valign">center</property>
<signal name="notify::active" handler="loaded_switch_changed" object="GtdPluginDialogRow"
swapped="yes"/>
<layout>
- <property name="left_attach">3</property>
- <property name="top_attach">0</property>
+ <property name="column">3</property>
+ <property name="row">0</property>
<property name="row-span">2</property>
</layout>
</object>
@@ -87,8 +87,8 @@
</object>
</child>
<layout>
- <property name="left_attach">4</property>
- <property name="top_attach">0</property>
+ <property name="column">4</property>
+ <property name="row">0</property>
<property name="row-span">2</property>
</layout>
</object>
diff --git a/src/gui/gtd-provider-popover.ui b/src/gui/gtd-provider-popover.ui
index 3dd2479..d425ca4 100644
--- a/src/gui/gtd-provider-popover.ui
+++ b/src/gui/gtd-provider-popover.ui
@@ -33,8 +33,8 @@
<class name="suggested-action"/>
</style>
<layout>
- <property name="left_attach">1</property>
- <property name="top_attach">2</property>
+ <property name="column">1</property>
+ <property name="row">2</property>
</layout>
</object>
</child>
@@ -46,8 +46,8 @@
<property name="receives_default">1</property>
<signal name="clicked" handler="gtd_provider_popover__action_button_clicked"
object="GtdProviderPopover" swapped="yes"/>
<layout>
- <property name="left_attach">0</property>
- <property name="top_attach">2</property>
+ <property name="column">0</property>
+ <property name="row">2</property>
</layout>
</object>
</child>
@@ -59,8 +59,8 @@
<class name="dim-label"/>
</style>
<layout>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="column">0</property>
+ <property name="row">0</property>
<property name="column-span">2</property>
</layout>
</object>
@@ -93,8 +93,8 @@
<class name="linked"/>
</style>
<layout>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="column">0</property>
+ <property name="row">1</property>
<property name="column-span">2</property>
</layout>
</object>
@@ -121,8 +121,8 @@
</object>
</child>
<layout>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="column">0</property>
+ <property name="row">0</property>
<property name="column-span">1</property>
</layout>
</object>
@@ -132,8 +132,8 @@
<property name="hexpand">1</property>
<property name="label" translatable="yes">Select a storage location</property>
<layout>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="column">0</property>
+ <property name="row">0</property>
<property name="column-span">1</property>
</layout>
</object>
@@ -145,8 +145,8 @@
<property name="show_stub_rows">False</property>
<signal name="provider-selected" handler="gtd_provider_popover__provider_selected"
object="GtdProviderPopover" swapped="yes"/>
<layout>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="column">0</property>
+ <property name="row">1</property>
<property name="column-span">2</property>
</layout>
</object>
diff --git a/src/gui/gtd-provider-row.ui b/src/gui/gtd-provider-row.ui
index 3be8c0a..9c3ce60 100644
--- a/src/gui/gtd-provider-row.ui
+++ b/src/gui/gtd-provider-row.ui
@@ -16,8 +16,8 @@
<property name="visible">0</property>
<property name="icon_name">emblem-ok-symbolic</property>
<layout>
- <property name="left_attach">3</property>
- <property name="top_attach">0</property>
+ <property name="column">3</property>
+ <property name="row">0</property>
<property name="row-span">2</property>
</layout>
</object>
@@ -30,8 +30,8 @@
<class name="dim-label"/>
</style>
<layout>
- <property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="column">1</property>
+ <property name="row">1</property>
</layout>
</object>
</child>
@@ -40,8 +40,8 @@
<property name="pixel_size">32</property>
<property name="icon_name">goa-account</property>
<layout>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="column">0</property>
+ <property name="row">0</property>
<property name="row-span">2</property>
</layout>
</object>
@@ -50,8 +50,8 @@
<object class="GtkLabel" id="description">
<property name="xalign">0</property>
<layout>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="column">1</property>
+ <property name="row">0</property>
</layout>
</object>
</child>
@@ -59,8 +59,8 @@
<object class="GtkLabel" id="enabled">
<property name="label" translatable="yes">Off</property>
<layout>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
+ <property name="column">2</property>
+ <property name="row">0</property>
<property name="row-span">2</property>
</layout>
</object>
diff --git a/src/gui/gtd-provider-selector.c b/src/gui/gtd-provider-selector.c
index 678fd5a..5f8f5cb 100644
--- a/src/gui/gtd-provider-selector.c
+++ b/src/gui/gtd-provider-selector.c
@@ -176,8 +176,8 @@ gtd_provider_selector__listbox_row_activated (GtdProviderSelector *selector,
}
static void
-gtd_provider_selector__check_toggled (GtdProviderSelector *selector,
- GtkToggleButton *check)
+on_local_check_toggled_cb (GtdProviderSelector *selector,
+ GtkCheckButton *check)
{
g_return_if_fail (GTD_IS_PROVIDER_SELECTOR (selector));
@@ -187,7 +187,7 @@ gtd_provider_selector__check_toggled (GtdProviderSelector *selector,
* activated. No need to do this when deactivated, since we already did.
*/
- if (gtk_toggle_button_get_active (check))
+ if (gtk_check_button_get_active (check))
{
GtdProvider *local_provider;
@@ -466,7 +466,7 @@ gtd_provider_selector_class_init (GtdProviderSelectorClass *klass)
gtk_widget_class_bind_template_child (widget_class, GtdProviderSelector, local_check);
gtk_widget_class_bind_template_child (widget_class, GtdProviderSelector, owncloud_stub_row);
- gtk_widget_class_bind_template_callback (widget_class, gtd_provider_selector__check_toggled);
+ gtk_widget_class_bind_template_callback (widget_class, on_local_check_toggled_cb);
gtk_widget_class_bind_template_callback (widget_class, gtd_provider_selector__listbox_row_activated);
}
diff --git a/src/gui/gtd-provider-selector.ui b/src/gui/gtd-provider-selector.ui
index 1617cde..3a2a55c 100644
--- a/src/gui/gtd-provider-selector.ui
+++ b/src/gui/gtd-provider-selector.ui
@@ -99,7 +99,7 @@
<object class="GtkCheckButton" id="local_check">
<property name="label" translatable="yes">Or you can just store your tasks on this
computer</property>
<property name="can_focus">1</property>
- <signal name="toggled" handler="gtd_provider_selector__check_toggled" object="GtdProviderSelector"
swapped="yes"/>
+ <signal name="toggled" handler="on_local_check_toggled_cb" object="GtdProviderSelector"
swapped="yes"/>
</object>
</child>
</template>
diff --git a/src/gui/gtd-task-row.c b/src/gui/gtd-task-row.c
index e06a0be..e05f733 100644
--- a/src/gui/gtd-task-row.c
+++ b/src/gui/gtd-task-row.c
@@ -317,14 +317,14 @@ on_drag_cancelled_cb (GtkDragSource *source,
}
static void
-on_complete_check_toggled_cb (GtkToggleButton *button,
- GtdTaskRow *self)
+on_complete_check_toggled_cb (GtkCheckButton *button,
+ GtdTaskRow *self)
{
GTD_ENTRY;
g_assert (GTD_IS_TASK (self->task));
- gtd_task_set_complete (self->task, gtk_toggle_button_get_active (button));
+ gtd_task_set_complete (self->task, gtk_check_button_get_active (button));
gtd_provider_update_task (gtd_task_get_provider (self->task),
self->task,
NULL,
@@ -352,7 +352,7 @@ on_complete_changed_cb (GtdTaskRow *self,
/* Update the toggle button as well */
g_signal_handlers_block_by_func (self->done_check, on_complete_check_toggled_cb, self);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (self->done_check), complete);
+ gtk_check_button_set_active (GTK_CHECK_BUTTON (self->done_check), complete);
g_signal_handlers_unblock_by_func (self->done_check, on_complete_check_toggled_cb, self);
}
diff --git a/src/plugins/background/ui/preferences.ui b/src/plugins/background/ui/preferences.ui
index da760c7..b3224dc 100644
--- a/src/plugins/background/ui/preferences.ui
+++ b/src/plugins/background/ui/preferences.ui
@@ -29,8 +29,8 @@
<property name="can_focus">1</property>
<property name="valign">center</property>
<layout>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="column">1</property>
+ <property name="row">0</property>
<property name="row-span">2</property>
</layout>
</object>
@@ -41,8 +41,8 @@
<property name="label" translatable="yes">Run on Startup</property>
<property name="xalign">0</property>
<layout>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="column">0</property>
+ <property name="row">0</property>
</layout>
</object>
</child>
@@ -55,8 +55,8 @@
<class name="dim-label"/>
</style>
<layout>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="column">0</property>
+ <property name="row">1</property>
</layout>
</object>
</child>
@@ -89,8 +89,8 @@
<property name="can_focus">1</property>
<property name="valign">center</property>
<layout>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="column">1</property>
+ <property name="row">0</property>
<property name="row-span">2</property>
</layout>
</object>
@@ -101,8 +101,8 @@
<property name="label" translatable="yes">Show Notifications</property>
<property name="xalign">0</property>
<layout>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
+ <property name="column">0</property>
+ <property name="row">0</property>
</layout>
</object>
</child>
@@ -115,8 +115,8 @@
<class name="dim-label"/>
</style>
<layout>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
+ <property name="column">0</property>
+ <property name="row">1</property>
</layout>
</object>
</child>
diff --git a/tests/interactive/test-filter-sort.c b/tests/interactive/test-filter-sort.c
index 83ced6f..3894f50 100644
--- a/tests/interactive/test-filter-sort.c
+++ b/tests/interactive/test-filter-sort.c
@@ -145,13 +145,13 @@ sort_func (GObject *a,
GObject *b,
gpointer user_data)
{
- GtkToggleButton *check;
+ GtkCheckButton *check;
GtdTask *task_a;
GtdTask *task_b;
- check = (GtkToggleButton*) user_data;
+ check = (GtkCheckButton*) user_data;
- if (gtk_toggle_button_get_active (check))
+ if (gtk_check_button_get_active (check))
{
task_a = GTD_TASK (a);
task_b = GTD_TASK (b);
@@ -176,7 +176,7 @@ sort_func (GObject *a,
}
static void
-on_check_active_changed_cb (GtkToggleButton *check,
+on_check_active_changed_cb (GtkCheckButton *check,
GParamSpec *pspec,
GtdListModelSort *sort)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]