Commit 9d99ee8e authored by Arturo Espinosa's avatar Arturo Espinosa

Use the new gnome_dialog_set_parent -mig

parent 03467aba
......@@ -16,7 +16,7 @@
* nice
*/
void
dialog_about (void)
dialog_about (Workbook *wb)
{
GtkWidget *about;
const gchar *authors[] = {
......@@ -37,6 +37,7 @@ dialog_about (void)
"http://www.gnome.org/gnumeric"),
NULL);
gtk_window_set_modal (GTK_WINDOW (about), TRUE);
gnome_dialog_set_parent (GNOME_DIALOG (about), GTK_WINDOW (wb->toplevel));
gnome_dialog_set_close (GNOME_DIALOG (about), TRUE);
gtk_widget_show (about);
}
......
......@@ -786,7 +786,7 @@ cell_properties_close (void)
* Main entry point for the Cell Format dialog box
*/
void
dialog_cell_format (Sheet *sheet)
dialog_cell_format (Workbook *wb, Sheet *sheet)
{
GtkWidget *prop_win;
CellList *cells;
......@@ -799,6 +799,8 @@ dialog_cell_format (Sheet *sheet)
cells = sheet_selection_to_list (sheet);
prop_win = gnome_property_box_new ();
gnome_dialog_set_parent (GNOME_DIALOG (prop_win), GTK_WINDOW (wb->toplevel));
if (cells)
first_cell = cells->data;
else
......
......@@ -26,7 +26,8 @@ dialog_define_names (Workbook *wb)
_("Add"),
_("Remove"),
NULL);
gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (wb->toplevel));
swin = gtk_scrolled_window_new (NULL, NULL);
clist = (GtkCList *) gtk_clist_new (1);
gtk_container_add (GTK_CONTAINER (swin), GTK_WIDGET (clist));
......
......@@ -12,7 +12,7 @@
#include "dialogs.h"
void
dialog_delete_cells (Sheet *sheet)
dialog_delete_cells (Workbook *wb, Sheet *sheet)
{
int state [4] = { 1, 0, 0, 0 };
SheetSelection *ss;
......
......@@ -12,7 +12,7 @@
#include "dialogs.h"
void
dialog_insert_cells (Sheet *sheet)
dialog_insert_cells (Workbook *wb, Sheet *sheet)
{
int state [4] = { 1, 0, 0, 0 };
SheetSelection *ss;
......
......@@ -46,7 +46,7 @@ enable_op_group (GtkWidget *widget, GtkWidget *group)
}
int
dialog_paste_special (void)
dialog_paste_special (Workbook *wb)
{
GtkWidget *dialog, *hbox;
GtkWidget *f1, *f1v, *f2, *f2v;
......@@ -57,6 +57,7 @@ dialog_paste_special (void)
GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL,
NULL);
gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (wb->toplevel));
f1 = gtk_frame_new (_("Paste type"));
f1v = gtk_vbox_new (TRUE, 0);
gtk_container_add (GTK_CONTAINER (f1), f1v);
......
......@@ -13,7 +13,7 @@
#include "dialogs.h"
void
dialog_zoom (Sheet *sheet)
dialog_zoom (Workbook *wb, Sheet *sheet)
{
char *custom;
int state [7];
......
......@@ -2,13 +2,13 @@
#define GNUMERIC_DIALOGS_H
void dialog_goto_cell (Workbook *wb);
void dialog_cell_format (Sheet *sheet);
int dialog_paste_special (void);
void dialog_insert_cells (Sheet *sheet);
void dialog_delete_cells (Sheet *sheet);
void dialog_zoom (Sheet *sheet);
char *dialog_query_load_file (void);
void dialog_about (void);
void dialog_cell_format (Workbook *wb, Sheet *sheet);
int dialog_paste_special (Workbook *wb);
void dialog_insert_cells (Workbook *wb, Sheet *sheet);
void dialog_delete_cells (Workbook *wb, Sheet *sheet);
void dialog_zoom (Workbook *wb, Sheet *sheet);
char *dialog_query_load_file (Workbook *wb);
void dialog_about (Workbook *wb);
void dialog_define_names (Workbook *wb);
#endif /* GNUMERIC_DIALOGS_H */
......@@ -16,7 +16,7 @@
* nice
*/
void
dialog_about (void)
dialog_about (Workbook *wb)
{
GtkWidget *about;
const gchar *authors[] = {
......@@ -37,6 +37,7 @@ dialog_about (void)
"http://www.gnome.org/gnumeric"),
NULL);
gtk_window_set_modal (GTK_WINDOW (about), TRUE);
gnome_dialog_set_parent (GNOME_DIALOG (about), GTK_WINDOW (wb->toplevel));
gnome_dialog_set_close (GNOME_DIALOG (about), TRUE);
gtk_widget_show (about);
}
......
......@@ -786,7 +786,7 @@ cell_properties_close (void)
* Main entry point for the Cell Format dialog box
*/
void
dialog_cell_format (Sheet *sheet)
dialog_cell_format (Workbook *wb, Sheet *sheet)
{
GtkWidget *prop_win;
CellList *cells;
......@@ -799,6 +799,8 @@ dialog_cell_format (Sheet *sheet)
cells = sheet_selection_to_list (sheet);
prop_win = gnome_property_box_new ();
gnome_dialog_set_parent (GNOME_DIALOG (prop_win), GTK_WINDOW (wb->toplevel));
if (cells)
first_cell = cells->data;
else
......
......@@ -26,7 +26,8 @@ dialog_define_names (Workbook *wb)
_("Add"),
_("Remove"),
NULL);
gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (wb->toplevel));
swin = gtk_scrolled_window_new (NULL, NULL);
clist = (GtkCList *) gtk_clist_new (1);
gtk_container_add (GTK_CONTAINER (swin), GTK_WIDGET (clist));
......
......@@ -12,7 +12,7 @@
#include "dialogs.h"
void
dialog_delete_cells (Sheet *sheet)
dialog_delete_cells (Workbook *wb, Sheet *sheet)
{
int state [4] = { 1, 0, 0, 0 };
SheetSelection *ss;
......
......@@ -12,7 +12,7 @@
#include "dialogs.h"
void
dialog_insert_cells (Sheet *sheet)
dialog_insert_cells (Workbook *wb, Sheet *sheet)
{
int state [4] = { 1, 0, 0, 0 };
SheetSelection *ss;
......
......@@ -46,7 +46,7 @@ enable_op_group (GtkWidget *widget, GtkWidget *group)
}
int
dialog_paste_special (void)
dialog_paste_special (Workbook *wb)
{
GtkWidget *dialog, *hbox;
GtkWidget *f1, *f1v, *f2, *f2v;
......@@ -57,6 +57,7 @@ dialog_paste_special (void)
GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL,
NULL);
gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (wb->toplevel));
f1 = gtk_frame_new (_("Paste type"));
f1v = gtk_vbox_new (TRUE, 0);
gtk_container_add (GTK_CONTAINER (f1), f1v);
......
......@@ -13,7 +13,7 @@
#include "dialogs.h"
void
dialog_zoom (Sheet *sheet)
dialog_zoom (Workbook *wb, Sheet *sheet)
{
char *custom;
int state [7];
......
......@@ -2,13 +2,13 @@
#define GNUMERIC_DIALOGS_H
void dialog_goto_cell (Workbook *wb);
void dialog_cell_format (Sheet *sheet);
int dialog_paste_special (void);
void dialog_insert_cells (Sheet *sheet);
void dialog_delete_cells (Sheet *sheet);
void dialog_zoom (Sheet *sheet);
char *dialog_query_load_file (void);
void dialog_about (void);
void dialog_cell_format (Workbook *wb, Sheet *sheet);
int dialog_paste_special (Workbook *wb);
void dialog_insert_cells (Workbook *wb, Sheet *sheet);
void dialog_delete_cells (Workbook *wb, Sheet *sheet);
void dialog_zoom (Workbook *wb, Sheet *sheet);
char *dialog_query_load_file (Workbook *wb);
void dialog_about (Workbook *wb);
void dialog_define_names (Workbook *wb);
#endif /* GNUMERIC_DIALOGS_H */
......@@ -34,7 +34,7 @@ workbook_save_as (Workbook *wb)
GTK_SIGNAL_FUNC (set_ok), &accepted);
gtk_signal_connect (GTK_OBJECT (fsel->cancel_button), "clicked",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
gtk_window_position (GTK_WINDOW (fsel), GTK_WIN_POS_MOUSE);
gtk_window_set_position (GTK_WINDOW (fsel), GTK_WIN_POS_MOUSE);
/* Run the dialog */
gtk_widget_show (GTK_WIDGET (fsel));
......@@ -67,7 +67,7 @@ workbook_save (Workbook *wb)
}
char *
dialog_query_load_file (void)
dialog_query_load_file (Workbook *wb)
{
GtkFileSelection *fsel;
gboolean accepted;
......@@ -75,12 +75,14 @@ dialog_query_load_file (void)
fsel = (GtkFileSelection *) gtk_file_selection_new (_("Load file"));
gtk_window_set_transient_for (GTK_WINDOW (fsel), GTK_WINDOW (wb->toplevel));
/* Connect the signals for Ok and Cancel */
gtk_signal_connect (GTK_OBJECT (fsel->ok_button), "clicked",
GTK_SIGNAL_FUNC (set_ok), &accepted);
gtk_signal_connect (GTK_OBJECT (fsel->cancel_button), "clicked",
GTK_SIGNAL_FUNC (gtk_main_quit), NULL);
gtk_window_position (GTK_WINDOW (fsel), GTK_WIN_POS_MOUSE);
gtk_window_set_position (GTK_WINDOW (fsel), GTK_WIN_POS_MOUSE);
/* Run the dialog */
gtk_widget_show (GTK_WIDGET (fsel));
......
......@@ -467,7 +467,7 @@ context_paste_special_cmd (GtkWidget *widget, ItemGrid *item_grid)
Sheet *sheet = item_grid->sheet;
int flags;
flags = dialog_paste_special ();
flags = dialog_paste_special (sheet->workbook);
sheet_selection_paste (sheet,
sheet->cursor_col,
sheet->cursor_row,
......@@ -479,14 +479,14 @@ context_paste_special_cmd (GtkWidget *widget, ItemGrid *item_grid)
static void
context_insert_cmd (GtkWidget *widget, ItemGrid *item_grid)
{
dialog_insert_cells (item_grid->sheet);
dialog_insert_cells (item_grid->sheet->workbook, item_grid->sheet);
context_destroy_menu (widget);
}
static void
context_delete_cmd (GtkWidget *widget, ItemGrid *item_grid)
{
dialog_delete_cells (item_grid->sheet);
dialog_delete_cells (item_grid->sheet->workbook, item_grid->sheet);
context_destroy_menu (widget);
}
......@@ -500,7 +500,7 @@ context_clear_cmd (GtkWidget *widget, ItemGrid *item_grid)
static void
context_cell_format_cmd (GtkWidget *widget, ItemGrid *item_grid)
{
dialog_cell_format (item_grid->sheet);
dialog_cell_format (item_grid->sheet->workbook, item_grid->sheet);
context_destroy_menu (widget);
}
......
......@@ -13,6 +13,7 @@
typedef struct
{
Workbook *workbook;
GtkWidget *dialog;
GtkWidget *hbox;
GtkWidget *vbbox;
......@@ -26,7 +27,7 @@ typedef struct
static void
add_to_clist (PluginData *pd, GtkWidget *clist)
{
const gchar *data[2];
gchar *data[2];
gint row;
data [0] = pd->title;
......@@ -55,7 +56,7 @@ close_cb (GtkWidget *button, PluginManager *pm)
static void
add_cb (GtkWidget *button, PluginManager *pm)
{
char *modfile = dialog_query_load_file ();
char *modfile = dialog_query_load_file (pm->workbook);
PluginData *pd;
if (!modfile)
......@@ -87,16 +88,17 @@ row_cb (GtkWidget * clist, gint row, gint col,
}
GtkWidget *
plugin_manager_new (void)
plugin_manager_new (Workbook *wb)
{
PluginManager *pm;
const gchar *n_titles[2] = { N_("Name"), N_("File") };
const gchar *titles[2] = { N_("Name"), N_("File") };
gchar *n_titles[2] = { N_("Name"), N_("File") };
gchar *titles[2] = { N_("Name"), N_("File") };
pm = g_new0 (PluginManager, 1);
if (!pm)
return NULL;
pm->workbook = wb;
pm->dialog = gtk_window_new (GTK_WINDOW_DIALOG);
pm->hbox = gtk_hbox_new (0, 0);
......
......@@ -22,6 +22,6 @@ extern GList *plugin_list;
void plugins_init (void);
PluginData *plugin_load (gchar *filename);
void plugin_unload (PluginData *pd);
GtkWidget *plugin_manager_new (void);
GtkWidget *plugin_manager_new (Workbook *wb);
#endif /* GNUMERIC_PLUGIN_H */
......@@ -61,13 +61,13 @@ new_cmd (void)
}
static void
open_cmd (void)
open_cmd (GtkWidget *widget, Workbook *wb)
{
char *fname = dialog_query_load_file ();
Workbook *wb;
char *fname = dialog_query_load_file (wb);
Workbook *new_wb;
if ((wb = workbook_read (fname)))
gtk_widget_show (wb->toplevel);
if ((new_wb = workbook_read (fname)))
gtk_widget_show (new_wb->toplevel);
}
static void
......@@ -85,7 +85,7 @@ save_as_cmd (GtkWidget *widget, Workbook *wb)
static void
plugins_cmd (GtkWidget *widget, Workbook *wb)
{
GtkWidget *pm = plugin_manager_new();
GtkWidget *pm = plugin_manager_new (wb);
gtk_widget_show(pm);
}
......@@ -443,7 +443,7 @@ paste_special_cmd (GtkWidget *widget, Workbook *wb)
int flags;
sheet = workbook_get_current_sheet (wb);
flags = dialog_paste_special ();
flags = dialog_paste_special (wb);
sheet_selection_paste (sheet, sheet->cursor_col, sheet->cursor_row,
flags, GDK_CURRENT_TIME);
......@@ -489,7 +489,7 @@ insert_cells_cmd (GtkWidget *widget, Workbook *wb)
Sheet *sheet;
sheet = workbook_get_current_sheet (wb);
dialog_insert_cells (sheet);
dialog_insert_cells (wb, sheet);
}
static void
......@@ -566,7 +566,7 @@ zoom_cmd (GtkWidget *widget, Workbook *wb)
Sheet *sheet;
sheet = workbook_get_current_sheet (wb);
dialog_zoom (sheet);
dialog_zoom (wb, sheet);
}
static void
......@@ -575,7 +575,7 @@ format_cells_cmd (GtkWidget *widget, Workbook *wb)
Sheet *sheet;
sheet = workbook_get_current_sheet (wb);
dialog_cell_format (sheet);
dialog_cell_format (wb, sheet);
}
static void
......@@ -646,7 +646,7 @@ workbook_edit_comment (GtkWidget *widget, Workbook *wb)
static void
about_cmd (GtkWidget *widget, Workbook *wb)
{
dialog_about ();
dialog_about (wb);
}
/* File menu */
......
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