/* GTK-based UI $Id: gtk_ui.c,v 1.97 2004/05/12 01:45:22 megastep Exp $ */ /* Modifications by Borland/Inprise Corp. 04/11/2000: Added check in check_install_button to see if install and binary path are the same. If so, leave install button disabled and give user a message. 04/17/2000: Created two new GladeXML objects, one for the readme dialog, the other for the license dialog and modified gtkui_init, setup_button_view_readme_slot and gtkui_license to create & use these new objects. Created 2 new handlers for destroy events on the readme and license dialogs. This was done to fix problems when the user uses the 'X' button in the upper right corner instead of the Close, Cancel or Agree buttons. For the readme, setup would seg fault if the user tried to open the readme dialog a second time. For the license, setup would stop responding. The setup.glade file was modified to include destroy handlers for the readme_dialog and license_dialog widgets. Added code to gtkui_complete to clean up the GladeXML objects. 04/21/2000: Cleaned up a bit too much, too soon in gtkui_complete. Removed the gtk_object_unref for setup_glade because it's still in use by the Play Now button if uid is root... 04/28/2000: More cleanup problems. Can't unref the gtk objects in gtkui_complete...too much is still in use. Maybe make a cleanup routine that gets called by the exit and play button handlers. Added code to disable the View Readme button (all 3 of them) when it is clicked. That way, the user can have only 1 instance of the readme dialog. Multiple instances was causing a problem for the destroy routine. Destroying the latest instance worked OK. Destroying the others caused a seg fault. Readme buttons are re-enabled when the dialog is closed. Cleaned up close_view_readme_slot to avoid the duplication with destroy_view_readme. close now just calls destroy. 05/12/2000: Changed the way the focus mechanism works for the install path and binary path fields and how the Begin Install button gets enabled/disabled. There were ways in which an invalid path could be selected from the combo boxes and the Begin Install button would not be disabled until the user clicked on it. Then, the mouse focus was on an insensitive item, making it appear that the UI locked up. Here's the changes: Modified gtkui_init to add signal handlers for the keypress and mouse button release events for both the install path and binary path fields. Also added these functions to handle the signals: path_entry_keypress_slot, path_combo_change_slot, binary_path_entry_keypress_slot, binary_path_combo_change_slot. The "keypress" slots evaluate the status of the Begin Install button after every keystroke when the user is typing a pathname. The "combo_change" slots evaluate the status of the button when- ever the user makes a selection from the drop-down list. Modified setup.glade to remove the signal handlers that grabbed the focus when the mouse was passed over these fields. Modified gtkui_prompt to add a RESPONSE_OK option and modifed the yesno_answer structure to support this. This will display a dialog with a message and a single OK button. This was a result of one of the (many) failed attempts to fix the focus issue. It turns out that I don't use this anywhere anymore, but I figured I'd leave it for someone who wants to display a simple message without using the gnome libs. To use it, just pass RESPONSE_OK as the last parameter. 05/17/2000: Modified gtkui_init to disable the install path or binary path widgets if the value was passed in as a command-line parameter (see main.c for the new -i and -b options). 06/02/2000: Modified gtkui_update to make sure the progress bar object is never sent an invalid value. If the