Commit d276f5e4 authored by Richard Hult's avatar Richard Hult Committed by Richard Hult

Try again, broken pipe.

2003-12-11  Richard Hult  <richard@imendio.com>

	* configure.in: Add gnome-vfs.
	* data/glade/html-output.glade:
	* data/ui/main-window.ui:
	* src/planner-html-plugin.c:
	* libplanner/mrp-error.h:
	* libplanner/mrp-xsl.c: Start to implement the "save to location
	feature". Based on patch from Bernardo Silveira.

	* src/planner-cmd-manager.[ch]:
	* src/planner-window.c:
	* src/planner-task-tree.c: Start implementing undo/redo.

	* src/: s/mg/planner/
parent 925f2120
......@@ -88,6 +88,8 @@
<separator/>
<toolitem name="FilePrint" verb="" _label="Print"/>
<separator/>
<toolitem name="EditUndo" verb="" />
<toolitem name="EditRedo" verb="" />
</dockitem>
<status>
......
......@@ -34,6 +34,7 @@ typedef enum {
MRP_ERROR_SAVE_FILE_EXIST,
MRP_ERROR_SAVE_FILE_CHANGED,
MRP_ERROR_EXPORT_UNSUPPORTED,
MRP_ERROR_EXPORT_FAILED,
MRP_ERROR_NO_FILE_MODULE,
MRP_ERROR_SAVE_WRITE_FAILED,
......
......@@ -23,6 +23,7 @@
#include <config.h>
#include <glib.h>
#include <gmodule.h>
#include <libgnomevfs/gnome-vfs.h>
#include <libxslt/xslt.h>
#include <libxslt/transform.h>
#include <libxslt/xsltutils.h>
......@@ -50,6 +51,11 @@ html_write (MrpFileWriter *writer,
xsltStylesheet *stylesheet;
xmlDoc *doc;
xmlDoc *final_doc;
GnomeVFSHandle *handle;
xmlChar *buffer;
gint len;
GnomeVFSResult result;
gboolean ret;
mrp_project_save_to_xml (project, &xml_project, NULL);
......@@ -65,13 +71,37 @@ html_write (MrpFileWriter *writer,
final_doc = xsltApplyStylesheet (stylesheet, doc, NULL);
xmlFree (doc);
xsltSaveResultToFilename (uri, final_doc, stylesheet, FALSE);
ret = TRUE;
if (xsltSaveResultToString (&buffer, &len, final_doc, stylesheet) != -1) {
result = gnome_vfs_create (&handle, uri, GNOME_VFS_OPEN_WRITE,
FALSE, 644);
if (result == GNOME_VFS_OK) {
gnome_vfs_write (handle, buffer, (GnomeVFSFileSize) len, NULL);
gnome_vfs_close (handle);
} else {
g_set_error (error,
MRP_ERROR,
MRP_ERROR_EXPORT_FAILED,
gnome_vfs_result_to_string (result));
ret = FALSE;
}
xmlFree (buffer);
} else {
g_set_error (error,
MRP_ERROR,
MRP_ERROR_EXPORT_FAILED,
_("HTML export failed"));
ret = FALSE;
}
xsltFreeStylesheet (stylesheet);
xmlFree (final_doc);
return TRUE;
return ret;
}
G_MODULE_EXPORT void
......
......@@ -38,6 +38,8 @@ planner_SOURCES = \
planner-cell-renderer-list.h \
planner-cell-renderer-popup.c \
planner-cell-renderer-popup.h \
planner-cmd-manager.c \
planner-cmd-manager.h \
planner-day-type-dialog.c \
planner-day-type-dialog.h \
planner-default-week-dialog.c \
......@@ -51,8 +53,6 @@ planner_SOURCES = \
planner-list-model.c \
planner-list-model.h \
planner-main.c \
planner-main-window.c \
planner-main-window.h \
planner-phase-dialog.c \
planner-phase-dialog.h \
planner-plugin.c \
......@@ -89,6 +89,8 @@ planner_SOURCES = \
planner-view.h \
planner-view-loader.c \
planner-view-loader.h \
planner-window.c \
planner-window.h \
planner-working-time-dialog.c \
planner-working-time-dialog.h
......
......@@ -25,14 +25,14 @@
#include <gtk/gtkmain.h>
#include <gtk/gtkstock.h>
#include <libgnome/gnome-i18n.h>
#include "planner-main-window.h"
#include "planner-window.h"
#include "planner-application.h"
#define d(x)
struct _MgApplicationPriv {
struct _PlannerApplicationPriv {
GList *windows;
/* recent file stuff */
......@@ -40,11 +40,11 @@ struct _MgApplicationPriv {
};
static void application_class_init (MgApplicationClass *klass);
static void application_init (MgApplication *page);
static void application_class_init (PlannerApplicationClass *klass);
static void application_init (PlannerApplication *page);
static void application_finalize (GObject *object);
static void application_window_closed_cb (MgMainWindow *window,
MgApplication *application);
static void application_window_closed_cb (PlannerWindow *window,
PlannerApplication *application);
static MrpApplicationClass *parent_class = NULL;
......@@ -131,26 +131,26 @@ planner_application_get_type (void)
if (!type) {
static const GTypeInfo info = {
sizeof (MgApplicationClass),
sizeof (PlannerApplicationClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) application_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (MgApplication),
sizeof (PlannerApplication),
0, /* n_preallocs */
(GInstanceInitFunc) application_init
};
type = g_type_register_static (MRP_TYPE_APPLICATION,
"MgApplication", &info, 0);
"PlannerApplication", &info, 0);
}
return type;
}
static void
application_class_init (MgApplicationClass *klass)
application_class_init (PlannerApplicationClass *klass)
{
GObjectClass *o_class;
......@@ -166,11 +166,11 @@ application_class_init (MgApplicationClass *klass)
}
static void
application_init (MgApplication *app)
application_init (PlannerApplication *app)
{
MgApplicationPriv *priv;
PlannerApplicationPriv *priv;
priv = g_new0 (MgApplicationPriv, 1);
priv = g_new0 (PlannerApplicationPriv, 1);
priv->windows = NULL;
......@@ -186,7 +186,7 @@ application_init (MgApplication *app)
static void
application_finalize (GObject *object)
{
MgApplication *app = MG_APPLICATION (object);
PlannerApplication *app = PLANNER_APPLICATION (object);
g_object_unref (app->priv->recent_model);
......@@ -198,13 +198,13 @@ application_finalize (GObject *object)
}
static void
application_window_closed_cb (MgMainWindow *window,
MgApplication *application)
application_window_closed_cb (PlannerWindow *window,
PlannerApplication *application)
{
MgApplicationPriv *priv;
PlannerApplicationPriv *priv;
g_return_if_fail (MG_IS_MAIN_WINDOW (window));
g_return_if_fail (MG_IS_APPLICATION (application));
g_return_if_fail (PLANNER_IS_MAIN_WINDOW (window));
g_return_if_fail (PLANNER_IS_APPLICATION (application));
priv = application->priv;
......@@ -218,29 +218,29 @@ application_window_closed_cb (MgMainWindow *window,
}
}
MgApplication *
PlannerApplication *
planner_application_new (void)
{
MgApplication *app;
MgApplicationPriv *priv;
PlannerApplication *app;
PlannerApplicationPriv *priv;
app = MG_APPLICATION (g_object_new (MG_TYPE_APPLICATION, NULL));
app = PLANNER_APPLICATION (g_object_new (PLANNER_TYPE_APPLICATION, NULL));
priv = app->priv;
return app;
}
GtkWidget *
planner_application_new_window (MgApplication *app)
planner_application_new_window (PlannerApplication *app)
{
MgApplicationPriv *priv;
PlannerApplicationPriv *priv;
GtkWidget *window;
g_return_val_if_fail (MG_IS_APPLICATION (app), NULL);
g_return_val_if_fail (PLANNER_IS_APPLICATION (app), NULL);
priv = app->priv;
window = planner_main_window_new (app);
window = planner_window_new (app);
g_signal_connect (window,
"closed",
......@@ -253,39 +253,39 @@ planner_application_new_window (MgApplication *app)
}
void
planner_application_exit (MgApplication *app)
planner_application_exit (PlannerApplication *app)
{
MgApplicationPriv *priv;
PlannerApplicationPriv *priv;
GList *list_cpy;
GList *l;
g_return_if_fail (MG_IS_APPLICATION (app));
g_return_if_fail (PLANNER_IS_APPLICATION (app));
priv = app->priv;
list_cpy = g_list_copy (priv->windows);
for (l = list_cpy; l; l = l->next) {
planner_main_window_close (MG_MAIN_WINDOW (l->data));
planner_window_close (PLANNER_WINDOW (l->data));
}
g_list_free (list_cpy);
}
EggRecentModel *
planner_application_get_recent_model (MgApplication *app)
planner_application_get_recent_model (PlannerApplication *app)
{
g_return_val_if_fail (MG_IS_APPLICATION (app), NULL);
g_return_val_if_fail (PLANNER_IS_APPLICATION (app), NULL);
return app->priv->recent_model;
}
GConfClient *
planner_application_get_gconf_client (MgApplication *app)
planner_application_get_gconf_client (PlannerApplication *app)
{
static GConfClient *client;
g_return_val_if_fail (MG_IS_APPLICATION (app), NULL);
g_return_val_if_fail (PLANNER_IS_APPLICATION (app), NULL);
if (!client) {
client = gconf_client_get_default ();
......
......@@ -21,8 +21,8 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __MG_APPLICATION_H__
#define __MG_APPLICATION_H__
#ifndef __PLANNER_APPLICATION_H__
#define __PLANNER_APPLICATION_H__
#include <bonobo/bonobo-window.h>
#include <bonobo/bonobo-ui-component.h>
......@@ -32,40 +32,34 @@
#include <libegg/recent-files/egg-recent-model.h>
#define MG_TYPE_APPLICATION (planner_application_get_type ())
#define MG_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MG_TYPE_APPLICATION, MgApplication))
#define MG_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MG_TYPE_APPLICATION, MgApplicationClass))
#define MG_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MG_TYPE_APPLICATION))
#define MG_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MG_TYPE_APPLICATION))
#define MG_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MG_TYPE_APPLICATION, MgApplicationClass))
#define PLANNER_TYPE_APPLICATION (planner_application_get_type ())
#define PLANNER_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLANNER_TYPE_APPLICATION, PlannerApplication))
#define PLANNER_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLANNER_TYPE_APPLICATION, PlannerApplicationClass))
#define PLANNER_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLANNER_TYPE_APPLICATION))
#define PLANNER_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLANNER_TYPE_APPLICATION))
#define PLANNER_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLANNER_TYPE_APPLICATION, PlannerApplicationClass))
typedef struct _MgApplication MgApplication;
typedef struct _MgApplicationClass MgApplicationClass;
typedef struct _MgApplicationPriv MgApplicationPriv;
typedef struct _PlannerApplication PlannerApplication;
typedef struct _PlannerApplicationClass PlannerApplicationClass;
typedef struct _PlannerApplicationPriv PlannerApplicationPriv;
struct _MgApplication
struct _PlannerApplication
{
MrpApplication parent;
MgApplicationPriv *priv;
MrpApplication parent;
PlannerApplicationPriv *priv;
};
struct _MgApplicationClass
struct _PlannerApplicationClass
{
MrpApplicationClass parent_class;
};
GType planner_application_get_type (void) G_GNUC_CONST;
GType planner_application_get_type (void) G_GNUC_CONST;
PlannerApplication *planner_application_new (void);
GtkWidget * planner_application_new_window (PlannerApplication *app);
void planner_application_exit (PlannerApplication *app);
EggRecentModel * planner_application_get_recent_model (PlannerApplication *app);
GConfClient * planner_application_get_gconf_client (PlannerApplication *app);
MgApplication *planner_application_new (void);
GtkWidget *planner_application_new_window (MgApplication *app);
void planner_application_exit (MgApplication *app);
EggRecentModel *planner_application_get_recent_model (MgApplication *app);
GConfClient *planner_application_get_gconf_client (MgApplication *app);
#endif /* __MG_APPLICATION_H__ */
#endif /* __PLANNER_APPLICATION_H__ */
......@@ -27,15 +27,15 @@
#include <libplanner/mrp-resource.h>
#include "planner-assignment-model.h"
struct _MgAssignmentModelPriv {
struct _PlannerAssignmentModelPriv {
MrpProject *project;
MrpTask *task;
};
#define G_LIST(x) ((GList *) x)
static void mam_init (MgAssignmentModel *model);
static void mam_class_init (MgAssignmentModelClass *class);
static void mam_init (PlannerAssignmentModel *model);
static void mam_class_init (PlannerAssignmentModelClass *class);
static void mam_finalize (GObject *object);
static gint mam_get_n_columns (GtkTreeModel *treemodel);
......@@ -48,19 +48,19 @@ static void mam_get_value (GtkTreeModel *treemodel,
GValue *value);
static void mam_assignment_changed_cb (MrpTask *task,
MrpAssignment *assignment,
MgAssignmentModel *model);
PlannerAssignmentModel *model);
static void mam_resource_added_cb (MrpProject *project,
MrpResource *assignment,
MgAssignmentModel *model);
PlannerAssignmentModel *model);
static void mam_resource_removed_cb (MrpProject *project,
MrpResource *resource,
MgAssignmentModel *model);
PlannerAssignmentModel *model);
static void mam_resource_notify_cb (MrpResource *resource,
GParamSpec *pspec,
MgAssignmentModel *model);
PlannerAssignmentModel *model);
static MgListModelClass *parent_class = NULL;
static PlannerListModelClass *parent_class = NULL;
GType
......@@ -71,19 +71,19 @@ planner_assignment_model_get_type (void)
if (!type) {
static const GTypeInfo info =
{
sizeof (MgAssignmentModelClass),
sizeof (PlannerAssignmentModelClass),
NULL, /* base_init */
NULL, /* base_finalize */
(GClassInitFunc) mam_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (MgAssignmentModel),
sizeof (PlannerAssignmentModel),
0,
(GInstanceInitFunc) mam_init,
};
type = g_type_register_static (MG_TYPE_LIST_MODEL,
"MgAssignmentModel",
type = g_type_register_static (PLANNER_TYPE_LIST_MODEL,
"PlannerAssignmentModel",
&info, 0);
}
......@@ -91,14 +91,14 @@ planner_assignment_model_get_type (void)
}
static void
mam_class_init (MgAssignmentModelClass *klass)
mam_class_init (PlannerAssignmentModelClass *klass)
{
GObjectClass *object_class;
MgListModelClass *lm_class;
PlannerListModelClass *lm_class;
parent_class = g_type_class_peek_parent (klass);
object_class = G_OBJECT_CLASS (klass);
lm_class = MG_LIST_MODEL_CLASS (klass);
lm_class = PLANNER_LIST_MODEL_CLASS (klass);
object_class->finalize = mam_finalize;
......@@ -108,11 +108,11 @@ mam_class_init (MgAssignmentModelClass *klass)
}
static void
mam_init (MgAssignmentModel *model)
mam_init (PlannerAssignmentModel *model)
{
MgAssignmentModelPriv *priv;
PlannerAssignmentModelPriv *priv;
priv = g_new0 (MgAssignmentModelPriv, 1);
priv = g_new0 (PlannerAssignmentModelPriv, 1);
priv->project = NULL;
......@@ -122,7 +122,7 @@ mam_init (MgAssignmentModel *model)
static void
mam_finalize (GObject *object)
{
MgAssignmentModel *model = MG_ASSIGNMENT_MODEL (object);
PlannerAssignmentModel *model = PLANNER_ASSIGNMENT_MODEL (object);
if (model->priv) {
if (model->priv->project) {
......@@ -176,17 +176,17 @@ mam_get_value (GtkTreeModel *tree_model,
gint column,
GValue *value)
{
MgAssignmentModel *model;
PlannerAssignmentModel *model;
MrpAssignment *assignment;
MrpResource *resource;
gchar *str;
gint units;
gfloat rate;
g_return_if_fail (MG_IS_ASSIGNMENT_MODEL (tree_model));
g_return_if_fail (PLANNER_IS_ASSIGNMENT_MODEL (tree_model));
g_return_if_fail (iter != NULL);
model = MG_ASSIGNMENT_MODEL (tree_model);
model = PLANNER_ASSIGNMENT_MODEL (tree_model);
resource = MRP_RESOURCE (G_LIST(iter->user_data)->data);
switch (column) {
......@@ -251,27 +251,27 @@ mam_get_value (GtkTreeModel *tree_model,
static void
mam_assignment_changed_cb (MrpTask *task,
MrpAssignment *assignment,
MgAssignmentModel *model)
PlannerAssignmentModel *model)
{
MrpResource *resource;
g_return_if_fail (MG_IS_ASSIGNMENT_MODEL (model));
g_return_if_fail (PLANNER_IS_ASSIGNMENT_MODEL (model));
g_return_if_fail (MRP_IS_ASSIGNMENT (assignment));
resource = mrp_assignment_get_resource (assignment);
planner_list_model_update (MG_LIST_MODEL (model), MRP_OBJECT (resource));
planner_list_model_update (PLANNER_LIST_MODEL (model), MRP_OBJECT (resource));
}
static void
mam_resource_added_cb (MrpProject *project,
MrpResource *resource,
MgAssignmentModel *model)
PlannerAssignmentModel *model)
{
g_return_if_fail (MG_IS_ASSIGNMENT_MODEL (model));
g_return_if_fail (PLANNER_IS_ASSIGNMENT_MODEL (model));
g_return_if_fail (MRP_IS_RESOURCE (resource));
planner_list_model_append (MG_LIST_MODEL (model), MRP_OBJECT (resource));
planner_list_model_append (PLANNER_LIST_MODEL (model), MRP_OBJECT (resource));
g_signal_connect_object (resource,
"notify",
G_CALLBACK (mam_resource_notify_cb),
......@@ -281,36 +281,36 @@ mam_resource_added_cb (MrpProject *project,
static void
mam_resource_removed_cb (MrpProject *project,
MrpResource *resource,
MgAssignmentModel *model)
PlannerAssignmentModel *model)
{
g_return_if_fail (MG_IS_ASSIGNMENT_MODEL (model));
g_return_if_fail (PLANNER_IS_ASSIGNMENT_MODEL (model));
g_return_if_fail (MRP_IS_RESOURCE (resource));
planner_list_model_remove (MG_LIST_MODEL (model), MRP_OBJECT (resource));
planner_list_model_remove (PLANNER_LIST_MODEL (model), MRP_OBJECT (resource));
}
static void
mam_resource_notify_cb (MrpResource *resource,
GParamSpec *pspec,
MgAssignmentModel *model)
PlannerAssignmentModel *model)
{
g_return_if_fail (MG_IS_ASSIGNMENT_MODEL (model));
g_return_if_fail (PLANNER_IS_ASSIGNMENT_MODEL (model));
g_return_if_fail (MRP_IS_RESOURCE (resource));
planner_list_model_update (MG_LIST_MODEL (model), MRP_OBJECT (resource));
planner_list_model_update (PLANNER_LIST_MODEL (model), MRP_OBJECT (resource));
}
MgAssignmentModel *
PlannerAssignmentModel *
planner_assignment_model_new (MrpTask *task)
{
MgAssignmentModel *model;
MgAssignmentModelPriv *priv;
PlannerAssignmentModel *model;
PlannerAssignmentModelPriv *priv;
GList *node;
GList *resources;
model = g_object_new (MG_TYPE_ASSIGNMENT_MODEL, NULL);
model = g_object_new (PLANNER_TYPE_ASSIGNMENT_MODEL, NULL);
g_return_val_if_fail (MG_IS_ASSIGNMENT_MODEL (model), NULL);
g_return_val_if_fail (PLANNER_IS_ASSIGNMENT_MODEL (model), NULL);
priv = model->priv;
......@@ -318,7 +318,7 @@ planner_assignment_model_new (MrpTask *task)
g_object_get (priv->task, "project", &priv->project, NULL);
resources = mrp_project_get_resources (priv->project);
planner_list_model_set_data (MG_LIST_MODEL (model), resources);
planner_list_model_set_data (PLANNER_LIST_MODEL (model), resources);
for (node = resources; node; node = node->next) {
g_signal_connect_object (node->data,
......
......@@ -20,33 +20,33 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef __MG_ASSIGNMENT_MODEL_H__
#define __MG_ASSIGNMENT_MODEL_H__
#ifndef __PLANNER_ASSIGNMENT_MODEL_H__
#define __PLANNER_ASSIGNMENT_MODEL_H__
#include <libplanner/mrp-project.h>
#include "planner-list-model.h"
#define MG_TYPE_ASSIGNMENT_MODEL (planner_assignment_model_get_type ())
#define MG_ASSIGNMENT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MG_TYPE_ASSIGNMENT_MODEL, MgAssignmentModel))
#define MG_ASSIGNMENT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MG_TYPE_ASSIGNMENT_MODEL, MgAssignmentModelClass))
#define MG_IS_ASSIGNMENT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MG_TYPE_ASSIGNMENT_MODEL))
#define MG_IS_ASSIGNMENT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MG_TYPE_ASSIGNMENT_MODEL))
#define MG_ASSIGNMENT_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MG_TYPE_ASSIGNMENT_MODEL, MgAssignmentModelClass))
#define PLANNER_TYPE_ASSIGNMENT_MODEL (planner_assignment_model_get_type ())
#define PLANNER_ASSIGNMENT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PLANNER_TYPE_ASSIGNMENT_MODEL, PlannerAssignmentModel))
#define PLANNER_ASSIGNMENT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PLANNER_TYPE_ASSIGNMENT_MODEL, PlannerAssignmentModelClass))
#define PLANNER_IS_ASSIGNMENT_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PLANNER_TYPE_ASSIGNMENT_MODEL))
#define PLANNER_IS_ASSIGNMENT_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PLANNER_TYPE_ASSIGNMENT_MODEL))
#define PLANNER_ASSIGNMENT_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PLANNER_TYPE_ASSIGNMENT_MODEL, PlannerAssignmentModelClass))
typedef struct _MgAssignmentModel MgAssignmentModel;
typedef struct _MgAssignmentModelClass MgAssignmentModelClass;
typedef struct _MgAssignmentModelPriv MgAssignmentModelPriv;
typedef struct _PlannerAssignmentModel PlannerAssignmentModel;
typedef struct _PlannerAssignmentModelClass PlannerAssignmentModelClass;
typedef struct _PlannerAssignmentModelPriv PlannerAssignmentModelPriv;
struct _MgAssignmentModel
struct _PlannerAssignmentModel
{
MgListModel parent;
PlannerListModel parent;
MgAssignmentModelPriv *priv;
PlannerAssignmentModelPriv *priv;
};
struct _MgAssignmentModelClass
struct _PlannerAssignmentModelClass
{
MgListModelClass parent_class;
PlannerListModelClass parent_class;
};
enum {
......@@ -61,6 +61,6 @@ enum {
};
GType planner_assignment_model_get_type (void);
MgAssignmentModel *planner_assignment_model_new (MrpTask *task);
PlannerAssignmentModel *planner_assignment_model_new (MrpTask *task);
#endif /* __MG_ASSIGNMENT_MODEL_H__ */
#endif /* __PLANNER_ASSIGNMENT_MODEL_H__ */
......@@ -46,7 +46,7 @@ enum {
};
typedef struct {
MgMainWindow *main_window;
PlannerWindow *main_window;
MrpProject *project;
GtkWidget *dialog;
......@@ -104,9 +104,9 @@ static void cal_dialog_selection_changed_cb (GtkTreeSelection *select
static void cal_dialog_apply_clicked_cb (GtkWidget *button,
DialogData *data);
static void cal_dialog_update_calendar_widgets (DialogData *data);
static void cal_dialog_month_changed_cb (MgCalendar *calendar,
static void cal_dialog_month_changed_cb (PlannerCalendar *calendar,
DialogData *data);
static void cal_dialog_date_selected_cb (MgCalendar *calendar,
static void cal_dialog_date_selected_cb (PlannerCalendar *calendar,
DialogData *data);
static void cal_dialog_option_menu_changed_cb (GtkWidget *option_menu,
DialogData *data);
......@@ -288,7 +288,7 @@ cal_dialog_parent_destroy_cb (GtkWidget *window, GtkWidget *dialog)
}
GtkWidget *
planner_calendar_dialog_new (MgMainWindow *window)
planner_calendar_dialog_new (PlannerWindow *window)
{
DialogData *data;
GladeXML *glade;
......@@ -297,7 +297,7 @@ planner_calendar_dialog_new (MgMainWindow *window)
GtkTreeSelection *selection;
gint i;
g_return_val_if_fail (MG_IS_MAIN_WINDOW (window), NULL);
g_return_val_if_fail (PLANNER_IS_MAIN_WINDOW (window), NULL);
glade = glade_xml_new (GLADEDIR "/calendar-dialog.glade",
"calendar_dialog",
......@@ -311,7 +311,7 @@ planner_calendar_dialog_new (MgMainWindow *window)
data = g_new0 (DialogData, 1);
data->project = planner_main_window_get_project (window);
data->project = planner_window_get_project (window);
data->main_window = window;
data->dialog = dialog;
......@@ -325,11 +325,11 @@ planner_calendar_dialog_new (MgMainWindow *window)
data->calendar = planner_calendar_new ();
gtk_widget_show (data->calendar);
planner_calendar_display_options (MG_CALENDAR (data->calendar),
MG_CALENDAR_SHOW_HEADING |
MG_CALENDAR_SHOW_DAY_NAMES |
MG_CALENDAR_SHOW_WEEK_NUMBERS |
MG_CALENDAR_WEEK_START_MONDAY);
planner_calendar_display_options (PLANNER_CALENDAR (data->calendar),
PLANNER_CALENDAR_SHOW_HEADING |