Skip to content

Commit

Permalink
Plugin certified for medical imaging
Browse files Browse the repository at this point in the history
  • Loading branch information
rossetantoine committed Aug 5, 2013
1 parent 8ec4ee4 commit 4010b76
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions AppController.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ extern AppController* OsiriX;

+ (BOOL) isFDACleared;
+ (BOOL) willExecutePlugin;
+ (BOOL) willExecutePlugin:(id) filter;
+ (BOOL) hasMacOSXLion;
+ (BOOL) hasMacOSXSnowLeopard;
+ (BOOL) hasMacOSXLeopard;
Expand Down
15 changes: 14 additions & 1 deletion AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -993,9 +993,19 @@ + (NSString*) printStackTrace: (NSException*) e
}

+ (BOOL) willExecutePlugin
{
return [self willExecutePlugin: nil];
}

+ (BOOL) willExecutePlugin:(id) filter;
{
BOOL returnValue = YES;

if( filter && [filter respondsToSelector: @selector( isCertifiedForMedicalImaging)])
{
return [filter isCertifiedForMedicalImaging];
}

if( [AppController isFDACleared])
{
if( [[NSUserDefaults standardUserDefaults] boolForKey: @"hidePluginCertificationWarning"] == NO)
Expand Down Expand Up @@ -4799,7 +4809,10 @@ - (void) tileWindows:(id)sender windows: (NSMutableArray*) viewersList display2D
NSDate *date1 = [[obj1 currentStudy] date];
NSDate *date2 = [[obj2 currentStudy] date];

return [date2 compare: date1];
if( [[NSUserDefaults standardUserDefaults] boolForKey: @"reversedTileWindowsOrderByStudyDate"])
return [date1 compare: date2];
else
return [date2 compare: date1];
}];
}

Expand Down
3 changes: 3 additions & 0 deletions PluginFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
/** This function is called if OsiriX needs to kill the current running plugin, to install an update, for example. */
- (void) willUnload;

/** This function is called if OsiriX needs to display a warning to the user about a non-certified plugin. */
- (BOOL) isCertifiedForMedicalImaging;

/** Opportunity for plugins to make Menu changes if necessary */

- (void)setMenus;
Expand Down
5 changes: 5 additions & 0 deletions PluginFilter.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ - (long) prepareFilter:(ViewerController*) vC
return 0;
}

- (BOOL) isCertifiedForMedicalImaging
{
return NO;
}

- (ViewerController*) duplicateCurrent2DViewerWindow
{
long i;
Expand Down
2 changes: 1 addition & 1 deletion ViewerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8272,7 +8272,7 @@ - (void)executeFilterFromBundle:(NSBundle*)bundle title:(NSString*)name
} else
filter = [[PluginManager plugins] objectForKey:name];

if( [AppController willExecutePlugin] == NO)
if( [AppController willExecutePlugin: filter] == NO)
return;

if( filter == nil)
Expand Down

0 comments on commit 4010b76

Please sign in to comment.