Clone
ixen <ixen@copyhandler.com>
committed
on 06 Apr 08
Cleanups in the About dialog box (added info about translator, removed unnecessary e-mails, fixed compilation version).
LoggerImprovements + 5 more
src/ch/AboutDlg.cpp (+34 -9)
30 30 bool CAboutDlg::m_bLock=false;
31 31
32 32 CAboutDlg::CAboutDlg() :ictranslate::CLanguageDialog(CAboutDlg::IDD, NULL, &m_bLock)
33 33 {
34 34         //{{AFX_DATA_INIT(CAboutDlg)
35 35         //}}AFX_DATA_INIT
36 36         RegisterStaticExControl(AfxGetInstanceHandle());
37 37 }
38 38
39 39 CAboutDlg::~CAboutDlg()
40 40 {
41 41 }
42 42
43 43 BEGIN_MESSAGE_MAP(CAboutDlg,ictranslate::CLanguageDialog)
44 44         //{{AFX_MSG_MAP(CAboutDlg)
45 45         //}}AFX_MSG_MAP
46 46 END_MESSAGE_MAP()
47 47
48 48 void CAboutDlg::UpdateProgramVersion()
49 49 {
50           CWnd* pCtl=(CWnd*)GetDlgItem(IDC_PROGRAM_STATICEX);
51           CWnd* pCtl2=(CWnd*)GetDlgItem(IDC_FULLVERSION_STATICEX);
  50         CWnd* pCtl = GetDlgItem(IDC_PROGRAM_STATICEX);
  51         CWnd* pCtl2 = GetDlgItem(IDC_FULLVERSION_STATICEX);
52 52         CWnd* pWndCopyright = GetDlgItem(IDC_COPYRIGHT_STATIC);
53           if (!pCtl || !pCtl2 || !pWndCopyright)
  53         CWnd* pctlSite = GetDlgItem(IDC_HOMEPAGELINK_STATIC);
  54         CWnd* pctlLanguage = GetDlgItem(IDC_LANGUAGE_STATIC);
  55         CWnd* pctlContact = GetDlgItem(IDC_CONTACT1LINK_STATIC);
  56
  57         if (!pCtl || !pCtl2 || !pWndCopyright || !pctlSite || !pctlLanguage || !pctlContact)
54 58                 return;
55           else
56           {
57                   CString strText = GetResManager()->LoadString(IDS_ABOUTVERSION_STRING);
58                   strText += GetApp()->GetAppVersion();
59 59
  60         // Readable version
60 61         pCtl->SetWindowText(GetApp()->GetAppNameVer());
  62
  63         // full version
  64         CString strText;
  65         strText.Format(_T("%s: %ld.%ld.%ld.%ld"), GetResManager()->LoadString(IDS_ABOUTVERSION_STRING),
  66                 PRODUCT_VERSION1, PRODUCT_VERSION2, PRODUCT_VERSION3, PRODUCT_VERSION4);
61 67         pCtl2->SetWindowText(strText);
  68         // Copyright information
62 69         pWndCopyright->SetWindowText(_T(COPYRIGHT_INFO));
  70
  71         // web page link
  72         pctlSite->SetWindowText(_T(PRODUCT_SITE) _T("|") _T(PRODUCT_SITE));
  73         pctlContact->SetWindowText(_T(CONTACT_INFO) _T("|mailto:") _T(CONTACT_INFO));
  74
  75         // language information
  76         ictranslate::CResourceManager* pResManager = GetResManager();
  77         if(pResManager)
  78         {
  79                 const ictranslate::CLangData* pLangData = pResManager->GetLanguageData();
  80                 if(pLangData)
  81                 {
  82                         ictranslate::CFormat fmt(pResManager->LoadString(IDS_ABOUT_LANGUAGE_STRING));
  83                         fmt.SetParam(_t("%langname"), pLangData->GetLangName());
  84                         fmt.SetParam(_t("%authors"), pLangData->GetAuthor());
  85
  86                         pctlLanguage->SetWindowText(fmt);
63 87                 }
64 88         }
  89 }
65 90
66 91 BOOL CAboutDlg::OnInitDialog()
67 92 {
68 93         CLanguageDialog::OnInitDialog();
69 94
70 95         UpdateProgramVersion();
71 96
72 97         return TRUE;
73 98 }
74 99
75 100 void CAboutDlg::OnLanguageChanged()
76 101 {
77 102         UpdateProgramVersion();
78 103 }
79 104
80 105 BOOL CAboutDlg::OnTooltipText(UINT uiID, TOOLTIPTEXT* pTip)
81 106 {
82 107         switch(uiID)
83 108         {
84 109         case IDC_HOMEPAGELINK_STATIC: