Skip to content

Commit

Permalink
Can add multiple app groups
Browse files Browse the repository at this point in the history
  • Loading branch information
flyingmachine committed Aug 24, 2012
1 parent d1dd554 commit cadf872
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 59 deletions.
2 changes: 1 addition & 1 deletion WorkMode/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
@interface AppDelegate : NSObject <NSApplicationDelegate>

@property (assign) IBOutlet NSWindow *window;

- (void)addAppGroupView: (NSArray *)apps;
@end
7 changes: 5 additions & 2 deletions WorkMode/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ @implementation AppDelegate

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
[self addAppGroupView];
// Insert code here to initialize your application
}

- (void)addAppGroupView
- (void)addAppGroupView:(NSArray *)apps
{
AppGroupController* controller = [[AppGroupController alloc] init];
NSRect rootFrame = controller.rootView.frame;
Expand All @@ -30,6 +29,10 @@ - (void)addAppGroupView
NSRect newFrame = NSMakeRect(mainView.frame.origin.x, mainView.frame.origin.y, mainView.frame.size.width, mainView.frame.size.height);
[mainView setFrame:newFrame];
[mainView addSubview: controller.rootView];

if(apps != nil){
[controller addApps:apps];
}
}

@end
1 change: 1 addition & 0 deletions WorkMode/AppReceiver.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ - (BOOL)appDragged:(id<NSDraggingInfo>)sender

- (NSDragOperation)draggingEntered:(id <NSDraggingInfo>)sender
{
NSLog(@"drag entered");
if ([self appDragged:sender]) {
return NSDragOperationCopy;
} else {
Expand Down
4 changes: 3 additions & 1 deletion WorkMode/NewAppGroupViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
//

#import "NewAppGroupViewController.h"
#import "AppDelegate.h"

@implementation NewAppGroupViewController
- (void) addApps:(NSArray *)appsToAdd {

AppDelegate* delegate = [[NSApplication sharedApplication] delegate];
[delegate addAppGroupView: appsToAdd];
}
@end
131 changes: 76 additions & 55 deletions WorkMode/en.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>NSCustomObject</string>
<string>NSCustomView</string>
<string>NSMenu</string>
<string>NSMenuItem</string>
<string>NSTextField</string>
Expand Down Expand Up @@ -1306,52 +1307,64 @@
<reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSTextField" id="305503072">
<object class="NSCustomView" id="703243050">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{181, 17}, {244, 17}}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:1535</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="326466244">
<int key="NSCellFlags">605028416</int>
<int key="NSCellFlags2">306185216</int>
<string key="NSContents">Drag Apps Here To Create New Group</string>
<object class="NSFont" key="NSSupport">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<string key="NSCellIdentifier">_NS:1535</string>
<reference key="NSControlView" ref="305503072"/>
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlTextColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSTextField" id="1008745122">
<reference key="NSNextResponder" ref="703243050"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{181, 16}, {244, 17}}</string>
<reference key="NSSuperview" ref="703243050"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:1535</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="839824959">
<int key="NSCellFlags">605028416</int>
<int key="NSCellFlags2">306185216</int>
<string key="NSContents">Drag Apps Here To Create New Group</string>
<object class="NSFont" key="NSSupport">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">1044</int>
</object>
<string key="NSCellIdentifier">_NS:1535</string>
<reference key="NSControlView" ref="1008745122"/>
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlTextColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
</object>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</array>
<string key="NSFrameSize">{607, 50}</string>
<reference key="NSSuperview" ref="439893737"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1008745122"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSClassName">NewAppGroupView</string>
</object>
</array>
<string key="NSFrameSize">{607, 50}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="305503072"/>
<reference key="NSNextKeyView" ref="703243050"/>
</object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
<string key="NSMinSize">{607, 72}</string>
Expand Down Expand Up @@ -2002,14 +2015,6 @@
</object>
<int key="connectionID">535</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">controller</string>
<reference key="source" ref="439893737"/>
<reference key="destination" ref="781044274"/>
</object>
<int key="connectionID">1111</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">addFontTrait:</string>
Expand Down Expand Up @@ -2062,9 +2067,17 @@
<object class="IBOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="781044274"/>
<reference key="destination" ref="439893737"/>
<reference key="destination" ref="703243050"/>
</object>
<int key="connectionID">1116</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">controller</string>
<reference key="source" ref="703243050"/>
<reference key="destination" ref="781044274"/>
</object>
<int key="connectionID">1112</int>
<int key="connectionID">1117</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
Expand Down Expand Up @@ -2591,7 +2604,7 @@
<int key="objectID">372</int>
<reference key="object" ref="439893737"/>
<array class="NSMutableArray" key="children">
<reference ref="305503072"/>
<reference ref="703243050"/>
</array>
<reference key="parent" ref="972006081"/>
</object>
Expand Down Expand Up @@ -3074,17 +3087,25 @@
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1113</int>
<reference key="object" ref="305503072"/>
<int key="objectID">1115</int>
<reference key="object" ref="703243050"/>
<array class="NSMutableArray" key="children">
<reference ref="326466244"/>
<reference ref="1008745122"/>
</array>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1113</int>
<reference key="object" ref="1008745122"/>
<array class="NSMutableArray" key="children">
<reference ref="839824959"/>
</array>
<reference key="parent" ref="703243050"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">1114</int>
<reference key="object" ref="326466244"/>
<reference key="parent" ref="305503072"/>
<reference key="object" ref="839824959"/>
<reference key="parent" ref="1008745122"/>
</object>
</array>
</object>
Expand All @@ -3095,6 +3116,7 @@
<string key="1110.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="1113.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="1114.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="1115.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="112.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="124.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="125.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
Expand Down Expand Up @@ -3157,7 +3179,6 @@
<string key="371.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="371.IBWindowTemplateEditedContentRect">{{380, 496}, {480, 360}}</string>
<integer value="1" key="371.NSWindowTemplate.visibleAtLaunch"/>
<string key="372.CustomClassName">NewAppGroupView</string>
<string key="372.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="375.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="376.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
Expand Down Expand Up @@ -3254,7 +3275,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">1114</int>
<int key="maxID">1117</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down

0 comments on commit cadf872

Please sign in to comment.