planner r896 - in trunk: . src



Author: mvdpot
Date: Wed Mar 26 20:30:50 2008
New Revision: 896
URL: http://svn.gnome.org/viewvc/planner?rev=896&view=rev

Log:
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.



Modified:
   trunk/ChangeLog
   trunk/src/planner-gantt-view.c
   trunk/src/planner-task-tree.c

Modified: trunk/src/planner-gantt-view.c
==============================================================================
--- trunk/src/planner-gantt-view.c	(original)
+++ trunk/src/planner-gantt-view.c	Wed Mar 26 20:30:50 2008
@@ -594,6 +594,12 @@
 				      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;

Modified: trunk/src/planner-task-tree.c
==============================================================================
--- trunk/src/planner-task-tree.c	(original)
+++ trunk/src/planner-task-tree.c	Wed Mar 26 20:30:50 2008
@@ -1753,7 +1753,7 @@
 	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 @@
 			    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 @@
 								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,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]