[evolution-patches] patch for bug #258786 [Tasks]
- From: "Viren L" <lviren novell com>
- To: <evolution-patches gnome org>
- Subject: [evolution-patches] patch for bug #258786 [Tasks]
- Date: Fri, 07 Oct 2005 05:57:23 -0600
Hi,
Attached patch fixes bug
http://bugzilla.gnome.org/show_bug.cgi?id=258786
Thanks,
Viren
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2826
diff -u -p -r1.2826 ChangeLog
--- ChangeLog 6 Oct 2005 18:21:50 -0000 1.2826
+++ ChangeLog 7 Oct 2005 11:46:29 -0000
@@ -1,3 +1,13 @@
+2005-10-07 Viren.L <lviren novell>
+
+ Fixes #258786
+ * gui/e-cal-model-tasks.[ch] (e_cal_model_tasks_mark_task_status):
+ Added boolean parameter complete.
+ * gui/e-cal-popup.[ch]: Added 2 popupmeus.
+ * gui/e-calendar-table.c (mark_as_notcomplete_cb), (mark_row_notcomplete_cb),
+ (e_cal_popup_target_new_select):
+ Marks the task as not complete.Handled masking for multiple selection.
+
2005-10-06 Srinivasa Ragavan <sragavan novell com>
* calendar.error.xml: Added accels to the Disard new event/
Index: gui/e-cal-model-tasks.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-model-tasks.h,v
retrieving revision 1.4
diff -u -p -r1.4 e-cal-model-tasks.h
--- gui/e-cal-model-tasks.h 3 Oct 2005 06:16:51 -0000 1.4
+++ gui/e-cal-model-tasks.h 7 Oct 2005 11:46:29 -0000
@@ -61,7 +61,7 @@ typedef struct {
GType e_cal_model_tasks_get_type (void);
ECalModelTasks *e_cal_model_tasks_new (void);
-void e_cal_model_tasks_mark_task_complete (ECalModelTasks *model, gint model_row);
+void e_cal_model_tasks_mark_task_status (ECalModelTasks *model, gint model_row, gboolean complete);
void e_cal_model_tasks_update_due_tasks (ECalModelTasks *model);
G_END_DECLS
Index: gui/e-cal-model-tasks.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-model-tasks.c,v
retrieving revision 1.32
diff -u -p -r1.32 e-cal-model-tasks.c
--- gui/e-cal-model-tasks.c 3 Oct 2005 06:16:51 -0000 1.32
+++ gui/e-cal-model-tasks.c 7 Oct 2005 11:46:29 -0000
@@ -1090,13 +1090,14 @@ e_cal_model_tasks_new (void)
}
/**
- * e_cal_model_tasks_mark_task_complete
+ * e_cal_model_tasks_mark_task_status
*/
void
-e_cal_model_tasks_mark_task_complete (ECalModelTasks *model, gint model_row)
+e_cal_model_tasks_mark_task_status (ECalModelTasks *model, gint model_row, gboolean complete)
{
ECalModelTasksPrivate *priv;
ECalModelComponent *comp_data;
+ gboolean read_only;
g_return_if_fail (E_IS_CAL_MODEL_TASKS (model));
g_return_if_fail (model_row >= 0 && model_row < e_table_model_row_count (E_TABLE_MODEL (model)));
@@ -1105,11 +1106,17 @@ e_cal_model_tasks_mark_task_complete (EC
comp_data = e_cal_model_get_component_at (E_CAL_MODEL (model), model_row);
if (comp_data) {
- e_table_model_pre_change (E_TABLE_MODEL (model));
-
- ensure_task_complete (comp_data, -1);
-
+ e_cal_is_read_only (comp_data->client, &read_only, NULL);
+ if (!read_only) {
+ e_table_model_pre_change (E_TABLE_MODEL (model));
+ if (complete)
+ ensure_task_complete (comp_data, -1);
+ else
+ ensure_task_not_complete (comp_data);
e_table_model_row_changed (E_TABLE_MODEL (model), model_row);
+ }
+ else
+ return;
}
}
Index: gui/e-calendar-table.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-table.c,v
retrieving revision 1.142
diff -u -p -r1.142 e-calendar-table.c
--- gui/e-calendar-table.c 3 Oct 2005 06:16:51 -0000 1.142
+++ gui/e-calendar-table.c 7 Oct 2005 11:46:31 -0000
@@ -89,6 +89,7 @@ static gint e_calendar_table_on_key_pres
static struct tm e_calendar_table_get_current_time (ECellDateEdit *ecde,
gpointer data);
static void mark_row_complete_cb (int model_row, gpointer data);
+static void mark_row_notcomplete_cb (int model_row, gpointer data);
static void hide_completed_rows (ECalModel *model, GList *clients_list, char *hide_sexp, GPtrArray *comp_objects);
static void show_completed_rows (ECalModel *model, GList *clients_list, char *show_sexp, GPtrArray *comp_objects);
@@ -1121,9 +1122,19 @@ mark_row_complete_cb (int model_row, gpo
ECalendarTable *cal_table;
cal_table = E_CALENDAR_TABLE (data);
- e_cal_model_tasks_mark_task_complete (E_CAL_MODEL_TASKS (cal_table->model), model_row);
+ e_cal_model_tasks_mark_task_status (E_CAL_MODEL_TASKS (cal_table->model), model_row, TRUE);
}
+static void
+mark_row_notcomplete_cb (int model_row, gpointer data)
+{
+ ECalendarTable *cal_table;
+
+ cal_table = E_CALENDAR_TABLE (data);
+ e_cal_model_tasks_mark_task_status (E_CAL_MODEL_TASKS (cal_table->model), model_row, FALSE);
+}
+
+
/* Callback used for the "mark tasks as complete" menu item */
static void
mark_as_complete_cb (EPopup *ep, EPopupItem *pitem, void *data)
@@ -1135,6 +1146,16 @@ mark_as_complete_cb (EPopup *ep, EPopupI
e_table_selected_row_foreach (etable, mark_row_complete_cb, cal_table);
}
+static void
+mark_as_notcomplete_cb (EPopup *ep, EPopupItem *pitem, void *data)
+{
+ ECalendarTable *cal_table = data;
+ ETable *etable;
+
+ etable = e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable));
+ e_table_selected_row_foreach (etable, mark_row_notcomplete_cb, cal_table);
+}
+
/* Opens the URL of the task */
static void
open_url_cb (EPopup *ep, EPopupItem *pitem, void *data)
@@ -1179,13 +1200,15 @@ static EPopupItem tasks_popup_items [] =
{ E_POPUP_ITEM, "80.assign", N_("_Assign Task"), e_calendar_table_on_assign, NULL, NULL, E_CAL_POPUP_SELECT_ONE, E_CAL_POPUP_SELECT_EDITABLE|E_CAL_POPUP_SELECT_ASSIGNABLE },
{ E_POPUP_ITEM, "90.forward", N_("_Forward as iCalendar"), e_calendar_table_on_forward, NULL, "stock_mail-forward", E_CAL_POPUP_SELECT_ONE },
- { E_POPUP_ITEM, "a0.markonecomplete", N_("_Mark as Complete"), mark_as_complete_cb, NULL, NULL, E_CAL_POPUP_SELECT_ONE, E_CAL_POPUP_SELECT_EDITABLE | E_CAL_POPUP_SELECT_NOTCOMPLETE},
- { E_POPUP_ITEM, "b0.markmanycomplete", N_("_Mark Selected Tasks as Complete"), mark_as_complete_cb, NULL, NULL, E_CAL_POPUP_SELECT_MANY, E_CAL_POPUP_SELECT_EDITABLE },
+ { E_POPUP_ITEM, "a0.markonecomplete", N_("_Mark as Complete"), mark_as_complete_cb, NULL, NULL, E_CAL_POPUP_SELECT_ONE | E_CAL_POPUP_SELECT_NOTCOMPLETE },
+ { E_POPUP_ITEM, "b0.markonenotcomplete", N_("_Mark as InComplete"), mark_as_notcomplete_cb, NULL, NULL, E_CAL_POPUP_SELECT_ONE | E_CAL_POPUP_SELECT_COMPLETE },
+ { E_POPUP_ITEM, "c0.markmanycomplete", N_("_Mark Tasks as Complete"), mark_as_complete_cb, NULL, NULL, E_CAL_POPUP_SELECT_MANY | E_CAL_POPUP_SELECT_NOTCOMPLETE},
+ { E_POPUP_ITEM, "d0.markmanynotcomplete", N_("Mark Tasks as _InComplete"), mark_as_notcomplete_cb, NULL, NULL, E_CAL_POPUP_SELECT_MANY | E_CAL_POPUP_SELECT_COMPLETE},
- { E_POPUP_BAR, "c0.bar" },
+ { E_POPUP_BAR, "e0.bar" },
- { E_POPUP_ITEM, "d0.delete", N_("_Delete"), delete_cb, NULL, GTK_STOCK_DELETE, E_CAL_POPUP_SELECT_ONE, E_CAL_POPUP_SELECT_EDITABLE },
- { E_POPUP_ITEM, "e0.deletemany", N_("_Delete Selected Tasks"), delete_cb, NULL, GTK_STOCK_DELETE, E_CAL_POPUP_SELECT_MANY, E_CAL_POPUP_SELECT_EDITABLE },
+ { E_POPUP_ITEM, "f0.delete", N_("_Delete"), delete_cb, NULL, GTK_STOCK_DELETE, E_CAL_POPUP_SELECT_ONE, E_CAL_POPUP_SELECT_EDITABLE },
+ { E_POPUP_ITEM, "g0.deletemany", N_("_Delete Selected Tasks"), delete_cb, NULL, GTK_STOCK_DELETE, E_CAL_POPUP_SELECT_MANY, E_CAL_POPUP_SELECT_EDITABLE },
};
static void
Index: gui/e-cal-popup.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-popup.h,v
retrieving revision 1.10
diff -u -p -r1.10 e-cal-popup.h
--- gui/e-cal-popup.h 30 Sep 2005 16:48:04 -0000 1.10
+++ gui/e-cal-popup.h 7 Oct 2005 11:46:31 -0000
@@ -86,6 +86,7 @@ enum _e_cal_popup_target_select_t {
E_CAL_POPUP_SELECT_DELEGATABLE = 1<<13,
E_CAL_POPUP_SELECT_ACCEPTABLE = 1<<14,
E_CAL_POPUP_SELECT_NOTCOMPLETE = 1<<15,
+ E_CAL_POPUP_SELECT_COMPLETE = 1<<16,
};
/**
Index: gui/e-cal-popup.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-cal-popup.c,v
retrieving revision 1.17
diff -u -p -r1.17 e-cal-popup.c
--- gui/e-cal-popup.c 30 Sep 2005 16:48:04 -0000 1.17
+++ gui/e-cal-popup.c 7 Oct 2005 11:46:32 -0000
@@ -212,7 +212,16 @@ e_cal_popup_target_new_select(ECalPopup
if (t->events->len == 0) {
client = e_cal_model_get_default_client(t->model);
- } else {
+
+ e_cal_is_read_only(client, &read_only, NULL);
+ if (!read_only)
+ mask &= ~E_CAL_POPUP_SELECT_EDITABLE;
+
+ if (!e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT)
+ && !e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_CONV_TO_ASSIGN_TASK))
+ mask &= ~E_CAL_POPUP_SELECT_ASSIGNABLE;
+
+ } else if (t->events->len == 1) {
ECalModelComponent *comp_data = (ECalModelComponent *)t->events->pdata[0];
ECalComponent *comp;
char *user_email = NULL;
@@ -222,10 +231,7 @@ e_cal_popup_target_new_select(ECalPopup
user_email = itip_get_comp_attendee (comp, comp_data->client);
mask &= ~E_CAL_POPUP_SELECT_ANY;
- if (t->events->len == 1)
- mask &= ~E_CAL_POPUP_SELECT_ONE;
- else
- mask &= ~E_CAL_POPUP_SELECT_MANY;
+ mask &= ~E_CAL_POPUP_SELECT_ONE;
if (icalcomponent_get_first_property (comp_data->icalcomp, ICAL_URL_PROPERTY))
mask &= ~E_CAL_POPUP_SELECT_HASURL;
@@ -269,22 +275,51 @@ e_cal_popup_target_new_select(ECalPopup
needs_to_accept (comp_data->icalcomp, user_email))
mask &= ~E_CAL_POPUP_SELECT_ACCEPTABLE;
- if (!icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY))
+ if (icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY))
+ mask &= ~E_CAL_POPUP_SELECT_COMPLETE;
+ else
mask &= ~E_CAL_POPUP_SELECT_NOTCOMPLETE;
+ e_cal_is_read_only(client, &read_only, NULL);
+ if (!read_only)
+ mask &= ~E_CAL_POPUP_SELECT_EDITABLE;
+
+ if (!e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT)
+ && !e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_CONV_TO_ASSIGN_TASK))
+ mask &= ~E_CAL_POPUP_SELECT_ASSIGNABLE;
+
g_object_unref (comp);
g_free (user_email);
- }
+ } else {
+ /* Multiple Items selected */
+ gint i, all_completed;
+
+ mask &= ~E_CAL_POPUP_SELECT_MANY;
+ mask &= ~E_CAL_POPUP_SELECT_ANY;
- e_cal_is_read_only(client, &read_only, NULL);
- if (!read_only)
- mask &= ~E_CAL_POPUP_SELECT_EDITABLE;
+ for (i=all_completed=0;i<t->events->len;i++) {
+
+ ECalModelComponent *comp_data = (ECalModelComponent *)t->events->pdata[i];
+ ECalComponent *comp;
-
+ comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp));
+
+ if (icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY))
+ all_completed++;
- if (!e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT)
- && !e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_CONV_TO_ASSIGN_TASK))
- mask &= ~E_CAL_POPUP_SELECT_ASSIGNABLE;
+ g_object_unref (comp);
+ }
+ if (all_completed == t->events->len)
+ mask &= ~E_CAL_POPUP_SELECT_COMPLETE;
+ else if (!all_completed)
+ mask &= ~E_CAL_POPUP_SELECT_NOTCOMPLETE;
+ else {
+ mask &= ~E_CAL_POPUP_SELECT_COMPLETE;
+ mask &= ~E_CAL_POPUP_SELECT_NOTCOMPLETE;
+ }
+ }
+
/* This bit isn't implemented ... */
mask &= ~E_CAL_POPUP_SELECT_NOTEDITING;
@@ -426,6 +461,7 @@ static const EPopupHookTargetMask ecalph
{ "delegate", E_CAL_POPUP_SELECT_DELEGATABLE },
{ "accept", E_CAL_POPUP_SELECT_ACCEPTABLE },
{ "not-complete", E_CAL_POPUP_SELECT_NOTCOMPLETE },
+ { "complete", E_CAL_POPUP_SELECT_COMPLETE },
{ 0 }
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]