mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-02-19 09:40:59 +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>
|
2013-03-13: Sebastian Reitenbach <sebastia@l00-bugdead-prods.de>
|
||||||
* Apps/EOModelEditor/DataBrowser.[h|m]
|
* Apps/EOModelEditor/DataBrowser.[h|m]
|
||||||
* make the fetch limit and qualifier fields work
|
* make the fetch limit and qualifier fields work
|
||||||
|
|
|
@ -125,7 +125,6 @@ static BOOL insideModalLoop = YES;
|
||||||
int modalCode;
|
int modalCode;
|
||||||
volatile BOOL keepLooping = YES;
|
volatile BOOL keepLooping = YES;
|
||||||
NSDictionary *connDict;
|
NSDictionary *connDict;
|
||||||
NSString *reason;
|
|
||||||
|
|
||||||
while (keepLooping)
|
while (keepLooping)
|
||||||
{
|
{
|
||||||
|
@ -145,12 +144,13 @@ static BOOL insideModalLoop = YES;
|
||||||
|
|
||||||
if (flag)
|
if (flag)
|
||||||
{
|
{
|
||||||
|
NSString *reason;
|
||||||
NS_DURING
|
NS_DURING
|
||||||
[self _assertConnectionDictionaryIsValidForAdaptor:adaptor
|
[self _assertConnectionDictionaryIsValidForAdaptor:adaptor
|
||||||
requiresAdministration:adminFlag];
|
requiresAdministration:adminFlag];
|
||||||
NS_HANDLER
|
NS_HANDLER
|
||||||
reason = [localException reason];
|
reason = [localException reason];
|
||||||
NSRunAlertPanel(@"Invalid connection dictionary",
|
NSRunAlertPanel(@"Invalid SQLite3 connection dictionary",
|
||||||
reason, nil, nil, nil);
|
reason, nil, nil, nil);
|
||||||
NS_ENDHANDLER
|
NS_ENDHANDLER
|
||||||
|
|
||||||
|
@ -278,19 +278,28 @@ static BOOL insideModalLoop = YES;
|
||||||
|
|
||||||
- (void)browse:(id)sender
|
- (void)browse:(id)sender
|
||||||
{
|
{
|
||||||
NSInteger code;
|
NSInteger code;
|
||||||
NSOpenPanel *panel = [NSOpenPanel openPanel];
|
NSOpenPanel *panel = [NSOpenPanel openPanel];
|
||||||
NSString *file;
|
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
|
||||||
|
NSString *lastPath;
|
||||||
|
NSString *file;
|
||||||
|
|
||||||
[panel setAllowedFileTypes:nil];
|
lastPath = [defaults stringForKey: @"SQLiteLoginPanelOpenDirectory"];
|
||||||
code = [panel runModalForDirectory:NSHomeDirectory() file:nil];
|
if (lastPath == nil)
|
||||||
file = [panel filename];
|
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)
|
if (code == NSOKButton && file)
|
||||||
{
|
{
|
||||||
[_path setStringValue:file];
|
[_path setStringValue:file];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue