Index: trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.cpp	(revision 87081)
+++ trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.cpp	(revision 87088)
@@ -199,11 +199,10 @@
     , m_pDetailsWidget(0)
 {
-    /* Prepare: */
     prepare();
-    uiCommon().setHelpKeyword(this, "networkingdetails");
 }
 
 QMenu *UINetworkManagerWidget::menu() const
 {
+    AssertPtrReturn(m_pActionPool, 0);
     return m_pActionPool->action(UIActionIndexMN_M_NetworkWindow)->menu();
 }
@@ -223,10 +222,13 @@
 
     /* Translate tree-widget: */
-    const QStringList fields = QStringList()
-                               << UINetworkManager::tr("Name")
-                               << UINetworkManager::tr("IPv4 Address/Mask")
-                               << UINetworkManager::tr("IPv6 Address/Mask")
-                               << UINetworkManager::tr("DHCP Server");
-    m_pTreeWidget->setHeaderLabels(fields);
+    if (m_pTreeWidget)
+    {
+        const QStringList fields = QStringList()
+                                   << UINetworkManager::tr("Name")
+                                   << UINetworkManager::tr("IPv4 Address/Mask")
+                                   << UINetworkManager::tr("IPv6 Address/Mask")
+                                   << UINetworkManager::tr("DHCP Server");
+        m_pTreeWidget->setHeaderLabels(fields);
+    }
 }
 
@@ -251,5 +253,5 @@
 void UINetworkManagerWidget::sltResetHostNetworkDetailsChanges()
 {
-    /* Just push the current item data there again: */
+    /* Just push current item data to details-widget again: */
     sltHandleCurrentItemChange();
 }
