Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.cpp	(revision 68997)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.cpp	(revision 68998)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2016 Oracle Corporation
+ * Copyright (C) 2006-2017 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -67,5 +67,5 @@
     /* Create main layout: */
     QHBoxLayout *pMainLayout = new QHBoxLayout(this);
-
+    /* Configure layout: */
 #ifdef VBOX_WS_MAC
     ::darwinSetHidesAllTitleButtons(this);
@@ -74,26 +74,31 @@
     else
         pMainLayout->setContentsMargins(6, 6, 6, 6);
-#endif /* VBOX_WS_MAC */
-
-    /* Create image: */
+#endif
+
+    /* If there is image: */
     if (pImage)
     {
+        /* Create image label: */
         m_pImageLbl = new QLabel(this);
+        /* Configure label: */
         m_pImageLbl->setPixmap(*pImage);
+        /* Add into layout: */
         pMainLayout->addWidget(m_pImageLbl);
     }
 
-    /* Create description: */
+    /* Create description label: */
     m_pDescriptionLbl = new QILabel(this);
+    /* Configure label: */
     if (m_cOperations > 1)
         m_pDescriptionLbl->setText(QString(m_spcszOpDescTpl)
-                                   .arg(m_progress.GetOperationDescription())
-                                   .arg(m_iCurrentOperation).arg(m_cOperations));
+                                           .arg(m_progress.GetOperationDescription())
+                                           .arg(m_iCurrentOperation).arg(m_cOperations));
     else
         m_pDescriptionLbl->setText(QString("%1 ...")
-                                   .arg(m_progress.GetOperationDescription()));
+                                           .arg(m_progress.GetOperationDescription()));
 
     /* Create progress-bar: */
     m_pProgressBar = new QProgressBar(this);
+    /* Configure progress-bar: */
     m_pProgressBar->setMaximum(100);
     m_pProgressBar->setValue(0);
@@ -102,4 +107,5 @@
     m_fCancelEnabled = m_progress.GetCancelable();
     m_pCancelBtn = new UIMiniCancelButton(this);
+    /* Configure cancel button: */
     m_pCancelBtn->setEnabled(m_fCancelEnabled);
     m_pCancelBtn->setFocusPolicy(Qt::ClickFocus);
@@ -111,5 +117,7 @@
     /* Create proggress layout: */
     QHBoxLayout *pProgressLayout = new QHBoxLayout;
+    /* Configure layout: */
     pProgressLayout->setMargin(0);
+    /* Add into layout: */
     pProgressLayout->addWidget(m_pProgressBar, 0, Qt::AlignVCenter);
     pProgressLayout->addWidget(m_pCancelBtn, 0, Qt::AlignVCenter);
@@ -117,10 +125,15 @@
     /* Create description layout: */
     QVBoxLayout *pDescriptionLayout = new QVBoxLayout;
+    /* Configure layout: */
     pDescriptionLayout->setMargin(0);
+    /* Add stretch: */
     pDescriptionLayout->addStretch(1);
+    /* Add into layout: */
     pDescriptionLayout->addWidget(m_pDescriptionLbl, 0, Qt::AlignHCenter);
     pDescriptionLayout->addLayout(pProgressLayout);
     pDescriptionLayout->addWidget(m_pEtaLbl, 0, Qt::AlignLeft | Qt::AlignVCenter);
+    /* Add stretch: */
     pDescriptionLayout->addStretch(1);
+    /* Add into layout: */
     pMainLayout->addLayout(pDescriptionLayout);
 
@@ -137,4 +150,5 @@
     /* Wait for CProgress to complete: */
     m_progress.WaitForCompletion(-1);
+
     /* Call the timer event handling delegate: */
     handleTimerEvent();
@@ -152,5 +166,5 @@
     if (m_progress.isOk())
     {
-        /* Start refresh timer */
+        /* Start refresh timer: */
         int id = startTimer(cRefreshInterval);
 
@@ -180,5 +194,5 @@
         }
 
-        /* Kill refresh timer */
+        /* Kill refresh timer: */
         killTimer(id);
 
@@ -269,8 +283,8 @@
     }
 
