SaveDialog support for floating alerts
authorRichard Fairhurst <richard@systemed.net>
Sun, 16 Jan 2011 16:54:39 +0000 (16:54 +0000)
committerRichard Fairhurst <richard@systemed.net>
Sun, 16 Jan 2011 16:54:39 +0000 (16:54 +0000)
net/systemeD/potlatch2/save/SaveDialog.mxml

index 1ccae4b..ef2100e 100644 (file)
       <mx:Text width="100%" styleName="failText" text="{failureText}"/>
     </mx:VBox>
 
-    <mx:VBox width="100%" height="100%" id="successTab">
-      <mx:Text width="100%">
-        <mx:htmlText><![CDATA[<b>All data uploaded!</b>]]></mx:htmlText>
-      </mx:Text>
-    </mx:VBox>
   </mx:ViewStack>
 
   <mx:ControlBar>
@@ -87,6 +82,7 @@
     import mx.events.DataGridEventReason;
     
     import net.systemeD.halcyon.connection.*;
+    import net.systemeD.halcyon.AttentionEvent;
     
     private var conn:Connection = Connection.getConnectionInstance();
        private var doSkip:Boolean = false;
     }
     
     private function saveCompleted(event:SaveCompleteEvent):void {
-        if ( event.saveOK )
-            succeed("All Data Saved!");
-        else
+        if ( event.saveOK ) {
+                       conn.dispatchEvent(new AttentionEvent(AttentionEvent.ALERT, null, "Changes successfully saved"));
+            close();
+        } else {
             fail("Failure when uploading data");
-
+               }
         if (saveButton && saveButton.parent) saveButton.parent.removeChild(saveButton);
         cancelButton.label = "Close";
     }
         infoBox.addChild(label);
     }
     
-    private function succeed(text:String):void {
-        processSequence.selectedChild = successTab;
-    }
-    
     private function fail(text:String):void {
         processSequence.selectedChild = failureTab;
         failureText = text;