Fix cases where the bookmarks info window would remember the last selection,

even after it had been deleted. Also changes focus when losing key status so
the field editor gets properly released. We seem to have lost the outlets
in the bm sidebar for the info and edit buttons, re-add and re-attach them
and ensure that they are disabled when there is no selection (bug 159655).
This commit is contained in:
pinkerton%netscape.com 2002-07-29 15:13:49 +00:00
Родитель ccb82fcf6b
Коммит 1f5bb58831
26 изменённых файлов: 202 добавлений и 50 удалений

Просмотреть файл

@ -78,32 +78,35 @@ static BookmarkInfoController *sharedBookmarkInfoController = nil;
[self commitChanges:[aNotification object]]; [self commitChanges:[aNotification object]];
[[mFieldEditor undoManager] removeAllActions]; [[mFieldEditor undoManager] removeAllActions];
} }
-(void)windowDidBecomeKey:(NSNotification*) aNotification
{
[[self window] makeFirstResponder:mNameField];
}
-(void)windowDidResignKey:(NSNotification*) aNotification -(void)windowDidResignKey:(NSNotification*) aNotification
{ {
[self commitChanges:nil]; [[self window] makeFirstResponder:[self window]];
} }
// if changedField is nil, commit everything
- (void)commitChanges:(id)changedField - (void)commitChanges:(id)changedField
{ {
if (![mBookmarkItem contentNode]) if (![mBookmarkItem contentNode])
return; return;
// Name // Name
if (!changedField || changedField == mNameField) if (changedField == mNameField)
[self commitField:mNameField toProperty:BookmarksService::gNameAtom]; [self commitField:mNameField toProperty:BookmarksService::gNameAtom];
// Location // Location
if (!changedField || changedField == mLocationField) if (changedField == mLocationField)
[self commitField:mLocationField toProperty:BookmarksService::gHrefAtom]; [self commitField:mLocationField toProperty:BookmarksService::gHrefAtom];
// Keyword // Keyword
if (!changedField || changedField == mKeywordField) if (changedField == mKeywordField)
[self commitField:mKeywordField toProperty:BookmarksService::gKeywordAtom]; [self commitField:mKeywordField toProperty:BookmarksService::gKeywordAtom];
// Description // Description
if (!changedField || changedField == mDescriptionField) if (changedField == mDescriptionField)
[self commitField:mDescriptionField toProperty:BookmarksService::gDescriptionAtom]; [self commitField:mDescriptionField toProperty:BookmarksService::gDescriptionAtom];
[[mFieldEditor undoManager] removeAllActions]; [[mFieldEditor undoManager] removeAllActions];
@ -213,5 +216,11 @@ static BookmarkInfoController *sharedBookmarkInfoController = nil;
return mFieldEditor; return mFieldEditor;
} }
-(void) close
{
mBookmarkItem = nil;
[super close];
}
@end @end

Просмотреть файл

@ -68,6 +68,14 @@
return self; return self;
} }
-(void) awakeFromNib
{
// make sure these are disabled at the start since the outliner
// starts off with no selection.
[mEditBookmarkButton setEnabled:NO];
[mDeleteBookmarkButton setEnabled:NO];
}
-(void) windowClosing -(void) windowClosing
{ {
if (mBookmarks) { if (mBookmarks) {
@ -312,6 +320,18 @@
return; return;
} }
// The alert panel was the key window. As soon as we dismissed it, Cocoa will
// pick a new one for us. Ideally, it'll be the window we were using when
// we clicked the delete button. However, if by chance the BookmarkInfoController
// is visible, it will become the key window since it's a panel. If we then delete
// the bookmark and try to close the window before we've setup a new bookmark,
// we'll trigger the windowDidResignKey message, which will try to update the bookmark
// we just deleted, and things will crash. So, we'll trigger windowDidResignKey now
// and avoid the unpleasentness of a crash log.
if (![[mBrowserWindowController window] isKeyWindow])
[[mBrowserWindowController window] makeKeyWindow];
// we'll run into problems if a parent item and one if its children are both selected. // we'll run into problems if a parent item and one if its children are both selected.
// A cheap way of having to avoid scanning the list to remove children is to have the // A cheap way of having to avoid scanning the list to remove children is to have the
// outliner collapse all items that are being deleted. This will cull the selection // outliner collapse all items that are being deleted. This will cull the selection
@ -773,14 +793,14 @@
-(void)outlineViewSelectionDidChange: (NSNotification*) aNotification -(void)outlineViewSelectionDidChange: (NSNotification*) aNotification
{ {
BookmarkInfoController *bic = [BookmarkInfoController sharedBookmarkInfoController];
int index = [mOutlineView selectedRow]; int index = [mOutlineView selectedRow];
if (index == -1) { if (index == -1) {
[mEditBookmarkButton setEnabled:NO]; [mEditBookmarkButton setEnabled:NO];
[mDeleteBookmarkButton setEnabled:NO]; [mDeleteBookmarkButton setEnabled:NO];
[bic close];
} }
else { else {
BookmarkInfoController *bic = [BookmarkInfoController sharedBookmarkInfoController];
[mEditBookmarkButton setEnabled:YES]; [mEditBookmarkButton setEnabled:YES];
[mDeleteBookmarkButton setEnabled:YES]; [mDeleteBookmarkButton setEnabled:YES];
if ([[bic window] isVisible]) if ([[bic window] isVisible])

7
camino/BrowserWindow.nib/classes.nib сгенерированный
Просмотреть файл

@ -12,7 +12,12 @@
}; };
CLASS = BookmarksDataSource; CLASS = BookmarksDataSource;
LANGUAGE = ObjC; LANGUAGE = ObjC;
OUTLETS = {mBrowserWindowController = id; mOutlineView = id; }; OUTLETS = {
mBrowserWindowController = id;
mDeleteBookmarkButton = id;
mEditBookmarkButton = id;
mOutlineView = id;
};
SUPERCLASS = NSObject; SUPERCLASS = NSObject;
}, },
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },

5
camino/BrowserWindow.nib/info.nib сгенерированный
Просмотреть файл

@ -9,7 +9,7 @@
<key>124</key> <key>124</key>
<string>305 659 170 144 0 0 1152 848 </string> <string>305 659 170 144 0 0 1152 848 </string>
<key>160</key> <key>160</key>
<string>478 172 195 666 0 0 1152 848 </string> <string>605 155 195 666 0 0 1152 848 </string>
<key>28</key> <key>28</key>
<string>523 439 195 457 0 0 1280 1002 </string> <string>523 439 195 457 0 0 1280 1002 </string>
<key>297</key> <key>297</key>
@ -23,7 +23,7 @@
<key>463</key> <key>463</key>
<string>22 619 200 180 0 0 1152 848 </string> <string>22 619 200 180 0 0 1152 848 </string>
<key>56</key> <key>56</key>
<string>403 587 360 76 0 0 1152 848 </string> <string>404 546 343 68 0 0 1152 848 </string>
</dict> </dict>
<key>IBFramework Version</key> <key>IBFramework Version</key>
<string>248.0</string> <string>248.0</string>
@ -44,6 +44,7 @@
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>56</integer> <integer>56</integer>
<integer>160</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>5S60</string> <string>5S60</string>

Двоичные данные
camino/BrowserWindow.nib/objects.nib сгенерированный

Двоичный файл не отображается.

7
camino/English.lproj/BrowserWindow.nib/classes.nib сгенерированный
Просмотреть файл

@ -12,7 +12,12 @@
}; };
CLASS = BookmarksDataSource; CLASS = BookmarksDataSource;
LANGUAGE = ObjC; LANGUAGE = ObjC;
OUTLETS = {mBrowserWindowController = id; mOutlineView = id; }; OUTLETS = {
mBrowserWindowController = id;
mDeleteBookmarkButton = id;
mEditBookmarkButton = id;
mOutlineView = id;
};
SUPERCLASS = NSObject; SUPERCLASS = NSObject;
}, },
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },

5
camino/English.lproj/BrowserWindow.nib/info.nib сгенерированный
Просмотреть файл

@ -9,7 +9,7 @@
<key>124</key> <key>124</key>
<string>305 659 170 144 0 0 1152 848 </string> <string>305 659 170 144 0 0 1152 848 </string>
<key>160</key> <key>160</key>
<string>478 172 195 666 0 0 1152 848 </string> <string>605 155 195 666 0 0 1152 848 </string>
<key>28</key> <key>28</key>
<string>523 439 195 457 0 0 1280 1002 </string> <string>523 439 195 457 0 0 1280 1002 </string>
<key>297</key> <key>297</key>
@ -23,7 +23,7 @@
<key>463</key> <key>463</key>
<string>22 619 200 180 0 0 1152 848 </string> <string>22 619 200 180 0 0 1152 848 </string>
<key>56</key> <key>56</key>
<string>403 587 360 76 0 0 1152 848 </string> <string>404 546 343 68 0 0 1152 848 </string>
</dict> </dict>
<key>IBFramework Version</key> <key>IBFramework Version</key>
<string>248.0</string> <string>248.0</string>
@ -44,6 +44,7 @@
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>56</integer> <integer>56</integer>
<integer>160</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>5S60</string> <string>5S60</string>

Двоичные данные
camino/English.lproj/BrowserWindow.nib/objects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -12,7 +12,12 @@
}; };
CLASS = BookmarksDataSource; CLASS = BookmarksDataSource;
LANGUAGE = ObjC; LANGUAGE = ObjC;
OUTLETS = {mBrowserWindowController = id; mOutlineView = id; }; OUTLETS = {
mBrowserWindowController = id;
mDeleteBookmarkButton = id;
mEditBookmarkButton = id;
mOutlineView = id;
};
SUPERCLASS = NSObject; SUPERCLASS = NSObject;
}, },
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },

Просмотреть файл

@ -9,7 +9,7 @@
<key>124</key> <key>124</key>
<string>305 659 170 144 0 0 1152 848 </string> <string>305 659 170 144 0 0 1152 848 </string>
<key>160</key> <key>160</key>
<string>478 172 195 666 0 0 1152 848 </string> <string>605 155 195 666 0 0 1152 848 </string>
<key>28</key> <key>28</key>
<string>523 439 195 457 0 0 1280 1002 </string> <string>523 439 195 457 0 0 1280 1002 </string>
<key>297</key> <key>297</key>
@ -23,7 +23,7 @@
<key>463</key> <key>463</key>
<string>22 619 200 180 0 0 1152 848 </string> <string>22 619 200 180 0 0 1152 848 </string>
<key>56</key> <key>56</key>
<string>403 587 360 76 0 0 1152 848 </string> <string>404 546 343 68 0 0 1152 848 </string>
</dict> </dict>
<key>IBFramework Version</key> <key>IBFramework Version</key>
<string>248.0</string> <string>248.0</string>
@ -44,6 +44,7 @@
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>56</integer> <integer>56</integer>
<integer>160</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>5S60</string> <string>5S60</string>

