Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIAddDiskEncryptionPasswordDialog.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIAddDiskEncryptionPasswordDialog.cpp	(revision 55015)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIAddDiskEncryptionPasswordDialog.cpp	(revision 55016)
@@ -26,4 +26,5 @@
 # include <QTableView>
 # include <QHeaderView>
+# include <QPushButton>
 # include <QItemEditorFactory>
 # include <QAbstractTableModel>
@@ -105,4 +106,7 @@
     EncryptionPasswordMap encryptionPasswords() const { return m_encryptionPasswords; }
 
+    /** Returns whether the model is valid. */
+    bool isValid() const;
+
     /** Returns the row count, taking optional @a parent instead of root if necessary. */
     virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
@@ -145,4 +149,9 @@
     Q_OBJECT;
 
+signals:
+
+    /** Notifies listeners about data change. */
+    void sigDataChanged();
+
 public:
 
@@ -154,4 +163,7 @@
       * acquired from the UIEncryptionDataModel instance. */
     EncryptionPasswordMap encryptionPasswords() const;
+
+    /** Returns whether the table is valid. */
+    bool isValid() const;
 
 private:
@@ -198,4 +210,14 @@
     /* Prepare: */
     prepare();
+}
+
+bool UIEncryptionDataModel::isValid() const
+{
+    /* Check whether the model contains invalid passwords: */
+    foreach (const bool &fValue, m_encryptionPasswordStatus.values())
+        if (!fValue)
+            return false;
+    /* Valid by default: */
+    return true;
 }
 
@@ -402,4 +424,10 @@
 }
 
+bool UIEncryptionDataTable::isValid() const
+{
+    AssertPtrReturn(m_pModelEncryptionData, false);
+    return m_pModelEncryptionData->isValid();
+}
+
 void UIEncryptionDataTable::prepare()
 {
@@ -410,4 +438,7 @@
         /* Assign configured model to table: */
         setModel(m_pModelEncryptionData);
+        /* Configure encryption-data model: */
+        connect(m_pModelEncryptionData, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
+                this, SIGNAL(sigDataChanged()));
     }
 
@@ -459,4 +490,5 @@
     , m_pLabelDescription(0)
     , m_pTableEncryptionData(0)
+    , m_pButtonBox(0)
 {
     /* Prepare: */
@@ -464,4 +496,6 @@
     /* Translate: */
     retranslateUi();
+    /* Validate: */
+    revalidate();
 }
 
@@ -496,4 +530,7 @@
             AssertPtrReturnVoid(m_pTableEncryptionData);
             {
+                /* Configure encryption-data table: */
+                connect(m_pTableEncryptionData, SIGNAL(sigDataChanged()),
+                        this, SLOT(sltDataChanged()));
                 /* Add label into layout: */
                 pInputLayout->addWidget(m_pTableEncryptionData);
@@ -503,13 +540,13 @@
         }
         /* Create button-box: */
-        QIDialogButtonBox *pButtonBox = new QIDialogButtonBox;
-        AssertPtrReturnVoid(pButtonBox);
+        m_pButtonBox = new QIDialogButtonBox;
+        AssertPtrReturnVoid(m_pButtonBox);
         {
             /* Configure button-box: */
-            pButtonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
-            connect(pButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
-            connect(pButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
+            m_pButtonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
+            connect(m_pButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
+            connect(m_pButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
             /* Add button-box into layout: */
-            pMainLayout->addWidget(pButtonBox);
+            pMainLayout->addWidget(m_pButtonBox);
         }
     }
@@ -533,4 +570,11 @@
 }
 
+void UIAddDiskEncryptionPasswordDialog::revalidate()
+{
+    /* Validate: */
+    AssertPtrReturnVoid(m_pButtonBox);
+    m_pButtonBox->button(QDialogButtonBox::Ok)->setEnabled(m_pTableEncryptionData->isValid());
+}
+
 #include "UIAddDiskEncryptionPasswordDialog.moc"
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIAddDiskEncryptionPasswordDialog.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIAddDiskEncryptionPasswordDialog.h	(revision 55015)
+++ trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIAddDiskEncryptionPasswordDialog.h	(revision 55016)
@@ -28,4 +28,5 @@
 /* Forward declarations: */
 class UIEncryptionDataTable;
+class QIDialogButtonBox;
 class QLabel;
 
@@ -53,4 +54,9 @@
     EncryptionPasswordMap encryptionPasswords() const;
 
+private slots:
+
+    /** Handles the data change. */
+    void sltDataChanged() { revalidate(); }
+
 private:
 
@@ -60,4 +66,7 @@
     /** Translation routine. */
     void retranslateUi();
+
+    /** Validation routine. */
+    void revalidate();
 
     /** Holds the name of the machine we show this dialog for. */
@@ -71,4 +80,6 @@
     /** Holds the encryption-data table instance. */
     UIEncryptionDataTable *m_pTableEncryptionData;
+    /** Holds the button-box instance. */
+    QIDialogButtonBox *m_pButtonBox;
 };
 
