@interface AppController (Private)
-//- (BOOL)uploadFile;
- (void)setStatus:(NSString *)msg isError:(BOOL)error;
- (void)readChannel:(LIBSSH2_CHANNEL *)channel;
+- (void)uploadAndPrint:(id)sender;
@end
*/
- (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];
close(sock);
[progress stopAnimation:self];
+
+ [pool release];
}
@end