@@ -257,7 +259,13 @@
 void UINetworkManagerWidget::sltApplyHostNetworkDetailsChanges()
 {
+    /* Check tree-widget: */
+    AssertMsgReturnVoid(m_pTreeWidget, ("Tree-widget isn't created!\n"));
+
     /* Get network item: */
     UIItemHostNetwork *pItem = static_cast<UIItemHostNetwork*>(m_pTreeWidget->currentItem());
     AssertMsgReturnVoid(pItem, ("Current item must not be null!\n"));
+
+    /* Check details-widget: */
+    AssertMsgReturnVoid(m_pDetailsWidget, ("Details-widget isn't created!\n"));
 
     /* Get item data: */
@@ -431,4 +439,7 @@
 void UINetworkManagerWidget::sltRemoveHostNetwork()
 {
+    /* Check tree-widget: */
+    AssertMsgReturnVoid(m_pTreeWidget, ("Tree-widget isn't created!\n"));
+
     /* Get network item: */
     UIItemHostNetwork *pItem = static_cast<UIItemHostNetwork*>(m_pTreeWidget->currentItem());
@@ -514,6 +525,7 @@
     gEDataManager->setHostNetworkManagerDetailsExpanded(fVisible);
     /* Show/hide details area and Apply button: */
-    m_pDetailsWidget->setVisible(fVisible);
-    /* Notify external lsiteners: */
+    if (m_pDetailsWidget)
+        m_pDetailsWidget->setVisible(fVisible);
+    /* Notify external listeners: */
     emit sigHostNetworkDetailsVisibilityChanged(fVisible);
 }
@@ -527,24 +539,28 @@
 void UINetworkManagerWidget::sltAdjustTreeWidget()
 {
-    /* Get the tree-widget abstract interface: */
-    QAbstractItemView *pItemView = m_pTreeWidget;
-    /* Get the tree-widget header-view: */
-    QHeaderView *pItemHeader = m_pTreeWidget->header();
-
-    /* Calculate the total tree-widget width: */
-    const int iTotal = m_pTreeWidget->viewport()->width();
-    /* Look for a minimum width hints for non-important columns: */
-    const int iMinWidth1 = qMax(pItemView->sizeHintForColumn(Column_IPv4), pItemHeader->sectionSizeHint(Column_IPv4));
-    const int iMinWidth2 = qMax(pItemView->sizeHintForColumn(Column_IPv6), pItemHeader->sectionSizeHint(Column_IPv6));
-    const int iMinWidth3 = qMax(pItemView->sizeHintForColumn(Column_DHCP), pItemHeader->sectionSizeHint(Column_DHCP));
-    /* Propose suitable width hints for non-important columns: */
-    const int iWidth1 = iMinWidth1 < iTotal / Column_Max ? iMinWidth1 : iTotal / Column_Max;
-    const int iWidth2 = iMinWidth2 < iTotal / Column_Max ? iMinWidth2 : iTotal / Column_Max;
-    const int iWidth3 = iMinWidth3 < iTotal / Column_Max ? iMinWidth3 : iTotal / Column_Max;
-    /* Apply the proposal: */
-    m_pTreeWidget->setColumnWidth(Column_IPv4, iWidth1);
-    m_pTreeWidget->setColumnWidth(Column_IPv6, iWidth2);
-    m_pTreeWidget->setColumnWidth(Column_DHCP, iWidth3);
-    m_pTreeWidget->setColumnWidth(Column_Name, iTotal - iWidth1 - iWidth2 - iWidth3);
+    /* Check tree-widget: */
+    if (m_pTreeWidget)
+    {
+        /* Get the tree-widget abstract interface: */
+        QAbstractItemView *pItemView = m_pTreeWidget;
+        /* Get the tree-widget header-view: */
+        QHeaderView *pItemHeader = m_pTreeWidget->header();
+
+        /* Calculate the total tree-widget width: */
+        const int iTotal = m_pTreeWidget->viewport()->width();
+        /* Look for a minimum width hints for non-important columns: */
+        const int iMinWidth1 = qMax(pItemView->sizeHintForColumn(Column_IPv4), pItemHeader->sectionSizeHint(Column_IPv4));
+        const int iMinWidth2 = qMax(pItemView->sizeHintForColumn(Column_IPv6), pItemHeader->sectionSizeHint(Column_IPv6));
+        const int iMinWidth3 = qMax(pItemView->sizeHintForColumn(Column_DHCP), pItemHeader->sectionSizeHint(Column_DHCP));
+        /* Propose suitable width hints for non-important columns: */
+        const int iWidth1 = iMinWidth1 < iTotal / Column_Max ? iMinWidth1 : iTotal / Column_Max;
+        const int iWidth2 = iMinWidth2 < iTotal / Column_Max ? iMinWidth2 : iTotal / Column_Max;
+        const int iWidth3 = iMinWidth3 < iTotal / Column_Max ? iMinWidth3 : iTotal / Column_Max;
+        /* Apply the proposal: */
+        m_pTreeWidget->setColumnWidth(Column_IPv4, iWidth1);
+        m_pTreeWidget->setColumnWidth(Column_IPv6, iWidth2);
+        m_pTreeWidget->setColumnWidth(Column_DHCP, iWidth3);
+        m_pTreeWidget->setColumnWidth(Column_Name, iTotal - iWidth1 - iWidth2 - iWidth3);
+    }
 }
 
@@ -635,4 +651,7 @@
 void UINetworkManagerWidget::sltHandleCurrentItemChange()
 {
+    /* Check tree-widget: */
+    AssertMsgReturnVoid(m_pTreeWidget, ("Tree-widget isn't created!\n"));
+
     /* Get network item: */
     UIItemHostNetwork *pItem = static_cast<UIItemHostNetwork*>(m_pTreeWidget->currentItem());
@@ -641,4 +660,7 @@
     m_pActionPool->action(UIActionIndexMN_M_Network_S_Remove)->setEnabled(pItem);
     m_pActionPool->action(UIActionIndexMN_M_Network_T_Details)->setEnabled(pItem);
+
+    /* Check details-widget: */
+    AssertMsgReturnVoid(m_pDetailsWidget, ("Details-widget isn't created!\n"));
 
     /* If there is an item => update details data: */
@@ -655,4 +677,7 @@
 void UINetworkManagerWidget::sltHandleContextMenuRequest(const QPoint &position)
 {
+    /* Check tree-widget: */
+    AssertMsgReturnVoid(m_pTreeWidget, ("Tree-widget isn't created!\n"));
+
     /* Compose temporary context-menu: */
     QMenu menu;
@@ -673,7 +698,9 @@
 void UINetworkManagerWidget::prepare()
 {
-    /* Prepare actions: */
+    /* Prepare self: */
+    uiCommon().setHelpKeyword(this, "networkingdetails");
+
+    /* Prepare stuff: */
     prepareActions();
-    /* Prepare widgets: */
     prepareWidgets();
 
@@ -711,5 +738,5 @@
     /* Create main-layout: */
     new QVBoxLayout(this);
-    AssertPtrReturnVoid(layout());
+    if (layout())
     {
         /* Configure layout: */
@@ -735,5 +762,5 @@
     /* Create toolbar: */
     m_pToolBar = new QIToolBar(parentWidget());
-    AssertPtrReturnVoid(m_pToolBar);
+    if (m_pToolBar)
     {
         /* Configure toolbar: */
@@ -766,9 +793,8 @@
 void UINetworkManagerWidget::prepareTreeWidget()
 {
-    /* Create tree-widget: */
-    m_pTreeWidget = new QITreeWidget;
-    AssertPtrReturnVoid(m_pTreeWidget);
-    {
-        /* Configure tree-widget: */
+    /* Prepare tree-widget: */
+    m_pTreeWidget = new QITreeWidget(this);
+    if (m_pTreeWidget)
+    {
         m_pTreeWidget->setRootIsDecorated(false);
         m_pTreeWidget->setAlternatingRowColors(true);
@@ -795,9 +821,8 @@
 void UINetworkManagerWidget::prepareDetailsWidget()
 {
-    /* Create details-widget: */
-    m_pDetailsWidget = new UINetworkDetailsWidget(m_enmEmbedding);
-    AssertPtrReturnVoid(m_pDetailsWidget);
-    {
-        /* Configure details-widget: */
+    /* Prepare details-widget: */
+    m_pDetailsWidget = new UINetworkDetailsWidget(m_enmEmbedding, this);
+    if (m_pDetailsWidget)
+    {
         m_pDetailsWidget->setVisible(false);
         m_pDetailsWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
@@ -817,10 +842,17 @@
 {
     /* Details action/widget: */
-    m_pActionPool->action(UIActionIndexMN_M_Network_T_Details)->setChecked(gEDataManager->hostNetworkManagerDetailsExpanded());
-    sltToggleHostNetworkDetailsVisibility(m_pActionPool->action(UIActionIndexMN_M_Network_T_Details)->isChecked());
+    if (m_pActionPool)
+    {
+        m_pActionPool->action(UIActionIndexMN_M_Network_T_Details)->setChecked(gEDataManager->hostNetworkManagerDetailsExpanded());
+        sltToggleHostNetworkDetailsVisibility(m_pActionPool->action(UIActionIndexMN_M_Network_T_Details)->isChecked());
+    }
 }
 
 void UINetworkManagerWidget::loadHostNetworks()
 {
+    /* Check tree-widget: */
+    if (!m_pTreeWidget)
+        return;
+
     /* Clear tree first of all: */
     m_pTreeWidget->clear();
@@ -917,5 +949,5 @@
     /* Create new item: */
     UIItemHostNetwork *pItem = new UIItemHostNetwork;
-    AssertPtrReturnVoid(pItem);
+    if (pItem)
     {
         /* Configure item: */
@@ -933,5 +965,5 @@
 {
     /* Update passed item: */
-    AssertPtrReturnVoid(pItem);
+    if (pItem)
     {
         /* Configure item: */
@@ -1016,9 +1048,8 @@
 void UINetworkManager::configureCentralWidget()
 {
-    /* Create widget: */
+    /* Prepare widget: */
     UINetworkManagerWidget *pWidget = new UINetworkManagerWidget(EmbedTo_Dialog, m_pActionPool, true, this);
-    AssertPtrReturnVoid(pWidget);
-    {
-        /* Configure widget: */
+    if (pWidget)
+    {
         setWidget(pWidget);
         setWidgetMenu(pWidget->menu());
Index: trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.h	(revision 87081)
+++ trunk/src/VBox/Frontends/VirtualBox/src/networkmanager/UINetworkManager.h	(revision 87088)
@@ -61,5 +61,5 @@
       * @param  fShowToolbar  Brings whether we should create/show toolbar. */
     UINetworkManagerWidget(EmbedTo enmEmbedding, UIActionPool *pActionPool,
-                               bool fShowToolbar = true, QWidget *pParent = 0);
+                           bool fShowToolbar = true, QWidget *pParent = 0);
 
     /** Returns the menu. */
@@ -161,9 +161,9 @@
       * @{ */
         /** Holds the widget embedding type. */
-        const EmbedTo m_enmEmbedding;
+        const EmbedTo  m_enmEmbedding;
         /** Holds the action-pool reference. */
-        UIActionPool *m_pActionPool;
+        UIActionPool  *m_pActionPool;
         /** Holds whether we should create/show toolbar. */
-        const bool    m_fShowToolbar;
+        const bool     m_fShowToolbar;
     /** @} */
 
@@ -177,5 +177,5 @@
       * @{ */
         /** Holds the tree-widget instance. */
-        QITreeWidget *m_pTreeWidget;
+        QITreeWidget           *m_pTreeWidget;
         /** Holds the details-widget instance. */
         UINetworkDetailsWidget *m_pDetailsWidget;
