Clear the file after uploading (so people can't print the same document twice)
authorRobert Sesek <rsesek@bluestatic.org>
Wed, 10 Sep 2008 23:40:21 +0000 (19:40 -0400)
committerRobert Sesek <rsesek@bluestatic.org>
Wed, 10 Sep 2008 23:40:21 +0000 (19:40 -0400)
* Source/AppController.h: Add an IBO for the "go" button
* Source/AppController.m:
(uploadAndPrint:): Disable the "go" button
* English.lproj/MainMenu.xib: Hook up the IBO
* Source/DraggableImageView.h+m:
(clearFile): New method to clear the currently dropped file

English.lproj/MainMenu.xib
Source/AppController.h
Source/AppController.m
Source/DraggableImageView.h
Source/DraggableImageView.m

index 396fb36e48622d609b2d5d11299f62596a203a6f..a5c977605b87e7e6f5a41698bb1c8ef261a2b288 100644 (file)
@@ -8,9 +8,9 @@
                <string key="IBDocument.HIToolboxVersion">352.00</string>
                <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
                        <bool key="EncodedWithXMLCoder">YES</bool>
-                       <integer value="106"/>
                        <integer value="539"/>
-                       <integer value="391"/>
+                       <integer value="106"/>
+                       <integer value="372"/>
                </object>
                <object class="NSArray" key="IBDocument.PluginDependencies">
                        <bool key="EncodedWithXMLCoder">YES</bool>
                                        </object>
                                        <int key="connectionID">557</int>
                                </object>
+                               <object class="IBConnectionRecord">
+                                       <object class="IBOutletConnection" key="connection">
+                                               <string key="label">goButton</string>
+                                               <reference key="source" ref="591533163"/>
+                                               <reference key="destination" ref="154094289"/>
+                                       </object>
+                                       <int key="connectionID">558</int>
+                               </object>
                        </object>
                        <object class="IBMutableOrderedSet" key="objectRecords">
                                <object class="NSArray" key="orderedObjects">
                                        <reference ref="9"/>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <reference ref="9"/>
-                                       <string>{{21, 388}, {480, 434}}</string>
+                                       <string>{{399, 341}, {480, 434}}</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                        <integer value="0" id="8"/>
                                        <reference ref="8"/>
-                                       <string>{{21, 388}, {480, 434}}</string>
+                                       <string>{{399, 341}, {480, 434}}</string>
                                        <reference ref="8"/>
                                        <string>{{542, 257}, {480, 434}}</string>
                                        <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
                                </object>
                        </object>
                        <nil key="sourceID"/>
-                       <int key="maxID">557</int>
+                       <int key="maxID">558</int>
                </object>
                <object class="IBClassDescriber" key="IBDocument.Classes">
                        <object class="NSMutableArray" key="referencedPartialClassDescriptions">
                                                <object class="NSMutableArray" key="dict.sortedKeys">
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                        <string>dragRegion</string>
+                                                       <string>goButton</string>
                                                        <string>helpWebView</string>
                                                        <string>helpWindow</string>
                                                        <string>password</string>
                                                <object class="NSMutableArray" key="dict.values">
                                                        <bool key="EncodedWithXMLCoder">YES</bool>
                                                        <string>DraggableImageView</string>
+                                                       <string>NSButton</string>
                                                        <string>WebView</string>
                                                        <string>NSWindow</string>
                                                        <string>NSSecureTextField</string>
index 1ac8a6253df228d4e1bbda0ebba65fd17de72094..22125bb641d829f777356d71c6af5541532270e3 100644 (file)
@@ -22,6 +22,7 @@
 {
        IBOutlet NSTextField *username;
        IBOutlet NSSecureTextField *password;
+       IBOutlet NSButton *goButton;
        
        IBOutlet NSProgressIndicator *progress;
        IBOutlet NSTextField *status;
index 126f52732050aba95766988e4272081e9af099b5..a4e6c5132db0f7f51f292039425c0f1ad5ce5ace 100644 (file)
        [progress startAnimation:self];
        [progress setHidden:NO];
        [status setHidden:NO];
+       [goButton setEnabled:NO];
        
        FILE *localFile;
        struct stat fileInfo;
@@ -273,6 +274,7 @@ shutdown:
        
        close(sock);
        
+       [dragRegion clearFile];
        [progress stopAnimation:self];
        
        [pool release];
index a5cc72dad86a3350c86e2f9b3072580e799cad04..4621cdca1db44824b69a82297140d97e47d1f3e6 100644 (file)
@@ -24,6 +24,7 @@
        NSString *filePath;
 }
 
+- (void)clearFile;
 - (NSString *)filePath;
 
 @end
index c0d423b85991e2c4496f2af83a1c61b59cb0ec87..2493957b829f5a60f8f4507423156001e799e1e4 100644 (file)
        return filePath;
 }
 
+/**
+ * Clears the file from selection
+ */
+- (void)clearFile
+{
+       [filePath release];
+       filePath = nil;
+       [pathDisplay setStringValue:@""];
+       [self setImage:nil];
+       [printButton setEnabled:NO];
+}
+
 /**
  * Dealloc
  */