Двоичные данные
camino/resources/localized/English.lproj/BrowserWindow.nib/objects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -78,32 +78,35 @@ static BookmarkInfoController *sharedBookmarkInfoController = nil;
[self commitChanges:[aNotification object]]; [self commitChanges:[aNotification object]];
[[mFieldEditor undoManager] removeAllActions]; [[mFieldEditor undoManager] removeAllActions];
} }
-(void)windowDidBecomeKey:(NSNotification*) aNotification
{
[[self window] makeFirstResponder:mNameField];
}
-(void)windowDidResignKey:(NSNotification*) aNotification -(void)windowDidResignKey:(NSNotification*) aNotification
{ {
[self commitChanges:nil]; [[self window] makeFirstResponder:[self window]];
} }
// if changedField is nil, commit everything
- (void)commitChanges:(id)changedField - (void)commitChanges:(id)changedField
{ {
if (![mBookmarkItem contentNode]) if (![mBookmarkItem contentNode])
return; return;
// Name // Name
if (!changedField || changedField == mNameField) if (changedField == mNameField)
[self commitField:mNameField toProperty:BookmarksService::gNameAtom]; [self commitField:mNameField toProperty:BookmarksService::gNameAtom];
// Location // Location
if (!changedField || changedField == mLocationField) if (changedField == mLocationField)
[self commitField:mLocationField toProperty:BookmarksService::gHrefAtom]; [self commitField:mLocationField toProperty:BookmarksService::gHrefAtom];
// Keyword // Keyword
if (!changedField || changedField == mKeywordField) if (changedField == mKeywordField)
[self commitField:mKeywordField toProperty:BookmarksService::gKeywordAtom]; [self commitField:mKeywordField toProperty:BookmarksService::gKeywordAtom];
// Description // Description
if (!changedField || changedField == mDescriptionField) if (changedField == mDescriptionField)
[self commitField:mDescriptionField toProperty:BookmarksService::gDescriptionAtom]; [self commitField:mDescriptionField toProperty:BookmarksService::gDescriptionAtom];
[[mFieldEditor undoManager] removeAllActions]; [[mFieldEditor undoManager] removeAllActions];
@ -213,5 +216,11 @@ static BookmarkInfoController *sharedBookmarkInfoController = nil;
return mFieldEditor; return mFieldEditor;
} }
-(void) close
{
mBookmarkItem = nil;
[super close];
}
@end @end

Просмотреть файл

