Permalink
Browse files

Show the window with indexing information after the user has selected…

… their dockets.
  • Loading branch information...
1 parent 8719915 commit bca75ad692334001e585806c0055cdd82b88e8f6 @beelsebob committed Dec 24, 2012
Showing with 14 additions and 38 deletions.
  1. +11 −1 Stash/STAAppDelegate.m
  2. +3 −37 Stash/en.lproj/MainMenu.xib
View
@@ -19,6 +19,7 @@ @interface STAAppDelegate () <NSWindowDelegate>
@property (copy) NSArray *indexingDocsets;
@property (copy) NSArray *docsets;
+@property (assign,getter=isWaitingForDocsetInput) BOOL waitingForDocsetInput;
@property (copy) NSString *currentSearchString;
@property (strong) NSMutableArray *results;
@property (strong) NSArray *sortedResults;
@@ -91,7 +92,7 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification
void(^handler)(NSEvent *) = ^(NSEvent *e)
{
- if (![[self preferencesController] isMonitoringForEvents])
+ if (![[self preferencesController] isMonitoringForEvents] && ![self isWaitingForDocsetInput])
{
NSUInteger modifiers = [e modifierFlags] & NSDeviceIndependentModifierFlagsMask;
NSUInteger desiredModifiers = [[self preferencesController] keyboardShortcutModifierFlags];
@@ -352,6 +353,13 @@ - (void)indexDocsetsWithPermissionInRoots:(NSArray *)roots withContinuation:(voi
NSError *err;
BOOL isDir;
__block BOOL finishedSearchingForDocsets = NO;
+ dispatch_async(dispatch_get_main_queue(), ^()
+ {
+ if (![[self window] isVisible])
+ {
+ [self toggleStashWindow:self];
+ }
+ });
for (NSURL *root in roots)
{
for (NSURL *docsetURL in [[NSFileManager defaultManager] contentsOfDirectoryAtURL:root
@@ -424,6 +432,7 @@ - (void)requestAccessToDirectory:(NSString *)directory continuation:(void(^)(NSU
{
NSURL *requiredURL = [NSURL URLWithString:[NSString stringWithFormat:@"file://%@", directory]];
NSOpenPanel *panel = [NSOpenPanel openPanel];
+ [self setWaitingForDocsetInput:YES];
[panel setCanChooseDirectories:YES];
[panel setCanChooseFiles:NO];
[panel setAllowsMultipleSelection:NO];
@@ -437,6 +446,7 @@ - (void)requestAccessToDirectory:(NSString *)directory continuation:(void(^)(NSU
{
if (result == NSFileHandlingPanelOKButton)
{
+ [self setWaitingForDocsetInput:NO];
cont([panel URL]);
}
else
@@ -1317,7 +1317,7 @@
<nil key="NSViewClass"/>
<nil key="NSUserInterfaceItemIdentifier"/>
<object class="NSView" key="NSWindowView" id="439893737">
- <reference key="NSNextResponder"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="NSSplitView" id="489345035">
@@ -1333,7 +1333,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{20, 552}, {150, 38}}</string>
<reference key="NSSuperview" ref="286431488"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="975610457"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
@@ -1505,7 +1504,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</set>
<string key="NSFrame">{{0, 543}, {229, 1}}</string>
<reference key="NSSuperview" ref="286431488"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="731999841"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
@@ -1538,7 +1536,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</set>
<string key="NSFrame">{{0, 598}, {229, 1}}</string>
<reference key="NSSuperview" ref="286431488"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="502976946"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
@@ -1568,7 +1565,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">4352</int>
<string key="NSFrameSize">{229, 544}</string>
<reference key="NSSuperview" ref="302682592"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="105211210"/>
<string key="NSReuseIdentifierKey">_NS:13</string>
<bool key="NSEnabled">YES</bool>
@@ -1670,7 +1666,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</array>
<string key="NSFrameSize">{229, 544}</string>
<reference key="NSSuperview" ref="975610457"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="196006355"/>
<string key="NSReuseIdentifierKey">_NS:11</string>
<reference key="NSDocView" ref="196006355"/>
@@ -1685,7 +1680,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{224, 17}, {15, 102}}</string>
<reference key="NSSuperview" ref="975610457"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="492191537"/>
<string key="NSReuseIdentifierKey">_NS:58</string>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
@@ -1698,7 +1692,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{1, 119}, {223, 15}}</string>
<reference key="NSSuperview" ref="975610457"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="901925895"/>
<string key="NSReuseIdentifierKey">_NS:60</string>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
@@ -1710,7 +1703,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</array>
<string key="NSFrameSize">{229, 544}</string>
<reference key="NSSuperview" ref="286431488"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="302682592"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSsFlags">133680</int>
@@ -1727,7 +1719,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{20, 607}, {189, 22}}</string>
<reference key="NSSuperview" ref="286431488"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="532254332"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
@@ -1787,7 +1778,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</array>
<string key="NSFrameSize">{229, 637}</string>
<reference key="NSSuperview" ref="489345035"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="220182933"/>
<string key="NSReuseIdentifierKey">_NS:11</string>
<string key="NSClassName">NSView</string>
@@ -1810,8 +1800,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<array class="NSMutableArray" key="NSSubviews"/>
<string key="NSFrameSize">{300, 170}</string>
<reference key="NSSuperview" ref="628516069"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView"/>
+ <reference key="NSNextKeyView" ref="771101011"/>
<string key="NSReuseIdentifierKey">_NS:13</string>
<bool key="NSEnabled">YES</bool>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
@@ -1912,7 +1901,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</array>
<string key="NSFrameSize">{300, 170}</string>
<reference key="NSSuperview" ref="109727746"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="457607115"/>
<string key="NSReuseIdentifierKey">_NS:11</string>
<reference key="NSDocView" ref="457607115"/>
@@ -1927,7 +1915,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{-100, -100}, {15, 102}}</string>
<reference key="NSSuperview" ref="109727746"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="834214383"/>
<string key="NSReuseIdentifierKey">_NS:58</string>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
@@ -1940,7 +1927,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{-100, -100}, {287, 16}}</string>
<reference key="NSSuperview" ref="109727746"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="628516069"/>
<string key="NSReuseIdentifierKey">_NS:60</string>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
@@ -1952,8 +1938,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</array>
<string key="NSFrame">{{226, 233}, {300, 170}}</string>
<reference key="NSSuperview" ref="731999841"/>
- <reference key="NSWindow"/>
- <reference key="NSNextKeyView" ref="771101011"/>
+ <reference key="NSNextKeyView" ref="628516069"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<int key="NSsFlags">154112</int>
<reference key="NSVScroller" ref="771101011"/>
@@ -1977,7 +1962,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</set>
<string key="NSFrame">{{88, 599}, {1, 39}}</string>
<reference key="NSSuperview" ref="731999841"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="845344041"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
@@ -2007,7 +1991,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</set>
<string key="NSFrame">{{44, 599}, {1, 39}}</string>
<reference key="NSSuperview" ref="731999841"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="169262692"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
@@ -2037,7 +2020,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</set>
<string key="NSFrame">{{0, 598}, {743, 1}}</string>
<reference key="NSSuperview" ref="731999841"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="247659310"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
@@ -2059,7 +2041,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{106, 609}, {531, 19}}</string>
<reference key="NSSuperview" ref="731999841"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="15757357"/>
<string key="NSReuseIdentifierKey">_NS:1505</string>
<bool key="NSEnabled">YES</bool>
@@ -2084,7 +2065,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{44, 597}, {44, 42}}</string>
<reference key="NSSuperview" ref="731999841"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="109727746"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
@@ -2113,7 +2093,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{-1, 597}, {45, 42}}</string>
<reference key="NSSuperview" ref="731999841"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="601319216"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
@@ -2159,7 +2138,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</set>
<string key="NSFrameSize">{743, 598}</string>
<reference key="NSSuperview" ref="731999841"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSHuggingPriority">{250, 250}</string>
@@ -2170,11 +2148,7 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<dictionary class="NSMutableDictionary" key="Values">
<integer value="12" key="WebKitDefaultFixedFontSize"/>
<integer value="12" key="WebKitDefaultFontSize"/>
- <boolean value="NO" key="WebKitJavaEnabled"/>
- <boolean value="NO" key="WebKitJavaScriptCanOpenWindowsAutomatically"/>
- <boolean value="NO" key="WebKitJavaScriptEnabled"/>
<integer value="1" key="WebKitMinimumFontSize"/>
- <boolean value="NO" key="WebKitPluginsEnabled"/>
</dictionary>
</object>
<bool key="UseBackForwardList">YES</bool>
@@ -2197,7 +2171,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</set>
<string key="NSFrameSize">{743, 1}</string>
<reference key="NSSuperview" ref="247659310"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="842032640"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
@@ -2219,7 +2192,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{693, 3}, {45, 19}}</string>
<reference key="NSSuperview" ref="247659310"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="705202067"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
@@ -2248,7 +2220,6 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{477, 3}, {208, 19}}</string>
<reference key="NSSuperview" ref="247659310"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="985949831"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
@@ -2303,32 +2274,27 @@ AAMAAAABAAEAAAFTAAMAAAAEAAAFwgAAAAAACAAIAAgACAABAAEAAQABA</bytes>
</array>
<string key="NSFrame">{{-1, 573}, {744, 25}}</string>
<reference key="NSSuperview" ref="731999841"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="533767610"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSClassName">NSView</string>
</object>
</array>
<string key="NSFrame">{{230, 0}, {743, 637}}</string>
<reference key="NSSuperview" ref="489345035"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1004830245"/>
<string key="NSReuseIdentifierKey">_NS:13</string>
<string key="NSClassName">NSView</string>
</object>
</array>
<string key="NSFrameSize">{973, 637}</string>
<reference key="NSSuperview" ref="439893737"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="286431488"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSIsVertical">YES</bool>
<int key="NSDividerStyle">2</int>
</object>
</array>
<string key="NSFrameSize">{973, 637}</string>
- <reference key="NSSuperview"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="489345035"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>

0 comments on commit bca75ad

Please sign in to comment.