Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Commit

Permalink
renaming stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
thesoftwarephilosopher committed Mar 16, 2013
1 parent 36deec8 commit 3f26000
Show file tree
Hide file tree
Showing 31 changed files with 282 additions and 882 deletions.
126 changes: 66 additions & 60 deletions DeskLabels/DeskLabels.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

66 changes: 5 additions & 61 deletions DeskLabels/DeskLabels/ArrangeDesktopWindow.xib
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</object>
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<object class="NSCustomObject" id="1001">
<string key="NSClassName">SDArrangeDesktopWindowController</string>
<string key="NSClassName">DLArrangeDesktopWindowController</string>
</object>
<object class="NSCustomObject" id="1003">
<string key="NSClassName">FirstResponder</string>
Expand All @@ -41,11 +41,11 @@
<string key="NSWindowRect">{{196, 240}, {480, 270}}</string>
<int key="NSWTFlags">544735232</int>
<string key="NSWindowTitle">Window</string>
<string key="NSWindowClass">SDArrangeDesktopWindow</string>
<string key="NSWindowClass">DLArrangeDesktopWindow</string>
<nil key="NSViewClass"/>
<nil key="NSUserInterfaceItemIdentifier"/>
<object class="NSView" key="NSWindowView" id="1006">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSCustomView" id="106685592">
Expand All @@ -57,7 +57,6 @@
<int key="NSvFlags">269</int>
<string key="NSFrame">{{139, 218}, {202, 32}}</string>
<reference key="NSSuperview" ref="106685592"/>
<reference key="NSWindow"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="879144591">
Expand Down Expand Up @@ -88,15 +87,12 @@
</array>
<string key="NSFrameSize">{480, 270}</string>
<reference key="NSSuperview" ref="1006"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="95333386"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSClassName">SDResizeJunkView</string>
<string key="NSClassName">DLArrangeDesktopView</string>
</object>
</array>
<string key="NSFrameSize">{480, 270}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="106685592"/>
</object>
<string key="NSScreenRect">{{0, 0}, {2560, 1418}}</string>
Expand Down Expand Up @@ -230,59 +226,7 @@
<nil key="sourceID"/>
<int key="maxID">33</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">SDArrangeDesktopWindow</string>
<string key="superclassName">NSWindow</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/SDArrangeDesktopWindow.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">SDArrangeDesktopWindowController</string>
<string key="superclassName">NSWindowController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">doneArrangingDesktop:</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">doneArrangingDesktop:</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">doneArrangingDesktop:</string>
<string key="candidateClassName">id</string>
</object>
</object>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="button">NSButton</string>
<string key="resizeJunkView">SDResizeJunkView</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="button">
<string key="name">button</string>
<string key="candidateClassName">NSButton</string>
</object>
<object class="IBToOneOutletInfo" key="resizeJunkView">
<string key="name">resizeJunkView</string>
<string key="candidateClassName">SDResizeJunkView</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/SDArrangeDesktopWindowController.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">SDResizeJunkView</string>
<string key="superclassName">NSBox</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/SDResizeJunkView.h</string>
</object>
</object>
</array>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
Expand Down
81 changes: 16 additions & 65 deletions DeskLabels/DeskLabels/DLAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,30 @@
#import "DLAppDelegate.h"


#import "SDArrangeDesktopWindowController.h"
#import "DLArrangeDesktopWindowController.h"

#import <ServiceManagement/ServiceManagement.h>

#import "DLFinderProxy.h"

#import "SDPreferencesWindowController.h"
#import "SDGeneralPrefPane.h"

#import "SharedDefines.h"
#import "DLNoteWindowController.h"
#import "DLGeneralPrefPane.h"

#import "SDHowToWindowController.h"

#import "DLNotesManager.h"


@interface DLAppDelegate ()

@property NSStatusItem *statusItem;
@property IBOutlet NSMenu *statusItemMenu;

@property NSMutableArray* noteControllers;
@property DLNotesManager* notesManager;

@property SDPreferencesWindowController* prefsController;

@property SDArrangeDesktopWindowController* arrangeDesktopWindowController;
@property DLArrangeDesktopWindowController* arrangeDesktopWindowController;

@end

Expand All @@ -47,69 +47,20 @@ - (void) awakeFromNib {
[self.statusItem setMenu:self.statusItemMenu];
}

- (void) someNoteChangedSomehow:(NSNotification*)note {
[self saveNotes];
}

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
[self loadNotes];

[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(someNoteChangedSomehow:)
name:SDSomeNoteChangedSomehowNotification
object:nil];
self.notesManager = [[DLNotesManager alloc] init];
[self.notesManager loadNotes];

if ([self.noteControllers count] == 0)
if ([self.notesManager.noteControllers count] == 0)
[SDHowToWindowController showInstructionsWindow];
}

- (void) loadNotes {
self.noteControllers = [NSMutableArray array];

NSArray *notes = [[NSUserDefaults standardUserDefaults] arrayForKey:@"notes"];

for (NSDictionary *dict in notes)
[self createNoteWithDictionary:dict];
}

- (void) saveNotes {
NSMutableArray *array = [NSMutableArray array];

for (DLNoteWindowController *controller in self.noteControllers)
[array addObject:[controller dictionaryRepresentation]];

[[NSUserDefaults standardUserDefaults] setObject:array forKey:@"notes"];
}

- (void) createNoteWithDictionary:(NSDictionary*)dictionary {
DLNoteWindowController *controller = [[DLNoteWindowController alloc] init];
controller.dictionaryToLoadFrom = dictionary;
controller.noteKilled = ^(DLNoteWindowController* deadController) {
[self.noteControllers removeObject:deadController];
[self saveNotes];
};
[self.noteControllers addObject:controller];
[controller showWindow:self];
}

- (IBAction) addNote:(id)sender {
[self createNoteWithDictionary:nil];
[self saveNotes];
[self.notesManager addNote];
}

- (IBAction) removeAllNotes:(id)sender {
NSAlert *alert = [[NSAlert alloc] init];

[alert setMessageText:@"Remove all desktop labels?"];
[alert setInformativeText:@"This operation cannot be undone. Seriously."];

[alert addButtonWithTitle:@"OK"];
[alert addButtonWithTitle:@"Cancel"];

if ([alert runModal] == NSAlertFirstButtonReturn) {
[self.noteControllers removeAllObjects];
[self saveNotes];
}
[self.notesManager removeAllNotes];
}

- (IBAction) reallyShowAboutPanel:(id)sender {
Expand All @@ -122,7 +73,7 @@ - (IBAction) showPreferences:(id)sender {

if (self.prefsController == nil) {
self.prefsController = [[SDPreferencesWindowController alloc] init];
[self.prefsController usePreferencePaneControllerClasses:@[[SDGeneralPrefPane self]]];
[self.prefsController usePreferencePaneControllerClasses:@[[DLGeneralPrefPane self]]];
}

[self.prefsController showWindow:sender];
Expand All @@ -137,11 +88,11 @@ - (IBAction) arrangeDesktop:(id)sender {
[NSApp activateIgnoringOtherApps:YES];

if (self.arrangeDesktopWindowController == nil)
self.arrangeDesktopWindowController = [[SDArrangeDesktopWindowController alloc] init];
self.arrangeDesktopWindowController = [[DLArrangeDesktopWindowController alloc] init];

[DLFinderProxy showDesktop];

self.arrangeDesktopWindowController.noteControllers = self.noteControllers;
self.arrangeDesktopWindowController.noteControllers = self.notesManager.noteControllers;
[self.arrangeDesktopWindowController showWindow:self];
}

Expand Down Expand Up @@ -178,7 +129,7 @@ - (BOOL) opensAtLogin {

- (BOOL) validateMenuItem:(NSMenuItem *)menuItem {
if ([menuItem action] == @selector(removeAllNotes:))
return [self.noteControllers count] > 0;
return [self.notesManager.noteControllers count] > 0;
else
return YES;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import <Cocoa/Cocoa.h>

@interface SDResizeJunkView : NSBox
@interface DLArrangeDesktopView : NSBox

@property (copy) void(^wantsBoxInRect)(NSRect box);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
//
//

#import "SDResizeJunkView.h"
#import "DLArrangeDesktopView.h"


@interface SDResizeJunkView ()
@interface DLArrangeDesktopView ()

@property NSPoint initialPoint;
@property NSPoint currentPoint;
Expand All @@ -18,7 +18,7 @@ @interface SDResizeJunkView ()

@end

@implementation SDResizeJunkView
@implementation DLArrangeDesktopView

- (void) awakeFromNib {
[super awakeFromNib];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

#import <Cocoa/Cocoa.h>

@interface SDArrangeDesktopWindow : NSWindow
@interface DLArrangeDesktopWindow : NSWindow

@end
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
//
//

#import "SDArrangeDesktopWindow.h"
#import "DLArrangeDesktopWindow.h"

@implementation SDArrangeDesktopWindow
@implementation DLArrangeDesktopWindow

- (id) initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag {
if ([super initWithContentRect:[[NSScreen mainScreen] frame]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

#import <Cocoa/Cocoa.h>

#import "SDResizeJunkView.h"
#import "DLArrangeDesktopView.h"

@interface SDArrangeDesktopWindowController : NSWindowController <NSWindowDelegate>
@interface DLArrangeDesktopWindowController : NSWindowController <NSWindowDelegate>

@property (weak) IBOutlet SDResizeJunkView* resizeJunkView;
@property (weak) IBOutlet DLArrangeDesktopView* resizeJunkView;
@property (weak) IBOutlet NSButton* button;

@property NSArray* noteControllers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
//
//

#import "SDArrangeDesktopWindowController.h"
#import "DLArrangeDesktopWindowController.h"

//#import "DLFinderProxy.h"

#import "DLIconGroupViewController.h"

#import "SDMoveAroundView.h"
#import "DLIconGroupView.h"


@implementation SDArrangeDesktopWindowController
@implementation DLArrangeDesktopWindowController

- (NSString*) windowNibName {
return @"ArrangeDesktopWindow";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>


@interface SDCloseButtonCell : NSButtonCell {
@interface DLCloseButtonCell : NSButtonCell {

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
// Copyright 2009 8th Light. All rights reserved.
//

#import "SDCloseButtonCell.h"
#import "DLCloseButtonCell.h"


@implementation SDCloseButtonCell
@implementation DLCloseButtonCell

- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
NSString *imageName = ([self isHighlighted] ? @"closebox_pressed" : @"closebox");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

#import <Cocoa/Cocoa.h>

@class SDTitleFieldEditor;
@class DLTitleFieldEditor;

@interface SDEditTitleController : NSWindowController
@interface DLEditTitleController : NSWindowController

@property (copy) NSString *forthcomingTitle;

Expand Down
Loading

0 comments on commit 3f26000

Please sign in to comment.