+    /* Update the progress dialog: */
     if (!m_progress.GetCanceled())
     {
-        /* Update the progress dialog: */
-        /* First ETA */
+        /* Update ETA: */
         long newTime = m_progress.GetTimeRemaining();
         long seconds;
@@ -324,5 +338,5 @@
             m_pEtaLbl->clear();
 
-        /* Then operation text if changed: */
+        /* Then operation text (if changed): */
         ulong newOp = m_progress.GetOperation() + 1;
         if (newOp != m_iCurrentOperation)
@@ -333,4 +347,5 @@
                                        .arg(m_iCurrentOperation).arg(m_cOperations));
         }
+        /* Update operation percentage: */
         m_pProgressBar->setValue(m_progress.GetPercent());
 
@@ -343,4 +358,5 @@
                                m_progress.GetOperation() + 1, m_progress.GetPercent());
     }
+    /* Mark progress canceled if so: */
     else
         m_pEtaLbl->setText(m_strCancel);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.h	(revision 68997)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.h	(revision 68998)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2009-2016 Oracle Corporation
+ * Copyright (C) 2009-2017 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -30,17 +30,11 @@
 class CProgress;
 
-/**
- * A QProgressDialog enhancement that allows to:
- *
- * 1) prevent closing the dialog when it has no cancel button;
- * 2) effectively track the IProgress object completion (w/o using
- *    IProgress::waitForCompletion() and w/o blocking the UI thread in any other
- *    way for too long).
- *
- * @note The CProgress instance is passed as a non-const reference to the
- *       constructor (to memorize COM errors if they happen), and therefore must
- *       not be destroyed before the created UIProgressDialog instance is
- *       destroyed.
- */
+
+/** QProgressDialog enhancement that allows to:
+  * 1) prevent closing the dialog when it has no cancel button;
+  * 2) effectively track the IProgress object completion (w/o using
+  *    IProgress::waitForCompletion() and w/o blocking the UI thread in any other way for too long).
+  * @note The CProgress instance is passed as a non-const reference to the constructor (to memorize COM errors if they happen),
+  *       and therefore must not be destroyed before the created UIProgressDialog instance is destroyed. */
 class UIProgressDialog: public QIWithRetranslateUI2<QIDialog>
 {
@@ -49,11 +43,15 @@
 public:
 
-    /** Constructor. */
+    /** Constructs progress-dialog passing @a pParent to the base-class.
+      * @param  progress   Brings the progress reference.
+      * @param  strTitle      Brings the progress-dialog title.
+      * @param  pImage        Brings the progress-dialog image.
+      * @param  cMinDuration  Brings the minimum duration before the progress-dialog is shown. */
     UIProgressDialog(CProgress &progress, const QString &strTitle,
                      QPixmap *pImage = 0, int cMinDuration = 2000, QWidget *pParent = 0);
-    /** Destructor. */
+    /** Destructs progress-dialog. */
     ~UIProgressDialog();
 
-    /* API: Run stuff: */
+    /** Executes the progress-dialog within its loop with passed @a iRefreshInterval. */
     int run(int aRefreshInterval);
 
@@ -61,8 +59,8 @@
 
     /** Notifies listeners about wrapped CProgress change.
-      * @param iOperations  holds the number of operations CProgress have,
-      * @param strOperation holds the description of the current CProgress operation,
-      * @param iOperation   holds the index of the current CProgress operation,
-      * @param iPercent     holds the percentage of the current CProgress operation. */
+      * @param  iOperations   Brings the number of operations CProgress have.
+      * @param  strOperation  Brings the description of the current CProgress operation.
+      * @param  iOperation    Brings the index of the current CProgress operation.
+      * @param  iPercent      Brings the percentage of the current CProgress operation. */
     void sigProgressChange(ulong iOperations, QString strOperation,
                            ulong iOperation, ulong iPercent);
@@ -70,44 +68,59 @@
 public slots:
 
-    /* Handler: Show stuff: */
+    /** Shows progress-dialog if it's not yet shown. */
     void show();
 
 protected:
 
-    /* Helper: Translate stuff: */
+    /** Handles translation event. */
     void retranslateUi();
 
-    /* Helper: Cancel stuff: */
+    /** Rejects dialog. */
     void reject();
 
-    /* Handlers: Event processing stuff: */
+    /** Handles timer @a pEvent. */
     virtual void timerEvent(QTimerEvent *pEvent);
+    /** Handles close @a pEvent. */
     virtual void closeEvent(QCloseEvent *pEvent);
 
 private slots:
 
-    /* Handler: Cancel stuff: */
+    /** Handles request to cancel operation. */
     void sltCancelOperation();
 
 private:
 
-    /** Timer event handling delegate. */
+    /** Performes timer event handling. */
     void handleTimerEvent();
 
-    /* Variables: */
+    /** Holds the progress reference. */
     CProgress &m_progress;
-    QLabel *m_pImageLbl;
-    QILabel *m_pDescriptionLbl;
-    QProgressBar *m_pProgressBar;
+
+    /** Holds the image label instance. */
+    QLabel             *m_pImageLbl;
+    /** Holds the description label instance. */
+    QILabel            *m_pDescriptionLbl;
+    /** Holds the progress-bar instance. */
+    QProgressBar       *m_pProgressBar;
+    /** Holds the cancel button instance. */
     UIMiniCancelButton *m_pCancelBtn;
-    QILabel *m_pEtaLbl;
-    bool m_fCancelEnabled;
-    QString m_strCancel;
-    const ulong m_cOperations;
-    ulong m_iCurrentOperation;
-    bool m_fEnded;
+    /** Holds the ETA label instance. */
+    QILabel            *m_pEtaLbl;
 
+    /** Holds whether progress cancel is enabled. */
+    bool         m_fCancelEnabled;
+    /** Holds the translated canceling tag. */
+    QString      m_strCancel;
+    /** Holds the amount of operations. */
+    const ulong  m_cOperations;
+    /** Holds the number of current operation. */
+    ulong        m_iCurrentOperation;
+    /** Holds whether the progress has ended. */
+    bool         m_fEnded;
+
+    /** Holds the operation description template. */
     static const char *m_spcszOpDescTpl;
 };
