2003-10-30  Rodrigo Moya <rodrigo@ximian.com>

	* gui/e-tasks.[ch] (e_tasks_get_cal_client): removed.

	* gui/tasks-control.c (sensitize_commands): fixed to work correctly
	with the ECalView's model.
	(tasks_control_set_property): don't use e_tasks_get_cal_client.

	* gui/alarm-notify/alarm-notify.c (free_client_hash): new function
	to remove items from the CalClient's hash table.
	(alarm_notify_finalize): call free_client_hash() for each item
	in the hash table.

svn path=/trunk/; revision=23136
This commit is contained in:
Rodrigo Moya
2003-10-30 19:04:54 +00:00
committed by Rodrigo Moya
parent 61031f4cb0
commit 973ca5ea3d
5 changed files with 31 additions and 25 deletions

View File

@ -1,3 +1,16 @@
2003-10-30 Rodrigo Moya <rodrigo@ximian.com>
* gui/e-tasks.[ch] (e_tasks_get_cal_client): removed.
* gui/tasks-control.c (sensitize_commands): fixed to work correctly
with the ECalView's model.
(tasks_control_set_property): don't use e_tasks_get_cal_client.
* gui/alarm-notify/alarm-notify.c (free_client_hash): new function
to remove items from the CalClient's hash table.
(alarm_notify_finalize): call free_client_hash() for each item
in the hash table.
2003-10-30 Rodrigo Moya <rodrigo@ximian.com>
* gui/alarm-notify/notify-main.c (client_die_cb): use

View File

@ -88,6 +88,16 @@ alarm_notify_init (AlarmNotify *an, AlarmNotifyClass *klass)
priv->uri_client_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
}
static void
free_client_hash (gpointer key, gpointer value, gpointer user_data)
{
char *uri = key;
CalClient *client = value;
g_free (uri);
g_object_unref (client);
}
/* Finalize handler for the alarm notify system */
static void
alarm_notify_finalize (GObject *object)
@ -101,6 +111,7 @@ alarm_notify_finalize (GObject *object)
an = ALARM_NOTIFY (object);
priv = an->priv;
g_hash_table_foreach (priv->uri_client_hash, (GHFunc) free_client_hash, NULL);
g_hash_table_destroy (priv->uri_client_hash);
g_free (priv);

View File

@ -857,27 +857,6 @@ backend_error_cb (CalClient *client, const char *message, gpointer data)
g_free (urinopwd);
}
/**
* e_tasks_get_cal_client:
* @tasks: An #ETasks.
*
* Queries the calendar client interface object that a tasks view is using.
*
* Return value: A calendar client interface object.
**/
CalClient *
e_tasks_get_cal_client (ETasks *tasks)
{
ETasksPrivate *priv;
g_return_val_if_fail (E_IS_TASKS (tasks), NULL);
priv = tasks->priv;
return priv->client;
}
void
e_tasks_new_task (ETasks *tasks)
{

View File

@ -67,8 +67,6 @@ void e_tasks_set_ui_component (ETasks *tasks,
gboolean e_tasks_open (ETasks *tasks,
char *file);
CalClient *e_tasks_get_cal_client (ETasks *tasks);
void e_tasks_new_task (ETasks *tasks);
void e_tasks_complete_selected (ETasks *tasks);
void e_tasks_delete_selected (ETasks *tasks);

View File

@ -47,6 +47,7 @@
#include "calendar-config.h"
#include "calendar-commands.h"
#include "e-tasks.h"
#include "e-calendar-table.h"
#include "tasks-control.h"
#include "evolution-shell-component-utils.h"
@ -162,11 +163,13 @@ tasks_control_get_property (BonoboPropertyBag *bag,
{
ETasks *tasks = user_data;
const char *uri;
ECalModel *model;
switch (arg_id) {
case TASKS_CONTROL_PROPERTY_URI_IDX:
uri = cal_client_get_uri (e_tasks_get_cal_client (tasks));
model = e_calendar_table_get_model (e_tasks_get_calendar_table (tasks));
uri = cal_client_get_uri (e_cal_model_get_default_client (model));
BONOBO_ARG_SET_STRING (arg, uri);
break;
@ -231,11 +234,13 @@ sensitize_commands (ETasks *tasks, BonoboControl *control, int n_selected)
{
BonoboUIComponent *uic;
gboolean read_only = TRUE;
ECalModel *model;
uic = bonobo_control_get_ui_component (control);
g_assert (uic != NULL);
cal_client_is_read_only (e_tasks_get_cal_client (tasks), &read_only, NULL);
model = e_calendar_table_get_model (e_tasks_get_calendar_table (tasks));
cal_client_is_read_only (e_cal_model_get_default_client (model), &read_only, NULL);
bonobo_ui_component_set_prop (uic, "/commands/TasksCut", "sensitive",
n_selected == 0 || read_only ? "0" : "1",