Commit 7a4c2ca8 authored by Chema Celorio's avatar Chema Celorio Committed by Jose Maria Celorio
Browse files

impl.

2001-07-21  Chema Celorio  <chema@celorio.com>

	* src/glade-project.c (glade_project_save): impl.

	* src/glade-project-window.c (gpw_save_cb): add contents
	(glade_project_window_get_project): impl.

	* src/glade-project-ui.c (glade_project_ui_save_get_name): new file that
	holds the ui that interacts with the user.
parent 5a43d02e
2001-07-21 Chema Celorio <chema@celorio.com>
* src/glade-project.c (glade_project_save): impl.
* src/glade-project-window.c (gpw_save_cb): add contents
(glade_project_window_get_project): impl.
* src/glade-project-ui.c (glade_project_ui_save_get_name): new file that
holds the ui that interacts with the user.
2001-07-16 Chema Celorio <chema@celorio.com>
* src/glade-widget.c (glade_widget_connect_edit_signals_with_class): impl.
......
......@@ -27,6 +27,7 @@ glade2_SOURCES = \
glade-placeholder.c \
glade-project-view.c \
glade-project-window.c \
glade-project-ui.c \
glade-widget-class.c \
glade-xml-utils.c \
glade-palette.c \
......@@ -52,6 +53,7 @@ noinst_HEADERS = \
glade-palette.h \
glade-cursor.h \
glade-project-window.h \
glade-project-ui.h \
glade-types.h \
glade-widget.h \
glade-widget-class.h \
......
......@@ -69,7 +69,10 @@ gpw_new_cb (void)
static void
gpw_save_cb (void)
{
g_print ("Implement me !\n");
GladeProject *project;
project = glade_project_window_get_project ();
glade_project_save (project);
}
static void
......@@ -573,3 +576,13 @@ glade_project_window_query_properties (GladeWidgetClass *class,
}
GladeProject *
glade_project_window_get_project (void)
{
GladeProjectWindow *gpw;
gpw = glade_project_window_get ();
g_return_val_if_fail (GLADE_IS_PROJECT_WINDOW (gpw), NULL);
return gpw->project;
}
......@@ -45,6 +45,7 @@ struct _GladeProjectWindow
GladeProjectWindow * glade_project_window_new (GladeCatalog *catalog);
GladeProjectWindow * glade_project_window_get ();
GladeProject * glade_project_window_get_project ();
void glade_project_window_set_add_class (GladeProjectWindow *gpw, GladeWidgetClass *class);
void glade_project_window_set_project (GladeProjectWindow *project_window,
......
......@@ -25,6 +25,7 @@
#include <string.h>
#include "glade.h"
#include "glade-project.h"
#include "glade-project-ui.h"
#include "glade-project-window.h"
#include "glade-widget.h"
......@@ -226,6 +227,19 @@ glade_project_get_widget_by_name (GladeProject *project, const gchar *name)
return NULL;
}
void
glade_project_selection_changed (GladeProject *project)
{
......@@ -318,3 +332,48 @@ glade_project_selection_set (GladeWidget *widget,
glade_project_selection_add (widget, emit_signal);
}
/**
* glade_project_save_to_file:
* @project:
* @file_name:
*
* Save a proejct
*
* Return Value: TRUE on success, FALSE otherwise
**/
gboolean
glade_project_save_to_file (GladeProject *project,
const gchar *file_name)
{
g_print ("Save %s to %s\n", project->name, file_name);
return TRUE;
}
/**
* glade_project_save:
* @project:
*
* Save the project, query the user for a proeject name if necessary
*
* Return Value: TRUE if the project was saved, FALSE if the user cancelled
* the operation or an error was encountered while saving
**/
gboolean
glade_project_save (GladeProject *project)
{
g_return_val_if_fail (GLADE_IS_PROJECT (project), FALSE);
if (project->path == NULL)
project->path = glade_project_ui_save_get_name (project);
if (project->path == NULL)
return FALSE;
glade_project_save_to_file (project, project->path);
return TRUE;
}
......@@ -17,10 +17,7 @@ struct _GladeProject
GtkObject object; /* We emit have signals so we are a GtkObject */
gchar *name; /* The name of the project like network-conf */
gchar *xml_filename; /* The name of the xml file on this (w/o the path)*/
gchar *directory; /* The path this project resides in. The directory
* plus the xml_filename make the full path.
*/
gchar *path; /* The full path of the xml file for this project*/
gboolean changed; /* A flag that is set when a project has changes
* if this flag is not set we don't have to query
......@@ -31,10 +28,7 @@ struct _GladeProject
GList *widgets; /* A list of GladeWidgets that make up this project.
* The widgets are stored in no particular order.
*/
#if 0
/* Not yet used */
GList *views;
#endif
GList *selection; /* We need to keep the selection in the project
* because we have multiple projects and when the
* user switchs between them, he will probably
......@@ -57,9 +51,15 @@ struct _GladeProjectClass
guint glade_project_get_type (void);
GladeProject * glade_project_get_active (void);
GladeProject * glade_project_new (void);
/* Project operations */
gboolean glade_project_save (GladeProject *project);
/* Widget related stuff */
void glade_project_add_widget (GladeProject *project,
GladeWidget *glade_widget);
......@@ -72,7 +72,6 @@ void glade_project_widget_name_changed (GladeProject *project,
void glade_project_selection_set (GladeWidget *widget, gboolean emit_signal);
void glade_project_selection_add (GladeWidget *widget, gboolean emit_signal);
void glade_project_selection_remove (GladeWidget *widget, gboolean emit_signal);
void glade_project_selection_clear (GladeProject *project, gboolean emit_signal);
G_END_DECLS
......
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