diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2002-12-10 05:26:53 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2002-12-10 05:26:53 +0800 |
commit | 3bb567307b06a04c5df4057615c27a3a74a4b732 (patch) | |
tree | 7f69646d534e9daafbf59b8cf96d39e320640893 /calendar/gui | |
parent | 4f476ec48a182f891ea5a6db2908429b9110badb (diff) | |
download | gsoc2013-evolution-3bb567307b06a04c5df4057615c27a3a74a4b732.tar.gz gsoc2013-evolution-3bb567307b06a04c5df4057615c27a3a74a4b732.tar.zst gsoc2013-evolution-3bb567307b06a04c5df4057615c27a3a74a4b732.zip |
Fixes #35003
2002-12-06 Rodrigo Moya <rodrigo@ximian.com>
Fixes #35003
* gui/misc.[ch] (get_uri_without_password): new function for
removing the password from the CalClient's uris.
* gui/gnome-cal.c (client_cal_opened_cb): use the URI returned by
get_uri_without_password for messages.
(backend_error_cb): likewise.
(backend_died_cb): likewise.
(gnome_calendar_open): likewise.
(open_error, method_error, permission_error): likewise.
* gui/e-tasks.c (e_tasks_open): hide the password from the URI
being displayed in messages.
(backend_error_cb): likewise.
svn path=/trunk/; revision=19070
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/e-tasks.c | 26 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 38 | ||||
-rw-r--r-- | calendar/gui/misc.c | 20 | ||||
-rw-r--r-- | calendar/gui/misc.h | 1 |
4 files changed, 72 insertions, 13 deletions
diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index 6675a1e298..9b99bea23b 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -35,6 +35,7 @@ #include "cal-search-bar.h" #include "calendar-config.h" #include "component-factory.h" +#include "misc.h" #include "e-tasks.h" @@ -336,6 +337,7 @@ e_tasks_open (ETasks *tasks, char *message; EUri *uri; char *real_uri; + char *urinopwd; g_return_val_if_fail (tasks != NULL, FALSE); g_return_val_if_fail (E_IS_TASKS (tasks), FALSE); @@ -349,9 +351,11 @@ e_tasks_open (ETasks *tasks, else real_uri = g_strdup (file); - message = g_strdup_printf (_("Opening tasks at %s"), real_uri); + urinopwd = get_uri_without_password (real_uri); + message = g_strdup_printf (_("Opening tasks at %s"), urinopwd); set_status_message (tasks, message); g_free (message); + g_free (urinopwd); if (!cal_client_open_calendar (priv->client, real_uri, FALSE)) { g_message ("e_tasks_open(): Could not issue the request"); @@ -374,10 +378,13 @@ load_error (ETasks *tasks, const char *uri) { char *msg; + char *urinopwd; - msg = g_strdup_printf (_("Could not load the tasks in `%s'"), uri); + urinopwd = get_uri_without_password (uri); + msg = g_strdup_printf (_("Could not load the tasks in `%s'"), urinopwd); gnome_error_dialog_parented (msg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks)))); g_free (msg); + g_free (urinopwd); } /* Displays an error to indicate that the specified URI method is not supported */ @@ -386,10 +393,13 @@ method_error (ETasks *tasks, const char *uri) { char *msg; + char *urinopwd; - msg = g_strdup_printf (_("The method required to load `%s' is not supported"), uri); + urinopwd = get_uri_without_password (uri); + msg = g_strdup_printf (_("The method required to load `%s' is not supported"), urinopwd); gnome_error_dialog_parented (msg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks)))); g_free (msg); + g_free (urinopwd); } /* Displays an error to indicate permission problems */ @@ -397,10 +407,13 @@ static void permission_error (ETasks *tasks, const char *uri) { char *msg; + char *urinopwd; - msg = g_strdup_printf (_("You don't have permission to open the folder in `%s'"), uri); + urinopwd = get_uri_without_password (uri); + msg = g_strdup_printf (_("You don't have permission to open the folder in `%s'"), urinopwd); gnome_error_dialog_parented (msg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks)))); g_free (msg); + g_free (urinopwd); } /* Callback from the calendar client when a calendar is opened */ @@ -459,13 +472,16 @@ backend_error_cb (CalClient *client, const char *message, gpointer data) ETasks *tasks; ETasksPrivate *priv; char *errmsg; + char *urinopwd; tasks = E_TASKS (data); priv = tasks->priv; - errmsg = g_strdup_printf (_("Error on %s:\n %s"), cal_client_get_uri (client), message); + urinopwd = get_uri_without_password (cal_client_get_uri (client)); + errmsg = g_strdup_printf (_("Error on %s:\n %s"), urinopwd, message); gnome_error_dialog_parented (errmsg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks)))); g_free (errmsg); + g_free (urinopwd); } /** diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index c66caaf844..13f51fab36 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -54,6 +54,7 @@ #include "calendar-view.h" #include "calendar-view-factory.h" #include "tag-calendar.h" +#include "misc.h" extern ECompEditorRegistry *comp_editor_registry; @@ -1493,10 +1494,13 @@ static void open_error (GnomeCalendar *gcal, const char *uri) { char *msg; + char *urinopwd; - msg = g_strdup_printf (_("Could not open the folder in `%s'"), uri); + urinopwd = get_uri_without_password (uri); + msg = g_strdup_printf (_("Could not open the folder in `%s'"), urinopwd); gnome_error_dialog_parented (msg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal)))); g_free (msg); + g_free (urinopwd); } /* Displays an error to indicate that the specified URI method is not supported */ @@ -1504,10 +1508,13 @@ static void method_error (GnomeCalendar *gcal, const char *uri) { char *msg; + char *urinopwd; - msg = g_strdup_printf (_("The method required to open `%s' is not supported"), uri); + urinopwd = get_uri_without_password (uri); + msg = g_strdup_printf (_("The method required to open `%s' is not supported"), urinopwd); gnome_error_dialog_parented (msg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal)))); g_free (msg); + g_free (urinopwd); } /* Displays an error to indicate permission problems */ @@ -1515,10 +1522,13 @@ static void permission_error (GnomeCalendar *gcal, const char *uri) { char *msg; + char *urinopwd; - msg = g_strdup_printf (_("You don't have permission to open the folder in `%s'"), uri); + urinopwd = get_uri_without_password (uri); + msg = g_strdup_printf (_("You don't have permission to open the folder in `%s'"), urinopwd); gnome_error_dialog_parented (msg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal)))); g_free (msg); + g_free (urinopwd); } /* Callback from the calendar client when a calendar is loaded */ @@ -1528,6 +1538,7 @@ client_cal_opened_cb (CalClient *client, CalClientOpenStatus status, gpointer da GnomeCalendar *gcal; GnomeCalendarPrivate *priv; char *msg; + char *uristr; gcal = GNOME_CALENDAR (data); priv = gcal->priv; @@ -1545,7 +1556,9 @@ client_cal_opened_cb (CalClient *client, CalClientOpenStatus status, gpointer da } /* add the alarms for this client */ - msg = g_strdup_printf (_("Adding alarms for %s"), cal_client_get_uri (client)); + uristr = get_uri_without_password (cal_client_get_uri (client)); + msg = g_strdup_printf (_("Adding alarms for %s"), uristr); + g_free (uristr); if (client == priv->client) { e_week_view_set_status_message (E_WEEK_VIEW (priv->week_view), msg); } @@ -1710,13 +1723,16 @@ backend_error_cb (CalClient *client, const char *message, gpointer data) GnomeCalendar *gcal; GnomeCalendarPrivate *priv; char *errmsg; + char *uristr; gcal = GNOME_CALENDAR (data); priv = gcal->priv; - errmsg = g_strdup_printf (_("Error on %s:\n %s"), cal_client_get_uri (client), message); + uristr = get_uri_without_password (cal_client_get_uri (client)); + errmsg = g_strdup_printf (_("Error on %s:\n %s"), uristr, message); gnome_error_dialog_parented (errmsg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal)))); g_free (errmsg); + g_free (uristr); } /* Callback when the backend dies */ @@ -1726,15 +1742,17 @@ backend_died_cb (CalClient *client, gpointer data) GnomeCalendar *gcal; GnomeCalendarPrivate *priv; char *message; + char *uristr; gcal = GNOME_CALENDAR (data); priv = gcal->priv; + uristr = get_uri_without_password (cal_client_get_uri (priv->client)); if (client == priv->client) { message = g_strdup_printf (_("The calendar backend for\n%s\n has crashed. " "You will have to restart Evolution in order " "to use it again"), - cal_client_get_uri (priv->client)); + uristr); e_day_view_set_status_message (E_DAY_VIEW (priv->day_view), NULL); e_day_view_set_status_message (E_DAY_VIEW (priv->work_week_view), NULL); e_week_view_set_status_message (E_WEEK_VIEW (priv->week_view), NULL); @@ -1743,7 +1761,7 @@ backend_died_cb (CalClient *client, gpointer data) message = g_strdup_printf (_("The task backend for\n%s\n has crashed. " "You will have to restart Evolution in order " "to use it again"), - cal_client_get_uri (priv->task_pad_client)); + uristr); calendar_model_set_status_message ( e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo)), NULL); } else @@ -1751,6 +1769,7 @@ backend_died_cb (CalClient *client, gpointer data) gnome_error_dialog_parented (message, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal)))); g_free (message); + g_free (uristr); } GtkWidget * @@ -1945,6 +1964,7 @@ gnome_calendar_open (GnomeCalendar *gcal, const char *str_uri) EUri *uri; char *message; char *real_uri; + char *urinopwd; g_return_val_if_fail (gcal != NULL, FALSE); g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), FALSE); @@ -1966,7 +1986,9 @@ gnome_calendar_open (GnomeCalendar *gcal, const char *str_uri) else real_uri = g_strdup (str_uri); - message = g_strdup_printf (_("Opening calendar at %s"), real_uri); + urinopwd = get_uri_without_password (real_uri); + message = g_strdup_printf (_("Opening calendar at %s"), urinopwd); + g_free (urinopwd); e_week_view_set_status_message (E_WEEK_VIEW (priv->week_view), message); g_free (message); diff --git a/calendar/gui/misc.c b/calendar/gui/misc.c index 15dcf93e09..e286442a89 100644 --- a/calendar/gui/misc.c +++ b/calendar/gui/misc.c @@ -24,6 +24,7 @@ #endif #include <ctype.h> +#include <e-util/e-url.h> #include "misc.h" @@ -58,3 +59,22 @@ string_is_empty (const char *value) return empty; } + +/** + * get_uri_without_password + */ +char * +get_uri_without_password (const char *full_uri) +{ + EUri *uri; + char *uristr; + + uri = e_uri_new (full_uri); + if (!uri) + return NULL; + + uristr = e_uri_to_string (uri, FALSE); + e_uri_free (uri); + + return uristr; + } diff --git a/calendar/gui/misc.h b/calendar/gui/misc.h index 81e2a13afe..d32739f9f5 100644 --- a/calendar/gui/misc.h +++ b/calendar/gui/misc.h @@ -25,5 +25,6 @@ #include <glib.h> gboolean string_is_empty (const char *value); +char *get_uri_without_password (const char *uri); #endif |