Service creation dialog improved
authorVictor Kirhenshtein <victor@netxms.org>
Thu, 27 Jan 2005 06:42:43 +0000 (06:42 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Thu, 27 Jan 2005 06:42:43 +0000 (06:42 +0000)
src/console/win32/CreateNetSrvDlg.cpp
src/console/win32/CreateNetSrvDlg.h
src/console/win32/globals.cpp
src/console/win32/nxcon.clw
src/console/win32/tools.cpp

index b249bfb..4d73981 100644 (file)
@@ -47,6 +47,10 @@ void CCreateNetSrvDlg::DoDataExchange(CDataExchange* pDX)
 BEGIN_MESSAGE_MAP(CCreateNetSrvDlg, CCreateObjectDlg)
        //{{AFX_MSG_MAP(CCreateNetSrvDlg)
        ON_CBN_SELCHANGE(IDC_COMBO_TYPES, OnSelchangeComboTypes)
+       ON_BN_CLICKED(IDC_RADIO_TCP, OnRadioTcp)
+       ON_BN_CLICKED(IDC_RADIO_UDP, OnRadioUdp)
+       ON_BN_CLICKED(IDC_RADIO_ICMP, OnRadioIcmp)
+       ON_BN_CLICKED(IDC_RADIO_OTHER, OnRadioOther)
        //}}AFX_MSG_MAP
 END_MESSAGE_MAP()
 
@@ -88,6 +92,14 @@ void CCreateNetSrvDlg::OnOK()
 void CCreateNetSrvDlg::OnSelchangeComboTypes() 
 {
    GetServiceType();
+   if (m_iServiceType != NETSRV_CUSTOM)
+   {
+      SetDlgItemText(IDC_EDIT_PROTO, _T("6"));
+      SendDlgItemMessage(IDC_RADIO_TCP, BM_SETCHECK, BST_CHECKED, 0);
+      SendDlgItemMessage(IDC_RADIO_UDP, BM_SETCHECK, BST_UNCHECKED, 0);
+      SendDlgItemMessage(IDC_RADIO_ICMP, BM_SETCHECK, BST_UNCHECKED, 0);
+      SendDlgItemMessage(IDC_RADIO_OTHER, BM_SETCHECK, BST_UNCHECKED, 0);
+   }
    SetProtocolCtrls();
 }
 
@@ -105,7 +117,8 @@ void CCreateNetSrvDlg::SetProtocolCtrls()
    EnableDlgItem(this, IDC_RADIO_UDP, bEnable);
    EnableDlgItem(this, IDC_RADIO_ICMP, bEnable);
    EnableDlgItem(this, IDC_RADIO_OTHER, bEnable);
-   EnableDlgItem(this, IDC_EDIT_PROTO, bEnable);
+   EnableDlgItem(this, IDC_EDIT_PROTO, 
+                 SendDlgItemMessage(IDC_RADIO_OTHER, BM_GETCHECK) == BST_CHECKED);
 }
 
 
@@ -123,3 +136,31 @@ void CCreateNetSrvDlg::GetServiceType()
       if (!_tcscmp(szBuffer, g_szServiceType[m_iServiceType]))
          break;
 }
+
+
+//
+// Handle radio button clicks
+//
+
+void CCreateNetSrvDlg::OnRadioTcp() 
+{
+   SetDlgItemText(IDC_EDIT_PROTO, _T("6"));
+   EnableDlgItem(this, IDC_EDIT_PROTO, FALSE);
+}
+
+void CCreateNetSrvDlg::OnRadioUdp() 
+{
+   SetDlgItemText(IDC_EDIT_PROTO, _T("17"));
+   EnableDlgItem(this, IDC_EDIT_PROTO, FALSE);
+}
+
+void CCreateNetSrvDlg::OnRadioIcmp() 
+{
+   SetDlgItemText(IDC_EDIT_PROTO, _T("1"));
+   EnableDlgItem(this, IDC_EDIT_PROTO, FALSE);
+}
+
+void CCreateNetSrvDlg::OnRadioOther() 
+{
+   EnableDlgItem(this, IDC_EDIT_PROTO, TRUE);
+}
index 10a9524..183084e 100644 (file)
@@ -49,6 +49,10 @@ protected:
        virtual BOOL OnInitDialog();
        virtual void OnOK();
        afx_msg void OnSelchangeComboTypes();
+       afx_msg void OnRadioTcp();
+       afx_msg void OnRadioUdp();
+       afx_msg void OnRadioIcmp();
+       afx_msg void OnRadioOther();
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
 };
index d6dac0a..87cb028 100644 (file)
@@ -77,15 +77,20 @@ CImageList *g_pObjectNormalImageList = NULL;
 // Global string constants
 //
 
-TCHAR *g_szStatusText[] = { "NORMAL", "WARNING", "MINOR", "MAJOR", "CRITICAL", "UNKNOWN", "UNMANAGED", "DISABLED", "TESTING" };
-TCHAR *g_szStatusTextSmall[] = { "Normal", "Warning", "Minor", "Major", "Critical", "Unknown", "Unmanaged", "Disabled", "Testing" };
+TCHAR *g_szStatusText[] = { "NORMAL", "WARNING", "MINOR", "MAJOR",
+                            "CRITICAL", "UNKNOWN", "UNMANAGED",
+                            "DISABLED", "TESTING" };
+TCHAR *g_szStatusTextSmall[] = { "Normal", "Warning", "Minor", "Major",
+                                 "Critical", "Unknown", "Unmanaged",
+                                 "Disabled", "Testing" };
 TCHAR *g_szObjectClass[] = { "Generic", "Subnet", "Node", "Interface", "Network", 
                              "Container", "Zone", "ServiceRoot", "Template", 
-                             "TemplateGroup", "TemplateRoot" };
-TCHAR *g_szActionType[] = { "Execute", "Remote", "E-Mail", "SMS" };
+                             "TemplateGroup", "TemplateRoot", "NetworkService" };
+TCHAR *g_szActionType[] = { _T("Execute"), _T("Remote"), _T("E-Mail"), _T("SMS") };
 TCHAR *g_szServiceType[] = { _T("User-defined"), _T("SSH"), _T("POP3"), _T("SMTP"),
                              _T("FTP"), _T("HTTP"), NULL };
-TCHAR *g_szInterfaceTypes[] = {
+TCHAR *g_szInterfaceTypes[] = 
+{
    "Unknown",
    "Other",
    "Regular 1822",
index a8a298d..af08fdb 100644 (file)
@@ -16,9 +16,9 @@ Class7=CEventBrowser
 Class9=CMapView
 
 ResourceCount=111
-Resource1=IDD_EDIT_RULE_SEVERITY (English (U.S.))
+Resource1=IDD_SELECT_USER (English (U.S.))
 Resource2=IDD_OBJECT_NODE_GENERAL
-Resource3=IDA_OBJECT_BROWSER (English (U.S.))
+Resource3=IDD_CREATE_NODE (English (U.S.))
 Resource4=IDD_SELECT_OBJECT
 Resource5=IDD_SELECT_ACTION
 Class2=CChildView
@@ -32,9 +32,9 @@ Resource7=IDD_NEW_USER
 Class12=CObjectBrowser
 Resource8=IDD_CREATE_CONTAINER
 Class13=CObjectPropDlg
-Resource9=IDD_DCI_TRANSFORM (English (U.S.))
-Resource10=IDA_EVENT_EDITOR (English (U.S.))
-Resource11=IDD_OBJECT_SECURITY (English (U.S.))
+Resource9=IDD_MIB_BROWSER (English (U.S.))
+Resource10=IDD_DATA_QUERY (English (U.S.))
+Resource11=IDA_NETMAP (English (U.S.))
 Resource12=IDR_CTRLPANEL (English (U.S.))
 Resource13=IDR_EVENTS (English (U.S.))
 Resource14=IDR_MAPFRAME (English (U.S.))
@@ -42,33 +42,33 @@ Resource15=IDR_OBJECTS (English (U.S.))
 Resource16=IDD_DUMMY (English (U.S.))
 Class14=CEventEditor
 Class15=CEditEventDlg
-Resource17=IDD_EDIT_RULE_COMMENT (English (U.S.))
+Resource17=IDD_REQUEST_PROCESSING (English (U.S.))
 Class16=CDebugFrame
-Resource18=IDD_DCI_COLLECTION (English (U.S.))
+Resource18=IDD_ABOUTBOX (English (U.S.))
 Resource19=IDD_OBJECT_PROPERTIES (English (U.S.))
 Resource20=IDD_SELECT_EVENT
 Class17=CObjectPreview
-Resource21=IDD_SELECT_INTERNAL_ITEM (English (U.S.))
+Resource21=IDD_CP_GENERAL (English (U.S.))
 Class18=CToolBox
 Class19=CObjectInfoBox
 Class20=CObjectSearchBox
-Resource22=IDD_CREATE_CONTAINER (English (U.S.))
+Resource22=IDD_DCI_THRESHOLDS (English (U.S.))
 Class21=CEditBox
 Class22=COPGeneral
 Class23=CNodePropsGeneral
-Resource23=IDD_REQUEST_PROCESSING (English (U.S.))
+Resource23=IDA_EPP (English (U.S.))
 Class24=CObjectPropCaps
 Class25=CObjectPropSheet
 Resource24=IDA_MDI_DEFAULT
 Class26=CRequestProcessingDlg
-Resource25=IDD_OBJECT_GENERAL (English (U.S.))
+Resource25=IDA_ALARM_BROWSER (English (U.S.))
 Resource26=IDD_PROGRESS (English (U.S.))
 Resource27=IDD_EDIT_RULE_ALARM
-Resource28=IDD_MIB_BROWSER (English (U.S.))
+Resource28=IDD_OBJECT_NODE_GENERAL (English (U.S.))
 Class27=CObjectPropsGeneral
-Resource29=IDA_TRAP_EDITOR (English (U.S.))
+Resource29=IDD_EDIT_TRAP_ARG (English (U.S.))
 Class28=CObjectPropsSecurity
-Resource30=IDD_EDIT_TRAP_ARG (English (U.S.))
+Resource30=IDD_EDIT_RULE_SEVERITY (English (U.S.))
 Resource31=IDD_SELECT_USER
 Resource32=IDD_OBJECT_SECURITY
 Class29=CUserSelectDlg
@@ -79,36 +79,36 @@ Class31=CNewUserDlg
 Resource35=IDD_THRESHOLD
 Resource36=IDA_EPP
 Class32=CUserPropDlg
-Resource37=IDA_EPP (English (U.S.))
+Resource37=IDD_DCI_TRANSFORM (English (U.S.))
 Resource38=IDD_ABOUTBOX
 Class33=CGroupPropDlg
 Resource39=IDD_CP_GENERAL
 Resource40=IDA_TRAP_EDITOR
 Resource41=IDM_VIEW_SPECIFIC
-Resource42=IDD_CP_GENERAL (English (U.S.))
+Resource42=IDD_USER_PROPERTIES (English (U.S.))
 Class34=CPasswordChangeDlg
 Class35=CNodeSummary
 Class36=CNetSummaryFrame
 Class37=CDataCollectionEditor
-Resource43=IDD_DATA_QUERY (English (U.S.))
+Resource43=IDD_SELECT_EVENT (English (U.S.))
 Class38=CDCIPropPage
-Resource44=IDD_SELECT_OBJECT (English (U.S.))
+Resource44=IDD_OBJECT_CAPS (English (U.S.))
 Class39=CDCIDataView
-Resource45=IDD_OBJECT_PRESENTATION (English (U.S.))
+Resource45=IDD_OBJECT_SECURITY (English (U.S.))
 Class40=CGraph
 Class41=CGraphFrame
 Class42=CDCIThresholdsPage
-Resource46=IDA_NETMAP (English (U.S.))
-Resource47=IDD_USER_PROPERTIES (English (U.S.))
+Resource46=IDD_CREATE_TEMPLATE (English (U.S.))
+Resource47=IDA_TRAP_EDITOR (English (U.S.))
 Resource48=IDM_CONTEXT
 Class43=CThresholdDlg
-Resource49=IDD_DCI_THRESHOLDS (English (U.S.))
+Resource49=IDD_LOGIN (English (U.S.))
 Resource50=IDD_EDIT_TRAP_ARG
 Class44=CMIBBrowserDlg
 Class45=CEventPolicyEditor
 Class46=CRuleList
 Class47=CRuleHeader
-Resource51=IDA_ALARM_BROWSER (English (U.S.))
+Resource51=IDD_CREATE_TG (English (U.S.))
 Resource52=IDD_CREATE_NODE
 Class48=CObjectSelDlg
 Resource53=IDD_OBJECT_CAPS
@@ -117,22 +117,22 @@ Class49=CRuleCommentDlg
 Resource55=IDD_DCI_COLLECTION
 Class50=CEventSelDlg
 Resource56=IDD_DATA_QUERY
-Resource57=IDD_GROUP_PROPERTIES (English (U.S.))
+Resource57=IDA_GRAPH (English (U.S.))
 Resource58=IDD_CREATE_TG
-Resource59=IDD_OBJECT_CAPS (English (U.S.))
-Resource60=IDD_EDIT_RULE_ALARM (English (U.S.))
+Resource59=IDA_OBJECT_BROWSER (English (U.S.))
+Resource60=IDD_NEW_USER (English (U.S.))
 Class51=CObjectPropsPresentation
-Resource61=IDD_SELECT_ACTION (English (U.S.))
+Resource61=IDD_DCI_COLLECTION (English (U.S.))
 Resource62=IDD_EDIT_RULE_COMMENT
 Class52=CRuleSeverityDlg
 Resource63=IDD_ACTION_PROPERTIES
 Class53=CRuleAlarmDlg
 Class54=CAlarmBrowser
-Resource64=IDD_OBJECT_NODE_GENERAL (English (U.S.))
+Resource64=IDA_MDI_DEFAULT (English (U.S.))
 Resource65=IDD_DCI_TRANSFORM
-Resource66=IDD_CREATE_TG (English (U.S.))
-Resource67=IDD_SELECT_EVENT (English (U.S.))
-Resource68=IDD_THRESHOLD (English (U.S.))
+Resource66=IDD_SELECT_OBJECT (English (U.S.))
+Resource67=IDD_OBJECT_GENERAL (English (U.S.))
+Resource68=IDD_EDIT_EVENT (English (U.S.))
 Class55=CConsolePropsGeneral
 Class56=CActionEditor
 Resource69=IDA_ACTION_EDITOR
@@ -143,18 +143,18 @@ Class58=CEditActionDlg
 Resource72=IDA_NETMAP
 Class59=CActionSelDlg
 Resource73=IDD_MIB_BROWSER
-Resource74=IDD_NEW_ACTION (English (U.S.))
-Resource75=IDD_CREATE_NODE (English (U.S.))
+Resource74=IDD_GROUP_PROPERTIES (English (U.S.))
+Resource75=IDD_THRESHOLD (English (U.S.))
 Resource76=IDD_USER_PROPERTIES
 Class60=CCreateObjectDlg
 Class61=CCreateContainerDlg
 Resource77=IDR_MAINFRAME
 Class62=CCreateNodeDlg
-Resource78=IDA_ACTION_EDITOR (English (U.S.))
-Resource79=IDD_EDIT_TRAP (English (U.S.))
-Resource80=IDD_SET_PASSWORD (English (U.S.))
+Resource78=IDD_EDIT_TRAP (English (U.S.))
+Resource79=IDD_OBJECT_PRESENTATION (English (U.S.))
+Resource80=IDA_PACKAGE_MGR (English (U.S.))
 Class63=CDCITransformPage
-Resource81=IDD_CREATE_TEMPLATE (English (U.S.))
+Resource81=IDD_EDIT_RULE_COMMENT (English (U.S.))
 Class64=CPollNodeDlg
 Resource82=IDD_POLL_NODE (English (U.S.))
 Class65=CNodePoller
@@ -180,24 +180,24 @@ Class73=CColorSelector
 Class74=CPackageMgr
 Resource94=IDD_GROUP_PROPERTIES
 Resource95=IDD_GRAPH_PROPERTIES
-Resource96=IDA_GRAPH (English (U.S.))
-Resource97=IDA_PACKAGE_MGR (English (U.S.))
-Resource98=IDD_ABOUTBOX (English (U.S.))
-Resource99=IDD_LOGIN (English (U.S.))
-Resource100=IDD_EDIT_EVENT (English (U.S.))
-Resource101=IDD_ACTION_PROPERTIES (English (U.S.))
-Resource102=IDD_SELECT_AGENT_PARAM (English (U.S.))
-Resource103=IDD_INPUT_BOX (English (U.S.))
-Resource104=IDA_MDI_DEFAULT (English (U.S.))
-Resource105=IDM_VIEW_SPECIFIC (English (U.S.))
-Resource106=IDM_CONTEXT (English (U.S.))
-Resource107=IDD_NEW_USER (English (U.S.))
+Resource96=IDD_GRAPH_PROPERTIES (English (U.S.))
+Resource97=IDD_SELECT_INTERNAL_ITEM (English (U.S.))
+Resource98=IDD_SELECT_AGENT_PARAM (English (U.S.))
+Resource99=IDD_INPUT_BOX (English (U.S.))
+Resource100=IDR_MAINFRAME (English (U.S.))
+Resource101=IDD_SET_PASSWORD (English (U.S.))
+Resource102=IDD_NEW_ACTION (English (U.S.))
+Resource103=IDD_ACTION_PROPERTIES (English (U.S.))
+Resource104=IDD_CREATE_CONTAINER (English (U.S.))
+Resource105=IDM_CONTEXT (English (U.S.))
+Resource106=IDM_VIEW_SPECIFIC (English (U.S.))
+Resource107=IDA_ACTION_EDITOR (English (U.S.))
 Class75=CInternalItemSelDlg
-Resource108=IDR_MAINFRAME (English (U.S.))
+Resource108=IDD_SELECT_ACTION (English (U.S.))
 Class76=CAgentParamSelDlg
-Resource109=IDD_SELECT_USER (English (U.S.))
+Resource109=IDA_EVENT_EDITOR (English (U.S.))
 Class77=CInputBox
-Resource110=IDD_GRAPH_PROPERTIES (English (U.S.))
+Resource110=IDD_EDIT_RULE_ALARM (English (U.S.))
 Class78=CCreateNetSrvDlg
 Resource111=IDD_CREATE_NETSRV (English (U.S.))
 
index 053952e..3ffe614 100644 (file)
@@ -275,13 +275,13 @@ void CreateObjectImageList(void)
    if (g_pObjectSmallImageList != NULL)
       delete g_pObjectSmallImageList;
    g_pObjectSmallImageList = new CImageList;
-   g_pObjectSmallImageList->Create(16, 16, ILC_COLOR24 | ILC_MASK, 8, 8);
+   g_pObjectSmallImageList->Create(16, 16, ILC_COLOR24 | ILC_MASK, 16, 8);
 
    // Create normal (32x32) image list
    if (g_pObjectNormalImageList != NULL)
       delete g_pObjectNormalImageList;
    g_pObjectNormalImageList = new CImageList;
-   g_pObjectNormalImageList->Create(32, 32, ILC_COLOR24 | ILC_MASK, 8, 8);
+   g_pObjectNormalImageList->Create(32, 32, ILC_COLOR24 | ILC_MASK, 16, 8);
 
    strcpy(szFileName, g_szWorkDir);
    strcat(szFileName, WORKDIR_IMAGECACHE);