Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/osirixplugins/code@288 bdd3870d-6ba2-4b59-8605-1de7af000970
  • Loading branch information
aglv committed Aug 21, 2012
1 parent 3d4bac9 commit 59e5a29
Show file tree
Hide file tree
Showing 10 changed files with 367 additions and 862 deletions.
21 changes: 5 additions & 16 deletions AutoClean/Sources/AutoCleanPluginFilter.mm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#import <OsiriXAPI/N2Debug.h>
#import <OsiriXAPI/browserController.h>
#import <OsiriXAPI/ThreadsManager.h>
#import <OsiriXAPI/DicomDatabase.h>

@implementation AutoCleanPluginFilter

Expand All @@ -21,6 +22,7 @@ -(void)initPlugin {

-(void)dealloc {
[self unscheduleAutoClean];
[super dealloc];
}

-(void)scheduleAutoCleanAt:(NSDate*)date {
Expand Down Expand Up @@ -53,22 +55,9 @@ -(void)_autoCleanThread:(NSDate*)date {
thread.name = NSLocalizedString(@"AutoClean Plugin", nil);
[ThreadsManager.defaultManager addThreadAndStart:thread];

Class DD = NSClassFromString(@"DicomDatabase");
if (DD)
{
id dd = [DD valueForKey:@"defaultDatabase"];
[dd performSelector:@selector(cleanForFreeSpaceMB:) withObject:[NSNumber numberWithInteger:124000]]; // TODO: 124000 -> -AutoCleanPluginThreshold/100*disksize
}
else // old OsiriX has @selector(autoCleanDatabaseFreeSpaceThread:)... but this will return without doing anything if autoclean is already running! and we cannot know
{
[NSUserDefaults.standardUserDefaults setBool:YES forKey:@"AUTOCLEANINGSPACE"];
NSInteger threshold = [[NSUserDefaults.standardUserDefaults objectForKey:AutoCleanPluginThresholdDefaultsKey] integerValue];
[NSUserDefaults.standardUserDefaults setInteger:threshold forKey:@"AUTOCLEANINGSPACE"];

[[BrowserController currentBrowser] performSelector:@selector(autoCleanDatabaseFreeSpaceThread:) withObject:self];

[NSUserDefaults.standardUserDefaults setObject:date forKey:AutoCleanPluginLastExecutionDefaultsKey];
}
id dd = [DicomDatabase defaultDatabase];
[dd performSelector:@selector(cleanForFreeSpaceMB:) withObject:[NSNumber numberWithInteger:124000]]; // TODO: 124000 -> -AutoCleanPluginThreshold/100*disksize

} @catch (NSException* e) {
N2LogExceptionWithStackTrace(e);
} @finally {
Expand Down
Binary file modified ExportROIs/English.lproj/InfoPlist.strings
Binary file not shown.
2 changes: 2 additions & 0 deletions ExportROIs/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>1.3.1</string>
<key>CFBundleShortVersionString</key>
<string>1.3.1</string>
<key>MenuTitles</key>
<array>
<string>Export ROIs</string>
Expand Down
Binary file modified ExportROIs/html/ExportROIs.osirixplugin.zip
Binary file not shown.
621 changes: 44 additions & 577 deletions HelloWorld/HelloWorldPreferences.xib

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions KeyObjectSelection/Resources/Plugin-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<string>1.0.1</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.0.1</string>
<key>NSPrincipalClass</key>
<string>KeyObjectSelectionFilter</string>
</dict>
Expand Down
3 changes: 2 additions & 1 deletion KeyObjectSelection/Sources/KeyObjectSelectionFilter.mm
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,9 @@ - (void)_ViewerController_finalizeSeriesViewing {
static NSString* const KOSReconstructionsSeriesName = NSLocalizedString(@"OsiriX Screen Captures", nil);

-(void)_ViewerController_setKeyImage:(id)sender {
DicomImage* image = [(ViewerController*)self currentImage];
//if ([(ViewerController*)self blendingController])
if (![[[(ViewerController*)self currentImage] isKeyImage] boolValue])
if (![image.modality isEqualToString:@"SC"] && ![[image isKeyImage] boolValue])
{
[KeyObjectSelectionFilterInstance playGrabSound];

Expand Down
Loading

0 comments on commit 59e5a29

Please sign in to comment.