home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Examples / DatabaseKit / OracleDemo / Controller.m < prev    next >
Text File  |  1992-07-09  |  977b  |  35 lines

  1. /* Controller.m:
  2.  * You may freely copy, distribute, and reuse the code in this example.
  3.  * NeXT disclaims any warranty of any kind, expressed or  implied, as to its
  4.  * fit for any particular use.
  5.  *
  6.  * Written by Mai Nguyen, NeXT Developer Support
  7.  *
  8.  */
  9.  
  10. #import "Controller.h"
  11. #import    <dbkit/dbkit.h>
  12. #import <libc.h>
  13.  
  14. /* Define localized strings */
  15. #define INSTALL_MODEL NXLocalizedString("Please install OracleDemo.dbmodel into your ~/Library/Databases directory and restart.", NULL, "Notify user that SybaseDemo.dbmodel must be installed in his local Databases directory.")
  16.  
  17. @implementation Controller
  18.  
  19. /* Extract the actual database and recordlist from the DBModule UI Object
  20.  */ 
  21. -appDidInit:sender
  22. {
  23.         /* Notify the user if the database can't be found */
  24.     if (![DBDatabase findDatabaseNamed:"OracleDemo" connect:YES]) {
  25.         NXRunAlertPanel(NULL, INSTALL_MODEL, "OK", NULL, NULL);
  26.         return self;
  27.     }    
  28.           
  29.     [theWindow makeKeyAndOrderFront:nil];
  30.     return self;
  31. }
  32.  
  33. @end
  34.  
  35.