Changeset 46

Show
Ignore:
Timestamp:
01/27/08 19:10:06 (8 months ago)
Author:
bbrinkmann
Message:

support new registration keys

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • public/trunk/pmfb/client/win/dialog/RegisterDialog.cpp

    r44 r46  
    3232        //{{AFX_DATA_INIT(CRegister) 
    3333        mKeyCode = _T(""); 
    34         mUserName = _T(""); 
    3534        //}}AFX_DATA_INIT 
    3635} 
     
    4241        //{{AFX_DATA_MAP(CRegister) 
    4342        DDX_Text(pDX, IDC_KEY_CODE, mKeyCode); 
    44         DDV_MaxChars(pDX, mKeyCode, 14); 
    45         DDX_Text(pDX, IDC_USER_NAME, mUserName); 
    46         DDV_MaxChars(pDX, mUserName, 31); 
    4743        //}}AFX_DATA_MAP 
    4844} 
     
    5147BEGIN_MESSAGE_MAP(CRegister, CDialog) 
    5248        //{{AFX_MSG_MAP(CRegister) 
    53         ON_BN_CLICKED(IDC_GENERATE, OnGenerate) 
    5449        //}}AFX_MSG_MAP 
     50        ON_BN_CLICKED(IDOK, OnBnClickedOk) 
    5551END_MESSAGE_MAP() 
    5652 
     
    6157{ 
    6258        CDialog::OnInitDialog(); 
    63     mUserName = AfxGetApp()->GetProfileString(_T("Registration"),_T("UserName")); 
    64     mGenerateState = AfxGetApp()->GetProfileInt(_T("Registration"),_T("GenerateState"),kUserNameActive); 
    65         GetDlgItem(IDC_USER_NAME)->SetWindowText(mUserName); 
    66         SetGenerateState(); 
     59//      SetGenerateState(); 
    6760 
    6861        return FALSE;  // return TRUE unless you set the focus to a control 
     
    7063} 
    7164 
    72 void CRegister::SetGenerateState()  
     65void CRegister::OnBnClickedOk() 
    7366{ 
    74         GetDlgItem(IDC_USER_NAME)->EnableWindow(mGenerateState == kUserNameActive); 
    75         GetDlgItem(IDC_KEY_CODE)->EnableWindow(mGenerateState == kUserNameInactive); 
    76         GetDlgItem(IDOK)->EnableWindow(mGenerateState == kUserNameInactive); 
    77         if (mGenerateState == kUserNameActive) 
    78         { 
    79                 GetDlgItem(IDC_GENERATE)->SetWindowText(CString(MAKEINTRESOURCE(IDS_REGISTER_GENERATE_ID))); 
    80                 GetDlgItem(IDC_KEY_CODE)->SetWindowText(_T("")); 
    81                 GetDlgItem(IDC_PERSONAL_ID)->SetWindowText(_T("")); 
    82                 this->GotoDlgCtrl(GetDlgItem(IDC_USER_NAME)); 
    83         } 
    84         else 
    85         { 
    86                 GetDlgItem(IDC_GENERATE)->SetWindowText(CString(MAKEINTRESOURCE(IDS_REGISTER_CHANGE_NAME))); 
    87                 GetDlgItem(IDC_USER_NAME)->GetWindowText(mUserName); 
    88 #if 0 
    89                 this->GetDlgItem(IDC_PERSONAL_ID)->SetWindowText(RegisterUserValidationKey((char*)(LPCTSTR)mUserName)); 
    90 #endif // 0 
    91                 this->GotoDlgCtrl(GetDlgItem(IDCANCEL)); 
    92         } 
     67        // TODO: Add your control notification handler code here 
     68        GetDlgItem(IDC_KEY_CODE)->GetWindowText(mKeyCode); 
     69        int error = db::Connection::addLicense((char*)(LPCTSTR)mKeyCode); 
     70        OnOK(); 
    9371} 
    94  
    95 void CRegister::OnGenerate()  
    96 { 
    97         mGenerateState = !mGenerateState; 
    98         SetGenerateState(); 
    99 } 
    100  
    101 void CRegister::OnCancel()  
    102 { 
    103         GetDlgItem(IDC_USER_NAME)->GetWindowText(mUserName); 
    104     AfxGetApp()->WriteProfileString(_T("Registration"),_T("UserName"),mUserName); 
    105     AfxGetApp()->WriteProfileInt(_T("Registration"),_T("GenerateState"),mGenerateState); 
    106          
    107         CDialog::OnCancel(); 
    108 } 
  • public/trunk/pmfb/client/win/dialog/RegisterDialog.h

    r44 r46  
    2727        enum { IDD = IDD_REGISTER }; 
    2828        CString mKeyCode; 
    29         CString mUserName; 
    3029        //}}AFX_DATA 
    31  
    3230 
    3331// Overrides 
     
    4442        //{{AFX_MSG(CRegister) 
    4543        virtual BOOL OnInitDialog(); 
    46         afx_msg void OnGenerate(); 
    47         virtual void OnCancel(); 
    4844        //}}AFX_MSG 
    4945        DECLARE_MESSAGE_MAP() 
    5046 
    51         void SetGenerateState(); 
    52         enum {kUserNameActive = 0, kUserNameInactive = 1}
    53         int mGenerateState
     47public: 
     48        afx_msg void OnEnChangeKeyCode()
     49        afx_msg void OnBnClickedOk()
    5450}; 
    5551 
  • public/trunk/pmfb/client/win/pmfb-vc/install/PlayMaker Football.nsi

    r8 r46  
    8181  CreateDirectory "$DOCUMENTS\PlayMaker Football\Sessions" 
    8282  CreateDirectory "$LOCALAPPDATA\PlayMaker\License" 
     83  CreateDirectory "$LOCALAPPDATA\PlayMaker\License\private" 
    8384SectionEnd 
    8485 
  • public/trunk/pmfb/client/win/pmfb-vc/pmfb.rc

    r36 r46  
    10571057END 
    10581058 
    1059 IDD_REGISTER DIALOG  0, 0, 197, 210 
     1059IDD_REGISTER DIALOGEX 0, 0, 287, 187 
    10601060STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU 
    10611061CAPTION "Register PlayMaker Football" 
    1062 FONT 8, "MS Sans Serif" 
    1063 BEGIN 
    1064     EDITTEXT        IDC_USER_NAME,71,10,114,12,ES_AUTOHSCROLL 
    1065     PUSHBUTTON      "",IDC_GENERATE,71,28,75,14 
    1066     PUSHBUTTON      "&Waiting",IDCANCEL,80,120,50,14 
    1067     EDITTEXT        IDC_KEY_CODE,71,164,114,12,ES_AUTOHSCROLL 
    1068     DEFPUSHBUTTON   "&Register",IDOK,80,183,50,14 
    1069     LTEXT           "User Name",IDC_STATIC,30,12,36,8 
    1070     LTEXT           "Personal ID",IDC_STATIC,30,51,38,8 
    1071     LTEXT           "",IDC_PERSONAL_ID,71,50,113,10,SS_SUNKEN 
    1072     LTEXT           "Key Code",IDC_STATIC,30,166,32,8 
    1073     CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDFRAME,25,5,165,60 
    1074     CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDFRAME,25,145,165,58 
    1075     CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDFRAME,25,70,165,70 
    1076     LTEXT           "Provide your order information, including your Personal ID, to PlayMaker to obtain a Key Code.  If you have done this and are still waiting for your Key Code to arive, click the Waiting button below.", 
    1077                     IDC_STATIC,30,75,155,40 
    1078     LTEXT           "1.",IDC_STATIC,10,31,8,8 
    1079     LTEXT           "2.",IDC_STATIC,10,100,8,8 
    1080     LTEXT           "3.",IDC_STATIC,10,166,8,8 
    1081     LTEXT           "Enter Key Code and click Register.",IDC_STATIC,30,150, 
    1082                     111,8 
     1062FONT 8, "MS Sans Serif", 0, 0, 0x0 
     1063BEGIN 
     1064    PUSHBUTTON      "Cancel",IDCANCEL,7,166,50,14 
     1065    DEFPUSHBUTTON   "&Register",IDOK,61,166,50,14 
     1066    LTEXT           "Enter Key Code and click Register.",IDC_STATIC,7,7,111, 
     1067                    8 
     1068    EDITTEXT        IDC_KEY_CODE,7,23,272,134,ES_MULTILINE | ES_AUTOHSCROLL 
    10831069END 
    10841070 
     
    13251311    BEGIN 
    13261312        LEFTMARGIN, 7 
    1327         RIGHTMARGIN, 19
    1328         TOPMARGIN, 7 
    1329         BOTTOMMARGIN, 203 
     1313        RIGHTMARGIN, 28
     1314        TOPMARGIN, 7 
     1315        BOTTOMMARGIN, 180 
    13301316    END 
    13311317 
     
    16431629    kRegisterFailString     "The registration information entered is invalid.  Please make sure the Key Code you entered exactly matches the one that was provided to you when you registered.  Or, to register your copy, lookup ""Registration"" in the buit-in help under the Help menu." 
    16441630    IDS_REGISTER_FAIL_NAME  "The registration information entered is invalid.  Please make sure the User Name you entered exactly matches the one that was provided to you when you registered.  Or, to register your copy, lookup ""Registration"" in the buit-in help under the Help menu." 
    1645     IDS_REGISTER_GENERATE_ID "Generate Personal ID
    1646     IDS_REGISTER_CHANGE_NAME "Change User Name
     1631    IDS_REGISTER_GENERATE_ID "Create Certificate Request
     1632    IDS_REGISTER_CHANGE_NAME "Change User Information
    16471633    IDS_REGISTER_READONLY   "You cannot register this application as long as it is read-only.  If you want to register it, exit the application and make sure that the read-only attribute on the file is not set and that it is on writable media." 
    16481634    kRegisterGameUnavailableString  
  • public/trunk/pmfb/client/win/pmfb-vc/resource.h

    r3 r46  
    11//{{NO_DEPENDENCIES}} 
    2 // Microsoft Developer Studio generated include file. 
     2// Microsoft Visual C++ generated include file. 
    33// Used by pmfb.rc 
    44// 
     
    130130#define IDC_KEY_CODE                    1017 
    131131#define IDC_LIGHT                       1018 
     132#define IDC_USER_EMAIL                  1018 
    132133#define IDC_DARK                        1019 
     134#define IDC_USER_CITY                   1019 
    133135#define IDC_BOTTOM_TO_TOP               1020 
     136#define IDC_USER_STATE                  1020 
    134137#define IDC_TOP_TO_BOTTOM               1021 
     138#define IDC_USER_COUNTRY                1021 
     139#define IDC_USER_CERT                   1022 
    135140#define IDC_SWITCH_AT_QUARTER           1023 
    136141#define IDC_YARD_LINE_SPINNER           1024 
     
    388393#define IDS_REGISTER_READONLY           42925 
    389394#define kRegisterGameUnavailableString  42926 
    390 #define kErrorDiskString                               42937 
    391 #define kErrorMemoryString                             42938 
    392 #define kErrorPlaybookFullString               42939 
     395#define kErrorDiskString                42937 
     396#define kErrorMemoryString              42938 
     397#define kErrorPlaybookFullString        42939 
    393398#define IDW_CUSTOM_BAR                  0xE804 
    394399#define IDW_PRACTICE_CONTROL_BAR        0xE805