From e5ec3be0a33af4efc460d93ce0d9ad4642bbb27b Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Sun, 13 Jul 2003 19:29:41 +0000 Subject: Changed the "URL:" label to "_Web Page:". Added a widget name to the URL 2003-07-11 Federico Mena Quintero * gui/dialogs/task-details-page.glade: Changed the "URL:" label to "_Web Page:". Added a widget name to the URL label so that we can hook up its mnemonic by hand. Added underlines to the "% Complete:" and "Date Completed:" labels. Added a widget name to the date completed label, also so that we can hook up its mnemonic. * gui/dialogs/task-details-page.c (get_widgets): Get the url_label and date_completed_label as well. (init_widgets): Set the mnemonic widgets of the url_label and the date_completed_label by hand, as their respective widgets are not created by libglade. * gui/e-calendar-table.c (tasks_popup_menu): Added an item for "Open Web Page". (e_calendar_table_show_popup_menu): Disable the aforementioned menu item if the selected task doesn't have the URL property set. (open_url_cb): New callback. * gui/e-tasks.c (write_html): Make the HTML say "Web Page:" instead of "URL:". svn path=/trunk/; revision=21805 --- calendar/ChangeLog | 23 ++++++++++++++++ calendar/gui/dialogs/task-details-page.c | 14 ++++++++++ calendar/gui/dialogs/task-details-page.glade | 17 ++++++------ calendar/gui/e-calendar-table.c | 41 ++++++++++++++++++++++++++-- calendar/gui/e-tasks.c | 2 +- 5 files changed, 85 insertions(+), 12 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 47c18e3fed..2116042484 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,26 @@ +2003-07-11 Federico Mena Quintero + + * gui/dialogs/task-details-page.glade: Changed the "URL:" label to + "_Web Page:". Added a widget name to the URL label so that we can + hook up its mnemonic by hand. Added underlines to the "% + Complete:" and "Date Completed:" labels. Added a widget name to + the date completed label, also so that we can hook up its mnemonic. + + * gui/dialogs/task-details-page.c (get_widgets): Get the url_label + and date_completed_label as well. + (init_widgets): Set the mnemonic widgets of the url_label and the + date_completed_label by hand, as their respective widgets are + not created by libglade. + + * gui/e-calendar-table.c (tasks_popup_menu): Added an item for + "Open Web Page". + (e_calendar_table_show_popup_menu): Disable the aforementioned + menu item if the selected task doesn't have the URL property set. + (open_url_cb): New callback. + + * gui/e-tasks.c (write_html): Make the HTML say "Web Page:" + instead of "URL:". + 2003-07-10 Harry Lu Fixes #46075. diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index 17524e2994..717ee7987d 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -52,8 +52,10 @@ struct _TaskDetailsPagePrivate { GtkWidget *priority; GtkWidget *percent_complete; + GtkWidget *date_completed_label; GtkWidget *completed_date; + GtkWidget *url_label; GtkWidget *url_entry; GtkWidget *url; @@ -148,8 +150,10 @@ task_details_page_init (TaskDetailsPage *tdpage) priv->priority = NULL; priv->percent_complete = NULL; + priv->date_completed_label = NULL; priv->completed_date = NULL; + priv->url_label = NULL; priv->url_entry = NULL; priv->url = NULL; @@ -469,9 +473,13 @@ get_widgets (TaskDetailsPage *tdpage) priv->priority = GW ("priority"); priv->percent_complete = GW ("percent-complete"); + priv->date_completed_label = GW ("date_completed_label"); + priv->completed_date = GW ("completed-date"); gtk_widget_show (priv->completed_date); + priv->url_label = GW ("url_label"); + priv->url_entry = GW ("url_entry"); gtk_widget_show (priv->url_entry); priv->url = e_url_entry_get_entry (E_URL_ENTRY (priv->url_entry)); @@ -481,7 +489,9 @@ get_widgets (TaskDetailsPage *tdpage) return (priv->status && priv->priority && priv->percent_complete + && priv->date_completed_label && priv->completed_date + && priv->url_label && priv->url); } @@ -666,6 +676,10 @@ init_widgets (TaskDetailsPage *tdpage) (EDateEditGetTimeCallback) comp_editor_get_current_time, tdpage, NULL); + /* These are created by hand, so hook the mnemonics manually */ + gtk_label_set_mnemonic_widget (GTK_LABEL (priv->date_completed_label), priv->completed_date); + gtk_label_set_mnemonic_widget (GTK_LABEL (priv->url_label), priv->url_entry); + /* Connect signals. The Status, Percent Complete & Date Completed properties are closely related so whenever one changes we may need to update the other 2. */ diff --git a/calendar/gui/dialogs/task-details-page.glade b/calendar/gui/dialogs/task-details-page.glade index d1091c320e..b3ba212f2c 100644 --- a/calendar/gui/dialogs/task-details-page.glade +++ b/calendar/gui/dialogs/task-details-page.glade @@ -188,8 +188,8 @@ True - % Complete - False + % _Complete + True False GTK_JUSTIFY_CENTER False @@ -198,6 +198,7 @@ 0.5 0 0 + percent-complete 0 @@ -243,10 +244,10 @@ 4 - + True - Date Completed: - False + _Date Completed: + True False GTK_JUSTIFY_CENTER False @@ -330,10 +331,10 @@ 6 - + True - URL: - False + _Web Page: + True False GTK_JUSTIFY_CENTER False diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index 21b803fe01..96cba831d8 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -935,6 +935,27 @@ mark_as_complete_cb (GtkWidget *menuitem, gpointer data) e_table_selected_row_foreach (etable, mark_row_complete_cb, cal_table); } +/* Opens the URL of the task */ +static void +open_url_cb (GtkWidget *menuitem, gpointer data) +{ + ECalendarTable *cal_table; + CalComponent *comp; + const char *url; + + cal_table = E_CALENDAR_TABLE (data); + + comp = get_selected_comp (cal_table); + if (!comp) + return; + + cal_component_get_url (comp, &url); + if (!url) + return; + + gnome_url_show (url, NULL); +} + /* Callback for the "delete tasks" menu item */ static void delete_cb (GtkWidget *menuitem, gpointer data) @@ -950,12 +971,14 @@ enum { MASK_SINGLE = 1 << 0, /* For commands that work on 1 task. */ MASK_MULTIPLE = 1 << 1, /* For commands for multiple tasks. */ MASK_EDITABLE = 1 << 2, /* For commands disabled in read-only folders */ - MASK_ASSIGNABLE = 1 << 3 /* For non-task assignable backends */ + MASK_ASSIGNABLE = 1 << 3, /* For non-task assignable backends */ + MASK_LACKS_URL = 1 << 4 /* For tasks that don't have the URL property set */ }; static EPopupMenu tasks_popup_menu [] = { E_POPUP_ITEM (N_("_Open"), GTK_SIGNAL_FUNC (e_calendar_table_on_open_task), MASK_SINGLE), + E_POPUP_ITEM (N_("Open _Web Page"), GTK_SIGNAL_FUNC (open_url_cb), MASK_SINGLE | MASK_LACKS_URL), E_POPUP_ITEM (N_("_Save as..."), GTK_SIGNAL_FUNC (e_calendar_table_on_save_as), MASK_SINGLE), E_POPUP_ITEM (N_("_Print..."), GTK_SIGNAL_FUNC (e_calendar_table_on_print_task), MASK_SINGLE), @@ -994,9 +1017,21 @@ e_calendar_table_show_popup_menu (ETable *table, if (n_selected <= 0) return TRUE; - if (n_selected == 1) + if (n_selected == 1) { + CalComponent *comp; + const char *url; + hide_mask = MASK_MULTIPLE; - else + + /* See if the task has the URL property set */ + + comp = get_selected_comp (cal_table); + g_assert (comp != NULL); + + cal_component_get_url (comp, &url); + if (!url) + disable_mask |= MASK_LACKS_URL; + } else hide_mask = MASK_SINGLE; if (cal_client_is_read_only (calendar_model_get_cal_client (e_calendar_table_get_model (cal_table)))) diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index d6965d8b5e..d0a0873195 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -318,7 +318,7 @@ write_html (GtkHTMLStream *stream, CalComponent *comp) gtk_html_stream_printf (stream, ""); /* URL */ - gtk_html_stream_printf (stream, "%s", _("URL:")); + gtk_html_stream_printf (stream, "%s", _("Web Page:")); cal_component_get_url (comp, (const char **) &str); if (str) gtk_html_stream_printf (stream, "%s", str, str); -- cgit v1.2.3