Permalink
Browse files

Merge branch 'master' of ssh://github.com/LVS/AGP-Launcher

  • Loading branch information...
andyjeffries committed Jan 10, 2012
2 parents a2b3e73 + cef44ed commit 62f32d7a287ae6aea35607e1149ca3edb474a6d7
Showing with 21,788 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +79 −0 WIN32/src/ABPLauncher/ABPDownload.cpp
  3. +39 −0 WIN32/src/ABPLauncher/ABPDownload.h
  4. +51 −0 WIN32/src/ABPLauncher/ABPDownloadThread.cpp
  5. +28 −0 WIN32/src/ABPLauncher/ABPDownloadThread.h
  6. +519 −0 WIN32/src/ABPLauncher/ABPLTools.cpp
  7. +53 −0 WIN32/src/ABPLauncher/ABPLTools.h
  8. +75 −0 WIN32/src/ABPLauncher/ABPLauncher.cpp
  9. +32 −0 WIN32/src/ABPLauncher/ABPLauncher.h
  10. BIN WIN32/src/ABPLauncher/ABPLauncher.ico
  11. +260 −0 WIN32/src/ABPLauncher/ABPLauncher.rc
  12. +414 −0 WIN32/src/ABPLauncher/ABPLauncher.vcproj
  13. +176 −0 WIN32/src/ABPLauncher/ABPLauncher.vcxproj
  14. +3 −0 WIN32/src/ABPLauncher/ABPLauncher.vcxproj.user
  15. +152 −0 WIN32/src/ABPLauncher/ABPLauncherDlg.cpp
  16. +47 −0 WIN32/src/ABPLauncher/ABPLauncherDlg.h
  17. +118 −0 WIN32/src/ABPLauncher/ABPLauncherSimpleDlg.cpp
  18. +32 −0 WIN32/src/ABPLauncher/ABPLauncherSimpleDlg.h
  19. BIN WIN32/src/ABPLauncher/Logo.bmp
  20. +32 −0 WIN32/src/ABPLauncher/Resource.h
  21. BIN WIN32/src/ABPLauncher/res/ABPLauncher.ico
  22. +13 −0 WIN32/src/ABPLauncher/res/ABPLauncher.rc2
  23. +8 −0 WIN32/src/ABPLauncher/stdafx.cpp
  24. +57 −0 WIN32/src/ABPLauncher/stdafx.h
  25. +26 −0 WIN32/src/ABPLauncher/targetver.h
  26. +20 −0 WIN32/src/Project.sln
  27. +20 −0 WIN32/src/Project_vcexp10.sln
  28. BIN WIN32/src/Project_vcexp10.suo
  29. BIN WIN32/src/Release/ABPLauncher.exe
  30. BIN WIN32/src/Release/ABPLauncher.pdb
  31. +130 −0 WIN32/src/tinyxml/Makefile
  32. +299 −0 WIN32/src/tinyxml/changes.txt
  33. +48 −0 WIN32/src/tinyxml/docs/annotated.html
  34. +63 −0 WIN32/src/tinyxml/docs/classTiXmlAttribute-members.html
  35. +173 −0 WIN32/src/tinyxml/docs/classTiXmlAttribute.html
  36. BIN WIN32/src/tinyxml/docs/classTiXmlAttribute.png
  37. +45 −0 WIN32/src/tinyxml/docs/classTiXmlBase-members.html
  38. +226 −0 WIN32/src/tinyxml/docs/classTiXmlBase.html
  39. BIN WIN32/src/tinyxml/docs/classTiXmlBase.png
  40. +109 −0 WIN32/src/tinyxml/docs/classTiXmlComment-members.html
  41. +115 −0 WIN32/src/tinyxml/docs/classTiXmlComment.html
  42. BIN WIN32/src/tinyxml/docs/classTiXmlComment.png
  43. +113 −0 WIN32/src/tinyxml/docs/classTiXmlDeclaration-members.html
  44. +131 −0 WIN32/src/tinyxml/docs/classTiXmlDeclaration.html
  45. BIN WIN32/src/tinyxml/docs/classTiXmlDeclaration.png
  46. +128 −0 WIN32/src/tinyxml/docs/classTiXmlDocument-members.html
  47. +437 −0 WIN32/src/tinyxml/docs/classTiXmlDocument.html
  48. BIN WIN32/src/tinyxml/docs/classTiXmlDocument.png
  49. +129 −0 WIN32/src/tinyxml/docs/classTiXmlElement-members.html
  50. +474 −0 WIN32/src/tinyxml/docs/classTiXmlElement.html
  51. BIN WIN32/src/tinyxml/docs/classTiXmlElement.png
  52. +53 −0 WIN32/src/tinyxml/docs/classTiXmlHandle-members.html
  53. +412 −0 WIN32/src/tinyxml/docs/classTiXmlHandle.html
  54. +107 −0 WIN32/src/tinyxml/docs/classTiXmlNode-members.html
  55. +718 −0 WIN32/src/tinyxml/docs/classTiXmlNode.html
  56. BIN WIN32/src/tinyxml/docs/classTiXmlNode.png
  57. +51 −0 WIN32/src/tinyxml/docs/classTiXmlPrinter-members.html
  58. +181 −0 WIN32/src/tinyxml/docs/classTiXmlPrinter.html
  59. BIN WIN32/src/tinyxml/docs/classTiXmlPrinter.png
  60. +111 −0 WIN32/src/tinyxml/docs/classTiXmlText-members.html
  61. +149 −0 WIN32/src/tinyxml/docs/classTiXmlText.html
  62. BIN WIN32/src/tinyxml/docs/classTiXmlText.png
  63. +107 −0 WIN32/src/tinyxml/docs/classTiXmlUnknown-members.html
  64. +111 −0 WIN32/src/tinyxml/docs/classTiXmlUnknown.html
  65. BIN WIN32/src/tinyxml/docs/classTiXmlUnknown.png
  66. +43 −0 WIN32/src/tinyxml/docs/classTiXmlVisitor-members.html
  67. +89 −0 WIN32/src/tinyxml/docs/classTiXmlVisitor.html
  68. BIN WIN32/src/tinyxml/docs/classTiXmlVisitor.png
  69. +38 −0 WIN32/src/tinyxml/docs/classes.html
  70. +49 −0 WIN32/src/tinyxml/docs/deprecated.html
  71. +532 −0 WIN32/src/tinyxml/docs/doxygen.css
  72. BIN WIN32/src/tinyxml/docs/doxygen.png
  73. +36 −0 WIN32/src/tinyxml/docs/files.html
  74. +80 −0 WIN32/src/tinyxml/docs/functions.html
  75. +98 −0 WIN32/src/tinyxml/docs/functions_0x63.html
  76. +71 −0 WIN32/src/tinyxml/docs/functions_0x64.html
  77. +92 −0 WIN32/src/tinyxml/docs/functions_0x65.html
  78. +82 −0 WIN32/src/tinyxml/docs/functions_0x66.html
  79. +77 −0 WIN32/src/tinyxml/docs/functions_0x67.html
  80. +89 −0 WIN32/src/tinyxml/docs/functions_0x69.html
  81. +83 −0 WIN32/src/tinyxml/docs/functions_0x6c.html
  82. +89 −0 WIN32/src/tinyxml/docs/functions_0x6e.html
  83. +74 −0 WIN32/src/tinyxml/docs/functions_0x6f.html
  84. +91 −0 WIN32/src/tinyxml/docs/functions_0x70.html
  85. +95 −0 WIN32/src/tinyxml/docs/functions_0x71.html
  86. +83 −0 WIN32/src/tinyxml/docs/functions_0x72.html
  87. +121 −0 WIN32/src/tinyxml/docs/functions_0x73.html
  88. +127 −0 WIN32/src/tinyxml/docs/functions_0x74.html
  89. +74 −0 WIN32/src/tinyxml/docs/functions_0x75.html
  90. +97 −0 WIN32/src/tinyxml/docs/functions_0x76.html
  91. +48 −0 WIN32/src/tinyxml/docs/functions_enum.html
  92. +79 −0 WIN32/src/tinyxml/docs/functions_func.html
  93. +97 −0 WIN32/src/tinyxml/docs/functions_func_0x63.html
  94. +70 −0 WIN32/src/tinyxml/docs/functions_func_0x64.html
  95. +91 −0 WIN32/src/tinyxml/docs/functions_func_0x65.html
  96. +81 −0 WIN32/src/tinyxml/docs/functions_func_0x66.html
  97. +76 −0 WIN32/src/tinyxml/docs/functions_func_0x67.html
  98. +88 −0 WIN32/src/tinyxml/docs/functions_func_0x69.html
  99. +82 −0 WIN32/src/tinyxml/docs/functions_func_0x6c.html
  100. +85 −0 WIN32/src/tinyxml/docs/functions_func_0x6e.html
  101. +90 −0 WIN32/src/tinyxml/docs/functions_func_0x70.html
  102. +94 −0 WIN32/src/tinyxml/docs/functions_func_0x71.html
  103. +82 −0 WIN32/src/tinyxml/docs/functions_func_0x72.html
  104. +120 −0 WIN32/src/tinyxml/docs/functions_func_0x73.html
  105. +126 −0 WIN32/src/tinyxml/docs/functions_func_0x74.html
  106. +70 −0 WIN32/src/tinyxml/docs/functions_func_0x75.html
  107. +96 −0 WIN32/src/tinyxml/docs/functions_func_0x76.html
  108. +51 −0 WIN32/src/tinyxml/docs/functions_rela.html
  109. +48 −0 WIN32/src/tinyxml/docs/functions_vars.html
  110. +54 −0 WIN32/src/tinyxml/docs/hierarchy.html
  111. +275 −0 WIN32/src/tinyxml/docs/index.html
  112. +31 −0 WIN32/src/tinyxml/docs/pages.html
  113. BIN WIN32/src/tinyxml/docs/tab_b.gif
  114. BIN WIN32/src/tinyxml/docs/tab_l.gif
  115. BIN WIN32/src/tinyxml/docs/tab_r.gif
  116. +105 −0 WIN32/src/tinyxml/docs/tabs.css
  117. +335 −0 WIN32/src/tinyxml/docs/tinystr_8h_source.html
  118. +1,206 −0 WIN32/src/tinyxml/docs/tinyxml_8h_source.html
  119. +720 −0 WIN32/src/tinyxml/docs/tutorial0.html
  120. +530 −0 WIN32/src/tinyxml/readme.txt
  121. +134 −0 WIN32/src/tinyxml/tinyXmlTest.vcxproj
  122. +135 −0 WIN32/src/tinyxml/tinyXmlTestSTL.vcxproj
  123. +111 −0 WIN32/src/tinyxml/tinystr.cpp
  124. +305 −0 WIN32/src/tinyxml/tinystr.h
  125. +1,886 −0 WIN32/src/tinyxml/tinyxml.cpp
  126. +1,805 −0 WIN32/src/tinyxml/tinyxml.h
  127. +38 −0 WIN32/src/tinyxml/tinyxml.sln
  128. +125 −0 WIN32/src/tinyxml/tinyxmlSTL.vcxproj
  129. +126 −0 WIN32/src/tinyxml/tinyxml_lib.vcxproj
  130. +52 −0 WIN32/src/tinyxml/tinyxmlerror.cpp
  131. +1,638 −0 WIN32/src/tinyxml/tinyxmlparser.cpp
  132. BIN WIN32/src/tinyxml/utf8test.gif
  133. +11 −0 WIN32/src/tinyxml/utf8test.xml
  134. +11 −0 WIN32/src/tinyxml/utf8testverify.xml
  135. +1,393 −0 WIN32/src/tinyxml/xmltest.cpp
