Commit bc294c73 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Extra argument here is a GdkScreen pointer. Supply that to

2003-05-22  Morten Welinder  <terra@gnome.org>

	* src/workbook-control-gui.c (workbook_control_gui_new): Extra
	argument here is a GdkScreen pointer.  Supply that to
	workbook_control_gui_init.  All callers changed.

	* src/workbook-control-priv.h (WorkbookControlClass): Add extra
	parameter to control_new method.

	* src/workbook-control.c (wb_control_wrapper_new): Add "extra"
	argument here also and supply it to control_new.  All callers
	changed.

	* src/workbook-control-gui.c (workbook_control_gui_init): Make
	static.  Take extra GdkScreen parameter and set the new screen
	asap before we go creating pango contexts and gcs relating to the
	default screen.  All callers changed.
parent dbe6d8ec
2003-05-22 Morten Welinder <terra@gnome.org>
* src/workbook-control-gui.c (workbook_control_gui_new): Extra
argument here is a GdkScreen pointer. Supply that to
workbook_control_gui_init. All callers changed.
* src/workbook-control-priv.h (WorkbookControlClass): Add extra
parameter to control_new method.
* src/workbook-control.c (wb_control_wrapper_new): Add "extra"
argument here also and supply it to control_new. All callers
changed.
* src/workbook-control-gui.c (workbook_control_gui_init): Make
static. Take extra GdkScreen parameter and set the new screen
asap before we go creating pango contexts and gcs relating to the
default screen. All callers changed.
2003-05-22 Jody Goldberg <jody@gnome.org>
* src/expr.c (cellrange_relocate) : fix logic inversion introduced
......
2003-05-22 Morten Welinder <terra@gnome.org>
* src/workbook-control-gui.c (workbook_control_gui_new): Extra
argument here is a GdkScreen pointer. Supply that to
workbook_control_gui_init. All callers changed.
* src/workbook-control-priv.h (WorkbookControlClass): Add extra
parameter to control_new method.
* src/workbook-control.c (wb_control_wrapper_new): Add "extra"
argument here also and supply it to control_new. All callers
changed.
* src/workbook-control-gui.c (workbook_control_gui_init): Make
static. Take extra GdkScreen parameter and set the new screen
asap before we go creating pango contexts and gcs relating to the
default screen. All callers changed.
2003-05-22 Jody Goldberg <jody@gnome.org>
* src/expr.c (cellrange_relocate) : fix logic inversion introduced
......
2003-05-22 Morten Welinder <terra@gnome.org>
* src/workbook-control-gui.c (workbook_control_gui_new): Extra
argument here is a GdkScreen pointer. Supply that to
workbook_control_gui_init. All callers changed.
* src/workbook-control-priv.h (WorkbookControlClass): Add extra
parameter to control_new method.
* src/workbook-control.c (wb_control_wrapper_new): Add "extra"
argument here also and supply it to control_new. All callers
changed.
* src/workbook-control-gui.c (workbook_control_gui_init): Make
static. Take extra GdkScreen parameter and set the new screen
asap before we go creating pango contexts and gcs relating to the
default screen. All callers changed.
2003-05-22 Jody Goldberg <jody@gnome.org>
* src/expr.c (cellrange_relocate) : fix logic inversion introduced
......
......@@ -58,8 +58,6 @@ cb_view_ok_clicked (G_GNUC_UNUSED GtkWidget *button,
gboolean shared;
GdkScreen *screen = NULL;
GSList *buttons = gtk_radio_button_get_group (state->location_elsewhere);
WorkbookControl *new_wbc;
WorkbookControlGUI *new_wbcg;
shared = gnumeric_glade_group_value (state->gui, shared_group) == 0;
......@@ -78,6 +76,11 @@ cb_view_ok_clicked (G_GNUC_UNUSED GtkWidget *button,
if (!name)
return; /* Just ignore */
gnumeric_notice (state->wbcg, GTK_MESSAGE_ERROR,
_("Connecting to a different display has been disabled "
"due to bugs in GTK+."));
return;
display = gdk_display_open (name);
if (!display) {
char *error_str =
......@@ -97,14 +100,11 @@ cb_view_ok_clicked (G_GNUC_UNUSED GtkWidget *button,
gtk_widget_destroy (state->dialog);
new_wbc = wb_control_wrapper_new
(void) wb_control_wrapper_new
(wbc,
shared ? wb_control_view (wbc) : NULL,
wb_control_workbook (wbc));
new_wbcg = WORKBOOK_CONTROL_GUI (new_wbc);
if (screen)
gtk_window_set_screen (wbcg_toplevel (new_wbcg), screen);
wb_control_workbook (wbc),
screen);
}
static void
......
......@@ -114,7 +114,7 @@ gui_file_read (WorkbookControlGUI *wbcg, char const *file_name,
workbook_control_set_view (WORKBOOK_CONTROL (wbcg), wbv, NULL);
workbook_control_init_state (WORKBOOK_CONTROL (wbcg));
} else
(void) wb_control_wrapper_new (WORKBOOK_CONTROL (wbcg), wbv, NULL);
(void) wb_control_wrapper_new (WORKBOOK_CONTROL (wbcg), wbv, NULL, NULL);
return TRUE;
}
......
......@@ -196,7 +196,7 @@ main (int argc, char *argv [])
WorkbookControlGUI *wbcg;
wbcg = WORKBOOK_CONTROL_GUI
(workbook_control_gui_new (wbv, NULL));
(workbook_control_gui_new (wbv, NULL, NULL));
opened_workbook = TRUE;
icg_set_transient_for (IO_CONTEXT_GTK (ioc),
wbcg_toplevel (wbcg));
......@@ -216,7 +216,7 @@ main (int argc, char *argv [])
gint n_of_sheets = gnm_app_prefs->initial_sheet_number;
workbook_control_gui_new
(NULL, workbook_new_with_sheets (n_of_sheets));
(NULL, workbook_new_with_sheets (n_of_sheets), NULL);
/* cheesy attempt to keep the ui from freezing during load */
handle_paint_events ();
}
......
......@@ -198,7 +198,7 @@ dao_prepare_output (WorkbookControl *wbc, data_analysis_output_t *dao,
dao->rows = SHEET_MAX_ROWS;
dao->cols = SHEET_MAX_COLS;
workbook_sheet_attach (wb, dao->sheet, NULL);
dao->wbc = wb_control_wrapper_new (dao->wbc, NULL, wb);
dao->wbc = wb_control_wrapper_new (dao->wbc, NULL, wb, NULL);
}
if (dao->rows == 0 || (dao->rows == 1 && dao->cols == 1))
dao->rows = SHEET_MAX_ROWS - dao->start_row;
......
......@@ -26,7 +26,10 @@ static void
wbcc_progress_message_set (CommandContext *cc, gchar const *msg) {}
static WorkbookControl *
wbcc_control_new (WorkbookControl *wbc, WorkbookView *wbv, Workbook *wb)
wbcc_control_new (G_GNUC_UNUSED WorkbookControl *wbc,
WorkbookView *wbv,
Workbook *wb,
G_GNUC_UNUSED void *extra)
{
return workbook_control_component_new (wbv, wb);
}
......
......@@ -318,9 +318,13 @@ wbcg_autosave_set (WorkbookControlGUI *wbcg, int minutes, gboolean prompt)
/****************************************************************************/
static WorkbookControl *
wbcg_control_new (WorkbookControl *wbc, WorkbookView *wbv, Workbook *wb)
wbcg_control_new (G_GNUC_UNUSED WorkbookControl *wbc,
WorkbookView *wbv,
Workbook *wb,
void *extra)
{
return workbook_control_gui_new (wbv, wb);
return workbook_control_gui_new (wbv, wb,
extra ? GDK_SCREEN (extra) : NULL);
}
static void
......@@ -1693,8 +1697,10 @@ wbcg_close_control (WorkbookControlGUI *wbcg)
static void
cb_file_new (GtkWidget *widget, WorkbookControlGUI *wbcg)
{
(void) workbook_control_gui_new (NULL,
workbook_new_with_sheets (gnm_app_prefs->initial_sheet_number));
Workbook *wb = workbook_new_with_sheets
(gnm_app_prefs->initial_sheet_number);
(void) workbook_control_gui_new (NULL, wb, NULL);
}
static void
......@@ -5017,9 +5023,11 @@ custom_uic_destroy (gpointer data)
}
#endif
void
static void
workbook_control_gui_init (WorkbookControlGUI *wbcg,
WorkbookView *optional_view, Workbook *optional_wb)
WorkbookView *optional_view,
Workbook *optional_wb,
GdkScreen *optional_screen)
{
static GtkTargetEntry const drag_types[] = {
{ (char *) "text/uri-list", 0, TARGET_URI_LIST },
......@@ -5037,6 +5045,10 @@ workbook_control_gui_init (WorkbookControlGUI *wbcg,
tmp = gnome_app_new ("Gnumeric", "Gnumeric");
#endif
wbcg->toplevel = GTK_WINDOW (tmp);
if (optional_screen)
gtk_window_set_screen (wbcg->toplevel, optional_screen);
wbcg->table = gtk_table_new (0, 0, 0);
wbcg->notebook = NULL;
wbcg->updating_ui = FALSE;
......@@ -5446,14 +5458,16 @@ GSF_CLASS (WorkbookControlGUI, workbook_control_gui,
#endif
WorkbookControl *
workbook_control_gui_new (WorkbookView *optional_view, Workbook *wb)
workbook_control_gui_new (WorkbookView *optional_view,
Workbook *optional_wb,
GdkScreen *optional_screen)
{
WorkbookControlGUI *wbcg;
WorkbookControl *wbc;
wbcg = g_object_new (workbook_control_gui_get_type (), NULL);
wbc = WORKBOOK_CONTROL (wbcg);
workbook_control_gui_init (wbcg, optional_view, wb);
workbook_control_gui_init (wbcg, optional_view, optional_wb, optional_screen);
workbook_control_init_state (wbc);
......
......@@ -14,10 +14,8 @@ typedef struct _CustomXmlUI CustomXmlUI;
GType workbook_control_gui_get_type (void);
WorkbookControl *workbook_control_gui_new (WorkbookView *optional_view,
Workbook *optional_wb);
void workbook_control_gui_init (WorkbookControlGUI *wbcg,
WorkbookView *optional_view,
Workbook *optional_wb);
Workbook *optional_wb,
GdkScreen *optional_screen);
int wbcg_sheet_to_page_index (WorkbookControlGUI *wbcg, Sheet *sheet,
SheetControlGUI **res);
......
......@@ -20,7 +20,8 @@ typedef struct {
CommandContextClass context_class;
/* Create a new control of the same form */
WorkbookControl *(*control_new) (WorkbookControl *wbc, WorkbookView *wbv, Workbook *wb);
WorkbookControl *(*control_new) (WorkbookControl *wbc, WorkbookView *wbv, Workbook *wb,
void *extra);
void (*init_state) (WorkbookControl *wbc);
/* Actions on the workbook UI */
......
......@@ -52,7 +52,8 @@ void wb_control_ ## func arglist \
#define WBC_VIRTUAL(func, arglist, call) WBC_VIRTUAL_FULL(func, func, arglist, call)
WorkbookControl *
wb_control_wrapper_new (WorkbookControl *wbc, WorkbookView *wbv, Workbook *wb)
wb_control_wrapper_new (WorkbookControl *wbc, WorkbookView *wbv, Workbook *wb,
void *extra)
{
WorkbookControlClass *wbc_class;
......@@ -60,7 +61,7 @@ wb_control_wrapper_new (WorkbookControl *wbc, WorkbookView *wbv, Workbook *wb)
wbc_class = WBC_CLASS (wbc);
if (wbc_class != NULL && wbc_class->control_new != NULL)
return wbc_class->control_new (wbc, wbv, wb);
return wbc_class->control_new (wbc, wbv, wb, extra);
return NULL;
}
......
......@@ -17,7 +17,8 @@ void workbook_control_init_state (WorkbookControl *wbc);
/* Create a new control of the same form */
WorkbookControl *wb_control_wrapper_new (WorkbookControl *wbc,
WorkbookView *wbv, Workbook *wb);
WorkbookView *wbv, Workbook *wb,
void *extra);
void wb_control_title_set (WorkbookControl *wbc, char const *title);
void wb_control_prefs_update (WorkbookControl *wbc);
......
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