cocoapsql-developer Mailing List for Cocoa PSQL (Page 2)
Status: Alpha
Brought to you by:
alkirkus
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(27) |
Jun
(21) |
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
(1) |
Dec
|
---|
From: Al K. <al...@ki...> - 2002-05-31 11:28:08
|
Hi Olaf. I have modified the PSQLTextView.m to perform the message dispatching using selectors, if they exist, to the methods which you are trying to invoke. This way there are no compiler warnings and the object remains portable. I have commited the change. Let me know if you see any problems doing it this way. See ya, Al On Friday, May 31, 2002, at 02:47 AM, Olaf van Oudenallen wrote: > On compiling the PSQLTextView there are two "Can't find method" > warnings about the psqlTexViewDidBecomeFirstResponder and > psqlTexViewDidResignFirstResponder. > > To make the PSQLTextView class portable and reusable I did not #import > the PSQLController class. The messages are send to the view's delegate. > The methods will be found at runtime. If not, I thought that sending a > message to nil is not disturbing. On the other hand, the PSQLTextView > class will be reused only for the purpose of enjoying these messages > so these methods will be implemented when reusing the class. > > Am I right? Olaf > > On vrijdag, mei 31, 2002, at 04:46 , Al Kirkus wrote: > >> By the way olaf there are a few warning messages popping up during the >> compile, is there anything I need to do for these? > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Cocoapsql-developer mailing list > Coc...@li... > https://lists.sourceforge.net/lists/listinfo/cocoapsql-developer |
From: Olaf v. O. <ol...@ad...> - 2002-05-31 10:29:34
|
On compiling the PSQLTextView there are two "Can't find method" warnings about the psqlTexViewDidBecomeFirstResponder and psqlTexViewDidResignFirstResponder. To make the PSQLTextView class portable and reusable I did not #import the PSQLController class. The messages are send to the view's delegate. The methods will be found at runtime. If not, I thought that sending a message to nil is not disturbing. On the other hand, the PSQLTextView class will be reused only for the purpose of enjoying these messages so these methods will be implemented when reusing the class. Am I right? Olaf On vrijdag, mei 31, 2002, at 04:46 , Al Kirkus wrote: > By the way olaf there are a few warning messages popping up during the > compile, is there anything I need to do for these? |
From: Al K. <al...@ki...> - 2002-05-31 02:46:37
|
Hi all. I made a small adjustment to the pb project file regarding the location of the connprefs.nib. This now works for me including the recent changes and the custom view that Olaf made. I just cvs checkout and compile and all is well. By the way olaf there are a few warning messages popping up during the compile, is there anything I need to do for these? Let me know, Al |
From: Ted P. <te...@sy...> - 2002-05-31 02:25:10
|
I am set up as follows /usr/local/pgsql/lib /usr/local/pgsql/include 1. from the 'files' tab drill down the frameworks => linked frameworks delete the reference to libpq.a 2. targets tab ... files and build section.... delete any reference to libpq.a 3. targets tab build settings CC compiler settings other compiler flags add this line -I/usr/local/pgsql/include Linker settings other linker flags add this line -L/usr/local/pgsql/lib -lpq at the bottom of this area: Search Paths: remove any reference to sw.... from two places (headers and libraries) so they only show a reference to /usr/local/pgsql/include and /lib.... then clean all targets.... and do a build. PB will now look only to the other paths for libpq.a. good luck Ted -----Original Message----- From: Olaf van Oudenallen <ol...@ad...> To: "Ted Petrosky" <te...@sy...> Date: Thu, 30 May 2002 16:49:49 +0200 Subject: Re: [Cocoapsql-developer] commit; Libpq.a and libpq-fe.h; referencing files and using search path > Hi Ted, > > Thanks for your reply on this issue. > Her is what I did: > Place a copy of the libpq.a in the Cocoapsql folder > Change the path to the existing libpq.a file to ./Cocoapsql > Clean the target > Remove the libpq.a file form the ./Cocoapsql folder > >> now the linker should find the libpq.a file through the > LIBRARY_SEARCH_PATH path(es) > Build: error... can find libpq.a > > Headers are found with the help of the HEADER_SEARCH_PATH path. I wonder > why the lib is not found. > |
From: Olaf v. O. <ol...@ad...> - 2002-05-30 21:09:51
|
- By replacing the queryScrollView's NSTextView with my subclass PSQLTextView, I enabled the use of the (queryScrollView-) NSTextView's becomeFirstResponder and resignFirstResponder for the purpous of registering when the View becoms and resings FirstResponder. With these 'notifications' I am able to set and reset the commitButton's keyequivalent properly so that the commitButton looks like the default button only when the view is FirstResponder. To have the submitButton actually act on RETURN or ENTER when the queryView is FirstResponder we need to send the button a performClick from within the - (void)textDidEndEditing:(NSNotification *)aNotification. => Modified the MainMenu.nib: Submitt button now has no keyequivalent (when first displaying the window) => Added PSQTextView to the project => Added to PSQLController.m #import "PSQLTextView.h" => Added to PSQLControler: /* gets invoked by the custom subclass PSQLTextView Therefore this file needs to be the delegate of the View */ -(void)psqlTextViewDidBecomeFirstResponder:(id)sender { if (sender == querySpace) [submitButton setKeyEquivalent:@"\r"]; } /* gets invoked by the custom subclass PSQLTextView Therefore this file needs to be the delegate of the View */ -(void)psqlTextViewDidResignFirstResponder:(id)sender { if (sender == querySpace) [submitButton setKeyEquivalent:@""]; } Added to the beginning of the -(void)awakeFromNib /* replacing the querySpace ScrollView's TextView with an instance of PSQLTextView to receive psqlTextViewDidBecomeFirstResponder and psqlTextViewDidResignFirstResponder messages */ id queryScrollView = [querySpace enclosingScrollView]; NSSize queryScrollViewSize = [queryScrollView contentSize]; // replace NSScrollView's NSTextView with MyTextView querySpace = [[PSQLTextView alloc] initWithFrame:NSMakeRect(0,0, queryScrollViewSize.width, queryScrollViewSize.height)]; [querySpace setMinSize:NSMakeSize(0.0,queryScrollViewSize.height)]; [querySpace setMaxSize:NSMakeSize(1e7,1e7)]; [querySpace setVerticallyResizable:YES]; [querySpace setHorizontallyResizable:NO]; [querySpace setAutoresizingMask:NSViewWidthSizable]; [queryScrollView setDocumentView:querySpace]; [querySpace release]; // as theScrollView retains the TextView [querySpace setDelegate:[mainWindow delegate]]; // restore the delegate connection /* end of replacing the querySpace TextView */ --- => Added to PSQLController - (void)textDidEndEditing:(NSNotification *)aNotification{ /* the querySpace TextView does end editing on RETURN or ENTER while (in awakeFromNib) the view's FieldEditor is set to YES ([querySpace setFieldEditor:YES])*/ NSEvent *event = [NSApp currentEvent]; if( [aNotification object]== querySpace ){ //fire the Window's default button's action on RETURN or ENTER if ( ([event keyCode] == 36 |[event keyCode] == 76) || [event type] == NSKeyUp) { [submitButton performClick:self]; // stay in the TextView for new queries to enter and execute: [mainWindow makeFirstResponder:querySpace]; } } } --- => Added to the end of -(void) doConnect [self setWindowTitle]; => Added to the end of -(void) doDisconnect{ if([connection connected]) [self setWindowTitle] => Added to the end of -(void)awakeFromNib [self setWindowTitle] => Added to PSQLControler: -(void)setWindowTitle { NSString *titleAdd; if([connection connected]) titleAdd = [NSString stringWithFormat:@"%@",@"(Connected)"]; else titleAdd = [NSString stringWithFormat:@"%@",@"(Not Connected)"]; if([[status dbName] isEqualToString:@""]) [mainWindow setTitle:@"(No Database Name)"]; else [mainWindow setTitle:[NSString stringWithFormat:@"%@ at host %@ %@",[status dbName],[status hostName],titleAdd]]; } |
From: Olaf v. O. <ol...@ad...> - 2002-05-30 19:22:07
|
I will start working on custom view for queryView involving ManMenu.nib and PSQLController. Goal is to set query's Submitbutton to have / not have RETURN an ENTER as key-equivalent. Further I will see that on return the query will be executed and the queryView stays key |
From: Olaf v. O. <ol...@ad...> - 2002-05-30 19:22:05
|
I have tried to update the repositry so that now there should be an localised copy of the ConnPrefs.nib in the Englis.lproj folder to update. The repositry (online .html) still doesn't reflect this assumed situation. And there is still a ConnPrefs.nib in the Cocoapsql folder. Hope your copy of the project doesn't complain about the missing ConnPrefs.nib anymore. Plase let me know. Olaf On donderdag, mei 30, 2002, at 01:04 , Ted Petrosky wrote: > > I must always 'clean' the PB project after changing any of the paths. > So that > has been my MO. Get the CVS, open the project, check the paths, 'clean > all'. > Usually this fixes any problems > > Ted > > > > -----Original Message----- > From: Olaf van Oudenallen <ol...@ad...> > To: coc...@li... > Date: Wed, 29 May 2002 19:34:42 +0200 > Subject: [Cocoapsql-developer] commit; Libpq.a and libpq-fe.h; > referencing > files and using search path > >> Libpq.a and libpq-fe.h; referencing files and using search path >> As I have postgresql installed in (subdirectiries of) /usr/local/pgsql/ >> The current targets settings for HEADER Search Path do not work for me. >> So I have added the Search Path: >> to HEADER: /usr/local/pgsql/include/ >> >> Hard coding an included library is another problem (for me): >> build-error: >> MasterObjectFile.Combine /Developer/TVOproducts/Cocoa Psql.build/ > Cocoa >> Psql.build/Objects-normal/ProjectBuilderMasterObjectFile.o >> ...skipped Cocoa Psql.app/Contents/MacOS/Cocoa Psql for lack of >> /sw/lib/libpq.a... >> Therefore I wonder if files to be included can be added without a path. >> Any way I used to get away with adding some folders (/sw/lib/) and an >> alias to have the libpq.a being included in the project. Now I had to >> make a copy of the file and place it in the folder /sw/lib/ >> As this is not the right solution, we stick with the (default) >> reference >> to /usr/local/pgsql/lib/libpq.a >> I keep wondering though why the LIBRAY_SEARCH_PATH doesn't find the > lib. >> > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Cocoapsql-developer mailing list > Coc...@li... > https://lists.sourceforge.net/lists/listinfo/cocoapsql-developer |
From: Olaf v. O. <ol...@ad...> - 2002-05-30 17:11:49
|
Hi Ted, Thanks for your reply on this issue. Her is what I did: Place a copy of the libpq.a in the Cocoapsql folder Change the path to the existing libpq.a file to ./Cocoapsql Clean the target Remove the libpq.a file form the ./Cocoapsql folder >> now the linker should find the libpq.a file through the LIBRARY_SEARCH_PATH path(es) Build: error... can find libpq.a Headers are found with the help of the HEADER_SEARCH_PATH path. I wonder why the lib is not found. I added a copy of the libpq.a in another (different) folder with the Search Path reference option. The Search Path was added to the LIBRARY_SEARCH_PATH but the file ("info") still had an absolute path. So that didn't help either. I would appreciate your contribution. Thanks, Olaf On donderdag, mei 30, 2002, at 01:04 , Ted Petrosky wrote: > > I must always 'clean' the PB project after changing any of the paths. > So that > has been my MO. Get the CVS, open the project, check the paths, 'clean > all'. > Usually this fixes any problems > > Ted > > > > -----Original Message----- > From: Olaf van Oudenallen <ol...@ad...> > To: coc...@li... > Date: Wed, 29 May 2002 19:34:42 +0200 > Subject: [Cocoapsql-developer] commit; Libpq.a and libpq-fe.h; > referencing > files and using search path > >> Libpq.a and libpq-fe.h; referencing files and using search path >> As I have postgresql installed in (subdirectiries of) /usr/local/pgsql/ >> The current targets settings for HEADER Search Path do not work for me. >> So I have added the Search Path: >> to HEADER: /usr/local/pgsql/include/ >> >> Hard coding an included library is another problem (for me): >> build-error: >> MasterObjectFile.Combine /Developer/TVOproducts/Cocoa Psql.build/ > Cocoa >> Psql.build/Objects-normal/ProjectBuilderMasterObjectFile.o >> ...skipped Cocoa Psql.app/Contents/MacOS/Cocoa Psql for lack of >> /sw/lib/libpq.a... >> Therefore I wonder if files to be included can be added without a path. >> Any way I used to get away with adding some folders (/sw/lib/) and an >> alias to have the libpq.a being included in the project. Now I had to >> make a copy of the file and place it in the folder /sw/lib/ >> As this is not the right solution, we stick with the (default) >> reference >> to /usr/local/pgsql/lib/libpq.a >> I keep wondering though why the LIBRAY_SEARCH_PATH doesn't find the > lib. >> > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Cocoapsql-developer mailing list > Coc...@li... > https://lists.sourceforge.net/lists/listinfo/cocoapsql-developer |
From: Al K. <al...@ki...> - 2002-05-30 13:21:45
|
Olaf and I are working on this. Something went wrong with the commits. Hopefully we will have an answer soon. See ya, Al On Thursday, May 30, 2002, at 07:47 AM, Ted Petrosky wrote: > I just tried to get the current CVS with > > cvs -d:pserver:ano...@cv...:/cvsroot/ > cocoapsql checkout cocoapsql > > in the terminal. everything went ok but when I try to build the app, i > get an error > about : ConnPrefs.nib > > I can not double click the nib file in PB. There is a red '?' > > I have to run to the office now. > > Ted > > |
From: Ted P. <te...@sy...> - 2002-05-30 11:06:29
|
I must always 'clean' the PB project after changing any of the paths. So that has been my MO. Get the CVS, open the project, check the paths, 'clean all'. Usually this fixes any problems Ted -----Original Message----- From: Olaf van Oudenallen <ol...@ad...> To: coc...@li... Date: Wed, 29 May 2002 19:34:42 +0200 Subject: [Cocoapsql-developer] commit; Libpq.a and libpq-fe.h; referencing files and using search path > Libpq.a and libpq-fe.h; referencing files and using search path > As I have postgresql installed in (subdirectiries of) /usr/local/pgsql/ > The current targets settings for HEADER Search Path do not work for me. > So I have added the Search Path: > to HEADER: /usr/local/pgsql/include/ > > Hard coding an included library is another problem (for me): build-error: > MasterObjectFile.Combine /Developer/TVOproducts/Cocoa Psql.build/ Cocoa > Psql.build/Objects-normal/ProjectBuilderMasterObjectFile.o > ...skipped Cocoa Psql.app/Contents/MacOS/Cocoa Psql for lack of > /sw/lib/libpq.a... > Therefore I wonder if files to be included can be added without a path. > Any way I used to get away with adding some folders (/sw/lib/) and an > alias to have the libpq.a being included in the project. Now I had to > make a copy of the file and place it in the folder /sw/lib/ > As this is not the right solution, we stick with the (default) reference > to /usr/local/pgsql/lib/libpq.a > I keep wondering though why the LIBRAY_SEARCH_PATH doesn't find the lib. > |
From: Olaf v. O. <ol...@ad...> - 2002-05-29 19:39:30
|
Auto set the 'Connect', 'Disconnect' and 'Export' menu items enabled/disabled: I added the actions to the first responder of MainMenu.nib menuConnect: menuDisconnect: raiseConnectionSettingsWindow: doExportMenuAction: (for consistancy reasons) and reconnected the Connection-menu items to these actions in the first responder. To auto Enable menuItems, I have made PSQLController the delagate of the mainWindow. Added to PSQLController.m - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { SEL action = [menuItem action]; if (action==@selector(menuConnect:) && [connection connected]) { return NO; } else if (action==@selector(menuDisconnect:) && ![connection connected]) { return NO; } else if (action==@selector(doExportMenuAction:) && ![tableView numberOfRows] > 0) { return NO; } else { return YES; } } |
From: Olaf v. O. <ol...@ad...> - 2002-05-29 19:39:29
|
Changed #include <postgresql/libpq-fe.h> to #import <libpq-fe.h> As #import is the default for Cocoa (and better as the libs get loaded only once now), I changed #include to #import. As I get an error on compiling PSQLController.m (header file 'postgresql/libpq-fe.h' not found) I changed <postgresql/libpq-fe.h> in <libpq-fe.h> So in the following files: change #include <postgresql/libpq-fe.h> into #import <libpq-fe.h> in the following files: PSQLConnection.h PSQLQuery.h |
From: Olaf v. O. <ol...@ad...> - 2002-05-29 19:39:28
|
The ConnPrefs.nib is now officially English |
From: Olaf v. O. <ol...@ad...> - 2002-05-29 19:39:28
|
Hi Al, I have not yet figured out what is the problem. I ran the update again as for the following error but that did not help. [imac:~/public/cvsprojects/cocoapsql] olaf% cvs commit cvs commit: Examining . cvs commit: Examining Cocoa Psql.pbproj cvs commit: Examining ConnPrefs.nib cvs commit: Examining English.lproj cvs commit: Examining English.lproj/MainMenu.nib cvs commit: Examining English.lproj/MainMenu~.nib cvs commit: in directory English.lproj/MainMenu~.nib: cvs [commit aborted]: there is no version here; do 'cvs checkout' first Maybe it has to do with the localised (and moved) ConnPrefs.nib Before the above commit I tried [imac:cvsprojects/cocoapsql/english.lproj] olaf% cvs add English.lproj/ConnPrefs.nib ol...@cv...'s password: cvs [add aborted]: no such directory `English.lproj' and [imac:~/public/cvsprojects/cocoapsql] olaf% cvs delete ConnPrefs.nib ol...@cv...'s password: cvs server: Removing ConnPrefs.nib cvs [server aborted]: could not chdir to ConnPrefs.nib: No such file or directory No commit for now |
From: Olaf v. O. <ol...@ad...> - 2002-05-29 19:39:28
|
Libpq.a and libpq-fe.h; referencing files and using search path As I have postgresql installed in (subdirectiries of) /usr/local/pgsql/ The current targets settings for HEADER Search Path do not work for me. So I have added the Search Path: to HEADER: /usr/local/pgsql/include/ Hard coding an included library is another problem (for me): build-error: MasterObjectFile.Combine /Developer/TVOproducts/Cocoa Psql.build/Cocoa Psql.build/Objects-normal/ProjectBuilderMasterObjectFile.o ...skipped Cocoa Psql.app/Contents/MacOS/Cocoa Psql for lack of /sw/lib/libpq.a... Therefore I wonder if files to be included can be added without a path. Any way I used to get away with adding some folders (/sw/lib/) and an alias to have the libpq.a being included in the project. Now I had to make a copy of the file and place it in the folder /sw/lib/ As this is not the right solution, we stick with the (default) reference to /usr/local/pgsql/lib/libpq.a I keep wondering though why the LIBRAY_SEARCH_PATH doesn't find the lib. |
From: Olaf v. O. <ol...@ad...> - 2002-05-29 19:39:27
|
Commited file by file Have trouble adding Cocoapsql/English.lproj/ConnPrefs.nib and deleting Cocoapsql/ConnPrefs.nib Commit was not completed because of the Cocoa psql.pbproj (with a space in the name)? or, more likely, on the discrepancy of the ConnPrefs.nib |
From: Al K. <al...@ki...> - 2002-05-29 15:03:07
|
Hi Olaf. As it happens, due to the power of Cocoa the export sheet could not have been easier to create!!!! The entire export facility only took about 1.5 hours total time to read the docs, learn how to do it, design and code. I like Cocoa and objective-C!!!! As for the question about the cvs update before commit: I ran into a problem using an update command one time. As the CVS is text based and it tries to address differences in files in the text domain it can really screw up binary files, like the actual project files!!! I trashed a project file by doing an update on something I worked on on another machine and then I really had to play games to get everything working correctly again. I recommend simply doing the commit instead of an update and go from there. I have not made any changes since you checked out the source so your commits should be simple. I am going to look into how we can keep the binary files (project definitions, nibs, other resource files) from getting trashed via CVS. I am sure there is a solution but I just have to find it. (Read, Read, Read, Read, Read, Read). Hope you are having a great day!! See ya, Al On Wednesday, May 29, 2002, at 02:48 AM, Olaf van Oudenallen wrote: > Hi Al. Thanks for your complete reply! > > First of all: your Export sheet works nice (and looks as if you have > spent a lot of time creating the sheet)! I have added a > validateMenuItem for this menuItem, bases on [tableView numberOfRows] > > 0. > > I subscribed to the cocoapsql-developer list so now I received your > mail twice. Once addressed directly to olaf@adm..... and once as the > subscriber of cocoapsql-developer list. So I suggest you send project > relative mail, with historical value, to the list and (all your other > nice mail) to me personally. > > I will alter the included library/framework libpq.q to be the one in > /usr/local/psql/lib/ and add to the HEADER Search Path > /usr/local/pgsql/include/ /* for me */ > and /sw/include/postgresql/ /* for you to have libpq-fe.h included*/ > > I agree on the FirstResponder / NSWindowController issue. I planned to > make the application (sort off?) multi document as soon as I have added > my changes to the repository. I don't now yet how but I guess splitting > the PSQLController to PSQLController as a subclass of > NSWindowController and PSQLAppController. (So I will add PSQL to the > existing AppController.h an .m names) and move the windows and sheets > so we will be able to open multiple Connection windows and multiple > (future) Manager windows, reflecting the database structure etc.) > Do you agree on leaving the structure as it is (with PSQLController > being the delegate of teh window) for the moment? > > I guess owr time-difference is 7 hrs. (we have daylight saving time > now). Here it's about 09:45. I will see that I commit tonight. > > Am I right that I don's HAVE to update before committing. As I > understood, on committing I will be prompted for eventual conflicts to > be solved. > > See you, Olaf > > On woensdag, mei 29, 2002, at 03:21 , Al Kirkus wrote: > >> Hi Olaf. >> >> You have a good point here. We should not assume any particular >> directory structure other than maybe the default imposed by the >> postgres package itself. Ideally it would be good if there was a way >> for project builder to reference an environment variable which we >> could set to point to the postgres installation directory if it >> differed from the default location, but I don't know if we can do >> that. I believe that the default location is /usr/local/pgsql just as >> you have it. Bottom line, I think that your path settings should be >> the default and we who do not have standard installation locations, >> because we used fink or whatever other reason, should be forced to >> deal with it. I think you should set project builder to reference >> postgres relevant includes in /usr/local/pgsql/include and relavent >> libraries in /usr/local/pgsql/lib. >> >> As for the second item relating to the the import statement, this goes >> directly to the path issue above. When postgres installed via fink it >> created a postgresql/ directory under /include. Since I was >> referencing the generic /include header directory I needed to include >> the /postgresql/ as part of the path name. You should double check but >> I believe that when a default install to /usr/local/pgsql is done, the >> relevant headers wind up in /usr/local/pgsql/include. If this is >> correct then your change is exactly right. As for the import, include >> discussion, you are correct. I only used the #include as a cue to >> myself to remember that these were postgres specific items written in >> ANSI C and not an objective C header. >> >> I have no problem with either change!! >> >> >> As for the third item, your code looks like it will work but there is >> a larger mistake here that needs to be corrected to save a lot of >> future work. I wanted to discus this with you. As I began learning >> Cocoa from the Aaron Hilegass book his examples did not explain the >> responder chain and the related concepts until later. I had already >> begun coding this program. Simply put I believe that the >> PSQLController should be coded as a subclass of NSWindowController >> instead of the simple NSObject and be made the delegate of the >> relevant windows. Then the First responder object needs to be modified >> by adding the relevant action methods reflecting the code that is >> already present in the PSQLController object. Once done the >> PSQLController will automatically be the first responder whenever it >> is key and the menus will automatically activate/deactivate as needed. >> There may still be a small issue with the connect/disconnect menu >> items but everything else should work OK, I think? >> >> I hope that last part made some sense to you as I am having trouble >> keeping it all straight myself. >> >> Let me know what you think, Al |
From: Olaf v. O. <ol...@ad...> - 2002-05-29 07:58:08
|
Hi Al. Thanks for your complete reply! First of all: your Export sheet works nice (and looks as if you have spent a lot of time creating the sheet)! I have added a validateMenuItem for this menuItem, bases on [tableView numberOfRows] > 0. I subscribed to the cocoapsql-developer list so now I received your mail twice. Once addressed directly to olaf@adm..... and once as the subscriber of cocoapsql-developer list. So I suggest you send project relative mail, with historical value, to the list and (all your other nice mail) to me personally. I will alter the included library/framework libpq.q to be the one in /usr/local/psql/lib/ and add to the HEADER Search Path /usr/local/pgsql/include/ /* for me */ and /sw/include/postgresql/ /* for you to have libpq-fe.h included*/ I agree on the FirstResponder / NSWindowController issue. I planned to make the application (sort off?) multi document as soon as I have added my changes to the repository. I don't now yet how but I guess splitting the PSQLController to PSQLController as a subclass of NSWindowController and PSQLAppController. (So I will add PSQL to the existing AppController.h an .m names) and move the windows and sheets so we will be able to open multiple Connection windows and multiple (future) Manager windows, reflecting the database structure etc.) Do you agree on leaving the structure as it is (with PSQLController being the delegate of teh window) for the moment? I guess owr time-difference is 7 hrs. (we have daylight saving time now). Here it's about 09:45. I will see that I commit tonight. Am I right that I don's HAVE to update before committing. As I understood, on committing I will be prompted for eventual conflicts to be solved. See you, Olaf On woensdag, mei 29, 2002, at 03:21 , Al Kirkus wrote: > Hi Olaf. > > You have a good point here. We should not assume any particular > directory structure other than maybe the default imposed by the > postgres package itself. Ideally it would be good if there was a way > for project builder to reference an environment variable which we could > set to point to the postgres installation directory if it differed from > the default location, but I don't know if we can do that. I believe > that the default location is /usr/local/pgsql just as you have it. > Bottom line, I think that your path settings should be the default and > we who do not have standard installation locations, because we used > fink or whatever other reason, should be forced to deal with it. I > think you should set project builder to reference postgres relevant > includes in /usr/local/pgsql/include and relavent libraries in > /usr/local/pgsql/lib. > > As for the second item relating to the the import statement, this goes > directly to the path issue above. When postgres installed via fink it > created a postgresql/ directory under /include. Since I was referencing > the generic /include header directory I needed to include the > /postgresql/ as part of the path name. You should double check but I > believe that when a default install to /usr/local/pgsql is done, the > relevant headers wind up in /usr/local/pgsql/include. If this is > correct then your change is exactly right. As for the import, include > discussion, you are correct. I only used the #include as a cue to > myself to remember that these were postgres specific items written in > ANSI C and not an objective C header. > > I have no problem with either change!! > > > As for the third item, your code looks like it will work but there is a > larger mistake here that needs to be corrected to save a lot of future > work. I wanted to discus this with you. As I began learning Cocoa from > the Aaron Hilegass book his examples did not explain the responder > chain and the related concepts until later. I had already begun coding > this program. Simply put I believe that the PSQLController should be > coded as a subclass of NSWindowController instead of the simple > NSObject and be made the delegate of the relevant windows. Then the > First responder object needs to be modified by adding the relevant > action methods reflecting the code that is already present in the > PSQLController object. Once done the PSQLController will automatically > be the first responder whenever it is key and the menus will > automatically activate/deactivate as needed. There may still be a small > issue with the connect/disconnect menu items but everything else should > work OK, I think? > > I hope that last part made some sense to you as I am having trouble > keeping it all straight myself. > > Let me know what you think, Al |
From: Al K. <al...@ki...> - 2002-05-29 01:21:36
|
Hi Olaf. You have a good point here. We should not assume any particular directory structure other than maybe the default imposed by the postgres package itself. Ideally it would be good if there was a way for project builder to reference an environment variable which we could set to point to the postgres installation directory if it differed from the default location, but I don't know if we can do that. I believe that the default location is /usr/local/pgsql just as you have it. Bottom line, I think that your path settings should be the default and we who do not have standard installation locations, because we used fink or whatever other reason, should be forced to deal with it. I think you should set project builder to reference postgres relevant includes in /usr/local/pgsql/include and relavent libraries in /usr/local/pgsql/lib. As for the second item relating to the the import statement, this goes directly to the path issue above. When postgres installed via fink it created a postgresql/ directory under /include. Since I was referencing the generic /include header directory I needed to include the /postgresql/ as part of the path name. You should double check but I believe that when a default install to /usr/local/pgsql is done, the relevant headers wind up in /usr/local/pgsql/include. If this is correct then your change is exactly right. As for the import, include discussion, you are correct. I only used the #include as a cue to myself to remember that these were postgres specific items written in ANSI C and not an objective C header. I have no problem with either change!! As for the third item, your code looks like it will work but there is a larger mistake here that needs to be corrected to save a lot of future work. I wanted to discus this with you. As I began learning Cocoa from the Aaron Hilegass book his examples did not explain the responder chain and the related concepts until later. I had already begun coding this program. Simply put I believe that the PSQLController should be coded as a subclass of NSWindowController instead of the simple NSObject and be made the delegate of the relevant windows. Then the First responder object needs to be modified by adding the relevant action methods reflecting the code that is already present in the PSQLController object. Once done the PSQLController will automatically be the first responder whenever it is key and the menus will automatically activate/deactivate as needed. There may still be a small issue with the connect/disconnect menu items but everything else should work OK, I think? I hope that last part made some sense to you as I am having trouble keeping it all straight myself. Let me know what you think, Al On Tuesday, May 28, 2002, at 05:15 PM, Olaf van Oudenallen wrote: > Hi Al, > > I have to discuss the following (two) items before commiting. The third > item is just to inform you. I will report commited changes again to > this list. > > Do you agree on the first two items? > > - Working with the project on different systems > - Changed #include <postgresql/libpq-fe.h> to #import <libpq-fe.h> > - Auto set the 'Connect', 'Disconnect' and 'Export' menu items > enabled/disabled: > > Working with the project on different systems > As I have postgresql installed in (subdirectiries of) /usr/local/pgsql/ > The current targets settings for HEADER Search Path do not work for me. > So I have added the Search Pathe: > to HEADER: /usr/local/pgsql/include/ > > Hard coding an included library is another problem (for me): > build-error: > MasterObjectFile.Combine /Developer/TVOproducts/Cocoa Psql.build/Cocoa > Psql.build/Objects-normal/ProjectBuilderMasterObjectFile.o > ...skipped Cocoa Psql.app/Contents/MacOS/Cocoa Psql for lack of > /sw/lib/libpq.a... > Therefore I wonder if files to be included can be added without a path. > Any way I used to get away with adding some folders (/sw/lib/) and an > alias to have the libpq.a being included in the project. Now I had to > make a copy of the file and place it in the folder /sw/lib/ > I am sure I have forgotten when I install the next update to > Postgrsql...... > Any solution? > > Changed #include <postgresql/libpq-fe.h> to #import <libpq-fe.h> > As #import is the default for Cocoa (and better as the libs get loaded > only once now), I changed #include to #import. > As I get an error on compiling PSQLController.m (header file > 'postgresql/libpq-fe.h' not found) I changed <postgresql/libpq-fe.h> in > <libpq-fe.h> > So in the following files: > changed #include <postgresql/libpq-fe.h> > into #import <libpq-fe.h> > in the following files: > PSQLConnection.h > PSQLQuery.h > > Auto set the 'Connect', 'Disconnect' and 'Export' menu items > enabled/disabled: > I added the actions to the first responder of MainMenu.nib > menuConnect: > menuDisconnect: > raiseConnectionSettingsWindow: > doExportMenuAction: (for consistancy reasons) > and reconnected the Connection-menu items to these actions in the first > responder. > > To auto Enable menuItems, I have made PSQLController the delagate of > the mainWindow. > > Added to PSQLController.m > - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { > SEL action = [menuItem action]; > if (action==@selector(menuConnect:) && [connection connected]) { > return NO; } > else if (action==@selector(menuDisconnect:) && ![connection > connected]) { > return NO; } > else if (action==@selector(doExportMenuAction:) && ![tableView > numberOfRows] > 0) { > return NO; } > else { > return YES; > } > } |
From: Olaf v. O. <ol...@ad...> - 2002-05-28 22:19:01
|
Hi Al, I have to discuss the following (two) items before commiting. The third item is just to inform you. I will report commited changes again to this list. Do you agree on the first two items? - Working with the project on different systems - Changed #include <postgresql/libpq-fe.h> to #import <libpq-fe.h> - Auto set the 'Connect', 'Disconnect' and 'Export' menu items enabled/disabled: Working with the project on different systems As I have postgresql installed in (subdirectiries of) /usr/local/pgsql/ The current targets settings for HEADER Search Path do not work for me. So I have added the Search Pathe: to HEADER: /usr/local/pgsql/include/ Hard coding an included library is another problem (for me): build-error: MasterObjectFile.Combine /Developer/TVOproducts/Cocoa Psql.build/Cocoa Psql.build/Objects-normal/ProjectBuilderMasterObjectFile.o ...skipped Cocoa Psql.app/Contents/MacOS/Cocoa Psql for lack of /sw/lib/libpq.a... Therefore I wonder if files to be included can be added without a path. Any way I used to get away with adding some folders (/sw/lib/) and an alias to have the libpq.a being included in the project. Now I had to make a copy of the file and place it in the folder /sw/lib/ I am sure I have forgotten when I install the next update to Postgrsql...... Any solution? Changed #include <postgresql/libpq-fe.h> to #import <libpq-fe.h> As #import is the default for Cocoa (and better as the libs get loaded only once now), I changed #include to #import. As I get an error on compiling PSQLController.m (header file 'postgresql/libpq-fe.h' not found) I changed <postgresql/libpq-fe.h> in <libpq-fe.h> So in the following files: changed #include <postgresql/libpq-fe.h> into #import <libpq-fe.h> in the following files: PSQLConnection.h PSQLQuery.h Auto set the 'Connect', 'Disconnect' and 'Export' menu items enabled/disabled: I added the actions to the first responder of MainMenu.nib menuConnect: menuDisconnect: raiseConnectionSettingsWindow: doExportMenuAction: (for consistancy reasons) and reconnected the Connection-menu items to these actions in the first responder. To auto Enable menuItems, I have made PSQLController the delagate of the mainWindow. Added to PSQLController.m - (BOOL)validateMenuItem:(NSMenuItem *)menuItem { SEL action = [menuItem action]; if (action==@selector(menuConnect:) && [connection connected]) { return NO; } else if (action==@selector(menuDisconnect:) && ![connection connected]) { return NO; } else if (action==@selector(doExportMenuAction:) && ![tableView numberOfRows] > 0) { return NO; } else { return YES; } } |
From: Marie L. W. <mar...@wa...> - 2002-05-28 18:29:16
|
Checked out this afternoon (some 6 hrs ago) and just updated. Will modify the menu to properly enable/disable connection-menu options |
From: Al K. <al...@ki...> - 2002-05-26 14:54:47
|
I have committed changes to CVS on Fri evening which allow you to export the data being viewed in the tableview. See ya, Al |
From: Al K. <al...@ki...> - 2002-05-26 14:53:52
|
Hi Ted. No this does not work for me either. It needs to be investigated further. I believe the trouble is that the run loop is being interrupted by the query and the drawRect function does not get called until it is finished. This problem should be added as a bug at sourceforge. Then we can get it worked through once the bugs/features are prioritized. Bottom line I don't currently have a quick fix but I am sure it is probably not a huge problem to sort out. See ya, Al On Saturday, May 25, 2002, at 11:07 PM, Ted Petrosky wrote: > al, > > I don't think this is working. while the app is off doing the query, > the status line > should update to say "Working......". > > I have a db here that I am testing against and I have some 6000 > rows..... the > 'working ....' never gets printed. I have tried a variety of methods > and none > seem to work. > > Does it work for you? > > Ted > > from controller.m > > - (IBAction)submitQuery:(id)sender > { > NSString *oldHistoryPlusCR; > if(![connection connected]){ > //not connected > [status setStatusMsg:@"You must connect before submitting > queries"]; > }else{ > [status setStatusMsg:@"Working . . ."]; > [self updateGui]; > > |
From: Al K. <al...@ki...> - 2002-05-24 18:25:04
|
Hi all. It has become important for me to be able to export the results obtained from a query. I will be working on an export feature next. I expect to export as tab delimited text. Any comments, Al |
From: Al K. <al...@ki...> - 2002-05-24 11:24:28
|
Begin forwarded message: > From: Olaf van Oudenallen <ol...@ad...> > Date: Fri May 24, 2002 03:13:12 AM US/Central > To: Al Kirkus <al...@ki...> > Subject: Re: Improvement ideas > Return-Path: <ol...@ad...> > Delivered-To: al...@ki... > Received: (qmail 27181 invoked from network); 24 May 2002 07:13:18 = -0000 > Received: from cmailenv4.svr.pol.co.uk (213.218.77.56) by 66.99.20.75=20= > with SMTP; 24 May 2002 07:13:18 -0000 > Received: from [62.21.159.212] (helo=3Dserver.kantoor.tvo) by=20 > cmailENV4.svr.pol.co.uk with smtp (Exim 3.35 #1) id 17BAEY-0000Vf-00=20= > for al...@ki...; Fri, 24 May 2002 08:15:34 +0000 > Received: from [192.168.1.3] by server.kantoor.tvo (AppleShare IP Mail=20= > Server 6.3.1) id 167674 via TCP with SMTP; Fri, 24 May 2002 10:13:22=20= > +0200 > Mime-Version: 1.0 > X-Sender: Ol...@ms...o (Unverified) > Message-Id: <a05100300b913980c657a@[192.168.1.3]> > In-Reply-To: <DAD...@ki...> > References: <DAD...@ki...> > Content-Type: multipart/alternative;=20 > boundary=3D"=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D_-1189894496=3D=3D_ma=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D" > > Hi Al, > > (1) I planned to have the queries stay in the query view and be=20 > reusable by navigating the cursor into a paragraph (=3Dhistorical = query),=20 > edit the paragraph when needed and enter. On enter, the modified=20 > paragraph will be added to the bottom of the historical list of = queries=20 > and the queryView will be reset to the history plus the new query = (plus=20 > a return to seperate the added query/paragraph). > So we can get rid of the history window and make my splitView -see = (4)-=20 > more effective. > > (2) Further I added an line so that on enter, after the query is=20 > processed, the queryView becomes first responder again. > > (3) I replaced the ScrollView with my own subclass of a scrollView the=20= > be able to enyoy the -(void)becomesFirstResponder and=20 > -(void)resignsFirstResponder. With the use of these messages that (try=20= > to) send a message to the ScrollViews delegate, I managed to set the=20= > "Submit" button's keyEquivalent and remove the keyEquivalent when the=20= > ScrollView becoms / resings first responder properly. (I hate Apple's=20= > default button wich responds to any enter / return) > > (4) I planned to alter the window by adding a splitView with the split=20= > between the queryView and the tableView. > > (5) I added two checkBoxes near the tableView's Clear button: = (somthing=20 > like) "AutoSize table columns" and "Table can be edited" > > (6) I managed to auto-size the column widths by calculating the text=20= > size of every headercell and evry datacell (rows * columns) based on=20= > the attributed value (stringValue and font). This does not work=20 > properly on the first query so I think I have to set the tableView's=20= > datasource to an empty datasource on awakeFromNib. Did not do that = yet. > > (7) I added the validateMenuItem (or so) to enable/disable the=20 > "connect" and "disconnect" menuitems, depending on the reply of the = msg=20 > "connected". To have it working I replaced your menu with a copy of a=20= > new File-menu wich I reconfigured to eye like your connection window=20= > and made connections to the FirstResponder instead of the=20 > PSQLController. > > (8) As implementation of the "Table can be edited" checkBox I did no=20= > more than adding an action to the PSQLController that sets the=20 > TableColumns editable to YES or NO. When done with (all of these 9)=20 > goals I planned to look into the actual work: make the tableView edit=20= > the datasource and on "Save" write to the database. > > (9) I planned to alter the UI of the tableView as follows: > - skip one cell to the right on return or enter=A0 - or - > - skip to the first cell of the next row on return or enter > - Add a preference option to enable/disable this feature > > (10) I am very pleased with your work on the postgre-classes while it=20= > works and gave me a good idea of how to start. On the other hand,=20 > reading the Query class, I got a little confused by the class-,=20 > message- and variable names you used. I am not sure=A0 at this moment = if=20 > I can think of more "descriptive" names. On the other hand I planned = to=20 > seriously reconsider things in this stage, before writing more code.=20= > For example: my feeling says tha PSQLQuery should be PSQLResult or so.=20= > And=A0 as I am interested in multiple windows and multiple connections=20= > (as I will be using one database for every costomer of mine), have=20 > another sort of dataClass to store all the available PSQLStatus = objects=20 > paired with initiated connections. Thinking to do. (My girlfriend=20 > sometimes hates me while floating away of our conversations). > > Sorry if I did not use all the proper message names but I am not = behind=20 > the right computer and starting may dayly work now. > > Sorry too for not using the cocoapsql-developer list now for the same=20= > reason (and for the reason that I don't know now how to address this=20= > message to be send to the mailing list too) Maybe you can sent a copy=20= > of this message for archiving reasons for me...? > > That's all for now. Please be convinced, now and forever, that I never=20= > intend to=A0 have critics in the negative way! > > Please comment on the 10 goals I have poited out above as I will,=20 > depending on your answer, implement them as soon as I have the CVS set=20= > up properly. > > Before actually implementing, I will be more precise - point by point = -=20 > about what class, method or menu I will alter at that moment to=20 > implement a feature. > > See you, Olaf > > Hi all. > > > > When I originally conceived how cocoapsql might work, I thought that=20= > the SQL queries themselves should be objects. That was the idea of the=20= > history window above the query line. I wanted the queries which would=20= > appear in the history window to be individually=A0 clickable, like a = url,=20 > and then have that query replace anything that might be in the main=20 > query window. There should also be an option to save the queries into = a=20 > list accessible through a pull down menu, kind of like favorites might=20= > be in a browser. > > > > Any comments on this? > > > > Al > > > > Input, Input, need more INPUT!!!! > > > > Note: I have copied that cocoapsql-developer list with this message. > > > > Please join at: > > > > > > http://lists.sourceforge.net/lists/listinfo/cocoapsql-developer > > > > -- > > O. van Oudenallen, mailto: ol...@ad... > Administratiekantoor Tersteeg Van Oudenallen > Grift 11 - 1423 DH=A0 Uithoorn - The Netherlands > Phone: +31(297)531929=A0 Fax: +31(297)523826 |