/[eiffelstudio]/branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_graphical_project_loader.e
ViewVC logotype

Contents of /branches/Eiffel_57_docking/Src/Eiffel/interface/new_graphical/commands/eb_graphical_project_loader.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 61989 - (show annotations)
Sun Jul 30 06:09:24 2006 UTC (13 years, 4 months ago) by manus
File size: 23813 byte(s)
EiffelStudio docking branch. It only contains modified classes needed to get the docking version of EiffelStudio.
1 indexing
2 description: "Graphical version for project loading."
3 legal: "See notice at end of class."
4 status: "See notice at end of class."
5 date: "$Date$"
6 revision: "$Revision$"
7
8 class
9 EB_GRAPHICAL_PROJECT_LOADER
10
11 inherit
12 PROJECT_LOADER
13 undefine
14 warning_messages
15 redefine
16 is_project_location_requested,
17 post_create_project
18 end
19
20 EB_CONSTANTS
21 export
22 {NONE} all
23 end
24
25 EB_SHARED_MANAGERS
26 rename
27 project_location as compiler_project_location
28 export
29 {NONE} all
30 end
31
32 EB_SHARED_PREFERENCES
33 export
34 {NONE} all
35 end
36
37 EV_DIALOG_CONSTANTS
38 export
39 {NONE} all
40 end
41
42 EB_FILE_DIALOG_CONSTANTS
43 export
44 {NONE} all
45 end
46
47 EV_SHARED_APPLICATION
48 export
49 {NONE} all
50 end
51
52 EB_LAYOUT_CONSTANTS
53 export
54 {NONE} all
55 end
56
57 COMMAND_EXECUTOR
58 rename
59 project_location as compiler_project_location
60 export
61 {NONE} all
62 end
63
64 create
65 make
66
67 feature {NONE} -- Initialization
68
69 make (a_parent: like parent_window) is
70 -- New instance of EB_GRAPHICAL_PROJECT_LOADER where dialogs are shown
71 -- either relative or modal to `a_parent'.
72 require
73 a_parent_not_void: a_parent /= Void
74 a_parent_not_destroyed: not a_parent.is_destroyed
75 do
76 parent_window := a_parent
77 deletion_agent := agent on_delete_directory
78 cancel_agent := agent on_cancel_operation
79 is_project_location_requested := True
80 ensure
81 parent_window_set: parent_window = a_parent
82 is_project_location_requested_set: is_project_location_requested
83 end
84
85 feature -- Access
86
87 parent_window: EV_WINDOW
88 -- Parent for all dialogs shown.
89
90 feature -- Status report
91
92 is_project_location_requested: BOOLEAN
93 -- If `True', ask user for a project location, otherwise simply create
94 -- project where configuration file is located.
95
96 feature -- Settings
97
98 set_is_project_location_requested (v: like is_project_location_requested) is
99 -- Set `is_project_location_requested' with `v'.
100 do
101 is_project_location_requested := v
102 ensure
103 is_project_location_requested_set: is_project_location_requested = v
104 end
105
106 compile_project is
107 -- Compile newly created project.
108 do
109 ev_application.do_once_on_idle (
110 agent (window_manager.last_focused_development_window.melt_project_cmd).execute)
111 end
112
113 open_project (in_new_studio: BOOLEAN) is
114 -- Open project.
115 require
116 not_has_error: not has_error
117 is_project_ready_for_compilation: not is_project_creation_or_opening_not_requested or is_project_ok
118 do
119 if in_new_studio then
120 execute (estudio_cmd_line)
121 end
122 end
123
124 melt_project (in_new_studio: BOOLEAN) is
125 -- Open project.
126 require
127 not_has_error: not has_error
128 is_compilation_requested: is_compilation_requested
129 is_project_ready_for_compilation: not is_project_creation_or_opening_not_requested or is_project_ok
130 do
131 if not in_new_studio then
132 ev_application.do_once_on_idle (
133 agent (window_manager.last_focused_development_window.melt_project_cmd).execute)
134 else
135 execute (estudio_cmd_line + " -melt")
136 end
137 end
138
139 precompile_project (in_new_studio: BOOLEAN) is
140 -- Compile newly created project.
141 require
142 not_has_error: not has_error
143 is_compilation_requested: is_compilation_requested
144 is_project_ready_for_compilation: not is_project_creation_or_opening_not_requested or is_project_ok
145 do
146 if not in_new_studio then
147 ev_application.do_once_on_idle (
148 agent (window_manager.last_focused_development_window.precompilation_cmd).execute)
149 else
150 execute (estudio_cmd_line + " -precompile")
151 end
152 end
153
154 freeze_project (in_new_studio: BOOLEAN) is
155 -- Compile newly created project.
156 require
157 not_has_error: not has_error
158 is_compilation_requested: is_compilation_requested
159 is_project_ready_for_compilation: not is_project_creation_or_opening_not_requested or is_project_ok
160 do
161 if not in_new_studio then
162 ev_application.do_once_on_idle (
163 agent (window_manager.last_focused_development_window.freeze_project_cmd).execute)
164 else
165 execute (estudio_cmd_line + " -freeze")
166 end
167 end
168
169 finalize_project (in_new_studio: BOOLEAN) is
170 -- Compile newly created project.
171 require
172 not_has_error: not has_error
173 is_compilation_requested: is_compilation_requested
174 is_project_ready_for_compilation: not is_project_creation_or_opening_not_requested or is_project_ok
175 do
176 if not in_new_studio then
177 ev_application.do_once_on_idle (
178 agent (window_manager.last_focused_development_window.finalize_project_cmd).execute)
179 else
180 execute (estudio_cmd_line + " -finalize")
181 end
182 end
183
184 feature {NONE} -- Actions
185
186 post_create_project is
187 -- Actions performed after creating a new project.
188 do
189 -- Destroy and forget `deleting_dialog' if it was used.
190 if deleting_dialog /= Void and then not deleting_dialog.is_destroyed then
191 deleting_dialog.destroy
192 deleting_dialog := Void
193 end
194 end
195
196 estudio_cmd_line: STRING is
197 -- Command line to open/compile currently selected project.
198 require
199 not_has_error: not has_error
200 do
201 create Result.make (1024)
202 Result.append (estudio_command_name)
203 Result.append (" -config %"")
204 Result.append (config_file_name)
205 Result.append ("%" -project_path %"")
206 Result.append (project_location)
207 Result.append ("%" -target %"")
208 Result.append (target_name)
209 Result.append ("%"")
210 if is_recompile_from_scrach then
211 Result.append (" -clean ")
212 end
213 end
214
215 feature {NONE} -- Error reporting
216
217 new_error_dialog: EV_ERROR_DIALOG is
218 -- New error dialog properly initialized.
219 do
220 create Result
221 Result.set_title ("Configuration Loading Error")
222 Result.set_buttons (<< ev_ok >>)
223 Result.set_default_push_button (Result.button (ev_ok))
224 Result.set_default_cancel_button (Result.button (ev_ok))
225 end
226
227 report_non_readable_configuration_file (a_file_name: STRING) is
228 -- Report an error when `a_file_name' cannot be read.
229 local
230 l_ev: EV_ERROR_DIALOG
231 do
232 l_ev := new_error_dialog
233 l_ev.set_text (warning_messages.w_cannot_read_file (a_file_name))
234 l_ev.show_modal_to_window (parent_window)
235 set_has_error
236 end
237
238 report_non_readable_ace_file_in_epr (a_epr_name, a_file_name: STRING) is
239 -- Report an error when ace file `a_file_name' cannot be accessed from epr file `a_epr_name'.
240 -- Note that `a_file_name' can be Void if `a_epr_name' does not mention it.
241 local
242 l_ev: EV_ERROR_DIALOG
243 do
244 l_ev := new_error_dialog
245 l_ev.set_text (warning_messages.w_cannot_read_ace_file_from_epr (a_epr_name, a_file_name))
246 l_ev.show_modal_to_window (parent_window)
247 set_has_error
248 end
249
250 report_cannot_read_ace_file (a_file_name: STRING; a_conf_error: CONF_ERROR) is
251 -- Report an error when ace file `a_file_name' can be read, but its content cannot
252 -- be properly interpreted. The details of the error are stored in `a_conf_error'.
253 local
254 l_ev: EV_ERROR_DIALOG
255 l_msg: STRING
256 do
257 l_ev := new_error_dialog
258 create l_msg.make_from_string (warning_messages.w_unable_to_load_ace_file (a_file_name))
259 l_msg.append ("%NFor the following reasons:%N")
260 l_msg.append_string (a_conf_error.text)
261 l_ev.set_text (l_msg)
262 l_ev.show_modal_to_window (parent_window)
263 set_has_error
264 end
265
266 report_cannot_read_config_file (a_file_name: STRING; a_conf_error: CONF_ERROR) is
267 -- Report an error when a config file `a_file_name' can be read, but its content cannot
268 -- be properly interpreted. The details of the error are stored in `a_conf_error'.
269 local
270 l_ev: EV_ERROR_DIALOG
271 l_msg: STRING
272 do
273 l_ev := new_error_dialog
274 create l_msg.make_from_string (warning_messages.w_unable_to_load_config_file (a_file_name))
275 l_msg.append ("%NFor the following reasons:%N")
276 l_msg.append_string (a_conf_error.text)
277 l_ev.set_text (l_msg)
278 l_ev.show_modal_to_window (parent_window)
279 set_has_error
280 end
281
282 report_cannot_save_converted_file (a_file_name: STRING) is
283 -- Report an error when result of a conversion from ace to new format cannot be stored
284 -- in file `a_file_name'.
285 local
286 l_ev: EV_ERROR_DIALOG
287 do
288 l_ev := new_error_dialog
289 l_ev.set_text (warning_messages.w_cannot_save_file (a_file_name))
290 l_ev.show_modal_to_window (parent_window)
291 set_has_error
292 end
293
294
295 report_cannot_convert_project (a_file_name: STRING) is
296 -- Report an error when result of a conversion from ace `a_file_name' to new format failed.
297 local
298 l_ev: EV_ERROR_DIALOG
299 do
300 l_ev := new_error_dialog
301 l_ev.set_text (warning_messages.w_cannot_convert_file (a_file_name))
302 l_ev.show_modal_to_window (parent_window)
303 set_has_error
304 end
305
306 report_cannot_create_project (a_dir_name: STRING) is
307 -- Report an error when we cannot create project in `a_dir_name'.
308 local
309 l_ev: EV_ERROR_DIALOG
310 do
311 l_ev := new_error_dialog
312 l_ev.set_text (warning_messages.w_cannot_create_project_directory (a_dir_name))
313 l_ev.show_modal_to_window (parent_window)
314 set_has_error
315 end
316
317 report_cannot_open_project (a_msg: STRING) is
318 -- Report an error when project cannot be read/write for some reasons
319 -- and possibly propose user to upgrade
320 local
321 l_ev: EV_ERROR_DIALOG
322 do
323 l_ev := new_error_dialog
324 l_ev.set_text (a_msg)
325 l_ev.show_modal_to_window (parent_window)
326 set_has_error
327 end
328
329 report_incompatible_project (a_msg: STRING) is
330 -- Report an error when retrieving an incompatible project and possibly
331 -- propose user to upgrade.
332 local
333 cd: STANDARD_DISCARDABLE_CONFIRMATION_DIALOG
334 do
335 -- Ace file included in the header of the .epr file...we can recompile if needed.
336 create cd.make_initialized (
337 2, preferences.dialog_data.confirm_convert_project_string,
338 Warning_messages.w_project_incompatible_version (config_file_name, version_number,
339 Eiffel_project.incompatible_version_number),
340 Interface_names.l_discard_convert_project_dialog,
341 preferences.preferences
342 )
343 cd.set_ok_action (agent set_should_override_project (True))
344 cd.set_cancel_action (agent set_has_error)
345 cd.show_modal_to_window (parent_window)
346 if should_override_project then
347 is_compilation_requested := True
348 end
349 end
350
351 report_project_corrupted (a_msg: STRING) is
352 -- Report an error when retrieving a project which is corrupted and possibly
353 -- propose user to recompile from scratch.
354 local
355 l_ev: EV_ERROR_DIALOG
356 do
357 l_ev := new_error_dialog
358 l_ev.set_text (a_msg)
359 l_ev.show_modal_to_window (parent_window)
360 set_has_error
361 end
362
363 report_project_retrieval_interrupted (a_msg: STRING) is
364 -- Report an error when project retrieval was stopped.
365 local
366 l_ev: EV_ERROR_DIALOG
367 do
368 l_ev := new_error_dialog
369 l_ev.set_text (a_msg)
370 l_ev.show_modal_to_window (parent_window)
371 set_has_error
372 end
373
374 report_project_incomplete (a_msg: STRING) is
375 -- Report an error when project is incomplete and possibly propose
376 -- user to recompile from scratch.
377 local
378 l_ev: EV_ERROR_DIALOG
379 do
380 l_ev := new_error_dialog
381 l_ev.set_text (a_msg)
382 l_ev.show_modal_to_window (parent_window)
383 set_has_error
384 end
385
386 report_project_loaded_successfully is
387 -- Report that project was loaded successfully.
388 local
389 l_title: STRING
390 do
391 l_title := Interface_names.l_loaded_project.twin
392 l_title.append (target_name)
393 if Eiffel_system.is_precompiled then
394 l_title.append (" (precompiled)")
395 end
396 window_manager.display_message (l_title)
397 recent_projects_manager.add_recent_project (config_file_name)
398 Recent_projects_manager.save_recent_projects
399
400 --| IEK With project session handling this code is no longer needed, remove when fully integrated.
401 -- We print text in the project_tool text concerning the system
402 -- because we were successful retrieving the project without
403 -- errors or conversion.
404 output_manager.display_system_info
405 end
406
407 feature {NONE} -- User interaction
408
409 ask_for_config_name (a_dir_name, a_file_name: STRING; a_action: PROCEDURE [ANY, TUPLE [STRING]]) is
410 -- Given `a_dir_name' and a proposed `a_file_name' name for the new format, ask the
411 -- user if he wants to create `a_file_name' or a different name. If he said yes, then
412 -- execute `a_action' with chosen file_name, otherwise do nothing.
413 local
414 l_save_as: EV_FILE_SAVE_DIALOG
415 l_file_name: FILE_NAME
416 l_ev: EV_MESSAGE_DIALOG
417 l_save_as_msg: STRING
418 do
419 create l_file_name.make_from_string (a_dir_name)
420 l_file_name.set_file_name (a_file_name)
421
422 create l_ev
423 l_save_as_msg := "Save As..."
424 l_ev.set_title ("Configuration Loading Message")
425 l_ev.set_buttons (<< ev_ok, l_save_as_msg, ev_cancel>>)
426 l_ev.set_default_push_button (l_ev.button (ev_ok))
427 l_ev.set_default_cancel_button (l_ev.button (ev_cancel))
428 l_ev.set_text ("Your old configration file needs to be converted to the new format.%N%
429 %The default name for the new configuration is '" + a_file_name + "'.%N%
430 %Select OK if you want to keep this name, or 'Save As...' to choose a different name.")
431
432 create l_save_as.make_with_title ("Choose name for new configuration file")
433 l_save_as.set_start_directory (a_dir_name)
434 l_save_as.set_file_name (a_file_name)
435 l_save_as.filters.extend ([config_files_filter, config_files_description])
436 l_save_as.save_actions.extend (agent select_config_file (l_save_as, a_action))
437 l_save_as.cancel_actions.extend (agent set_has_error)
438
439 l_ev.button (l_save_as_msg).select_actions.extend (agent l_save_as.show_modal_to_window (parent_window))
440 l_ev.button (ev_cancel).select_actions.extend (agent on_cancelled (l_ev))
441 l_ev.button (ev_ok).select_actions.extend (agent a_action.call ([l_file_name.string]))
442 l_ev.show_modal_to_window (parent_window)
443 end
444
445 select_config_file (a_dlg: EV_FILE_SAVE_DIALOG; a_action: PROCEDURE [ANY, TUPLE]) is
446 -- Given a save dialog `a_dlg', check if the selected file does not exist, and then
447 -- execute `a_action'. If file exists, display a warning and ask if user wants to
448 -- override that file or not. If overriden, then execute `a_action', otherwise
449 -- bring save dialog one more time.
450 require
451 a_dlg_not_void: a_dlg /= Void
452 a_action_not_void: a_action /= Void
453 local
454 file_name: STRING
455 wd: EV_WARNING_DIALOG
456 file: RAW_FILE
457 do
458 -- This is a callback from the name chooser when user click OK.
459 file_name := a_dlg.file_name
460 check file_name_not_empty: not file_name.is_empty end
461 create file.make (file_name)
462 if file.exists then
463 create wd.make_with_text (Warning_messages.w_file_exists (file_name))
464 wd.set_buttons (<< ev_ok, ev_cancel >>)
465 wd.set_default_push_button (wd.button (ev_ok))
466 wd.set_default_cancel_button (wd.button (ev_cancel))
467 wd.button (ev_cancel).select_actions.extend (agent a_dlg.show_modal_to_window (parent_window))
468 wd.button (ev_ok).select_actions.extend (agent a_action.call ([file_name]))
469
470 -- Display the warning window. If user presses `Cancel' we ask him again
471 -- for a file name, otherwise if he presses `OK' we simply override
472 -- the selected `file_name'.
473 wd.show_modal_to_window (parent_window)
474 else
475 a_action.call ([file_name])
476 end
477 end
478
479 ask_for_target_name (a_targets: DS_ARRAYED_LIST [STRING]) is
480 -- Ask user to choose one target among `a_targets'.
481 local
482 l_dialog: EV_DIALOG
483 l_list: EV_LIST
484 l_vbox: EV_VERTICAL_BOX
485 l_hbox: EV_HORIZONTAL_BOX
486 l_select_button, l_button: EV_BUTTON
487 l_item: EV_LIST_ITEM
488 do
489 if a_targets.count = 1 then
490 a_targets.start
491 target_name := a_targets.item_for_iteration
492 else
493 create l_dialog.make_with_title ("Select a target")
494 create l_list
495 from
496 a_targets.start
497 until
498 a_targets.after
499 loop
500 create l_item.make_with_text (a_targets.item_for_iteration)
501 l_item.pointer_double_press_actions.force_extend (agent on_target_selected (l_dialog, l_item))
502 l_list.extend (l_item)
503 a_targets.forth
504 end
505 -- Select first item by default.
506 l_list.first.enable_select
507 l_list.set_minimum_size (100, 150)
508
509 create l_vbox
510 l_vbox.set_border_width (default_border_size)
511 l_vbox.set_padding (small_padding_size)
512 l_vbox.extend (l_list)
513
514 create l_hbox
515 l_hbox.set_padding (default_padding_size)
516 l_vbox.extend (l_hbox)
517 l_vbox.disable_item_expand (l_hbox)
518
519 l_hbox.extend (create {EV_CELL})
520 create l_select_button.make_with_text_and_action ("Select target", agent on_select_button_pushed (l_dialog, l_list))
521 l_select_button.set_minimum_height (default_button_height)
522 l_hbox.extend (l_select_button)
523 l_hbox.disable_item_expand (l_select_button)
524
525 create l_button.make_with_text_and_action (ev_cancel, agent on_cancelled (l_dialog))
526 l_button.set_minimum_height (default_button_height)
527 l_button.set_minimum_width (default_button_width)
528 l_hbox.extend (l_button)
529 l_hbox.disable_item_expand (l_button)
530 l_hbox.extend (create {EV_CELL})
531
532 l_dialog.extend (l_vbox)
533
534 l_dialog.set_default_cancel_button (l_button)
535 l_dialog.set_default_push_button (l_select_button)
536
537 l_dialog.show_modal_to_window (parent_window)
538 end
539 end
540
541 ask_for_new_project_location (a_project_path: STRING) is
542 -- Given a proposed location `a_project_path', ask user if he wants
543 -- this location or another one.
544 local
545 l_create: EB_CREATE_PROJECT_DIALOG
546 do
547 create l_create.make_with_ace (parent_window, config_file_name, a_project_path)
548 l_create.show_modal_to_parent
549 has_error := not l_create.success
550 if not has_error then
551 -- Process if we should start compilation right away or wait.
552 project_location := l_create.project_location
553 is_compilation_requested := l_create.compile_project
554 end
555 end
556
557 feature {NONE} -- Actions
558
559 deleting_dialog: EV_DIALOG
560 -- Dialog displaying that the program is currently deleting
561 -- some files.
562
563 deleting_dialog_label: EV_LABEL
564 -- Label displaying the file currently being deleted
565
566 choose_again: BOOLEAN
567 -- We need to choose again the file
568
569 build_deleting_dialog is
570 -- Build the dialog displayed to have the user wait during the
571 -- deletion of a directory.
572 local
573 label_font: EV_FONT
574 pixmap: EV_PIXMAP
575 hb: EV_HORIZONTAL_BOX
576 vb: EV_VERTICAL_BOX
577 pixmap_box: EV_CELL
578 button_box: EV_HORIZONTAL_BOX
579 cancel_button: EV_BUTTON
580 do
581 -- Create and display a dialog to have the user wait.
582 pixmap := (create {EV_STOCK_PIXMAPS}).Information_pixmap.twin
583 create pixmap_box
584 pixmap_box.extend (pixmap)
585 pixmap_box.set_minimum_size (pixmap.width, pixmap.height)
586
587 create deleting_dialog_label
588 deleting_dialog_label.align_text_left
589 deleting_dialog_label.set_text (Interface_names.l_deleting_dialog_default)
590 label_font := deleting_dialog_label.font
591 deleting_dialog_label.set_minimum_size (
592 label_font.width * minimum_width_of_deleting_dialog,
593 label_font.height * minimum_height_of_deleting_dialog
594 )
595
596 create cancel_button.make_with_text (Interface_names.b_cancel)
597 Layout_constants.set_default_size_for_button (cancel_button)
598 cancel_button.select_actions.extend (agent on_cancel_button_pushed)
599
600 create hb
601 hb.set_border_width (Layout_constants.Default_border_size)
602 hb.set_padding (Layout_constants.Default_padding_size)
603 hb.extend (pixmap_box)
604 hb.disable_item_expand (pixmap_box)
605 hb.extend (deleting_dialog_label)
606
607 create button_box
608 button_box.set_padding (Layout_constants.Default_padding_size)
609 button_box.set_border_width (Layout_constants.Default_border_size)
610 button_box.extend (create {EV_CELL})
611 button_box.extend (cancel_button)
612 button_box.disable_item_expand (cancel_button)
613 button_box.extend (create {EV_CELL})
614
615 create vb
616 vb.extend (hb)
617 vb.extend (button_box)
618 vb.disable_item_expand (button_box)
619
620 create deleting_dialog
621 deleting_dialog.extend (vb)
622 deleting_dialog.set_default_cancel_button (cancel_button)
623 deleting_dialog.set_title (Interface_names.t_deleting_files)
624 deleting_dialog.set_icon_pixmap (pixmaps.icon_pixmaps.general_dialog_icon)
625 deleting_dialog.show_relative_to_window (parent_window)
626 end
627
628 on_delete_directory (deleted_files: ARRAYED_LIST [STRING]) is
629 -- The files in `deleted_files' have just been deleted.
630 -- Display
631 local
632 ise_directory_utils: ISE_DIRECTORY_UTILITIES
633 deleted_file_pathname: STRING
634 do
635 if deleting_dialog = Void then
636 build_deleting_dialog
637 end
638 create ise_directory_utils
639 deleted_file_pathname := ise_directory_utils.path_ellipsis (deleted_files.first, Path_ellipsis_width)
640 check
641 deleting_dialog_label_exists: deleting_dialog_label /= Void
642 end
643 deleting_dialog_label.set_text (deleted_file_pathname)
644 deleting_dialog_label.refresh_now
645 ev_application.process_events
646 end
647
648 on_cancel_button_pushed is
649 -- The user has just pushed the "Cancel" in the deleting dialog.
650 do
651 is_deletion_cancelled := True
652 end
653
654 on_cancel_operation: BOOLEAN is
655 -- Has the user pushed the "Cancel" in the deleting dialog?
656 do
657 Result := is_deletion_cancelled
658 end
659
660 on_select_button_pushed (a_dlg: EV_DIALOG; a_list: EV_LIST) is
661 -- Action when user click Select button for a target.
662 require
663 a_dlg_not_void: a_dlg /= Void
664 a_dlg_not_destroyed: not a_dlg.is_destroyed
665 a_list_not_void: a_list /= Void
666 a_list_not_destroyed: not a_list.is_destroyed
667 do
668 if a_list.selected_item /= Void then
669 target_name := a_list.selected_item.text
670 a_dlg.destroy
671 end
672 ensure
673 target_name_set: old a_list.selected_item /= Void implies (target_name /= Void)
674 end
675
676 on_target_selected (a_dlg: EV_DIALOG; a_item: EV_LIST_ITEM) is
677 -- Action when user select a target with a double click.
678 require
679 a_dlg_not_void: a_dlg /= Void
680 a_dlg_not_destroyed: not a_dlg.is_destroyed
681 a_item_not_void: a_item /= Void
682 a_item_not_destroyed: not a_item.is_destroyed
683 do
684 target_name := a_item.text
685 a_dlg.destroy
686 end
687
688 on_cancelled (a_dlg: EV_DIALOG) is
689 -- Action when user select a target with a double click.
690 require
691 a_dlg_not_void: a_dlg /= Void
692 do
693 has_error := True
694 if not a_dlg.is_destroyed then
695 a_dlg.destroy
696 end
697 end
698
699
700 feature {NONE} -- Implementation / Private constants.
701
702 minimum_width_of_deleting_dialog: INTEGER is 70
703 -- Minimum width of the deleting dialog in characters.
704
705 minimum_height_of_deleting_dialog: INTEGER is 2
706 -- Minimum height of the deleting dialog in characters.
707
708 Path_ellipsis_width: INTEGER is
709 -- Maximum number of characters per item.
710 once
711 Result := minimum_width_of_deleting_dialog - 10
712 end
713
714 invariant
715 parent_window_not_void: parent_window /= Void
716 parent_window_not_destroyed: not parent_window.is_destroyed
717
718 indexing
719 copyright: "Copyright (c) 1984-2006, Eiffel Software"
720 license: "GPL version 2 (see http://www.eiffel.com/licensing/gpl.txt)"
721 licensing_options: "http://www.eiffel.com/licensing"
722 copying: "[
723 This file is part of Eiffel Software's Eiffel Development Environment.
724
725 Eiffel Software's Eiffel Development Environment is free
726 software; you can redistribute it and/or modify it under
727 the terms of the GNU General Public License as published
728 by the Free Software Foundation, version 2 of the License
729 (available at the URL listed under "license" above).
730
731 Eiffel Software's Eiffel Development Environment is
732 distributed in the hope that it will be useful, but
733 WITHOUT ANY WARRANTY; without even the implied warranty
734 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
735 See the GNU General Public License for more details.
736
737 You should have received a copy of the GNU General Public
738 License along with Eiffel Software's Eiffel Development
739 Environment; if not, write to the Free Software Foundation,
740 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
741 ]"
742 source: "[
743 Eiffel Software
744 356 Storke Road, Goleta, CA 93117 USA
745 Telephone 805-685-1006, Fax 805-685-6869
746 Website http://www.eiffel.com
747 Customer support http://support.eiffel.com
748 ]"
749 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date ID Revision

  ViewVC Help
Powered by ViewVC 1.1.23