Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ManOpen/ManDocument.m
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ - (void)windowControllerDidLoadNib:(NSWindowController *)windowController
[textView setSelectable:YES];
[textView setImportsGraphics:NO];
[textView setRichText:YES];
[textView setUsesFindPanel:YES];
[textView setUsesFindBar:YES];

if (sizeString != nil)
{
Expand Down
2 changes: 2 additions & 0 deletions ManOpen/ManDocumentController.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

#import "SystemType.h"
#import <AppKit/NSDocumentController.h>
#import <AppKit/NSStatusItem.h>


@class NSPanel, NSTextField, NSPopUpButton, NSFont;
Expand All @@ -18,6 +19,7 @@
IBOutlet NSPopUpButton *openSectionPopup;
BOOL startedUp;
NSArray *docControllerObjects;
NSStatusItem* statusItem;
}

- (id)openWord:(NSString *)word;
Expand Down
21 changes: 19 additions & 2 deletions ManOpen/ManDocumentController.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
[aproposPanel setFrameUsingName:@"AproposPanel"];
[aproposPanel setFrameAutosaveName:@"AproposPanel"];

[self setupStatusItem];

startedUp = YES;
}

Expand All @@ -67,6 +69,14 @@ - (BOOL)applicationOpenUntitledFile:(NSApplication *)sender
return NO;
}

- (void) setupStatusItem {
statusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength];
statusItem.image = [NSImage imageNamed:@"ManOpen"];
statusItem.image.size = NSMakeSize(20.0, 20.0);
statusItem.button.action = @selector(openTextPanel:);
[statusItem retain];
}

- (void)removeDocument:(NSDocument *)document
{
BOOL autoQuit = [[NSUserDefaults standardUserDefaults] boolForKey:@"QuitWhenLastClosed"];
Expand Down Expand Up @@ -402,23 +412,30 @@ - (IBAction)openTextPanel:(id)sender
[openTextField selectText:self];

if ([self useModalPanels]) {
if ([NSApp runModalForWindow:openTextPanel] == NSModalResponseOK)
if ([NSApp runModalForWindow:openTextPanel] == NSModalResponseOK) {
[self openTitleFromPanel];
[NSApp activateIgnoringOtherApps:YES];
}
}
else {
[openTextPanel makeKeyAndOrderFront:self];
[NSApp activateIgnoringOtherApps:YES];
}

}

- (IBAction)openAproposPanel:(id)sender
{
[aproposField selectText:self];
if ([self useModalPanels]) {
if ([NSApp runModalForWindow:aproposPanel] == NSModalResponseOK)
if ([NSApp runModalForWindow:aproposPanel] == NSModalResponseOK) {
[self openAproposFromPanel];
[NSApp activateIgnoringOtherApps:YES];
}
}
else {
[aproposPanel makeKeyAndOrderFront:self];
[NSApp activateIgnoringOtherApps:YES];
}
}

Expand Down