Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Marcin Grabda
committed
Oct 11, 2010
0 parents
commit 75be822
Showing
34 changed files
with
12,513 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// AppController.h | ||
// WhatSub | ||
// | ||
// Created by Marcin Grabda on 5/10/09. | ||
// Copyright 2010 www.burningtomato.com. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
@class DropFileView; | ||
@class FileHandler; | ||
|
||
@interface AppController : NSObject { | ||
FileHandler* fileHandler; | ||
} | ||
|
||
- (IBAction)openPreferencesWindow:(id)sender; | ||
- (void)filesDragged:(DropFileView*)sender; | ||
- (IBAction)openFile:(id)sender; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// | ||
// AppController.m | ||
// WhatSub | ||
// | ||
// Created by Marcin Grabda on 5/10/09. | ||
// Copyright 2010 www.burningtomato.com. All rights reserved. | ||
// | ||
|
||
#import "AppController.h" | ||
#import "DropFileView.h" | ||
#import "AppPreferencesController.h" | ||
#import "FileHandler.h" | ||
|
||
@implementation AppController | ||
|
||
- (id)init | ||
{ | ||
if (self = [super init]) { | ||
fileHandler = [[FileHandler alloc] init]; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
- (IBAction)openPreferencesWindow:(id)sender | ||
{ | ||
[[AppPreferencesController sharedPrefsWindowController] showWindow:nil]; | ||
} | ||
|
||
/* handle a drop on the dock */ | ||
- (void)application:(NSApplication *)sender openFiles:(NSArray*)files | ||
{ | ||
[fileHandler startProcessingFiles:files]; | ||
} | ||
|
||
/* handle files dropped on the view area */ | ||
- (void)filesDragged:(DropFileView*)sender | ||
{ | ||
[fileHandler startProcessingFiles:[sender filenames]]; | ||
} | ||
|
||
/* handle files opened via the menu item */ | ||
- (IBAction)openFile:(id)sender | ||
{ | ||
NSArray* fileTypes = [NSArray arrayWithObjects:@"txt", @"avi", nil]; | ||
NSOpenPanel* openPanel = [NSOpenPanel openPanel]; | ||
|
||
[openPanel setCanChooseFiles:YES]; | ||
[openPanel setCanChooseDirectories:NO]; | ||
[openPanel setCanCreateDirectories:NO]; | ||
[openPanel setAllowsMultipleSelection:YES]; | ||
[openPanel setTitle:@"Select a file to open..."]; | ||
|
||
if ([openPanel runModalForDirectory:nil file:nil types:fileTypes] == NSOKButton) | ||
{ | ||
NSArray* files = [openPanel filenames]; | ||
[fileHandler startProcessingFiles:files]; | ||
} | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// | ||
// AppPreferencesWindowController.h | ||
// WhatSub | ||
// | ||
// Created by Marcin Grabda on 2/8/10. | ||
// Copyright 2010 www.burningtomato.com. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
#import "DBPrefsWindowController.h" | ||
|
||
@interface AppPreferencesController : DBPrefsWindowController { | ||
IBOutlet NSView* generalPrefsView; | ||
IBOutlet NSView* accountPrefsView; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// AppPreferencesWindowController.m | ||
// WhatSub | ||
// | ||
// Created by Marcin Grabda on 2/8/10. | ||
// Copyright 2010 www.burningtomato.com. All rights reserved. | ||
// | ||
|
||
#import "AppPreferencesController.h" | ||
|
||
@implementation AppPreferencesController | ||
|
||
- (void)setupToolbar | ||
{ | ||
[self addView:generalPrefsView label:@"General"]; | ||
[self addView:accountPrefsView label:@"Napiprojekt"]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
// | ||
// DBPrefsWindowController.h | ||
// | ||
// Created by Dave Batton | ||
// http://www.Mere-Mortal-Software.com/blog/ | ||
// | ||
// Documentation for this class is available here: | ||
// http://www.mere-mortal-software.com/blog/details.php?d=2007-03-11 | ||
// | ||
// Copyright 2007. Some rights reserved. | ||
// This work is licensed under a Creative Commons license: | ||
// http://creativecommons.org/licenses/by/3.0/ | ||
// | ||
// 11 March 2007 : Initial 1.0 release | ||
// 15 March 2007 : Version 1.1 | ||
// Resizing is now handled along with the cross-fade by | ||
// the NSViewAnimation routine. | ||
// Cut the fade time in half to speed up the window resize. | ||
// -setupToolbar is now called each time the window opens so | ||
// you can configure it differently each time if you want. | ||
// Holding down the shift key will now slow down the animation. | ||
// This can be disabled by using the new -setShiftSlowsAnimation: | ||
// method. | ||
// 23 March 2007 : Version 1.1.1 | ||
// The initial first responder now gets set when the view is | ||
// swapped so that the user can tab to the objects displayed | ||
// in the window. | ||
// Also added a work-around to Cocoa's insistance on drawing | ||
// a focus ring around the first toolbar icon when going from | ||
// a view with a focusable item to a view without a focusable item. | ||
// | ||
// 31 May 2007 : Version 1.1.2 | ||
// The window's title bar and toolbar heights are now calculated at | ||
// runtime, rather than being hard-coded. | ||
// Fixed a redraw problem and a window placement problem associated | ||
// with large preference windows. | ||
// Added some code to supress compiler warnings from unused parameters. | ||
// Fixed a couple of objects that weren't being properly released. | ||
// | ||
|
||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
|
||
@interface DBPrefsWindowController : NSWindowController { | ||
NSMutableArray *toolbarIdentifiers; | ||
NSMutableDictionary *toolbarViews; | ||
NSMutableDictionary *toolbarItems; | ||
|
||
BOOL _crossFade; | ||
BOOL _shiftSlowsAnimation; | ||
|
||
NSView *contentSubview; | ||
NSViewAnimation *viewAnimation; | ||
} | ||
|
||
|
||
+ (DBPrefsWindowController *)sharedPrefsWindowController; | ||
+ (NSString *)nibName; | ||
|
||
- (void)setupToolbar; | ||
- (void)addView:(NSView *)view label:(NSString *)label; | ||
- (void)addView:(NSView *)view label:(NSString *)label image:(NSImage *)image; | ||
|
||
- (BOOL)crossFade; | ||
- (void)setCrossFade:(BOOL)fade; | ||
- (BOOL)shiftSlowsAnimation; | ||
- (void)setShiftSlowsAnimation:(BOOL)slows; | ||
|
||
- (void)displayViewForIdentifier:(NSString *)identifier animate:(BOOL)animate; | ||
- (void)crossFadeView:(NSView *)oldView withView:(NSView *)newView; | ||
- (NSRect)frameForView:(NSView *)view; | ||
|
||
|
||
@end |
Oops, something went wrong.