aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-12-05 18:41:51 +0000
committerstuconnolly <stuart02@gmail.com>2010-12-05 18:41:51 +0000
commit0dcf7859fbaf5dbb1e1a2887e46add5634d26d77 (patch)
tree4f7ea468d364a7aeaaf4ac139e6d38f05a457b0b
parentc91dd638605c4e4cee9343dce11abdf498e20532 (diff)
parentbedc1d11d6bedb4239b8f083b88b26d171ced3b3 (diff)
downloadsequelpro-0dcf7859fbaf5dbb1e1a2887e46add5634d26d77.tar.gz
sequelpro-0dcf7859fbaf5dbb1e1a2887e46add5634d26d77.tar.bz2
sequelpro-0dcf7859fbaf5dbb1e1a2887e46add5634d26d77.zip
Bring outlineview branch up to date with trunk (r2961:2966).
-rw-r--r--Source/SPConnectionController.m2
-rw-r--r--Source/SPConnectionControllerDelegate.m22
-rw-r--r--sequel-pro.xcodeproj/project.pbxproj20
3 files changed, 29 insertions, 15 deletions
diff --git a/Source/SPConnectionController.m b/Source/SPConnectionController.m
index 4938c09a..979f59bb 100644
--- a/Source/SPConnectionController.m
+++ b/Source/SPConnectionController.m
@@ -195,7 +195,7 @@ static const NSString *SPExportFavoritesFilename = @"SequelProFavorites.plist";
SPTreeNode *favorite = [self _favoriteNodeForFavoriteID:[prefs integerForKey:([prefs boolForKey:SPSelectLastFavoriteUsed]) ? SPLastFavoriteID : SPDefaultFavorite]];
- if (favorite && [favorite representedObject]) {
+ if (favorite) {
NSNumber *typeNumber = [[[favorite representedObject] nodeFavorite] objectForKey:SPFavoriteTypeKey];
diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m
index da16fd57..8e2e03b2 100644
--- a/Source/SPConnectionControllerDelegate.m
+++ b/Source/SPConnectionControllerDelegate.m
@@ -125,7 +125,9 @@
- (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item
{
- return ([[(SPTreeNode *)item parentNode] parentNode] == nil);
+ NSLog(@"%@", [(SPTreeNode *)item representedObject]);
+
+ return ([[(SPTreeNode *)item parentNode] parentNode] == nil);
}
- (void)outlineViewSelectionDidChange:(NSNotification *)notification
@@ -190,7 +192,7 @@
#pragma mark -
#pragma mark Outline view drag & drop
-/*- (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pboard
+- (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pboard
{
[pboard declareTypes:[NSArray arrayWithObject:SPFavoritesPasteboardDragType] owner:self];
[pboard setData:[NSData data] forType:SPFavoritesPasteboardDragType];
@@ -217,8 +219,10 @@
if ((!item) || ([info draggingSource] != outlineView)) return acceptedDrop;
- SPTreeNode *node = (item) ? item : favoritesRoot;
-
+ SPTreeNode *node = (item) ? item : [[[[favoritesRoot childNodes] objectAtIndex:0] childNodes] objectAtIndex:0];
+
+ // TODO: Fix me, disable automatic sorting
+
// Disable all automatic sorting
//currentSortItem = -1;
//reverseFavoritesSort = NO;
@@ -230,10 +234,10 @@
//[favorites sortUsingDescriptors:[NSArray array]];
// Uncheck sort by menu items
- for (NSMenuItem *menuItem in [[favoritesSortByMenuItem submenu] itemArray])
+ /*for (NSMenuItem *menuItem in [[favoritesSortByMenuItem submenu] itemArray])
{
[menuItem setState:NSOffState];
- }
+ }*/
NSArray *nodes = [self selectedFavoriteNodes];
@@ -273,12 +277,14 @@
else {
[[[treeNode parentNode] mutableChildNodes] removeObject:treeNode];
}
-
+
[childNodeArray insertObject:treeNode atIndex:newIndex];
newIndex++;
}
+ [favoritesController saveFavorites];
+
[self _reloadFavoritesViewData];
[[[[NSApp delegate] preferenceController] generalPreferencePane] updateDefaultFavoritePopup];
@@ -286,7 +292,7 @@
acceptedDrop = YES;
return acceptedDrop;
-}*/
+}
#pragma mark -
#pragma mark Textfield delegate methods
diff --git a/sequel-pro.xcodeproj/project.pbxproj b/sequel-pro.xcodeproj/project.pbxproj
index 1e1e66a9..0baff5ea 100644
--- a/sequel-pro.xcodeproj/project.pbxproj
+++ b/sequel-pro.xcodeproj/project.pbxproj
@@ -1388,6 +1388,17 @@
name = Data;
sourceTree = "<group>";
};
+ 173567CD12AC140A000DCCEF /* Bundle Support */ = {
+ isa = PBXGroup;
+ children = (
+ BC77C5E2129AA69E009AD832 /* SPBundleHTMLOutputController.h */,
+ BC77C5E3129AA69E009AD832 /* SPBundleHTMLOutputController.m */,
+ BC68BFC5128D4EAE004907D9 /* SPBundleEditorController.h */,
+ BC68BFC6128D4EAE004907D9 /* SPBundleEditorController.m */,
+ );
+ name = "Bundle Support";
+ sourceTree = "<group>";
+ };
173C836C11AAD24300B8B084 /* Exporters */ = {
isa = PBXGroup;
children = (
@@ -1967,18 +1978,13 @@
17E641470EF01EB8001BC333 /* Controllers */ = {
isa = PBXGroup;
children = (
- 17AF739B12AAABDD00C54D6A /* SPChooseMenuItemDialog.h */,
- 17AF739C12AAABDD00C54D6A /* SPChooseMenuItemDialog.m */,
- BC77C5E2129AA69E009AD832 /* SPBundleHTMLOutputController.h */,
- BC77C5E3129AA69E009AD832 /* SPBundleHTMLOutputController.m */,
- BC68BFC5128D4EAE004907D9 /* SPBundleEditorController.h */,
- BC68BFC6128D4EAE004907D9 /* SPBundleEditorController.m */,
17E6414A0EF01EF6001BC333 /* SPAppController.h */,
17E6414B0EF01EF6001BC333 /* SPAppController.m */,
58A8A78F11A036C000B95749 /* SPWindowController.h */,
58A8A79011A036C000B95749 /* SPWindowController.m */,
1798AB8F1267924D000D946A /* SPAppleScriptSupport.h */,
1798AB901267924D000D946A /* SPAppleScriptSupport.m */,
+ 173567CD12AC140A000DCCEF /* Bundle Support */,
173E70A6107FF61D008733C9 /* Main View Controllers */,
173E70D2107FF687008733C9 /* Subview Controllers */,
173E70D4107FF6E7008733C9 /* Data Controllers */,
@@ -2001,6 +2007,8 @@
172A65100F7BED7A001E861A /* SPConsoleMessage.m */,
17C058860FC9FC390077E9CF /* SPNarrowDownCompletion.h */,
17C058870FC9FC390077E9CF /* SPNarrowDownCompletion.m */,
+ 17AF739B12AAABDD00C54D6A /* SPChooseMenuItemDialog.h */,
+ 17AF739C12AAABDD00C54D6A /* SPChooseMenuItemDialog.m */,
17AF713012A8428000C54D6A /* Tree Nodes */,
173E70A1107FF495008733C9 /* Core Data */,
);