https://src.bluestatic.org
/
printdrop.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
65ec94e
)
Threading the print command with -[uploadAndPrint:]
author
Robert Sesek <rsesek@bluestatic.org>
Tue, 26 Feb 2008 16:54:54 +0000
(11:54 -0500)
committer
Robert Sesek <rsesek@bluestatic.org>
Tue, 26 Feb 2008 16:54:54 +0000
(11:54 -0500)
Source/AppController.m
patch
|
blob
|
history
diff --git
a/Source/AppController.m
b/Source/AppController.m
index 0a0aaf962caed023ff9d4d052280bbc371c5d812..2d5f4151fb48dd5020cd4f072829251d72685efb 100644
(file)
--- a/
Source/AppController.m
+++ b/
Source/AppController.m
@@
-22,10
+22,10
@@
@interface AppController (Private)
@interface AppController (Private)
-//- (BOOL)uploadFile;
- (void)setStatus:(NSString *)msg isError:(BOOL)error;
- (void)readChannel:(LIBSSH2_CHANNEL *)channel;
- (void)setStatus:(NSString *)msg isError:(BOOL)error;
- (void)readChannel:(LIBSSH2_CHANNEL *)channel;
+- (void)uploadAndPrint:(id)sender;
@end
@end
@@
-98,6
+98,17
@@
*/
- (IBAction)print:(id)sender
{
*/
- (IBAction)print:(id)sender
{
+ [NSThread detachNewThreadSelector:@selector(uploadAndPrint:) toTarget:self withObject:sender];
+}
+
+/**
+ * Opens an SSH session, creates a SCP channel to upload the file, followed by a shell channel
+ * to queue up LPR
+ */
+- (void)uploadAndPrint:(id)sender
+{
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
[progress startAnimation:self];
[progress setHidden:NO];
[status setHidden:NO];
[progress startAnimation:self];
[progress setHidden:NO];
[status setHidden:NO];
@@
-230,6
+241,8
@@
shutdown:
close(sock);
[progress stopAnimation:self];
close(sock);
[progress stopAnimation:self];
+
+ [pool release];
}
@end
}
@end