Deployment view improved
authorVictor Kirhenshtein <victor@netxms.org>
Wed, 23 Feb 2005 20:25:26 +0000 (20:25 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Wed, 23 Feb 2005 20:25:26 +0000 (20:25 +0000)
.gitattributes
src/console/win32/DeploymentView.cpp
src/console/win32/DeploymentView.h
src/console/win32/icons/Makefile.am
src/console/win32/icons/nack.ico [new file with mode: 0644]
src/console/win32/icons/pending.ico [new file with mode: 0644]
src/console/win32/icons/running.ico [new file with mode: 0644]
src/console/win32/nxcon.dsp
src/console/win32/nxcon.rc
src/console/win32/resource.h

index b46c733..1037031 100644 (file)
@@ -451,6 +451,7 @@ src/console/win32/icons/e-mail.ico -text
 src/console/win32/icons/exec.ico -text
 src/console/win32/icons/graph.ico -text
 src/console/win32/icons/log.ico -text
+src/console/win32/icons/nack.ico -text
 src/console/win32/icons/ovl_status_critical.ico -text
 src/console/win32/icons/ovl_status_disabled.ico -text
 src/console/win32/icons/ovl_status_major.ico -text
@@ -461,8 +462,10 @@ src/console/win32/icons/ovl_status_unmanaged.ico -text
 src/console/win32/icons/ovl_status_warning.ico -text
 src/console/win32/icons/package.ico -text
 src/console/win32/icons/passwd.ico -text
+src/console/win32/icons/pending.ico -text
 src/console/win32/icons/question.ico -text
 src/console/win32/icons/rexec.ico -text
+src/console/win32/icons/running.ico -text
 src/console/win32/icons/setup.ico -text
 src/console/win32/icons/sms.ico -text
 src/console/win32/icons/sort_up.ico -text
index a070662..5c926f6 100644 (file)
@@ -30,6 +30,7 @@ CDeploymentView::CDeploymentView()
 {
    m_dwRqId = 0;
    m_bFinished = FALSE;
+   m_dwFailedNodes = 0;
 }
 
 CDeploymentView::~CDeploymentView()
@@ -90,12 +91,16 @@ int CDeploymentView::OnCreate(LPCREATESTRUCT lpCreateStruct)
    GetClientRect(&rect);
    rect.top += STATUS_HEIGHT + 1;
    m_wndListCtrl.Create(WS_CHILD | WS_VISIBLE | LVS_REPORT, rect, this, ID_LIST_VIEW);
-   m_wndListCtrl.InsertColumn(0, _T("Node"), LVCFMT_LEFT, 120);
-   m_wndListCtrl.InsertColumn(1, _T("Status"), LVCFMT_LEFT, 100);
-   m_wndListCtrl.InsertColumn(2, _T("Message"), LVCFMT_LEFT, 250);
+   m_wndListCtrl.InsertColumn(0, _T("Node"), LVCFMT_LEFT, 150);
+   m_wndListCtrl.InsertColumn(1, _T("Status"), LVCFMT_LEFT, 120);
+   m_wndListCtrl.InsertColumn(2, _T("Message"), LVCFMT_LEFT, 350);
    m_wndListCtrl.SetExtendedStyle(LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);
 
-   m_imageList.Create(g_pObjectSmallImageList);
+   m_imageList.Create(16, 16, ILC_COLOR24 | ILC_MASK, 4, 1);
+   m_imageList.Add(theApp.LoadIcon(IDI_RUNNING));
+   m_imageList.Add(theApp.LoadIcon(IDI_PENDING));
+   m_imageList.Add(theApp.LoadIcon(IDI_ACK));
+   m_imageList.Add(theApp.LoadIcon(IDI_NACK));
    m_wndListCtrl.SetImageList(&m_imageList, LVSIL_SMALL);
        
        return 0;
@@ -166,16 +171,26 @@ void CDeploymentView::OnDeploymentInfo(DWORD dwRqId, NXC_DEPLOYMENT_STATUS *pInf
          pObject = NXCFindObjectById(g_hSession, pInfo->dwNodeId);
          if (pObject != NULL)
          {
-            iItem = m_wndListCtrl.InsertItem(0x7FFFFFFF, pObject->szName,
-                                             GetObjectImageIndex(pObject));
+            iItem = m_wndListCtrl.InsertItem(0x7FFFFFFF, pObject->szName, 1);
          }
          else
          {
-            iItem = m_wndListCtrl.InsertItem(0x7FFFFFFF, _T("<invalid>"), -1);
+            iItem = m_wndListCtrl.InsertItem(0x7FFFFFFF, _T("<invalid>"), 3);
          }
          m_wndListCtrl.SetItemData(iItem, pInfo->dwNodeId);
          m_wndProgressCtrl.SetRange32(0, m_wndListCtrl.GetItemCount());
       }
+      else
+      {
+         LVITEM lvi;
+         static m_iStateImage[] = { 1, 0, 0, 2, 3, 0 };
+
+         lvi.iItem = iItem;
+         lvi.iSubItem = 0;
+         lvi.mask = LVIF_IMAGE;
+         lvi.iImage = m_iStateImage[pInfo->dwStatus];
+         m_wndListCtrl.SetItem(&lvi);
+      }
       m_wndListCtrl.SetItemText(iItem, 1, g_szDeploymentStatus[pInfo->dwStatus]);
       m_wndListCtrl.SetItemText(iItem, 2, 
          (pInfo->dwStatus == DEPLOYMENT_STATUS_FAILED) ? pInfo->pszErrorMessage : _T(""));
@@ -183,6 +198,9 @@ void CDeploymentView::OnDeploymentInfo(DWORD dwRqId, NXC_DEPLOYMENT_STATUS *pInf
       if ((pInfo->dwStatus == DEPLOYMENT_STATUS_FAILED) ||
           (pInfo->dwStatus == DEPLOYMENT_STATUS_COMPLETED))
          m_wndProgressCtrl.StepIt();
+
+      if (pInfo->dwStatus == DEPLOYMENT_STATUS_FAILED)
+         m_dwFailedNodes++;
    }
 }
 