@ -68,6 +68,14 @@
return self; return self;
} }
-(void) awakeFromNib
{
// make sure these are disabled at the start since the outliner
// starts off with no selection.
[mEditBookmarkButton setEnabled:NO];
[mDeleteBookmarkButton setEnabled:NO];
}
-(void) windowClosing -(void) windowClosing
{ {
if (mBookmarks) { if (mBookmarks) {
@ -312,6 +320,18 @@
return; return;
} }
// The alert panel was the key window. As soon as we dismissed it, Cocoa will
// pick a new one for us. Ideally, it'll be the window we were using when
// we clicked the delete button. However, if by chance the BookmarkInfoController
// is visible, it will become the key window since it's a panel. If we then delete
// the bookmark and try to close the window before we've setup a new bookmark,
// we'll trigger the windowDidResignKey message, which will try to update the bookmark
// we just deleted, and things will crash. So, we'll trigger windowDidResignKey now
// and avoid the unpleasentness of a crash log.
if (![[mBrowserWindowController window] isKeyWindow])
[[mBrowserWindowController window] makeKeyWindow];
// we'll run into problems if a parent item and one if its children are both selected. // we'll run into problems if a parent item and one if its children are both selected.
// A cheap way of having to avoid scanning the list to remove children is to have the // A cheap way of having to avoid scanning the list to remove children is to have the
// outliner collapse all items that are being deleted. This will cull the selection // outliner collapse all items that are being deleted. This will cull the selection
@ -773,14 +793,14 @@
-(void)outlineViewSelectionDidChange: (NSNotification*) aNotification -(void)outlineViewSelectionDidChange: (NSNotification*) aNotification
{ {
BookmarkInfoController *bic = [BookmarkInfoController sharedBookmarkInfoController];
int index = [mOutlineView selectedRow]; int index = [mOutlineView selectedRow];
if (index == -1) { if (index == -1) {
[mEditBookmarkButton setEnabled:NO]; [mEditBookmarkButton setEnabled:NO];
[mDeleteBookmarkButton setEnabled:NO]; [mDeleteBookmarkButton setEnabled:NO];
[bic close];
} }
else { else {
BookmarkInfoController *bic = [BookmarkInfoController sharedBookmarkInfoController];
[mEditBookmarkButton setEnabled:YES]; [mEditBookmarkButton setEnabled:YES];
[mDeleteBookmarkButton setEnabled:YES]; [mDeleteBookmarkButton setEnabled:YES];
if ([[bic window] isVisible]) if ([[bic window] isVisible])

Просмотреть файл

@ -78,32 +78,35 @@ static BookmarkInfoController *sharedBookmarkInfoController = nil;
[self commitChanges:[aNotification object]]; [self commitChanges:[aNotification object]];
[[mFieldEditor undoManager] removeAllActions]; [[mFieldEditor undoManager] removeAllActions];
} }
-(void)windowDidBecomeKey:(NSNotification*) aNotification
{
[[self window] makeFirstResponder:mNameField];
}
-(void)windowDidResignKey:(NSNotification*) aNotification -(void)windowDidResignKey:(NSNotification*) aNotification
{ {
[self commitChanges:nil]; [[self window] makeFirstResponder:[self window]];
} }
// if changedField is nil, commit everything
- (void)commitChanges:(id)changedField - (void)commitChanges:(id)changedField
{ {
if (![mBookmarkItem contentNode]) if (![mBookmarkItem contentNode])
return; return;
// Name // Name
if (!changedField || changedField == mNameField) if (changedField == mNameField)
[self commitField:mNameField toProperty:BookmarksService::gNameAtom]; [self commitField:mNameField toProperty:BookmarksService::gNameAtom];
// Location // Location
if (!changedField || changedField == mLocationField) if (changedField == mLocationField)
[self commitField:mLocationField toProperty:BookmarksService::gHrefAtom]; [self commitField:mLocationField toProperty:BookmarksService::gHrefAtom];
// Keyword // Keyword
if (!changedField || changedField == mKeywordField) if (changedField == mKeywordField)
[self commitField:mKeywordField toProperty:BookmarksService::gKeywordAtom]; [self commitField:mKeywordField toProperty:BookmarksService::gKeywordAtom];
// Description // Description
if (!changedField || changedField == mDescriptionField) if (changedField == mDescriptionField)
[self commitField:mDescriptionField toProperty:BookmarksService::gDescriptionAtom]; [self commitField:mDescriptionField toProperty:BookmarksService::gDescriptionAtom];
[[mFieldEditor undoManager] removeAllActions]; [[mFieldEditor undoManager] removeAllActions];
@ -213,5 +216,11 @@ static BookmarkInfoController *sharedBookmarkInfoController = nil;
return mFieldEditor; return mFieldEditor;
} }
-(void) close
{
mBookmarkItem = nil;
[super close];
}
@end @end

Просмотреть файл

@ -68,6 +68,14 @@
return self; return self;
} }
-(void) awakeFromNib
{
// make sure these are disabled at the start since the outliner
// starts off with no selection.
[mEditBookmarkButton setEnabled:NO];
[mDeleteBookmarkButton setEnabled:NO];
}
-(void) windowClosing -(void) windowClosing
{ {
if (mBookmarks) { if (mBookmarks) {
@ -312,6 +320,18 @@
return; return;
} }
// The alert panel was the key window. As soon as we dismissed it, Cocoa will
// pick a new one for us. Ideally, it'll be the window we were using when
// we clicked the delete button. However, if by chance the BookmarkInfoController
// is visible, it will become the key window since it's a panel. If we then delete
// the bookmark and try to close the window before we've setup a new bookmark,
// we'll trigger the windowDidResignKey message, which will try to update the bookmark
// we just deleted, and things will crash. So, we'll trigger windowDidResignKey now
// and avoid the unpleasentness of a crash log.
if (![[mBrowserWindowController window] isKeyWindow])
[[mBrowserWindowController window] makeKeyWindow];
// we'll run into problems if a parent item and one if its children are both selected. // we'll run into problems if a parent item and one if its children are both selected.
// A cheap way of having to avoid scanning the list to remove children is to have the // A cheap way of having to avoid scanning the list to remove children is to have the
// outliner collapse all items that are being deleted. This will cull the selection // outliner collapse all items that are being deleted. This will cull the selection
@ -773,14 +793,14 @@
-(void)outlineViewSelectionDidChange: (NSNotification*) aNotification -(void)outlineViewSelectionDidChange: (NSNotification*) aNotification
{ {
BookmarkInfoController *bic = [BookmarkInfoController sharedBookmarkInfoController];
int index = [mOutlineView selectedRow]; int index = [mOutlineView selectedRow];
if (index == -1) { if (index == -1) {
[mEditBookmarkButton setEnabled:NO]; [mEditBookmarkButton setEnabled:NO];
[mDeleteBookmarkButton setEnabled:NO]; [mDeleteBookmarkButton setEnabled:NO];
[bic close];
} }
else { else {
BookmarkInfoController *bic = [BookmarkInfoController sharedBookmarkInfoController];
[mEditBookmarkButton setEnabled:YES]; [mEditBookmarkButton setEnabled:YES];
[mDeleteBookmarkButton setEnabled:YES]; [mDeleteBookmarkButton setEnabled:YES];
if ([[bic window] isVisible]) if ([[bic window] isVisible])

7
chimera/BrowserWindow.nib/classes.nib сгенерированный
Просмотреть файл

@ -12,7 +12,12 @@
}; };
CLASS = BookmarksDataSource; CLASS = BookmarksDataSource;
LANGUAGE = ObjC; LANGUAGE = ObjC;
OUTLETS = {mBrowserWindowController = id; mOutlineView = id; }; OUTLETS = {
mBrowserWindowController = id;
mDeleteBookmarkButton = id;
mEditBookmarkButton = id;
mOutlineView = id;
};
SUPERCLASS = NSObject; SUPERCLASS = NSObject;
}, },
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },

5
chimera/BrowserWindow.nib/info.nib сгенерированный
Просмотреть файл

@ -9,7 +9,7 @@
<key>124</key> <key>124</key>
<string>305 659 170 144 0 0 1152 848 </string> <string>305 659 170 144 0 0 1152 848 </string>
<key>160</key> <key>160</key>
<string>478 172 195 666 0 0 1152 848 </string> <string>605 155 195 666 0 0 1152 848 </string>
<key>28</key> <key>28</key>
<string>523 439 195 457 0 0 1280 1002 </string> <string>523 439 195 457 0 0 1280 1002 </string>
<key>297</key> <key>297</key>
@ -23,7 +23,7 @@
<key>463</key> <key>463</key>
<string>22 619 200 180 0 0 1152 848 </string> <string>22 619 200 180 0 0 1152 848 </string>
<key>56</key> <key>56</key>
<string>403 587 360 76 0 0 1152 848 </string> <string>404 546 343 68 0 0 1152 848 </string>
</dict> </dict>
<key>IBFramework Version</key> <key>IBFramework Version</key>
<string>248.0</string> <string>248.0</string>
@ -44,6 +44,7 @@
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>56</integer> <integer>56</integer>
<integer>160</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>5S60</string> <string>5S60</string>

Двоичные данные
chimera/BrowserWindow.nib/objects.nib сгенерированный

Двоичный файл не отображается.

7
chimera/English.lproj/BrowserWindow.nib/classes.nib сгенерированный
Просмотреть файл

@ -12,7 +12,12 @@
}; };
CLASS = BookmarksDataSource; CLASS = BookmarksDataSource;
LANGUAGE = ObjC; LANGUAGE = ObjC;
OUTLETS = {mBrowserWindowController = id; mOutlineView = id; }; OUTLETS = {
mBrowserWindowController = id;
mDeleteBookmarkButton = id;
mEditBookmarkButton = id;
mOutlineView = id;
};
SUPERCLASS = NSObject; SUPERCLASS = NSObject;
}, },
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },

5
chimera/English.lproj/BrowserWindow.nib/info.nib сгенерированный
Просмотреть файл

@ -9,7 +9,7 @@
<key>124</key> <key>124</key>
<string>305 659 170 144 0 0 1152 848 </string> <string>305 659 170 144 0 0 1152 848 </string>
<key>160</key> <key>160</key>
<string>478 172 195 666 0 0 1152 848 </string> <string>605 155 195 666 0 0 1152 848 </string>
<key>28</key> <key>28</key>
<string>523 439 195 457 0 0 1280 1002 </string> <string>523 439 195 457 0 0 1280 1002 </string>
<key>297</key> <key>297</key>
@ -23,7 +23,7 @@
<key>463</key> <key>463</key>
<string>22 619 200 180 0 0 1152 848 </string> <string>22 619 200 180 0 0 1152 848 </string>
<key>56</key> <key>56</key>
<string>403 587 360 76 0 0 1152 848 </string> <string>404 546 343 68 0 0 1152 848 </string>
</dict> </dict>
<key>IBFramework Version</key> <key>IBFramework Version</key>
<string>248.0</string> <string>248.0</string>
@ -44,6 +44,7 @@
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>56</integer> <integer>56</integer>
<integer>160</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>5S60</string> <string>5S60</string>

Двоичные данные
chimera/English.lproj/BrowserWindow.nib/objects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -12,7 +12,12 @@
}; };
CLASS = BookmarksDataSource; CLASS = BookmarksDataSource;
LANGUAGE = ObjC; LANGUAGE = ObjC;
OUTLETS = {mBrowserWindowController = id; mOutlineView = id; }; OUTLETS = {
mBrowserWindowController = id;
mDeleteBookmarkButton = id;
mEditBookmarkButton = id;
mOutlineView = id;
};
SUPERCLASS = NSObject; SUPERCLASS = NSObject;
}, },
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; }, {CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },

Просмотреть файл

@ -9,7 +9,7 @@
<key>124</key> <key>124</key>
<string>305 659 170 144 0 0 1152 848 </string> <string>305 659 170 144 0 0 1152 848 </string>
<key>160</key> <key>160</key>
<string>478 172 195 666 0 0 1152 848 </string> <string>605 155 195 666 0 0 1152 848 </string>
<key>28</key> <key>28</key>
<string>523 439 195 457 0 0 1280 1002 </string> <string>523 439 195 457 0 0 1280 1002 </string>
<key>297</key> <key>297</key>
@ -23,7 +23,7 @@
<key>463</key> <key>463</key>
<string>22 619 200 180 0 0 1152 848 </string> <string>22 619 200 180 0 0 1152 848 </string>
<key>56</key> <key>56</key>
<string>403 587 360 76 0 0 1152 848 </string> <string>404 546 343 68 0 0 1152 848 </string>
</dict> </dict>
<key>IBFramework Version</key> <key>IBFramework Version</key>
<string>248.0</string> <string>248.0</string>
@ -44,6 +44,7 @@
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>56</integer> <integer>56</integer>
<integer>160</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>5S60</string> <string>5S60</string>

Двоичные данные
chimera/resources/localized/English.lproj/BrowserWindow.nib/objects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -78,32 +78,35 @@ static BookmarkInfoController *sharedBookmarkInfoController = nil;
[self commitChanges:[aNotification object]]; [self commitChanges:[aNotification object]];
[[mFieldEditor undoManager] removeAllActions]; [[mFieldEditor undoManager] removeAllActions];
} }
-(void)windowDidBecomeKey:(NSNotification*) aNotification
{
[[self window] makeFirstResponder:mNameField];
}
-(void)windowDidResignKey:(NSNotification*) aNotification -(void)windowDidResignKey:(NSNotification*) aNotification
{ {
[self commitChanges:nil]; [[self window] makeFirstResponder:[self window]];
} }
// if changedField is nil, commit everything
- (void)commitChanges:(id)changedField - (void)commitChanges:(id)changedField
{ {
if (![mBookmarkItem contentNode]) if (![mBookmarkItem contentNode])
return; return;
// Name // Name
if (!changedField || changedField == mNameField) if (changedField == mNameField)
[self commitField:mNameField toProperty:BookmarksService::gNameAtom]; [self commitField:mNameField toProperty:BookmarksService::gNameAtom];
// Location // Location
if (!changedField || changedField == mLocationField) if (changedField == mLocationField)
[self commitField:mLocationField toProperty:BookmarksService::gHrefAtom]; [self commitField:mLocationField toProperty:BookmarksService::gHrefAtom];
// Keyword // Keyword
if (!changedField || changedField == mKeywordField) if (changedField == mKeywordField)
[self commitField:mKeywordField toProperty:BookmarksService::gKeywordAtom]; [self commitField:mKeywordField toProperty:BookmarksService::gKeywordAtom];
// Description // Description
if (!changedField || changedField == mDescriptionField) if (changedField == mDescriptionField)
[self commitField:mDescriptionField toProperty:BookmarksService::gDescriptionAtom]; [self commitField:mDescriptionField toProperty:BookmarksService::gDescriptionAtom];
[[mFieldEditor undoManager] removeAllActions]; [[mFieldEditor undoManager] removeAllActions];
@ -213,5 +216,11 @@ static BookmarkInfoController *sharedBookmarkInfoController = nil;
return mFieldEditor; return mFieldEditor;
} }
-(void) close
{
mBookmarkItem = nil;
[super close];
}
@end @end

