ReactOS  0.4.15-dev-5131-g311fcc6
loaddlg.cpp File Reference
#include "rapps.h"
#include <shlobj_undoc.h>
#include <shlguid_undoc.h>
#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <wininet.h>
#include <shellutils.h>
#include <debug.h>
#include <ui/rosctrls.h>
#include <windowsx.h>
#include <process.h>
#include "rosui.h"
#include "dialogs.h"
#include "misc.h"
Include dependency graph for loaddlg.cpp:

Go to the source code of this file.

Classes

struct  DownloadInfo
 
struct  DownloadParam
 
class  CDownloaderProgress
 
class  CDowloadingAppsListView
 
class  CDownloadManager
 

Enumerations

enum  DownloadType { DLTYPE_APPLICATION, DLTYPE_DBUPDATE, DLTYPE_DBUPDATE_UNOFFICIAL }
 
enum  DownloadStatus {
  DLSTATUS_WAITING = IDS_STATUS_WAITING, DLSTATUS_DOWNLOADING = IDS_STATUS_DOWNLOADING, DLSTATUS_WAITING_INSTALL = IDS_STATUS_DOWNLOADED, DLSTATUS_INSTALLING = IDS_STATUS_INSTALLING,
  DLSTATUS_INSTALLED = IDS_STATUS_INSTALLED, DLSTATUS_FINISHED = IDS_STATUS_FINISHED
}
 

Functions

ATL::CStringW LoadStatusString (DownloadStatus StatusParam)
 
VOID MessageBox_LoadString (HWND hMainWnd, INT StringID)
 
BOOL ShowLastError (HWND hWndOwner, BOOL bInetError, DWORD dwLastError)
 
BOOL DownloadListOfApplications (const ATL::CSimpleArray< CAvailableApplicationInfo > &AppsList, BOOL bIsModal)
 
BOOL DownloadApplication (CAvailableApplicationInfo *pAppInfo)
 
VOID DownloadApplicationsDB (LPCWSTR lpUrl, BOOL IsOfficial)
 

Variables

BOOL UrlHasBeenCopied
 

Enumeration Type Documentation

◆ DownloadStatus

Enumerator
DLSTATUS_WAITING 
DLSTATUS_DOWNLOADING 
DLSTATUS_WAITING_INSTALL 
DLSTATUS_INSTALLING 
DLSTATUS_INSTALLED 
DLSTATUS_FINISHED 

Definition at line 66 of file loaddlg.cpp.

◆ DownloadType

Enumerator
DLTYPE_APPLICATION 
DLTYPE_DBUPDATE 
DLTYPE_DBUPDATE_UNOFFICIAL 

Definition at line 59 of file loaddlg.cpp.

Function Documentation

◆ DownloadApplication()

BOOL DownloadApplication ( CAvailableApplicationInfo pAppInfo)

Definition at line 1061 of file loaddlg.cpp.

1062 {
1063  if (!pAppInfo)
1064  return FALSE;
1065 
1066  CDownloadManager::Download(*pAppInfo, FALSE);
1067  return TRUE;
1068 }
static VOID Download(const DownloadInfo &DLInfo, BOOL bIsModal=FALSE)
Definition: loaddlg.cpp:407
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117

Referenced by CMainWindow::InstallApplication(), and CMainWindow::OnCommand().

◆ DownloadApplicationsDB()

VOID DownloadApplicationsDB ( LPCWSTR  lpUrl,
BOOL  IsOfficial 
)

Definition at line 1070 of file loaddlg.cpp.

1071 {
1072  static DownloadInfo DatabaseDLInfo;
1073  DatabaseDLInfo.szUrl = lpUrl;
1074  DatabaseDLInfo.szName.LoadStringW(IDS_DL_DIALOG_DB_DISP);
1075  DatabaseDLInfo.DLType = IsOfficial ? DLTYPE_DBUPDATE : DLTYPE_DBUPDATE_UNOFFICIAL;
1076  CDownloadManager::Download(DatabaseDLInfo, TRUE);
1077 }
#define IDS_DL_DIALOG_DB_DISP
Definition: resource.h:218
static VOID Download(const DownloadInfo &DLInfo, BOOL bIsModal=FALSE)
Definition: loaddlg.cpp:407
#define TRUE
Definition: types.h:120
DownloadType DLType
Definition: loaddlg.cpp:95
ATL::CStringW szUrl
Definition: loaddlg.cpp:96
ATL::CStringW szName
Definition: loaddlg.cpp:97

Referenced by CAvailableApps::UpdateAppsDB().

◆ DownloadListOfApplications()

BOOL DownloadListOfApplications ( const ATL::CSimpleArray< CAvailableApplicationInfo > &  AppsList,
BOOL  bIsModal 
)

Definition at line 1044 of file loaddlg.cpp.

1045 {
1046  if (AppsList.GetSize() == 0)
1047  return FALSE;
1048 
1049  // Initialize shared variables
1050  for (INT i = 0; i < AppsList.GetSize(); ++i)
1051  {
1052  CDownloadManager::Add(AppsList[i]); // implicit conversion to DownloadInfo
1053  }
1054 
1055  // Create a dialog and issue a download process
1057 
1058  return TRUE;
1059 }
#define TRUE
Definition: types.h:120
static VOID LaunchDownloadDialog(BOOL)
Definition: loaddlg.cpp:1023
int GetSize() const
Definition: atlsimpcoll.h:104
int32_t INT
Definition: typedefs.h:58
#define FALSE
Definition: types.h:117
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static VOID Add(DownloadInfo info)
Definition: loaddlg.cpp:402

Referenced by HandleInstallCommand(), HandleSetupCommand(), CMainWindow::InstallApplication(), and CMainWindow::OnCommand().

◆ LoadStatusString()

ATL::CStringW LoadStatusString ( DownloadStatus  StatusParam)

Definition at line 76 of file loaddlg.cpp.

77 {
78  ATL::CStringW szString;
79  szString.LoadStringW(StatusParam);
80  return szString;
81 }

Referenced by CDowloadingAppsListView::AddRow(), CDowloadingAppsListView::SetDownloadStatus(), and CDownloadManager::ThreadFunc().

◆ MessageBox_LoadString()

VOID MessageBox_LoadString ( HWND  hMainWnd,
INT  StringID 
)
inline

Definition at line 368 of file loaddlg.cpp.

369 {
370  ATL::CStringW szMsgText;
371  if (szMsgText.LoadStringW(StringID))
372  {
374  }
375 }
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
PCXSTR GetString() const
Definition: atlsimpstr.h:361
HWND hMainWnd
Definition: magnifier.c:32
#define MB_ICONERROR
Definition: winuser.h:781
#define NULL
Definition: types.h:112
#define MB_OK
Definition: winuser.h:784

Referenced by CDownloadManager::ThreadFunc().

◆ ShowLastError()

BOOL ShowLastError ( HWND  hWndOwner,
BOOL  bInetError,
DWORD  dwLastError 
)

Definition at line 554 of file loaddlg.cpp.

558 {
559  CLocalPtr<WCHAR> lpMsg;
560 
564  (bInetError ? GetModuleHandleW(L"wininet.dll") : NULL),
565  dwLastError,
567  (LPWSTR)&lpMsg,
568  0, NULL))
569  {
570  DPRINT1("FormatMessageW unexpected failure (err %d)\n", GetLastError());
571  return FALSE;
572  }
573 
574  MessageBoxW(hWndOwner, lpMsg, NULL, MB_OK | MB_ICONERROR);
575  return TRUE;
576 }
#define TRUE
Definition: types.h:120
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define L(x)
Definition: ntvdm.h:50
#define FALSE
Definition: types.h:117
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:416
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:420
#define FORMAT_MESSAGE_FROM_HMODULE
Definition: winbase.h:419
#define MB_ICONERROR
Definition: winuser.h:781
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:417
#define NULL
Definition: types.h:112
#define MB_OK
Definition: winuser.h:784
#define DPRINT1
Definition: precomp.h:8
Definition: misc.h:45
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define LANG_USER_DEFAULT
Definition: tnerror.cpp:50

Referenced by CDownloadManager::ThreadFunc().

Variable Documentation

◆ UrlHasBeenCopied

BOOL UrlHasBeenCopied

Definition at line 514 of file loaddlg.cpp.

Referenced by CDownloadManager::ThreadFunc(), and CDownloadManager::UpdateProgress().