edit-dialog: requires date format for construct
Neccessary to pass it to GcalDateSelector & GcalTimeSelector without having to search the value again.
This commit is contained in:
committed by
Erick Pérez Castellanos
parent
0ad7dd54ab
commit
07e052ef9c
@@ -65,6 +65,7 @@ typedef struct
|
||||
ECalComponent *component;
|
||||
|
||||
/* flags */
|
||||
gboolean format_24h;
|
||||
gboolean event_is_new;
|
||||
gboolean setting_event;
|
||||
} GcalEditDialogPrivate;
|
||||
@@ -765,14 +766,18 @@ gcal_edit_dialog_all_day_changed (GtkWidget *widget,
|
||||
|
||||
/* Public API */
|
||||
GtkWidget*
|
||||
gcal_edit_dialog_new (void)
|
||||
gcal_edit_dialog_new (gboolean format_24h)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
GcalEditDialogPrivate *priv;
|
||||
|
||||
dialog = g_object_new (GCAL_TYPE_EDIT_DIALOG, NULL);
|
||||
priv = gcal_edit_dialog_get_instance_private (GCAL_EDIT_DIALOG (dialog));
|
||||
|
||||
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
|
||||
gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
|
||||
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
|
||||
priv->format_24h = format_24h;
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ struct _GcalEditDialogClass
|
||||
|
||||
GType gcal_edit_dialog_get_type (void);
|
||||
|
||||
GtkWidget* gcal_edit_dialog_new (void);
|
||||
GtkWidget* gcal_edit_dialog_new (gboolean format_24h);
|
||||
|
||||
void gcal_edit_dialog_set_event_is_new (GcalEditDialog *dialog,
|
||||
gboolean event_is_new);
|
||||
|
||||
+1
-1
@@ -1250,7 +1250,7 @@ gcal_window_constructed (GObject *object)
|
||||
gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (priv->calendars_button), G_MENU_MODEL (priv->calendar_menu));
|
||||
|
||||
/* edit dialog initialization */
|
||||
priv->edit_dialog = gcal_edit_dialog_new ();
|
||||
priv->edit_dialog = gcal_edit_dialog_new (use_24h_format);
|
||||
gtk_window_set_transient_for (GTK_WINDOW (priv->edit_dialog), GTK_WINDOW (object));
|
||||
gcal_edit_dialog_set_manager (GCAL_EDIT_DIALOG (priv->edit_dialog), priv->manager);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user