aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-calendar-table.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@ximian.com>2003-07-14 03:29:41 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2003-07-14 03:29:41 +0800
commite5ec3be0a33af4efc460d93ce0d9ad4642bbb27b (patch)
tree8f75f9b0d0501dcb6fbfdb6a698544e6ce87e586 /calendar/gui/e-calendar-table.c
parent9cafe346c61294495cc42a8124257469e28c6879 (diff)
downloadgsoc2013-evolution-e5ec3be0a33af4efc460d93ce0d9ad4642bbb27b.tar
gsoc2013-evolution-e5ec3be0a33af4efc460d93ce0d9ad4642bbb27b.tar.gz
gsoc2013-evolution-e5ec3be0a33af4efc460d93ce0d9ad4642bbb27b.tar.bz2
gsoc2013-evolution-e5ec3be0a33af4efc460d93ce0d9ad4642bbb27b.tar.lz
gsoc2013-evolution-e5ec3be0a33af4efc460d93ce0d9ad4642bbb27b.tar.xz
gsoc2013-evolution-e5ec3be0a33af4efc460d93ce0d9ad4642bbb27b.tar.zst
gsoc2013-evolution-e5ec3be0a33af4efc460d93ce0d9ad4642bbb27b.zip
Changed the "URL:" label to "_Web Page:". Added a widget name to the URL
2003-07-11 Federico Mena Quintero <federico@ximian.com> * 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
Diffstat (limited to 'calendar/gui/e-calendar-table.c')
-rw-r--r--calendar/gui/e-calendar-table.c41
1 files changed, 38 insertions, 3 deletions
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))))