mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-02-16 00:11:15 +00:00
* 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:
parent
16ca8db210
commit
33ad4a881e
2 changed files with 25 additions and 12 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue