add the parent arg.

2002-12-18  Chris Toshok  <toshok@ximian.com>

	* gal-view.[ch] (gal_view_edit): add the parent arg.

	* gal-view-new-dialog.c (gal_view_new_dialog_init): set the dialog
	modal.

	* gal-view-etable.c (gal_view_etable_edit): take the parent arg
	and pass it to e_table_config_new.

	* gal-define-views-dialog.c (gdvd_button_new_dialog_callback):
	pass the dialog as the parent to gal_view_edit.
	(gdvd_button_modify_callback): same.
	(gdvd_button_new_callback): set view_new_dialog transient for
	dialog.

svn path=/trunk/; revision=19164
This commit is contained in:
Chris Toshok
2002-12-19 02:23:44 +00:00
committed by Chris Toshok
parent 7bd2b9cf14
commit be8b72f963
5 changed files with 18 additions and 10 deletions

View File

@ -115,9 +115,10 @@ gdvd_button_new_dialog_callback(GtkWidget *widget, int id, GalDefineViewsDialog
gchar *dup_of_name = g_strdup(name);
g_strchomp(dup_of_name);
if (*dup_of_name != '\0') {
GtkWidget *editor;
view = gal_view_factory_new_view(factory, dup_of_name);
gal_define_views_model_append(GAL_DEFINE_VIEWS_MODEL(dialog->model), view);
gal_view_edit(view);
gal_view_edit(view, GTK_WINDOW (dialog));
g_object_unref(view);
}
g_free(dup_of_name);
@ -131,6 +132,7 @@ static void
gdvd_button_new_callback(GtkWidget *widget, GalDefineViewsDialog *dialog)
{
GtkWidget *view_new_dialog = gal_view_new_dialog_new(dialog->collection);
gtk_window_set_transient_for (GTK_WINDOW (view_new_dialog), GTK_WINDOW (dialog));
g_signal_connect(view_new_dialog, "response",
G_CALLBACK(gdvd_button_new_dialog_callback), dialog);
gtk_widget_show(view_new_dialog);
@ -151,7 +153,7 @@ gdvd_button_modify_callback(GtkWidget *widget, GalDefineViewsDialog *dialog)
GalView *view;
view = gal_define_views_model_get_view(GAL_DEFINE_VIEWS_MODEL(dialog->model),
row);
gal_view_edit(view);
gal_view_edit(view, GTK_WINDOW (dialog));
}
}

View File

@ -71,14 +71,15 @@ config_changed (ETableConfig *config, GalViewEtable *view)
}
static void
gal_view_etable_edit (GalView *view)
gal_view_etable_edit (GalView *view, GtkWindow *parent)
{
GalViewEtable *etable_view = GAL_VIEW_ETABLE(view);
ETableConfig *config;
config = e_table_config_new(etable_view->title,
etable_view->spec,
etable_view->state);
etable_view->state,
parent);
g_signal_connect(config, "changed",
G_CALLBACK(config_changed), view);

View File

@ -104,6 +104,7 @@ gal_view_new_dialog_init (GalViewNewDialog *dialog)
NULL);
gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, TRUE, FALSE);
gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
dialog->collection = NULL;
dialog->selected_factory = NULL;

View File

@ -44,15 +44,18 @@ static guint gal_view_signals [LAST_SIGNAL] = { 0, };
/**
* gal_view_edit
* @view: The view to edit
* @parent: the parent window.
*/
void
gal_view_edit (GalView *view)
gal_view_edit (GalView *view,
GtkWindow *parent)
{
g_return_if_fail (view != NULL);
g_return_if_fail (GAL_IS_VIEW (view));
g_return_if_fail (GTK_IS_WINDOW (parent));
if (GAL_VIEW_GET_CLASS (view)->edit)
GAL_VIEW_GET_CLASS (view)->edit (view);
GAL_VIEW_GET_CLASS (view)->edit (view, parent);
}
/**

View File

@ -24,7 +24,7 @@
#ifndef _GAL_VIEW_H_
#define _GAL_VIEW_H_
#include <gtk/gtkobject.h>
#include <gtk/gtkwindow.h>
#include <libxml/tree.h>
#ifdef __cplusplus
@ -48,7 +48,7 @@ typedef struct {
/*
* Virtual methods
*/
void (*edit) (GalView *view);
void (*edit) (GalView *view, GtkWindow *parent_window);
void (*load) (GalView *view,
const char *filename);
void (*save) (GalView *view,
@ -66,8 +66,9 @@ typedef struct {
/* Standard functions */
GType gal_view_get_type (void);
/* Open an editor dialog for this view. */
void gal_view_edit (GalView *view);
/* Open an editor dialog for this view, modal/transient for the GtkWindow arg. */
void gal_view_edit (GalView *view,
GtkWindow *parent);
/* xml load and save functions */
void gal_view_load (GalView *view,