aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
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
parent9cafe346c61294495cc42a8124257469e28c6879 (diff)
downloadgsoc2013-evolution-e5ec3be0a33af4efc460d93ce0d9ad4642bbb27b.tar.gz
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')
-rw-r--r--calendar/gui/dialogs/task-details-page.c14
-rw-r--r--calendar/gui/dialogs/task-details-page.glade17
-rw-r--r--calendar/gui/e-calendar-table.c41
-rw-r--r--calendar/gui/e-tasks.c2
4 files changed, 62 insertions, 12 deletions
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 @@
<child>
<widget class="GtkLabel" id="label19">
<property name="visible">True</property>
- <property name="label" translatable="yes">% Complete</property>
- <property name="use_underline">False</property>
+ <property name="label" translatable="yes">% _Complete</property>
+ <property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
@@ -198,6 +198,7 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
+ <property name="mnemonic_widget">percent-complete</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -243,10 +244,10 @@
<property name="column_spacing">4</property>
<child>
- <widget class="GtkLabel" id="label12">
+ <widget class="GtkLabel" id="date_completed_label">
<property name="visible">True</property>
- <property name="label" translatable="yes">Date Completed:</property>
- <property name="use_underline">False</property>
+ <property name="label" translatable="yes">_Date Completed:</property>
+ <property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
@@ -330,10 +331,10 @@
<property name="column_spacing">6</property>
<child>
- <widget class="GtkLabel" id="label14">
+ <widget class="GtkLabel" id="url_label">
<property name="visible">True</property>
- <property name="label" translatable="yes">URL:</property>
- <property name="use_underline">False</property>
+ <property name="label" translatable="yes">_Web Page:</property>
+ <property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
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, "<TD></TD></TR>");
/* URL */
- gtk_html_stream_printf (stream, "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\"><B>%s</B></TD>", _("URL:"));
+ gtk_html_stream_printf (stream, "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\"><B>%s</B></TD>", _("Web Page:"));
cal_component_get_url (comp, (const char **) &str);
if (str)
gtk_html_stream_printf (stream, "<TD><A HREF=\"%s\">%s</A></TD></TR>", str, str);