* EOAdaptors/SQLiteAdaptor/LoginPanel/SQLite3LoginPanel.m

make the login panel remember the last used directory



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@36361 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Sebastian Reitenbach 2013-03-14 15:34:30 +00:00
parent 16ca8db210
commit 33ad4a881e
2 changed files with 25 additions and 12 deletions

View file

@ -1,3 +1,7 @@
2013-03-14: Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
* EOAdaptors/SQLiteAdaptor/LoginPanel/SQLite3LoginPanel.m
make the login panel remember the last used directory
2013-03-13: Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
* Apps/EOModelEditor/DataBrowser.[h|m]
* make the fetch limit and qualifier fields work

View file

@ -125,7 +125,6 @@ static BOOL insideModalLoop = YES;
int modalCode;
volatile BOOL keepLooping = YES;
NSDictionary *connDict;
NSString *reason;
while (keepLooping)
{
@ -145,12 +144,13 @@ static BOOL insideModalLoop = YES;
if (flag)
{
NSString *reason;
NS_DURING
[self _assertConnectionDictionaryIsValidForAdaptor:adaptor
requiresAdministration:adminFlag];
NS_HANDLER
reason = [localException reason];
NSRunAlertPanel(@"Invalid connection dictionary",
NSRunAlertPanel(@"Invalid SQLite3 connection dictionary",
reason, nil, nil, nil);
NS_ENDHANDLER
@ -278,19 +278,28 @@ static BOOL insideModalLoop = YES;
- (void)browse:(id)sender
{
NSInteger code;
NSOpenPanel *panel = [NSOpenPanel openPanel];
NSString *file;
NSInteger code;
NSOpenPanel *panel = [NSOpenPanel openPanel];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *lastPath;
NSString *file;
[panel setAllowedFileTypes:nil];
code = [panel runModalForDirectory:NSHomeDirectory() file:nil];
file = [panel filename];
lastPath = [defaults stringForKey: @"SQLiteLoginPanelOpenDirectory"];
if (lastPath == nil)
lastPath = NSHomeDirectory();
[panel setAllowedFileTypes:nil];
code = [panel runModalForDirectory:lastPath file:nil];
file = [panel filename];
[defaults setObject:[file stringByDeletingLastPathComponent]
forKey:@"SQLiteLoginPanelOpenDirectory"];
[defaults synchronize];
if (code == NSOKButton && file)
{
[_path setStringValue:file];
}
if (code == NSOKButton && file)
{
[_path setStringValue:file];
}
}
@end