Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 83 lines (73 sloc) 2.629 kb
0f4e94fb »
2008-11-02 Import of r1.0 (20081021)
1 /*
2 * DropLook: A simple wrapper for QuickLook.
3 */
4
5 /*
6539e694 »
2009-08-17 Release 1.0.3.
6 * Copyright (c) 2008, 2009 Mo McRoberts.
0f4e94fb »
2008-11-02 Import of r1.0 (20081021)
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. The names of the author(s) of this software may not be used to endorse
17 * or promote products derived from this software without specific prior
18 * written permission.
19 *
9641840d » Gun.io Whitespace Robot
2012-01-29 Remove whitespace [WhitespaceBot]
20 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
0f4e94fb »
2008-11-02 Import of r1.0 (20081021)
22 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
23 * AUTHORS OF THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
25 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
9641840d » Gun.io Whitespace Robot
2012-01-29 Remove whitespace [WhitespaceBot]
26 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0f4e94fb »
2008-11-02 Import of r1.0 (20081021)
29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32 #ifdef HAVE_CONFIG_H
33 # include "config.h"
34 #endif
35
36 #import "DropWinController.h"
37
38 #define QLPreviewPanel NSClassFromString(@"QLPreviewPanel")
39 #define QLPreviewView NSClassFromString(@"QLPreviewView")
40
41 @implementation DropWinController
42
43 -(id)initWithPath:(NSString *)path
44 {
1a2b3bf7 »
2008-11-02 Import 1.0.2 (20081029)
45 NSURL *u;
46 NSDocumentController *sharedDocs;
9641840d » Gun.io Whitespace Robot
2012-01-29 Remove whitespace [WhitespaceBot]
47
b2685433 »
2008-11-02 Import r1.0.1 (20081026)
48 self = [super init];
49 if(self)
0f4e94fb »
2008-11-02 Import of r1.0 (20081021)
50 {
b2685433 »
2008-11-02 Import r1.0.1 (20081026)
51 if(YES != [NSBundle loadNibNamed:@"DropWindow.nib" owner:self])
52 {
53 NSLog(@"Failed to load DropWindow.nib");
54 [self dealloc];
55 return nil;
56 }
6539e694 »
2009-08-17 Release 1.0.3.
57 u = [[NSURL alloc] initFileURLWithPath:path];
b2685433 »
2008-11-02 Import r1.0.1 (20081026)
58 qlpanel = [QLPreviewView alloc];
59 [window setTitleWithRepresentedFilename:path];
1a2b3bf7 »
2008-11-02 Import 1.0.2 (20081029)
60 [window center];
b2685433 »
2008-11-02 Import r1.0.1 (20081026)
61 [qlpanel initWithFrame:[window frame]];
62 [window setContentView: qlpanel];
1a2b3bf7 »
2008-11-02 Import 1.0.2 (20081029)
63 [qlpanel setURL:u];
64 sharedDocs = [NSDocumentController sharedDocumentController];
65 [sharedDocs noteNewRecentDocumentURL:u];
66 [u release];
67 [qlpanel release];
b2685433 »
2008-11-02 Import r1.0.1 (20081026)
68 [window makeKeyAndOrderFront:self];
0f4e94fb »
2008-11-02 Import of r1.0 (20081021)
69 }
70 return self;
71 }
72
1a2b3bf7 »
2008-11-02 Import 1.0.2 (20081029)
73 - (void)windowWillClose:(NSNotification *)notification
74 {
75 [self dealloc];
76 }
77
78 -(IBAction)closeWindow:(id)sender
79 {
80 [window close];
81 }
82
0f4e94fb »
2008-11-02 Import of r1.0 (20081021)
83 @end
Something went wrong with that request. Please try again.