diff options
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r-- | calendar/gui/dialogs/Makefile.am | 3 | ||||
-rw-r--r-- | calendar/gui/dialogs/alarm-dialog.c | 9 | ||||
-rw-r--r-- | calendar/gui/dialogs/alarm-dialog.ui | 2 | ||||
-rw-r--r-- | calendar/gui/dialogs/alarm-list-dialog.c | 14 | ||||
-rw-r--r-- | calendar/gui/dialogs/cal-prefs-dialog.c | 4 | ||||
-rw-r--r-- | calendar/gui/dialogs/calendar-setup.c | 16 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor-util.c | 96 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 27 | ||||
-rw-r--r-- | calendar/gui/dialogs/delete-comp.c | 10 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-editor.c | 13 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 8 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.ui | 4 | ||||
-rw-r--r-- | calendar/gui/dialogs/memo-editor.c | 4 | ||||
-rw-r--r-- | calendar/gui/dialogs/memo-page.c | 8 | ||||
-rw-r--r-- | calendar/gui/dialogs/recur-comp.c | 7 | ||||
-rw-r--r-- | calendar/gui/dialogs/recurrence-page.c | 43 | ||||
-rw-r--r-- | calendar/gui/dialogs/schedule-page.c | 4 | ||||
-rw-r--r-- | calendar/gui/dialogs/send-comp.c | 10 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-details-page.c | 19 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-editor.c | 9 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.c | 4 |
21 files changed, 135 insertions, 179 deletions
diff --git a/calendar/gui/dialogs/Makefile.am b/calendar/gui/dialogs/Makefile.am index 6e9cb26c05..0bd89de799 100644 --- a/calendar/gui/dialogs/Makefile.am +++ b/calendar/gui/dialogs/Makefile.am @@ -15,7 +15,8 @@ libcal_dialogs_la_CPPFLAGS = \ -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" \ -DPREFIX=\""$(prefix)"\" \ $(GNOME_PLATFORM_CFLAGS) \ - $(EVOLUTION_CALENDAR_CFLAGS) + $(EVOLUTION_CALENDAR_CFLAGS) \ + $(CAMEL_CFLAGS) ecalendarincludedir = $(privincludedir)/calendar/gui/dialogs diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c index f7d5443da0..9fe23fe525 100644 --- a/calendar/gui/dialogs/alarm-dialog.c +++ b/calendar/gui/dialogs/alarm-dialog.c @@ -1209,6 +1209,7 @@ gboolean alarm_dialog_run (GtkWidget *parent, ECal *ecal, ECalComponentAlarm *alarm) { Dialog dialog; + GtkWidget *container; gint response_id; g_return_val_if_fail (alarm != NULL, FALSE); @@ -1234,8 +1235,12 @@ alarm_dialog_run (GtkWidget *parent, ECal *ecal, ECalComponentAlarm *alarm) alarm_to_dialog (&dialog); gtk_widget_ensure_style (dialog.toplevel); - gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog.toplevel)->vbox), 0); - gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog.toplevel)->action_area), 12); + + container = gtk_dialog_get_action_area (GTK_DIALOG (dialog.toplevel)); + gtk_container_set_border_width (GTK_CONTAINER (container), 12); + + container = gtk_dialog_get_content_area (GTK_DIALOG (dialog.toplevel)); + gtk_container_set_border_width (GTK_CONTAINER (container), 0); gtk_window_set_icon_name ( GTK_WINDOW (dialog.toplevel), "x-office-calendar"); diff --git a/calendar/gui/dialogs/alarm-dialog.ui b/calendar/gui/dialogs/alarm-dialog.ui index 94ae8009c4..bf6e570e4a 100644 --- a/calendar/gui/dialogs/alarm-dialog.ui +++ b/calendar/gui/dialogs/alarm-dialog.ui @@ -411,7 +411,7 @@ <child> <object class="GtkLabel" id="label1"> <property name="visible">True</property> - <property name="label" translatable="yes">extra times every</property> + <property name="label" translatable="yes" comments="This is part of the sentence: 'Repeat the alarm %d extra times every %d minutes'. Where %d are numbers.">extra times every</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_CENTER</property> diff --git a/calendar/gui/dialogs/alarm-list-dialog.c b/calendar/gui/dialogs/alarm-list-dialog.c index c350b4774d..b8588d666d 100644 --- a/calendar/gui/dialogs/alarm-list-dialog.c +++ b/calendar/gui/dialogs/alarm-list-dialog.c @@ -261,6 +261,7 @@ gboolean alarm_list_dialog_run (GtkWidget *parent, ECal *ecal, EAlarmList *list_store) { Dialog dialog; + GtkWidget *container; gint response_id; dialog.ecal = ecal; @@ -279,14 +280,19 @@ alarm_list_dialog_run (GtkWidget *parent, ECal *ecal, EAlarmList *list_store) sensitize_buttons (&dialog); gtk_widget_ensure_style (dialog.toplevel); - gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog.toplevel)->vbox), 0); - gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog.toplevel)->action_area), 12); + + container = gtk_dialog_get_action_area (GTK_DIALOG (dialog.toplevel)); + gtk_container_set_border_width (GTK_CONTAINER (container), 12); + + container = gtk_dialog_get_content_area (GTK_DIALOG (dialog.toplevel)); + gtk_container_set_border_width (GTK_CONTAINER (container), 0); gtk_window_set_icon_name ( GTK_WINDOW (dialog.toplevel), "x-office-calendar"); - gtk_window_set_transient_for (GTK_WINDOW (dialog.toplevel), - GTK_WINDOW (parent)); + gtk_window_set_transient_for ( + GTK_WINDOW (dialog.toplevel), + GTK_WINDOW (parent)); response_id = gtk_dialog_run (GTK_DIALOG (dialog.toplevel)); gtk_widget_hide (dialog.toplevel); diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c index f6ba176d00..914c26c3ec 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.c +++ b/calendar/gui/dialogs/cal-prefs-dialog.c @@ -779,8 +779,8 @@ calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs, /* date/time format */ table = e_builder_get_widget (prefs->builder, "datetime_format_table"); - e_datetime_format_add_setup_widget (table, 0, "calendar", "table", DTFormatKindDateTime, _("Time and date:")); - e_datetime_format_add_setup_widget (table, 1, "calendar", "table", DTFormatKindDate, _("Date only:")); + e_datetime_format_add_setup_widget (table, 0, "calendar", "table", DTFormatKindDateTime, _("Ti_me and date:")); + e_datetime_format_add_setup_widget (table, 1, "calendar", "table", DTFormatKindDate, _("_Date only:")); /* Hide senseless preferences when running in Express mode */ e_shell_hide_widgets_for_express_mode (shell, prefs->builder, diff --git a/calendar/gui/dialogs/calendar-setup.c b/calendar/gui/dialogs/calendar-setup.c index 9b396ce2cf..b21c027fe1 100644 --- a/calendar/gui/dialogs/calendar-setup.c +++ b/calendar/gui/dialogs/calendar-setup.c @@ -137,7 +137,7 @@ static GtkWidget * eccp_get_source_type (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data) { static GtkWidget *label, *type; - gint row; + guint row; CalendarSourceDialog *sdialog = data; ECalConfigTargetSource *t = (ECalConfigTargetSource *) ec->target; ESource *source = t->source; @@ -147,7 +147,7 @@ eccp_get_source_type (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidg if (old) gtk_widget_destroy (label); - row = ((GtkTable *)parent)->nrows; + g_object_get (parent, "n-rows", &row, NULL); if (sdialog->original_source) { label = gtk_label_new (_("Type:")); @@ -214,14 +214,14 @@ static GtkWidget * eccp_get_source_name (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidget *old, gpointer data) { static GtkWidget *label, *entry; - gint row; + guint row; ECalConfigTargetSource *t = (ECalConfigTargetSource *) ec->target; ESource *source = t->source; if (old) gtk_widget_destroy (label); - row = ((GtkTable*)parent)->nrows; + g_object_get (parent, "n-rows", &row, NULL); label = gtk_label_new_with_mnemonic (_("_Name:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); @@ -257,14 +257,14 @@ eccp_general_offline (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidg CalendarSourceDialog *sdialog = data; GtkWidget *offline_setting = NULL; const gchar *offline_sync; - gint row; + guint row; const gchar *base_uri = e_source_group_peek_base_uri (sdialog->source_group); gboolean is_local = base_uri && (g_str_has_prefix (base_uri, "file://") || g_str_has_prefix (base_uri, "contacts://")); offline_sync = e_source_get_property (sdialog->source, "offline_sync"); if (old) return old; else { - row = ((GtkTable*)parent)->nrows; + g_object_get (parent, "n-rows", &row, NULL); if (sdialog->source_type == E_CAL_SOURCE_TYPE_EVENT) offline_setting = gtk_check_button_new_with_mnemonic (_("Cop_y calendar contents locally for offline operation")); @@ -322,10 +322,12 @@ eccp_get_source_color (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWid { CalendarSourceDialog *sdialog = data; static GtkWidget *label, *color_button; - guint row = GTK_TABLE (parent)->nrows; + guint row; const gchar *color_spec = NULL; GdkColor color; + g_object_get (parent, "n-rows", &row, NULL); + if (old) gtk_widget_destroy (label); diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c index 9f96011eda..9856bd7c96 100644 --- a/calendar/gui/dialogs/comp-editor-util.c +++ b/calendar/gui/dialogs/comp-editor-util.c @@ -111,102 +111,6 @@ comp_editor_free_dates (CompEditorPageDates *dates) e_cal_component_free_icaltimetype (dates->complete); } -/* dtstart is only passed in if tt is the dtend. */ -static void -write_label_piece (struct icaltimetype *tt, - gchar *buffer, - gint size, - gchar *stext, - const gchar *etext, - struct icaltimetype *dtstart) -{ - struct tm tmp_tm = { 0 }; - struct icaltimetype tt_copy = *tt; - gint len; - - /* FIXME: May want to convert the time to an appropriate zone. */ - - if (stext != NULL) - strcat (buffer, stext); - - /* If we are writing the DTEND (i.e. DTSTART is set), and - DTEND > DTSTART, subtract 1 day. The DTEND date is not inclusive. */ - if (tt_copy.is_date && dtstart - && icaltime_compare_date_only (tt_copy, *dtstart) > 0) { - icaltime_adjust (&tt_copy, -1, 0, 0, 0); - } - - tmp_tm.tm_year = tt_copy.year - 1900; - tmp_tm.tm_mon = tt_copy.month - 1; - tmp_tm.tm_mday = tt_copy.day; - tmp_tm.tm_hour = tt_copy.hour; - tmp_tm.tm_min = tt_copy.minute; - tmp_tm.tm_sec = tt_copy.second; - tmp_tm.tm_isdst = -1; - - tmp_tm.tm_wday = time_day_of_week (tt_copy.day, tt_copy.month - 1, - tt_copy.year); - - len = strlen (buffer); - e_time_format_date_and_time (&tmp_tm, - calendar_config_get_24_hour_format (), - !tt_copy.is_date, FALSE, - &buffer[len], size - len); - if (etext != NULL) - strcat (buffer, etext); -} - -/** - * comp_editor_date_label: - * @dates: The dates to use in constructing a label - * @label: The label whose text is to be set - * - * Set the text of a label based on the dates available and the user's - * formatting preferences - **/ -void -comp_editor_date_label (CompEditorPageDates *dates, GtkWidget *label) -{ - gchar buffer[1024]; - gboolean start_set = FALSE, end_set = FALSE; - gboolean complete_set = FALSE, due_set = FALSE; - - buffer[0] = '\0'; - - if (dates->start && !icaltime_is_null_time (*dates->start->value)) - start_set = TRUE; - if (dates->end && !icaltime_is_null_time (*dates->end->value)) - end_set = TRUE; - if (dates->complete && !icaltime_is_null_time (*dates->complete)) - complete_set = TRUE; - if (dates->due && !icaltime_is_null_time (*dates->due->value)) - due_set = TRUE; - - if (start_set) - write_label_piece (dates->start->value, buffer, 1024, - NULL, NULL, NULL); - - if (start_set && end_set) - write_label_piece (dates->end->value, buffer, 1024, - _(" to "), NULL, dates->start->value); - - if (complete_set) { - if (start_set) - write_label_piece (dates->complete, buffer, 1024, _(" (Completed "), ")", NULL); - else - write_label_piece (dates->complete, buffer, 1024, _("Completed "), NULL, NULL); - } - - if (due_set && dates->complete == NULL) { - if (start_set) - write_label_piece (dates->due->value, buffer, 1024, _(" (Due "), ")", NULL); - else - write_label_piece (dates->due->value, buffer, 1024, _("Due "), NULL, NULL); - } - - gtk_label_set_text (GTK_LABEL (label), buffer); -} - /** * comp_editor_new_date_edit: * @show_date: Whether to show a date picker in the widget. diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 062e483562..010dd1cbf6 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -42,16 +42,6 @@ #include <e-util/gconf-bridge.h> #include <shell/e-shell.h> -#include <camel/camel-url.h> -#include <camel/camel-exception.h> -#include <camel/camel-folder.h> -#include <camel/camel-stream-mem.h> -#include <camel/camel-mime-message.h> -#include <camel/camel-file-utils.h> -#include <camel/camel-stream-fs.h> - -#include "mail/mail-tools.h" - #include "../print.h" #include "../comp-util.h" #include "save-comp.h" @@ -2974,7 +2964,8 @@ comp_editor_get_mime_attach_list (CompEditor *editor) EAttachment *attachment; CamelDataWrapper *wrapper; CamelMimePart *mime_part; - CamelStreamMem *mstream; + CamelStream *stream; + GByteArray *byte_array; guchar *buffer = NULL; const gchar *desc, *disp; gint column_id; @@ -2990,16 +2981,18 @@ comp_editor_get_mime_attach_list (CompEditor *editor) continue; cal_mime_attach = g_malloc0 (sizeof (struct CalMimeAttach)); - wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (mime_part)); - mstream = (CamelStreamMem *) camel_stream_mem_new (); + wrapper = camel_medium_get_content (CAMEL_MEDIUM (mime_part)); + + byte_array = g_byte_array_new (); + stream = camel_stream_mem_new_with_byte_array (byte_array); - camel_data_wrapper_decode_to_stream (wrapper, (CamelStream *) mstream); - buffer = g_memdup (mstream->buffer->data, mstream->buffer->len); + camel_data_wrapper_decode_to_stream (wrapper, stream); + buffer = g_memdup (byte_array->data, byte_array->len); camel_mime_part_set_content_id (mime_part, NULL); cal_mime_attach->encoded_data = (gchar *)buffer; - cal_mime_attach->length = mstream->buffer->len; + cal_mime_attach->length = byte_array->len; cal_mime_attach->filename = g_strdup (camel_mime_part_get_filename (mime_part)); desc = camel_mime_part_get_description (mime_part); if (!desc || *desc == '\0') @@ -3014,7 +3007,7 @@ comp_editor_get_mime_attach_list (CompEditor *editor) attach_list = g_slist_append (attach_list, cal_mime_attach); - camel_object_unref (mstream); + g_object_unref (stream); } diff --git a/calendar/gui/dialogs/delete-comp.c b/calendar/gui/dialogs/delete-comp.c index e0a431ffb7..ecdaf58762 100644 --- a/calendar/gui/dialogs/delete-comp.c +++ b/calendar/gui/dialogs/delete-comp.c @@ -166,12 +166,12 @@ delete_component_dialog (ECalComponent *comp, } static void -cb_toggled_cb (GtkWidget *toggle, gpointer data) +cb_toggled_cb (GtkToggleButton *toggle, gpointer data) { gboolean active = FALSE; GtkWidget *entry = (GtkWidget *) data; - active = GTK_TOGGLE_BUTTON (toggle)->active; + active = gtk_toggle_button_get_active (toggle); gtk_widget_set_sensitive (entry, active); } @@ -208,13 +208,13 @@ prompt_retract_dialog (ECalComponent *comp, gchar **retract_text, GtkWidget *par gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE); - gtk_box_set_spacing ((GtkBox *) (GTK_DIALOG (dialog)->vbox), 12); - vbox = GTK_WIDGET (GTK_DIALOG (dialog)->vbox); + vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + gtk_box_set_spacing (GTK_BOX (vbox), 12); cb = gtk_check_button_new_with_mnemonic (_("_Delete this item from all other recipient's mailboxes?")); gtk_container_add (GTK_CONTAINER (vbox), cb); - label = gtk_label_new_with_mnemonic ("_Retract comment"); + label = gtk_label_new_with_mnemonic (_("_Retract comment")); frame = gtk_frame_new (NULL); gtk_frame_set_label_widget ((GtkFrame *) frame, label); diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index 7184a63d9e..262751fa86 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -117,6 +117,7 @@ create_schedule_page (CompEditor *editor) EventEditorPrivate *priv; ENameSelector *name_selector; CompEditorPage *page; + GtkWidget *content_area; priv = EVENT_EDITOR_GET_PRIVATE (editor); @@ -124,6 +125,9 @@ create_schedule_page (CompEditor *editor) _("Free/Busy"), GTK_WINDOW (editor), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, NULL); + content_area = + gtk_dialog_get_content_area (GTK_DIALOG (priv->sched_window)); + g_signal_connect ( priv->sched_window, "response", G_CALLBACK (gtk_widget_hide), NULL); @@ -134,7 +138,7 @@ create_schedule_page (CompEditor *editor) priv->sched_page = schedule_page_new (priv->model, editor); page = COMP_EDITOR_PAGE (priv->sched_page); gtk_container_add ( - GTK_CONTAINER (GTK_DIALOG (priv->sched_window)->vbox), + GTK_CONTAINER (content_area), comp_editor_page_get_widget (page)); name_selector = event_page_get_name_selector (priv->event_page); @@ -282,6 +286,7 @@ event_editor_constructor (GType type, CompEditorPage *page; EventEditorPrivate *priv; GtkActionGroup *action_group; + GtkWidget *content_area; ECal *client; gboolean is_meeting; GtkWidget *alarm_page; @@ -317,6 +322,9 @@ event_editor_constructor (GType type, priv->recur_window, "delete-event", G_CALLBACK(gtk_widget_hide_on_delete), NULL); + content_area = + gtk_dialog_get_content_area (GTK_DIALOG (priv->recur_window)); + priv->recur_page = recurrence_page_new (editor); page = COMP_EDITOR_PAGE (priv->recur_page); if (!e_shell_get_express_mode(e_shell_get_default())) { @@ -556,6 +564,9 @@ event_editor_init (EventEditor *ee) g_error_free (error); } + action = comp_editor_get_action (editor, "print"); + gtk_action_set_tooltip (action, _("Print this event")); + /* Hide send options. */ action = comp_editor_get_action (editor, "send-options"); gtk_action_set_visible (action, FALSE); diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index f37861827d..1dfabb7597 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -2137,6 +2137,7 @@ get_widgets (EventPage *epage) EventPagePrivate *priv; GSList *accel_groups; GtkAction *action; + GtkWidget *parent; GtkWidget *toplevel; GtkWidget *sw; @@ -2178,7 +2179,8 @@ get_widgets (EventPage *epage) priv->attendees_label = GW ("attendees-label"); g_object_ref (priv->main); - gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main); + parent = gtk_widget_get_parent (priv->main); + gtk_container_remove (GTK_CONTAINER (parent), priv->main); priv->categories = GW ("categories"); priv->categories_btn = GW ("categories-button"); @@ -2457,11 +2459,7 @@ safe_to_process_date_changed_signal (GtkWidget *dedit_widget) entry = e_date_edit_get_entry (dedit); -#if GTK_CHECK_VERSION(2,19,7) return !entry || !gtk_widget_has_focus (entry); -#else - return !entry || !GTK_WIDGET_HAS_FOCUS (entry); -#endif } /* Callback used when the start date widget change. We check that the diff --git a/calendar/gui/dialogs/event-page.ui b/calendar/gui/dialogs/event-page.ui index 328b6eac42..061c0b1e43 100644 --- a/calendar/gui/dialogs/event-page.ui +++ b/calendar/gui/dialogs/event-page.ui @@ -323,7 +323,7 @@ <child> <object class="GtkLabel" id="summary-label"> <property name="visible">True</property> - <property name="label" translatable="yes">Su_mmary:</property> + <property name="label" translatable="yes">_Summary:</property> <property name="use_underline">True</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_CENTER</property> @@ -858,7 +858,7 @@ <child> <object class="GtkLabel" id="attendees-label"> <property name="visible">True</property> - <property name="label" translatable="yes">Attendee_s...</property> + <property name="label" translatable="yes">Atte_ndees...</property> <property name="use_underline">True</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> diff --git a/calendar/gui/dialogs/memo-editor.c b/calendar/gui/dialogs/memo-editor.c index 8e988c00a5..9486ef6770 100644 --- a/calendar/gui/dialogs/memo-editor.c +++ b/calendar/gui/dialogs/memo-editor.c @@ -133,6 +133,7 @@ memo_editor_init (MemoEditor *me) { CompEditor *editor = COMP_EDITOR (me); GtkUIManager *ui_manager; + GtkAction *action; const gchar *id; GError *error = NULL; @@ -150,6 +151,9 @@ memo_editor_init (MemoEditor *me) g_critical ("%s: %s", G_STRFUNC, error->message); g_error_free (error); } + + action = comp_editor_get_action (editor, "print"); + gtk_action_set_tooltip (action, _("Print this memo")); } /** diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index adb10dc9fa..8ffe45d2c5 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -438,12 +438,14 @@ fill_comp_with_recipients (ENameSelector *name_selector, ECalComponent *comp) if (contact && e_contact_get (contact , E_CONTACT_IS_LIST)) { EBook *book = NULL; ENameSelectorDialog *dialog; + ENameSelectorModel *model; EContactStore *c_store; GList *books, *l; gchar *uri = e_contact_get (contact, E_CONTACT_BOOK_URI); dialog = e_name_selector_peek_dialog (name_selector); - c_store = e_name_selector_dialog_peek_model (dialog)->contact_store; + model = e_name_selector_dialog_peek_model (dialog); + c_store = e_name_selector_model_peek_contact_store (model); books = e_contact_store_get_books (c_store); for (l = books; l; l = l->next) { @@ -768,6 +770,7 @@ get_widgets (MemoPage *mpage) MemoPagePrivate *priv; GSList *accel_groups; GtkWidget *toplevel; + GtkWidget *parent; priv = mpage->priv; @@ -787,7 +790,8 @@ get_widgets (MemoPage *mpage) page->accel_group = g_object_ref (accel_groups->data); g_object_ref (priv->main); - gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main); + parent = gtk_widget_get_parent (priv->main); + gtk_container_remove (GTK_CONTAINER (parent), priv->main); priv->info_hbox = GW ("generic-info"); priv->info_icon = GW ("generic-info-image"); diff --git a/calendar/gui/dialogs/recur-comp.c b/calendar/gui/dialogs/recur-comp.c index 0d9197546b..7793647723 100644 --- a/calendar/gui/dialogs/recur-comp.c +++ b/calendar/gui/dialogs/recur-comp.c @@ -40,6 +40,7 @@ recur_component_dialog (ECal *client, gchar *str; GtkWidget *dialog, *rb_this, *rb_prior, *rb_future, *rb_all, *hbox; GtkWidget *placeholder, *vbox; + GtkWidget *content_area; ECalComponentVType vtype; gboolean ret; @@ -72,8 +73,10 @@ recur_component_dialog (ECal *client, g_free (str); gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE); + content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + hbox = gtk_hbox_new (FALSE, 12); - gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), hbox); + gtk_container_add (GTK_CONTAINER (content_area), hbox); placeholder = gtk_label_new (""); gtk_widget_set_size_request (placeholder, 48, 48); @@ -105,7 +108,7 @@ recur_component_dialog (ECal *client, gtk_widget_show_all (hbox); placeholder = gtk_label_new (""); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), placeholder, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (content_area), placeholder, FALSE, FALSE, 0); gtk_widget_show (placeholder); ret = gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK; diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index 578f98929c..ae79698efd 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -532,6 +532,7 @@ sensitize_recur_widgets (RecurrencePage *rpage) CompEditor *editor; CompEditorFlags flags; gboolean recurs, sens = TRUE; + GtkWidget *child; GtkWidget *label; editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (rpage)); @@ -548,8 +549,9 @@ sensitize_recur_widgets (RecurrencePage *rpage) else gtk_widget_set_sensitive (priv->preview_calendar, TRUE && sens); - if (GTK_BIN (priv->custom_warning_bin)->child) - gtk_widget_destroy (GTK_BIN (priv->custom_warning_bin)->child); + child = gtk_bin_get_child (GTK_BIN (priv->custom_warning_bin)); + if (child != NULL) + gtk_widget_destroy (child); if (recurs && priv->custom) { gtk_widget_set_sensitive (priv->params, FALSE); @@ -681,7 +683,7 @@ simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp) guint8 day_mask; gint i; - g_return_if_fail (GTK_BIN (priv->special)->child != NULL); + g_return_if_fail (gtk_bin_get_child (GTK_BIN (priv->special)) != NULL); g_return_if_fail (priv->weekday_picker != NULL); g_return_if_fail (IS_WEEKDAY_PICKER (priv->weekday_picker)); @@ -717,7 +719,7 @@ simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp) enum month_num_options month_num; enum month_day_options month_day; - g_return_if_fail (GTK_BIN (priv->special)->child != NULL); + g_return_if_fail (gtk_bin_get_child (GTK_BIN (priv->special)) != NULL); g_return_if_fail (priv->month_day_combo != NULL); g_return_if_fail (GTK_IS_COMBO_BOX (priv->month_day_combo)); g_return_if_fail (priv->month_num_combo != NULL); @@ -901,11 +903,7 @@ fill_component (RecurrencePage *rpage, ECalComponent *comp) e_cal_component_set_exdate_list (comp, list); e_cal_component_free_exdate_list (list); -#if GTK_CHECK_VERSION(2,19,7) if (gtk_widget_get_visible (priv->ending_combo) && gtk_widget_get_sensitive (priv->ending_combo) && -#else - if (GTK_WIDGET_VISIBLE (priv->ending_combo) && GTK_WIDGET_IS_SENSITIVE (priv->ending_combo) && -#endif e_dialog_combo_box_get (priv->ending_combo, ending_types_map) == ENDING_UNTIL) { /* check whether the "until" date is in the future */ struct icaltimetype tt; @@ -950,7 +948,7 @@ make_weekly_special (RecurrencePage *rpage) priv = rpage->priv; - g_return_if_fail (GTK_BIN (priv->special)->child == NULL); + g_return_if_fail (gtk_bin_get_child (GTK_BIN (priv->special)) == NULL); g_return_if_fail (priv->weekday_picker == NULL); /* Create the widgets */ @@ -1228,7 +1226,7 @@ make_monthly_special (RecurrencePage *rpage) priv = rpage->priv; - g_return_if_fail (GTK_BIN (priv->special)->child == NULL); + g_return_if_fail (gtk_bin_get_child (GTK_BIN (priv->special)) == NULL); g_return_if_fail (priv->month_day_combo == NULL); /* Create the widgets */ @@ -1282,6 +1280,7 @@ make_recurrence_special (RecurrencePage *rpage) { RecurrencePagePrivate *priv; icalrecurrencetype_frequency frequency; + GtkWidget *child; priv = rpage->priv; @@ -1289,8 +1288,10 @@ make_recurrence_special (RecurrencePage *rpage) gtk_widget_destroy (priv->month_num_combo); priv->month_num_combo = NULL; } - if (GTK_BIN (priv->special)->child != NULL) { - gtk_widget_destroy (GTK_BIN (priv->special)->child); + + child = gtk_bin_get_child (GTK_BIN (priv->special)); + if (child != NULL) { + gtk_widget_destroy (child); priv->weekday_picker = NULL; priv->month_day_combo = NULL; @@ -1345,7 +1346,7 @@ make_ending_until_special (RecurrencePage *rpage) EDateEdit *de; ECalComponentDateTime dt_start; - g_return_if_fail (GTK_BIN (priv->ending_special)->child == NULL); + g_return_if_fail (gtk_bin_get_child (GTK_BIN (priv->ending_special)) == NULL); g_return_if_fail (priv->ending_date_edit == NULL); editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (rpage)); @@ -1394,7 +1395,7 @@ make_ending_count_special (RecurrencePage *rpage) priv = rpage->priv; - g_return_if_fail (GTK_BIN (priv->ending_special)->child == NULL); + g_return_if_fail (gtk_bin_get_child (GTK_BIN (priv->ending_special)) == NULL); g_return_if_fail (priv->ending_count_spin == NULL); /* Create the widgets */ @@ -1435,11 +1436,13 @@ make_ending_special (RecurrencePage *rpage) { RecurrencePagePrivate *priv; enum ending_type ending_type; + GtkWidget *child; priv = rpage->priv; - if (GTK_BIN (priv->ending_special)->child != NULL) { - gtk_widget_destroy (GTK_BIN (priv->ending_special)->child); + child = gtk_bin_get_child (GTK_BIN (priv->ending_special)); + if (child != NULL) { + gtk_widget_destroy (child); priv->ending_date_edit = NULL; priv->ending_count_spin = NULL; @@ -1985,6 +1988,7 @@ get_widgets (RecurrencePage *rpage) RecurrencePagePrivate *priv; GSList *accel_groups; GtkWidget *toplevel; + GtkWidget *parent; priv = rpage->priv; @@ -2002,7 +2006,8 @@ get_widgets (RecurrencePage *rpage) page->accel_group = g_object_ref (accel_groups->data); g_object_ref (priv->main); - gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main); + parent = gtk_widget_get_parent (priv->main); + gtk_container_remove (GTK_CONTAINER (parent), priv->main); priv->recurs = GW ("recurs"); priv->params = GW ("params"); @@ -2082,6 +2087,7 @@ create_exception_dialog (RecurrencePage *rpage, const gchar *title, GtkWidget ** RecurrencePagePrivate *priv; GtkWidget *dialog, *toplevel; CompEditor *editor; + GtkWidget *container; priv = rpage->priv; @@ -2096,7 +2102,8 @@ create_exception_dialog (RecurrencePage *rpage, const gchar *title, GtkWidget ** *date_edit = comp_editor_new_date_edit (TRUE, FALSE, TRUE); gtk_widget_show (*date_edit); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), *date_edit, FALSE, TRUE, 6); + container = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + gtk_box_pack_start (GTK_BOX (container), *date_edit, FALSE, TRUE, 6); return dialog; } diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index 2e13cba1b9..7cd177e410 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -307,6 +307,7 @@ get_widgets (SchedulePage *spage) SchedulePagePrivate *priv; GSList *accel_groups; GtkWidget *toplevel; + GtkWidget *parent; priv = spage->priv; @@ -324,7 +325,8 @@ get_widgets (SchedulePage *spage) page->accel_group = g_object_ref (accel_groups->data); g_object_ref (priv->main); - gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main); + parent = gtk_widget_get_parent (priv->main); + gtk_container_remove (GTK_CONTAINER (parent), priv->main); #undef GW diff --git a/calendar/gui/dialogs/send-comp.c b/calendar/gui/dialogs/send-comp.c index a42501c9d6..4a9f80ef21 100644 --- a/calendar/gui/dialogs/send-comp.c +++ b/calendar/gui/dialogs/send-comp.c @@ -108,6 +108,7 @@ send_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gbo ECalComponentVType vtype; const gchar *id; GtkWidget *dialog, *sa_checkbox = NULL, *ona_checkbox = NULL; + GtkWidget *content_area; gboolean res; if (strip_alarms) @@ -155,11 +156,12 @@ send_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gbo } dialog = e_alert_dialog_new_for_args (parent, id, NULL); + content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); if (strip_alarms) - sa_checkbox = add_checkbox (GTK_BOX (GTK_DIALOG (dialog)->vbox), _("Send my alarms with this event")); + sa_checkbox = add_checkbox (GTK_BOX (content_area), _("Send my alarms with this event")); if (only_new_attendees) - ona_checkbox = add_checkbox (GTK_BOX (GTK_DIALOG (dialog)->vbox), _("Notify new attendees _only")); + ona_checkbox = add_checkbox (GTK_BOX (content_area), _("Notify new attendees _only")); res = gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES; @@ -183,11 +185,11 @@ send_component_prompt_subject (GtkWindow *parent, ECal *client, ECalComponent *c switch (vtype) { case E_CAL_COMPONENT_EVENT: - id = "calendar:prompt-send-no-subject-calendar"; + id = "calendar:prompt-save-no-subject-calendar"; break; case E_CAL_COMPONENT_TODO: - id = "calendar:prompt-send-no-subject-task"; + id = "calendar:prompt-save-no-subject-task"; break; case E_CAL_COMPONENT_JOURNAL: id = "calendar:prompt-send-no-subject-memo"; diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index c549633eb5..f84b07ecd3 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -448,6 +448,7 @@ get_widgets (TaskDetailsPage *tdpage) TaskDetailsPagePrivate *priv; GSList *accel_groups; GtkWidget *toplevel; + GtkWidget *parent; priv = tdpage->priv; @@ -465,7 +466,8 @@ get_widgets (TaskDetailsPage *tdpage) page->accel_group = g_object_ref (accel_groups->data); g_object_ref (priv->main); - gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main); + parent = gtk_widget_get_parent (priv->main); + gtk_container_remove (GTK_CONTAINER (parent), priv->main); priv->status_combo = GW ("status-combobox"); priv->priority_combo = GW ("priority-combobox"); @@ -661,6 +663,7 @@ static void init_widgets (TaskDetailsPage *tdpage) { TaskDetailsPagePrivate *priv; + GtkAdjustment *adjustment; priv = tdpage->priv; @@ -677,13 +680,15 @@ init_widgets (TaskDetailsPage *tdpage) /* Connect signals. The Status, Percent Complete & Date Completed properties are closely related so whenever one changes we may need to update the other 2. */ - g_signal_connect (GTK_COMBO_BOX (priv->status_combo), - "changed", - G_CALLBACK (status_changed), tdpage); + g_signal_connect ( + GTK_COMBO_BOX (priv->status_combo), "changed", + G_CALLBACK (status_changed), tdpage); - g_signal_connect((GTK_SPIN_BUTTON (priv->percent_complete)->adjustment), - "value_changed", - G_CALLBACK (percent_complete_changed), tdpage); + adjustment = gtk_spin_button_get_adjustment ( + GTK_SPIN_BUTTON (priv->percent_complete)); + g_signal_connect ( + adjustment, "value_changed", + G_CALLBACK (percent_complete_changed), tdpage); /* Priority */ g_signal_connect_swapped ( diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 7e35cbe070..46a2f95d0e 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -309,6 +309,8 @@ task_editor_init (TaskEditor *te) CompEditor *editor = COMP_EDITOR (te); GtkUIManager *ui_manager; GtkActionGroup *action_group; + GtkWidget *content_area; + GtkAction *action; const gchar *id; GError *error = NULL; @@ -333,8 +335,10 @@ task_editor_init (TaskEditor *te) G_CALLBACK(gtk_widget_hide), NULL); te->priv->task_details_page = task_details_page_new (editor); + content_area = gtk_dialog_get_content_area ( + GTK_DIALOG (te->priv->task_details_window)); gtk_container_add ( - GTK_CONTAINER (GTK_DIALOG (te->priv->task_details_window)->vbox), + GTK_CONTAINER (content_area), comp_editor_page_get_widget ((CompEditorPage *) te->priv->task_details_page)); gtk_widget_show_all (gtk_bin_get_child (GTK_BIN (te->priv->task_details_window))); comp_editor_append_page ( @@ -362,6 +366,9 @@ task_editor_init (TaskEditor *te) g_error_free (error); } + action = comp_editor_get_action (editor, "print"); + gtk_action_set_tooltip (action, _("Print this task")); + g_signal_connect_swapped ( te->priv->model, "row_changed", G_CALLBACK (task_editor_model_changed_cb), te); diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index fb6338005f..9747501eea 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -1335,6 +1335,7 @@ get_widgets (TaskPage *tpage) TaskPagePrivate *priv; GSList *accel_groups; GtkWidget *toplevel; + GtkWidget *parent; GtkWidget *sw; GtkTreeSelection *selection; @@ -1352,7 +1353,8 @@ get_widgets (TaskPage *tpage) page->accel_group = g_object_ref (accel_groups->data); g_object_ref (priv->main); - gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main); + parent = gtk_widget_get_parent (priv->main); + gtk_container_remove (GTK_CONTAINER (parent), priv->main); priv->info_hbox = e_builder_get_widget (priv->builder, "generic-info"); priv->info_icon = e_builder_get_widget (priv->builder, "generic-info-image"); |