@@ -237,7 +255,16 @@ void CDeploymentView::OnDeploymentFinished(WPARAM wParam, LPARAM lParam)
    m_bFinished = TRUE;
    InvalidateRect(NULL);
    if (lParam == RCC_SUCCESS)
-      MessageBox(_T("Deployment job finished successfully"), _T("Information"), MB_OK | MB_ICONINFORMATION);
+   {
+      if (m_dwFailedNodes == 0)
+         MessageBox(_T("Deployment job finished successfully"),
+                    _T("Information"), MB_OK | MB_ICONINFORMATION);
+      else
+         MessageBox(_T("Deployment job finished with errors"),
+                    _T("Warning"), MB_OK | MB_ICONEXCLAMATION);
+   }
    else
+   {
       theApp.ErrorBox(lParam, _T("Deployment job failed: %s"));
+   }
 }
index 644d624..94bad5c 100644 (file)
@@ -31,6 +31,7 @@ public:
 
 // Implementation
 protected:
+       DWORD m_dwFailedNodes;
        CImageList m_imageList;
        CProgressCtrl m_wndProgressCtrl;
        CFont m_font;
index cca3bbc..9278597 100644 (file)
@@ -17,4 +17,6 @@ EXTRA_DIST = \
        ovl_status_warning.ico passwd.ico question.ico rexec.ico RuleManager.ico \
        setup.ico SeverityCritical.ico SeverityMajor.ico SeverityMinor.ico \
        SeverityNormal.ico SeverityWarning.ico sms.ico sortdown.ico \
-       sort_up.ico tree.ico unsupported.ico user.ico users.ico
+       sort_up.ico tree.ico unsupported.ico user.ico users.ico \
+       nack.ico running.ico pending.ico
+
diff --git a/src/console/win32/icons/nack.ico b/src/console/win32/icons/nack.ico
new file mode 100644 (file)
index 0000000..a6cb53b
Binary files /dev/null and b/src/console/win32/icons/nack.ico differ
diff --git a/src/console/win32/icons/pending.ico b/src/console/win32/icons/pending.ico
new file mode 100644 (file)
index 0000000..e617170
Binary files /dev/null and b/src/console/win32/icons/pending.ico differ
diff --git a/src/console/win32/icons/running.ico b/src/console/win32/icons/running.ico
new file mode 100644 (file)
index 0000000..720fbde
Binary files /dev/null and b/src/console/win32/icons/running.ico differ
index f80c757..7df9f34 100644 (file)
@@ -854,6 +854,10 @@ SOURCE=.\res\login.bmp
 # End Source File
 # Begin Source File
 
+SOURCE=.\icons\nack.ico
+# End Source File
+# Begin Source File
+
 SOURCE=.\icons\NetMap.ICO
 # End Source File
 # Begin Source File
@@ -922,6 +926,10 @@ SOURCE=.\icons\passwd.ico
 # End Source File
 # Begin Source File
 
+SOURCE=.\icons\pending.ico
+# End Source File
+# Begin Source File
+
 SOURCE=.\res\psym_any.bmp
 # End Source File
 # Begin Source File
@@ -938,6 +946,10 @@ SOURCE=.\icons\RuleManager.ico
 # End Source File
 # Begin Source File
 
+SOURCE=.\icons\running.ico
+# End Source File
+# Begin Source File
+
 SOURCE=.\icons\setup.ico
 # End Source File
 # Begin Source File
index dc8d182..997b967 100644 (file)
@@ -109,6 +109,9 @@ IDI_TRAP                ICON    DISCARDABLE     "icons\\trap.ico"
 IDI_PACKAGE             ICON    DISCARDABLE     "icons\\package.ico"
 IDI_DATABASE            ICON    DISCARDABLE     "icons\\database.ico"
 IDI_DEPLOY              ICON    DISCARDABLE     "icons\\deploy.ico"
+IDI_NACK                ICON    DISCARDABLE     "icons\\nack.ico"
+IDI_RUNNING             ICON    DISCARDABLE     "icons\\running.ico"
+IDI_PENDING             ICON    DISCARDABLE     "icons\\pending.ico"
 
 /////////////////////////////////////////////////////////////////////////////
 //
index 6146d72..4d1c948 100644 (file)
 #define IDD_OBJECT_NETSRV_GENERAL       256
 #define IDD_OBJECT_NODE_POLL            257
 #define IDI_DEPLOY                      258
+#define IDI_NACK                        259
+#define IDI_RUNNING                     260
+#define IDI_PENDING                     261
 #define ID_EDIT_BOX                     525
 #define IDC_EDIT_SERVER                 1000
 #define IDC_EDIT_LOGIN                  1001
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_3D_CONTROLS                     1
-#define _APS_NEXT_RESOURCE_VALUE        259
+#define _APS_NEXT_RESOURCE_VALUE        262
 #define _APS_NEXT_COMMAND_VALUE         32916
 #define _APS_NEXT_CONTROL_VALUE         1235
 #define _APS_NEXT_SYMED_VALUE           121