Commit a81054ca authored by Alvaro del Castillo's avatar Alvaro del Castillo Committed by Alvaro del Castillo

src/planner-calendar-dialog.c src/planner-day-type-dialog.c

2004-06-23 Alvaro del Castillo  <acs@barrapunto.com>

	* src/planner-calendar-dialog.c
	* src/planner-day-type-dialog.c
	* src/planner-group-dialog.c
	* src/planner-phase-dialog.c
	* src/planner-project-properties.c
	* src/planner-resource-cmd.c
	* src/planner-resource-dialog.c
	* src/planner-resource-view.c
	* src/planner-task-cmd.c
	* src/planner-task-dialog.c
	* src/planner-task-tree.c:
	Change strings from undo command to fix bug #144742 and
	use the new undo API call planner_cmd_new which fix the
	more hard change in bug #144734.
parent be8c3c18
2004-06-23 Alvaro del Castillo <acs@barrapunto.com>
* src/planner-calendar-dialog.c
* src/planner-day-type-dialog.c
* src/planner-group-dialog.c
* src/planner-phase-dialog.c
* src/planner-project-properties.c
* src/planner-resource-cmd.c
* src/planner-resource-dialog.c
* src/planner-resource-view.c
* src/planner-task-cmd.c
* src/planner-task-dialog.c
* src/planner-task-tree.c:
Change strings from undo command to fix bug #144742 and
use the new undo API call planner_cmd_new which fix the
more hard change in bug #144734.
2004-06-23 Richard Hult <richard@imendio.com>
* src/planner-ttable-model.c (ttable_model_resource_removed_cb):
......
......@@ -156,10 +156,6 @@ cal_cmd_day_type_undo (PlannerCmd *cmd_base)
{
CalCmdDayType *cmd = (CalCmdDayType*) cmd_base;
if (g_getenv ("PLANNER_DEBUG_UNDO_CAL")) {
g_message ("Undo Changing calendar for day ...");
}
mrp_calendar_set_days (cmd->calendar, cmd->time, cmd->old_day, -1);
}
......@@ -255,10 +251,6 @@ cal_cmd_remove_undo (PlannerCmd *cmd_base)
GList *c;
CalCmdRemove *cmd = (CalCmdRemove*) cmd_base;
if (g_getenv ("PLANNER_DEBUG_UNDO_CAL")) {
g_message ("Undo removing calendar ...");
}
mrp_calendar_add (cmd->calendar, cmd->parent);
if (cmd->resources != NULL) {
......@@ -376,9 +368,6 @@ cal_cmd_add_undo (PlannerCmd *cmd_base)
{
CalCmdAdd *cmd = (CalCmdAdd*) cmd_base;
if (g_getenv ("PLANNER_DEBUG_UNDO_CAL")) {
g_message ("Undo adding calendar ...");
}
mrp_calendar_remove (cmd->calendar);
}
......
......@@ -486,15 +486,17 @@ day_type_cmd_add (DialogData *data,
{
PlannerCmd *cmd_base;
DayTypeCmdAdd *cmd;
gchar *undo_label;;
cmd = g_new0 (DayTypeCmdAdd, 1);
undo_label = g_strdup_printf (_("Add day type \"%s\""), name);
cmd_base = planner_cmd_new (DayTypeCmdAdd,
undo_label,
day_type_cmd_add_do,
day_type_cmd_add_undo,
day_type_cmd_add_free);
g_free (undo_label);
cmd_base = (PlannerCmd*) cmd;
cmd_base->label = g_strdup_printf (_("Add day type \"%s\""), name);
cmd_base->do_func = day_type_cmd_add_do;
cmd_base->undo_func = day_type_cmd_add_undo;
cmd_base->free_func = day_type_cmd_add_free;
cmd = (DayTypeCmdAdd *) cmd_base;
cmd->project = data->project;
......@@ -545,15 +547,19 @@ day_type_cmd_remove (DialogData *data,
{
PlannerCmd *cmd_base;
DayTypeCmdRemove *cmd;
gchar *undo_label;;
cmd = g_new0 (DayTypeCmdRemove, 1);
undo_label = g_strdup_printf (_("Remove day type \"%s\""), mrp_day_get_name (day));
cmd_base = (PlannerCmd*) cmd;
cmd_base = planner_cmd_new (DayTypeCmdRemove,
undo_label,
day_type_cmd_remove_do,
day_type_cmd_remove_undo,
day_type_cmd_remove_free);
cmd_base->label = g_strdup_printf (_("Remove day type \"%s\""), mrp_day_get_name (day));
cmd_base->do_func = day_type_cmd_remove_do;
cmd_base->undo_func = day_type_cmd_remove_undo;
cmd_base->free_func = day_type_cmd_remove_free;
g_free (undo_label);
cmd = (DayTypeCmdRemove *) cmd_base;
cmd->project = data->project;
......
......@@ -297,14 +297,13 @@ group_cmd_insert (PlannerView *view)
PlannerCmd *cmd_base;
GroupCmdInsert *cmd;
cmd = g_new0 (GroupCmdInsert, 1);
cmd_base = planner_cmd_new (GroupCmdInsert,
_("Insert group"),
group_cmd_insert_do,
group_cmd_insert_undo,
group_cmd_insert_free);
cmd_base = (PlannerCmd*) cmd;
cmd_base->label = g_strdup (_("Insert group"));
cmd_base->do_func = group_cmd_insert_do;
cmd_base->undo_func = group_cmd_insert_undo;
cmd_base->free_func = group_cmd_insert_free;
cmd = (GroupCmdInsert *) cmd_base;
cmd->project = planner_window_get_project (view->main_window);
......@@ -422,14 +421,13 @@ group_cmd_remove (PlannerView *view, MrpGroup *group)
PlannerCmd *cmd_base;
GroupCmdRemove *cmd;
cmd = g_new0 (GroupCmdRemove, 1);
cmd_base = (PlannerCmd*) cmd;
cmd_base = planner_cmd_new (GroupCmdRemove,
_("Remove group"),
group_cmd_remove_do,
group_cmd_remove_undo,
group_cmd_remove_free);
cmd_base->label = g_strdup (_("Remove group"));
cmd_base->do_func = group_cmd_remove_do;
cmd_base->undo_func = group_cmd_remove_undo;
cmd_base->free_func = group_cmd_remove_free;
cmd = (GroupCmdRemove *) cmd_base;
cmd->project = planner_window_get_project (view->main_window);
cmd->group = group;
......@@ -518,14 +516,13 @@ group_cmd_default (PlannerView *view,
PlannerCmd *cmd_base;
GroupCmdDefault *cmd;
cmd = g_new0 (GroupCmdDefault, 1);
cmd_base = (PlannerCmd*) cmd;
cmd_base = planner_cmd_new (GroupCmdDefault,
_("Default group"),
group_cmd_default_do,
group_cmd_default_undo,
group_cmd_default_free);
cmd_base->label = g_strdup (_("Default group"));
cmd_base->do_func = group_cmd_default_do;
cmd_base->undo_func = group_cmd_default_undo;
cmd_base->free_func = group_cmd_default_free;
cmd = (GroupCmdDefault *) cmd_base;
cmd->project = planner_window_get_project (view->main_window);
......@@ -637,14 +634,13 @@ group_cmd_edit_property (PlannerView *view,
PlannerCmd *cmd_base;
GroupCmdEditProperty *cmd;
cmd = g_new0 (GroupCmdEditProperty, 1);
cmd_base = planner_cmd_new (GroupCmdEditProperty,
_("Edit group property"),
group_cmd_edit_property_do,
group_cmd_edit_property_undo,
group_cmd_edit_property_free);
cmd_base = (PlannerCmd*) cmd;
cmd_base->label = g_strdup (_("Edit group property"));
cmd_base->do_func = group_cmd_edit_property_do;
cmd_base->undo_func = group_cmd_edit_property_undo;
cmd_base->free_func = group_cmd_edit_property_free;
cmd = (GroupCmdEditProperty *) cmd_base;
cmd->property = property;
cmd->group = group;
......
......@@ -528,14 +528,13 @@ phase_cmd_insert (PlannerWindow *main_window,
PlannerCmd *cmd_base;
PhaseCmdInsert *cmd;
cmd = g_new0 (PhaseCmdInsert, 1);
cmd_base = planner_cmd_new (PhaseCmdInsert,
_("Insert phase"),
phase_cmd_insert_do,
phase_cmd_insert_undo,
phase_cmd_insert_free);
cmd_base = (PlannerCmd*) cmd;
cmd_base->label = g_strdup (_("Insert phase"));
cmd_base->do_func = phase_cmd_insert_do;
cmd_base->undo_func = phase_cmd_insert_undo;
cmd_base->free_func = phase_cmd_insert_free;
cmd = (PhaseCmdInsert *) cmd_base;
cmd->project = planner_window_get_project (main_window);
......@@ -628,14 +627,13 @@ phase_cmd_remove (PlannerWindow *window,
PlannerCmd *cmd_base;
PhaseCmdRemove *cmd;
cmd = g_new0 (PhaseCmdRemove, 1);
cmd_base = (PlannerCmd*) cmd;
cmd_base = planner_cmd_new (PhaseCmdRemove,
_("Remove phase"),
phase_cmd_remove_do,
phase_cmd_remove_undo,
phase_cmd_remove_free);
cmd_base->label = g_strdup (_("Remove phase"));
cmd_base->do_func = phase_cmd_remove_do;
cmd_base->undo_func = phase_cmd_remove_undo;
cmd_base->free_func = phase_cmd_remove_free;
cmd = (PhaseCmdRemove *) cmd_base;
cmd->project = planner_window_get_project (window);
cmd->phase = g_strdup (phase);
......
......@@ -308,7 +308,13 @@ property_cmd_edit (DialogData *data,
PlannerCmd *cmd_base;
PropertyCmdEdit *cmd;
cmd = g_new0 (PropertyCmdEdit, 1);
cmd_base = planner_cmd_new (PropertyCmdEdit,
label,
property_cmd_edit_do,
property_cmd_edit_undo,
NULL /* FIXME */);
cmd = (PropertyCmdEdit *) cmd_base;
switch (type) {
case PROP_STRING:
......@@ -344,13 +350,6 @@ property_cmd_edit (DialogData *data,
break;
}
cmd_base = (PlannerCmd*) cmd;
cmd_base->label = g_strdup (label);
cmd_base->do_func = property_cmd_edit_do;
cmd_base->undo_func = property_cmd_edit_undo;
cmd_base->free_func = NULL; /* FIXME */
cmd->project = data->project;
cmd->type = type;
cmd->property = g_strdup (property);
......
......@@ -70,14 +70,13 @@ planner_resource_cmd_insert (PlannerWindow *main_window,
PlannerCmd *cmd_base;
ResourceCmdInsert *cmd;
cmd = g_new0 (ResourceCmdInsert, 1);
cmd_base = planner_cmd_new (ResourceCmdInsert,
_("Insert resource"),
resource_cmd_insert_do,
resource_cmd_insert_undo,
resource_cmd_insert_free);
cmd_base = (PlannerCmd*) cmd;
cmd_base->label = g_strdup (_("Insert resource"));
cmd_base->do_func = resource_cmd_insert_do;
cmd_base->undo_func = resource_cmd_insert_undo;
cmd_base->free_func = resource_cmd_insert_free;
cmd = (ResourceCmdInsert *) cmd_base;
if (resource == NULL) {
cmd->resource = g_object_new (MRP_TYPE_RESOURCE, NULL);
......
......@@ -506,14 +506,13 @@ resource_cmd_edit_calendar (DialogData *data,
ResourceCmdCalendar *cmd;
MrpCalendar *current_calendar;
cmd = g_new0 (ResourceCmdCalendar, 1);
cmd_base = planner_cmd_new (ResourceCmdCalendar,
_("Edit resource calendar"),
resource_cmd_calendar_do,
resource_cmd_calendar_undo,
resource_cmd_calendar_free);
cmd_base = (PlannerCmd*) cmd;
cmd_base->label = g_strdup (_("Edit resource calendar from dialog"));
cmd_base->do_func = resource_cmd_calendar_do;
cmd_base->undo_func = resource_cmd_calendar_undo;
cmd_base->free_func = resource_cmd_calendar_free;
cmd = (ResourceCmdCalendar *) cmd_base;
cmd->resource = g_object_ref (data->resource);
......@@ -588,14 +587,13 @@ resource_cmd_edit_note (DialogData *data,
return NULL;
}
cmd = g_new0 (ResourceCmdEditNote, 1);
cmd_base = planner_cmd_new (ResourceCmdEditNote,
_("Edit resource note"),
resource_cmd_note_do,
resource_cmd_note_undo,
resource_cmd_note_free);
cmd_base = (PlannerCmd*) cmd;
cmd_base->label = g_strdup (_("Edit resource note from dialog"));
cmd_base->do_func = resource_cmd_note_do;
cmd_base->undo_func = resource_cmd_note_undo;
cmd_base->free_func = resource_cmd_note_free;
cmd = (ResourceCmdEditNote *) cmd_base;
cmd->property = g_strdup ("note");
cmd->resource = g_object_ref (data->resource);
......@@ -661,15 +659,14 @@ resource_cmd_edit_cost (DialogData *data,
if (cost == old_cost) {
return NULL;
}
cmd = g_new0 (ResourceCmdEditCost, 1);
cmd_base = (PlannerCmd*) cmd;
cmd_base->label = g_strdup (_("Edit resource cost from dialog"));
cmd_base->do_func = resource_cmd_cost_do;
cmd_base->undo_func = resource_cmd_cost_undo;
cmd_base->free_func = resource_cmd_cost_free;
cmd_base = planner_cmd_new (ResourceCmdEditCost,
_("Edit resource note"),
resource_cmd_cost_do,
resource_cmd_cost_undo,
resource_cmd_cost_free);
cmd = (ResourceCmdEditCost *) cmd_base;
cmd->property = g_strdup ("cost");
cmd->resource = g_object_ref (data->resource);
......@@ -732,14 +729,13 @@ resource_cmd_edit_property (PlannerWindow *main_window,
PlannerCmd *cmd_base;
ResourceCmdEditProperty *cmd;
cmd = g_new0 (ResourceCmdEditProperty, 1);
cmd_base = planner_cmd_new (ResourceCmdEditProperty,
_("Edit resource property"),
resource_cmd_edit_property_do,
resource_cmd_edit_property_undo,
resource_cmd_edit_property_free);
cmd_base = (PlannerCmd*) cmd;
cmd_base->label = g_strdup (_("Edit resource property from dialog"));
cmd_base->do_func = resource_cmd_edit_property_do;
cmd_base->undo_func = resource_cmd_edit_property_undo;
cmd_base->free_func = resource_cmd_edit_property_free;
cmd = (ResourceCmdEditProperty *) cmd_base;
cmd->property = g_strdup (property);
cmd->resource = g_object_ref (resource);
......@@ -774,14 +770,13 @@ resource_cmd_edit_property_focus (PlannerWindow *main_window,
PlannerCmd *cmd_base;
ResourceCmdEditProperty *cmd;
cmd = g_new0 (ResourceCmdEditProperty, 1);
cmd_base = (PlannerCmd*) cmd;
cmd_base = planner_cmd_new (ResourceCmdEditProperty,
_("Edit resource property"),
resource_cmd_edit_property_do,
resource_cmd_edit_property_undo,
resource_cmd_edit_property_free);
cmd_base->label = g_strdup (_("Edit resource property from dialog"));
cmd_base->do_func = resource_cmd_edit_property_do;
cmd_base->undo_func = resource_cmd_edit_property_undo;
cmd_base->free_func = resource_cmd_edit_property_free;
cmd = (ResourceCmdEditProperty *) cmd_base;
cmd->property = g_strdup (property);
cmd->resource = g_object_ref (resource);
......@@ -1286,7 +1281,7 @@ resource_dialog_resource_cost_changed_cb (MrpResource *resource,
dialog);
}
/* FIXME: undo support */
/* FIXME: undo support ... it seems undo is working */
static void
resource_dialog_resource_calendar_changed_cb (MrpResource *resource,
GParamSpec *pspec,
......
......@@ -923,14 +923,13 @@ resource_cmd_remove (PlannerView *view,
PlannerCmd *cmd_base;
ResourceCmdRemove *cmd;
cmd = g_new0 (ResourceCmdRemove, 1);
cmd_base = planner_cmd_new (ResourceCmdRemove,
_("Remove resource"),
resource_cmd_remove_do,
resource_cmd_remove_undo,
resource_cmd_remove_free);
cmd_base = (PlannerCmd*) cmd;
cmd_base->label = g_strdup (_("Remove resource"));
cmd_base->do_func = resource_cmd_remove_do;
cmd_base->undo_func = resource_cmd_remove_undo;
cmd_base->free_func = resource_cmd_remove_free;
cmd = (ResourceCmdRemove *) cmd_base;
cmd->project = planner_window_get_project (view->main_window);
cmd->resource = g_object_ref (resource);
......@@ -1325,14 +1324,13 @@ resource_cmd_edit_property (PlannerView *view,
PlannerCmd *cmd_base;
ResourceCmdEditProperty *cmd;
cmd = g_new0 (ResourceCmdEditProperty, 1);
cmd_base = (PlannerCmd*) cmd;
cmd_base = planner_cmd_new (ResourceCmdEditProperty,
_("Edit resource property"),
resource_cmd_edit_property_do,
resource_cmd_edit_property_undo,
resource_cmd_edit_property_free);
cmd_base->label = g_strdup (_("Edit resource property"));
cmd_base->do_func = resource_cmd_edit_property_do;
cmd_base->undo_func = resource_cmd_edit_property_undo;
cmd_base->free_func = resource_cmd_edit_property_free;
cmd = (ResourceCmdEditProperty *) cmd_base;
cmd->property = g_strdup (property);
cmd->resource = g_object_ref (resource);
......@@ -1410,14 +1408,13 @@ resource_cmd_edit_custom_property (PlannerView *view,
PlannerCmd *cmd_base;
ResourceCmdEditCustomProperty *cmd;
cmd = g_new0 (ResourceCmdEditCustomProperty, 1);
cmd_base = (PlannerCmd*) cmd;
cmd_base = planner_cmd_new (ResourceCmdEditCustomProperty,
_("Edit resource custom property"),
resource_cmd_edit_custom_property_do,
resource_cmd_edit_custom_property_undo,
resource_cmd_edit_custom_property_free);
cmd_base->label = g_strdup (_("Edit resource custom property"));
cmd_base->do_func = resource_cmd_edit_custom_property_do;
cmd_base->undo_func = resource_cmd_edit_custom_property_undo;
cmd_base->free_func = resource_cmd_edit_custom_property_free;
cmd = (ResourceCmdEditCustomProperty *) cmd_base;
cmd->property = property;
cmd->resource = g_object_ref (resource);
......
......@@ -127,10 +127,6 @@ task_cmd_unlink_do (PlannerCmd *cmd_base)
cmd = (TaskCmdLink*) cmd_base;
if (g_getenv ("PLANNER_DEBUG_UNDO_TASK")) {
g_message ("Removing the link ...");
}
mrp_task_remove_predecessor (cmd->after, cmd->before);
return TRUE;
......
......@@ -444,7 +444,7 @@ task_cmd_edit_property_focus (PlannerWindow *main_window,
TaskCmdEditProperty *cmd;
cmd_base = planner_cmd_new (TaskCmdEditProperty,
_("Edit task property from dialog"),
_("Edit task property"),
task_cmd_edit_property_do,
task_cmd_edit_property_undo,
task_cmd_edit_property_free);
......@@ -518,7 +518,7 @@ task_cmd_edit_type (PlannerWindow *main_window,
}
cmd_base = planner_cmd_new (TaskCmdEditType,
_("Edit task type from dialog"),
_("Edit task type"),
task_cmd_edit_type_do,
task_cmd_edit_type_undo,
task_cmd_edit_type_free);
......@@ -585,7 +585,7 @@ task_cmd_edit_sched (PlannerWindow *main_window,
}
cmd_base = planner_cmd_new (TaskCmdEditSchedule,
_("Edit task schedule from dialog"),
_("Edit task schedule"),
task_cmd_edit_sched_do,
task_cmd_edit_sched_undo,
task_cmd_edit_sched_free);
......@@ -663,7 +663,7 @@ task_cmd_assign_add (PlannerWindow *main_window,
}
cmd_base = planner_cmd_new (TaskCmdEditAssignment,
_("Add a resource for a task from dialog"),
_("Add resource to task"),
task_cmd_assign_add_do,
task_cmd_assign_add_undo,
task_cmd_assign_add_free);
......@@ -723,7 +723,7 @@ task_cmd_assign_remove (PlannerWindow *main_window,
TaskCmdEditAssignment *cmd;
cmd_base = planner_cmd_new (TaskCmdEditAssignment,
_("Remove a resource from a task from dialog"),
_("Remove resource from task"),
task_cmd_assign_remove_do,
task_cmd_assign_remove_undo,
task_cmd_assign_remove_free);
......@@ -782,7 +782,7 @@ task_cmd_assign_units (PlannerWindow *main_window,
TaskCmdEditAssignment *cmd;
cmd_base = planner_cmd_new (TaskCmdEditAssignment,
_("Change resource units for a task from dialog"),
_("Change resource units in task"),
task_cmd_assign_units_do,
task_cmd_assign_units_undo,
task_cmd_assign_units_free);
......@@ -949,7 +949,7 @@ task_cmd_edit_lag (PlannerWindow *main_window,
}
cmd_base = planner_cmd_new (TaskCmdEditType,
_("Edit lag predecessor from dialog"),
_("Edit lag predecessor"),
task_cmd_edit_lag_do,
task_cmd_edit_lag_undo,
task_cmd_edit_lag_free);
......@@ -1015,7 +1015,7 @@ task_cmd_edit_note (DialogData *data,
}
cmd_base = planner_cmd_new (TaskCmdEditNote,
_("Edit task note from dialog"),
_("Edit task note"),
task_cmd_edit_note_do,
task_cmd_edit_note_undo,
task_cmd_edit_note_free);
......@@ -2489,7 +2489,6 @@ task_dialog_assignment_toggled_cb (GtkCellRendererText *cell,
} else {
MrpAssignment *assignment;
/* FIXME: UNDO */
assignment = mrp_task_get_assignment (data->task, resource);
if (assignment) {
......
......@@ -237,15 +237,13 @@ task_cmd_edit_property (PlannerTaskTree *tree,
TaskCmdEditProperty *cmd;
PlannerGanttModel *model;
cmd = g_new0 (TaskCmdEditProperty, 1);
cmd_base = planner_cmd_new (TaskCmdEditProperty,
_("Edit task property"),
task_cmd_edit_property_do,
task_cmd_edit_property_undo,
task_cmd_edit_property_free);
cmd_base = (PlannerCmd*) cmd;
cmd_base->label = g_strdup (_("Edit task property"));
cmd_base->do_func = task_cmd_edit_property_do;
cmd_base->undo_func = task_cmd_edit_property_undo;
cmd_base->free_func = task_cmd_edit_property_free;
cmd = (TaskCmdEditProperty *) cmd_base;
cmd->tree = tree;
cmd->project = task_tree_get_project (tree);
......@@ -688,16 +686,15 @@ task_cmd_constraint (PlannerTaskTree *tree,
PlannerCmd *cmd_base;
TaskCmdConstraint *cmd;
cmd = g_new0 (TaskCmdConstraint, 1);
cmd_base = planner_cmd_new (TaskCmdConstraint,
_("Apply constraint to task"),
task_cmd_constraint_do,
task_cmd_constraint_undo,
task_cmd_constraint_free);
cmd_base = (PlannerCmd *) cmd;
cmd_base->label = g_strdup (_("Constraint task"));
cmd_base->do_func = task_cmd_constraint_do;
cmd_base->undo_func = task_cmd_constraint_undo;
cmd_base->free_func = task_cmd_constraint_free;
cmd->task = g_object_ref (task);
cmd = (TaskCmdConstraint *) cmd_base;
cmd->task = g_object_ref (task);
cmd->constraint = g_new0 (MrpConstraint, 1);
cmd->constraint->time = constraint.time;
cmd->constraint->type = constraint.type;
......@@ -751,14 +748,14 @@ task_cmd_reset_constraint (PlannerTaskTree *tree,
PlannerCmd *cmd_base;
TaskCmdConstraint *cmd;
cmd = g_new0 (TaskCmdConstraint, 1);
cmd_base = planner_cmd_new (TaskCmdConstraint,
_("Reset task constraint"),
task_cmd_constraint_reset_do,
task_cmd_constraint_reset_undo,
task_cmd_constraint_reset_free);
cmd = (TaskCmdConstraint *) cmd_base;
cmd_base = (PlannerCmd *) cmd;
cmd_base->label = g_strdup (_("Constraint task reset"));
cmd_base->do_func = task_cmd_constraint_reset_do;
cmd_base->undo_func = task_cmd_constraint_reset_undo;
cmd_base->free_func = task_cmd_constraint_reset_free;
cmd->task = g_object_ref (task);
g_object_get (task, "constraint",
......@@ -885,13 +882,13 @@ task_cmd_move (PlannerTaskTree *tree,
MrpTask *parent_old;
cmd = g_new0 (TaskCmdMove, 1);
cmd_base = planner_cmd_new (TaskCmdMove,
_("Move task"),
task_cmd_move_do,
task_cmd_move_undo,
task_cmd_move_free);
cmd_base = (PlannerCmd*) cmd;
cmd_base->label = g_strdup (_("Move task"));
cmd_base->do_func = task_cmd_move_do;
cmd_base->undo_func = task_cmd_move_undo;
cmd_base->free_func = task_cmd_move_free;
cmd = (TaskCmdMove *) cmd_base;
cmd->project = g_object_ref (tree->priv->project);
cmd->task = g_object_ref (task);
......@@ -994,14 +991,14 @@ task_cmd_edit_custom_property (PlannerTaskTree *tree,
PlannerTaskTreePriv *priv = tree->priv;
TaskCmdEditCustomProperty *cmd;
cmd = g_new0 (TaskCmdEditCustomProperty, 1);
cmd_base = (PlannerCmd*) cmd;
cmd_base = planner_cmd_new (TaskCmdEditCustomProperty,
_("Edit task custom property"),
task_cmd_edit_custom_property_do,
task_cmd_edit_custom_property_undo,
task_cmd_edit_custom_property_free);
cmd_base->label = g_strdup (_("Edit task custom property"));
cmd_base->do_func = task_cmd_edit_custom_property_do;
cmd_base->undo_func = task_cmd_edit_custom_property_undo;
cmd_base->free_func = task_cmd_edit_custom_property_free;
cmd = (TaskCmdEditCustomProperty *) cmd_base;
cmd->property = property;
cmd->task = g_object_ref (task);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment