Re: working on



First of all and to learn a bit Planner, I worked to keep
the "Show Guide Lines" option checked from a work session to another
one. At present, you need to reselect this option every time you run
Planner.
But with the patch, it is saved in the Gantt view structure so you
needn't to reselect the option the next time you load your project.

This involves mainly planner-gantt-view.c and planner-gantt-chart.c,
and have a similar comportment that the "Critical Task Highlight"
option's one, for example. (guidelines_option.patch attached, of course
tell me what you think !)

Other points are :
* about the way you select dates on the calendar dialog :
it would be nice to select a few dates and to be able to apply changes
(like changing day-type) on every dates in the selection instead of date
after date.
So I added a GList of selected_days in the _PlannerCalendar structure.
The list is updated when you keep the shift key engaged and you move
from one date to another (it could be on other events as well of course,
like selecting it with mouse...).

However it's quite a lot of changes so before going ahead I wanted to
know what you think about all this and how you would do it. (I still
need to apply changes to the whole selection especially)

* about the HTML exportation :
	-- get internationalization for the html produced by the plugin
It's a bit tricky because xlst files are written with English words in
it for some labels like "Company", "Manager", "week"...

I thought about :
		- adding a new set of translation files for this plugin but it
wouldn't be very "clean", also you would need to put the current
language information when you generate the XML.
		- adding every word needed for presentation on the XML data, already
translated in the same way that every other word in the application.
Then you just have to get the translated word in the stylesheets instead
of writting it. I think it would be ok that way.
		- any idea ? (generating at least parts of the xslt files ? not so
easy...)

	-- don't put in the HTML information from the columns which are not in
"visible state" on the different views
(For example, if you don't want anyone to see the cost of your resources
for the project. )
		- a simple way to make this would be to put blank information when
generating the XML where columns are set to be hide
		- otherwise you would have to generate the presentation stylesheets
dynamically...

* also, have you thought about including PERT diagrams in Planner ?

Regards,
Marie
Index: src/planner-gantt-chart.c
===================================================================
--- src/planner-gantt-chart.c	(r�sion 833)
+++ src/planner-gantt-chart.c	(copie de travail)
@@ -55,6 +55,7 @@
 
 #define CRITICAL_PATH_KEY  "/views/gantt_view/highlight_critical_path"
 #define NOSTDDAYS_PATH_KEY "/views/gantt_view/display_nonstandard_days"
+#define GUIDELINES_PATH_KEY "/views/gantt_view/show_guidelines"
 
 
 typedef struct _TreeNode TreeNode; 
@@ -108,6 +109,9 @@
 	/* Nonstandard days visualization */
 	gboolean         nonstandard_days;
 
+	/* GuideLines . */
+	gboolean 		 guidelines;
+
 	/* Keep a list of signal connection ids, so we can remove them
 	 * easily.
 	 */
@@ -390,6 +394,12 @@
 							  NULL);
 	priv->nonstandard_days   = planner_conf_get_bool (NOSTDDAYS_PATH_KEY,
 							  NULL);
+	priv->guidelines = planner_conf_get_bool (GUIDELINES_PATH_KEY, NULL);
+
+	g_object_set (G_OBJECT(chart->priv->background),
+			"show_guidelines",
+			priv->guidelines,
+			NULL);
 }
 
 static void
@@ -1919,9 +1929,9 @@
 	planner_conf_set_bool (CRITICAL_PATH_KEY, state, NULL);
 }
 
-void
+void 
 planner_gantt_chart_set_show_guidelines (PlannerGanttChart *chart,
-				    gboolean           state)
+		gboolean 		state)
 {
 	PlannerGanttChartPriv *priv;
 
@@ -1929,14 +1939,22 @@
 
 	priv = chart->priv;
 
+	if (priv->guidelines == state) {
+		return;
+	}
+
+	priv->guidelines = state;
+
 	g_object_set (G_OBJECT(chart->priv->background),
-		      "show_guidelines",
-		      state,
-		      NULL);
+			"show_guidelines",
+			state,
+			NULL);
+	gtk_widget_queue_draw (GTK_WIDGET (priv->canvas));
 
-	gtk_widget_queue_draw (GTK_WIDGET (priv->canvas));
+	planner_conf_set_bool (GUIDELINES_PATH_KEY, state, NULL);
 }
 
+
 gboolean
 planner_gantt_chart_get_highlight_critical_tasks (PlannerGanttChart *chart)
 {
@@ -1945,6 +1963,14 @@
 	return chart->priv->highlight_critical;
 }
 
+gboolean
+planner_gantt_chart_get_show_guidelines (PlannerGanttChart *chart)
+{
+	g_return_val_if_fail (PLANNER_IS_GANTT_CHART (chart), FALSE);
+
+	return chart->priv->guidelines;
+}
+
 void
 planner_gantt_chart_set_nonstandard_days (PlannerGanttChart *chart,
 						  gboolean           state)
Index: src/planner-gantt-chart.h
===================================================================
--- src/planner-gantt-chart.h	(r�sion 833)
+++ src/planner-gantt-chart.h	(copie de travail)
@@ -94,6 +94,9 @@
 planner_gantt_chart_set_show_guidelines			(PlannerGanttChart  *chart,
 							 gboolean       state);
 
+gboolean
+planner_gantt_chart_get_show_guidelines 		(PlannerGanttChart *chart);
+
 void
 planner_gantt_chart_set_nonstandard_days             (PlannerGanttChart *chart,
 							   gboolean           state);
Index: src/planner-gantt-view.c
===================================================================
--- src/planner-gantt-view.c	(r�sion 833)
+++ src/planner-gantt-view.c	(copie de travail)
@@ -197,33 +197,6 @@
 G_DEFINE_TYPE (PlannerGanttView, planner_gantt_view, PLANNER_TYPE_VIEW);
 
 
-static gboolean
-gantt_view_chart_scroll_event (GtkWidget * gki, GdkEventScroll * event, PlannerGanttView *view)
-{
-	gboolean can_in, can_out;
-	PlannerGanttViewPriv *priv;
-	
-	if (event->state & GDK_CONTROL_MASK) {
-		priv = view->priv;
-		planner_gantt_chart_can_zoom (PLANNER_GANTT_CHART (priv->gantt), &can_in, &can_out);
-		switch (event->direction) {
-      			case GDK_SCROLL_UP: {
-				if (can_in)
-					gantt_view_zoom_in_cb  (NULL, view);
-	        		break;
-			}
-			case GDK_SCROLL_DOWN:
-				if (can_out)
-					gantt_view_zoom_out_cb  (NULL, view);
-			        break;
-		      default:
-        		break;
-		}
-    	}
-
-	return TRUE;
-}
-
 static void
 planner_gantt_view_class_init (PlannerGanttViewClass *klass)
 {
@@ -256,6 +229,7 @@
 {
 	PlannerGanttViewPriv *priv;
 	gboolean              show_critical, show_nostd_days;
+    gboolean			  show_guidelines;
 	gchar                *filename;
 
 	priv = PLANNER_GANTT_VIEW (view)->priv;
@@ -287,6 +261,9 @@
 	show_nostd_days = planner_gantt_chart_get_nonstandard_days (
 		PLANNER_GANTT_CHART (priv->gantt));
 
+	show_guidelines = planner_gantt_chart_get_show_guidelines (
+			PLANNER_GANTT_CHART (priv->gantt));
+
 	planner_task_tree_set_highlight_critical (PLANNER_TASK_TREE (priv->tree),
 						  show_critical);
 
@@ -300,6 +277,10 @@
 	gtk_toggle_action_set_active (
 		GTK_TOGGLE_ACTION (gtk_action_group_get_action (priv->actions, "NonstandardDays")),
 		show_nostd_days);
+	
+	gtk_toggle_action_set_active (
+		GTK_TOGGLE_ACTION (gtk_action_group_get_action (priv->actions, "ShowGuideLines")),
+		show_guidelines);
 
 	gantt_view_selection_changed_cb (PLANNER_TASK_TREE (priv->tree),
 					 PLANNER_GANTT_VIEW (view));
@@ -596,11 +577,6 @@
 	priv->gantt = planner_gantt_chart_new_with_model (model);
 	planner_gantt_chart_set_view (PLANNER_GANTT_CHART (priv->gantt),
 				      PLANNER_TASK_TREE (tree));
-
-	gtk_widget_set_events (GTK_WIDGET (priv->gantt), GDK_SCROLL_MASK);
-
-	g_signal_connect (priv->gantt, "scroll-event",
-                    G_CALLBACK (gantt_view_chart_scroll_event), view);
 	
 	g_object_unref (model);
 
@@ -1153,6 +1129,7 @@
 	planner_gantt_chart_set_show_guidelines (
 		PLANNER_GANTT_CHART (priv->gantt),
  		state);
+
 }
 
 static void


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