Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp	(revision 55654)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp	(revision 55655)
@@ -65,5 +65,4 @@
     /* Loading/saving stuff: */
     , m_pSerializeProcess(0)
-    , m_pSerializeProgress(0)
     , m_fLoaded(false)
     , m_fSaved(false)
@@ -123,4 +122,6 @@
     /* Prepare process-bar: */
     m_pProcessBar = new QProgressBar;
+    m_pProcessBar->setMaximum(100);
+    m_pProcessBar->setMinimum(0);
 
     /* Prepare warning-pane: */
@@ -157,9 +158,4 @@
         m_pSerializeProcess = 0;
     }
-    if (serializeProgress())
-    {
-        delete m_pSerializeProgress;
-        m_pSerializeProgress = 0;
-    }
 
     /* Recall popup-pane if any: */
@@ -223,9 +219,4 @@
         m_pSerializeProcess = 0;
     }
-    if (serializeProgress())
-    {
-        delete m_pSerializeProgress;
-        m_pSerializeProgress = 0;
-    }
 
     /* Mark as loaded: */
@@ -241,9 +232,4 @@
         m_pSerializeProcess = 0;
     }
-    if (serializeProgress())
-    {
-        delete m_pSerializeProgress;
-        m_pSerializeProgress = 0;
-    }
 
     /* Mark as saved: */
@@ -257,7 +243,7 @@
 }
 
-void UISettingsDialog::sltHandlePageProcessed()
-{
-    m_pProcessBar->setValue(m_pProcessBar->value() + 1);
+void UISettingsDialog::sltHandleProcessProgressChange(int iValue)
+{
+    m_pProcessBar->setValue(iValue);
     if (m_pProcessBar->value() == m_pProcessBar->maximum())
     {
@@ -281,14 +267,16 @@
         /* Configure settings loader: */
         connect(m_pSerializeProcess, SIGNAL(sigNotifyAboutProcessStarted()), this, SLOT(sltHandleProcessStarted()));
-        connect(m_pSerializeProcess, SIGNAL(sigNotifyAboutPagePostprocessed(int)), this, SLOT(sltHandlePageProcessed()));
+        connect(m_pSerializeProcess, SIGNAL(sigNotifyAboutProcessProgressChanged(int)), this, SLOT(sltHandleProcessProgressChange(int)));
         connect(m_pSerializeProcess, SIGNAL(sigNotifyAboutProcessFinished()), this, SLOT(sltMarkLoaded()));
+
         /* Raise current page priority: */
         m_pSerializeProcess->raisePriorityOfPage(m_pSelector->currentId());
+
         /* Start settings loader: */
         m_pSerializeProcess->start();
-    }
-
-    /* Upload data finally: */
-    data = m_pSerializeProcess->data();
+
+        /* Upload data finally: */
+        data = m_pSerializeProcess->data();
+    }
 }
 
@@ -298,18 +286,28 @@
     m_fSaved = false;
 
-    /* Create settings saver: */
-    QWidget *pDlgParent = windowManager().realParentWindow(window());
-    m_pSerializeProgress = new UISettingsSerializerProgress(pDlgParent, UISettingsSerializer::Save,
-                                                            data, m_pSelector->settingPages());
-    AssertPtrReturnVoid(m_pSerializeProgress);
-    {
-        /* Make setting saver the temporary parent for all the sub-dialogs: */
-        windowManager().registerNewParent(m_pSerializeProgress, pDlgParent);
-        /* Start settings saver: */
-        m_pSerializeProgress->exec();
-    }
-
-    /* Upload data finally: */
-    data = m_pSerializeProgress->data();
+    /* Create the 'settings saver': */
+    QPointer<UISettingsSerializerProgress> pDlgSerializeProgress =
+        new UISettingsSerializerProgress(this, UISettingsSerializer::Save,
+                                         data, m_pSelector->settingPages());
+    AssertPtrReturnVoid(static_cast<UISettingsSerializerProgress*>(pDlgSerializeProgress));
+    {
+        /* Make the 'settings saver' temporary parent for all sub-dialogs: */
+        windowManager().registerNewParent(pDlgSerializeProgress, windowManager().realParentWindow(this));
+
+        /* Execute the 'settings saver': */
+        pDlgSerializeProgress->exec();
+
+        /* Any modal dialog can be destroyed in own event-loop
+         * as a part of application termination procedure..
+         * We have to check if the dialog still valid. */
+        if (pDlgSerializeProgress)
+        {
+            /* Upload 'settings saver' data: */
+            data = pDlgSerializeProgress->data();
+
+            /* Delete the 'settings saver': */
+            delete pDlgSerializeProgress;
+        }
+    }
 }
 