Просмотреть файл

@ -68,6 +68,14 @@
return self; return self;
} }
-(void) awakeFromNib
{
// make sure these are disabled at the start since the outliner
// starts off with no selection.
[mEditBookmarkButton setEnabled:NO];
[mDeleteBookmarkButton setEnabled:NO];
}
-(void) windowClosing -(void) windowClosing
{ {
if (mBookmarks) { if (mBookmarks) {
@ -312,6 +320,18 @@
return; return;
} }
// The alert panel was the key window. As soon as we dismissed it, Cocoa will
// pick a new one for us. Ideally, it'll be the window we were using when
// we clicked the delete button. However, if by chance the BookmarkInfoController
// is visible, it will become the key window since it's a panel. If we then delete
// the bookmark and try to close the window before we've setup a new bookmark,
// we'll trigger the windowDidResignKey message, which will try to update the bookmark
// we just deleted, and things will crash. So, we'll trigger windowDidResignKey now
// and avoid the unpleasentness of a crash log.
if (![[mBrowserWindowController window] isKeyWindow])
[[mBrowserWindowController window] makeKeyWindow];
// we'll run into problems if a parent item and one if its children are both selected. // we'll run into problems if a parent item and one if its children are both selected.
// A cheap way of having to avoid scanning the list to remove children is to have the // A cheap way of having to avoid scanning the list to remove children is to have the
// outliner collapse all items that are being deleted. This will cull the selection // outliner collapse all items that are being deleted. This will cull the selection
@ -773,14 +793,14 @@
-(void)outlineViewSelectionDidChange: (NSNotification*) aNotification -(void)outlineViewSelectionDidChange: (NSNotification*) aNotification
{ {
BookmarkInfoController *bic = [BookmarkInfoController sharedBookmarkInfoController];
int index = [mOutlineView selectedRow]; int index = [mOutlineView selectedRow];
if (index == -1) { if (index == -1) {
[mEditBookmarkButton setEnabled:NO]; [mEditBookmarkButton setEnabled:NO];
[mDeleteBookmarkButton setEnabled:NO]; [mDeleteBookmarkButton setEnabled:NO];
[bic close];
} }
else { else {
BookmarkInfoController *bic = [BookmarkInfoController sharedBookmarkInfoController];
[mEditBookmarkButton setEnabled:YES]; [mEditBookmarkButton setEnabled:YES];
[mDeleteBookmarkButton setEnabled:YES]; [mDeleteBookmarkButton setEnabled:YES];
if ([[bic window] isVisible]) if ([[bic window] isVisible])