Revision: 29652
http://sourceforge.net/p/bibdesk/svn/29652
Author: hofman
Date: 2025-10-02 21:34:00 +0000 (Thu, 02 Oct 2025)
Log Message:
-----------
Override designated initializer for window controllers rather than convenience
initializer
Modified Paths:
--------------
trunk/bibdesk/BDSKBookmarkController.m
trunk/bibdesk/BDSKCharacterConversion.m
trunk/bibdesk/BDSKDocumentInfoWindowController.m
trunk/bibdesk/BDSKErrorObjectController.m
trunk/bibdesk/BDSKFileMatcher.m
trunk/bibdesk/BDSKFileMigrationController.h
trunk/bibdesk/BDSKFileMigrationController.m
trunk/bibdesk/BDSKFiler.m
trunk/bibdesk/BDSKFindController.m
trunk/bibdesk/BDSKOrphanedFilesFinder.m
trunk/bibdesk/BDSKPreferenceController.m
trunk/bibdesk/BDSKPreviewer.m
trunk/bibdesk/BDSKSearchBookmarkController.m
trunk/bibdesk/BDSKTextViewCompletionController.h
trunk/bibdesk/BDSKTextViewCompletionController.m
trunk/bibdesk/BDSKTypeInfoEditor.m
Modified: trunk/bibdesk/BDSKBookmarkController.m
===================================================================
--- trunk/bibdesk/BDSKBookmarkController.m 2025-10-02 09:15:47 UTC (rev
29651)
+++ trunk/bibdesk/BDSKBookmarkController.m 2025-10-02 21:34:00 UTC (rev
29652)
@@ -101,9 +101,9 @@
return sharedBookmarkController ?: [super allocWithZone:zone];
}
-- (instancetype)init {
+- (instancetype)initWithWindow:(NSWindow *)window {
if (sharedBookmarkController == nil) {
- self = [super initWithWindowNibName:@"BookmarksWindow"];
+ self = [super initWithWindow:nil];
if (self) {
undoManager = nil;
@@ -125,6 +125,10 @@
return self;
}
+- (NSString *)windowNibName {
+ return @"BookmarksWindow";
+}
+
- (void)windowDidLoad {
[self setupToolbar];
[self setWindowFrameAutosaveName:BDSKBookmarksWindowFrameAutosaveName];
Modified: trunk/bibdesk/BDSKCharacterConversion.m
===================================================================
--- trunk/bibdesk/BDSKCharacterConversion.m 2025-10-02 09:15:47 UTC (rev
29651)
+++ trunk/bibdesk/BDSKCharacterConversion.m 2025-10-02 21:34:00 UTC (rev
29652)
@@ -59,10 +59,10 @@
return sharedConversionEditor;
}
-- (instancetype)init
+- (instancetype)initWithWindow:(NSWindow *)window
{
BDSKPRECONDITION(sharedConversionEditor == nil);
- self = [super
initWithWindowNibName:BDSKCharacterConversionFrameAutosaveName];
+ self = [super initWithWindow:nil];
if (self) {
NSDictionary *tmpDict = [NSDictionary
dictionaryWithContentsOfFile:[[NSBundle mainBundle]
pathForResource:CHARACTER_CONVERSION_FILENAME ofType:nil]];
@@ -84,6 +84,10 @@
return self;
}
+- (NSString *)windowNibName {
+ return BDSKCharacterConversionFrameAutosaveName;
+}
+
- (void)windowDidLoad {
[self updateButtons];
}
Modified: trunk/bibdesk/BDSKDocumentInfoWindowController.m
===================================================================
--- trunk/bibdesk/BDSKDocumentInfoWindowController.m 2025-10-02 09:15:47 UTC
(rev 29651)
+++ trunk/bibdesk/BDSKDocumentInfoWindowController.m 2025-10-02 21:34:00 UTC
(rev 29652)
@@ -49,8 +49,8 @@
@synthesize tableView, addRemoveButton, okButton, cancelButton, info;
-- (instancetype)init {
- self = [super initWithWindowNibName:@"DocumentInfoWindow"];
+- (instancetype)initWithWindow:(NSWindow *)window {
+ self = [super initWithWindow:nil];
if (self) {
info = [[NSMapTable alloc]
initWithKeyPointerFunctions:[NSPointerFunctions
caseInsensitiveStringPointerFunctions]
valuePointerFunctions:[NSPointerFunctions strongObjectPointerFunctions]
capacity:0];
keys = nil;
@@ -58,6 +58,10 @@
return self;
}
+- (NSString *)windowNibName {
+ return @"DocumentInfoWindow";
+}
+
#pragma mark Resetting
- (void)refreshKeys{
Modified: trunk/bibdesk/BDSKErrorObjectController.m
===================================================================
--- trunk/bibdesk/BDSKErrorObjectController.m 2025-10-02 09:15:47 UTC (rev
29651)
+++ trunk/bibdesk/BDSKErrorObjectController.m 2025-10-02 21:34:00 UTC (rev
29652)
@@ -79,7 +79,7 @@
return sharedErrorObjectController;
}
-- (instancetype)init;
+- (instancetype)initWithWindow:(NSWindow *)window;
{
BDSKPRECONDITION(sharedErrorObjectController == nil);
self = [super initWithWindow:nil];
Modified: trunk/bibdesk/BDSKFileMatcher.m
===================================================================
--- trunk/bibdesk/BDSKFileMatcher.m 2025-10-02 09:15:47 UTC (rev 29651)
+++ trunk/bibdesk/BDSKFileMatcher.m 2025-10-02 21:34:00 UTC (rev 29652)
@@ -101,7 +101,7 @@
return sharedInstance;
}
-- (instancetype)init
+- (instancetype)initWithWindow:(NSWindow *)window
{
BDSKPRECONDITION(sharedInstance == nil);
self = [super initWithWindow:nil];
Modified: trunk/bibdesk/BDSKFileMigrationController.h
===================================================================
--- trunk/bibdesk/BDSKFileMigrationController.h 2025-10-02 09:15:47 UTC (rev
29651)
+++ trunk/bibdesk/BDSKFileMigrationController.h 2025-10-02 21:34:00 UTC (rev
29652)
@@ -51,10 +51,6 @@
NSMutableArray *results;
}
-- (instancetype)init NS_DESIGNATED_INITIALIZER;
-- (instancetype)initWithWindow:(nullable NSWindow *)window NS_UNAVAILABLE;
-- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;
-
@property (nonatomic, nullable, strong) IBOutlet NSTableView *tableView;
@property (nonatomic, nullable, strong) IBOutlet NSButton *migrateButton;
@property (nonatomic, nullable, strong) IBOutlet NSProgressIndicator
*progressBar;
Modified: trunk/bibdesk/BDSKFileMigrationController.m
===================================================================
--- trunk/bibdesk/BDSKFileMigrationController.m 2025-10-02 09:15:47 UTC (rev
29651)
+++ trunk/bibdesk/BDSKFileMigrationController.m 2025-10-02 21:34:00 UTC (rev
29652)
@@ -77,7 +77,7 @@
[NSValueTransformer setValueTransformer:[[BDSKURLPathTransformer alloc]
init] forName:BDSKURLPathTransformerName];
}
-- (instancetype)init
+- (instancetype)initWithWindow:(NSWindow *)window
{
self = [super initWithWindow:nil];
if (self) {
@@ -104,7 +104,9 @@
[progressBar setUsesThreadedAnimation:YES];
}
-- (NSString *)windowNibName { return @"BDSKFileMigration"; }
+- (NSString *)windowNibName {
+ return @"BDSKFileMigration";
+}
- (NSString *)windowTitleForDocumentDisplayName:(NSString *)displayName{
NSString *title = NSLocalizedString(@"Convert Files and URLs", @"title for
file migration window");
Modified: trunk/bibdesk/BDSKFiler.m
===================================================================
--- trunk/bibdesk/BDSKFiler.m 2025-10-02 09:15:47 UTC (rev 29651)
+++ trunk/bibdesk/BDSKFiler.m 2025-10-02 21:34:00 UTC (rev 29652)
@@ -70,11 +70,16 @@
return sharedFiler;
}
-- (instancetype)init{
+- (instancetype)initWithWindow:(NSWindow *)window {
BDSKPRECONDITION(sharedFiler == nil);
- return [super initWithWindowNibName:@"AutoFileProgress"];
+ self = [super initWithWindow:nil];
+ return self;
}
+- (NSString *)windowNibName {
+ return @"AutoFileProgress";
+}
+
#pragma mark Auto file methods
- (BOOL)checkPapersFolder {
Modified: trunk/bibdesk/BDSKFindController.m
===================================================================
--- trunk/bibdesk/BDSKFindController.m 2025-10-02 09:15:47 UTC (rev 29651)
+++ trunk/bibdesk/BDSKFindController.m 2025-10-02 21:34:00 UTC (rev 29652)
@@ -79,9 +79,9 @@
return sharedFC;
}
-- (instancetype)init {
+- (instancetype)initWithWindow:(NSWindow *)window {
BDSKPRECONDITION(sharedFC == nil);
- self = [super initWithWindowNibName:@"BDSKFindPanel"];
+ self = [super initWithWindow:nil];
if (self) {
NSPasteboard *pboard = [NSPasteboard
pasteboardWithName:NSPasteboardNameFind];
NSArray *strings = [pboard readObjectsForClasses:@[[NSString class]]
options:@{}];
@@ -108,6 +108,10 @@
return self;
}
+- (NSString *)windowwNibName {
+ return @"BDSKFindPanel";
+}
+
- (void)windowDidLoad{
[self setWindowFrameAutosaveName:BDSKFindPanelFrameAutosaveName];
Modified: trunk/bibdesk/BDSKOrphanedFilesFinder.m
===================================================================
--- trunk/bibdesk/BDSKOrphanedFilesFinder.m 2025-10-02 09:15:47 UTC (rev
29651)
+++ trunk/bibdesk/BDSKOrphanedFilesFinder.m 2025-10-02 21:34:00 UTC (rev
29652)
@@ -92,9 +92,9 @@
return sharedFinder;
}
-- (instancetype)init {
+- (instancetype)initWithWindow:(NSWindow *)window {
BDSKPRECONDITION(sharedFinder == nil);
- self = [super init];
+ self = [super initWithWindow:nil];
if (self) {
orphanedFiles = [[NSMutableArray alloc] init];
wasLaunched = NO;
Modified: trunk/bibdesk/BDSKPreferenceController.m
===================================================================
--- trunk/bibdesk/BDSKPreferenceController.m 2025-10-02 09:15:47 UTC (rev
29651)
+++ trunk/bibdesk/BDSKPreferenceController.m 2025-10-02 21:34:00 UTC (rev
29652)
@@ -127,9 +127,9 @@
return sharedController ?: [super allocWithZone:zone];
}
-- (instancetype)init {
+- (instancetype)initWithWindow:(NSWindow *)window {
if (sharedController == nil) {
- self = [super initWithWindowNibName:@"BDSKPreferences"];
+ self = [super initWithWindow:nil];
if (self) {
categories = [[NSMutableArray alloc] init];
categoryDicts = [[NSMutableDictionary alloc] init];
@@ -149,6 +149,10 @@
return self;
}
+- (NSString *)windowNibName {
+ return @"BDSKPreferences";
+}
+
- (NSString *)defaultWindowTitle {
return [NSString stringWithFormat:NSLocalizedString(@"%@ Preferences",
@""), [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]];
}
Modified: trunk/bibdesk/BDSKPreviewer.m
===================================================================
--- trunk/bibdesk/BDSKPreviewer.m 2025-10-02 09:15:47 UTC (rev 29651)
+++ trunk/bibdesk/BDSKPreviewer.m 2025-10-02 21:34:00 UTC (rev 29652)
@@ -86,7 +86,7 @@
return sharedPreviewer;
}
-- (instancetype)init{
+- (instancetype)initWithWindow:(NSWindow *)window {
if(self = [super initWithWindow:nil]){
// this reflects the currently expected state, not necessarily the
actual state
// it corresponds to the last drawing item added to the mainQueue
Modified: trunk/bibdesk/BDSKSearchBookmarkController.m
===================================================================
--- trunk/bibdesk/BDSKSearchBookmarkController.m 2025-10-02 09:15:47 UTC
(rev 29651)
+++ trunk/bibdesk/BDSKSearchBookmarkController.m 2025-10-02 21:34:00 UTC
(rev 29652)
@@ -98,9 +98,9 @@
return sharedBookmarkController ?: [super allocWithZone:zone];
}
-- (instancetype)init {
+- (instancetype)initWithWindow:(NSWindow *)window {
if (sharedBookmarkController == nil) {
- self = [super initWithWindowNibName:@"SearchBookmarksWindow"];
+ self = [super initWithWindow:nil];
if (self) {
NSArray *bookmarksData = [[NSUserDefaults standardUserDefaults]
arrayForKey:BDSKSearchGroupBookmarksKey];
@@ -115,6 +115,10 @@
return self;
}
+- (NSString *)windowNibName {
+ return @"SearchBookmarksWindow";
+}
+
- (void)windowDidLoad {
[self setupToolbar];
[self
setWindowFrameAutosaveName:BDSKSearchBookmarksWindowFrameAutosaveName];
Modified: trunk/bibdesk/BDSKTextViewCompletionController.h
===================================================================
--- trunk/bibdesk/BDSKTextViewCompletionController.h 2025-10-02 09:15:47 UTC
(rev 29651)
+++ trunk/bibdesk/BDSKTextViewCompletionController.h 2025-10-02 21:34:00 UTC
(rev 29652)
@@ -51,10 +51,6 @@
BOOL shouldInsert;
}
-- (instancetype)init NS_DESIGNATED_INITIALIZER;
-- (instancetype)initWithWindow:(nullable NSWindow *)window NS_UNAVAILABLE;
-- (nullable instancetype)initWithCoder:(NSCoder *)coder NS_UNAVAILABLE;
-
@property (class, nonatomic, readonly) BDSKTextViewCompletionController
*sharedController;
@property (nonatomic, strong, nullable, readonly) NSTextView *currentTextView;
Modified: trunk/bibdesk/BDSKTextViewCompletionController.m
===================================================================
--- trunk/bibdesk/BDSKTextViewCompletionController.m 2025-10-02 09:15:47 UTC
(rev 29651)
+++ trunk/bibdesk/BDSKTextViewCompletionController.m 2025-10-02 21:34:00 UTC
(rev 29652)
@@ -75,9 +75,9 @@
return sharedController;
}
-- (instancetype)init;
+- (instancetype)initWithWindow:(NSWindow *)window;
{
- NSWindow *window = [[self class] completionWindow];
+ window = [[self class] completionWindow];
self = [super initWithWindow:window];
if (self) {
tableView = [(NSScrollView *)[window contentView] documentView];
Modified: trunk/bibdesk/BDSKTypeInfoEditor.m
===================================================================
--- trunk/bibdesk/BDSKTypeInfoEditor.m 2025-10-02 09:15:47 UTC (rev 29651)
+++ trunk/bibdesk/BDSKTypeInfoEditor.m 2025-10-02 21:34:00 UTC (rev 29652)
@@ -64,7 +64,7 @@
return sharedTypeInfoEditor;
}
-- (instancetype)init
+- (instancetype)initWithWindow:(NSWindow *)window
{
BDSKPRECONDITION(sharedTypeInfoEditor == nil);
self = [super initWithWindow:nil];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit