Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.cpp	(revision 71791)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.cpp	(revision 71792)
@@ -720,4 +720,7 @@
     , m_pCreateNewDirectory(0)
     , m_pShowProperties(0)
+    , m_pSelectAll(0)
+    , m_pInvertSelection(0)
+
 {
     prepareObjects();
@@ -919,4 +922,18 @@
     }
 
+    m_pSelectAll = new QAction(this);
+    {
+        m_pSelectAll->setIcon(UIIconPool::iconSet(QString(":/session_info_32px.png")));
+        m_pToolBar->addAction(m_pSelectAll);
+        connect(m_pSelectAll, &QAction::triggered, this, &UIGuestControlFileTable::sltSelectAll);
+    }
+
+    m_pInvertSelection = new QAction(this);
+    {
+        m_pInvertSelection->setIcon(UIIconPool::iconSet(QString(":/session_info_32px.png")));
+        m_pToolBar->addAction(m_pInvertSelection);
+        connect(m_pInvertSelection, &QAction::triggered, this, &UIGuestControlFileTable::sltInvertSelection);
+    }
+
     disableSelectionDependentActions();
 }
@@ -1214,11 +1231,8 @@
 void UIGuestControlFileTable::sltSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected)
 {
-    /* Disable all the action that operate on some selection: */
-    if (!deselected.isEmpty() && selected.isEmpty())
+    if (m_pView->hasSelection())
+        enableSelectionDependentActions();
+    else
         disableSelectionDependentActions();
-
-    /* Enable all the action that operate on some selection: */
-    if (deselected.isEmpty() && !selected.isEmpty())
-        enableSelectionDependentActions();
 }
 
@@ -1231,4 +1245,64 @@
     QStringList pathList = comboLocation.split(UIPathOperations::delimiter, QString::SkipEmptyParts);
     goIntoDirectory(pathList);
+}
+
+void UIGuestControlFileTable::sltSelectAll()
+{
+    if (!m_pModel || !m_pView)
+        return;
+    m_pView->selectAll();
+    deSelectUpDirectoryItem();
+}
+
+void UIGuestControlFileTable::sltInvertSelection()
+{
+    setSelectionForAll(QItemSelectionModel::QItemSelectionModel::Toggle | QItemSelectionModel::Rows);
+    deSelectUpDirectoryItem();
+}
+
+void UIGuestControlFileTable::deSelectUpDirectoryItem()
+{
+    if (!m_pView)
+        return;
+    QItemSelectionModel *pSelectionModel = m_pView->selectionModel();
+    if (!pSelectionModel)
+        return;
+    QModelIndex currentRoot = m_pView->rootIndex();
+    if (!currentRoot.isValid())
+        return;
+
+    /* Make sure that "up directory item" (if exists) is deselected: */
+    for (int i = 0; i < m_pModel->rowCount(currentRoot); ++i)
+    {
+        QModelIndex index = m_pModel->index(i, 0, currentRoot);
+        if (!index.isValid())
+            continue;
+
+        UIFileTableItem *item = static_cast<UIFileTableItem*>(index.internalPointer());
+        if (item && item->isUpDirectory())
+        {
+            pSelectionModel->select(index, QItemSelectionModel::QItemSelectionModel::Deselect | QItemSelectionModel::Rows);
+        }
+    }
+}
+
+void UIGuestControlFileTable::setSelectionForAll(QItemSelectionModel::SelectionFlags flags)
+{
+    if (!m_pView)
+        return;
+    QItemSelectionModel *pSelectionModel = m_pView->selectionModel();
+    if (!pSelectionModel)
+        return;
+    QModelIndex currentRoot = m_pView->rootIndex();
+    if (!currentRoot.isValid())
+        return;
+
+    for (int i = 0; i < m_pModel->rowCount(currentRoot); ++i)
+    {
+        QModelIndex index = m_pModel->index(i, 0, currentRoot);
+        if (!index.isValid())
+            continue;
+        pSelectionModel->select(index, flags);
+    }
 }
 
@@ -1312,4 +1386,18 @@
         m_pShowProperties->setToolTip(UIVMInformationDialog::tr("Show the properties of the selected item(s)"));
         m_pShowProperties->setStatusTip(UIVMInformationDialog::tr("Show the properties of the selected item(s)"));
+    }
+
+    if (m_pSelectAll)
+    {
+        m_pSelectAll->setText(UIVMInformationDialog::tr("Select All"));
+        m_pSelectAll->setToolTip(UIVMInformationDialog::tr("Select All"));
+        m_pSelectAll->setStatusTip(UIVMInformationDialog::tr("Select All"));
+    }
+
+    if (m_pInvertSelection)
+    {
+        m_pInvertSelection->setText(UIVMInformationDialog::tr("Invert Selection"));
+        m_pInvertSelection->setToolTip(UIVMInformationDialog::tr("Invert Selection"));
+        m_pInvertSelection->setStatusTip(UIVMInformationDialog::tr("Invert Selection"));
     }
 }
@@ -1482,3 +1570,2 @@
 
 #include "UIGuestControlFileTable.moc"
-
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.h	(revision 71791)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/guestctrl/UIGuestControlFileTable.h	(revision 71792)
@@ -20,5 +20,6 @@
 
 /* Qt includes: */
-# include <QMutex>
+#include <QItemSelectionModel>
+#include <QMutex>
 #include <QThread>
 #include <QWidget>
@@ -304,4 +305,6 @@
     void sltSelectionChanged(const QItemSelection & selected, const QItemSelection & deselected);
     void sltLocationComboCurrentChange(const QString &strLocation);
+    void sltSelectAll();
+    void sltInvertSelection();
 
 private:
@@ -316,4 +319,6 @@
     void            enableSelectionDependentActions();
     void            disableSelectionDependentActions();
+    void            deSelectUpDirectoryItem();
+    void            setSelectionForAll(QItemSelectionModel::SelectionFlags flags);
     QGridLayout     *m_pMainLayout;
     QComboBox       *m_pLocationComboBox;
@@ -326,4 +331,6 @@
     QAction         *m_pCreateNewDirectory;
     QAction         *m_pShowProperties;
+    QAction         *m_pSelectAll;
+    QAction         *m_pInvertSelection;
     /** The vector of action which need some selection to work on like cut, copy etc. */
     QVector<QAction*> m_selectionDependentActions;
@@ -335,3 +342,2 @@
 
 #endif /* !___UIGuestControlFileTable_h___ */
-
