You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
(23) |
Apr
(254) |
May
(252) |
Jun
(209) |
Jul
(198) |
Aug
(192) |
Sep
(207) |
Oct
(120) |
Nov
(179) |
Dec
(52) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(48) |
Feb
(69) |
Mar
(129) |
Apr
(250) |
May
(113) |
Jun
(177) |
Jul
(228) |
Aug
(155) |
Sep
(218) |
Oct
(185) |
Nov
(109) |
Dec
(88) |
2009 |
Jan
(83) |
Feb
(39) |
Mar
(70) |
Apr
(47) |
May
(48) |
Jun
(67) |
Jul
(61) |
Aug
(97) |
Sep
(221) |
Oct
(141) |
Nov
(70) |
Dec
(61) |
2010 |
Jan
(45) |
Feb
(76) |
Mar
(178) |
Apr
(106) |
May
(57) |
Jun
(32) |
Jul
(64) |
Aug
(98) |
Sep
(96) |
Oct
(19) |
Nov
(34) |
Dec
(117) |
2011 |
Jan
(55) |
Feb
(48) |
Mar
(64) |
Apr
(21) |
May
(39) |
Jun
(53) |
Jul
(99) |
Aug
(56) |
Sep
(39) |
Oct
(26) |
Nov
(19) |
Dec
(69) |
2012 |
Jan
(17) |
Feb
(40) |
Mar
(17) |
Apr
|
May
(2) |
Jun
(8) |
Jul
(2) |
Aug
(10) |
Sep
(10) |
Oct
(38) |
Nov
(48) |
Dec
(70) |
2013 |
Jan
(43) |
Feb
(47) |
Mar
(39) |
Apr
(37) |
May
(25) |
Jun
(6) |
Jul
(20) |
Aug
(49) |
Sep
(33) |
Oct
(34) |
Nov
(75) |
Dec
(6) |
2014 |
Jan
(32) |
Feb
(10) |
Mar
(17) |
Apr
|
May
|
Jun
(26) |
Jul
(5) |
Aug
|
Sep
(4) |
Oct
(23) |
Nov
(80) |
Dec
(48) |
2015 |
Jan
(80) |
Feb
(50) |
Mar
(58) |
Apr
(20) |
May
(11) |
Jun
(16) |
Jul
(24) |
Aug
(27) |
Sep
(56) |
Oct
(30) |
Nov
(16) |
Dec
(6) |
2016 |
Jan
(31) |
Feb
(14) |
Mar
(23) |
Apr
(17) |
May
(40) |
Jun
(12) |
Jul
(17) |
Aug
(9) |
Sep
(32) |
Oct
(36) |
Nov
(23) |
Dec
(9) |
2017 |
Jan
(37) |
Feb
(23) |
Mar
(65) |
Apr
(22) |
May
(6) |
Jun
(3) |
Jul
|
Aug
|
Sep
(3) |
Oct
(22) |
Nov
(63) |
Dec
(71) |
2018 |
Jan
(83) |
Feb
(21) |
Mar
(35) |
Apr
(44) |
May
(14) |
Jun
(12) |
Jul
(8) |
Aug
(18) |
Sep
(10) |
Oct
(145) |
Nov
(144) |
Dec
(76) |
2019 |
Jan
(18) |
Feb
(28) |
Mar
(5) |
Apr
(208) |
May
(291) |
Jun
(158) |
Jul
(27) |
Aug
(8) |
Sep
(10) |
Oct
(83) |
Nov
(41) |
Dec
(31) |
2020 |
Jan
(16) |
Feb
(46) |
Mar
(100) |
Apr
(78) |
May
(69) |
Jun
(71) |
Jul
(28) |
Aug
(131) |
Sep
(176) |
Oct
(89) |
Nov
(147) |
Dec
(19) |
2021 |
Jan
(19) |
Feb
(25) |
Mar
(91) |
Apr
(98) |
May
(14) |
Jun
(44) |
Jul
(8) |
Aug
(3) |
Sep
(38) |
Oct
(57) |
Nov
(97) |
Dec
(74) |
2022 |
Jan
(89) |
Feb
(47) |
Mar
(15) |
Apr
(50) |
May
(54) |
Jun
(56) |
Jul
(80) |
Aug
(12) |
Sep
(11) |
Oct
(60) |
Nov
(48) |
Dec
(4) |
2023 |
Jan
(75) |
Feb
(49) |
Mar
(84) |
Apr
(24) |
May
(13) |
Jun
(74) |
Jul
(32) |
Aug
(66) |
Sep
(50) |
Oct
(38) |
Nov
(105) |
Dec
(181) |
2024 |
Jan
(21) |
Feb
(49) |
Mar
(77) |
Apr
(84) |
May
(20) |
Jun
(71) |
Jul
(53) |
Aug
(33) |
Sep
(54) |
Oct
(124) |
Nov
(151) |
Dec
(73) |
2025 |
Jan
(61) |
Feb
(17) |
Mar
(136) |
Apr
(72) |
May
(200) |
Jun
(238) |
Jul
(91) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ho...@us...> - 2025-06-29 16:38:54
|
Revision: 15567 http://sourceforge.net/p/skim-app/code/15567 Author: hofman Date: 2025-06-29 16:38:51 +0000 (Sun, 29 Jun 2025) Log Message: ----------- observe view changes only when we care about it Modified Paths: -------------- trunk/SKMainWindowController_UI.m Modified: trunk/SKMainWindowController_UI.m =================================================================== --- trunk/SKMainWindowController_UI.m 2025-06-29 16:20:01 UTC (rev 15566) +++ trunk/SKMainWindowController_UI.m 2025-06-29 16:38:51 UTC (rev 15567) @@ -138,6 +138,7 @@ @interface SKMainWindowController (UIPrivate) - (void)changeColorProperty:(id)sender; +- (void)handleNoteViewFrameDidChangeNotification:(NSNotification *)notification; @end #pragma mark - @@ -1199,10 +1200,15 @@ - (void)toggleAutoResizeNoteRows:(id)sender { mwcFlags.autoResizeNoteRows = (0 == mwcFlags.autoResizeNoteRows); - if (mwcFlags.autoResizeNoteRows) + if (mwcFlags.autoResizeNoteRows) { [self resetNoteRowHeights]; - else + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNoteViewFrameDidChangeNotification:) + name:NSViewFrameDidChangeNotification object:[rightSideController.noteOutlineView enclosingScrollView]]; + } else { [self autoSizeNoteRows:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self + name:NSViewFrameDidChangeNotification object:[rightSideController.noteOutlineView enclosingScrollView]]; + } } - (void)menuNeedsUpdate:(NSMenu *)menu { @@ -2110,9 +2116,6 @@ name:SKPDFViewCurrentAnnotationChangedNotification object:pdfView]; [nc addObserver:self selector:@selector(handleReadingBarDidChangeNotification:) name:SKPDFViewReadingBarDidChangeNotification object:pdfView]; - // View - [nc addObserver:self selector:@selector(handleNoteViewFrameDidChangeNotification:) - name:NSViewFrameDidChangeNotification object:[rightSideController.noteOutlineView enclosingScrollView]]; // UndoManager NSUndoManager *undoManager = [[self document] undoManager]; [nc addObserver:self selector:@selector(observeUndoManagerCheckpoint:) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-29 16:20:02
|
Revision: 15566 http://sourceforge.net/p/skim-app/code/15566 Author: hofman Date: 2025-06-29 16:20:01 +0000 (Sun, 29 Jun 2025) Log Message: ----------- reuse variable Modified Paths: -------------- trunk/NSDocument_SKExtensions.m Modified: trunk/NSDocument_SKExtensions.m =================================================================== --- trunk/NSDocument_SKExtensions.m 2025-06-29 16:10:02 UTC (rev 15565) +++ trunk/NSDocument_SKExtensions.m 2025-06-29 16:20:01 UTC (rev 15566) @@ -135,14 +135,14 @@ } NSWindow *window = [self primaryWindow]; - if (window) + if (window) { [setup setObject:NSStringFromRect([window frame]) forKey:SKDocumentSetupWindowFrameKey]; + + NSString *tabs = [window tabIndexesInWindows:[[NSApp orderedDocuments] valueForKey:@"primaryWindow"]]; + if (tabs) + [setup setObject:tabs forKey:SKDocumentSetupTabsKey]; + } - NSArray *windows = [[NSApp orderedDocuments] valueForKey:@"primaryWindow"]; - NSString *tabs = [[self primaryWindow] tabIndexesInWindows:windows]; - if (tabs) - [setup setObject:tabs forKey:SKDocumentSetupTabsKey]; - return setup; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-29 16:10:04
|
Revision: 15565 http://sourceforge.net/p/skim-app/code/15565 Author: hofman Date: 2025-06-29 16:10:02 +0000 (Sun, 29 Jun 2025) Log Message: ----------- create tmpData only when needed Modified Paths: -------------- trunk/SKMainDocument.m Modified: trunk/SKMainDocument.m =================================================================== --- trunk/SKMainDocument.m 2025-06-29 16:06:55 UTC (rev 15564) +++ trunk/SKMainDocument.m 2025-06-29 16:10:02 UTC (rev 15565) @@ -881,8 +881,6 @@ PDFDocument *pdfDoc = nil; NSError *error = nil; - tmpData = [[SKTemporaryData alloc] init]; - if ([[NSWorkspace sharedWorkspace] type:docType conformsToType:SKDocumentTypePostScript]) { inData = data; data = [SKConversionProgressController newPDFDataWithPostScriptData:data error:&error]; @@ -892,13 +890,13 @@ pdfDoc = [[SKPDFDocument alloc] initWithData:data]; if (pdfDoc) { + tmpData = [[SKTemporaryData alloc] init]; + [tmpData setPdfDocument:pdfDoc]; [self setPDFData:data]; - [tmpData setPdfDocument:pdfDoc]; [self setOriginalData:inData]; [self updateChangeCount:NSChangeReadOtherContents]; return YES; } else { - tmpData = nil; if (outError != NULL) *outError = error ?: [NSError readFileErrorWithLocalizedDescription:NSLocalizedString(@"Unable to load file", @"Error description")]; return NO; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-29 16:06:56
|
Revision: 15564 http://sourceforge.net/p/skim-app/code/15564 Author: hofman Date: 2025-06-29 16:06:55 +0000 (Sun, 29 Jun 2025) Log Message: ----------- begin modal session only for applying the reverted data, it is not needed when reading the data Modified Paths: -------------- trunk/SKMainDocument.m Modified: trunk/SKMainDocument.m =================================================================== --- trunk/SKMainDocument.m 2025-06-29 15:52:06 UTC (rev 15563) +++ trunk/SKMainDocument.m 2025-06-29 16:06:55 UTC (rev 15564) @@ -1015,9 +1015,13 @@ } - (BOOL)revertToContentsOfURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError{ + + if (NO == [super revertToContentsOfURL:absoluteURL ofType:typeName error:outError]) + return NO; + NSWindow *primaryWindow = [[self primaryWindowController] window]; NSWindow *modalwindow = nil; - NSModalSession session; + NSModalSession session = nil; if ([primaryWindow attachedSheet] == nil && [primaryWindow isMainWindow]) { modalwindow = [[SKAnimatedBorderlessWindow alloc] initWithContentRect:NSZeroRect]; @@ -1026,22 +1030,16 @@ [(SKApplication *)NSApp setUserAttentionDisabled:NO]; } - BOOL success = [super revertToContentsOfURL:absoluteURL ofType:typeName error:outError]; + [self setDataFromTmpData]; + [[self undoManager] removeAllActions]; + [fileUpdateChecker reset]; - if (success) { - [self setDataFromTmpData]; - [[self undoManager] removeAllActions]; - [fileUpdateChecker reset]; - } else { - tmpData = nil; - } - if (modalwindow) { [NSApp endModalSession:session]; [modalwindow orderOut:nil]; } - return success; + return YES; } #pragma mark Printing This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-29 15:52:08
|
Revision: 15563 http://sourceforge.net/p/skim-app/code/15563 Author: hofman Date: 2025-06-29 15:52:06 +0000 (Sun, 29 Jun 2025) Log Message: ----------- invert condition Modified Paths: -------------- trunk/SKBookmarkController.m Modified: trunk/SKBookmarkController.m =================================================================== --- trunk/SKBookmarkController.m 2025-06-29 15:45:37 UTC (rev 15562) +++ trunk/SKBookmarkController.m 2025-06-29 15:52:06 UTC (rev 15563) @@ -250,7 +250,7 @@ } - (BOOL)addRecentDocumentForURL:(NSURL *)fileURL pageIndex:(NSUInteger)pageIndex snapshots:(NSArray *)snapshots { - if (maxRecentDocumentsCount > 0 && appIsTerminating == NO) + if (maxRecentDocumentsCount <= 0 || appIsTerminating) return YES; if (fileURL) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-29 15:45:39
|
Revision: 15562 http://sourceforge.net/p/skim-app/code/15562 Author: hofman Date: 2025-06-29 15:45:37 +0000 (Sun, 29 Jun 2025) Log Message: ----------- use runModalForWindow instead of runModalSession to allow idling Modified Paths: -------------- trunk/SKConversionProgressController.m Modified: trunk/SKConversionProgressController.m =================================================================== --- trunk/SKConversionProgressController.m 2025-06-29 14:37:59 UTC (rev 15561) +++ trunk/SKConversionProgressController.m 2025-06-29 15:45:37 UTC (rev 15562) @@ -314,8 +314,7 @@ } - NSModalSession session = [NSApp beginModalSessionForWindow:[self window]]; - NSInteger rv = NSModalResponseContinue; + NSInteger rv = SKConversionSucceeded; if (provider) { [self convertPostScriptWithProvider:provider]; @@ -327,15 +326,14 @@ } @catch(id exception) { task = nil; - [NSApp stopModalWithCode:SKConversionFailed]; + rv = SKConversionFailed; } } else { - [NSApp stopModalWithCode:SKConversionFailed]; + rv = SKConversionFailed; } - while (rv == NSModalResponseContinue) - rv = [NSApp runModalSession:session]; - [NSApp endModalSession:session]; + if (rv == SKConversionSucceeded) + rv = [NSApp runModalForWindow:[self window]]; if (outputFileURL) [[NSFileManager defaultManager] removeItemAtURL:[outputFileURL URLByDeletingLastPathComponent] error:NULL]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-29 14:38:01
|
Revision: 15561 http://sourceforge.net/p/skim-app/code/15561 Author: hofman Date: 2025-06-29 14:37:59 +0000 (Sun, 29 Jun 2025) Log Message: ----------- rename mainWindowController property to primaryWindowController Modified Paths: -------------- trunk/SKMainDocument.h trunk/SKMainDocument.m trunk/SKNoteWindowController.m Modified: trunk/SKMainDocument.h =================================================================== --- trunk/SKMainDocument.h 2025-06-29 14:35:24 UTC (rev 15560) +++ trunk/SKMainDocument.h 2025-06-29 14:37:59 UTC (rev 15561) @@ -47,7 +47,7 @@ @interface SKMainDocument : NSDocument <SKPDFSynchronizerDelegate> { - SKMainWindowController *mainWindowController; + SKMainWindowController *primaryWindowController; // variables to be saved: NSData *pdfData; @@ -77,7 +77,7 @@ - (IBAction)readNotes:(nullable id)sender; - (IBAction)convertNotes:(nullable id)sender; -@property (nonatomic, nullable, readonly) SKMainWindowController *mainWindowController; +@property (nonatomic, nullable, readonly) SKMainWindowController *primaryWindowController; @property (nonatomic, nullable, readonly) PDFDocument *pdfDocument; @property (nonatomic, nullable, readonly) SKPDFView *pdfView; Modified: trunk/SKMainDocument.m =================================================================== --- trunk/SKMainDocument.m 2025-06-29 14:35:24 UTC (rev 15560) +++ trunk/SKMainDocument.m 2025-06-29 14:37:59 UTC (rev 15561) @@ -157,7 +157,7 @@ @implementation SKMainDocument -@synthesize mainWindowController; +@synthesize primaryWindowController; @dynamic pdfDocument, pdfView, synchronizer, snapshots, presentationOptions, tags, rating, notes, currentPage, activeNote, richText, selectionSpecifier, selectionQDRect, selectionPage, pdfViewSettings; + (BOOL)isPDFDocument { return YES; } @@ -174,10 +174,10 @@ } - (void)makeWindowControllers{ - if (mainWindowController == nil) { - mainWindowController = [[SKMainWindowController alloc] init]; - [mainWindowController setShouldCloseDocument:YES]; - [self addWindowController:mainWindowController]; + if (primaryWindowController == nil) { + primaryWindowController = [[SKMainWindowController alloc] init]; + [primaryWindowController setShouldCloseDocument:YES]; + [self addWindowController:primaryWindowController]; } } @@ -195,13 +195,13 @@ [[self undoManager] disableUndoRegistration]; - [[self mainWindowController] setPdfDocument:pdfDoc addAnnotationsWithProperties:[tmpData noteDicts]]; + [[self primaryWindowController] setPdfDocument:pdfDoc addAnnotationsWithProperties:[tmpData noteDicts]]; [self setPresentationOptions:[tmpData presentationOptions]]; - [[self mainWindowController] setTags:[tmpData openMetaTags]]; + [[self primaryWindowController] setTags:[tmpData openMetaTags]]; - [[self mainWindowController] setRating:[tmpData openMetaRating]]; + [[self primaryWindowController] setRating:[tmpData openMetaRating]]; [[self undoManager] enableUndoRegistration]; @@ -220,7 +220,7 @@ } - (void)showWindows{ - if ([[self mainWindowController] isWindowLoaded] && [[[self mainWindowController] window] isVisible]) { + if ([[self primaryWindowController] isWindowLoaded] && [[[self primaryWindowController] window] isVisible]) { for (NSWindowController *wc in [self windowControllers]) { if ([[wc window] isVisible]) [wc showWindow:nil]; @@ -232,25 +232,25 @@ } - (void)removeWindowController:(NSWindowController *)windowController { - if ([windowController isEqual:mainWindowController]) - mainWindowController = nil; + if ([windowController isEqual:primaryWindowController]) + primaryWindowController = nil; [super removeWindowController:windowController]; } - (void)saveRecentDocumentInfo { - if ([[mainWindowController window] delegate] == nil) + if ([[primaryWindowController window] delegate] == nil) return; NSURL *fileURL = [self fileURL]; NSUInteger pageIndex = [[[self pdfView] currentPage] pageIndex]; - NSArray *snapshots = [[[self mainWindowController] snapshots] valueForKey:SKSnapshotCurrentSetupKey]; + NSArray *snapshots = [[[self primaryWindowController] snapshots] valueForKey:SKSnapshotCurrentSetupKey]; if ([[SKBookmarkController sharedBookmarkController] addRecentDocumentForURL:fileURL pageIndex:pageIndex snapshots:[snapshots count] > 0 ? snapshots : nil]) [self setRecentInfoNeedsUpdate:NO]; } - (void)applySetup:(NSDictionary *)setup { - if ([self mainWindowController] == nil) + if ([self primaryWindowController] == nil) [self makeWindowControllers]; - [[self mainWindowController] applySetup:setup]; + [[self primaryWindowController] applySetup:setup]; } - (void)applyOptions:(NSDictionary *)options { @@ -281,7 +281,7 @@ } } if ([searchString length] > 0) { - [[self mainWindowController] setSearchString:searchString]; + [[self primaryWindowController] setSearchString:searchString]; } } @@ -307,26 +307,26 @@ } - (SKInteractionMode)interactionMode { - return [[self mainWindowController] interactionMode]; + return [[self primaryWindowController] interactionMode]; } - (void)setInteractionMode:(SKInteractionMode)mode { if (mode == SKNormalMode) { - if ([[self mainWindowController] canExitFullscreen]) - [[self mainWindowController] exitFullscreen]; - else if ([[self mainWindowController] canExitPresentation]) - [[self mainWindowController] exitPresentation]; + if ([[self primaryWindowController] canExitFullscreen]) + [[self primaryWindowController] exitFullscreen]; + else if ([[self primaryWindowController] canExitPresentation]) + [[self primaryWindowController] exitPresentation]; } else if (mode == SKFullScreenMode) { - if ([[self mainWindowController] canEnterFullscreen]) - [[self mainWindowController] enterFullscreen]; + if ([[self primaryWindowController] canEnterFullscreen]) + [[self primaryWindowController] enterFullscreen]; } else if (mode == SKPresentationMode) { - if ([[self mainWindowController] canEnterPresentation]) - [[self mainWindowController] enterPresentation]; + if ([[self primaryWindowController] canEnterPresentation]) + [[self primaryWindowController] enterPresentation]; } } - (BOOL)canExitPresentation { - return [[self mainWindowController] canExitPresentation]; + return [[self primaryWindowController] canExitPresentation]; } #pragma mark Writing @@ -478,7 +478,7 @@ - (NSArray *)SkimNoteProperties { NSArray *array = [super SkimNoteProperties]; - NSArray *widgetProperties = [[self mainWindowController] widgetProperties]; + NSArray *widgetProperties = [[self primaryWindowController] widgetProperties]; if ([widgetProperties count]) array = [array arrayByAddingObjectsFromArray:widgetProperties]; if (pageOffsets != nil) { @@ -1015,7 +1015,7 @@ } - (BOOL)revertToContentsOfURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError{ - NSWindow *primaryWindow = [[self mainWindowController] window]; + NSWindow *primaryWindow = [[self primaryWindowController] window]; NSWindow *modalwindow = nil; NSModalSession session; @@ -1084,7 +1084,7 @@ - (IBAction)copyURL:(id)sender { NSURL *skimURL = [[[self pdfView] currentPage] skimURL]; if (skimURL) { - NSString *searchString = [mainWindowController searchString]; + NSString *searchString = [primaryWindowController searchString]; if ([searchString length] > 0) { searchString = [searchString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]]; NSURLComponents *components = [[NSURLComponents alloc] initWithURL:skimURL resolvingAgainstBaseURL:NO]; @@ -1114,7 +1114,7 @@ } if (array) { - [[self mainWindowController] addAnnotationsWithProperties:array replacing:replace]; + [[self primaryWindowController] addAnnotationsWithProperties:array replacing:replace]; [[self undoManager] setActionName:replace ? NSLocalizedString(@"Replace Notes", @"Undo action name") : NSLocalizedString(@"Add Notes", @"Undo action name")]; } else NSBeep(); @@ -1158,7 +1158,7 @@ } - (void)convertNotesUsingPDFDocument:(PDFDocument *)pdfDocWithoutNotes completionHandler:(void (^)(void))completionHandler { - [[self mainWindowController] beginProgressSheetWithMessage:[NSLocalizedString(@"Converting notes", @"Message for progress sheet") stringByAppendingEllipsis] maxValue:0]; + [[self primaryWindowController] beginProgressSheetWithMessage:[NSLocalizedString(@"Converting notes", @"Message for progress sheet") stringByAppendingEllipsis] maxValue:0]; NSMapTable *offsets = nil; NSMutableArray *annotations = nil; @@ -1208,13 +1208,13 @@ dispatch_async(dispatch_get_main_queue(), ^{ - [[self mainWindowController] addConvertedAnnotationsWithProperties:noteDicts removeAnnotations:annotations]; + [[self primaryWindowController] addConvertedAnnotationsWithProperties:noteDicts removeAnnotations:annotations]; [self setPDFData:data pageOffsets:offsets]; [[self undoManager] setActionName:NSLocalizedString(@"Convert Notes", @"Undo action name")]; - [[self mainWindowController] dismissProgressSheet]; + [[self primaryWindowController] dismissProgressSheet]; if (completionHandler) completionHandler(); @@ -1225,7 +1225,7 @@ } else { - [[self mainWindowController] dismissProgressSheet]; + [[self primaryWindowController] dismissProgressSheet]; if (completionHandler) completionHandler(); @@ -1238,7 +1238,7 @@ SKTextFieldSheetController *passwordSheetController = [[SKTextFieldSheetController alloc] initWithWindowNibName:@"PasswordSheet"]; [passwordSheetController setInformativeText:NSLocalizedString(@"The document requires a password to be converted", @"Informative text")]; - [passwordSheetController beginSheetModalForWindow:[[self mainWindowController] window] completionHandler:^(NSModalResponse result) { + [passwordSheetController beginSheetModalForWindow:[[self primaryWindowController] window] completionHandler:^(NSModalResponse result) { if (result == NSModalResponseOK) { [[passwordSheetController window] orderOut:nil]; @@ -1377,7 +1377,7 @@ [alert setInformativeText:NSLocalizedString(@"Your current changes will be lost.", @"Informative text in alert dialog")]; [alert addButtonWithTitle:NSLocalizedString(@"Revert", @"Button title")]; [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"Button title")]; - [alert beginSheetModalForWindow:[[self mainWindowController] window] completionHandler:^(NSModalResponse returnCode){ + [alert beginSheetModalForWindow:[[self primaryWindowController] window] completionHandler:^(NSModalResponse returnCode){ if (returnCode == NSAlertFirstButtonReturn) { NSError *error = nil; if (NO == [self revertToContentsOfURL:[self fileURL] ofType:[self fileType] error:&error] && [error isUserCancelledError] == NO) { @@ -1393,12 +1393,12 @@ } - (void)performFindPanelAction:(id)sender { - [[self mainWindowController] performFindPanelAction:sender]; + [[self primaryWindowController] performFindPanelAction:sender]; } - (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)anItem { if ([anItem action] == @selector(revertDocumentToSaved:)) { - if ([self fileURL] == nil || [[self fileURL] checkResourceIsReachableAndReturnError:NULL] == NO || [[self mainWindowController] interactionMode] == SKPresentationMode) + if ([self fileURL] == nil || [[self fileURL] checkResourceIsReachableAndReturnError:NULL] == NO || [[self primaryWindowController] interactionMode] == SKPresentationMode) return NO; if ([self isDocumentEdited] || [fileUpdateChecker fileChangedOnDisk] || NSOrderedAscending == [[self fileModificationDate] compare:fileModificationDate([self fileURL])]) @@ -1409,7 +1409,7 @@ } else if ([anItem action] == @selector(readNotes:)) { return [[self pdfDocument] allowsNotes]; } else if ([anItem action] == @selector(performFindPanelAction:)) { - if ([[self mainWindowController] interactionMode] == SKPresentationMode) + if ([[self primaryWindowController] interactionMode] == SKPresentationMode) return NO; switch ([anItem tag]) { case NSFindPanelActionShowFindPanel: @@ -1429,7 +1429,7 @@ } - (void)remoteButtonPressed:(NSEvent *)theEvent { - [[self mainWindowController] remoteButtonPressed:theEvent]; + [[self primaryWindowController] remoteButtonPressed:theEvent]; } - (void)printDocument:(id)sender { @@ -1440,7 +1440,7 @@ SKTextFieldSheetController *passwordSheetController = [[SKTextFieldSheetController alloc] initWithWindowNibName:@"PasswordSheet"]; [passwordSheetController setInformativeText:NSLocalizedString(@"The document requires a password to be printed", @"Informative text")]; - [passwordSheetController beginSheetModalForWindow:[[self mainWindowController] window] completionHandler:^(NSModalResponse result) { + [passwordSheetController beginSheetModalForWindow:[[self primaryWindowController] window] completionHandler:^(NSModalResponse result) { if (result == NSModalResponseOK) { [[passwordSheetController window] orderOut:nil]; [pdfDoc unlockWithPassword:[passwordSheetController stringValue]]; @@ -1598,26 +1598,26 @@ #pragma mark Accessors - (NSWindow *)primaryWindow { - return [mainWindowController window]; + return [primaryWindowController window]; } - (PDFDocument *)pdfDocument{ - return [[self mainWindowController] pdfDocument]; + return [[self primaryWindowController] pdfDocument]; } - (PDFDocument *)placeholderPdfDocument{ - return [[self mainWindowController] placeholderPdfDocument]; + return [[self primaryWindowController] placeholderPdfDocument]; } - (NSDictionary *)currentDocumentSetup { NSMutableDictionary *setup = [[super currentDocumentSetup] mutableCopy]; if ([setup count]) - [setup addEntriesFromDictionary:[[self mainWindowController] currentSetup]]; + [setup addEntriesFromDictionary:[[self primaryWindowController] currentSetup]]; return setup; } - (SKPDFView *)pdfView { - return [[self mainWindowController] pdfView]; + return [[self primaryWindowController] pdfView]; } - (BOOL)recentInfoNeedsUpdate { @@ -1629,7 +1629,7 @@ } - (NSDictionary *)presentationOptions { - SKTransitionController *transitions = [[self mainWindowController] transitionControllerCreating:NO]; + SKTransitionController *transitions = [[self primaryWindowController] transitionControllerCreating:NO]; SKTransitionInfo *transition = [transitions transition]; NSArray *pageTransitions = [transitions pageTransitions]; NSMutableDictionary *options = nil; @@ -1641,7 +1641,7 @@ } - (void)setPresentationOptions:(NSDictionary *)dictionary { - SKTransitionController *transitions = [[self mainWindowController] transitionControllerCreating:dictionary != nil]; + SKTransitionController *transitions = [[self primaryWindowController] transitionControllerCreating:dictionary != nil]; if (dictionary == nil) { NSUInteger count = [[transitions pageTransitions] count]; if (count == 0 || count + 1 == [[self pdfDocument] pageCount]) @@ -1653,19 +1653,19 @@ } - (NSArray *)snapshots { - return [[self mainWindowController] snapshots]; + return [[self primaryWindowController] snapshots]; } - (NSArray *)tags { - return [[self mainWindowController] tags] ?: @[]; + return [[self primaryWindowController] tags] ?: @[]; } - (double)rating { - return [[self mainWindowController] rating]; + return [[self primaryWindowController] rating]; } - (NSMenu *)notesMenu { - return [[self mainWindowController] notesMenu]; + return [[self primaryWindowController] notesMenu]; } #pragma mark Passwords @@ -1721,15 +1721,15 @@ #pragma mark Scripting support - (BOOL)hasNotes { - return [[self mainWindowController] hasNotes]; + return [[self primaryWindowController] hasNotes]; } - (NSArray *)notes { - return [[self mainWindowController] notes]; + return [[self primaryWindowController] notes]; } - (PDFAnnotation *)valueInNotesWithUniqueID:(NSString *)aUniqueID { - for (PDFAnnotation *annotation in [[self mainWindowController] notes]) { + for (PDFAnnotation *annotation in [[self primaryWindowController] notes]) { if ([[annotation uniqueID] isEqualToString:aUniqueID]) return annotation; } @@ -1767,19 +1767,19 @@ } - (BOOL)isOutlineExpanded:(PDFOutline *)outline { - return [[self mainWindowController] isOutlineExpanded:outline]; + return [[self primaryWindowController] isOutlineExpanded:outline]; } - (void)setExpanded:(BOOL)flag forOutline:(PDFOutline *)outline { - [[self mainWindowController] setExpanded:flag forOutline:outline]; + [[self primaryWindowController] setExpanded:flag forOutline:outline]; } - (PDFPage *)currentPage { - return [mainWindowController currentPage]; + return [primaryWindowController currentPage]; } - (void)setCurrentPage:(PDFPage *)page { - [mainWindowController setCurrentPage:page]; + [primaryWindowController setCurrentPage:page]; } - (NSData *)currentQDPoint { @@ -1847,11 +1847,11 @@ } - (NSArray *)noteSelection { - return [[self mainWindowController] selectedNotes]; + return [[self primaryWindowController] selectedNotes]; } - (void)setNoteSelection:(NSArray *)newNoteSelection { - return [[self mainWindowController] setSelectedNotes:newNoteSelection]; + return [[self primaryWindowController] setSelectedNotes:newNoteSelection]; } - (NSDictionary *)pdfViewSettings { @@ -1878,23 +1878,23 @@ } - (NSDocument *)presentationNotesDocument { - return [[self mainWindowController] presentationNotesDocument]; + return [[self primaryWindowController] presentationNotesDocument]; } - (void)setPresentationNotesDocument:(NSDocument *)document { if ([document isPDFDocument] && [document countOfPages] == [self countOfPages]) { - [[self mainWindowController] setPresentationNotesDocument:document]; + [[self primaryWindowController] setPresentationNotesDocument:document]; if (document != self) - [[self mainWindowController] setPresentationNotesOffset:0]; + [[self primaryWindowController] setPresentationNotesOffset:0]; } } - (NSInteger)presentationNotesOffset { - return [[self mainWindowController] presentationNotesOffset]; + return [[self primaryWindowController] presentationNotesOffset]; } - (void)setPresentationNotesOffset:(NSInteger)offset { - [[self mainWindowController] setPresentationNotesOffset:offset]; + [[self primaryWindowController] setPresentationNotesOffset:offset]; } - (BOOL)isPDFDocument { @@ -2045,8 +2045,8 @@ if ([location isKindOfClass:[PDFPage class]]) { id pointData = [args objectForKey:@"At"]; - if ([mainWindowController interactionMode] == SKPresentationMode) { - [mainWindowController setCurrentPage:(PDFPage *)location]; + if ([primaryWindowController interactionMode] == SKPresentationMode) { + [primaryWindowController setCurrentPage:(PDFPage *)location]; } else if ([pointData isKindOfClass:[NSData class]]) { NSPoint point = [(NSData *)pointData pointValueAsQDPoint]; [[self pdfView] goToDestination:[[PDFDestination alloc] initWithPage:(PDFPage *)location atPoint:point]]; @@ -2053,7 +2053,7 @@ } else { [[self pdfView] goToCurrentPage:(PDFPage *)location]; } - } else if ([mainWindowController interactionMode] == SKPresentationMode) { + } else if ([primaryWindowController interactionMode] == SKPresentationMode) { } else if ([location isKindOfClass:[PDFAnnotation class]]) { [[self pdfView] scrollAnnotationToVisible:(PDFAnnotation *)location]; } else if ([location isKindOfClass:[PDFOutline class]]) { Modified: trunk/SKNoteWindowController.m =================================================================== --- trunk/SKNoteWindowController.m 2025-06-29 14:35:24 UTC (rev 15560) +++ trunk/SKNoteWindowController.m 2025-06-29 14:37:59 UTC (rev 15561) @@ -257,9 +257,9 @@ if ([self commitEditing] == NO) [self discardEditing]; if ([[self window] isKeyWindow]) - [[[[self document] mainWindowController] window] makeKeyWindow]; + [[[[self document] primaryWindowController] window] makeKeyWindow]; else if ([[self window] isMainWindow]) - [[[[self document] mainWindowController] window] makeMainWindow]; + [[[[self document] primaryWindowController] window] makeMainWindow]; if (previewURL) [self endPreviewPanelControl:nil]; @try { [textView unbind:[self isNoteType] ? @"attributedString" : @"value"]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-29 14:35:27
|
Revision: 15560 http://sourceforge.net/p/skim-app/code/15560 Author: hofman Date: 2025-06-29 14:35:24 +0000 (Sun, 29 Jun 2025) Log Message: ----------- rename mainWindow property to primaryWindow to avoid confusion with NSApp's mainWindow Modified Paths: -------------- trunk/NSDocument_SKExtensions.h trunk/NSDocument_SKExtensions.m trunk/SKDocumentController.m trunk/SKMainDocument.m trunk/SKMainWindowController_FullScreen.m trunk/SKNotesDocument.m Modified: trunk/NSDocument_SKExtensions.h =================================================================== --- trunk/NSDocument_SKExtensions.h 2025-06-28 17:00:08 UTC (rev 15559) +++ trunk/NSDocument_SKExtensions.h 2025-06-29 14:35:24 UTC (rev 15560) @@ -54,7 +54,7 @@ + (BOOL)isPDFDocument; -@property (nonatomic, nullable, readonly) NSWindow *mainWindow; +@property (nonatomic, nullable, readonly) NSWindow *primaryWindow; - (IBAction)copyURL:(nullable id)sender; Modified: trunk/NSDocument_SKExtensions.m =================================================================== --- trunk/NSDocument_SKExtensions.m 2025-06-28 17:00:08 UTC (rev 15559) +++ trunk/NSDocument_SKExtensions.m 2025-06-29 14:35:24 UTC (rev 15560) @@ -67,7 +67,7 @@ + (BOOL)isPDFDocument { return NO; } -- (NSWindow *)mainWindow { +- (NSWindow *)primaryWindow { return [[[self windowControllers] firstObject] window]; } @@ -92,12 +92,12 @@ - (NSMenu *)notesMenu { return nil; } - (SKInteractionMode)interactionMode { - return ([[self mainWindow] styleMask] & NSWindowStyleMaskFullScreen) == 0 ? SKNormalMode : SKFullScreenMode; + return ([[self primaryWindow] styleMask] & NSWindowStyleMaskFullScreen) == 0 ? SKNormalMode : SKFullScreenMode; } - (void)setInteractionMode:(SKInteractionMode)mode { if (mode != [self interactionMode] && (mode == SKFullScreenMode || mode == SKNormalMode)) - [[self mainWindow] toggleFullScreen:nil]; + [[self primaryWindow] toggleFullScreen:nil]; } - (BOOL)canExitPresentation { return NO; } @@ -134,12 +134,12 @@ [setup setObject:data forKey:[alias isBookmark] ? SKDocumentSetupBookmarkKey : SKDocumentSetupAliasKey]; } - NSWindow *window = [self mainWindow]; + NSWindow *window = [self primaryWindow]; if (window) [setup setObject:NSStringFromRect([window frame]) forKey:SKDocumentSetupWindowFrameKey]; - NSArray *windows = [[NSApp orderedDocuments] valueForKey:@"mainWindow"]; - NSString *tabs = [[self mainWindow] tabIndexesInWindows:windows]; + NSArray *windows = [[NSApp orderedDocuments] valueForKey:@"primaryWindow"]; + NSString *tabs = [[self primaryWindow] tabIndexesInWindows:windows]; if (tabs) [setup setObject:tabs forKey:SKDocumentSetupTabsKey]; Modified: trunk/SKDocumentController.m =================================================================== --- trunk/SKDocumentController.m 2025-06-28 17:00:08 UTC (rev 15559) +++ trunk/SKDocumentController.m 2025-06-29 14:35:24 UTC (rev 15560) @@ -381,8 +381,8 @@ } [self openDocumentWithBookmark:child completionHandler:^(NSDocument *document, BOOL documentWasAlreadyOpen, NSError *error){ - if (windows && [document mainWindow]) - [windows replaceObjectAtIndex:i withObject:[document mainWindow]]; + if (windows && [document primaryWindow]) + [windows replaceObjectAtIndex:i withObject:[document primaryWindow]]; if (document == nil && error) { if (errors == nil) errors = [[NSMutableArray alloc] init]; Modified: trunk/SKMainDocument.m =================================================================== --- trunk/SKMainDocument.m 2025-06-28 17:00:08 UTC (rev 15559) +++ trunk/SKMainDocument.m 2025-06-29 14:35:24 UTC (rev 15560) @@ -1015,11 +1015,11 @@ } - (BOOL)revertToContentsOfURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError{ - NSWindow *mainWindow = [[self mainWindowController] window]; + NSWindow *primaryWindow = [[self mainWindowController] window]; NSWindow *modalwindow = nil; NSModalSession session; - if ([mainWindow attachedSheet] == nil && [mainWindow isMainWindow]) { + if ([primaryWindow attachedSheet] == nil && [primaryWindow isMainWindow]) { modalwindow = [[SKAnimatedBorderlessWindow alloc] initWithContentRect:NSZeroRect]; [(SKApplication *)NSApp setUserAttentionDisabled:YES]; session = [NSApp beginModalSessionForWindow:modalwindow]; @@ -1597,7 +1597,7 @@ #pragma mark Accessors -- (NSWindow *)mainWindow { +- (NSWindow *)primaryWindow { return [mainWindowController window]; } Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-06-28 17:00:08 UTC (rev 15559) +++ trunk/SKMainWindowController_FullScreen.m 2025-06-29 14:35:24 UTC (rev 15560) @@ -242,7 +242,7 @@ NSScreen *screen = [normalWindow screen]; if ([self presentationNotesDocument] && [self presentationNotesDocument] != [self document]) { - NSArray *screens = [[[[self presentationNotesDocument] mainWindow] screen] alternateScreens]; + NSArray *screens = [[[[self presentationNotesDocument] primaryWindow] screen] alternateScreens]; if ([screens count] > 0 && [screens containsObject:[screen primaryScreen]] == NO) screen = [screens firstObject]; } Modified: trunk/SKNotesDocument.m =================================================================== --- trunk/SKNotesDocument.m 2025-06-28 17:00:08 UTC (rev 15559) +++ trunk/SKNotesDocument.m 2025-06-29 14:35:24 UTC (rev 15560) @@ -596,12 +596,12 @@ } - (IBAction)toggleFullscreen:(id)sender { - [[self mainWindow] toggleFullScreen:sender]; + [[self primaryWindow] toggleFullScreen:sender]; } - (void)performFindPanelAction:(id)sender { if ([sender tag] == NSFindPanelActionShowFindPanel) { - NSToolbar *toolbar = [[self mainWindow] toolbar]; + NSToolbar *toolbar = [[self primaryWindow] toolbar]; if ([[[toolbar items] valueForKey:@"itemIdentifier"] containsObject:SKNotesDocumentSearchToolbarItemIdentifier] == NO) [toolbar insertItemWithItemIdentifier:SKNotesDocumentSearchToolbarItemIdentifier atIndex:0]; if ([toolbar displayMode] == NSToolbarDisplayModeLabelOnly) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-28 17:00:11
|
Revision: 15559 http://sourceforge.net/p/skim-app/code/15559 Author: hofman Date: 2025-06-28 17:00:08 +0000 (Sat, 28 Jun 2025) Log Message: ----------- revert an earlier commit to set side pane width, we don't always set from settings Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-06-28 16:55:23 UTC (rev 15558) +++ trunk/SKMainWindowController.m 2025-06-28 17:00:08 UTC (rev 15559) @@ -189,7 +189,7 @@ - (SKDestination)destinationFromSetup:(NSDictionary *)setup; - (void)setDestination:(SKDestination)dest inSetup:(NSMutableDictionary *)setup; -- (void)applySideWidthsFromSetup:(NSDictionary *)setup; +- (void)applyLeftSideWidth:(CGFloat)leftSideWidth rightSideWidth:(CGFloat)rightSideWidth; - (void)updateTableFont; @@ -426,7 +426,10 @@ [pdfView setDelegate:self]; - [self applySideWidthsFromSetup:savedNormalSetup]; + NSNumber *leftWidthNumber = [savedNormalSetup objectForKey:LEFTSIDEPANEWIDTH_KEY] ?: [sud objectForKey:SKLeftSidePaneWidthKey]; + NSNumber *rightWidthNumber = [savedNormalSetup objectForKey:RIGHTSIDEPANEWIDTH_KEY] ?: [sud objectForKey:SKRightSidePaneWidthKey]; + if (leftWidthNumber && rightWidthNumber) + [self applyLeftSideWidth:[leftWidthNumber doubleValue] rightSideWidth:[rightWidthNumber doubleValue]]; // this needs to be done before loading the PDFDocument [self resetThumbnailSizeIfNeeded]; @@ -545,13 +548,9 @@ mwcFlags.settingUpWindow = 0; } -- (void)applySideWidthsFromSetup:(NSDictionary *)setup { - NSNumber *leftWidth = [setup objectForKey:LEFTSIDEPANEWIDTH_KEY]; - NSNumber *rightWidth = [setup objectForKey:RIGHTSIDEPANEWIDTH_KEY]; - if (leftWidth && rightWidth) { - [splitView setPosition:[leftWidth doubleValue] ofDividerAtIndex:0]; - [splitView setPosition:[splitView maxPossiblePositionOfDividerAtIndex:1] - [splitView dividerThickness] - [rightWidth doubleValue] ofDividerAtIndex:1]; - } +- (void)applyLeftSideWidth:(CGFloat)leftSideWidth rightSideWidth:(CGFloat)rightSideWidth { + [splitView setPosition:leftSideWidth ofDividerAtIndex:0]; + [splitView setPosition:[splitView maxPossiblePositionOfDividerAtIndex:1] - [splitView dividerThickness] - rightSideWidth ofDividerAtIndex:1]; } - (void)applySetup:(NSDictionary *)setup{ @@ -569,7 +568,10 @@ [savedNormalWindow setFrame:NSRectFromString(rectString) display:NO]; } - [self applySideWidthsFromSetup:setup]; + NSNumber *leftWidthNumber = [setup objectForKey:LEFTSIDEPANEWIDTH_KEY]; + NSNumber *rightWidthNumber = [setup objectForKey:RIGHTSIDEPANEWIDTH_KEY]; + if (leftWidthNumber && rightWidthNumber) + [self applyLeftSideWidth:[leftWidthNumber doubleValue] rightSideWidth:[rightWidthNumber doubleValue]]; if ([[pdfView document] isLocked]) { NSArray *snapshotSetups = [savedNormalSetup objectForKey:SNAPSHOTS_KEY]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-28 16:55:26
|
Revision: 15558 http://sourceforge.net/p/skim-app/code/15558 Author: hofman Date: 2025-06-28 16:55:23 +0000 (Sat, 28 Jun 2025) Log Message: ----------- Display summary of display settings in preferences Modified Paths: -------------- trunk/Base.lproj/GeneralPreferences.xib trunk/NSValueTransformer_SKExtensions.h trunk/NSValueTransformer_SKExtensions.m Modified: trunk/Base.lproj/GeneralPreferences.xib =================================================================== --- trunk/Base.lproj/GeneralPreferences.xib 2025-06-28 09:21:29 UTC (rev 15557) +++ trunk/Base.lproj/GeneralPreferences.xib 2025-06-28 16:55:23 UTC (rev 15558) @@ -15,7 +15,7 @@ <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> <customObject id="-3" userLabel="Application" customClass="NSObject"/> <customView translatesAutoresizingMaskIntoConstraints="NO" id="1"> - <rect key="frame" x="0.0" y="0.0" width="340" height="451"/> + <rect key="frame" x="0.0" y="0.0" width="412" height="451"/> <subviews> <button toolTip="Open the contents pane only when the file has a table of contents" horizontalHuggingPriority="252" verticalHuggingPriority="750" imageHugsTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3"> <rect key="frame" x="18" y="317" width="252" height="18"/> @@ -38,10 +38,10 @@ </connections> </button> <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="5"> - <rect key="frame" x="12" y="372" width="316" height="5"/> + <rect key="frame" x="12" y="372" width="388" height="5"/> </box> <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="6"> - <rect key="frame" x="12" y="91" width="316" height="5"/> + <rect key="frame" x="12" y="91" width="388" height="5"/> </box> <textField horizontalHuggingPriority="252" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7" userLabel="Check for Skim updates:"> <rect key="frame" x="18" y="109" width="153" height="16"/> @@ -52,7 +52,7 @@ </textFieldCell> </textField> <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="8"> - <rect key="frame" x="12" y="136" width="316" height="5"/> + <rect key="frame" x="12" y="136" width="388" height="5"/> </box> <popUpButton horizontalHuggingPriority="252" verticalHuggingPriority="750" imageHugsTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9"> <rect key="frame" x="174" y="102" width="88" height="25"/> @@ -85,7 +85,7 @@ </connections> </button> <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="11"> - <rect key="frame" x="12" y="199" width="316" height="5"/> + <rect key="frame" x="12" y="199" width="388" height="5"/> </box> <button toolTip="Automatically save a Skim notes file with the same file name whenever you save a PDF file" horizontalHuggingPriority="252" verticalHuggingPriority="750" imageHugsTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="12"> <rect key="frame" x="18" y="150" width="265" height="18"/> @@ -98,7 +98,7 @@ </connections> </button> <button toolTip="Choose this to use different PDF view settings in full screen mode and normal mode" horizontalHuggingPriority="252" verticalHuggingPriority="750" tag="1" imageHugsTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="13" userLabel="Full Screen Button"> - <rect key="frame" x="169" y="207" width="68" height="32"/> + <rect key="frame" x="204" y="207" width="68" height="32"/> <buttonCell key="cell" type="push" title="Edit…" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="37"> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <font key="font" metaFont="system"/> @@ -108,7 +108,7 @@ </connections> </button> <button toolTip="Set the initial PDF view settings for newly opened documents" horizontalHuggingPriority="252" verticalHuggingPriority="750" imageHugsTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="14" userLabel="Normal Button"> - <rect key="frame" x="169" y="239" width="68" height="32"/> + <rect key="frame" x="204" y="239" width="68" height="32"/> <buttonCell key="cell" type="push" title="Edit…" bezelStyle="rounded" alignment="center" borderStyle="border" inset="2" id="36"> <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> <font key="font" metaFont="system"/> @@ -145,7 +145,7 @@ </connections> </button> <box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="19"> - <rect key="frame" x="12" y="50" width="316" height="5"/> + <rect key="frame" x="12" y="50" width="388" height="5"/> </box> <textField horizontalHuggingPriority="252" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="20" userLabel="Save passwords in Keychain:"> <rect key="frame" x="18" y="23" width="178" height="16"/> @@ -234,15 +234,75 @@ <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> </textFieldCell> </textField> + <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="krj-lQ-Yls"> + <rect key="frame" x="184" y="250" width="19" height="15"/> + <constraints> + <constraint firstAttribute="height" constant="15" id="Fco-v2-LYc"/> + <constraint firstAttribute="width" constant="19" id="ZuU-AQ-CjZ"/> + </constraints> + <imageCell key="cell" refusesFirstResponder="YES" alignment="left" id="b6u-6B-WAW"/> + <connections> + <binding destination="58" name="value" keyPath="values.SKDefaultPDFDisplaySettings" id="Dcp-T4-6yk"> + <dictionary key="options"> + <string key="NSValueTransformerName">SKDisplayModeImage</string> + </dictionary> + </binding> + </connections> + </imageView> + <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="fiY-dG-n4g"> + <rect key="frame" x="174" y="249" width="4" height="16"/> + <textFieldCell key="cell" lineBreakMode="clipping" id="w0W-AB-7oK"> + <font key="font" metaFont="system"/> + <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> + <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> + </textFieldCell> + <connections> + <binding destination="58" name="value" keyPath="values.SKDefaultPDFDisplaySettings" id="xBf-SL-3gZ"> + <dictionary key="options"> + <string key="NSValueTransformerName">SKScaleFactor</string> + </dictionary> + </binding> + </connections> + </textField> + <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hdM-1x-c8a"> + <rect key="frame" x="174" y="217" width="4" height="16"/> + <textFieldCell key="cell" lineBreakMode="clipping" id="JUa-v7-AnV"> + <font key="font" metaFont="system"/> + <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> + <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/> + </textFieldCell> + <connections> + <binding destination="58" name="value" keyPath="values.SKDefaultFullScreenPDFDisplaySettings" id="4vV-z6-pim"> + <dictionary key="options"> + <string key="NSValueTransformerName">SKScaleFactor</string> + </dictionary> + </binding> + </connections> + </textField> + <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="C1M-te-Zg5"> + <rect key="frame" x="184" y="218" width="19" height="15"/> + <constraints> + <constraint firstAttribute="width" constant="19" id="9Id-kP-ZDw"/> + <constraint firstAttribute="height" constant="15" id="GRN-4I-yh1"/> + </constraints> + <imageCell key="cell" refusesFirstResponder="YES" alignment="left" id="Mw7-rW-fRV"/> + <connections> + <binding destination="58" name="value" keyPath="values.SKDefaultFullScreenPDFDisplaySettings" id="AAS-In-clw"> + <dictionary key="options"> + <string key="NSValueTransformerName">SKDisplayModeImage</string> + </dictionary> + </binding> + </connections> + </imageView> </subviews> <constraints> <constraint firstItem="11" firstAttribute="top" secondItem="13" secondAttribute="bottom" constant="12" id="0FC-yH-TEU"/> <constraint firstItem="10" firstAttribute="top" secondItem="3" secondAttribute="bottom" constant="6" symbolic="YES" id="0kE-Qf-IKS"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="18" secondAttribute="trailing" constant="20" symbolic="YES" id="1dC-9R-56p"/> - <constraint firstItem="14" firstAttribute="leading" secondItem="15" secondAttribute="trailing" constant="8" symbolic="YES" id="1pJ-ZZ-JaA"/> <constraint firstItem="YMN-MA-BZc" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="20r-lI-K3p"/> <constraint firstItem="f9u-Df-2s9" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="1" secondAttribute="leading" constant="20" symbolic="YES" id="32P-dV-Eex"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="13" secondAttribute="trailing" constant="20" symbolic="YES" id="3k2-tt-YTb"/> + <constraint firstItem="14" firstAttribute="leading" secondItem="krj-lQ-Yls" secondAttribute="trailing" constant="8" symbolic="YES" id="4l7-ly-FGP"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="hos-Of-u1Q" secondAttribute="trailing" constant="20" symbolic="YES" id="6l3-zE-gSM"/> <constraint firstItem="3" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="7ep-6b-PdA"/> <constraint firstItem="14" firstAttribute="leading" secondItem="13" secondAttribute="leading" id="8iP-uW-VDS"/> @@ -249,8 +309,10 @@ <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="9" secondAttribute="trailing" constant="20" symbolic="YES" id="9zb-Rk-CmA"/> <constraint firstItem="lVN-xI-ijg" firstAttribute="top" secondItem="hos-Of-u1Q" secondAttribute="bottom" constant="8" symbolic="YES" id="A23-MT-CLp"/> <constraint firstItem="19" firstAttribute="leading" secondItem="5" secondAttribute="leading" id="CG0-Ds-aXI"/> + <constraint firstItem="C1M-te-Zg5" firstAttribute="centerY" secondItem="f9u-Df-2s9" secondAttribute="centerY" id="CYv-P4-hyq"/> <constraint firstItem="3" firstAttribute="top" secondItem="ClK-rQ-vsN" secondAttribute="bottom" constant="8" symbolic="YES" id="Dcc-qq-NoQ"/> <constraint firstItem="15" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="Doc-wp-yxY"/> + <constraint firstItem="hdM-1x-c8a" firstAttribute="firstBaseline" secondItem="f9u-Df-2s9" secondAttribute="firstBaseline" id="EVP-yw-5EN"/> <constraint firstItem="5" firstAttribute="top" secondItem="lVN-xI-ijg" secondAttribute="bottom" constant="12" id="EXD-Ez-Qk4"/> <constraint firstItem="6" firstAttribute="leading" secondItem="5" secondAttribute="leading" id="GHw-r2-IJp"/> <constraint firstItem="YMN-MA-BZc" firstAttribute="top" secondItem="11" secondAttribute="bottom" constant="12" id="GZE-6M-v8w"/> @@ -263,13 +325,17 @@ <constraint firstItem="f9u-Df-2s9" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="Kj1-8n-wxA"/> <constraint firstItem="ClK-rQ-vsN" firstAttribute="top" secondItem="5" secondAttribute="bottom" constant="12" id="Lpu-p7-gyl"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="14" secondAttribute="trailing" constant="20" symbolic="YES" id="Lyc-Te-X32"/> + <constraint firstItem="fiY-dG-n4g" firstAttribute="leading" secondItem="15" secondAttribute="trailing" constant="8" symbolic="YES" id="Mem-6q-ZD4"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="15" secondAttribute="trailing" constant="20" symbolic="YES" id="Nkq-Ax-nJg"/> <constraint firstItem="lVN-xI-ijg" firstAttribute="leading" secondItem="1" secondAttribute="leading" constant="32" id="Oje-sg-FbU"/> <constraint firstItem="15" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="1" secondAttribute="leading" constant="20" symbolic="YES" id="P2b-oG-3nq"/> + <constraint firstItem="hdM-1x-c8a" firstAttribute="leading" secondItem="f9u-Df-2s9" secondAttribute="trailing" constant="8" symbolic="YES" id="PtE-WF-LmK"/> <constraint firstItem="19" firstAttribute="top" secondItem="4" secondAttribute="bottom" constant="12" id="Q1S-8k-zDI"/> <constraint firstItem="8" firstAttribute="top" secondItem="12" secondAttribute="bottom" constant="12" id="QXC-51-fr8"/> <constraint firstAttribute="trailing" secondItem="duc-5M-yv6" secondAttribute="trailing" priority="251" constant="20" symbolic="YES" id="QpV-2B-8gq"/> + <constraint firstItem="13" firstAttribute="leading" secondItem="C1M-te-Zg5" secondAttribute="trailing" constant="8" symbolic="YES" id="SGr-qX-I5n"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="3" secondAttribute="trailing" constant="20" symbolic="YES" id="Sbi-6D-vkH"/> + <constraint firstItem="15" firstAttribute="centerY" secondItem="krj-lQ-Yls" secondAttribute="centerY" id="Scn-9T-dlB"/> <constraint firstItem="19" firstAttribute="trailing" secondItem="5" secondAttribute="trailing" id="TSo-3c-YFG"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="4" secondAttribute="trailing" constant="20" symbolic="YES" id="U8O-JV-nun"/> <constraint firstItem="9" firstAttribute="leading" secondItem="7" secondAttribute="trailing" constant="8" symbolic="YES" id="UHb-CR-xG0"/> @@ -283,6 +349,8 @@ <constraint firstItem="12" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="bLu-jp-YjC"/> <constraint firstItem="hos-Of-u1Q" firstAttribute="top" secondItem="1" secondAttribute="top" constant="20" symbolic="YES" id="bPi-A8-Wp7"/> <constraint firstItem="18" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="dt2-ti-H14"/> + <constraint firstItem="C1M-te-Zg5" firstAttribute="leading" secondItem="hdM-1x-c8a" secondAttribute="trailing" constant="8" symbolic="YES" id="egg-kN-Twa"/> + <constraint firstItem="fiY-dG-n4g" firstAttribute="leading" secondItem="hdM-1x-c8a" secondAttribute="leading" id="fbM-jI-97E"/> <constraint firstItem="11" firstAttribute="trailing" secondItem="5" secondAttribute="trailing" id="fmK-oo-I6v"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="20" secondAttribute="trailing" constant="20" symbolic="YES" id="g4n-FP-2OB"/> <constraint firstItem="13" firstAttribute="width" secondItem="14" secondAttribute="width" id="iDb-LY-iDA"/> @@ -295,14 +363,15 @@ <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="duc-5M-yv6" secondAttribute="trailing" constant="20" symbolic="YES" id="ldM-OS-AyE"/> <constraint firstItem="18" firstAttribute="top" secondItem="10" secondAttribute="bottom" constant="6" symbolic="YES" id="n6b-L7-vO4"/> <constraint firstItem="13" firstAttribute="top" secondItem="14" secondAttribute="bottom" constant="12" symbolic="YES" id="npT-XL-y6y"/> + <constraint firstItem="krj-lQ-Yls" firstAttribute="leading" secondItem="fiY-dG-n4g" secondAttribute="trailing" constant="8" symbolic="YES" id="obG-T7-WAj"/> <constraint firstItem="12" firstAttribute="top" secondItem="YMN-MA-BZc" secondAttribute="bottom" constant="6" symbolic="YES" id="pRs-P8-idK"/> <constraint firstAttribute="bottom" secondItem="duc-5M-yv6" secondAttribute="bottom" constant="20" symbolic="YES" id="prN-jO-7Ys"/> - <constraint firstItem="13" firstAttribute="leading" secondItem="f9u-Df-2s9" secondAttribute="trailing" constant="8" symbolic="YES" id="qPH-G3-xAj"/> <constraint firstItem="ClK-rQ-vsN" firstAttribute="firstBaseline" secondItem="16" secondAttribute="firstBaseline" id="rVj-ct-mRq"/> <constraint firstItem="5" firstAttribute="leading" secondItem="1" secondAttribute="leading" constant="12" id="rkP-h4-vkE"/> <constraint firstItem="duc-5M-yv6" firstAttribute="top" secondItem="19" secondAttribute="bottom" constant="12" id="rxL-uA-y9K"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="12" secondAttribute="trailing" constant="20" symbolic="YES" id="sf3-2d-1Yx"/> <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="ClK-rQ-vsN" secondAttribute="trailing" constant="20" symbolic="YES" id="t5G-XJ-g2V"/> + <constraint firstItem="fiY-dG-n4g" firstAttribute="firstBaseline" secondItem="15" secondAttribute="firstBaseline" id="twR-Yt-ajh"/> <constraint firstAttribute="trailing" secondItem="5" secondAttribute="trailing" constant="12" id="uYa-Mh-FS5"/> <constraint firstItem="10" firstAttribute="leading" secondItem="hos-Of-u1Q" secondAttribute="leading" id="vK9-EU-mar"/> <constraint firstItem="13" firstAttribute="firstBaseline" secondItem="f9u-Df-2s9" secondAttribute="firstBaseline" id="vRB-kQ-LI2"/> @@ -309,7 +378,7 @@ <constraint firstItem="9" firstAttribute="top" secondItem="8" secondAttribute="bottom" constant="12" id="wRZ-ah-TXh"/> <constraint firstItem="9" firstAttribute="firstBaseline" secondItem="7" secondAttribute="firstBaseline" id="xO9-QM-sbG"/> </constraints> - <point key="canvasLocation" x="139.5" y="154.5"/> + <point key="canvasLocation" x="139" y="154.5"/> </customView> <userDefaultsController representsSharedInstance="YES" id="58"/> </objects> Modified: trunk/NSValueTransformer_SKExtensions.h =================================================================== --- trunk/NSValueTransformer_SKExtensions.h 2025-06-28 09:21:29 UTC (rev 15557) +++ trunk/NSValueTransformer_SKExtensions.h 2025-06-28 16:55:23 UTC (rev 15558) @@ -44,6 +44,8 @@ extern NSString *SKUnarchiveColorArrayTransformerName; extern NSString *SKTypeImageTransformerName; extern NSString *SKHasWindowImageTransformerName; +extern NSString *SKDisplayModeImageTransformerName; +extern NSString *SKScaleFactorTransformerName; extern NSString *SKIsZeroTransformerName; extern NSString *SKIsOneTransformerName; extern NSString *SKIsTwoTransformerName; Modified: trunk/NSValueTransformer_SKExtensions.m =================================================================== --- trunk/NSValueTransformer_SKExtensions.m 2025-06-28 09:21:29 UTC (rev 15557) +++ trunk/NSValueTransformer_SKExtensions.m 2025-06-28 16:55:23 UTC (rev 15558) @@ -39,11 +39,14 @@ #import "NSValueTransformer_SKExtensions.h" #import "NSImage_SKExtensions.h" #import <SkimNotes/SkimNotes.h> +#import <Quartz/Quartz.h> NSString *SKUnarchiveColorTransformerName = @"SKUnarchiveColor"; NSString *SKUnarchiveColorArrayTransformerName = @"SKUnarchiveColorArray"; NSString *SKTypeImageTransformerName = @"SKTypeImage"; NSString *SKHasWindowImageTransformerName = @"SKHasWindowImage"; +NSString *SKDisplayModeImageTransformerName = @"SKDisplayModeImage"; +NSString *SKScaleFactorTransformerName = @"SKScaleFactor"; NSString *SKIsZeroTransformerName = @"SKIsZero"; NSString *SKIsOneTransformerName = @"SKIsOne"; NSString *SKIsTwoTransformerName = @"SKIsTwo"; @@ -68,6 +71,16 @@ #pragma mark - +@interface SKDisplayModeImageTransformer : NSValueTransformer +@end + +#pragma mark - + +@interface SKScaleFactorTransformer : NSValueTransformer +@end + +#pragma mark - + @interface SKRadioTransformer : NSValueTransformer { NSInteger targetValue; } @@ -83,6 +96,8 @@ [NSValueTransformer setValueTransformer:[[SKUnarchiveColorArrayTransformer alloc] init] forName:SKUnarchiveColorArrayTransformerName]; [NSValueTransformer setValueTransformer:[[SKTypeImageTransformer alloc] init] forName:SKTypeImageTransformerName]; [NSValueTransformer setValueTransformer:[[SKHasWindowImageTransformer alloc] init] forName:SKHasWindowImageTransformerName]; + [NSValueTransformer setValueTransformer:[[SKDisplayModeImageTransformer alloc] init] forName:SKDisplayModeImageTransformerName]; + [NSValueTransformer setValueTransformer:[[SKScaleFactorTransformer alloc] init] forName:SKScaleFactorTransformerName]; [NSValueTransformer setValueTransformer:[[SKRadioTransformer alloc] initWithTargetValue:0] forName:SKIsZeroTransformerName]; [NSValueTransformer setValueTransformer:[[SKRadioTransformer alloc] initWithTargetValue:1] forName:SKIsOneTransformerName]; [NSValueTransformer setValueTransformer:[[SKRadioTransformer alloc] initWithTargetValue:2] forName:SKIsTwoTransformerName]; @@ -237,6 +252,71 @@ #pragma mark - +@implementation SKDisplayModeImageTransformer + ++ (Class)transformedValueClass { + return [NSImage class]; +} + ++ (BOOL)allowsReverseTransformation { + return NO; +} + +- (id)transformedValue:(id)settings { + NSNumber *displayMode = [settings objectForKey:@"displayMode"]; + if (displayMode == nil) + return nil; + switch ([displayMode integerValue]) { + case kPDFDisplaySinglePage: + return [NSImage imageNamed:SKImageNameToolbarSinglePage]; + case kPDFDisplaySinglePageContinuous: + if ([[settings objectForKey:@"displayDirection"] boolValue]) + return [NSImage imageNamed:SKImageNameToolbarHorizontal]; + else + return [NSImage imageNamed:SKImageNameToolbarSinglePageContinuous]; + case kPDFDisplayTwoUp: + return [NSImage imageNamed:SKImageNameToolbarTwoUp]; + case kPDFDisplayTwoUpContinuous: + if ([[settings objectForKey:@"displaysAsBook"] boolValue]) + return [NSImage imageNamed:SKImageNameToolbarBookMode]; + else + return [NSImage imageNamed:SKImageNameToolbarTwoUpContinuous]; + default: + return nil; + } +} + +@end + +#pragma mark - + +@implementation SKScaleFactorTransformer + ++ (Class)transformedValueClass { + return [NSString class]; +} + ++ (BOOL)allowsReverseTransformation { + return NO; +} + +- (id)transformedValue:(id)settings { + if ([settings count] == 0) + return nil; + if ([[settings objectForKey:@"autoScales"] boolValue]) + return [[NSBundle mainBundle] localizedStringForKey:@"Auto" value:@"" table:@"ZoomValues"]; + static NSNumberFormatter *formatter = nil; + if (formatter == nil) { + formatter = [[NSNumberFormatter alloc] init]; + [formatter setNumberStyle:NSNumberFormatterPercentStyle]; + } + return [formatter stringFromNumber:[settings objectForKey:@"scaleFactor"]]; +} + +@end + +#pragma mark - + @implementation SKRadioTransformer + (Class)transformedValueClass { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-28 09:21:31
|
Revision: 15557 http://sourceforge.net/p/skim-app/code/15557 Author: hofman Date: 2025-06-28 09:21:29 +0000 (Sat, 28 Jun 2025) Log Message: ----------- note reecentinfo updated from document Modified Paths: -------------- trunk/SKMainDocument.m trunk/SKMainWindowController.m Modified: trunk/SKMainDocument.m =================================================================== --- trunk/SKMainDocument.m 2025-06-28 09:11:40 UTC (rev 15556) +++ trunk/SKMainDocument.m 2025-06-28 09:21:29 UTC (rev 15557) @@ -215,6 +215,8 @@ fileUpdateChecker = [[SKFileUpdateChecker alloc] initForDocument:self]; // the file update checker starts disabled, setting enabled will start checking if it should [fileUpdateChecker setEnabled:YES]; + + [self setRecentInfoNeedsUpdate:YES]; } - (void)showWindows{ Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-06-28 09:11:40 UTC (rev 15556) +++ trunk/SKMainWindowController.m 2025-06-28 09:21:29 UTC (rev 15557) @@ -542,8 +542,6 @@ [savedNormalSetup removeAllObjects]; } - [doc setRecentInfoNeedsUpdate:YES]; - mwcFlags.settingUpWindow = 0; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-28 09:11:41
|
Revision: 15556 http://sourceforge.net/p/skim-app/code/15556 Author: hofman Date: 2025-06-28 09:11:40 +0000 (Sat, 28 Jun 2025) Log Message: ----------- combine condition checks, initial performFit before page navigation Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-06-28 09:01:47 UTC (rev 15555) +++ trunk/SKMainWindowController.m 2025-06-28 09:11:40 UTC (rev 15556) @@ -412,7 +412,6 @@ [statusBar setMenu:menu]; - NSInteger windowSizeOption = [sud integerForKey:SKInitialWindowSizeOptionKey]; if (hasWindowSetup) { NSString *rectString = [savedNormalSetup objectForKey:MAINWINDOWFRAME_KEY]; if (rectString) @@ -433,7 +432,6 @@ [self resetThumbnailSizeIfNeeded]; [self resetSnapshotSizeIfNeeded]; - // NB: the next line will load the PDF document and annotations, so necessary setup must be finished first! // windowControllerDidLoadNib: is not called automatically because the document overrides makeWindowControllers [doc windowControllerDidLoadNib:self]; @@ -450,20 +448,28 @@ // Due to a bug in Leopard we should only resize and swap in the PDFView after loading the PDFDocument [pdfContentView addSubviewWithConstraints:pdfView]; - // get the initial display mode from the PDF if present and not overridden by an explicit setup - if (hasWindowSetup == NO && [[NSUserDefaults standardUserDefaults] boolForKey:SKUseSettingsFromPDFKey]) { - NSDictionary *initialSettings = [[self pdfDocument] initialSettings]; - if (initialSettings) { - [pdfView setDisplaySettings:initialSettings]; - if ([initialSettings objectForKey:@"fitWindow"] && [[initialSettings objectForKey:@"fitWindow"] boolValue]) - windowSizeOption = SKWindowOptionFit; + if (hasWindowSetup == NO) { + NSInteger windowSizeOption = [sud integerForKey:SKInitialWindowSizeOptionKey]; + + // get the initial display mode from the PDF if present and not overridden by an explicit setup + if ([[NSUserDefaults standardUserDefaults] boolForKey:SKUseSettingsFromPDFKey]) { + NSDictionary *initialSettings = [[self pdfDocument] initialSettings]; + if (initialSettings) { + [pdfView setDisplaySettings:initialSettings]; + if ([initialSettings objectForKey:@"fitWindow"] && [[initialSettings objectForKey:@"fitWindow"] boolValue]) + windowSizeOption = SKWindowOptionFit; + } } + + // We can fit only after the PDF has been loaded + if (windowSizeOption == SKWindowOptionFit) { + [[window contentView] layoutSubtreeIfNeeded]; + [self performFit:self]; + } else if (windowSizeOption == SKWindowOptionMaximize) { + [window zoom:self]; + } } - if (windowSizeOption == SKWindowOptionMaximize && hasWindowSetup == NO) { - [window zoom:self]; - } - // Go to page? SKDestination dest = [self destinationFromSetup:savedNormalSetup]; BOOL rememberPage = dest.pageIndex == NSNotFound && [sud boolForKey:SKRememberLastPageViewedKey]; @@ -492,12 +498,6 @@ } } - // We can fit only after the PDF has been loaded - if (windowSizeOption == SKWindowOptionFit && hasWindowSetup == NO) { - [[window contentView] layoutSubtreeIfNeeded]; - [self performFit:self]; - } - // Open snapshots? NSArray *snapshotSetups = [savedNormalSetup objectForKey:SNAPSHOTS_KEY]; if (rememberSnapshots && recentDoc) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-28 09:01:50
|
Revision: 15555 http://sourceforge.net/p/skim-app/code/15555 Author: hofman Date: 2025-06-28 09:01:47 +0000 (Sat, 28 Jun 2025) Log Message: ----------- set side pane widths and get them from setup in singlle method Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-06-28 08:55:10 UTC (rev 15554) +++ trunk/SKMainWindowController.m 2025-06-28 09:01:47 UTC (rev 15555) @@ -189,7 +189,7 @@ - (SKDestination)destinationFromSetup:(NSDictionary *)setup; - (void)setDestination:(SKDestination)dest inSetup:(NSMutableDictionary *)setup; -- (void)applyLeftSideWidth:(CGFloat)leftSideWidth rightSideWidth:(CGFloat)rightSideWidth; +- (void)applySideWidthsFromSetup:(NSDictionary *)setup; - (void)updateTableFont; @@ -427,12 +427,8 @@ [pdfView setDelegate:self]; - NSNumber *leftWidthNumber = [savedNormalSetup objectForKey:LEFTSIDEPANEWIDTH_KEY] ?: [sud objectForKey:SKLeftSidePaneWidthKey]; - NSNumber *rightWidthNumber = [savedNormalSetup objectForKey:RIGHTSIDEPANEWIDTH_KEY] ?: [sud objectForKey:SKRightSidePaneWidthKey]; + [self applySideWidthsFromSetup:savedNormalSetup]; - if (leftWidthNumber && rightWidthNumber) - [self applyLeftSideWidth:[leftWidthNumber doubleValue] rightSideWidth:[rightWidthNumber doubleValue]]; - // this needs to be done before loading the PDFDocument [self resetThumbnailSizeIfNeeded]; [self resetSnapshotSizeIfNeeded]; @@ -551,9 +547,13 @@ mwcFlags.settingUpWindow = 0; } -- (void)applyLeftSideWidth:(CGFloat)leftSideWidth rightSideWidth:(CGFloat)rightSideWidth { - [splitView setPosition:leftSideWidth ofDividerAtIndex:0]; - [splitView setPosition:[splitView maxPossiblePositionOfDividerAtIndex:1] - [splitView dividerThickness] - rightSideWidth ofDividerAtIndex:1]; +- (void)applySideWidthsFromSetup:(NSDictionary *)setup { + NSNumber *leftWidth = [setup objectForKey:LEFTSIDEPANEWIDTH_KEY]; + NSNumber *rightWidth = [setup objectForKey:RIGHTSIDEPANEWIDTH_KEY]; + if (leftWidth && rightWidth) { + [splitView setPosition:[leftWidth doubleValue] ofDividerAtIndex:0]; + [splitView setPosition:[splitView maxPossiblePositionOfDividerAtIndex:1] - [splitView dividerThickness] - [rightWidth doubleValue] ofDividerAtIndex:1]; + } } - (void)applySetup:(NSDictionary *)setup{ @@ -571,10 +571,7 @@ [savedNormalWindow setFrame:NSRectFromString(rectString) display:NO]; } - NSNumber *leftWidth = [setup objectForKey:LEFTSIDEPANEWIDTH_KEY]; - NSNumber *rightWidth = [setup objectForKey:RIGHTSIDEPANEWIDTH_KEY]; - if (leftWidth && rightWidth) - [self applyLeftSideWidth:[leftWidth doubleValue] rightSideWidth:[rightWidth doubleValue]]; + [self applySideWidthsFromSetup:setup]; if ([[pdfView document] isLocked]) { NSArray *snapshotSetups = [savedNormalSetup objectForKey:SNAPSHOTS_KEY]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-28 08:55:11
|
Revision: 15554 http://sourceforge.net/p/skim-app/code/15554 Author: hofman Date: 2025-06-28 08:55:10 +0000 (Sat, 28 Jun 2025) Log Message: ----------- remove unused declaration Modified Paths: -------------- trunk/SKMainWindowController_FullScreen.m Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-06-27 16:44:44 UTC (rev 15553) +++ trunk/SKMainWindowController_FullScreen.m 2025-06-28 08:55:10 UTC (rev 15554) @@ -84,10 +84,6 @@ static CGFloat fullScreenToolbarOffset = 0.0; -@interface SKMainWindowController (SKFullScreenPrivate) -- (void)applyLeftSideWidth:(CGFloat)leftSideWidth rightSideWidth:(CGFloat)rightSideWidth; -@end - @implementation SKMainWindowController (FullScreen) #pragma mark Side Windows This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-27 16:44:45
|
Revision: 15553 http://sourceforge.net/p/skim-app/code/15553 Author: hofman Date: 2025-06-27 16:44:44 +0000 (Fri, 27 Jun 2025) Log Message: ----------- fix comment Modified Paths: -------------- trunk/SKMainWindowController.m Modified: trunk/SKMainWindowController.m =================================================================== --- trunk/SKMainWindowController.m 2025-06-27 16:14:10 UTC (rev 15552) +++ trunk/SKMainWindowController.m 2025-06-27 16:44:44 UTC (rev 15553) @@ -324,7 +324,7 @@ } - (void)windowDidLoad{ - // savedNormalSetup can contain pageIndex and snapshots from non-setup bnookmarks + // savedNormalSetup can contain pageIndex and snapshots from non-setup bookmarks BOOL hasWindowSetup = [savedNormalSetup count] > 2; NSWindow *window = [self window]; NSDocument *doc = [self document]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-25 09:06:26
|
Revision: 15551 http://sourceforge.net/p/skim-app/code/15551 Author: hofman Date: 2025-06-25 09:06:23 +0000 (Wed, 25 Jun 2025) Log Message: ----------- separate method to stop observing current documents, rename method Modified Paths: -------------- trunk/SKApplicationController.m Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2025-06-25 09:02:07 UTC (rev 15550) +++ trunk/SKApplicationController.m 2025-06-25 09:06:23 UTC (rev 15551) @@ -160,7 +160,8 @@ [[[NSDocumentController sharedDocumentController] documents] makeObjectsPerformSelector:forced ? @selector(saveRecentDocumentInfo) : @selector(saveRecentDocumentInfoIfNeeded)]; } -- (void)registerForCurrentDocumentsNotifications { + +- (void)startObservingCurrentDocuments { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc addObserver:self selector:@selector(registerCurrentDocuments:) name:SKDocumentDidShowNotification object:nil]; @@ -170,6 +171,15 @@ currentDocumentsTimer = [NSTimer scheduledTimerWithTimeInterval:CURRENTDOCUMENTSETUP_INTERVAL target:self selector:@selector(registerCurrentDocuments:) userInfo:nil repeats:YES]; } +- (void)stopObservingCurrentDocuments { + [currentDocumentsTimer invalidate]; + currentDocumentsTimer = nil; + + NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; + [nc removeObserver:self name:SKDocumentDidShowNotification object:nil]; + [nc removeObserver:self name:SKDocumentControllerDidRemoveDocumentNotification object:nil]; +} + - (void)reopenLastOpenFiles { didReopen = YES; @@ -226,7 +236,7 @@ [sud setObject:versionString forKey:SKLastVersionLaunchedKey]; } - [self performSelector:@selector(registerForCurrentDocumentsNotifications) withObject:nil afterDelay:1.0]; + [self performSelector:@selector(startObservingCurrentDocuments) withObject:nil afterDelay:1.0]; // kHIDRemoteModeExclusiveAuto lets the HIDRemote handle activation when the app gets or loses focus if ([sud boolForKey:SKEnableAppleRemoteKey]) { @@ -306,12 +316,8 @@ return nil; } -- (void)applicationStartsTerminating:(NSApplication *)application; { - [currentDocumentsTimer invalidate]; - currentDocumentsTimer = nil; - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - [nc removeObserver:self name:SKDocumentDidShowNotification object:nil]; - [nc removeObserver:self name:SKDocumentControllerDidRemoveDocumentNotification object:nil]; +- (void)applicationStartsTerminating:(NSApplication *)application { + [self stopObservingCurrentDocuments]; [presentationDocument() setInteractionMode:SKNormalMode]; @@ -320,7 +326,7 @@ - (void)applicationCanceledTerminating:(NSApplication *)application { if (currentDocumentsTimer == nil) - [self registerForCurrentDocumentsNotifications]; + [self startObservingCurrentDocuments]; } - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)application { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-25 09:02:10
|
Revision: 15550 http://sourceforge.net/p/skim-app/code/15550 Author: hofman Date: 2025-06-25 09:02:07 +0000 (Wed, 25 Jun 2025) Log Message: ----------- rename delegate method Modified Paths: -------------- trunk/SKApplication.h trunk/SKApplication.m trunk/SKApplicationController.m Modified: trunk/SKApplication.h =================================================================== --- trunk/SKApplication.h 2025-06-24 16:55:41 UTC (rev 15549) +++ trunk/SKApplication.h 2025-06-25 09:02:07 UTC (rev 15550) @@ -43,7 +43,7 @@ @protocol SKApplicationDelegate <NSApplicationDelegate> @optional - (void)applicationStartsTerminating:(NSApplication *)application; -- (void)applicationWillNotTerminate:(NSApplication *)application; +- (void)applicationCanceledTerminating:(NSApplication *)application; @end @class SPUStandardUpdaterController; Modified: trunk/SKApplication.m =================================================================== --- trunk/SKApplication.m 2025-06-24 16:55:41 UTC (rev 15549) +++ trunk/SKApplication.m 2025-06-25 09:02:07 UTC (rev 15550) @@ -80,8 +80,8 @@ // this is also called after NSDocumentController reviews unsaved documents - (void)replyToApplicationShouldTerminate:(BOOL)shouldTerminate { - if (shouldTerminate == NO && [[self delegate] respondsToSelector:@selector(applicationWillNotTerminate:)]) - [[self delegate] applicationWillNotTerminate:self]; + if (shouldTerminate == NO && [[self delegate] respondsToSelector:@selector(applicationCanceledTerminating:)]) + [[self delegate] applicationCanceledTerminating:self]; [super replyToApplicationShouldTerminate:shouldTerminate]; } Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2025-06-24 16:55:41 UTC (rev 15549) +++ trunk/SKApplicationController.m 2025-06-25 09:02:07 UTC (rev 15550) @@ -318,7 +318,7 @@ [self registerCurrentDocuments:nil]; } -- (void)applicationWillNotTerminate:(NSApplication *)application; { +- (void)applicationCanceledTerminating:(NSApplication *)application { if (currentDocumentsTimer == nil) [self registerForCurrentDocumentsNotifications]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-24 16:55:44
|
Revision: 15549 http://sourceforge.net/p/skim-app/code/15549 Author: hofman Date: 2025-06-24 16:55:41 +0000 (Tue, 24 Jun 2025) Log Message: ----------- separate function to find document in presentation mode Modified Paths: -------------- trunk/SKApplicationController.m Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2025-06-24 16:48:36 UTC (rev 15548) +++ trunk/SKApplicationController.m 2025-06-24 16:55:41 UTC (rev 15549) @@ -298,14 +298,15 @@ return reply; } -- (void)applicationStartsTerminating:(NSApplication *)application; { +static inline NSDocument *presentationDocument(void) { for (NSDocument *doc in [[NSDocumentController sharedDocumentController] documents]) { - if ([doc interactionMode] == SKPresentationMode) { - [doc setInteractionMode:SKNormalMode]; - break; - } + if ([doc interactionMode] == SKPresentationMode) + return doc; } - + return nil; +} + +- (void)applicationStartsTerminating:(NSApplication *)application; { [currentDocumentsTimer invalidate]; currentDocumentsTimer = nil; NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; @@ -312,6 +313,8 @@ [nc removeObserver:self name:SKDocumentDidShowNotification object:nil]; [nc removeObserver:self name:SKDocumentControllerDidRemoveDocumentNotification object:nil]; + [presentationDocument() setInteractionMode:SKNormalMode]; + [self registerCurrentDocuments:nil]; } @@ -321,26 +324,21 @@ } - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)application { - for (NSDocument *doc in [[NSDocumentController sharedDocumentController] documents]) { - if ([doc interactionMode] == SKPresentationMode) { - if ([doc canExitPresentation]) { + NSDocument *doc = presentationDocument(); + if ([doc canExitPresentation]) { + [doc setInteractionMode:SKNormalMode]; + } else if (doc) { + DISPATCH_MAIN_AFTER_SEC(0.51, ^{ + if ([doc interactionMode] != SKPresentationMode) { + [NSApp replyToApplicationShouldTerminate:YES]; + } else if ([doc canExitPresentation]) { [doc setInteractionMode:SKNormalMode]; - break; + [NSApp replyToApplicationShouldTerminate:YES]; } else { - return NSTerminateCancel; - DISPATCH_MAIN_AFTER_SEC(0.51, ^{ - if ([doc interactionMode] != SKPresentationMode) { - [NSApp replyToApplicationShouldTerminate:YES]; - } else if ([doc canExitPresentation]) { - [doc setInteractionMode:SKNormalMode]; - [NSApp replyToApplicationShouldTerminate:YES]; - } else { - [NSApp replyToApplicationShouldTerminate:NO]; - } - }); - return NSTerminateLater; + [NSApp replyToApplicationShouldTerminate:NO]; } - } + }); + return NSTerminateLater; } return NSTerminateNow; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-24 16:48:38
|
Revision: 15548 http://sourceforge.net/p/skim-app/code/15548 Author: hofman Date: 2025-06-24 16:48:36 +0000 (Tue, 24 Jun 2025) Log Message: ----------- make custom app delegate methods not notifications Modified Paths: -------------- trunk/SKApplication.h trunk/SKApplication.m trunk/SKApplicationController.m Modified: trunk/SKApplication.h =================================================================== --- trunk/SKApplication.h 2025-06-24 16:39:46 UTC (rev 15547) +++ trunk/SKApplication.h 2025-06-24 16:48:36 UTC (rev 15548) @@ -40,13 +40,10 @@ NS_ASSUME_NONNULL_BEGIN -extern NSString *SKApplicationStartsTerminatingNotification; -extern NSString *SKApplicationWillNotTerminateNotification; - @protocol SKApplicationDelegate <NSApplicationDelegate> @optional -- (void)applicationStartsTerminating:(NSNotification *)aNotification; -- (void)applicationWillNotTerminate:(NSNotification *)aNotification; +- (void)applicationStartsTerminating:(NSApplication *)application; +- (void)applicationWillNotTerminate:(NSApplication *)application; @end @class SPUStandardUpdaterController; Modified: trunk/SKApplication.m =================================================================== --- trunk/SKApplication.m 2025-06-24 16:39:46 UTC (rev 15547) +++ trunk/SKApplication.m 2025-06-24 16:48:36 UTC (rev 15548) @@ -44,8 +44,6 @@ #import "NSString_SKExtensions.h" #import "SKPreferenceController.h" -NSString *SKApplicationStartsTerminatingNotification = @"SKApplicationStartsTerminatingNotification"; -NSString *SKApplicationWillNotTerminateNotification = @"SKApplicationWillNotTerminateNotification"; @implementation SKApplication @@ -75,29 +73,18 @@ } - (IBAction)terminate:(id)sender { - [[NSNotificationCenter defaultCenter] postNotificationName:SKApplicationStartsTerminatingNotification object:self]; + if ([[self delegate] respondsToSelector:@selector(applicationStartsTerminating:)]) + [[self delegate] applicationStartsTerminating:self]; [super terminate:sender]; } // this is also called after NSDocumentController reviews unsaved documents - (void)replyToApplicationShouldTerminate:(BOOL)shouldTerminate { - if (shouldTerminate == NO) - [[NSNotificationCenter defaultCenter] postNotificationName:SKApplicationWillNotTerminateNotification object:self]; + if (shouldTerminate == NO && [[self delegate] respondsToSelector:@selector(applicationWillNotTerminate:)]) + [[self delegate] applicationWillNotTerminate:self]; [super replyToApplicationShouldTerminate:shouldTerminate]; } -- (void)setDelegate:(id<SKApplicationDelegate>)delegate { - if ([[self delegate] respondsToSelector:@selector(applicationStartsTerminating:)]) - [[NSNotificationCenter defaultCenter] removeObserver:[self delegate] name:SKApplicationStartsTerminatingNotification object:self]; - if ([[self delegate] respondsToSelector:@selector(applicationWillNotTerminate)]) - [[NSNotificationCenter defaultCenter] removeObserver:[self delegate] name:SKApplicationWillNotTerminateNotification object:self]; - [super setDelegate:delegate]; - if ([[self delegate] respondsToSelector:@selector(applicationStartsTerminating:)]) - [[NSNotificationCenter defaultCenter] addObserver:[self delegate] selector:@selector(applicationStartsTerminating:) name:SKApplicationStartsTerminatingNotification object:self]; - if ([[self delegate] respondsToSelector:@selector(applicationWillNotTerminate:)]) - [[NSNotificationCenter defaultCenter] addObserver:[self delegate] selector:@selector(applicationWillNotTerminate:) name:SKApplicationWillNotTerminateNotification object:self]; -} - - (BOOL)willDragMouse { return NSEventTypeLeftMouseDragged == [[self nextEventMatchingMask:(NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged) untilDate:[NSDate distantFuture] inMode:NSEventTrackingRunLoopMode dequeue:NO] type]; } Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2025-06-24 16:39:46 UTC (rev 15547) +++ trunk/SKApplicationController.m 2025-06-24 16:48:36 UTC (rev 15548) @@ -298,7 +298,7 @@ return reply; } -- (void)applicationStartsTerminating:(NSNotification *)aNotification { +- (void)applicationStartsTerminating:(NSApplication *)application; { for (NSDocument *doc in [[NSDocumentController sharedDocumentController] documents]) { if ([doc interactionMode] == SKPresentationMode) { [doc setInteractionMode:SKNormalMode]; @@ -315,7 +315,7 @@ [self registerCurrentDocuments:nil]; } -- (void)applicationWillNotTerminate:(NSNotification *)aNotification { +- (void)applicationWillNotTerminate:(NSApplication *)application; { if (currentDocumentsTimer == nil) [self registerForCurrentDocumentsNotifications]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-24 16:39:48
|
Revision: 15547 http://sourceforge.net/p/skim-app/code/15547 Author: hofman Date: 2025-06-24 16:39:46 +0000 (Tue, 24 Jun 2025) Log Message: ----------- exit presentation on terminate from app controller so itwill be done before saving recent document info Modified Paths: -------------- trunk/SKApplicationController.m trunk/SKMainWindowController_UI.m Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2025-06-24 16:30:59 UTC (rev 15546) +++ trunk/SKApplicationController.m 2025-06-24 16:39:46 UTC (rev 15547) @@ -299,11 +299,19 @@ } - (void)applicationStartsTerminating:(NSNotification *)aNotification { + for (NSDocument *doc in [[NSDocumentController sharedDocumentController] documents]) { + if ([doc interactionMode] == SKPresentationMode) { + [doc setInteractionMode:SKNormalMode]; + break; + } + } + [currentDocumentsTimer invalidate]; currentDocumentsTimer = nil; NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; [nc removeObserver:self name:SKDocumentDidShowNotification object:nil]; [nc removeObserver:self name:SKDocumentControllerDidRemoveDocumentNotification object:nil]; + [self registerCurrentDocuments:nil]; } Modified: trunk/SKMainWindowController_UI.m =================================================================== --- trunk/SKMainWindowController_UI.m 2025-06-24 16:30:59 UTC (rev 15546) +++ trunk/SKMainWindowController_UI.m 2025-06-24 16:39:46 UTC (rev 15547) @@ -60,7 +60,6 @@ #import "SKGroupedSearchResult.h" #import "PDFSelection_SKExtensions.h" #import "NSString_SKExtensions.h" -#import "SKApplication.h" #import "NSMenu_SKExtensions.h" #import "SKLineInspector.h" #import "SKFieldEditor.h" @@ -2027,11 +2026,6 @@ [self updateRightStatus]; } -- (void)handleApplicationStartsTerminatingNotification:(NSNotification *)notification { - if ([self interactionMode] == SKPresentationMode) - [self exitPresentation]; -} - - (void)setHasOutline:(BOOL)hasOutline forAnnotation:(PDFAnnotation *)annotation { SKNoteOutlineView *ov = rightSideController.noteOutlineView; NSInteger row = [ov rowForItem:annotation]; @@ -2103,9 +2097,6 @@ - (void)registerForNotifications { NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - // Application - [nc addObserver:self selector:@selector(handleApplicationStartsTerminatingNotification:) - name:SKApplicationStartsTerminatingNotification object:NSApp]; // PDFView [nc addObserver:self selector:@selector(handlePageChangedNotification:) name:PDFViewPageChangedNotification object:pdfView]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-24 16:31:00
|
Revision: 15546 http://sourceforge.net/p/skim-app/code/15546 Author: hofman Date: 2025-06-24 16:30:59 +0000 (Tue, 24 Jun 2025) Log Message: ----------- fix selector Modified Paths: -------------- trunk/SKApplication.m Modified: trunk/SKApplication.m =================================================================== --- trunk/SKApplication.m 2025-06-24 16:29:53 UTC (rev 15545) +++ trunk/SKApplication.m 2025-06-24 16:30:59 UTC (rev 15546) @@ -95,7 +95,7 @@ if ([[self delegate] respondsToSelector:@selector(applicationStartsTerminating:)]) [[NSNotificationCenter defaultCenter] addObserver:[self delegate] selector:@selector(applicationStartsTerminating:) name:SKApplicationStartsTerminatingNotification object:self]; if ([[self delegate] respondsToSelector:@selector(applicationWillNotTerminate:)]) - [[NSNotificationCenter defaultCenter] addObserver:[self delegate] selector:@selector(applicationStartsTerminating:) name:SKApplicationWillNotTerminateNotification object:self]; + [[NSNotificationCenter defaultCenter] addObserver:[self delegate] selector:@selector(applicationWillNotTerminate:) name:SKApplicationWillNotTerminateNotification object:self]; } - (BOOL)willDragMouse { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-24 16:29:54
|
Revision: 15545 http://sourceforge.net/p/skim-app/code/15545 Author: hofman Date: 2025-06-24 16:29:53 +0000 (Tue, 24 Jun 2025) Log Message: ----------- use property consistently Modified Paths: -------------- trunk/SKApplication.m Modified: trunk/SKApplication.m =================================================================== --- trunk/SKApplication.m 2025-06-24 16:26:00 UTC (rev 15544) +++ trunk/SKApplication.m 2025-06-24 16:29:53 UTC (rev 15545) @@ -92,9 +92,9 @@ if ([[self delegate] respondsToSelector:@selector(applicationWillNotTerminate)]) [[NSNotificationCenter defaultCenter] removeObserver:[self delegate] name:SKApplicationWillNotTerminateNotification object:self]; [super setDelegate:delegate]; - if ([delegate respondsToSelector:@selector(applicationStartsTerminating:)]) + if ([[self delegate] respondsToSelector:@selector(applicationStartsTerminating:)]) [[NSNotificationCenter defaultCenter] addObserver:[self delegate] selector:@selector(applicationStartsTerminating:) name:SKApplicationStartsTerminatingNotification object:self]; - if ([delegate respondsToSelector:@selector(applicationWillNotTerminate:)]) + if ([[self delegate] respondsToSelector:@selector(applicationWillNotTerminate:)]) [[NSNotificationCenter defaultCenter] addObserver:[self delegate] selector:@selector(applicationStartsTerminating:) name:SKApplicationWillNotTerminateNotification object:self]; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-24 16:26:02
|
Revision: 15544 http://sourceforge.net/p/skim-app/code/15544 Author: hofman Date: 2025-06-24 16:26:00 +0000 (Tue, 24 Jun 2025) Log Message: ----------- make applicationWillNotTerminate a notification Modified Paths: -------------- trunk/SKApplication.h trunk/SKApplication.m trunk/SKApplicationController.m Modified: trunk/SKApplication.h =================================================================== --- trunk/SKApplication.h 2025-06-24 16:16:49 UTC (rev 15543) +++ trunk/SKApplication.h 2025-06-24 16:26:00 UTC (rev 15544) @@ -41,11 +41,12 @@ NS_ASSUME_NONNULL_BEGIN extern NSString *SKApplicationStartsTerminatingNotification; +extern NSString *SKApplicationWillNotTerminateNotification; @protocol SKApplicationDelegate <NSApplicationDelegate> @optional - (void)applicationStartsTerminating:(NSNotification *)aNotification; -- (void)applicationWillNotTerminate:(NSApplication *)application; +- (void)applicationWillNotTerminate:(NSNotification *)aNotification; @end @class SPUStandardUpdaterController; Modified: trunk/SKApplication.m =================================================================== --- trunk/SKApplication.m 2025-06-24 16:16:49 UTC (rev 15543) +++ trunk/SKApplication.m 2025-06-24 16:26:00 UTC (rev 15544) @@ -45,6 +45,7 @@ #import "SKPreferenceController.h" NSString *SKApplicationStartsTerminatingNotification = @"SKApplicationStartsTerminatingNotification"; +NSString *SKApplicationWillNotTerminateNotification = @"SKApplicationWillNotTerminateNotification"; @implementation SKApplication @@ -74,29 +75,33 @@ } - (IBAction)terminate:(id)sender { - [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:SKApplicationStartsTerminatingNotification object:self]]; + [[NSNotificationCenter defaultCenter] postNotificationName:SKApplicationStartsTerminatingNotification object:self]; [super terminate:sender]; } // this is also called after NSDocumentController reviews unsaved documents - (void)replyToApplicationShouldTerminate:(BOOL)shouldTerminate { - if (shouldTerminate == NO && [[self delegate] respondsToSelector:@selector(applicationWillNotTerminate:)]) - [[self delegate] applicationWillNotTerminate:self]; + if (shouldTerminate == NO) + [[NSNotificationCenter defaultCenter] postNotificationName:SKApplicationWillNotTerminateNotification object:self]; [super replyToApplicationShouldTerminate:shouldTerminate]; } -- (BOOL)willDragMouse { - return NSEventTypeLeftMouseDragged == [[self nextEventMatchingMask:(NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged) untilDate:[NSDate distantFuture] inMode:NSEventTrackingRunLoopMode dequeue:NO] type]; -} - - (void)setDelegate:(id<SKApplicationDelegate>)delegate { if ([[self delegate] respondsToSelector:@selector(applicationStartsTerminating:)]) [[NSNotificationCenter defaultCenter] removeObserver:[self delegate] name:SKApplicationStartsTerminatingNotification object:self]; + if ([[self delegate] respondsToSelector:@selector(applicationWillNotTerminate)]) + [[NSNotificationCenter defaultCenter] removeObserver:[self delegate] name:SKApplicationWillNotTerminateNotification object:self]; [super setDelegate:delegate]; if ([delegate respondsToSelector:@selector(applicationStartsTerminating:)]) [[NSNotificationCenter defaultCenter] addObserver:[self delegate] selector:@selector(applicationStartsTerminating:) name:SKApplicationStartsTerminatingNotification object:self]; + if ([delegate respondsToSelector:@selector(applicationWillNotTerminate:)]) + [[NSNotificationCenter defaultCenter] addObserver:[self delegate] selector:@selector(applicationStartsTerminating:) name:SKApplicationWillNotTerminateNotification object:self]; } +- (BOOL)willDragMouse { + return NSEventTypeLeftMouseDragged == [[self nextEventMatchingMask:(NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged) untilDate:[NSDate distantFuture] inMode:NSEventTrackingRunLoopMode dequeue:NO] type]; +} + #pragma mark Windows menu - (void)reorganizeWindowsItem:(NSWindow *)aWindow { Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2025-06-24 16:16:49 UTC (rev 15543) +++ trunk/SKApplicationController.m 2025-06-24 16:26:00 UTC (rev 15544) @@ -307,7 +307,7 @@ [self registerCurrentDocuments:nil]; } -- (void)applicationWillNotTerminate:(NSApplication *)application { +- (void)applicationWillNotTerminate:(NSNotification *)aNotification { if (currentDocumentsTimer == nil) [self registerForCurrentDocumentsNotifications]; } @@ -319,6 +319,7 @@ [doc setInteractionMode:SKNormalMode]; break; } else { + return NSTerminateCancel; DISPATCH_MAIN_AFTER_SEC(0.51, ^{ if ([doc interactionMode] != SKPresentationMode) { [NSApp replyToApplicationShouldTerminate:YES]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-24 16:16:52
|
Revision: 15543 http://sourceforge.net/p/skim-app/code/15543 Author: hofman Date: 2025-06-24 16:16:49 +0000 (Tue, 24 Jun 2025) Log Message: ----------- add app delegate as notification observer rather than sending notification directly Modified Paths: -------------- trunk/SKApplication.m Modified: trunk/SKApplication.m =================================================================== --- trunk/SKApplication.m 2025-06-24 16:10:55 UTC (rev 15542) +++ trunk/SKApplication.m 2025-06-24 16:16:49 UTC (rev 15543) @@ -74,10 +74,7 @@ } - (IBAction)terminate:(id)sender { - NSNotification *notification = [NSNotification notificationWithName:SKApplicationStartsTerminatingNotification object:self]; - [[NSNotificationCenter defaultCenter] postNotification:notification]; - if ([[self delegate] respondsToSelector:@selector(applicationStartsTerminating:)]) - [[self delegate] applicationStartsTerminating:notification]; + [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:SKApplicationStartsTerminatingNotification object:self]]; [super terminate:sender]; } @@ -92,6 +89,14 @@ return NSEventTypeLeftMouseDragged == [[self nextEventMatchingMask:(NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDragged) untilDate:[NSDate distantFuture] inMode:NSEventTrackingRunLoopMode dequeue:NO] type]; } +- (void)setDelegate:(id<SKApplicationDelegate>)delegate { + if ([[self delegate] respondsToSelector:@selector(applicationStartsTerminating:)]) + [[NSNotificationCenter defaultCenter] removeObserver:[self delegate] name:SKApplicationStartsTerminatingNotification object:self]; + [super setDelegate:delegate]; + if ([delegate respondsToSelector:@selector(applicationStartsTerminating:)]) + [[NSNotificationCenter defaultCenter] addObserver:[self delegate] selector:@selector(applicationStartsTerminating:) name:SKApplicationStartsTerminatingNotification object:self]; +} + #pragma mark Windows menu - (void)reorganizeWindowsItem:(NSWindow *)aWindow { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ho...@us...> - 2025-06-24 16:10:56
|
Revision: 15542 http://sourceforge.net/p/skim-app/code/15542 Author: hofman Date: 2025-06-24 16:10:55 +0000 (Tue, 24 Jun 2025) Log Message: ----------- override replyToApplicationhouldTerminate: to notify when termination is canceled, also from NSDocumentController Modified Paths: -------------- trunk/SKApplication.h trunk/SKApplication.m trunk/SKApplicationController.m Modified: trunk/SKApplication.h =================================================================== --- trunk/SKApplication.h 2025-06-24 14:44:50 UTC (rev 15541) +++ trunk/SKApplication.h 2025-06-24 16:10:55 UTC (rev 15542) @@ -45,7 +45,7 @@ @protocol SKApplicationDelegate <NSApplicationDelegate> @optional - (void)applicationStartsTerminating:(NSNotification *)aNotification; -- (void)applicationDocumentControllerCanceledTerminate:(NSApplication *)application; +- (void)applicationWillNotTerminate:(NSApplication *)application; @end @class SPUStandardUpdaterController; Modified: trunk/SKApplication.m =================================================================== --- trunk/SKApplication.m 2025-06-24 14:44:50 UTC (rev 15541) +++ trunk/SKApplication.m 2025-06-24 16:10:55 UTC (rev 15542) @@ -46,10 +46,6 @@ NSString *SKApplicationStartsTerminatingNotification = @"SKApplicationStartsTerminatingNotification"; -@interface NSApplication (SKPrivateDeclarations) -- (void)_docController:(NSDocumentController *)docController shouldTerminate:(BOOL)shouldTerminate; -@end - @implementation SKApplication @synthesize updaterController, userAttentionDisabled; @@ -85,10 +81,11 @@ [super terminate:sender]; } -- (void)_docController:(NSDocumentController *)docController shouldTerminate:(BOOL)shouldTerminate { - [super _docController:docController shouldTerminate:shouldTerminate]; - if (shouldTerminate == NO && [[self delegate] respondsToSelector:@selector(applicationDocumentControllerCanceledTerminate:)]) - [[self delegate] applicationDocumentControllerCanceledTerminate:self]; +// this is also called after NSDocumentController reviews unsaved documents +- (void)replyToApplicationShouldTerminate:(BOOL)shouldTerminate { + if (shouldTerminate == NO && [[self delegate] respondsToSelector:@selector(applicationWillNotTerminate:)]) + [[self delegate] applicationWillNotTerminate:self]; + [super replyToApplicationShouldTerminate:shouldTerminate]; } - (BOOL)willDragMouse { Modified: trunk/SKApplicationController.m =================================================================== --- trunk/SKApplicationController.m 2025-06-24 14:44:50 UTC (rev 15541) +++ trunk/SKApplicationController.m 2025-06-24 16:10:55 UTC (rev 15542) @@ -299,18 +299,17 @@ } - (void)applicationStartsTerminating:(NSNotification *)aNotification { - if (currentDocumentsTimer == nil) { - [currentDocumentsTimer invalidate]; - currentDocumentsTimer = nil; - NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; - [nc removeObserver:self name:SKDocumentDidShowNotification object:nil]; - [nc removeObserver:self name:SKDocumentControllerDidRemoveDocumentNotification object:nil]; - [self registerCurrentDocuments:nil]; - } + [currentDocumentsTimer invalidate]; + currentDocumentsTimer = nil; + NSNotificationCenter *nc = [NSNotificationCenter defaultCenter]; + [nc removeObserver:self name:SKDocumentDidShowNotification object:nil]; + [nc removeObserver:self name:SKDocumentControllerDidRemoveDocumentNotification object:nil]; + [self registerCurrentDocuments:nil]; } -- (void)applicationDocumentControllerCanceledTerminate:(NSApplication *)application { - [self registerForCurrentDocumentsNotifications]; +- (void)applicationWillNotTerminate:(NSApplication *)application { + if (currentDocumentsTimer == nil) + [self registerForCurrentDocumentsNotifications]; } - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)application { @@ -328,7 +327,6 @@ [NSApp replyToApplicationShouldTerminate:YES]; } else { [NSApp replyToApplicationShouldTerminate:NO]; - [self registerForCurrentDocumentsNotifications]; } }); return NSTerminateLater; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |