Commit 1c5ea548 authored by Richard Hult's avatar Richard Hult Committed by Richard Hult

Bump for a pre-release.

2005-02-18  Richard Hult  <richard@imendio.com>

	* configure.in: Bump for a pre-release.

	* data/glade/task-dialog.glade: Change the work/duration
	spinbuttons to entries.

	* src/planner-format.c: (planner_format_duration_with_day_length),
	(planner_format_duration): Move here from the task tree and make
	more general.

	* src/planner-gantt-print.c:
	* src/planner-gantt-row.c:
	* src/planner-project-properties.c:
	* src/planner-resource-view.c:
	* src/planner-task-tree.c:
	* src/planner-ttable-row.c: Update for the above change.

	* src/planner-task-dialog.c: Change the work/duration spinbuttons
	to entries and add duration parsing like the tree views has.
parent c8e189f8
2005-02-18 Richard Hult <richard@imendio.com>
* configure.in: Bump for a pre-release.
* data/glade/task-dialog.glade: Change the work/duration
spinbuttons to entries.
* src/planner-format.c: (planner_format_duration_with_day_length),
(planner_format_duration): Move here from the task tree and make
more general.
* src/planner-gantt-print.c:
* src/planner-gantt-row.c:
* src/planner-project-properties.c:
* src/planner-resource-view.c:
* src/planner-task-tree.c:
* src/planner-ttable-row.c: Update for the above change.
* src/planner-task-dialog.c: Change the work/duration spinbuttons
to entries and add duration parsing like the tree views has.
2005-02-18 Richard Hult <richard@imendio.com>
* src/planner-sql-plugin.c (check_database_tables): Don't g_free,
g_object_unref.
* configure.in: Bump version for a pre-release.
* src/planner-task-tree.c: (task_cmd_move_undo), (task_cmd_move):
Restore the task type of the parent on undo.
(task_cmd_move): Initialize variable.
......
......@@ -3,7 +3,7 @@
AC_PREREQ(2.54)
AC_INIT(AUTHORS)
AM_INIT_AUTOMAKE(planner, 0.12.90)
AM_INIT_AUTOMAKE(planner, 0.12.91)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
......
......@@ -121,7 +121,6 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">work_spinbutton</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
......@@ -150,7 +149,6 @@
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">work_spinbutton</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
......@@ -224,48 +222,6 @@
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="work_spinbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="climb_rate">1</property>
<property name="digits">1</property>
<property name="numeric">True</property>
<property name="update_policy">GTK_UPDATE_IF_VALID</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
<property name="adjustment">0 0 10000 1 10 10</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="duration_spinbutton">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="climb_rate">1</property>
<property name="digits">1</property>
<property name="numeric">True</property>
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
<property name="adjustment">0 0 10000 1 10 10</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkSpinButton" id="complete_spinbutton">
<property name="visible">True</property>
......@@ -526,7 +482,7 @@
<child>
<widget class="GtkLabel" id="label115">
<property name="visible">True</property>
<property name="label" translatable="yes">days</property>
<property name="label" translatable="yes"> </property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
......@@ -554,7 +510,7 @@
<child>
<widget class="GtkLabel" id="label116">
<property name="visible">True</property>
<property name="label" translatable="yes">days</property>
<property name="label" translatable="yes"> </property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
......@@ -578,6 +534,48 @@
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="work_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="duration_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
......
......@@ -131,6 +131,141 @@ mrproject
@Returns:
<!-- ##### FUNCTION mrp_param_spec_time ##### -->
<para>
</para>
@name:
@nick:
@blurb:
@flags:
@Returns:
<!-- ##### FUNCTION mrp_time_align_day ##### -->
<para>
</para>
@t:
@Returns:
<!-- ##### FUNCTION mrp_time_compose ##### -->
<para>
</para>
@year:
@month:
@day:
@hour:
@minute:
@second:
@Returns:
<!-- ##### FUNCTION mrp_time_day_name ##### -->
<para>
</para>
@t:
@Returns:
<!-- ##### FUNCTION mrp_time_day_of_week ##### -->
<para>
</para>
@t:
@Returns:
<!-- ##### FUNCTION mrp_time_debug_print ##### -->
<para>
</para>
@t:
<!-- ##### FUNCTION mrp_time_decompose ##### -->
<para>
</para>
@t:
@year:
@month:
@day:
@hour:
@minute:
@second:
@Returns:
<!-- ##### FUNCTION mrp_time_format ##### -->
<para>
</para>
@format:
@t:
@Returns:
<!-- ##### FUNCTION mrp_time_from_msdate_string ##### -->
<para>
</para>
@str:
@Returns:
<!-- ##### FUNCTION mrp_time_from_string ##### -->
<para>
</para>
@str:
@err:
@Returns:
<!-- ##### FUNCTION mrp_time_from_tm ##### -->
<para>
</para>
@tm:
@Returns:
<!-- ##### FUNCTION mrp_time_month_name ##### -->
<para>
</para>
@t:
@Returns:
<!-- ##### FUNCTION mrp_time_month_name_initial ##### -->
<para>
</para>
@t:
@Returns:
<!-- ##### FUNCTION mrp_time_to_string ##### -->
<para>
</para>
@t:
@Returns:
<!-- ##### FUNCTION mrp_time_week_number ##### -->
<para>
</para>
@t:
@Returns:
<!-- ##### MACRO textdomain ##### -->
<para>
......
......@@ -14,6 +14,9 @@ the main project application object.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT MrpApplicationPriv ##### -->
<para>
A private struct for internal use only. The definition of this
......
......@@ -14,6 +14,9 @@ MrpAssignment
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT MrpAssignmentPriv ##### -->
<para>
A private struct for internal use only. The definition of this
......
......@@ -22,6 +22,9 @@ can be overridden to use another day type as well.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT MrpCalendarPriv ##### -->
<para>
A private struct for internal use only. The definition of this
......
......@@ -15,6 +15,9 @@ day. Other examples might be custom types like half day, or a holiday.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT MrpDay ##### -->
<para>
Object representing a day in the project.
......
......@@ -14,6 +14,9 @@ MrpError
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### MACRO MRP_ERROR ##### -->
<para>
Error domain for libmrproject.
......
......@@ -14,6 +14,9 @@ MrpGroup
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT MrpGroupPriv ##### -->
<para>
A private struct for internal use only. The definition of this
......
......@@ -14,6 +14,9 @@ MrpObject
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT MrpObjectPriv ##### -->
<para>
A private struct for internal use only. The definition of this
......
......@@ -14,6 +14,9 @@ MrpProject
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT MrpProjectPriv ##### -->
<para>
A private struct for internal use only. The definition of this
......
......@@ -16,6 +16,9 @@ GUI application, or plugins that add functionality.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### TYPEDEF MrpProperty ##### -->
<para>
Object representing a custom property in the project.
......
......@@ -18,6 +18,9 @@ finished, plus a lag time.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT MrpRelationPriv ##### -->
<para>
A private struct for internal use only. The definition of this
......
......@@ -14,6 +14,9 @@ represents a resource in the project.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT MrpResourcePriv ##### -->
<para>
A private struct for internal use only. The definition of this
......
......@@ -14,6 +14,9 @@ represents a task in the project.
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### STRUCT MrpTaskPriv ##### -->
<para>
A private struct for internal use only. The definition of this
......
......@@ -14,6 +14,9 @@ mrptime
</para>
<!-- ##### SECTION Stability_Level ##### -->
<!-- ##### TYPEDEF mrptime ##### -->
<para>
Corresponds to the standard C <type>time_t</type> type.
......@@ -49,153 +52,3 @@ Represents the maximium value for #mrptime.
@Returns:
<!-- ##### FUNCTION mrp_time_from_tm ##### -->
<para>
</para>
@tm:
@Returns:
<!-- ##### FUNCTION mrp_time_compose ##### -->
<para>
</para>
@year:
@month:
@day:
@hour:
@minute:
@second:
@Returns:
<!-- ##### FUNCTION mrp_time_decompose ##### -->
<para>
</para>
@t:
@year:
@month:
@day:
@hour:
@minute:
@second:
@Returns:
<!-- ##### FUNCTION mrp_time_from_string ##### -->
<para>
</para>
@str:
@err:
@Returns:
<!-- ##### FUNCTION mrp_time_to_string ##### -->
<para>
</para>
@t:
@Returns:
<!-- ##### FUNCTION mrp_time_from_msdate_string ##### -->
<para>
</para>
@str:
@Returns:
<!-- ##### FUNCTION mrp_time_align_day ##### -->
<para>
</para>
@t:
@Returns:
<!-- ##### FUNCTION mrp_time_day_of_week ##### -->
<para>
</para>
@t:
@Returns:
<!-- ##### FUNCTION mrp_time_week_number ##### -->
<para>
</para>
@t:
@Returns:
<!-- ##### FUNCTION mrp_time_day_name ##### -->
<para>
</para>
@t:
@Returns:
<!-- ##### FUNCTION mrp_time_month_name ##### -->
<para>
</para>
@t:
@Returns:
<!-- ##### FUNCTION mrp_time_month_name_initial ##### -->
<para>
</para>
@t:
@Returns:
<!-- ##### FUNCTION mrp_time_format ##### -->
<para>
</para>
@format:
@t:
@Returns:
<!-- ##### FUNCTION mrp_time_debug_print ##### -->
<para>
</para>
@t:
<!-- ##### FUNCTION mrp_param_spec_time ##### -->
<para>
</para>
@name:
@nick:
@blurb:
@flags:
@Returns:
......@@ -14,3 +14,6 @@ planner
</para>
<!-- ##### SECTION Stability_Level ##### -->
......@@ -129,14 +129,16 @@ format_strip_trailing_zeroes (gchar *str)
}
gchar *
planner_format_duration (gint duration,
gint day_length)
planner_format_duration_with_day_length (gint duration,
gint day_length)
{
gint days;
gint hours;
gint days;
gint hours;
days = duration / (60*60*day_length);
duration -= days * 60*60*day_length;
day_length = day_length / (60*60);
days = duration / day_length;
duration -= days * day_length;
hours = duration / (60*60);
if (days > 0 && hours > 0) {
......@@ -152,6 +154,23 @@ planner_format_duration (gint duration,
}
}
gchar *
planner_format_duration (MrpProject *project,
gint duration)
{
MrpCalendar *calendar;
gint day_length;
calendar = mrp_project_get_calendar (project);
day_length = mrp_calendar_day_get_total_work (calendar, mrp_day_get_work ()) * 60*60;
if (day_length == 0) {
day_length = 8*60*60;
}
return planner_format_duration_with_day_length (duration, day_length);
}
#if 0
gchar *
planner_format_duration (gint duration,
......@@ -364,3 +383,182 @@ planner_parse_float (const gchar *str)
return int_part + dec_part / pow (10, dec_factor);
}
typedef enum {
UNIT_NONE,
UNIT_MONTH,
UNIT_WEEK,
UNIT_DAY,
UNIT_HOUR,
UNIT_MINUTE
} Unit;
typedef struct {
gchar *name;
Unit unit;
} Units;
/* The comments here are for i18n, they get extracted to the po files. */
static Units units[] = {
{ N_("mon"), UNIT_MONTH }, /* month unit variant accepted in input */
{ N_("month"), UNIT_MONTH }, /* month unit variant accepted in input */
{ N_("months"), UNIT_MONTH }, /* month unit variant accepted in input */
{ N_("w"), UNIT_WEEK }, /* week unit variant accepted in input */
{ N_("week"), UNIT_WEEK }, /* week unit variant accepted in input */
{ N_("weeks"), UNIT_WEEK }, /* week unit variant accepted in input */
{ N_("d"), UNIT_DAY }, /* day unit variant accepted in input */
{ N_("day"), UNIT_DAY }, /* day unit variant accepted in input */
{ N_("days"), UNIT_DAY }, /* day unit variant accepted in input */
{ N_("h"), UNIT_HOUR }, /* hour unit variant accepted in input */
{ N_("hour"), UNIT_HOUR }, /* hour unit variant accepted in input */
{ N_("hours"), UNIT_HOUR }, /* hour unit variant accepted in input */
{ N_("min"), UNIT_MINUTE }, /* minute unit variant accepted in input */
{ N_("minute"), UNIT_MINUTE }, /* minute unit variant accepted in input */
{ N_("minutes"), UNIT_MINUTE } /* minute unit variant accepted in input */
};
static gint num_units = G_N_ELEMENTS (units);
static Unit
format_get_unit_from_string (const gchar *str)
{
static Units *translated_units;
static gboolean inited = FALSE;
Unit unit = UNIT_NONE;
gint i;
gchar *tmp;
if (!inited) {
translated_units = g_new0 (Units, num_units);
for (i = 0; i < num_units; i++) {
tmp = g_utf8_casefold (_(units[i].name), -1);
translated_units[i].name = tmp;
translated_units[i].unit = units[i].unit;
}
inited = TRUE;
}
for (i = 0; i < num_units; i++) {
if (!strncmp (str, translated_units[i].name,
strlen (translated_units[i].name))) {
unit = translated_units[i].unit;
}
}
if (unit != UNIT_NONE) {
return unit;
}
/* Try untranslated names as a fallback. */
for (i = 0; i < num_units; i++) {
if (!strncmp (str, units[i].name, strlen (units[i].name))) {
unit = units[i].unit;
}
}
return unit;
}
static gint
format_multiply_with_unit (gdouble value,
Unit unit,
gint seconds_per_month,
gint seconds_per_week,
gint seconds_per_day)
{
switch (unit) {
case UNIT_MONTH: