Source

Pleasant3D_OpenSource / PrinterDriver / Sanguino3G / Sanguino3G.m

//
//  Sanguino3G.m
//  Sanguino3G
//
//  Created by Eberhard Rensch on 18.02.10.
//  Copyright 2010 Pleasant Software. All rights reserved.
//

#import "Sanguino3G.h"

@implementation Sanguino3G

+ (NSString*)driverIdentifier
{
	return @"sanguino3g";
}

- (NSString*)driverName
{
	return NSLocalizedStringFromTableInBundle(@"Sanguino3G Fake", nil, [NSBundle bundleForClass:[self class]], @"Localized Display Name for Driver");
}

- (NSString*)driverVersionString
{
	return [[[NSBundle bundleForClass:[Sanguino3G class]] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
}

- (NSString*)driverImagePath
{
	return [[NSBundle bundleForClass:[Sanguino3G class]] pathForImageResource:@"mbIcon.png"];
}

- (NSString*)driverManufacturer
{
	return @"Pleasant Software";
}

- (NSView*)printDialogView
{
	[NSBundle loadNibNamed:@"PrintDialog" owner:self];
	return printerDialogView;
}

- (NSString*)statusString
{
	NSString* status;
	if(self.isPrinting)
		status = @"Remaining Time: xx:xx";
	else
		status = NSLocalizedStringFromTableInBundle(@"Waiting…", nil, [NSBundle bundleForClass:[self class]], @"Printing Driver Status Message");
	return status;
}

- (void)processPrintJob
{
	for(int i=0;i<30;i++)
	{
		[NSThread sleepUntilDate:[NSDate dateWithTimeIntervalSinceNow:.3]];
		dispatch_async(dispatch_get_main_queue(), ^{
			self.progress = ((float)i/30.f);
		});
	}
}

@end