=== modified file 'cmd/ciborium-ui/main.go'
--- cmd/ciborium-ui/main.go	2015-03-10 01:07:19 +0000
+++ cmd/ciborium-ui/main.go	2015-03-10 01:07:19 +0000
@@ -42,6 +42,7 @@
 	FormatError    bool
 	Unmounting     bool
 	UnmountError   bool
+	DevicePresent  bool
 }
 
 type DriveList struct {
@@ -120,8 +121,13 @@
 		for block := range c {
 			if block {
 				log.Println("Block device added")
+				ctrl.DevicePresent = true
+				qml.Changed(ctrl, &ctrl.DevicePresent)
 			} else {
 				log.Println("Block device removed")
+				// TODO: keep track of the removed device
+				ctrl.DevicePresent = false
+				qml.Changed(ctrl, &ctrl.DevicePresent)
 			}
 			ctrl.Drives()
 		}
@@ -166,6 +172,7 @@
 			}
 		}
 	}()
+
 }
 
 func (ctrl *driveControl) Drives() {

=== added file 'share/ciborium/qml/components/DriveDelegate.qml'
--- share/ciborium/qml/components/DriveDelegate.qml	1970-01-01 00:00:00 +0000
+++ share/ciborium/qml/components/DriveDelegate.qml	2015-03-10 01:07:19 +0000
@@ -0,0 +1,68 @@
+import QtQuick 2.0
+import Ubuntu.Components 1.1
+import Ubuntu.Components.Popups 1.0
+
+UbuntuShape {
+    property var onFormatClicked
+    property var onSafeRemovalClicked
+
+    height: childrenRect.height + (3 *units.gu(1))
+    color: driveIndex % 2 === 0 ? "white" : "#DECAE3"
+
+    Icon {
+    	id: driveIcon
+        width: 24
+        height: 24
+        name: "media-memory-sd"
+        //source: "file:///usr/share/icons/Humanity/devices/48/media-memory-sd.svg"
+
+	anchors {
+	    top: parent.top
+	    topMargin: units.gu(2)
+	    left: parent.left
+	    leftMargin: units.gu(2)
+	}
+    }
+
+    Label {
+    	id: driveLabel
+        text: driveCtrl.driveModel(index)
+
+	anchors {
+            top: parent.top
+	    topMargin: units.gu(2)
+	    left: driveIcon.right
+	    leftMargin: units.gu(2)
+	    right: parent.right
+	    rightMargin: units.gu(2)
+	    bottom:  driveIcon.bottom
+	}
+    }
+
+    Button {
+        id: formatButton
+        text: i18n.tr("Format")
+        onClicked: onFormatClicked() 
+
+	anchors {
+	    top: driveIcon.bottom
+	    topMargin: units.gu(1)
+	    left: parent.left
+	    leftMargin: units.gu(1)
+
+	}
+    }
+
+    Button {
+        id: removalButton
+        text: i18n.tr("Safely Remove")
+        onClicked: onSafeRemovalClicked(removalButton)
+
+	anchors {
+	    top: driveIcon.bottom
+	    topMargin: units.gu(1)
+	    left: formatButton.right
+	    leftMargin: units.gu(1)
+	}
+    }
+}

=== added file 'share/ciborium/qml/components/FormatConfirmation.qml'
--- share/ciborium/qml/components/FormatConfirmation.qml	1970-01-01 00:00:00 +0000
+++ share/ciborium/qml/components/FormatConfirmation.qml	2015-03-10 01:07:19 +0000
@@ -0,0 +1,37 @@
+import QtQuick 2.0
+import Ubuntu.Components 1.1
+import Ubuntu.Components.Popups 1.0
+
+Dialog {
+    property bool isError: driveCtrl.formatError
+    property bool formatting: driveCtrl.formatting 
+    property var onButtonClicked
+
+    title: i18n.tr("Formatting")
+
+    ActivityIndicator {
+        id: formatActivity
+        visible:  formatting && !isError
+        running: formatting && !isError
+    }
+
+    Button {
+        id: okFormatErrorButton
+        visible: false
+        text: i18n.tr("Ok")
+        color: UbuntuColors.orange
+        onClicked: onButtonClicked()
+    }
+
+    onIsErrorChanged: {
+        if (isError) {
+            okFormatErrorButton.visible = true;
+            formatActivity.visible = false;
+            text= i18n.tr("There was an error when formatting the device");
+        } else {
+            okFormatErrorButton.visible= false;
+            formatActivity.visible= true;
+        }
+    }
+
+}

=== modified file 'share/ciborium/qml/components/FormatDialog.qml'
--- share/ciborium/qml/components/FormatDialog.qml	2015-03-10 01:07:19 +0000
+++ share/ciborium/qml/components/FormatDialog.qml	2015-03-10 01:07:19 +0000
@@ -2,88 +2,21 @@
 import Ubuntu.Components 1.1
 import Ubuntu.Components.Popups 1.0
 
-Item {
+Dialog {
     property int driveIndex
-
-
-    height: childrenRect.height
-    width: childrenRect.width
-
-    Component {
-        id: dialogFormat
-
-        Dialog {
-            id: dialogueFormat
-
-            title: i18n.tr("Format")
-            text: i18n.tr("This action will wipe the content from the device")
-
-            Button {
-                text: i18n.tr("Cancel")
-                onClicked: PopupUtils.close(dialogueFormat)
-            }
-            Button {
-                text: i18n.tr("Continue with format")
-                color: UbuntuColors.orange
-                onClicked: {
-                    driveCtrl.driveFormat(driveIndex)                     
-                    PopupUtils.close(dialogueFormat)
-                    PopupUtils.open(dialogFormatting)
-                }
-            }
-        }
-    }
-
-    Component {
-        id: dialogFormatting
-
-        Dialog {
-            id: dialogueFormatting
-            property bool isError: driveCtrl.formatError
-
-            title: i18n.tr("Formatting")
-
-            ActivityIndicator {
-                id: formatActivity
-		visible:  driveCtrl.formatting && !isError
-                running: driveCtrl.formatting && !isError
-                onRunningChanged: {
-                    if (!running) {
-		    	if (!isError)
-                            PopupUtils.close(dialogueFormatting);
-                    }
-                }
-            }
-
-            Button {
-	    	id: okFormatErrorButton
-		visible: false
-                text: i18n.tr("Ok")
-                color: UbuntuColors.orange
-                onClicked: {
-                    PopupUtils.close(dialogueFormatting)
-                }
-
-            }
-
-            onIsErrorChanged: {
-	    	if (isError) {
-			okFormatErrorButton.visible = true;
-                        formatActivity.visible = false;
-                        dialogueFormatting.text= i18n.tr("There was an error when formatting the device");
-		} else {
-			okFormatErrorButton.visible= false;
-                        formatActivity.visible= true;
-		}
-	    }
-        }
-    }
-
-    Button {
-        anchors.centerIn: parent
-        id: formatButton
-        text: i18n.tr("Format")
-        onClicked: PopupUtils.open(dialogFormat)
-    }
-
+    property var onCancelClicked
+    property var onContinueClicked
+
+    title: i18n.tr("Format")
+    text: i18n.tr("This action will wipe the content from the device")
+
+    Button {
+        text: i18n.tr("Cancel")
+        onClicked: onCancelClicked()
+    }
+    Button {
+        text: i18n.tr("Continue with format")
+        color: UbuntuColors.orange
+        onClicked: onContinueClicked()
+    }
 }

=== modified file 'share/ciborium/qml/components/SafeRemoval.qml'
--- share/ciborium/qml/components/SafeRemoval.qml	2015-03-10 01:07:19 +0000
+++ share/ciborium/qml/components/SafeRemoval.qml	2015-03-10 01:07:19 +0000
@@ -2,93 +2,24 @@
 import Ubuntu.Components 1.1
 import Ubuntu.Components.Popups 1.0
 
-Item {
+
+Dialog {
     property int driveIndex
-
-    height: childrenRect.height
-    width: childrenRect.width
-
-    Component {
-        id: dialogRemoved
-
-        Dialog {
-            id: dialogueRemoved
-            property bool isError: driveCtrl.unmountError
-
-
-            title: i18n.tr("Unmounting")
-
-            Button {
-	    	id: unmountOkButton
-		visible: false
-                text: i18n.tr("Ok")
-                color: UbuntuColors.orange
-                onClicked: {
-                    PopupUtils.close(dialogueRemoved)
-                }
-            }
-
-            ActivityIndicator {
-                id: unmountActivity
-		visible: driveCtrl.unmounting && !isError
-                running: driveCtrl.unmounting && !isError
-                onRunningChanged: {
-                    if (!running) {
-		    	if (!isError) {
-				unmountOkButton.visible = true;
-				unmountActivity.visible = false;
-				dialogueRemoved.text = i18n.tr("You can now safely remove the device");
-			}
-                    }
-                }
-            }
-
-
-            onIsErrorChanged: {
-	    	if (isError) {
-			dialogueRemoved.title = i18n.tr("Unmount Error");
-			dialogueRemoved.text = i18n.tr("The device could not be unmounted because is busy");
-		} else {
-			dialogueRemoved.title = i18n.tr("Safe to remove");
-			dialogueRemoved.text = i18n.tr("You can now safely remove the device");
-		}
-		unmountOkButton.visible = true;
-	    }
-        }
-    }
-
-    Component {
-        id: dialogConfirmRemove
-
-        Dialog {
-            id: dialogueConfirmRemove
-
-            title: i18n.tr("Confirm remove")
-            text: i18n.tr("Files on the device can't be accessed after removing")
-
-            Button {
-                text: i18n.tr("Cancel")
-                onClicked: PopupUtils.close(dialogueConfirmRemove)
-            }
-            Button {
-                text: i18n.tr("Continue")
-                color: UbuntuColors.orange
-                onClicked: {
-                    driveCtrl.driveUnmount(index)
-                    PopupUtils.close(dialogueConfirmRemove)
-                    saferemoval.enabled= false
-                    PopupUtils.open(dialogRemoved)
-                }
-            }
-        }
-    }
-
-    Button {
-        anchors.centerIn: parent
-        id: saferemoval
-        text: i18n.tr("Safely Remove")
-        onClicked: {
-            PopupUtils.open(dialogConfirmRemove)
-        }
-    }
+    property var removeButton
+    property var onCancelClicked
+    property var onContinueClicked
+
+    title: i18n.tr("Confirm remove")
+    text: i18n.tr("Files on the device can't be accessed after removing")
+
+    Button {
+        text: i18n.tr("Cancel")
+        onClicked: onCancelClicked(removeButton) 
+    } // Button Cancel
+
+    Button {
+        text: i18n.tr("Continue")
+        color: UbuntuColors.orange
+        onClicked: onContinueClicked(removeButton)
+   }
 }

=== added file 'share/ciborium/qml/components/SafeRemovalConfirmation.qml'
--- share/ciborium/qml/components/SafeRemovalConfirmation.qml	1970-01-01 00:00:00 +0000
+++ share/ciborium/qml/components/SafeRemovalConfirmation.qml	2015-03-10 01:07:19 +0000
@@ -0,0 +1,54 @@
+import QtQuick 2.0
+import Ubuntu.Components 1.1
+import Ubuntu.Components.Popups 1.0
+
+Dialog {
+    property bool isError: driveCtrl.unmountError
+    property int driveCount: driveCtrl.len
+    property var onButtonClicked
+    property var removeButton
+
+    title: i18n.tr("Unmounting")
+
+    Button {
+        id: unmountOkButton
+        visible: false
+        text: i18n.tr("Ok")
+        color: UbuntuColors.orange
+        onClicked: onButtonClicked()
+    }  // Button unmountOkButton
+
+    ActivityIndicator {
+        id: unmountActivity
+        visible: driveCtrl.unmounting && !isError
+        running: driveCtrl.unmounting && !isError
+        onRunningChanged: {
+            if (!running && !isError) {
+                unmountOkButton.visible = true;
+                unmountActivity.visible = false;
+                text = i18n.tr("You can now safely remove the device");
+            }
+        } // onRunningChanged
+    }  // ActivityIndictor unmountActivity
+
+
+    onIsErrorChanged: {
+        if (isError) {
+            title = i18n.tr("Unmount Error");
+            text = i18n.tr("The device could not be unmounted because is busy");
+            removeButton.enabled = true
+        } else {
+            title = i18n.tr("Safe to remove");
+            text = i18n.tr("You can now safely remove the device");
+            removeButton.enabled = true
+        }
+        unmountOkButton.visible = true;
+    } // onIsErrorChanged
+
+    onDriveCountChanged: {
+        if (driveCount == 0) {
+            // TODO: really needed? 
+            PopupUtils.close(confirmationDialog)
+        }
+    } // onDriveCountChanged
+}

=== modified file 'share/ciborium/qml/main.qml'
--- share/ciborium/qml/main.qml	2014-09-24 20:24:19 +0000
+++ share/ciborium/qml/main.qml	2015-03-10 01:07:19 +0000
@@ -1,6 +1,7 @@
 import QtQuick 2.0
 import Ubuntu.Components 1.1
 import Ubuntu.Components.ListItems 0.1 as ListItem
+import Ubuntu.Components.Popups 1.0
 
 import "components"
 
@@ -33,65 +34,104 @@
             title: i18n.tr("SD Card Management")
             Component.onCompleted: driveCtrl.watch()
 
+	    Component {
+                id: safeRemovalConfirmation
+                SafeRemovalConfirmation {
+                    id: safeRemovalConfirmationDialog
+		    onButtonClicked: function() {
+		        console.log("SafeRemovalDialog button clicked");
+		        PopupUtils.close(safeRemovalConfirmationDialog)
+                    }
+		}
+	    }
+
+	    Component {
+                id: safeRemoval
+                SafeRemoval {
+                    id: safeRemovalDialog
+                    onCancelClicked: function(button) {
+		        console.log("SafeRemoval cancelation button clicked");
+                        button.enabled = true;
+		        PopupUtils.close(safeRemovalDialog);
+	            }
+                    onContinueClicked: function(button) {
+		        console.log("SafeRemoval continue button clicked.")
+                        driveCtrl.driveUnmount(safeRemovalDialog.driveIndex)
+                        PopupUtils.close(safeRemovalDialog)
+                        PopupUtils.open(safeRemovalConfirmation, mainPage, {"removeButton": button})
+		    }
+                }
+	    }
+
+	    Component {
+	    	id: formatConfirmation
+		FormatConfirmation {
+	    	    id: formatConfirmationDialog
+		    onButtonClicked: function() {
+		        console.log("FormatConfirmation button clicked");
+		        PopupUtils.close(formatConfirmationDialog)
+                    }
+                    onFormattingChanged: {
+                        if (!formatConfirmationDialog.formatting && !formatConfirmationDialog.isError) {
+                            PopupUtils.close(formatConfirmationDialog);
+                        }
+		    }
+		}
+	    }
+
+	    Component {
+	    	id: format
+                FormatDialog {
+	    	    id: formatDialog
+                    onCancelClicked: function() {
+		        console.log("Format cancelation button clicked");
+		        PopupUtils.close(formatDialog);
+	            }
+
+                    onContinueClicked: function() {
+		        console.log("Format continue button clicked.")
+                        driveCtrl.driveFormat(formatDialog.driveIndex)                     
+                        PopupUtils.close(formatDialog)
+                        PopupUtils.open(formatConfirmation, mainPage)
+		    }
+		}
+	    }
+
+
             ListView {
                 model: driveCtrl.len
                 spacing: units.gu(1)
+
                 anchors {
                     top: parent.top
                     bottom: parent.bottom
                     left: parent.left
                     right: parent.right
                     topMargin: units.gu(1)
-                }
-
-                delegate: UbuntuShape {
-                    height: childrenRect.height
-                    width: parent.width
-                    color: index % 2 === 0 ? "white" : "#DECAE3"
-                    anchors {
-                        topMargin: units.gu(1)
-                        bottomMargin: units.gu(1)
-                    }
-
-                    Column {
-                        spacing: units.gu(2)
+                } // anchors
+
+                delegate: DriveDelegate {
+                        onFormatClicked: function() {
+                            PopupUtils.open(format, mainPage, {"driveIndex": index})
+			}
+
+                        onSafeRemovalClicked: function(button) {
+			    button.enabled = false
+                            PopupUtils.open(safeRemoval, mainPage, {"driveIndex": index, "removeButton": button})
+			}
+
                         anchors {
-                            leftMargin: units.gu(2)
+		            left: parent.left
+		            leftMargin: units.gu(1)
+		            right: parent.right
+		            rightMargin: units.gu(1)
                             topMargin: units.gu(1)
                             bottomMargin: units.gu(1)
                         }
 
-                        Row {
-                            spacing: units.gu(1)
-                            height: units.gu(2)
-                            width: childrenRect.width
-
-                            Icon {
-                                width: 24
-                                height: 24
-                                name: "media-memory-sd"
-                                //source: "file:///usr/share/icons/Humanity/devices/48/media-memory-sd.svg"
-                            }
-                            Label {
-                                width: paintedWidth       
-                                text: driveCtrl.driveModel(index)
-                            }
-                        }
-                        Row {
-                            spacing: units.gu(1)
-                            height: childrenRect.height
-                            width: childrenRect.width
-                            FormatDialog {
-                                driveIndex: index
-                            }
-                            SafeRemoval {
-                                driveIndex: index
-                            }
-                        }
-                    }
-                }
-            }
-        }
+                } // delegate
+            } // ListView
+        } // Page
     }
 }
 

