edit-dialog: fix time widgets sensitive when all day
This commit is contained in:
@@ -311,7 +311,6 @@
|
|||||||
<object class="GcalTimeSelector" id="start_time_selector">
|
<object class="GcalTimeSelector" id="start_time_selector">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="sensitive" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
|
||||||
<signal name="notify::time" handler="sync_datetimes" object="GcalEditDialog" swapped="yes" />
|
<signal name="notify::time" handler="sync_datetimes" object="GcalEditDialog" swapped="yes" />
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
@@ -326,7 +325,6 @@
|
|||||||
<object class="GcalTimeSelector" id="end_time_selector">
|
<object class="GcalTimeSelector" id="end_time_selector">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="sensitive" bind-source="GcalEditDialog" bind-property="writable" bind-flags="default" />
|
|
||||||
<signal name="notify::time" handler="sync_datetimes" object="GcalEditDialog" swapped="yes" />
|
<signal name="notify::time" handler="sync_datetimes" object="GcalEditDialog" swapped="yes" />
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
|
|||||||
+13
-6
@@ -260,14 +260,21 @@ static void
|
|||||||
gcal_edit_dialog_set_writable (GcalEditDialog *dialog,
|
gcal_edit_dialog_set_writable (GcalEditDialog *dialog,
|
||||||
gboolean writable)
|
gboolean writable)
|
||||||
{
|
{
|
||||||
if (dialog->writable != writable)
|
gboolean all_day;
|
||||||
{
|
|
||||||
dialog->writable = writable;
|
|
||||||
|
|
||||||
gtk_button_set_label (GTK_BUTTON (dialog->done_button), writable ? _("Save") : _("Done"));
|
if (dialog->writable == writable)
|
||||||
|
return;
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (dialog), "writable");
|
all_day = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->all_day_check));
|
||||||
}
|
|
||||||
|
gtk_widget_set_sensitive (dialog->start_time_selector, !all_day && writable);
|
||||||
|
gtk_widget_set_sensitive (dialog->end_time_selector, !all_day && writable);
|
||||||
|
|
||||||
|
gtk_button_set_label (GTK_BUTTON (dialog->done_button), writable ? _("Save") : _("Done"));
|
||||||
|
|
||||||
|
dialog->writable = writable;
|
||||||
|
|
||||||
|
g_object_notify (G_OBJECT (dialog), "writable");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user