window: Move synchronize button to the calendar popover
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user