Provide a new 'View data' button in the upload dialogue.
[potlatch2.git] / net / systemeD / potlatch2 / save / SaveDialog.mxml
index 4d87dd1395bc58177bbe817267d8d2f25f8031ca..676c446cd7c05b7fa6493415265ff6a1af291755 100644 (file)
       <mx:Text width="100%" styleName="failText" text="{failureText}"/>
     </mx:VBox>
 
+    <mx:VBox width="100%" height="100%" id="dataTab">
+      <mx:TextArea width="100%" height="100%" id="dataText"/>
+    </mx:VBox>
+
   </mx:ViewStack>
 
   <mx:ControlBar>
+    <mx:Button id="dataButton" label="View data" visible="false" click="processSequence.selectedChild=dataTab" styleName="titleWindowButton" />
     <mx:Spacer width="100%"/>
     <mx:Button id="cancelButton" label="Cancel" click="close();" styleName="titleWindowButton" />
     <mx:Button id="saveButton" label="Save >" click="startSave();" styleName="titleWindowButton" />
         
         saveProgress.label = "Uploading changes";
         _connection.addEventListener(Connection.SAVE_COMPLETED, saveCompleted);
-        _connection.uploadChanges();
+        var rawData:*=_connection.uploadChanges();
+        if (rawData) {
+            dataText.text=rawData.toString();
+            dataButton.visible=true;
+        }
     }
     
     private function changesetError(event:Event):void {
     private function saveCompleted(event:SaveCompleteEvent):void {
         if ( event.saveOK ) {
                        _connection.dispatchEvent(new AttentionEvent(AttentionEvent.ALERT, null, "Changes successfully saved"));
-            close();
+            if (processSequence.selectedChild!=dataTab) close();
         } else {
             fail("Failure when uploading data");
                }
         processSequence.selectedChild = failureTab;
         failureText = text;
     }
-    
+
     private function close():void {
         _connection.removeEventListener(Connection.NEW_CHANGESET, changesetCreated);
         _connection.removeEventListener(Connection.NEW_CHANGESET_ERROR, changesetError);