From 3352744652a821093ef1138187609cdca5c9fef7 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Fri, 4 Sep 2009 11:55:54 +0000 Subject: =?UTF-8?q?=E2=80=A2=C2=A0prepared=20Query=20Name=20Sheet=20for=20?= =?UTF-8?q?choosing=20the=20target=20of=20the=20to=20be=20saved=20query=20?= =?UTF-8?q?favorite=20(global=20or=20not)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/CustomQuery.m | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'Source/CustomQuery.m') diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index d679a1de..bbad9edc 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -154,6 +154,7 @@ modalDelegate:self didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:) contextInfo:@"addSelectionToNewQueryFavorite"]; + } if ([queryFavoritesButton indexOfSelectedItem] == 2) { @@ -2489,14 +2490,20 @@ queryToBeAddded = [textView string]; } - [favorites addObject:[NSDictionary dictionaryWithObjects: - [NSArray arrayWithObjects:[queryFavoriteNameTextField stringValue], queryToBeAddded, nil] - forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]]]; - - [prefs setObject:favorites forKey:@"queryFavorites"]; - [prefs synchronize]; + if([saveQueryFavoriteGlobal state] == NSOnState) { + [favorites addObject:[NSDictionary dictionaryWithObjects: + [NSArray arrayWithObjects:[queryFavoriteNameTextField stringValue], queryToBeAddded, nil] + forKeys:[NSArray arrayWithObjects:@"name", @"query", nil]]]; + [prefs setObject:favorites forKey:@"queryFavorites"]; + } else { + [SPTooltip showWithObject:@"Not yet implemented"]; + } + + [saveQueryFavoriteGlobal setState:NSOffState]; + [self queryFavoritesHaveBeenUpdated:nil]; + } } -- cgit v1.2.3