summaryrefslogtreecommitdiffabout
path: root/ACLTargetCombo.cpp
authorMichael Krelin <hacker@klever.net>2012-12-08 21:19:17 (UTC)
committer Michael Krelin <hacker@klever.net>2012-12-11 21:59:29 (UTC)
commit8808689fe340bec6e90ab13dd502292b0579cf1f (patch) (side-by-side diff)
tree45b7c863151341f687b74e40bffcbd7ab5468783 /ACLTargetCombo.cpp
parent6e7e413ca364d79673e523c09767c18e7cff1bec (diff)
downloadpumpkin-osx/0.0.zip
pumpkin-osx/0.0.tar.gz
pumpkin-osx/0.0.tar.bz2
initial osx portosx/0.0
Signed-off-by: Michael Krelin <hacker@klever.net>
Diffstat (limited to 'ACLTargetCombo.cpp') (more/less context) (show whitespace changes)
-rw-r--r--ACLTargetCombo.cpp85
1 files changed, 0 insertions, 85 deletions
diff --git a/ACLTargetCombo.cpp b/ACLTargetCombo.cpp
deleted file mode 100644
index cdbd075..0000000
--- a/ACLTargetCombo.cpp
+++ b/dev/null
@@ -1,85 +0,0 @@
-// ACLTargetCombo.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "PumpKIN.h"
-#include "PumpKINDlg.h"
-#include "ACLTargetCombo.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CACLTargetCombo
-
-CACLTargetCombo::CACLTargetCombo()
-: m_op(-1)
-{
-}
-
-CACLTargetCombo::~CACLTargetCombo()
-{
-}
-
-
-BEGIN_MESSAGE_MAP(CACLTargetCombo, CComboBox)
- //{{AFX_MSG_MAP(CACLTargetCombo)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CACLTargetCombo message handlers
-
-void CACLTargetCombo::SetOp(int op)
-{
- m_op=op;
- ResetContent();
- switch(op) {
- case tftp::opRRQ:
- m_tmap.RemoveAll();
- SetItemData(m_tmap[acl_rule::rrqNone]=AddString("fallback to global"),acl_rule::rrqNone);
- SetItemData(m_tmap[acl_rule::rrqDeny]=AddString("deny access"),acl_rule::rrqDeny);
- SetItemData(m_tmap[acl_rule::rrqPrompt]=AddString("prompt"),acl_rule::rrqPrompt);
- SetItemData(m_tmap[acl_rule::rrqGrant]=AddString("grant access"),CPumpKINDlg::rrqGrant);
- SetCurSel(0);
- EnableWindow(TRUE);
- break;
- case tftp::opWRQ:
- m_tmap.RemoveAll();
- SetItemData(m_tmap[acl_rule::wrqNone]=AddString("fallback to global"),acl_rule::wrqNone);
- SetItemData(m_tmap[acl_rule::wrqDeny]=AddString("deny access"),acl_rule::wrqDeny);
- SetItemData(m_tmap[acl_rule::wrqPrompt]=AddString("prompt"),acl_rule::wrqPrompt);
- SetItemData(m_tmap[acl_rule::wrqPromptIfExists]=AddString("prompt if file exists"),acl_rule::wrqPromptIfExists);
- SetItemData(m_tmap[acl_rule::wrqGrant]=AddString("grant access"),acl_rule::wrqGrant);
- SetCurSel(0);
- EnableWindow(TRUE);
- break;
- default:
- EnableWindow(FALSE);
- break;
- }
-}
-
-int CACLTargetCombo::GetTarget()
-{
- int cs=GetCurSel();
- if(cs==CB_ERR)
- return -1;
- return GetItemData(cs);
-}
-
-void CACLTargetCombo::SetTarget(int t,int op)
-{
- if(op>=0)
- SetOp(op);
- ASSERT(m_op>=0);
- int i;
- if(m_tmap.Lookup(t,i))
- SetCurSel(i);
- else
- SetCurSel(0);
-}