作図ソフト dia の改良版
Revision | 062b67e4756fed290cc5c05e0f32aa86aeb29e0d (tree) |
---|---|
Zeit | 2004-04-07 21:10:07 |
Autor | Lars Clausen <lclausen@src....> |
Commiter | Lars Clausen |
Persistent diagram properties window
@@ -1,3 +1,22 @@ | ||
1 | +2004-04-07 Lars Clausen <lc@pc770.sb.statsbiblioteket.dk> | |
2 | + | |
3 | + * app/recent_files.c (open_recent_file_callback): | |
4 | + * app/interface.c (origin_button_press): | |
5 | + * app/filedlg.c (file_open_ok_callback): | |
6 | + * app/display.c: | |
7 | + * app/diagram.[ch]: | |
8 | + * app/commands.c (dialogs_layers_callback): Using new | |
9 | + diagram_set_current() function to ensure auxilliary windows are | |
10 | + updated. | |
11 | + | |
12 | + * app/layer_dialog.c: Trying to unify with dia-props. Diagram | |
13 | + menu now borken. *sniff* | |
14 | + | |
15 | + * app/dia-props.c: Diagram properties window attempted | |
16 | + persistentified. Trying to make more like layer dialog (since it | |
17 | + already changes when the diagram changes), but some things still | |
18 | + borken. | |
19 | + | |
1 | 20 | 2004-04-06 Lars Clausen <lars@raeder.dk> |
2 | 21 | |
3 | 22 | * lib/dialinechooser.[ch] (dia_line_chooser_set_line_style): |
@@ -312,7 +312,7 @@ handle_initial_diagram(const char *in_file_name, | ||
312 | 312 | if (diagram != NULL) { |
313 | 313 | diagram_update_extents(diagram); |
314 | 314 | if (app_is_interactive()) { |
315 | - layer_dialog_set_diagram(diagram); | |
315 | + diagram_set_current(diagram); | |
316 | 316 | ddisp = new_display(diagram); |
317 | 317 | } |
318 | 318 | } |
@@ -544,6 +544,9 @@ app_init (int argc, char **argv) | ||
544 | 544 | persistence_register_window_create("layer_window", |
545 | 545 | (NullaryFunc*)&create_layer_dialog); |
546 | 546 | |
547 | + persistence_register_window_create("diagram_properties", | |
548 | + (NullaryFunc*)create_diagram_properties_dialog()); | |
549 | + | |
547 | 550 | /*fill recent file menu */ |
548 | 551 | recent_file_history_init(); |
549 | 552 |
@@ -555,6 +558,7 @@ app_init (int argc, char **argv) | ||
555 | 558 | persistence_register_window_create("sheets_main_dialog", |
556 | 559 | (NullaryFunc*)&sheets_dialog_create); |
557 | 560 | |
561 | + | |
558 | 562 | /* In current setup, we can't find the autosaved files. */ |
559 | 563 | /*autosave_restore_documents();*/ |
560 | 564 | } else { |
@@ -1023,7 +1023,8 @@ dialogs_properties_callback(gpointer data, guint action, GtkWidget *widget) | ||
1023 | 1023 | void |
1024 | 1024 | dialogs_layers_callback(gpointer data, guint action, GtkWidget *widget) |
1025 | 1025 | { |
1026 | - layer_dialog_set_diagram(ddisplay_active()->diagram); | |
1026 | + /* This shouldn't really be necessary */ | |
1027 | + diagram_set_current(ddisplay_active()->diagram); | |
1027 | 1028 | layer_dialog_show(); |
1028 | 1029 | } |
1029 | 1030 |
@@ -31,8 +31,10 @@ | ||
31 | 31 | #include "display.h" |
32 | 32 | #include "widgets.h" |
33 | 33 | #include "display.h" |
34 | +#include "persistence.h" | |
34 | 35 | |
35 | 36 | static GtkWidget *dialog = NULL; |
37 | +static GtkWidget *diagram_omenu; | |
36 | 38 | static GtkWidget *dynamic_check; |
37 | 39 | static GtkWidget *width_x_entry, *width_y_entry; |
38 | 40 | static GtkWidget *visible_x_entry, *visible_y_entry; |
@@ -41,6 +43,28 @@ static GtkWidget *bg_colour, *grid_colour, *pagebreak_colour; | ||
41 | 43 | static void diagram_properties_respond(GtkWidget *widget, |
42 | 44 | gint response_id, |
43 | 45 | gpointer user_data); |
46 | +static void diagram_properties_retrieve(Diagram *dia); | |
47 | +void create_diagram_properties_dialog(void); | |
48 | +void diagram_properties_update_diagram_list(void); | |
49 | + | |
50 | +/* diagram_properties_set_diagram | |
51 | + * Called when the active diagram is changed. It updates the contents | |
52 | + * of the diagram properties dialog | |
53 | + */ | |
54 | +void | |
55 | +diagram_properties_set_diagram(Diagram *dia) | |
56 | +{ | |
57 | + int i; | |
58 | + | |
59 | + if (dialog && dia != NULL) | |
60 | + { | |
61 | + diagram_properties_retrieve(dia); | |
62 | + | |
63 | + i = g_list_index(dia_open_diagrams(), dia); | |
64 | + if (i >= 0) | |
65 | + gtk_option_menu_set_history(GTK_OPTION_MENU(diagram_omenu), i); | |
66 | + } | |
67 | +} | |
44 | 68 | |
45 | 69 | static void |
46 | 70 | diagram_properties_dialog_destroyed(GtkWidget *widget, gpointer userdata) |
@@ -49,31 +73,135 @@ diagram_properties_dialog_destroyed(GtkWidget *widget, gpointer userdata) | ||
49 | 73 | dialog = NULL; |
50 | 74 | } |
51 | 75 | |
76 | +/* Update widget sensitivity to deal with dynamic grid and lack of diagram */ | |
52 | 77 | static void |
53 | 78 | diagram_properties_update_sensitivity(GtkToggleButton *widget, |
54 | 79 | gpointer userdata) |
55 | 80 | { |
56 | 81 | Diagram *dia = ddisplay_active_diagram(); |
57 | - dia->data->grid.dynamic = | |
58 | - gtk_toggle_button_get_active(GTK_CHECK_BUTTON(dynamic_check)); | |
59 | - gtk_widget_set_sensitive(width_x_entry, !dia->data->grid.dynamic); | |
60 | - gtk_widget_set_sensitive(width_y_entry, !dia->data->grid.dynamic); | |
61 | - gtk_widget_set_sensitive(visible_x_entry, !dia->data->grid.dynamic); | |
62 | - gtk_widget_set_sensitive(visible_y_entry, !dia->data->grid.dynamic); | |
82 | + if (dia == NULL) { | |
83 | + gtk_widget_set_sensitive(dynamic_check, FALSE); | |
84 | + gtk_widget_set_sensitive(width_x_entry, FALSE); | |
85 | + gtk_widget_set_sensitive(width_y_entry, FALSE); | |
86 | + gtk_widget_set_sensitive(visible_x_entry, FALSE); | |
87 | + gtk_widget_set_sensitive(visible_y_entry, FALSE); | |
88 | + gtk_widget_set_sensitive(bg_colour, FALSE); | |
89 | + gtk_widget_set_sensitive(grid_colour, FALSE); | |
90 | + gtk_widget_set_sensitive(pagebreak_colour, FALSE); | |
91 | + } else { | |
92 | + dia->data->grid.dynamic = | |
93 | + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dynamic_check)); | |
94 | + gtk_widget_set_sensitive(dynamic_check, TRUE); | |
95 | + gtk_widget_set_sensitive(width_x_entry, !dia->data->grid.dynamic); | |
96 | + gtk_widget_set_sensitive(width_y_entry, !dia->data->grid.dynamic); | |
97 | + gtk_widget_set_sensitive(visible_x_entry, !dia->data->grid.dynamic); | |
98 | + gtk_widget_set_sensitive(visible_y_entry, !dia->data->grid.dynamic); | |
99 | + gtk_widget_set_sensitive(bg_colour, TRUE); | |
100 | + gtk_widget_set_sensitive(grid_colour, TRUE); | |
101 | + gtk_widget_set_sensitive(pagebreak_colour, TRUE); | |
102 | + } | |
63 | 103 | } |
64 | 104 | |
65 | 105 | static void |
66 | -create_diagram_properties_dialog(Diagram *dia) | |
106 | +diagram_properties_select_diagram_callback(GtkWidget *widget, gpointer gdata) | |
107 | +{ | |
108 | + Diagram *dia = (Diagram *)gdata; | |
109 | + | |
110 | + diagram_properties_set_diagram(dia); | |
111 | +} | |
112 | + | |
113 | +void | |
114 | +diagram_properties_update_diagram_list(void) | |
115 | +{ | |
116 | + GtkWidget *new_menu; | |
117 | + GtkWidget *menu_item; | |
118 | + GList *dia_list; | |
119 | + Diagram *dia; | |
120 | + char *filename; | |
121 | + int i; | |
122 | + int current_nr; | |
123 | + | |
124 | + if (dialog == NULL) return; | |
125 | + | |
126 | + new_menu = gtk_menu_new(); | |
127 | + | |
128 | + current_nr = -1; | |
129 | + | |
130 | + i = 0; | |
131 | + dia_list = dia_open_diagrams(); | |
132 | + while (dia_list != NULL) { | |
133 | + dia = (Diagram *) dia_list->data; | |
134 | + | |
135 | + if (ddisplay_active() && dia == ddisplay_active()->diagram) { | |
136 | + current_nr = i; | |
137 | + } | |
138 | + | |
139 | + filename = strrchr(dia->filename, G_DIR_SEPARATOR); | |
140 | + if (filename==NULL) { | |
141 | + filename = dia->filename; | |
142 | + } else { | |
143 | + filename++; | |
144 | + } | |
145 | + printf("Adding filename %s to menu\n", filename); | |
146 | + | |
147 | + menu_item = gtk_menu_item_new_with_label(filename); | |
148 | + | |
149 | + g_signal_connect (GTK_OBJECT (menu_item), "activate", | |
150 | + /**/ | |
151 | + (GtkSignalFunc) diagram_properties_select_diagram_callback, | |
152 | + (gpointer) dia); | |
153 | + | |
154 | + gtk_menu_append( GTK_MENU(new_menu), menu_item); | |
155 | + gtk_widget_show (menu_item); | |
156 | + | |
157 | + dia_list = g_list_next(dia_list); | |
158 | + i++; | |
159 | + } | |
160 | + | |
161 | + if (dia_open_diagrams()==NULL) { | |
162 | + menu_item = gtk_menu_item_new_with_label (_("none")); | |
163 | + g_signal_connect (GTK_OBJECT (menu_item), "activate", | |
164 | + /**/ | |
165 | + (GtkSignalFunc) diagram_properties_select_diagram_callback, | |
166 | + (gpointer) NULL); | |
167 | + gtk_menu_append( GTK_MENU(new_menu), menu_item); | |
168 | + gtk_widget_show (menu_item); | |
169 | + } | |
170 | + | |
171 | + gtk_option_menu_remove_menu(GTK_OPTION_MENU(diagram_omenu)); | |
172 | + | |
173 | + gtk_option_menu_set_menu(GTK_OPTION_MENU(diagram_omenu), | |
174 | + new_menu); | |
175 | + | |
176 | + gtk_option_menu_set_history(GTK_OPTION_MENU(diagram_omenu), | |
177 | + current_nr); | |
178 | + gtk_menu_set_active(GTK_MENU(new_menu), current_nr); | |
179 | + | |
180 | + if (current_nr == -1) { | |
181 | + dia = NULL; | |
182 | + if (dia_open_diagrams()!=NULL) { | |
183 | + dia = (Diagram *) dia_open_diagrams()->data; | |
184 | + } | |
185 | + /**/ | |
186 | + diagram_properties_set_diagram(dia); | |
187 | + } | |
188 | +} | |
189 | + | |
190 | +void | |
191 | +create_diagram_properties_dialog() | |
67 | 192 | { |
68 | 193 | GtkWidget *dialog_vbox; |
69 | 194 | GtkWidget *notebook; |
70 | 195 | GtkWidget *table; |
71 | 196 | GtkWidget *label; |
197 | + GtkWidget *hbox; | |
198 | + GtkWidget *menu; | |
199 | + GtkWidget *separator; | |
72 | 200 | GtkAdjustment *adj; |
73 | 201 | |
74 | 202 | dialog = gtk_dialog_new_with_buttons( |
75 | 203 | _("Diagram Properties"), |
76 | - GTK_WINDOW(ddisplay_active()->shell), | |
204 | + NULL, | |
77 | 205 | GTK_DIALOG_DESTROY_WITH_PARENT, |
78 | 206 | GTK_STOCK_CLOSE, GTK_RESPONSE_CANCEL, |
79 | 207 | GTK_STOCK_APPLY, GTK_RESPONSE_APPLY, |
@@ -83,8 +211,6 @@ create_diagram_properties_dialog(Diagram *dia) | ||
83 | 211 | //GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); |
84 | 212 | gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_OK); |
85 | 213 | |
86 | - dialog_vbox = GTK_DIALOG(dialog)->vbox; | |
87 | - | |
88 | 214 | gtk_window_set_role(GTK_WINDOW(dialog), "diagram_properties"); |
89 | 215 | |
90 | 216 | g_signal_connect(G_OBJECT(dialog), "response", |
@@ -95,6 +221,28 @@ create_diagram_properties_dialog(Diagram *dia) | ||
95 | 221 | g_signal_connect(G_OBJECT(dialog), "destroy_event", |
96 | 222 | G_CALLBACK(diagram_properties_dialog_destroyed), NULL); |
97 | 223 | |
224 | + dialog_vbox = GTK_DIALOG(dialog)->vbox; | |
225 | + | |
226 | + hbox = gtk_hbox_new(FALSE, 1); | |
227 | + | |
228 | + label = gtk_label_new(_("Diagrams:")); | |
229 | + gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 2); | |
230 | + gtk_widget_show (label); | |
231 | + | |
232 | + diagram_omenu = gtk_option_menu_new(); | |
233 | + gtk_box_pack_start(GTK_BOX(hbox), diagram_omenu, TRUE, TRUE, 2); | |
234 | + gtk_widget_show (diagram_omenu); | |
235 | + | |
236 | + menu = gtk_menu_new(); | |
237 | + gtk_option_menu_set_menu(GTK_OPTION_MENU(diagram_omenu), menu); | |
238 | + | |
239 | + gtk_box_pack_start(GTK_BOX(dialog_vbox), hbox, FALSE, FALSE, 2); | |
240 | + gtk_widget_show (hbox); | |
241 | + | |
242 | + separator = gtk_hseparator_new(); | |
243 | + gtk_box_pack_start(GTK_BOX(dialog_vbox), separator, FALSE, FALSE, 2); | |
244 | + gtk_widget_show (separator); | |
245 | + | |
98 | 246 | notebook = gtk_notebook_new(); |
99 | 247 | gtk_notebook_set_tab_pos(GTK_NOTEBOOK(notebook), GTK_POS_TOP); |
100 | 248 | gtk_box_pack_start(GTK_BOX(dialog_vbox), notebook, TRUE, TRUE, 0); |
@@ -231,8 +379,8 @@ diagram_properties_retrieve(Diagram *dia) | ||
231 | 379 | gtk_window_set_title(GTK_WINDOW(dialog), title); |
232 | 380 | g_free(name); |
233 | 381 | g_free(title); |
234 | - gtk_toggle_button_set_active(GTK_CHECK_BUTTON(dynamic_check), | |
235 | - dia->data->grid.dynamic); | |
382 | + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dynamic_check), | |
383 | + dia->data->grid.dynamic); | |
236 | 384 | gtk_spin_button_set_value(GTK_SPIN_BUTTON(width_x_entry), |
237 | 385 | dia->data->grid.width_x); |
238 | 386 | gtk_spin_button_set_value(GTK_SPIN_BUTTON(width_y_entry), |
@@ -255,8 +403,11 @@ diagram_properties_retrieve(Diagram *dia) | ||
255 | 403 | void |
256 | 404 | diagram_properties_show(Diagram *dia) |
257 | 405 | { |
258 | - if (!dialog) | |
259 | - create_diagram_properties_dialog(dia); | |
406 | + if (!dialog) { | |
407 | + create_diagram_properties_dialog(); | |
408 | + persistence_register_window(GTK_WINDOW(dialog)); | |
409 | + diagram_properties_update_diagram_list(); | |
410 | + } | |
260 | 411 | |
261 | 412 | diagram_properties_retrieve(dia); |
262 | 413 |
@@ -276,7 +427,7 @@ diagram_properties_respond(GtkWidget *widget, | ||
276 | 427 | response_id != GTK_RESPONSE_APPLY) { |
277 | 428 | if (active_diagram) { |
278 | 429 | active_diagram->data->grid.dynamic = |
279 | - gtk_toggle_button_get_active(GTK_CHECK_BUTTON(dynamic_check)); | |
430 | + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dynamic_check)); | |
280 | 431 | active_diagram->data->grid.width_x = |
281 | 432 | gtk_spin_button_get_value(GTK_SPIN_BUTTON(width_x_entry)); |
282 | 433 | active_diagram->data->grid.width_y = |
@@ -298,17 +449,3 @@ diagram_properties_respond(GtkWidget *widget, | ||
298 | 449 | if (response_id != GTK_RESPONSE_APPLY) |
299 | 450 | gtk_widget_hide(dialog); |
300 | 451 | } |
301 | - | |
302 | -/* diagram_properties_set_diagram | |
303 | - * Called when the active diagram is changed. It updates the contents | |
304 | - * of the diagram properties dialog | |
305 | - */ | |
306 | -void | |
307 | -diagram_properties_set_diagram(Diagram *dia) | |
308 | -{ | |
309 | - if (dialog && dia != NULL) | |
310 | - { | |
311 | - diagram_properties_retrieve(dia); | |
312 | - } | |
313 | -} | |
314 | - |
@@ -76,8 +76,9 @@ diagram_init(Diagram *dia, const char *filename) | ||
76 | 76 | if (!g_list_find(open_diagrams, dia)) |
77 | 77 | open_diagrams = g_list_prepend(open_diagrams, dia); |
78 | 78 | |
79 | - if (app_is_interactive()) | |
80 | - layer_dialog_update_diagram_list(); | |
79 | + if (app_is_interactive()) { | |
80 | + diagram_set_current(dia); | |
81 | + } | |
81 | 82 | } |
82 | 83 | |
83 | 84 | int |
@@ -129,16 +130,29 @@ new_diagram(const char *filename) /* Note: filename is copied */ | ||
129 | 130 | } |
130 | 131 | |
131 | 132 | void |
133 | +diagram_set_current(Diagram *dia) { | |
134 | + layer_dialog_set_diagram(dia); | |
135 | + diagram_properties_set_diagram(dia); | |
136 | +} | |
137 | + | |
138 | +void | |
132 | 139 | diagram_destroy(Diagram *dia) |
133 | 140 | { |
141 | + Diagram *other_diagram; | |
142 | + | |
134 | 143 | assert(dia->displays==NULL); |
135 | 144 | |
136 | 145 | diagram_data_destroy(dia->data); |
137 | 146 | |
138 | 147 | g_free(dia->filename); |
139 | 148 | |
149 | + other_diagram = g_list_find(open_diagrams, dia); | |
150 | + if (g_list_next(other_diagram) != NULL) other_diagram = g_list_next(other_diagram); | |
151 | + else if (g_list_previous(other_diagram) != NULL) other_diagram = g_list_previous(other_diagram); | |
152 | + else other_diagram = NULL; | |
153 | + printf("Found other diagram %p for %p\n", other_diagram, dia); | |
140 | 154 | open_diagrams = g_list_remove(open_diagrams, dia); |
141 | - layer_dialog_update_diagram_list(); | |
155 | + diagram_set_current(other_diagram); | |
142 | 156 | |
143 | 157 | undo_destroy(dia->undo); |
144 | 158 |
@@ -1204,7 +1218,7 @@ diagram_set_filename(Diagram *dia, char *filename) | ||
1204 | 1218 | |
1205 | 1219 | g_free(title); |
1206 | 1220 | |
1207 | - layer_dialog_update_diagram_list(); | |
1221 | + diagram_set_current(dia); | |
1208 | 1222 | recent_file_history_add((const char *)filename); |
1209 | 1223 | |
1210 | 1224 | diagram_tree_update_name(diagram_tree(), dia); |
@@ -61,6 +61,8 @@ GList *dia_open_diagrams(void); /* Read only! */ | ||
61 | 61 | Diagram *diagram_load(const char *filename, DiaImportFilter *ifilter); |
62 | 62 | int diagram_load_into (Diagram *dest, const char *filename, DiaImportFilter *ifilter); |
63 | 63 | Diagram *new_diagram(const char *filename); /*Note: filename is copied*/ |
64 | +/** Perform updates related to getting a new current diagram */ | |
65 | +void diagram_set_current(Diagram *diagram); | |
64 | 66 | void diagram_destroy(Diagram *dia); |
65 | 67 | gboolean diagram_is_modified(Diagram *dia); |
66 | 68 | void diagram_modified(Diagram *dia); |
@@ -1201,16 +1201,16 @@ display_set_active(DDisplay *ddisp) | ||
1201 | 1201 | active_display = ddisp; |
1202 | 1202 | |
1203 | 1203 | /* perform notification here (such as switch layers dialog) */ |
1204 | - layer_dialog_set_diagram(ddisp ? ddisp->diagram : NULL); | |
1205 | - diagram_properties_set_diagram(ddisp ? ddisp->diagram : NULL); | |
1206 | - | |
1207 | 1204 | if (ddisp) { |
1205 | + diagram_set_current(ddisp->diagram); | |
1208 | 1206 | display_update_menu_state(ddisp); |
1209 | 1207 | |
1210 | 1208 | if (prefs.toolbox_on_top) { |
1211 | 1209 | gtk_window_set_transient_for(GTK_WINDOW(interface_get_toolbox_shell()), |
1212 | 1210 | GTK_WINDOW(ddisp->shell)); |
1213 | 1211 | } |
1212 | + } else { | |
1213 | + diagram_set_current(NULL); | |
1214 | 1214 | } |
1215 | 1215 | } |
1216 | 1216 | } |
@@ -153,7 +153,7 @@ file_open_ok_callback(GtkWidget *w, GtkFileSelection *fs) | ||
153 | 153 | |
154 | 154 | if (diagram != NULL) { |
155 | 155 | diagram_update_extents(diagram); |
156 | - layer_dialog_set_diagram(diagram); | |
156 | + diagram_set_current(diagram); | |
157 | 157 | |
158 | 158 | ddisp = new_display(diagram); |
159 | 159 | } |
@@ -1129,7 +1129,7 @@ create_lineprops_area(GtkWidget *parent) | ||
1129 | 1129 | gtk_tooltips_set_tip(tool_tips, chooser, _("Line style for new lines. Click to pick a line style, or set line style parameters with Details..."), NULL); |
1130 | 1130 | style = persistence_register_integer("line-style", LINESTYLE_SOLID); |
1131 | 1131 | dash_length = persistence_register_real("dash-length", DEFAULT_LINESTYLE_DASHLEN); |
1132 | - dia_line_chooser_set_line_style(chooser, style, dash_length); | |
1132 | + dia_line_chooser_set_line_style(DIA_LINE_CHOOSER(chooser), style, dash_length); | |
1133 | 1133 | gtk_widget_show(chooser); |
1134 | 1134 | |
1135 | 1135 | chooser = dia_arrow_chooser_new(FALSE, change_end_arrow_style, NULL, tool_tips); |
@@ -1224,7 +1224,7 @@ dia_dnd_file_drag_data_received (GtkWidget *widget, | ||
1224 | 1224 | |
1225 | 1225 | if (diagram != NULL) { |
1226 | 1226 | diagram_update_extents(diagram); |
1227 | - layer_dialog_set_diagram(diagram); | |
1227 | + diagram_set_current(diagram); | |
1228 | 1228 | |
1229 | 1229 | ddisp = new_display(diagram); |
1230 | 1230 | } |
@@ -205,7 +205,8 @@ recent_file_history_remove (const char *fname) | ||
205 | 205 | } |
206 | 206 | |
207 | 207 | static void |
208 | -open_recent_file_callback (GtkWidget *widget, gpointer data) { | |
208 | +open_recent_file_callback(GtkWidget *widget, gpointer data) | |
209 | +{ | |
209 | 210 | DiaImportFilter *ifilter = NULL; |
210 | 211 | Diagram *diagram = NULL; |
211 | 212 | gchar *filename = (gchar *)data; |
@@ -215,7 +216,7 @@ open_recent_file_callback (GtkWidget *widget, gpointer data) { | ||
215 | 216 | diagram = diagram_load(filename, ifilter); |
216 | 217 | if (diagram != NULL) { |
217 | 218 | diagram_update_extents(diagram); |
218 | - layer_dialog_set_diagram(diagram); | |
219 | + diagram_set_current(diagram); | |
219 | 220 | new_display(diagram); |
220 | 221 | } else |
221 | 222 | recent_file_history_remove (filename); |