View
@@ -4,3 +4,7 @@ release_notes.txt
release_notes_template.html.erb
ABP Launcher.xcodeproj/project.xcworkspace/xcuserdata/*
ABP Launcher.xcodeproj/xcuserdata/*
+WIN32/Release
+WIN32/Debug
+WIN32/src/ABPLauncher/Release
+WIN32/src/ABPLauncher/Debug
@@ -0,0 +1,79 @@
+// ABPDownload.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "ABPLauncher.h"
+#include "ABPDownload.h"
+#include "ABPDownloadThread.h"
+
+// ABPDownload dialog
+
+IMPLEMENT_DYNAMIC(ABPDownload, CDialog)
+
+ABPDownload::ABPDownload(CWnd* pParent /*=NULL*/)
+ : CDialog(ABPDownload::IDD, pParent)
+ , m_info(_T(""))
+{
+}
+
+ABPDownload::~ABPDownload()
+{
+}
+
+void ABPDownload::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ DDX_Control(pDX, IDC_PROGRESS1, m_progress);
+ DDX_Text(pDX, IDC_STATIC1, m_info);
+}
+
+
+BEGIN_MESSAGE_MAP(ABPDownload, CDialog)
+ ON_WM_TIMER()
+END_MESSAGE_MAP()
+
+BOOL ABPDownload::OnInitDialog()
+{
+ m_bThreadExited = true;
+ CDialog::OnInitDialog();
+ m_progress.SetRange(0, m_downloadList.size()*100);
+ m_listIndex = 0;
+ SetTimer(0, 10, NULL);
+ return TRUE; // return TRUE unless you set the focus to a control
+}
+
+void ABPDownload::OnTimer(UINT_PTR nIDEvent)
+{
+ KillTimer(0);
+ if (m_bThreadExited)
+ {
+ if (m_listIndex < (int)m_downloadList.size())
+ {
+ CString jar = m_downloadList[m_listIndex++];
+
+ m_pThread = dynamic_cast<ABPDownloadThread *>(AfxBeginThread(RUNTIME_CLASS(ABPDownloadThread), 0, 0, CREATE_SUSPENDED));
+ if (m_pThread)
+ {
+ m_bThreadExited = false;
+ m_pThread->m_bAutoDelete = false;
+ m_pThread->m_pbFinish = &m_bThreadExited;
+ m_pThread->m_url = m_server + jar;
+ m_pThread->m_path = m_basePath + jar;
+ m_pThread->m_downloaded = 0;
+ m_pThread->m_totalSize = 1;
+ m_pThread->ResumeThread();
+ }
+ }
+ else
+ EndDialog(IDOK);
+ }
+ else if (m_pThread!=NULL)
+ {
+ // Display progress
+ float p = ((float)m_pThread->m_downloaded*100/(float)m_pThread->m_totalSize);
+ m_progress.SetPos((int)((m_listIndex-1)*100+p));
+ m_info.Format("%s %.02f%%", m_pThread->m_url.Mid(m_server.GetLength()), p );
+ UpdateData(FALSE);
+ }
+ SetTimer(0, 10, NULL);
+}
@@ -0,0 +1,39 @@
+#pragma once
+#include "afxwin.h"
+#include "afxcmn.h"
+#include "ABPLTools.h"
+#include "ABPDownloadThread.h"
+#include "Resource.h"
+
+// ABPDownload dialog
+
+class ABPDownload : public CDialog
+{
+ DECLARE_DYNAMIC(ABPDownload)
+
+public:
+ ABPDownload(CWnd* pParent = NULL); // standard constructor
+ virtual ~ABPDownload();
+
+// Dialog Data
+ enum { IDD = IDD_ABPDOWNLOAD };
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+
+ DECLARE_MESSAGE_MAP()
+
+ virtual BOOL OnInitDialog();
+public:
+ CString m_info;
+ CProgressCtrl m_progress;
+
+ CString m_basePath; // Where ta save files
+ CString m_server; // Server
+ std::vector<CString> m_downloadList; // jar list
+
+ int m_listIndex;
+ ABPDownloadThread *m_pThread;
+ bool m_bThreadExited;
+ afx_msg void OnTimer(UINT_PTR nIDEvent);
+};
@@ -0,0 +1,51 @@
+// ABPDownloadThread.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "ABPLauncher.h"
+#include "ABPDownloadThread.h"
+
+// ABPDownloadThread
+
+IMPLEMENT_DYNCREATE(ABPDownloadThread, CWinThread)
+
+ABPDownloadThread::ABPDownloadThread()
+{
+}
+
+ABPDownloadThread::~ABPDownloadThread()
+{
+}
+
+BOOL ABPDownloadThread::InitInstance()
+{
+ return TRUE;
+}
+
+int ABPDownloadThread::ExitInstance()
+{
+ return CWinThread::ExitInstance();
+}
+
+BEGIN_MESSAGE_MAP(ABPDownloadThread, CWinThread)
+END_MESSAGE_MAP()
+
+
+void ABPDownloadThread::DownloadFeedback(DWORD totalSize, DWORD downloaded)
+{
+ m_totalSize = totalSize;
+ m_downloaded = downloaded;
+}
+
+int ABPDownloadThread::Run(void)
+{
+ ABPLTools tools;
+ m_path.Replace("/", "\\");
+ int idx = m_path.ReverseFind('\\');
+ if (idx!=-1)
+ tools.CreateDirectory(m_path.Mid(0, idx));
+ m_bExit = false;
+ tools.DownloadFile(m_url, m_path, this, &m_bExit);
+ *m_pbFinish = true;
+ return 0;
+}
@@ -0,0 +1,28 @@
+#pragma once
+#include "ABPLTools.h"
+// ABPDownloadThread
+
+class ABPDownloadThread : public CWinThread, public InternetFeedback
+{
+ DECLARE_DYNCREATE(ABPDownloadThread)
+
+protected:
+ ABPDownloadThread(); // protected constructor used by dynamic creation
+ virtual ~ABPDownloadThread();
+
+public:
+ bool *m_pbFinish; // true when thread exit
+ bool m_bExit; // to exit when user ask
+ DWORD m_totalSize, m_downloaded; // UI feedback
+ CString m_url, m_path; // url to download and destination path
+ virtual void DownloadFeedback(DWORD totalSize, DWORD downloaded);
+ virtual BOOL InitInstance();
+ virtual int ExitInstance();
+
+protected:
+ DECLARE_MESSAGE_MAP()
+public:
+ virtual int Run(void);
+};
+
+
Oops, something went wrong.

0 comments on commit 62f32d7

Please sign in to comment.