@@ -364,7 +362,4 @@
         /* Add stack-widget page if created: */
         m_pages[cId] = m_pStack->addWidget(pPage);
-        /* Update process-bar: */
-        m_pProcessBar->setMinimum(0);
-        m_pProcessBar->setMaximum(m_pStack->count());
     }
     /* Assign validator if necessary: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h	(revision 55654)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h	(revision 55655)
@@ -34,5 +34,4 @@
 class UISettingsPage;
 class UISettingsSerializer;
-class UISettingsSerializerProgress;
 
 /* Using declarations: */
@@ -68,5 +67,5 @@
     /* Handlers for process bar: */
     void sltHandleProcessStarted();
-    void sltHandlePageProcessed();
+    void sltHandleProcessProgressChange(int iValue);
 
 protected:
@@ -74,6 +73,4 @@
     /** Returns the serialize process instance. */
     UISettingsSerializer* serializeProcess() const { return m_pSerializeProcess; }
-    /** Returns the serialize progress instance. */
-    UISettingsSerializerProgress* serializeProgress() const { return m_pSerializeProgress; }
 
     /** Loads the @a data. */
@@ -146,6 +143,4 @@
     /** Holds the serialize process instance. */
     UISettingsSerializer *m_pSerializeProcess;
-    /** Holds the serialize progress instance. */
-    UISettingsSerializerProgress *m_pSerializeProgress;
 
     /* Loading/saving stuff: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSerializer.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSerializer.cpp	(revision 55654)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSerializer.cpp	(revision 55655)
@@ -89,19 +89,25 @@
 void UISettingsSerializer::sltHandleProcessedPage(int iPageId)
 {
+    /* Make sure such page present: */
+    AssertReturnVoid(m_pages.contains(iPageId));
+
+    /* Get the page being processed: */
+    UISettingsPage *pSettingsPage = m_pages.value(iPageId);
+
     /* If serializer loads settings: */
     if (m_direction == Load)
     {
-        /* If such page present: */
-        if (m_pages.contains(iPageId))
-        {
-            /* We should fetch internal page cache: */
-            UISettingsPage *pSettingsPage = m_pages[iPageId];
-            pSettingsPage->setValidatorBlocked(true);
-            pSettingsPage->getFromCache();
-            pSettingsPage->setValidatorBlocked(false);
-        }
-    }
-    /* Notify listeners about page postprocessed: */
-    emit sigNotifyAboutPagePostprocessed(iPageId);
+        /* We should fetch internal page cache: */
+        pSettingsPage->setValidatorBlocked(true);
+        pSettingsPage->getFromCache();
+        pSettingsPage->setValidatorBlocked(false);
+    }
+
+    /* Add processed page into corresponding map: */
+    m_pagesDone.insert(iPageId, pSettingsPage);
+
+    /* Notify listeners about process reached n%: */
+    const int iValue = 100 * m_pagesDone.size() / m_pages.size();
+    emit sigNotifyAboutProcessProgressChanged(iValue);
 }
 
@@ -122,6 +128,7 @@
             pPage->revalidate();
     }
-    /* Notify listeners about pages postprocessed: */
-    emit sigNotifyAboutPagesPostprocessed();
+
+    /* Notify listeners about process reached 100%: */
+    emit sigNotifyAboutProcessProgressChanged(100);
 }
 
@@ -232,8 +239,6 @@
     {
         /* Install progress handler: */
-        connect(m_pSerializer, SIGNAL(sigNotifyAboutPagePostprocessed(int)),
-                this, SLOT(sltAdvanceProgressValue()));
-        connect(m_pSerializer, SIGNAL(sigNotifyAboutPagesPostprocessed()),
-                this, SLOT(sltAdvanceProgressValue()));
+        connect(m_pSerializer, SIGNAL(sigNotifyAboutProcessProgressChanged(int)),
+                this, SLOT(sltHandleProcessProgressChange(int)));
         connect(m_pSerializer, SIGNAL(sigOperationProgressChange(ulong, QString, ulong, ulong)),
                 this, SLOT(sltHandleOperationProgressChange(ulong, QString, ulong, ulong)));
@@ -286,9 +291,7 @@
                     /* Configure progress bar: */
                     m_pBarOperationProgress->setMinimumWidth(300);
-                    m_pBarOperationProgress->setMaximum(m_pSerializer->pageCount() + 1);
+                    m_pBarOperationProgress->setMaximum(100);
                     m_pBarOperationProgress->setMinimum(0);
                     m_pBarOperationProgress->setValue(0);
-                    connect(m_pBarOperationProgress, SIGNAL(valueChanged(int)),
-                            this, SLOT(sltProgressValueChanged(int)));
                     /* Add bar into layout: */
                     pLayoutProgress->addWidget(m_pBarOperationProgress);
@@ -356,15 +359,10 @@
 }
 
-void UISettingsSerializerProgress::sltAdvanceProgressValue()
-{
-    /* Advance the operation progress bar: */
+void UISettingsSerializerProgress::sltHandleProcessProgressChange(int iValue)
+{
+    /* Update the operation progress-bar with incoming value: */
     AssertPtrReturnVoid(m_pBarOperationProgress);
-    m_pBarOperationProgress->setValue(m_pBarOperationProgress->value() + 1);
-}
-
-void UISettingsSerializerProgress::sltProgressValueChanged(int iValue)
-{
+    m_pBarOperationProgress->setValue(iValue);
     /* Hide the progress-dialog upon reaching the 100% progress: */
-    AssertPtrReturnVoid(m_pBarOperationProgress);
     if (iValue == m_pBarOperationProgress->maximum())
         hide();
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSerializer.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSerializer.h	(revision 55654)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsSerializer.h	(revision 55655)
@@ -49,6 +49,10 @@
 signals:
 
-    /** Notifies GUI thread about process has been started. */
+    /** Notifies listeners about process has been started. */
     void sigNotifyAboutProcessStarted();
+    /** Notifies listeners about process reached @a iValue. */
+    void sigNotifyAboutProcessProgressChanged(int iValue);
+    /** Notifies listeners about process has been finished. */
+    void sigNotifyAboutProcessFinished();
 
     /** Notifies GUI thread about some page was processed. */
@@ -56,12 +60,4 @@
     /** Notifies GUI thread about all pages were processed. */
     void sigNotifyAboutPagesProcessed();
-
-    /** Notifies listeners about some page was post-processed. */
-    void sigNotifyAboutPagePostprocessed(int iPageId);
-    /** Notifies listeners about all pages were post-processed. */
-    void sigNotifyAboutPagesPostprocessed();
-
-    /** Notifies listeners about process has been finished. */
-    void sigNotifyAboutProcessFinished();
 
     /** Notifies listeners about particular operation progress change.
@@ -130,4 +126,6 @@
     /** Holds the page(s) to load/save the data to/from. */
     UISettingsPageMap m_pages;
+    /** Holds the page(s) to load/save the data to/from for which that task was done. */
+    UISettingsPageMap m_pagesDone;
 
     /** Holds whether the save was complete. */
@@ -187,9 +185,6 @@
     void sltStartProcess();
 
-    /** Advances the current progress value. */
-    void sltAdvanceProgressValue();
-
-    /** Handles the progress value change. */
-    void sltProgressValueChanged(int iValue);
+    /** Handles process progress change to @a iValue. */
+    void sltHandleProcessProgressChange(int iValue);
 
     /** Handles particular operation progress change.