+
 
 /** QObject reimplementation allowing to effectively track the CProgress object completion
@@ -124,8 +137,8 @@
 
     /** Notifies listeners about wrapped CProgress change.
-      * @param iOperations  holds the number of operations CProgress have,
-      * @param strOperation holds the description of the current CProgress operation,
-      * @param iOperation   holds the index of the current CProgress operation,
-      * @param iPercent     holds the percentage of the current CProgress operation. */
+      * @param  iOperations   Brings the number of operations CProgress have.
+      * @param  strOperation  Brings the description of the current CProgress operation.
+      * @param  iOperation    Brings the index of the current CProgress operation.
+      * @param  iPercent      Brings the percentage of the current CProgress operation. */
     void sigProgressChange(ulong iOperations, QString strOperation,
                            ulong iOperation, ulong iPercent);
@@ -137,29 +150,28 @@
 public:
 
-    /** Constructor passing @a pParent to the base-class.
-      * @param progress holds the CProgress to be wrapped. */
+    /** Constructs progress handler passing @a pParent to the base-class.
+      * @param  progress  Brings the progress reference. */
     UIProgress(CProgress &progress, QObject *pParent = 0);
 
-    /** Starts the UIProgress by entering the personal event-loop.
-      * @param iRefreshInterval holds the refresh interval to check
-      *                         for the CProgress updates with. */
+    /** Executes the progress-handler within its loop with passed @a iRefreshInterval. */
     void run(int iRefreshInterval);
 
 private:
 
-    /** Timer @a pEvent reimplementation. */
+    /** Handles timer @a pEvent. */
     virtual void timerEvent(QTimerEvent *pEvent);
 
-    /** Holds the wrapped CProgress reference. */
+    /** Holds the progress reference. */
     CProgress &m_progress;
-    /** Holds the number of operations wrapped CProgress have. */
-    const ulong m_cOperations;
-    /** Holds whether the UIProgress ended. */
-    bool m_fEnded;
 
-    /** Holds the personal event-loop. */
+    /** Holds the amount of operations. */
+    const ulong  m_cOperations;
+    /** Holds whether the progress has ended. */
+    bool         m_fEnded;
+
+    /** Holds the personal event-loop instance. */
     QPointer<QEventLoop> m_pEventLoop;
 };
 
-#endif /* __UIProgressDialog_h__ */
+#endif /* !__UIProgressDialog_h__ */
 
