Revision: 28334
          http://sourceforge.net/p/bibdesk/svn/28334
Author:   hofman
Date:     2023-09-12 14:37:54 +0000 (Tue, 12 Sep 2023)
Log Message:
-----------
add smart group date condition comparison for a date in the current session

Modified Paths:
--------------
    trunk/bibdesk/BDSKApplication.h
    trunk/bibdesk/BDSKApplication.m
    trunk/bibdesk/BDSKCondition.h
    trunk/bibdesk/BDSKCondition.m
    trunk/bibdesk/Base.lproj/BDSKCondition.xib
    trunk/bibdesk/de.lproj/BDSKCondition.strings
    trunk/bibdesk/en.lproj/BDSKCondition.strings
    trunk/bibdesk/fr.lproj/BDSKCondition.strings

Modified: trunk/bibdesk/BDSKApplication.h
===================================================================
--- trunk/bibdesk/BDSKApplication.h     2023-08-01 14:14:07 UTC (rev 28333)
+++ trunk/bibdesk/BDSKApplication.h     2023-09-12 14:37:54 UTC (rev 28334)
@@ -40,8 +40,12 @@
 
 @protocol BDSKApplicationDelegate;
 
-@interface BDSKApplication : NSApplication
+@interface BDSKApplication : NSApplication {
+    NSDate *launchDate;
+}
 
+@property (nonatomic, readonly) NSDate *launchDate;
+
 - (void)relaunch;
 
 - (id <BDSKApplicationDelegate>)delegate;

Modified: trunk/bibdesk/BDSKApplication.m
===================================================================
--- trunk/bibdesk/BDSKApplication.m     2023-08-01 14:14:07 UTC (rev 28333)
+++ trunk/bibdesk/BDSKApplication.m     2023-09-12 14:37:54 UTC (rev 28334)
@@ -46,6 +46,8 @@
 
 @implementation BDSKApplication
 
+@synthesize launchDate;
+
 // I don't know where else to do this
 // the documentation says applicationWillFinishLaunching:, but that comes too 
late
 - (id)init {
@@ -52,6 +54,9 @@
     self = [super init];
     if (!RUNNING_BEFORE(10_11))
         [NSFontManager setFontManagerFactory:[BDSKFontManager class]];
+    if (self) {
+        launchDate = [[NSDate alloc] init];
+    }
     return self;
 }
 

Modified: trunk/bibdesk/BDSKCondition.h
===================================================================
--- trunk/bibdesk/BDSKCondition.h       2023-08-01 14:14:07 UTC (rev 28333)
+++ trunk/bibdesk/BDSKCondition.h       2023-09-12 14:37:54 UTC (rev 28334)
@@ -78,7 +78,8 @@
     BDSKDate, 
     BDSKAfterDate, 
     BDSKBeforeDate, 
-    BDSKInDateRange
+    BDSKInDateRange,
+    BDSKThisSession
 };
 
 typedef NS_ENUM(NSInteger, BDSKFieldType) {

Modified: trunk/bibdesk/BDSKCondition.m
===================================================================
--- trunk/bibdesk/BDSKCondition.m       2023-08-01 14:14:07 UTC (rev 28333)
+++ trunk/bibdesk/BDSKCondition.m       2023-09-12 14:37:54 UTC (rev 28334)
@@ -46,6 +46,7 @@
 #import "BDSKCondition+Scripting.h"
 #import "NSColor_BDSKExtensions.h"
 #import "NSArray_BDSKExtensions.h"
+#import "BDSKApplication.h"
 
 
 @interface BDSKCondition (Private)
@@ -800,6 +801,10 @@
             *startDate = [dateValue startOfPeriod:BDSKPeriodDay];
             *endDate = [toDateValue startOfPeriod:BDSKPeriodDay byAdding:1];
             break;
+        case BDSKThisSession:
+            *startDate = [NSApp launchDate];
+            *endDate = nil;
+            break;
     }
 }
 

Modified: trunk/bibdesk/Base.lproj/BDSKCondition.xib
===================================================================
--- trunk/bibdesk/Base.lproj/BDSKCondition.xib  2023-08-01 14:14:07 UTC (rev 
28333)
+++ trunk/bibdesk/Base.lproj/BDSKCondition.xib  2023-09-12 14:37:54 UTC (rev 
28334)
@@ -1,9 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
     <dependencies>
         <deployment identifier="macosx"/>
-        <development version="8000" identifier="xcode"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="17701"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="19529"/>
         <capability name="documents saved in the Xcode 8 format" 
minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -155,6 +154,7 @@
                                         <menuItem title="is yesterday" tag="1" 
id="219"/>
                                         <menuItem title="is this week" tag="2" 
id="214"/>
                                         <menuItem title="is last week" tag="3" 
id="221"/>
+                                        <menuItem title="is this session" 
tag="12" id="vns-I0-HQr"/>
                                         <menuItem isSeparatorItem="YES" 
id="216">
                                             <modifierMask 
key="keyEquivalentModifierMask" command="YES"/>
                                         </menuItem>

Modified: trunk/bibdesk/de.lproj/BDSKCondition.strings
===================================================================
(Binary files differ)

Modified: trunk/bibdesk/en.lproj/BDSKCondition.strings
===================================================================
(Binary files differ)

Modified: trunk/bibdesk/fr.lproj/BDSKCondition.strings
===================================================================
(Binary files differ)

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to