-
Notifications
You must be signed in to change notification settings - Fork 29
/
DlgCreateFlvDownloadsByWebPageUrl.cpp
87 lines (68 loc) · 2.17 KB
/
DlgCreateFlvDownloadsByWebPageUrl.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
Free Download Manager Copyright (c) 2003-2016 FreeDownloadManager.ORG
*/
#include "stdafx.h"
#include "fdm.h"
#include "DlgCreateFlvDownloadsByWebPageUrl.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CDlgCreateFlvDownloadsByWebPageUrl::CDlgCreateFlvDownloadsByWebPageUrl(CWnd* pParent )
: CDialog(CDlgCreateFlvDownloadsByWebPageUrl::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgCreateFlvDownloadsByWebPageUrl)
//}}AFX_DATA_INIT
}
void CDlgCreateFlvDownloadsByWebPageUrl::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgCreateFlvDownloadsByWebPageUrl)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgCreateFlvDownloadsByWebPageUrl, CDialog)
//{{AFX_MSG_MAP(CDlgCreateFlvDownloadsByWebPageUrl)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CDlgCreateFlvDownloadsByWebPageUrl::OnOK()
{
GetDlgItemText (IDC_WPURL, m_strWebPageUrl);
fsURL url;
if (IR_SUCCESS != url.Crack (m_strWebPageUrl))
{
MessageBox (LS (L_CHECKURL), LS (L_INPERR), MB_ICONEXCLAMATION);
GetDlgItem (IDC_WPURL)->SetFocus ();
return;
}
_LastFlashVideoUrls.AddRecord (m_strWebPageUrl);
CDialog::OnOK();
}
BOOL CDlgCreateFlvDownloadsByWebPageUrl::OnInitDialog()
{
CDialog::OnInitDialog();
LPCTSTR pszUrl = _ClipbrdMgr.Text ();
if (pszUrl && *pszUrl)
{
fsURL url;
if (url.Crack (pszUrl) == IR_SUCCESS && *url.GetHostName ())
m_strWebPageUrl = pszUrl;
}
if (m_strWebPageUrl.IsEmpty ())
m_strWebPageUrl = _T("http://");
CComboBox *pUrls = (CComboBox*) GetDlgItem (IDC_WPURL);
for (int i = 0; i < _LastFlashVideoUrls.GetRecordCount (); i++)
pUrls->AddString (_LastFlashVideoUrls.GetRecord (i));
SetDlgItemText (IDC_WPURL, m_strWebPageUrl);
ApplyLanguage ();
return TRUE;
}
void CDlgCreateFlvDownloadsByWebPageUrl::ApplyLanguage()
{
fsDlgLngInfo lnginfo [] = {
fsDlgLngInfo (IDC__WEBPAGE, L_WEBPAGE, TRUE),
fsDlgLngInfo (IDC__NOTE, L_CREATEFLVDLD_FROM_WPURL_NOTE),
fsDlgLngInfo (IDCANCEL, L_CANCEL),
};
_LngMgr.ApplyLanguage (this, lnginfo, sizeof (lnginfo) / sizeof (fsDlgLngInfo), L_CREATEFVDLD);
}