window: Move synchronize button to the calendar popover

This commit is contained in:
Georges Basile Stavracas Neto
2019-05-10 13:10:50 -03:00
parent 0639b4e7ae
commit 405787307c
3 changed files with 18 additions and 9 deletions
+10
View File
@@ -29,6 +29,16 @@
</child>
</object>
</child>
<!-- Synchronize -->
<child>
<object class="GtkModelButton" id="synchronize_button">
<property name="visible">True</property>
<property name="action-name">app.sync</property>
<property name="text" translatable="yes">_Synchronize</property>
</object>
</child>
<child>
<object class="GtkButton" id="calendar_settings_button">
<property name="visible">True</property>
-9
View File
@@ -302,15 +302,6 @@
<property name="margin">12</property>
<property name="orientation">vertical</property>
<!-- Synchronize -->
<child>
<object class="GtkModelButton">
<property name="visible">True</property>
<property name="action-name">app.sync</property>
<property name="text" translatable="yes">_Synchronize</property>
</object>
</child>
<!-- Weather -->
<child>
<object class="GtkModelButton">
+8
View File
@@ -31,6 +31,7 @@ struct _GcalCalendarPopover
GtkWidget *calendar_listbox;
GtkStack *icon_stack;
GtkWidget *synchronize_button;
GcalContext *context;
@@ -298,6 +299,12 @@ gcal_calendar_popover_set_property (GObject *object,
for (l = calendars; l; l = l->next)
add_calendar (self, l->data);
g_object_bind_property (manager,
"synchronizing",
self->synchronize_button,
"sensitive",
G_BINDING_INVERT_BOOLEAN | G_BINDING_SYNC_CREATE);
g_signal_connect (manager, "calendar-added", G_CALLBACK (on_manager_calendar_added_cb), object);
g_signal_connect (manager, "calendar-removed", G_CALLBACK (on_manager_calendar_removed_cb), object);
g_signal_connect (manager, "calendar-changed", G_CALLBACK (on_manager_calendar_changed_cb), object);
@@ -337,6 +344,7 @@ gcal_calendar_popover_class_init (GcalCalendarPopoverClass *klass)
gtk_widget_class_bind_template_child (widget_class, GcalCalendarPopover, calendar_listbox);
gtk_widget_class_bind_template_child (widget_class, GcalCalendarPopover, icon_stack);
gtk_widget_class_bind_template_child (widget_class, GcalCalendarPopover, synchronize_button);
gtk_widget_class_bind_template_callback (widget_class, on_listbox_row_activated_cb);
}