Commit 45eb813f authored by Maurice van der Pot's avatar Maurice van der Pot Committed by Maurice van der Pot

Added percent complete column to gantt view as well. Added range checking

2008-03-26  Maurice van der Pot  <griffon26@kfk4ever.com>

	* src/planner-gantt-view.c: (gantt_view_create_widget):
	Added percent	complete column to gantt view as well.
	* src/planner-task-tree.c: (task_tree_complete_edited),
	(task_tree_add_column):
	Added range checking for percent complete column to prevent GTK warnings.


svn path=/trunk/; revision=896
parent c0a9aefd
2008-03-26 Maurice van der Pot <griffon26@kfk4ever.com>
* src/planner-gantt-view.c: (gantt_view_create_widget):
Added percent complete column to gantt view as well.
* src/planner-task-tree.c: (task_tree_complete_edited),
(task_tree_add_column):
Added range checking for percent complete column to prevent GTK warnings.
2008-03-15 Maurice van der Pot <griffon26@kfk4ever.com>
* data/stylesheets/html1_gantt.xsl:
......
......@@ -594,6 +594,12 @@ gantt_view_create_widget (PlannerGanttView *view)
COL_SLACK, _("Slack"),
COL_COST, _("Cost"),
COL_ASSIGNED_TO, _("Assigned to"),
/* i18n: The string "% Complete" will be used in the header
* of a column containing values from 0 upto 100, indicating
* what part of a task has been completed.
* xgettext:no-c-format
*/
COL_COMPLETE, _("% Complete"),
-1);
priv->tree = tree;
......
......@@ -1753,7 +1753,7 @@ task_tree_complete_edited (GtkCellRendererText *cell,
GtkTreeIter iter;
MrpTask *task;
GValue value = { 0 };
gint complete;
gint complete;
model = gtk_tree_view_get_model (view);
path = gtk_tree_path_new_from_string (path_string);
......@@ -1763,7 +1763,11 @@ task_tree_complete_edited (GtkCellRendererText *cell,
COL_TASK, &task,
-1);
complete = atoi(new_text);
complete = atoi(new_text);
if (complete < 0) complete = 0;
if (complete > 100) complete = 100;
if (mrp_task_get_percent_complete (MRP_TASK (task)) != complete) {
g_value_init (&value, G_TYPE_INT);
g_value_set_int (&value, complete);
......@@ -2523,7 +2527,7 @@ task_tree_add_column (PlannerTaskTree *tree,
NULL);
gtk_tree_view_column_set_resizable (col, TRUE);
gtk_tree_view_column_set_min_width (col, 70);
gtk_tree_view_column_set_min_width (col, 100);
gtk_tree_view_column_set_cell_data_func (col,
cell,
task_tree_complete_data_func,
......
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