Created
August 28, 2017 15:24
-
-
Save sanchaez/19b09d41389bee02d935754e73d3a66d to your computer and use it in GitHub Desktop.
Unified Diff for RAPPS ReactOS GSoC 2017 Project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: base/applications/rapps/rapps.h | |
=================================================================== | |
--- base/applications/rapps/rapps.h (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/rapps.h (.../branches/GSoC_2017/rapps/reactos) (nonexistent) | |
@@ -1,200 +0,0 @@ | |
-#ifndef _RAPPS_H | |
-#define _RAPPS_H | |
- | |
-#include <tchar.h> | |
-#include <stdarg.h> | |
- | |
-#define WIN32_NO_STATUS | |
-#define _INC_WINDOWS | |
-#define COM_NO_WINDOWS_H | |
-#define COBJMACROS | |
- | |
-#include <windef.h> | |
-#include <winbase.h> | |
-#include <winreg.h> | |
-#include <wingdi.h> | |
-#include <winnls.h> | |
-#include <winuser.h> | |
-#include <wincon.h> | |
-#include <richedit.h> | |
-#include <shellapi.h> | |
-#include <shlobj.h> | |
-#include <shlwapi.h> | |
-#include <stdio.h> | |
-#include <strsafe.h> | |
-#include <ndk/rtlfuncs.h> | |
- | |
-#include <rappsmsg.h> | |
- | |
-#include "resource.h" | |
- | |
-#ifdef USE_CERT_PINNING | |
- #define CERT_ISSUER_INFO "BE\r\nGlobalSign nv-sa\r\nGlobalSign Domain Validation CA - SHA256 - G2" | |
- #define CERT_SUBJECT_INFO "Domain Control Validated\r\n*.reactos.org" | |
-#endif | |
- | |
-#define APPLICATION_DATABASE_URL L"https://svn.reactos.org/packages/rappmgr.cab" | |
- | |
-#define SPLIT_WIDTH 4 | |
-#define MAX_STR_LEN 256 | |
- | |
-#define LISTVIEW_ICON_SIZE 24 | |
-#define TREEVIEW_ICON_SIZE 24 | |
- | |
-/* EnumType flags for EnumInstalledApplications */ | |
-#define ENUM_ALL_COMPONENTS 30 | |
-#define ENUM_APPLICATIONS 31 | |
-#define ENUM_UPDATES 32 | |
-/* EnumType flags for EnumAvailableApplications */ | |
-#define ENUM_ALL_AVAILABLE 0 | |
-#define ENUM_CAT_AUDIO 1 | |
-#define ENUM_CAT_VIDEO 2 | |
-#define ENUM_CAT_GRAPHICS 3 | |
-#define ENUM_CAT_GAMES 4 | |
-#define ENUM_CAT_INTERNET 5 | |
-#define ENUM_CAT_OFFICE 6 | |
-#define ENUM_CAT_DEVEL 7 | |
-#define ENUM_CAT_EDU 8 | |
-#define ENUM_CAT_ENGINEER 9 | |
-#define ENUM_CAT_FINANCE 10 | |
-#define ENUM_CAT_SCIENCE 11 | |
-#define ENUM_CAT_TOOLS 12 | |
-#define ENUM_CAT_DRIVERS 13 | |
-#define ENUM_CAT_LIBS 14 | |
-#define ENUM_CAT_OTHER 15 | |
- | |
-#define ENUM_INSTALLED_MIN ENUM_ALL_COMPONENTS | |
-#define ENUM_INSTALLED_MAX ENUM_UPDATES | |
-#define ENUM_AVAILABLE_MIN ENUM_ALL_AVAILABLE | |
-#define ENUM_AVAILABLE_MAX ENUM_CAT_OTHER | |
- | |
-#define IS_INSTALLED_ENUM(a) (a >= ENUM_INSTALLED_MIN && a <= ENUM_INSTALLED_MAX) | |
-#define IS_AVAILABLE_ENUM(a) (a >= ENUM_AVAILABLE_MIN && a <= ENUM_AVAILABLE_MAX) | |
- | |
-/* aboutdlg.c */ | |
-VOID ShowAboutDialog(VOID); | |
- | |
-/* available.c */ | |
-typedef struct | |
-{ | |
- INT Category; | |
- WCHAR szName[MAX_PATH]; | |
- WCHAR szRegName[MAX_PATH]; | |
- WCHAR szVersion[MAX_PATH]; | |
- WCHAR szLicense[MAX_PATH]; | |
- WCHAR szDesc[MAX_PATH]; | |
- WCHAR szSize[MAX_PATH]; | |
- WCHAR szUrlSite[MAX_PATH]; | |
- WCHAR szUrlDownload[MAX_PATH]; | |
- WCHAR szCDPath[MAX_PATH]; | |
- | |
- /* caching mechanism related entries */ | |
- WCHAR cFileName[MAX_PATH]; | |
- FILETIME ftCacheStamp; | |
- LIST_ENTRY List; | |
- | |
- /* optional integrity checks (SHA-1 digests are 160 bit = 40 characters in hex string form) */ | |
- WCHAR szSHA1[40 + 1]; | |
- | |
-} APPLICATION_INFO, *PAPPLICATION_INFO; | |
- | |
-typedef struct | |
-{ | |
- HKEY hRootKey; | |
- HKEY hSubKey; | |
- WCHAR szKeyName[MAX_PATH]; | |
- | |
-} INSTALLED_INFO, *PINSTALLED_INFO; | |
- | |
-typedef struct | |
-{ | |
- BOOL bSaveWndPos; | |
- BOOL bUpdateAtStart; | |
- BOOL bLogEnabled; | |
- WCHAR szDownloadDir[MAX_PATH]; | |
- BOOL bDelInstaller; | |
- /* Window Pos */ | |
- BOOL Maximized; | |
- INT Left; | |
- INT Top; | |
- INT Width; | |
- INT Height; | |
- /* Proxy settings */ | |
- INT Proxy; | |
- WCHAR szProxyServer[MAX_PATH]; | |
- WCHAR szNoProxyFor[MAX_PATH]; | |
- | |
-} SETTINGS_INFO, *PSETTINGS_INFO; | |
- | |
-/* available.c */ | |
-typedef BOOL (CALLBACK *AVAILENUMPROC)(PAPPLICATION_INFO Info); | |
-BOOL EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc); | |
-BOOL ShowAvailableAppInfo(INT Index); | |
-BOOL UpdateAppsDB(VOID); | |
-VOID FreeCachedAvailableEntries(VOID); | |
- | |
-/* installdlg.c */ | |
-BOOL InstallApplication(INT Index); | |
- | |
-/* installed.c */ | |
-typedef BOOL (CALLBACK *APPENUMPROC)(INT ItemIndex, LPWSTR lpName, PINSTALLED_INFO Info); | |
-BOOL EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc); | |
-BOOL GetApplicationString(HKEY hKey, LPCWSTR lpKeyName, LPWSTR lpString); | |
-BOOL ShowInstalledAppInfo(INT Index); | |
-BOOL UninstallApplication(INT Index, BOOL bModify); | |
-BOOL IsInstalledApplication(LPWSTR lpRegName, BOOL IsUserKey); | |
-VOID RemoveAppFromRegistry(INT Index); | |
- | |
-/* winmain.c */ | |
-extern HWND hMainWnd; | |
-extern HINSTANCE hInst; | |
-extern INT SelectedEnumType; | |
-extern SETTINGS_INFO SettingsInfo; | |
-VOID SaveSettings(HWND hwnd); | |
-VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo); | |
- | |
-/* loaddlg.c */ | |
-BOOL DownloadApplication(INT Index); | |
-VOID DownloadApplicationsDB(LPCWSTR lpUrl); | |
- | |
-/* misc.c */ | |
-INT GetSystemColorDepth(VOID); | |
-int GetWindowWidth(HWND hwnd); | |
-int GetWindowHeight(HWND hwnd); | |
-int GetClientWindowWidth(HWND hwnd); | |
-int GetClientWindowHeight(HWND hwnd); | |
-VOID CopyTextToClipboard(LPCWSTR lpszText); | |
-VOID SetWelcomeText(VOID); | |
-VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem); | |
-BOOL StartProcess(LPWSTR lpPath, BOOL Wait); | |
-BOOL GetStorageDirectory(PWCHAR lpDirectory, DWORD cch); | |
-BOOL ExtractFilesFromCab(LPWSTR lpCabName, LPWSTR lpOutputPath); | |
-VOID InitLogs(VOID); | |
-VOID FreeLogs(VOID); | |
-BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPWSTR lpMsg); | |
- | |
-UINT ParserGetString(LPCWSTR lpKeyName, LPWSTR lpReturnedString, UINT nSize, LPCWSTR lpFileName); | |
-UINT ParserGetInt(LPCWSTR lpKeyName, LPCWSTR lpFileName); | |
- | |
-/* settingsdlg.c */ | |
-VOID CreateSettingsDlg(HWND hwnd); | |
- | |
-/* gui.cpp */ | |
-HWND CreateMainWindow(); | |
-DWORD_PTR ListViewGetlParam(INT item); | |
-INT ListViewAddItem(INT ItemIndex, INT IconIndex, PWSTR lpName, LPARAM lParam); | |
-VOID SetStatusBarText(PCWSTR szText); | |
-VOID NewRichEditText(PCWSTR szText, DWORD flags); | |
-VOID InsertRichEditText(PCWSTR szText, DWORD flags); | |
-extern HWND hListView; | |
-extern WCHAR szSearchPattern[MAX_STR_LEN]; | |
- | |
-/* integrity.cpp */ | |
-BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName); | |
- | |
-//extern HWND hTreeView; | |
-//BOOL CreateTreeView(HWND hwnd); | |
-//HTREEITEM TreeViewAddItem(HTREEITEM hParent, LPWSTR lpText, INT Image, INT SelectedImage, LPARAM lParam); | |
- | |
- | |
-#endif /* _RAPPS_H */ | |
Property changes on: base/applications/rapps/rapps.h | |
___________________________________________________________________ | |
Deleted: svn:eol-style | |
## -1 +0,0 ## | |
-native | |
\ No newline at end of property | |
Index: base/applications/rapps/resource.h | |
=================================================================== | |
--- base/applications/rapps/resource.h (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/resource.h (.../branches/GSoC_2017/rapps/reactos) (nonexistent) | |
@@ -1,171 +0,0 @@ | |
-#pragma once | |
- | |
-/* Icons */ | |
-#define IDI_MAIN 10 | |
-#define IDI_EXIT 11 | |
-#define IDI_INSTALL 12 | |
-#define IDI_UNINSTALL 13 | |
-#define IDI_SETTINGS 14 | |
-#define IDI_MODIFY 15 | |
-#define IDI_REFRESH 16 | |
-#define IDI_APPS 17 | |
-#define IDI_APPUPD 18 | |
-#define IDI_CATEGORY 19 | |
-#define IDI_UPDATE_DB 20 | |
- | |
-/* Icons for categories */ | |
-#define IDI_CAT_AUDIO 50 | |
-#define IDI_CAT_DEVEL 51 | |
-#define IDI_CAT_DRIVERS 52 | |
-#define IDI_CAT_EDU 53 | |
-#define IDI_CAT_ENGINEER 54 | |
-#define IDI_CAT_FINANCE 55 | |
-#define IDI_CAT_GAMES 56 | |
-#define IDI_CAT_GRAPHICS 57 | |
-#define IDI_CAT_INTERNET 58 | |
-#define IDI_CAT_LIBS 59 | |
-#define IDI_CAT_OFFICE 60 | |
-#define IDI_CAT_OTHER 61 | |
-#define IDI_CAT_SCIENCE 62 | |
-#define IDI_CAT_TOOLS 63 | |
-#define IDI_CAT_VIDEO 64 | |
- | |
-/* Bitmaps */ | |
- | |
-/* Controls */ | |
-#define IDC_STATUSBAR 1000 | |
-#define IDC_DOWNLOAD_PROGRESS 1001 | |
-#define IDC_DOWNLOAD_STATUS 1002 | |
-#define IDC_SAVE_WINDOW_POS 1003 | |
-#define IDC_UPDATE_AVLIST 1004 | |
-#define IDC_DOWNLOAD_DIR_EDIT 1005 | |
-#define IDC_DEL_AFTER_INSTALL 1006 | |
-#define IDC_LOG_ENABLED 1007 | |
-#define IDC_CHOOSE 1008 | |
-#define IDC_DEFAULT_SETTINGS 1009 | |
-#define IDC_INSTALL_TEXT 1010 | |
-#define IDC_CD_INSTALL 1011 | |
-#define IDC_DOWNLOAD_INSTALL 1012 | |
-#define IDC_PROXY_DEFAULT 1013 | |
-#define IDC_NO_PROXY 1014 | |
-#define IDC_USE_PROXY 1015 | |
-#define IDC_PROXY_SERVER 1016 | |
-#define IDC_NO_PROXY_FOR 1017 | |
- | |
-/* Dialogs */ | |
-#define IDD_SETTINGS_DIALOG 300 | |
-#define IDD_INSTALL_DIALOG 301 | |
-#define IDD_DOWNLOAD_DIALOG 302 | |
-#define IDD_ABOUT_DIALOG 303 | |
- | |
-/* Menus */ | |
-#define IDR_MAINMENU 500 | |
-#define IDR_LINKMENU 501 | |
-#define IDR_APPLICATIONMENU 502 | |
- | |
-/* Menu items */ | |
-#define ID_EXIT 550 | |
-#define ID_INSTALL 551 | |
-#define ID_UNINSTALL 552 | |
-#define ID_HELP 553 | |
-#define ID_ABOUT 554 | |
-#define ID_MODIFY 555 | |
-#define ID_OPEN_LINK 556 | |
-#define ID_COPY_LINK 557 | |
-#define ID_SETTINGS 558 | |
-#define ID_REFRESH 559 | |
-#define ID_REGREMOVE 560 | |
-#define ID_RESETDB 561 | |
- | |
-/* Strings */ | |
-#define IDS_APPTITLE 100 | |
-#define IDS_SEARCH_TEXT 101 | |
-#define IDS_INSTALL 102 | |
-#define IDS_UNINSTALL 103 | |
-#define IDS_MODIFY 104 | |
-#define IDS_APPS_COUNT 105 | |
-#define IDS_WELCOME_TITLE 106 | |
-#define IDS_WELCOME_TEXT 107 | |
-#define IDS_WELCOME_URL 108 | |
-#define IDS_INSTALLED 109 | |
-#define IDS_AVAILABLEFORINST 110 | |
-#define IDS_UPDATES 111 | |
-#define IDS_APPLICATIONS 112 | |
-#define IDS_CHOOSE_FOLDER_TEXT 113 | |
-#define IDS_CHOOSE_FOLDER_ERROR 114 | |
-#define IDS_APP_REG_REMOVE 116 | |
-#define IDS_INFORMATION 117 | |
-#define IDS_UNABLE_TO_REMOVE 118 | |
-#define IDS_UNABLE_TO_DOWNLOAD 119 | |
-#define IDS_UNABLE_TO_DOWNLOAD2 120 | |
-#define IDS_CERT_DOES_NOT_MATCH 121 | |
-#define IDS_INTEG_CHECK_TITLE 122 | |
-#define IDS_INTEG_CHECK_FAIL 123 | |
-#define IDS_INTERRUPTED_DOWNLOAD 124 | |
-#define IDS_UNABLE_TO_WRITE 125 | |
- | |
-/* Tooltips */ | |
-#define IDS_TOOLTIP_INSTALL 200 | |
-#define IDS_TOOLTIP_UNINSTALL 201 | |
-#define IDS_TOOLTIP_MODIFY 202 | |
-#define IDS_TOOLTIP_SETTINGS 203 | |
-#define IDS_TOOLTIP_REFRESH 204 | |
-#define IDS_TOOLTIP_EXIT 205 | |
-#define IDS_TOOLTIP_UPDATE_DB 206 | |
- | |
-/* Columns info */ | |
-#define IDS_APP_NAME 250 | |
-#define IDS_APP_INST_VERSION 251 | |
-#define IDS_APP_DESCRIPTION 252 | |
- | |
-/* Apps info */ | |
-#define IDS_INFO_VERSION 280 | |
-#define IDS_INFO_DESCRIPTION 281 | |
-#define IDS_INFO_PUBLISHER 282 | |
-#define IDS_INFO_HELPLINK 283 | |
-#define IDS_INFO_HELPPHONE 284 | |
-#define IDS_INFO_README 285 | |
-#define IDS_INFO_REGOWNER 286 | |
-#define IDS_INFO_PRODUCTID 287 | |
-#define IDS_INFO_CONTACT 288 | |
-#define IDS_INFO_UPDATEINFO 289 | |
-#define IDS_INFO_INFOABOUT 290 | |
-#define IDS_INFO_COMMENTS 291 | |
-#define IDS_INFO_INSTLOCATION 292 | |
-#define IDS_INFO_INSTALLSRC 293 | |
-#define IDS_INFO_UNINSTALLSTR 294 | |
-#define IDS_INFO_MODIFYPATH 295 | |
-#define IDS_INFO_INSTALLDATE 296 | |
- | |
-/* Info for available apps */ | |
-#define IDS_AINFO_VERSION 350 | |
-#define IDS_AINFO_DESCRIPTION 351 | |
-#define IDS_AINFO_SIZE 352 | |
-#define IDS_AINFO_URLSITE 353 | |
-#define IDS_AINFO_LICENSE 354 | |
-#define IDS_AINFO_URLDOWNLOAD 355 | |
- | |
-/* Names of categories */ | |
-#define IDS_CAT_AUDIO 700 | |
-#define IDS_CAT_DEVEL 701 | |
-#define IDS_CAT_DRIVERS 702 | |
-#define IDS_CAT_EDU 703 | |
-#define IDS_CAT_ENGINEER 704 | |
-#define IDS_CAT_FINANCE 705 | |
-#define IDS_CAT_GAMES 706 | |
-#define IDS_CAT_GRAPHICS 707 | |
-#define IDS_CAT_INTERNET 708 | |
-#define IDS_CAT_LIBS 709 | |
-#define IDS_CAT_OFFICE 710 | |
-#define IDS_CAT_OTHER 711 | |
-#define IDS_CAT_SCIENCE 712 | |
-#define IDS_CAT_TOOLS 713 | |
-#define IDS_CAT_VIDEO 714 | |
- | |
-/* Accelerators */ | |
-#define HOTKEYS 715 | |
- | |
-/* Other */ | |
-#ifndef IDC_STATIC | |
-#define IDC_STATIC -1 | |
-#endif | |
Property changes on: base/applications/rapps/resource.h | |
___________________________________________________________________ | |
Deleted: svn:eol-style | |
## -1 +0,0 ## | |
-native | |
\ No newline at end of property | |
Index: base/applications/rapps/crichedit.h | |
=================================================================== | |
--- base/applications/rapps/crichedit.h (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/crichedit.h (.../branches/GSoC_2017/rapps/reactos) (nonexistent) | |
@@ -1,98 +0,0 @@ | |
-#pragma once | |
- | |
-class CRichEdit : | |
- public CWindow | |
-{ | |
-public: | |
- VOID SetRangeFormatting(LONG Start, LONG End, DWORD dwEffects) | |
- { | |
- CHARFORMAT2 CharFormat; | |
- | |
- SendMessageW(EM_SETSEL, Start, End); | |
- | |
- ZeroMemory(&CharFormat, sizeof(CharFormat)); | |
- | |
- CharFormat.cbSize = sizeof(CharFormat); | |
- CharFormat.dwMask = dwEffects; | |
- CharFormat.dwEffects = dwEffects; | |
- | |
- SendMessageW(EM_SETCHARFORMAT, SCF_WORD | SCF_SELECTION, (LPARAM) &CharFormat); | |
- | |
- SendMessageW(EM_SETSEL, End, End + 1); | |
- } | |
- | |
- LONG GetTextLen(VOID) | |
- { | |
- GETTEXTLENGTHEX TxtLenStruct; | |
- | |
- TxtLenStruct.flags = GTL_NUMCHARS; | |
- TxtLenStruct.codepage = 1200; | |
- | |
- return (LONG) SendMessageW(EM_GETTEXTLENGTHEX, (WPARAM) &TxtLenStruct, 0); | |
- } | |
- | |
- /* | |
- * Insert text (without cleaning old text) | |
- * Supported effects: | |
- * - CFM_BOLD | |
- * - CFM_ITALIC | |
- * - CFM_UNDERLINE | |
- * - CFM_LINK | |
- */ | |
- VOID InsertText(LPCWSTR lpszText, DWORD dwEffects) | |
- { | |
- SETTEXTEX SetText; | |
- LONG Len = GetTextLen(); | |
- | |
- /* Insert new text */ | |
- SetText.flags = ST_SELECTION; | |
- SetText.codepage = 1200; | |
- | |
- SendMessageW(EM_SETTEXTEX, (WPARAM) &SetText, (LPARAM) lpszText); | |
- | |
- SetRangeFormatting(Len, Len + wcslen(lpszText), | |
- (dwEffects == CFM_LINK) ? (PathIsURLW(lpszText) ? dwEffects : 0) : dwEffects); | |
- } | |
- | |
- /* | |
- * Clear old text and add new | |
- */ | |
- VOID SetText(LPCWSTR lpszText, DWORD dwEffects) | |
- { | |
- SetWindowTextW(L""); | |
- InsertText(lpszText, dwEffects); | |
- } | |
- | |
- HWND Create(HWND hwndParent) | |
- { | |
- // TODO: FreeLibrary when the window is destroyed | |
- LoadLibraryW(L"riched20.dll"); | |
- | |
- m_hWnd = CreateWindowExW(0, | |
- L"RichEdit20W", | |
- NULL, | |
- WS_CHILD | WS_VISIBLE | ES_MULTILINE | | |
- ES_LEFT | ES_READONLY, | |
- 205, 28, 465, 100, | |
- hwndParent, | |
- NULL, | |
- _AtlBaseModule.GetModuleInstance(), | |
- NULL); | |
- | |
- if (m_hWnd) | |
- { | |
- SendMessageW(EM_SETBKGNDCOLOR, 0, GetSysColor(COLOR_BTNFACE)); | |
- SendMessageW(WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
- SendMessageW(EM_SETEVENTMASK, 0, ENM_LINK | ENM_MOUSEEVENTS); | |
- SendMessageW(EM_SHOWSCROLLBAR, SB_VERT, TRUE); | |
- } | |
- | |
- return m_hWnd; | |
- } | |
- | |
-public: | |
- virtual VOID OnLink(ENLINK *Link) | |
- { | |
- } | |
- | |
-}; | |
Property changes on: base/applications/rapps/crichedit.h | |
___________________________________________________________________ | |
Deleted: svn:eol-style | |
## -1 +0,0 ## | |
-native | |
\ No newline at end of property | |
Index: base/applications/rapps/rosui.h | |
=================================================================== | |
--- base/applications/rapps/rosui.h (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/rosui.h (.../branches/GSoC_2017/rapps/reactos) (nonexistent) | |
@@ -1,796 +0,0 @@ | |
-/* PROJECT: ReactOS UI Layout Engine | |
- * LICENSE: GPL - See COPYING in the top level directory | |
- * AUTHORS: David Quintana <gigaherz@gmail.com> | |
- */ | |
-#pragma once | |
- | |
-template<class T, int GrowthRate = 10> | |
-class CPointerArray | |
-{ | |
-protected: | |
- HDPA m_hDpa; | |
- | |
-public: | |
- CPointerArray() | |
- { | |
- m_hDpa = DPA_Create(GrowthRate); | |
- } | |
- | |
- ~CPointerArray() | |
- { | |
- DPA_DestroyCallback(m_hDpa, s_OnRemoveItem, this); | |
- } | |
- | |
-private: | |
- static int CALLBACK s_OnRemoveItem(void * ptr, void * context) | |
- { | |
- CPointerArray * self = (CPointerArray*) context; | |
- return (int) self->OnRemoveItem(reinterpret_cast<T*>(ptr)); | |
- } | |
- | |
- static int CALLBACK s_OnCompareItems(void *p1, void *p2, LPARAM lParam) | |
- { | |
- CPointerArray * self = (CPointerArray*) lParam; | |
- return self->OnCompareItems(reinterpret_cast<T*>(p1), reinterpret_cast<T*>(p2)); | |
- } | |
- | |
-public: | |
- virtual BOOL OnRemoveItem(T * ptr) | |
- { | |
- return TRUE; | |
- } | |
- | |
- virtual int OnCompareItems(T * p1, T * p2) | |
- { | |
- int t = (reinterpret_cast<int>(p2) -reinterpret_cast<int>(p1)); | |
- if (t > 0) | |
- return 1; | |
- if (t < 0) | |
- return -1; | |
- return 0; | |
- } | |
- | |
-public: | |
- int GetCount() const | |
- { | |
- return DPA_GetPtrCount(m_hDpa); | |
- } | |
- | |
- T* Get(int i) const | |
- { | |
- return (T*) DPA_GetPtr(m_hDpa, i); | |
- } | |
- | |
- BOOL Set(int i, T* ptr) | |
- { | |
- return DPA_SetPtr(m_hDpa, i, ptr); | |
- } | |
- | |
- int Insert(int at, T* ptr) | |
- { | |
- return DPA_InsertPtr(m_hDpa, at, ptr); | |
- } | |
- | |
- int Append(T* ptr) | |
- { | |
- return DPA_InsertPtr(m_hDpa, DA_LAST, ptr); | |
- } | |
- | |
- int IndexOf(T* ptr) const | |
- { | |
- return DPA_GetPtrIndex(m_hDpa, ptr); | |
- } | |
- | |
- BOOL Remove(T* ptr) | |
- { | |
- int i = IndexOf(ptr); | |
- if (i < 0) | |
- return FALSE; | |
- return RemoveAt(i); | |
- } | |
- | |
- BOOL RemoveAt(int i) | |
- { | |
- T* ptr = (T*) DPA_GetPtr(m_hDpa, i); | |
- OnRemoveItem(ptr); | |
- return DPA_DeletePtr(m_hDpa, i); | |
- } | |
- | |
- BOOL Clear() | |
- { | |
- DPA_EnumCallback(s_OnRemoveItem, this); | |
- return DPA_DeleteAllPtrs(m_hDpa); | |
- } | |
- | |
- BOOL Sort() | |
- { | |
- return DPA_Sort(m_hDpa, s_OnCompareItems, (LPARAM)this); | |
- } | |
- | |
- int Search(T* item, int iStart, UINT uFlags) | |
- { | |
- return DPA_Search(m_hDpa, s_OnCompareItems, (LPARAM)this); | |
- } | |
-}; | |
- | |
-class CUiRect | |
- : public RECT | |
-{ | |
-public: | |
- CUiRect() | |
- { | |
- left = right = top = bottom = 0; | |
- } | |
- | |
- CUiRect(int l, int t, int r, int b) | |
- { | |
- left = l; | |
- right = r; | |
- top = t; | |
- bottom = b; | |
- } | |
-}; | |
- | |
-class CUiMargin | |
- : public CUiRect | |
-{ | |
-public: | |
- CUiMargin() | |
- { | |
- } | |
- | |
- CUiMargin(int all) | |
- : CUiRect(all, all, all, all) | |
- { | |
- } | |
- | |
- CUiMargin(int horz, int vert) | |
- : CUiRect(horz, vert, horz, vert) | |
- { | |
- } | |
-}; | |
- | |
-class CUiMeasure | |
-{ | |
-public: | |
- enum MeasureType | |
- { | |
- Type_FitContent = 0, | |
- Type_Fixed = 1, | |
- Type_Percent = 2, | |
- Type_FitParent = 3 | |
- }; | |
- | |
-private: | |
- MeasureType m_Type; | |
- int m_Value; | |
- | |
-public: | |
- CUiMeasure() | |
- { | |
- m_Type = Type_FitContent; | |
- m_Value = 0; | |
- } | |
- | |
- CUiMeasure(MeasureType type, int value) | |
- { | |
- m_Type = type; | |
- m_Value = value; | |
- } | |
- | |
- int ComputeMeasure(int parent, int content) | |
- { | |
- switch (m_Type) | |
- { | |
- case Type_FitContent: | |
- return content; | |
- case Type_Fixed: | |
- return m_Value; | |
- case Type_Percent: | |
- return max(content, parent * m_Value / 100); | |
- case Type_FitParent: | |
- return parent; | |
- } | |
- | |
- return 0; | |
- } | |
- | |
-public: | |
- static CUiMeasure FitContent() | |
- { | |
- return CUiMeasure(Type_FitContent, 0); | |
- } | |
- | |
- static CUiMeasure FitParent() | |
- { | |
- return CUiMeasure(Type_FitParent, 0); | |
- } | |
- | |
- static CUiMeasure Fixed(int pixels) | |
- { | |
- return CUiMeasure(Type_Fixed, pixels); | |
- } | |
- | |
- static CUiMeasure Percent(int percent) | |
- { | |
- return CUiMeasure(Type_Percent, percent); | |
- } | |
-}; | |
- | |
-enum CUiAlignment | |
-{ | |
- UiAlign_LeftTop, | |
- UiAlign_Middle, | |
- UiAlign_RightBtm, | |
- UiAlign_Stretch | |
-}; | |
- | |
-class CUiBox | |
-{ | |
-public: | |
- CUiMargin m_Margin; | |
- | |
- CUiAlignment m_HorizontalAlignment; | |
- CUiAlignment m_VerticalAlignment; | |
- | |
-protected: | |
- CUiBox() | |
- { | |
- m_HorizontalAlignment = UiAlign_LeftTop; | |
- m_VerticalAlignment = UiAlign_LeftTop; | |
- } | |
- | |
- virtual void ComputeRect(RECT parentRect, RECT currentRect, RECT* newRect) | |
- { | |
- parentRect.left += m_Margin.left; | |
- parentRect.right -= m_Margin.right; | |
- parentRect.top += m_Margin.top; | |
- parentRect.bottom -= m_Margin.bottom; | |
- | |
- if (parentRect.right < parentRect.left) | |
- parentRect.right = parentRect.left; | |
- | |
- if (parentRect.bottom < parentRect.top) | |
- parentRect.bottom = parentRect.top; | |
- | |
- SIZE szParent = { parentRect.right - parentRect.left, parentRect.bottom - parentRect.top }; | |
- SIZE szCurrent = { currentRect.right - currentRect.left, currentRect.bottom - currentRect.top }; | |
- | |
- currentRect = parentRect; | |
- | |
- switch (m_HorizontalAlignment) | |
- { | |
- case UiAlign_LeftTop: | |
- currentRect.right = currentRect.left + szCurrent.cx; | |
- break; | |
- case UiAlign_Middle: | |
- currentRect.left = parentRect.left + (szParent.cx - szCurrent.cx) / 2; | |
- currentRect.right = currentRect.left + szCurrent.cx; | |
- break; | |
- case UiAlign_RightBtm: | |
- currentRect.left = currentRect.right - szCurrent.cx; | |
- break; | |
- default: | |
- break; | |
- } | |
- | |
- switch (m_VerticalAlignment) | |
- { | |
- case UiAlign_LeftTop: | |
- currentRect.bottom = currentRect.top + szCurrent.cy; | |
- break; | |
- case UiAlign_Middle: | |
- currentRect.top = parentRect.top + (szParent.cy - szCurrent.cy) / 2; | |
- currentRect.bottom = currentRect.top + szCurrent.cy; | |
- break; | |
- case UiAlign_RightBtm: | |
- currentRect.top = currentRect.bottom - szCurrent.cy; | |
- break; | |
- default: | |
- break; | |
- } | |
- | |
- *newRect = currentRect; | |
- } | |
- | |
- | |
-public: | |
- virtual void ComputeMinimalSize(SIZE* size) | |
- { | |
- // Override in subclass | |
- size->cx = max(size->cx, 0); | |
- size->cy = min(size->cy, 0); | |
- }; | |
- | |
- virtual void ComputeContentBounds(RECT* rect) | |
- { | |
- // Override in subclass | |
- }; | |
- | |
- virtual DWORD_PTR CountSizableChildren() | |
- { | |
- // Override in subclass | |
- return 0; | |
- }; | |
- | |
- virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp) | |
- { | |
- // Override in subclass | |
- return NULL; | |
- }; | |
-}; | |
- | |
-class CUiPrimitive | |
-{ | |
-protected: | |
- CUiPrimitive * m_Parent; | |
- | |
-public: | |
- virtual ~CUiPrimitive() {} | |
- | |
- virtual CUiBox * AsBox() { return NULL; } | |
-}; | |
- | |
-class CUiCollection : | |
- public CPointerArray < CUiPrimitive > | |
-{ | |
- virtual BOOL OnRemoveItem(CUiPrimitive * ptr) | |
- { | |
- delete ptr; | |
- return TRUE; | |
- } | |
-}; | |
- | |
-class CUiContainer | |
-{ | |
-protected: | |
- CUiCollection m_Children; | |
- | |
-public: | |
- CUiCollection& Children() { return m_Children; } | |
-}; | |
- | |
-class CUiPanel : | |
- public CUiPrimitive, | |
- public CUiBox, | |
- public CUiContainer | |
-{ | |
-public: | |
- CUiMeasure m_Width; | |
- CUiMeasure m_Height; | |
- | |
- CUiPanel() | |
- { | |
- m_Width = CUiMeasure::FitParent(); | |
- m_Height = CUiMeasure::FitParent(); | |
- } | |
- | |
- virtual ~CUiPanel() | |
- { | |
- } | |
- | |
- virtual CUiBox * AsBox() { return this; } | |
- | |
- virtual void ComputeMinimalSize(SIZE* size) | |
- { | |
- for (int i = 0; i < m_Children.GetCount(); i++) | |
- { | |
- CUiBox * box = m_Children.Get(i)->AsBox(); | |
- if (box) | |
- { | |
- box->ComputeMinimalSize(size); | |
- } | |
- } | |
- }; | |
- | |
- virtual void ComputeContentBounds(RECT* rect) | |
- { | |
- for (int i = 0; i < m_Children.GetCount(); i++) | |
- { | |
- CUiBox * box = m_Children.Get(i)->AsBox(); | |
- if (box) | |
- { | |
- box->ComputeContentBounds(rect); | |
- } | |
- } | |
- }; | |
- | |
- virtual DWORD_PTR CountSizableChildren() | |
- { | |
- int count = 0; | |
- for (int i = 0; i < m_Children.GetCount(); i++) | |
- { | |
- CUiBox * box = m_Children.Get(i)->AsBox(); | |
- if (box) | |
- { | |
- count += box->CountSizableChildren(); | |
- } | |
- } | |
- return count; | |
- } | |
- | |
- virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp) | |
- { | |
- RECT rect = { 0 }; | |
- | |
- SIZE content = { 0 }; | |
- ComputeMinimalSize(&content); | |
- | |
- int preferredWidth = m_Width.ComputeMeasure(parentRect.right - parentRect.left, content.cx); | |
- int preferredHeight = m_Height.ComputeMeasure(parentRect.bottom - parentRect.top, content.cy); | |
- | |
- rect.right = preferredWidth; | |
- rect.bottom = preferredHeight; | |
- | |
- ComputeRect(parentRect, rect, &rect); | |
- | |
- for (int i = 0; i < m_Children.GetCount(); i++) | |
- { | |
- CUiBox * box = m_Children.Get(i)->AsBox(); | |
- if (box) | |
- { | |
- hDwp = box->OnParentSize(rect, hDwp); | |
- } | |
- } | |
- | |
- return hDwp; | |
- } | |
-}; | |
- | |
-template<class T = CWindow> | |
-class CUiWindow : | |
- public CUiPrimitive, | |
- public CUiBox, | |
- public T | |
-{ | |
-public: | |
- virtual CUiBox * AsBox() { return this; } | |
- | |
- HWND GetWindow() { return T::m_hWnd; } | |
- | |
- virtual void ComputeMinimalSize(SIZE* size) | |
- { | |
- // TODO: Maybe use WM_GETMINMAXINFO? | |
- return CUiBox::ComputeMinimalSize(size); | |
- }; | |
- | |
- virtual void ComputeContentBounds(RECT* rect) | |
- { | |
- RECT r; | |
- ::GetWindowRect(T::m_hWnd, &r); | |
- rect->left = min(rect->left, r.left); | |
- rect->top = min(rect->top, r.top); | |
- rect->right = max(rect->right, r.right); | |
- rect->bottom = max(rect->bottom, r.bottom); | |
- }; | |
- | |
- virtual DWORD_PTR CountSizableChildren() | |
- { | |
- return 1; | |
- }; | |
- | |
- virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp) | |
- { | |
- RECT rect; | |
- | |
- ::GetWindowRect(T::m_hWnd, &rect); | |
- | |
- ComputeRect(parentRect, rect, &rect); | |
- | |
- if (hDwp) | |
- { | |
- return ::DeferWindowPos(hDwp, T::m_hWnd, NULL, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOACTIVATE | SWP_NOZORDER); | |
- } | |
- else | |
- { | |
- T::SetWindowPos(NULL, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOACTIVATE | SWP_NOZORDER | SWP_DEFERERASE); | |
- return NULL; | |
- } | |
- }; | |
- | |
-public: | |
- virtual ~CUiWindow() | |
- { | |
- T::DestroyWindow(); | |
- } | |
-}; | |
- | |
-class CUiSplitPanel : | |
- public CUiPrimitive, | |
- public CUiBox, | |
- public CWindowImpl<CUiSplitPanel> | |
-{ | |
- static const int THICKNESS = 4; | |
- | |
-protected: | |
- | |
- HCURSOR m_hCursor; | |
- | |
- CUiPanel m_First; | |
- CUiPanel m_Second; | |
- | |
- RECT m_LastRect; | |
- | |
- BOOL m_HasOldRect; | |
- | |
-public: | |
- int m_Pos; | |
- BOOL m_Horizontal; | |
- BOOL m_DynamicFirst; | |
- int m_MinFirst; | |
- int m_MinSecond; | |
- | |
- CUiMeasure m_Width; | |
- CUiMeasure m_Height; | |
- | |
-public: | |
- CUiSplitPanel() | |
- { | |
- m_Width = CUiMeasure::FitParent(); | |
- m_Height = CUiMeasure::FitParent(); | |
- m_Pos = 100; | |
- m_MinFirst = 100; | |
- m_MinSecond = 100; | |
- m_DynamicFirst = FALSE; | |
- m_HasOldRect = FALSE; | |
- } | |
- | |
- virtual ~CUiSplitPanel() | |
- { | |
- } | |
- | |
- virtual CUiBox * AsBox() { return this; } | |
- | |
- CUiCollection& First() { return m_First.Children(); } | |
- CUiCollection& Second() { return m_Second.Children(); } | |
- | |
- virtual void ComputeMinimalSize(SIZE* size) | |
- { | |
- if (m_Horizontal) | |
- size->cx = max(size->cx, THICKNESS); | |
- else | |
- size->cy = max(size->cy, THICKNESS); | |
- m_First.ComputeMinimalSize(size); | |
- m_Second.ComputeMinimalSize(size); | |
- }; | |
- | |
- virtual void ComputeContentBounds(RECT* rect) | |
- { | |
- RECT r; | |
- | |
- m_First.ComputeContentBounds(rect); | |
- m_Second.ComputeContentBounds(rect); | |
- | |
- ::GetWindowRect(m_hWnd, &r); | |
- | |
- rect->left = min(rect->left, r.left); | |
- rect->top = min(rect->top, r.top); | |
- rect->right = max(rect->right, r.right); | |
- rect->bottom = max(rect->bottom, r.bottom); | |
- }; | |
- | |
- virtual DWORD_PTR CountSizableChildren() | |
- { | |
- int count = 1; | |
- count += m_First.CountSizableChildren(); | |
- count += m_Second.CountSizableChildren(); | |
- return count; | |
- }; | |
- | |
- virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp) | |
- { | |
- RECT rect = { 0 }; | |
- | |
- SIZE content = { 0 }; | |
- ComputeMinimalSize(&content); | |
- | |
- int preferredWidth = m_Width.ComputeMeasure(parentRect.right - parentRect.left, content.cx); | |
- int preferredHeight = m_Width.ComputeMeasure(parentRect.bottom - parentRect.top, content.cy); | |
- | |
- rect.right = preferredWidth; | |
- rect.bottom = preferredHeight; | |
- | |
- ComputeRect(parentRect, rect, &rect); | |
- | |
- SIZE growth = { 0 }; | |
- if (m_HasOldRect) | |
- { | |
- RECT oldRect = m_LastRect; | |
- | |
- growth.cx = (parentRect.right - parentRect.left) - (oldRect.right - oldRect.left); | |
- growth.cy = (parentRect.bottom - parentRect.top) - (oldRect.bottom - oldRect.top); | |
- } | |
- | |
- RECT splitter = rect; | |
- RECT first = rect; | |
- RECT second = rect; | |
- | |
- if (m_Horizontal) | |
- { | |
- rect.top += m_MinFirst; | |
- rect.bottom -= THICKNESS + m_MinSecond; | |
- if (m_DynamicFirst) | |
- { | |
- if (growth.cy > 0) | |
- { | |
- m_Pos += min(growth.cy, rect.bottom - (m_Pos+THICKNESS)); | |
- } | |
- else if (growth.cy < 0) | |
- { | |
- m_Pos += max(growth.cy, rect.top - m_Pos); | |
- } | |
- } | |
- | |
- if (m_Pos > rect.bottom) | |
- m_Pos = rect.bottom; | |
- | |
- if (m_Pos < rect.top) | |
- m_Pos = rect.top; | |
- | |
- splitter.top = m_Pos; | |
- splitter.bottom = m_Pos + THICKNESS; | |
- first.bottom = splitter.top; | |
- second.top = splitter.bottom; | |
- } | |
- else | |
- { | |
- rect.left += m_MinFirst; | |
- rect.right -= THICKNESS + m_MinSecond; | |
- if (m_DynamicFirst) | |
- { | |
- if (growth.cx > 0) | |
- { | |
- m_Pos += min(growth.cx, rect.right - (m_Pos + THICKNESS)); | |
- } | |
- else if (growth.cx < 0) | |
- { | |
- m_Pos += max(growth.cy, rect.left - m_Pos); | |
- } | |
- } | |
- | |
- if (m_Pos > rect.right) | |
- m_Pos = rect.right; | |
- | |
- if (m_Pos < rect.left) | |
- m_Pos = rect.left; | |
- | |
- splitter.left = m_Pos; | |
- splitter.right = m_Pos + THICKNESS; | |
- first.right = splitter.left; | |
- second.left = splitter.right; | |
- } | |
- | |
- m_LastRect = parentRect; | |
- m_HasOldRect = TRUE; | |
- | |
- hDwp = m_First.OnParentSize(first, hDwp); | |
- hDwp = m_Second.OnParentSize(second, hDwp); | |
- | |
- if (hDwp) | |
- { | |
- return DeferWindowPos(hDwp, NULL, | |
- splitter.left, splitter.top, | |
- splitter.right - splitter.left, | |
- splitter.bottom - splitter.top, | |
- SWP_NOACTIVATE | SWP_NOZORDER); | |
- } | |
- else | |
- { | |
- SetWindowPos(NULL, | |
- splitter.left, splitter.top, | |
- splitter.right - splitter.left, | |
- splitter.bottom - splitter.top, | |
- SWP_NOACTIVATE | SWP_NOZORDER); | |
- return NULL; | |
- } | |
- }; | |
- | |
-private: | |
- BOOL ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT& theResult, DWORD dwMapId) | |
- { | |
- theResult = 0; | |
- switch (Msg) | |
- { | |
- case WM_SETCURSOR: | |
- SetCursor(m_hCursor); | |
- theResult = TRUE; | |
- break; | |
- | |
- case WM_LBUTTONDOWN: | |
- SetCapture(); | |
- break; | |
- | |
- case WM_LBUTTONUP: | |
- case WM_RBUTTONDOWN: | |
- if (GetCapture() == m_hWnd) | |
- { | |
- ReleaseCapture(); | |
- } | |
- break; | |
- | |
- case WM_MOUSEMOVE: | |
- if (GetCapture() == m_hWnd) | |
- { | |
- POINT Point; | |
- GetCursorPos(&Point); | |
- ::ScreenToClient(GetParent(), &Point); | |
- if (m_Horizontal) | |
- SetPos(Point.y); | |
- else | |
- SetPos(Point.x); | |
- } | |
- break; | |
- | |
- default: | |
- return FALSE; | |
- } | |
- | |
- return TRUE; | |
- } | |
- | |
-public: | |
- int GetPos(VOID) | |
- { | |
- return m_Pos; | |
- } | |
- | |
- void SetPos(int NewPos) | |
- { | |
- RECT rcParent; | |
- | |
- rcParent = m_LastRect; | |
- | |
- if (m_Horizontal) | |
- { | |
- rcParent.bottom -= THICKNESS; | |
- | |
- m_Pos = NewPos; | |
- | |
- if (m_Pos < rcParent.top) | |
- m_Pos = rcParent.top; | |
- | |
- if (m_Pos > rcParent.bottom) | |
- m_Pos = rcParent.bottom; | |
- } | |
- else | |
- { | |
- rcParent.right -= THICKNESS; | |
- | |
- m_Pos = NewPos; | |
- | |
- if (m_Pos < rcParent.left) | |
- m_Pos = rcParent.left; | |
- | |
- if (m_Pos > rcParent.right) | |
- m_Pos = rcParent.right; | |
- } | |
- | |
- int count = CountSizableChildren(); | |
- | |
- HDWP hdwp = NULL; | |
- hdwp = BeginDeferWindowPos(count); | |
- if (hdwp) hdwp = OnParentSize(m_LastRect, hdwp); | |
- if (hdwp) EndDeferWindowPos(hdwp); | |
- } | |
- | |
-public: | |
- DECLARE_WND_CLASS_EX(_T("SplitterWindowClass"), CS_HREDRAW | CS_VREDRAW, COLOR_BTNFACE) | |
- | |
- /* Create splitter bar */ | |
- HWND Create(HWND hwndParent) | |
- { | |
- if (m_Horizontal) | |
- m_hCursor = LoadCursor(0, IDC_SIZENS); | |
- else | |
- m_hCursor = LoadCursor(0, IDC_SIZEWE); | |
- | |
- DWORD style = WS_CHILD | WS_VISIBLE; | |
- DWORD exStyle = WS_EX_TRANSPARENT; | |
- | |
- RECT size = { 205, 180, 465, THICKNESS }; | |
- size.right += size.left; | |
- size.bottom += size.top; | |
- | |
- return CWindowImpl::Create(hwndParent, size, NULL, style, exStyle); | |
- } | |
-}; | |
Property changes on: base/applications/rapps/rosui.h | |
___________________________________________________________________ | |
Deleted: svn:eol-style | |
## -1 +0,0 ## | |
-native | |
\ No newline at end of property | |
Index: base/applications/rapps/lang/sq-AL.rc | |
=================================================================== | |
--- base/applications/rapps/lang/sq-AL.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/sq-AL.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -96,7 +96,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "Shkarko..." | |
+CAPTION "Shkarko %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -156,11 +156,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nVersioni: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nPershkrimi: " | |
IDS_AINFO_SIZE "\nMasa: " | |
IDS_AINFO_URLSITE "\nHome Page: " | |
IDS_AINFO_LICENSE "\nLicenca: " | |
IDS_AINFO_URLDOWNLOAD "\nShkarko: " | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -189,7 +191,7 @@ | |
IDS_INSTALL "Instalo" | |
IDS_UNINSTALL "Uninstall" | |
IDS_MODIFY "Modifiko" | |
- IDS_APPS_COUNT "Numrimi Aplicacioneve: %d" | |
+ IDS_APPS_COUNT "Numrimi Aplicacioneve: %d; Selected: %d" | |
IDS_WELCOME_TITLE "Mire Se Erdhe ne ReactOS Applications Manager!\n\n" | |
IDS_WELCOME_TEXT "Zgjidh nje kategori ne te majte, pastaj zgjidh nje aplicacion per ta instaluar ose uninstall.\nReactOS Web Site: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -204,9 +206,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not found!" | |
IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
IDS_UNABLE_TO_REMOVE "E pamundur te fshihen informacionet e programit nga regjistri!" | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "SSL certificate verification failed." | |
IDS_INTEG_CHECK_TITLE "Verifying package integrity..." | |
IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have been corrupted or tampered with during downloading. Running the software is not recommended." | |
IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." | |
IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/bg-BG.rc | |
=================================================================== | |
--- base/applications/rapps/lang/bg-BG.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/bg-BG.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -96,7 +96,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "Сваляне" | |
+CAPTION "Сваляне %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -156,11 +156,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nВерсия: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nОписание: " | |
IDS_AINFO_SIZE "\nРазмер: " | |
IDS_AINFO_URLSITE "\nДомашна страница: " | |
IDS_AINFO_LICENSE "\nРазрешително: " | |
IDS_AINFO_URLDOWNLOAD "\nРзтегляне: " | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -189,7 +191,7 @@ | |
IDS_INSTALL "Слагане" | |
IDS_UNINSTALL "Махане" | |
IDS_MODIFY "РџСЂРѕРјСЏРЅР°" | |
- IDS_APPS_COUNT "Брой приложения: %d" | |
+ IDS_APPS_COUNT "Брой приложения: %d; Selected: %d" | |
IDS_WELCOME_TITLE "Управителят на приложенията на РеактОС ви приветства" | |
IDS_WELCOME_TEXT "Рзберете раздел РѕС‚ лявата страна, след което изберете приложение Р·Р° слагане или премахване.\nСтраницата РЅР° РеактОС: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -204,9 +206,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not found!" | |
IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
IDS_UNABLE_TO_REMOVE "Премахването на данните за приложението от регистъра е невъзможно!" | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "SSL certificate verification failed." | |
IDS_INTEG_CHECK_TITLE "Verifying package integrity..." | |
IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have been corrupted or tampered with during downloading. Running the software is not recommended." | |
IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." | |
IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/de-DE.rc | |
=================================================================== | |
--- base/applications/rapps/lang/de-DE.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/de-DE.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -92,7 +92,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "Herunterladen..." | |
+CAPTION "Herunterladen %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -152,11 +152,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nVersion: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nBeschreibung: " | |
IDS_AINFO_SIZE "\nGröße: " | |
IDS_AINFO_URLSITE "\nHomepage: " | |
IDS_AINFO_LICENSE "\nLizenz: " | |
IDS_AINFO_URLDOWNLOAD "\nHerunterladen: " | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -185,7 +187,7 @@ | |
IDS_INSTALL "Installieren" | |
IDS_UNINSTALL "Deinstallieren" | |
IDS_MODIFY "Г„ndern" | |
- IDS_APPS_COUNT "Anzahl der Anwendungen: %d" | |
+ IDS_APPS_COUNT "Anzahl der Anwendungen: %d; Selected: %d" | |
IDS_WELCOME_TITLE "Willkommen im ReactOS-Anwendungsmanager!\n\n" | |
IDS_WELCOME_TEXT "Wählen Sie links eine Kategorie und dann eine Anwendung um sie zu installieren oder zu deinstallieren.\nReactOS-Webseite: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -200,9 +202,46 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Paket konnte nicht geladen werden! Addresse wurde nicht gefunden!" | |
IDS_UNABLE_TO_DOWNLOAD2 "Paket konnte nicht geladen werden! PrГјfen Sie Ihre Internetverbindung!" | |
IDS_UNABLE_TO_REMOVE "Konnte die Daten nicht aus der Registry löschen!" | |
- IDS_CERT_DOES_NOT_MATCH "ГњberprГјfung des SSL-Zertifikats fehlgeschlagen." | |
- IDS_INTEG_CHECK_TITLE "Verifying package integrity..." | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
+ IDS_CERT_DOES_NOT_MATCH "ГњberprГјfung des SSL-Zertifikats fehlgeschlagen." IDS_INTEG_CHECK_TITLE "Verifying package integrity..." | |
IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have been corrupted or tampered with during downloading. Running the software is not recommended." | |
IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." | |
IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/zh-CN.rc | |
=================================================================== | |
--- base/applications/rapps/lang/zh-CN.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/zh-CN.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -94,7 +94,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "жЈењЁдё‹иЅЅ..." | |
+CAPTION "жЈењЁдё‹иЅЅ %ls..." | |
FONT 9, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -154,11 +154,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\n版本:" | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nжЏЏиї°пјљ" | |
IDS_AINFO_SIZE "\n大小:" | |
IDS_AINFO_URLSITE "\nдё»йЎµпјљ" | |
IDS_AINFO_LICENSE "\nеЌЏи®®пјљ" | |
IDS_AINFO_URLDOWNLOAD "\nдё‹иЅЅ:" | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -187,7 +189,7 @@ | |
IDS_INSTALL "安装" | |
IDS_UNINSTALL "еЌёиЅЅ" | |
IDS_MODIFY "дї®ж”№" | |
- IDS_APPS_COUNT "зЁ‹еєЏдёЄж•°пјљ%d" | |
+ IDS_APPS_COUNT "зЁ‹еєЏдёЄж•°пјљ%d; Selected: %d" | |
IDS_WELCOME_TITLE "欢迎来到 ReactOS 程序管理器!\n\n" | |
IDS_WELCOME_TEXT "д»Ће·¦ж ЏйЂ‰ж‹©дёЂдёЄз±»е€«пјЊз„¶еђЋйЂ‰ж‹©и¦Ѓе®‰иЈ…ж€–еЌёиЅЅзљ„зЁ‹еєЏгЂ‚\nReactOS зЅ‘з«™пјљ" | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -202,9 +204,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "ж— жі•дё‹иЅЅиЇҐиЅЇд»¶еЊ… пјЃж‰ѕдёЌе€°зЅ‘з»њзљ„ењ°еќЂ пјЃ" | |
IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
IDS_UNABLE_TO_REMOVE "ж— жі•д»ЋжіЁе†ЊиЎЁе€ й™¤иЇҐзЁ‹еєЏзљ„ж•°жЌ®пјЃ" | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "SSL certificate verification failed." | |
IDS_INTEG_CHECK_TITLE "Verifying package integrity..." | |
IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have been corrupted or tampered with during downloading. Running the software is not recommended." | |
IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." | |
IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/cs-CZ.rc | |
=================================================================== | |
--- base/applications/rapps/lang/cs-CZ.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/cs-CZ.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -97,7 +97,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "StahovГЎnГ..." | |
+CAPTION "StahovГЎnГ %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -157,11 +157,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nVerze: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nPopis: " | |
IDS_AINFO_SIZE "\nVelikost: " | |
IDS_AINFO_URLSITE "\nDomovskГЎ strГЎnka: " | |
IDS_AINFO_LICENSE "\nLicense: " | |
IDS_AINFO_URLDOWNLOAD "\nStaЕѕenГ: " | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -190,7 +192,7 @@ | |
IDS_INSTALL "Instalovat" | |
IDS_UNINSTALL "Odinstalovat" | |
IDS_MODIFY "ZmД›nit" | |
- IDS_APPS_COUNT "PoДЌet aplikacГ: %d" | |
+ IDS_APPS_COUNT "PoДЌet aplikacГ: %d; Selected: %d" | |
IDS_WELCOME_TITLE "VГtejte v ReactOS SprГЎvci aplikacГ!\n\n" | |
IDS_WELCOME_TEXT "Na levГ© stranД› zvolte kategorii, pak vpravo zvolte aplikaci, kterГЎ bude nainstalovГЎna nebo odinstalovГЎna.\nWebovГЎ strГЎnka ReactOS: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -205,9 +207,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Soubor se nepodaЕ™ilo stГЎhnout! Adresa nenalezena!" | |
IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
IDS_UNABLE_TO_REMOVE "NepodaЕ™ilo se odstranit data programu z registru!" | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "SSL certificate verification failed." | |
IDS_INTEG_CHECK_TITLE "Verifying package integrity..." | |
IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have been corrupted or tampered with during downloading. Running the software is not recommended." | |
IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." | |
IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/uk-UA.rc | |
=================================================================== | |
--- base/applications/rapps/lang/uk-UA.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/uk-UA.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -26,7 +26,7 @@ | |
MENUITEM SEPARATOR | |
MENUITEM "&Оновити\tF5", ID_REFRESH | |
MENUITEM SEPARATOR | |
- MENUITEM "Update Da&tabase\tCtrl+F5", ID_RESETDB | |
+ MENUITEM "Оновити список &програм\tCtrl+F5", ID_RESETDB | |
END | |
POPUP "&Довідка" | |
BEGIN | |
@@ -56,7 +56,7 @@ | |
MENUITEM SEPARATOR | |
MENUITEM "&Оновити\tF5", ID_REFRESH | |
MENUITEM SEPARATOR | |
- MENUITEM "Update Da&tabase\tCtrl+F5", ID_RESETDB | |
+ MENUITEM "Оновити список &програм\tCtrl+F5", ID_RESETDB | |
END | |
END | |
@@ -79,7 +79,7 @@ | |
CONTROL "Direct (No proxy)", IDC_NO_PROXY, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 15, 145, 210, 10 | |
CONTROL "Proxy", IDC_USE_PROXY, "Button", BS_AUTORADIOBUTTON | WS_TABSTOP, 15, 160, 74, 10 | |
EDITTEXT IDC_PROXY_SERVER, 90, 160, 147, 12, ES_AUTOHSCROLL | WS_DISABLED | |
- LTEXT "No proxy for", -1, 27, 175, 64, 10 | |
+ LTEXT "Виключення", -1, 27, 175, 64, 10 | |
EDITTEXT IDC_NO_PROXY_FOR, 90, 175, 147, 12, ES_AUTOHSCROLL | WS_DISABLED | |
PUSHBUTTON "Стандартно", IDC_DEFAULT_SETTINGS, 8, 195, 60, 14 | |
PUSHBUTTON "OK", IDOK, 116, 195, 60, 14 | |
@@ -98,9 +98,9 @@ | |
PUSHBUTTON "Скасувати", IDCANCEL, 150, 78, 60, 14 | |
END | |
-IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
-STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "Завантаження..." | |
+IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 220 | |
+STYLE DS_SHELLFONT | DS_CENTER | WS_POPUPWINDOW | WS_SYSMENU | WS_VISIBLE | |
+CAPTION "Завантаження %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -125,7 +125,7 @@ | |
IDS_TOOLTIP_MODIFY "Змінити" | |
IDS_TOOLTIP_SETTINGS "Налаштування" | |
IDS_TOOLTIP_REFRESH "Оновити" | |
- IDS_TOOLTIP_UPDATE_DB "Update Database" | |
+ IDS_TOOLTIP_UPDATE_DB "Оновити список програм" | |
IDS_TOOLTIP_EXIT "Р’РёС…С–Рґ" | |
END | |
@@ -160,11 +160,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nВерсія: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nДоступна версія: " | |
IDS_AINFO_DESCRIPTION "\nРћРїРёСЃ: " | |
IDS_AINFO_SIZE "\nР РѕР·РјС–СЂ: " | |
IDS_AINFO_URLSITE "\nДомашня сторінка: " | |
IDS_AINFO_LICENSE "\nЛіцензія: " | |
IDS_AINFO_URLDOWNLOAD "\nЗавантажити: " | |
+ IDS_AINFO_LANGUAGES "\nРњРѕРІРё: " | |
END | |
STRINGTABLE | |
@@ -193,7 +195,7 @@ | |
IDS_INSTALL "Встановити" | |
IDS_UNINSTALL "Видалити" | |
IDS_MODIFY "Змінити" | |
- IDS_APPS_COUNT "Kількість додатків: %d" | |
+ IDS_APPS_COUNT "Kількість додатків: %d; Обрано: %d" | |
IDS_WELCOME_TITLE "Ласкаво просимо в Менеджер додатків ReactOS!\n\n" | |
IDS_WELCOME_TEXT "Виберіть категорію зліва, а потім виберіть програми для встановлення чи видалення.\nСторінка ReactOS: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -205,12 +207,50 @@ | |
IDS_CHOOSE_FOLDER_ERROR "Ви вказали неіснуючу теку!" | |
IDS_APP_REG_REMOVE "Ви дійсно хочете видалити дані про встановлену програму з реєстру?" | |
IDS_INFORMATION "Інформація" | |
- IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not found!" | |
- IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
+ IDS_UNABLE_TO_DOWNLOAD "Неможливо завантажити додаток! Адресу не знайдено!" | |
+ IDS_UNABLE_TO_DOWNLOAD2 "Неможливо завантажити додаток! Перевірте підключення до мережі Інтернет!" | |
IDS_UNABLE_TO_REMOVE "Не вдалося видалити дані про програму з реєстру!" | |
- IDS_CERT_DOES_NOT_MATCH "SSL certificate verification failed." | |
- IDS_INTEG_CHECK_TITLE "Verifying package integrity..." | |
- IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have been corrupted or tampered with during downloading. Running the software is not recommended." | |
- IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." | |
- IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." | |
+ IDS_UNABLE_TO_INSTALL "Не вдалося завершити інсталювання!" | |
+ IDS_CERT_DOES_NOT_MATCH "Помилка перевіки сертифікату SSL." | |
+ IDS_INTEG_CHECK_TITLE "Перевірка цілістності додатку..." | |
+ IDS_INTEG_CHECK_FAIL "Додаток не пройшов перевірку цілістності, його молги пошкодити чи замінити. Запуск додатку не рекомендується." | |
+ IDS_INTERRUPTED_DOWNLOAD "Завантаження перервано. Перевірте підключення до мережі Інтернет." | |
+ IDS_UNABLE_TO_WRITE "Записк на диск неможливий. Можливо, на диску недостатньо містця." | |
+ IDS_SELECT_ALL "Вибрати все" | |
+ IDS_INSTALL_SELECTED "Встановити обране" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Встановлено" | |
+ IDS_STATUS_NOTINSTALLED "Не встановлено" | |
+ IDS_STATUS_DOWNLOADED "Завантажено" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Є оновлення" | |
+ IDS_STATUS_DOWNLOADING "Завантажується…" | |
+ IDS_STATUS_INSTALLING "Встановлюється…" | |
+ IDS_STATUS_WAITING "Очікування завантаження..." | |
+ IDS_STATUS_FINISHED "Завершено" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Вільне ПЗ" | |
+ IDS_LICENSE_FREEWARE "Безкоштовне ПЗ" | |
+ IDS_LICENSE_TRIAL "Пробна версія" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Є переклад вашою мовою" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Доступно іншими мовами" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Є переклад Англійською" | |
+ IDS_LANGUAGE_SINGLE "РћРґРЅР° РјРѕРІР°" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+ще %d)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d доступно)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Список програм" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Оновлення списку програм..." | |
+END | |
Index: base/applications/rapps/lang/pl-PL.rc | |
=================================================================== | |
--- base/applications/rapps/lang/pl-PL.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/pl-PL.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -100,7 +100,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "ЕљciД…gnij..." | |
+CAPTION "ЕљciД…gnij %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -160,11 +160,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nWersja: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nOpis: " | |
IDS_AINFO_SIZE "\nRozmiar: " | |
IDS_AINFO_URLSITE "\nStrona: " | |
IDS_AINFO_LICENSE "\nLicencja: " | |
IDS_AINFO_URLDOWNLOAD "\nPobieranie: " | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -208,9 +210,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Nie można pobrać pakietu! Nie znaleziono adresu!" | |
IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
IDS_UNABLE_TO_REMOVE "Nie moЕјna byЕ‚o usunД…Д‡ wpisu z rejestru!" | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "SSL certificate verification failed." | |
IDS_INTEG_CHECK_TITLE "Verifying package integrity..." | |
IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have been corrupted or tampered with during downloading. Running the software is not recommended." | |
IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." | |
IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/pt-BR.rc | |
=================================================================== | |
--- base/applications/rapps/lang/pt-BR.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/pt-BR.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -94,7 +94,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "Download..." | |
+CAPTION "Download %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -154,11 +154,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nVersГЈo: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nDescrição: " | |
IDS_AINFO_SIZE "\nTamanho: " | |
IDS_AINFO_URLSITE "\nPГЎgina: " | |
IDS_AINFO_LICENSE "\nLicença: " | |
IDS_AINFO_URLDOWNLOAD "\nTransferir: " | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -187,7 +189,7 @@ | |
IDS_INSTALL "Instalar" | |
IDS_UNINSTALL "Desinstalar" | |
IDS_MODIFY "Modificar" | |
- IDS_APPS_COUNT "NГєmero de aplicativos: %d" | |
+ IDS_APPS_COUNT "NГєmero de aplicativos: %d; Selected: %d" | |
IDS_WELCOME_TITLE "Bem-vindo(a) a Central de Aplicativos ReactOS!\n\n" | |
IDS_WELCOME_TEXT "Escolha uma categoria Г esquerda, entГЈo escolha um aplicativo para instalar ou desinstalar.\nWeb Site ReactOS: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -202,9 +204,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not found!" | |
IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
IDS_UNABLE_TO_REMOVE "NГЈo foi possГvel remover as informações do programa do registro!" | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "SSL certificate verification failed." | |
IDS_INTEG_CHECK_TITLE "Verifying package integrity..." | |
IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have been corrupted or tampered with during downloading. Running the software is not recommended." | |
IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." | |
IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/it-IT.rc | |
=================================================================== | |
--- base/applications/rapps/lang/it-IT.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/it-IT.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -92,7 +92,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "Scaricamento in corso" | |
+CAPTION "Scaricamento in corso %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -152,11 +152,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nVersione: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nDescrizione: " | |
IDS_AINFO_SIZE "\nDimensione: " | |
IDS_AINFO_URLSITE "\nHome Page: " | |
IDS_AINFO_LICENSE "\nLicenza: " | |
IDS_AINFO_URLDOWNLOAD "\nScaricare: " | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -185,7 +187,7 @@ | |
IDS_INSTALL "Installa" | |
IDS_UNINSTALL "Rimuovi" | |
IDS_MODIFY "Modifica" | |
- IDS_APPS_COUNT "Numero applicazioni: %d" | |
+ IDS_APPS_COUNT "Numero applicazioni: %d; Selected: %d" | |
IDS_WELCOME_TITLE "Benvenuto!\n\n" | |
IDS_WELCOME_TEXT "Scegliere una categoria a sinistra, poi scegliere una applicazione da installare o disinstallare.\nReactOS Web Site: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -200,9 +202,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Impossibile scaricare il pacchetto! Indirizzo non trovato!" | |
IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
IDS_UNABLE_TO_REMOVE "Impossibile cancellare i dati dal registro!" | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "Verifica del certificato SSL fallita." | |
IDS_INTEG_CHECK_TITLE "Verifica integritа pacchetto..." | |
IDS_INTEG_CHECK_FAIL "Il pacchetto non ha superato il controllo di integritа, potrebbe essere stato danneggiato o manomesso durante lo scaricamento. L'esecuzione del software non и raccomandata." | |
IDS_INTERRUPTED_DOWNLOAD "Lo scaricamento и stato interrotto. Verificare la connessione a Internet." | |
IDS_UNABLE_TO_WRITE "Impossibile scrivere su disco: lo spazio libero potrebbe essere esaurito." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/no-NO.rc | |
=================================================================== | |
--- base/applications/rapps/lang/no-NO.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/no-NO.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -92,7 +92,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "Lastet ned..." | |
+CAPTION "Lastet ned %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -152,6 +152,7 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nVersjon: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nBeskrivelse: " | |
IDS_AINFO_SIZE "\nStГёrrelse: " | |
IDS_AINFO_URLSITE "\nHjemmeside: " | |
@@ -185,7 +186,7 @@ | |
IDS_INSTALL "Installere" | |
IDS_UNINSTALL "Avinstallere" | |
IDS_MODIFY "Endre" | |
- IDS_APPS_COUNT "Program oppsummering: %d" | |
+ IDS_APPS_COUNT "Program oppsummering: %d; Selected: %d" | |
IDS_WELCOME_TITLE "Velkommen til ReactOS programbehandler!\n\n" | |
IDS_WELCOME_TEXT "Velg en kategori til venstre, og velg et program for installere eller avinstallere programvaren.\nReactOS internettside: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -200,9 +201,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not found!" | |
IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the registry!" | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "SSL certificate verification failed." | |
IDS_INTEG_CHECK_TITLE "Verifying package integrity..." | |
IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have been corrupted or tampered with during downloading. Running the software is not recommended." | |
IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." | |
IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/en-US.rc | |
=================================================================== | |
--- base/applications/rapps/lang/en-US.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/en-US.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -90,9 +90,9 @@ | |
PUSHBUTTON "Cancel", IDCANCEL, 150, 78, 60, 14 | |
END | |
-IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
-STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "Downloading..." | |
+IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 220 | |
+STYLE DS_SHELLFONT | DS_CENTER | WS_POPUPWINDOW | WS_CAPTION | WS_VISIBLE | |
+CAPTION "Downloading %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -152,11 +152,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nVersion: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nDescription: " | |
IDS_AINFO_SIZE "\nSize: " | |
IDS_AINFO_URLSITE "\nHome Page: " | |
IDS_AINFO_LICENSE "\nLicense: " | |
IDS_AINFO_URLDOWNLOAD "\nDownload: " | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -185,7 +187,7 @@ | |
IDS_INSTALL "Install" | |
IDS_UNINSTALL "Uninstall" | |
IDS_MODIFY "Modify" | |
- IDS_APPS_COUNT "Applications count: %d" | |
+ IDS_APPS_COUNT "Applications count: %d; Selected: %d" | |
IDS_WELCOME_TITLE "Welcome to ReactOS Applications Manager!\n\n" | |
IDS_WELCOME_TEXT "Choose a category on the left, then choose an application to install or uninstall.\nReactOS Web Site: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -200,9 +202,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not found!" | |
IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the registry!" | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "SSL certificate verification failed." | |
IDS_INTEG_CHECK_TITLE "Verifying package integrity..." | |
IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have been corrupted or tampered with during downloading. Running the software is not recommended." | |
IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." | |
IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/sk-SK.rc | |
=================================================================== | |
--- base/applications/rapps/lang/sk-SK.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/sk-SK.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -97,7 +97,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "SЕҐahujem ..." // StiahnuЕҐ ??? | |
+CAPTION "SЕҐahujem %ls..." // StiahnuЕҐ ??? | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -157,11 +157,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nVerzia: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nPopis: " | |
IDS_AINFO_SIZE "\nVeДѕkosЕҐ: " | |
IDS_AINFO_URLSITE "\nDomovskГЎ strГЎnka: " | |
IDS_AINFO_LICENSE "\nLicencia: " | |
IDS_AINFO_URLDOWNLOAD "\nStiahnuЕҐ: " | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -190,7 +192,7 @@ | |
IDS_INSTALL "InЕЎtalovaЕҐ" | |
IDS_UNINSTALL "OdinЕЎtalovaЕҐ" | |
IDS_MODIFY "ZmeniЕҐ" | |
- IDS_APPS_COUNT "PoДЌet programov: %d" | |
+ IDS_APPS_COUNT "PoДЌet programov: %d; Selected: %d" | |
IDS_WELCOME_TITLE "VГta VГЎs ManaЕѕГ©r aplikГЎciГ systГ©mu ReactOS!\n\n" // ReactOS Application Manager | |
IDS_WELCOME_TEXT "Vyberte si kategГіriu na Дѕavej strane, potom vyberte aplikГЎciu, ktorГє chcete nainЕЎtalovaЕҐ alebo odinЕЎtalovaЕҐ.\nWebstrГЎnka projektu ReactOS: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -205,9 +207,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not found!" | |
IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
IDS_UNABLE_TO_REMOVE "Nie je moЕѕnГ© odstrГЎniЕҐ z registrov Гєdaje o programe!" | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "SSL certificate verification failed." | |
IDS_INTEG_CHECK_TITLE "Verifying package integrity..." | |
IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have been corrupted or tampered with during downloading. Running the software is not recommended." | |
IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." | |
IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/sv-SE.rc | |
=================================================================== | |
--- base/applications/rapps/lang/sv-SE.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/sv-SE.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -99,7 +99,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "Ladda ner..." | |
+CAPTION "Ladda ner %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -159,11 +159,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nVersion: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nBeskrivning: " | |
IDS_AINFO_SIZE "\nStorlek: " | |
IDS_AINFO_URLSITE "\nHemsida: " | |
IDS_AINFO_LICENSE "\nLicens: " | |
IDS_AINFO_URLDOWNLOAD "\nLadda ner: " | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -192,7 +194,7 @@ | |
IDS_INSTALL "Installera" | |
IDS_UNINSTALL "Avinstallera" | |
IDS_MODIFY "Г„ndra" | |
- IDS_APPS_COUNT "Programantal: %d" | |
+ IDS_APPS_COUNT "Programantal: %d; Selected: %d" | |
IDS_WELCOME_TITLE "Välkommen till ReactOS programhanterare!\n\n" | |
IDS_WELCOME_TEXT "Välj en kategori till vänster, och sedan ett program för att installera eller avinstallera.\nReactOS Web sida: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -207,9 +209,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not found!" | |
IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
IDS_UNABLE_TO_REMOVE "Det gick ej att ta bort programmets data frГҐn registret!" | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "SSL certificate verification failed." | |
IDS_INTEG_CHECK_TITLE "Verifying package integrity..." | |
IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have been corrupted or tampered with during downloading. Running the software is not recommended." | |
IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." | |
IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/ro-RO.rc | |
=================================================================== | |
--- base/applications/rapps/lang/ro-RO.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/ro-RO.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -98,7 +98,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "În descărcare…" | |
+CAPTION "ГЋn descДѓrcare %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -158,11 +158,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nVersiune: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nDescriere: " | |
IDS_AINFO_SIZE "\nDimensiune: " | |
IDS_AINFO_URLSITE "\nPaginДѓ web: " | |
IDS_AINFO_LICENSE "\nLicenИ›Дѓ: " | |
IDS_AINFO_URLDOWNLOAD "\nDescarca: " | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -191,7 +193,7 @@ | |
IDS_INSTALL "InstaleazДѓ" | |
IDS_UNINSTALL "DezinstaleazДѓ" | |
IDS_MODIFY "ModificДѓ" | |
- IDS_APPS_COUNT "NumДѓrul de programe: %d" | |
+ IDS_APPS_COUNT "NumДѓrul de programe: %d; Selected: %d" | |
IDS_WELCOME_TITLE "Bun venit la gestionarul de programe ReactOS!\n\n" | |
IDS_WELCOME_TEXT "AlegeИ›i o categorie din stГўnga, apoi alegeИ›i o aplicaИ›ie pentru a o instala sau dezinstala.\nArdesa web ReactOS: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -206,9 +208,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Pachetul nu poate fi descДѓrcat! Adresa nu este gДѓsitДѓ!" | |
IDS_UNABLE_TO_DOWNLOAD2 "Pachetul nu poate fi descДѓrcat! VerificaИ›i conexiunea de Internet!" | |
IDS_UNABLE_TO_REMOVE "Datele de registru pentru acest program nu au putut fi eliminate!" | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "Verificarea certificatului SSL a eИ™uat." | |
IDS_INTEG_CHECK_TITLE "Integritatea pachetului în verificare…" | |
IDS_INTEG_CHECK_FAIL "Pachetul nu a trecut de verificarea de integritate. Utilizarea programului nu este recomandatДѓ." | |
IDS_INTERRUPTED_DOWNLOAD "DescДѓrcarea a fost Г®ntreruptДѓ. VerificaИ›i conexiunea la Internet." | |
IDS_UNABLE_TO_WRITE "EИ™ec la scriea pe disc. Una din cauze poate fi atingerea limitei de capacitate." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/he-IL.rc | |
=================================================================== | |
--- base/applications/rapps/lang/he-IL.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/he-IL.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -94,7 +94,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "Ч”Ч•ЧЁЧ“Ч”..." | |
+CAPTION "Ч”Ч•ЧЁЧ“Ч” %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -154,11 +154,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nЧ’ЧЁЧЎЧ”: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nЧЄЧ™ЧђЧ•ЧЁ: " | |
IDS_AINFO_SIZE "\nЧ’Ч•Ч“Чњ: " | |
IDS_AINFO_URLSITE "\nЧ“ЧЈ Ч‘Ч™ЧЄ: " | |
IDS_AINFO_LICENSE "\nЧЁЧ™Ч©Ч™Ч•Чџ: " | |
IDS_AINFO_URLDOWNLOAD "\nЧ”Ч•ЧЁЧ“: " | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -187,7 +189,7 @@ | |
IDS_INSTALL "Ч”ЧЄЧ§Ч Ч”" | |
IDS_UNINSTALL "Ч”ЧЎЧЁЧ”" | |
IDS_MODIFY "Ч©Ч™Ч Ч•Ч™" | |
- IDS_APPS_COUNT "ЧЎЧ¤Ч™ЧЁЧЄ Ч™Ч™Ч©Ч•ЧћЧ™Чќ: %d" | |
+ IDS_APPS_COUNT "ЧЎЧ¤Ч™ЧЁЧЄ Ч™Ч™Ч©Ч•ЧћЧ™Чќ: %d; Selected: %d" | |
IDS_WELCOME_TITLE "Ч‘ЧЁЧ•Ч›Ч™Чќ Ч”Ч‘ЧђЧ™Чќ ЧњЧћЧ Ч”Чњ Ч”Ч™Ч™Ч©Ч•ЧћЧ™Чќ Ч©Чњ ReactOS!\n\n" | |
IDS_WELCOME_TEXT "Choose a category on the left, then choose an application to install or uninstall.\nReactOS Web Site: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -202,9 +204,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not found!" | |
IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
IDS_UNABLE_TO_REMOVE "Unable to remove data on the program from the registry!" | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "SSL certificate verification failed." | |
IDS_INTEG_CHECK_TITLE "Verifying package integrity..." | |
IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have been corrupted or tampered with during downloading. Running the software is not recommended." | |
IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." | |
IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/ja-JP.rc | |
=================================================================== | |
--- base/applications/rapps/lang/ja-JP.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/ja-JP.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -92,7 +92,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "ダウンгѓгѓјгѓ‰..." | |
+CAPTION "ダウンгѓгѓјгѓ‰ %ls..." | |
FONT 9, "MS UI Gothic" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -152,11 +152,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nгѓђгѓјг‚ёгѓ§гѓі: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\n概要: " | |
IDS_AINFO_SIZE "\nサイズ: " | |
IDS_AINFO_URLSITE "\nгѓ›гѓјгѓ гѓљгѓјг‚ё: " | |
IDS_AINFO_LICENSE "\nライセンス: " | |
IDS_AINFO_URLDOWNLOAD "\nダウンгѓгѓјгѓ‰: " | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -185,7 +187,7 @@ | |
IDS_INSTALL "インストール" | |
IDS_UNINSTALL "アンインストール" | |
IDS_MODIFY "変更" | |
- IDS_APPS_COUNT "г‚ўгѓ—гѓЄг‚±гѓјг‚·гѓ§гѓіж•°: %d" | |
+ IDS_APPS_COUNT "г‚ўгѓ—гѓЄг‚±гѓјг‚·гѓ§гѓіж•°: %d; Selected: %d" | |
IDS_WELCOME_TITLE "ReactOS г‚ўгѓ—гѓЄг‚±гѓјг‚·гѓ§гѓі гѓћгѓЌгѓјг‚ёгѓЈгЃёг‚€гЃ†гЃ“гЃќ!\n\n" | |
IDS_WELCOME_TEXT "左側からカテゴリを選択し、インストール又はアンインストールするアプリケーションを選んでください。\nReactOS ウェブ サイト: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -200,9 +202,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Unable to download the package! Address not found!" | |
IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
IDS_UNABLE_TO_REMOVE "レジストリからこのプгѓг‚°гѓ©гѓ に関するデータを削除できません!" | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "SSL certificate verification failed." | |
IDS_INTEG_CHECK_TITLE "Verifying package integrity..." | |
IDS_INTEG_CHECK_FAIL "The package did not pass the integrity check, it may have been corrupted or tampered with during downloading. Running the software is not recommended." | |
IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." | |
IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/tr-TR.rc | |
=================================================================== | |
--- base/applications/rapps/lang/tr-TR.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/tr-TR.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -94,7 +94,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "Д°ndiriliyor" | |
+CAPTION "Д°ndiriliyor %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -154,11 +154,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nSГјrГјmГј: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nAçıklaması: " | |
IDS_AINFO_SIZE "\nBГјyГјklГјДџГј: " | |
IDS_AINFO_URLSITE "\nAna SayfasД±: " | |
IDS_AINFO_LICENSE "\nRuhsatД±: " | |
IDS_AINFO_URLDOWNLOAD "\nД°ndir: " | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -187,7 +189,7 @@ | |
IDS_INSTALL "Kur" | |
IDS_UNINSTALL "KaldД±r" | |
IDS_MODIFY "DeДџiЕџtir" | |
- IDS_APPS_COUNT "Uygulama SayД±sД±: %d" | |
+ IDS_APPS_COUNT "Uygulama SayД±sД±: %d; Selected: %d" | |
IDS_WELCOME_TITLE "ReactOS Uygulama Yöneticisi'ne hoş geldiniz.\n\n" | |
IDS_WELCOME_TEXT "Solda bir ulam seçiniz, ardından kurmak ya da kaldırmak için bir uygulama seçiniz.\nReactOS'un Umûmî Ağ sitesi: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -202,9 +204,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Paket indirilemez! Adres bulunamadД±!" | |
IDS_UNABLE_TO_DOWNLOAD2 "Paket indirilemez! UmГ»mГ® AДџ baДџlantД±nД±zД± yoklayД±nД±z!" | |
IDS_UNABLE_TO_REMOVE "Д°zlencenin giriЕџi deДџer defterinden silinemiyor." | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "SSL onay belgesi doДџrulamasД± baЕџarД±sД±z." | |
IDS_INTEG_CHECK_TITLE "Paket bГјtГјnlГјДџГј doДџrulanД±yor..." | |
IDS_INTEG_CHECK_FAIL "Paket bütünlük denetimini geçmedi, bozulmuş veyâ indirme esnâsında oynanmış olabilir. Yazılımı çalıştırmak önerilmez." | |
IDS_INTERRUPTED_DOWNLOAD "Д°ndirme kesildi. UmГ»mГ® AДџ baДџlantД±nД±zД± denetleyiniz." | |
IDS_UNABLE_TO_WRITE "Diske yazД±lamД±yor. Disk dolu olabilir." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/zh-TW.rc | |
=================================================================== | |
--- base/applications/rapps/lang/zh-TW.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/zh-TW.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -94,7 +94,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "жЈењЁдё‹иј‰..." | |
+CAPTION "жЈењЁдё‹иј‰ %ls..." | |
FONT 9, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -154,11 +154,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\n版本:" | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nжЏЏиї°пјљ" | |
IDS_AINFO_SIZE "\n大小:" | |
IDS_AINFO_URLSITE "\nдё»й Ѓпјљ" | |
IDS_AINFO_LICENSE "\nеЌ”и°пјљ" | |
IDS_AINFO_URLDOWNLOAD "\nдё‹иј‰:" | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -187,7 +189,7 @@ | |
IDS_INSTALL "安裝" | |
IDS_UNINSTALL "解除安裝" | |
IDS_MODIFY "дї®ж”№" | |
- IDS_APPS_COUNT "зЁ‹ејЏеЂ‹ж•ёпјљ%d" | |
+ IDS_APPS_COUNT "зЁ‹ејЏеЂ‹ж•ёпјљ%d; Selected: %d" | |
IDS_WELCOME_TITLE "жЎиїЋдѕ†е€° ReactOS зЁ‹ејЏз®Ўзђ†е™ЁпјЃ\n\n" | |
IDS_WELCOME_TEXT "從左欄選擇一個類別,然後選擇要安裝或解除安裝的程式。\nReactOS 網站:" | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -202,9 +204,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "з„Ўжі•дё‹иј‰еЊ…!ж‰ѕдёЌе€°зљ„дЅЌеќЂ!" | |
IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
IDS_UNABLE_TO_REMOVE "無法從登錄檔刪除該程式的資料!" | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "SSL 憑и‰й©—и‰е¤±ж•—гЂ‚" | |
IDS_INTEG_CHECK_TITLE "й©—и‰еҐ—иЈќи»џй«”зљ„е®Њж•ґжЂ§..." | |
IDS_INTEG_CHECK_FAIL "包沒有通過完整性檢查,它可能已損壞,或者在下載過程дёзЇЎж”№гЂ‚е»єи°ж‚ЁдёЌи¦ЃйЃ‹иЎЊи©Іи»џй«”гЂ‚" | |
IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." | |
IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/ru-RU.rc | |
=================================================================== | |
--- base/applications/rapps/lang/ru-RU.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/ru-RU.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -90,9 +90,9 @@ | |
PUSHBUTTON "Отмена", IDCANCEL, 150, 78, 60, 14 | |
END | |
-IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
-STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "Загрузка..." | |
+IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 220 | |
+STYLE DS_SHELLFONT | DS_CENTER | WS_POPUPWINDOW | WS_SYSMENU | WS_VISIBLE | |
+CAPTION "Загрузка %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -152,11 +152,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nВерсия: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nДоступная версия: " | |
IDS_AINFO_DESCRIPTION "\nОписание: " | |
IDS_AINFO_SIZE "\nРазмер: " | |
IDS_AINFO_URLSITE "\nДомашняя страница: " | |
IDS_AINFO_LICENSE "\nЛицензия: " | |
IDS_AINFO_URLDOWNLOAD "\nЗагрузить: " | |
+ IDS_AINFO_LANGUAGES "\nЯзыки: " | |
END | |
STRINGTABLE | |
@@ -185,7 +187,7 @@ | |
IDS_INSTALL "Установить" | |
IDS_UNINSTALL "Удалить" | |
IDS_MODIFY "Рзменить" | |
- IDS_APPS_COUNT "Количество: %d" | |
+ IDS_APPS_COUNT "Количество приложений: %d; Выбрано: %d" | |
IDS_WELCOME_TITLE "Добро пожаловать в ""Менеджер приложений ReactOS""!\n\n" | |
IDS_WELCOME_TEXT "Выберите категорию слева и приложение для установки или удаления.\nСайт ReactOS: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -200,9 +202,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Не удалось скачать приложение! Не найден адрес!" | |
IDS_UNABLE_TO_DOWNLOAD2 "РќРµ удалось скачать приложение! Проверьте подключение Рє сети Рнтернет!" | |
IDS_UNABLE_TO_REMOVE "Не удалось удалить данные о программе из реестра!" | |
+ IDS_UNABLE_TO_INSTALL "Не удалось завершить установку!" | |
IDS_CERT_DOES_NOT_MATCH "Ошибка проверки SSL сертификата." | |
IDS_INTEG_CHECK_TITLE "Проверка целостности приложения..." | |
IDS_INTEG_CHECK_FAIL "Приложение не прошло проверку целостности, возможно оно было повреждено или подменено. Запуск приложения не рекомендуется." | |
IDS_INTERRUPTED_DOWNLOAD "Загрузка была прервана. Проверьте подключение Рє сети Рнтернет." | |
IDS_UNABLE_TO_WRITE "Не удалось записать данные на диск. Возможно, недостаточно свободного места на диске." | |
+ IDS_SELECT_ALL "Выбрать все" | |
+ IDS_INSTALL_SELECTED "Установить выбранное" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Установлено" | |
+ IDS_STATUS_NOTINSTALLED "Не установлено" | |
+ IDS_STATUS_DOWNLOADED "Загружено" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Есть обновления" | |
+ IDS_STATUS_DOWNLOADING "Загружается…" | |
+ IDS_STATUS_INSTALLING "Установка..." | |
+ IDS_STATUS_WAITING "Ожидание установки…" | |
+ IDS_STATUS_FINISHED "Завершено" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "РЎРІРѕР±РѕРґРЅРѕРµ РџРћ" | |
+ IDS_LICENSE_FREEWARE "Бесплатное ПО" | |
+ IDS_LICENSE_TRIAL "Пробная версия" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Доступно на вашем языке" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Доступно на других языках" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Доступно на Английском" | |
+ IDS_LANGUAGE_SINGLE "Один язык" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+еще %d )" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d доступно)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "База данных приложений" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Обновление базы данных..." | |
+END | |
Index: base/applications/rapps/lang/es-ES.rc | |
=================================================================== | |
--- base/applications/rapps/lang/es-ES.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/es-ES.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -95,7 +95,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "Descargando..." | |
+CAPTION "Descargando %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -155,11 +155,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nVersiГіn: " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nDescripciГіn: " | |
IDS_AINFO_SIZE "\nTamaГ±o: " | |
IDS_AINFO_URLSITE "\nPГЎgina Web: " | |
IDS_AINFO_LICENSE "\nLicencia: " | |
IDS_AINFO_URLDOWNLOAD "\nDescargar: " | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -188,7 +190,7 @@ | |
IDS_INSTALL "Instalar" | |
IDS_UNINSTALL "Desinstalar" | |
IDS_MODIFY "Modificar" | |
- IDS_APPS_COUNT "NГєmero de aplicaciones: %d" | |
+ IDS_APPS_COUNT "NГєmero de aplicaciones: %d; Selected: %d" | |
IDS_WELCOME_TITLE "Bienvenido al Administrador de aplicaciones de ReactOS.\n\n" | |
IDS_WELCOME_TEXT "Seleccione una categorГa a la izquierda, para mГЎs tarde seleccionar la aplicaciГіn a instalar o desinstalar.\nWeb de ReactOS: " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -203,9 +205,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "No se pudo descargar el paquete. No se ha encontrado la direcciГіn de Internet." | |
IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
IDS_UNABLE_TO_REMOVE "No se pudieron borrar del Registro los datos de instalaciГіn del programa." | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "Ha fallado la comprobaciГіn del certificado SSL." | |
IDS_INTEG_CHECK_TITLE "Verificando integridad del paquete..." | |
IDS_INTEG_CHECK_FAIL "El paquete no ha pasado la comprobaciГіn de integridad, puede haber sido alterado o estar corrupto. No se recomienda ejecutarlo." | |
IDS_INTERRUPTED_DOWNLOAD "Se ha interrumpido la descarga por un error de red. Comprueba la conexiГіn a Internet." | |
IDS_UNABLE_TO_WRITE "No se ha podido escribir en el disco duro, es posible que no quede espacio libre." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/lang/fr-FR.rc | |
=================================================================== | |
--- base/applications/rapps/lang/fr-FR.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/lang/fr-FR.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -92,7 +92,7 @@ | |
IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 220, 72 | |
STYLE DS_SHELLFONT | DS_CENTER | WS_BORDER | WS_CAPTION | WS_POPUP | WS_SYSMENU | WS_VISIBLE | |
-CAPTION "TГ©lГ©chargement..." | |
+CAPTION "TГ©lГ©chargement %ls..." | |
FONT 8, "MS Shell Dlg" | |
BEGIN | |
CONTROL "Progress1", IDC_DOWNLOAD_PROGRESS, "msctls_progress32", WS_BORDER | PBS_SMOOTH, 10, 10, 200, 12 | |
@@ -152,11 +152,13 @@ | |
STRINGTABLE | |
BEGIN | |
IDS_AINFO_VERSION "\nVersion : " | |
+ IDS_AINFO_AVAILABLEVERSION "\nAvailable Version: " | |
IDS_AINFO_DESCRIPTION "\nDescription : " | |
IDS_AINFO_SIZE "\nTaille : " | |
IDS_AINFO_URLSITE "\nSite internet : " | |
IDS_AINFO_LICENSE "\nLicence : " | |
IDS_AINFO_URLDOWNLOAD "\nTГ©lГ©charger : " | |
+ IDS_AINFO_LANGUAGES "\nLanguages: " | |
END | |
STRINGTABLE | |
@@ -185,7 +187,7 @@ | |
IDS_INSTALL "Installer" | |
IDS_UNINSTALL "DГ©sinstaller" | |
IDS_MODIFY "Modifier" | |
- IDS_APPS_COUNT "Nombre d'applications : %d" | |
+ IDS_APPS_COUNT "Nombre d'applications : %d; Selected: %d" | |
IDS_WELCOME_TITLE "Bienvenue dans ReactOS Applications Manager !\n\n" | |
IDS_WELCOME_TEXT "Choisissez une catГ©gorie Г gauche, ensuite choisissez une application Г installer ou dГ©sinstaller.\nSite internet de ReactOS : " | |
IDS_WELCOME_URL "http://www.reactos.org" | |
@@ -200,9 +202,47 @@ | |
IDS_UNABLE_TO_DOWNLOAD "Impossible de tГ©lГ©charger le paquet : adresse introuvable !" | |
IDS_UNABLE_TO_DOWNLOAD2 "Unable to download the package! Check Internet Connection!" | |
IDS_UNABLE_TO_REMOVE "Impossible de supprimer du registre les donnГ©es du programme !" | |
+ IDS_UNABLE_TO_INSTALL "Unable to open installer!" | |
IDS_CERT_DOES_NOT_MATCH "La vГ©rification du certificat SSL a Г©chouГ©." | |
IDS_INTEG_CHECK_TITLE "VГ©rification de l'intГ©gritГ© du paquet..." | |
IDS_INTEG_CHECK_FAIL "Le contrГґle d'intГ©gritГ© du paquet a Г©chouГ©, il se peut qu'il ait Г©tГ© corrompu ou altГ©rГ© au cours du tГ©lГ©chargement. L'exГ©cution du programme n'est pas recommandГ©e." | |
IDS_INTERRUPTED_DOWNLOAD "The download was interrupted. Check connection to Internet." | |
IDS_UNABLE_TO_WRITE "Unable to write to disk. Disk may be at capacity." | |
+ IDS_SELECT_ALL "Select/Deselect All" | |
+ IDS_INSTALL_SELECTED "Install Selected" | |
END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_STATUS_INSTALLED "Installed" | |
+ IDS_STATUS_NOTINSTALLED "Not installed" | |
+ IDS_STATUS_DOWNLOADED "Downloaded" | |
+ IDS_STATUS_UPDATE_AVAILABLE "Update available" | |
+ IDS_STATUS_DOWNLOADING "Downloading…" | |
+ IDS_STATUS_INSTALLING "Installing…" | |
+ IDS_STATUS_WAITING "Waiting to install…" | |
+ IDS_STATUS_FINISHED "Finished" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LICENSE_OPENSOURCE "Open Source" | |
+ IDS_LICENSE_FREEWARE "Freeware" | |
+ IDS_LICENSE_TRIAL "Trial/Demo" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_LANGUAGE_AVAILABLE_TRANSLATION "Supports your language" | |
+ IDS_LANGUAGE_NO_TRANSLATION "Supports other languages" | |
+ IDS_LANGUAGE_ENGLISH_TRANSLATION "Supports English" | |
+ IDS_LANGUAGE_SINGLE "Single language" | |
+ IDS_LANGUAGE_MORE_PLACEHOLDER " (+%d more)" | |
+ IDS_LANGUAGE_AVAILABLE_PLACEHOLDER " (+%d available)" | |
+END | |
+ | |
+STRINGTABLE | |
+BEGIN | |
+ IDS_DL_DIALOG_DB_DISP "Applications Database" | |
+ IDS_DL_DIALOG_DB_DOWNLOAD_DISP "Updating Database..." | |
+END | |
Index: base/applications/rapps/aboutdlg.cpp | |
=================================================================== | |
--- base/applications/rapps/aboutdlg.cpp (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/aboutdlg.cpp (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -4,36 +4,24 @@ | |
* FILE: base/applications/rapps/aboutdlg.cpp | |
* PURPOSE: About Dialog | |
* PROGRAMMERS: Dmitry Chapyshev (dmitry@reactos.org) | |
+ * Alexander Shaposhikov (chaez.san@gmail.com) | |
*/ | |
+#include "defines.h" | |
-#include "rapps.h" | |
- | |
-static | |
-INT_PTR CALLBACK | |
-AboutDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) | |
+static INT_PTR CALLBACK AboutDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) | |
{ | |
- switch (Msg) | |
+ if (Msg == WM_COMMAND && LOWORD(wParam) == IDOK) | |
{ | |
- case WM_COMMAND: | |
- { | |
- switch (LOWORD(wParam)) | |
- { | |
- case IDOK: | |
- EndDialog(hDlg, LOWORD(wParam)); | |
- break; | |
- } | |
- } | |
- break; | |
+ return EndDialog(hDlg, LOWORD(wParam)); | |
} | |
return FALSE; | |
} | |
-VOID | |
-ShowAboutDialog(VOID) | |
+VOID ShowAboutDialog() | |
{ | |
- DialogBox(hInst, | |
- MAKEINTRESOURCE(IDD_ABOUT_DIALOG), | |
- hMainWnd, | |
- AboutDlgProc); | |
+ DialogBoxW(hInst, | |
+ MAKEINTRESOURCEW(IDD_ABOUT_DIALOG), | |
+ hMainWnd, | |
+ AboutDlgProc); | |
} | |
Index: base/applications/rapps/include/misc.h | |
=================================================================== | |
--- base/applications/rapps/include/misc.h (.../trunk/reactos) (nonexistent) | |
+++ base/applications/rapps/include/misc.h (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -0,0 +1,45 @@ | |
+#pragma once | |
+ | |
+#include <windef.h> | |
+#include <atlstr.h> | |
+ | |
+INT GetWindowWidth(HWND hwnd); | |
+INT GetWindowHeight(HWND hwnd); | |
+INT GetClientWindowWidth(HWND hwnd); | |
+INT GetClientWindowHeight(HWND hwnd); | |
+ | |
+VOID CopyTextToClipboard(LPCWSTR lpszText); | |
+VOID SetWelcomeText(); | |
+VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem); | |
+BOOL StartProcess(ATL::CStringW &Path, BOOL Wait); | |
+BOOL StartProcess(LPWSTR lpPath, BOOL Wait); | |
+BOOL GetStorageDirectory(ATL::CStringW &lpDirectory); | |
+BOOL ExtractFilesFromCab(LPCWSTR lpCabName, LPCWSTR lpOutputPath); | |
+VOID InitLogs(); | |
+VOID FreeLogs(); | |
+BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg); | |
+BOOL GetInstalledVersion(ATL::CStringW *pszVersion, const ATL::CStringW &szRegName); | |
+ | |
+class CConfigParser | |
+{ | |
+ // Locale names cache | |
+ const static INT m_cchLocaleSize = 5; | |
+ | |
+ static ATL::CStringW m_szLocaleID; | |
+ static ATL::CStringW m_szCachedINISectionLocale; | |
+ static ATL::CStringW m_szCachedINISectionLocaleNeutral; | |
+ | |
+ const ATL::CStringW szConfigPath; | |
+ | |
+ static ATL::CStringW GetINIFullPath(const ATL::CStringW& FileName); | |
+ static VOID CacheINILocaleLazy(); | |
+ | |
+public: | |
+ static const ATL::CStringW& GetLocale(); | |
+ static INT CConfigParser::GetLocaleSize(); | |
+ | |
+ CConfigParser(const ATL::CStringW& FileName = ""); | |
+ | |
+ UINT GetString(const ATL::CStringW& KeyName, ATL::CStringW& ResultString); | |
+ UINT GetInt(const ATL::CStringW& KeyName); | |
+}; | |
Property changes on: base/applications/rapps/include/misc.h | |
___________________________________________________________________ | |
Added: svn:eol-style | |
## -0,0 +1 ## | |
+native | |
\ No newline at end of property | |
Index: base/applications/rapps/include/unattended.h | |
=================================================================== | |
--- base/applications/rapps/include/unattended.h (.../trunk/reactos) (nonexistent) | |
+++ base/applications/rapps/include/unattended.h (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -0,0 +1,8 @@ | |
+#pragma once | |
+#include "windef.h" | |
+ | |
+#define CMD_KEY_INSTALL L"/INSTALL" | |
+#define CMD_KEY_SETUP L"/SETUP" | |
+ | |
+// return TRUE if the SETUP key was valid | |
+BOOL CmdParser(LPWSTR lpCmdLine); | |
Property changes on: base/applications/rapps/include/unattended.h | |
___________________________________________________________________ | |
Added: svn:eol-style | |
## -0,0 +1 ## | |
+native | |
\ No newline at end of property | |
Index: base/applications/rapps/include/defines.h | |
=================================================================== | |
--- base/applications/rapps/include/defines.h (.../trunk/reactos) (nonexistent) | |
+++ base/applications/rapps/include/defines.h (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -0,0 +1,34 @@ | |
+#pragma once | |
+ | |
+#define WIN32_NO_STATUS | |
+#define _INC_WINDOWS | |
+#define COM_NO_WINDOWS_H | |
+#define COBJMACROS | |
+#include <tchar.h> | |
+#include <stdarg.h> | |
+ | |
+#include <windef.h> | |
+#include <winbase.h> | |
+#include <winreg.h> | |
+#include <wingdi.h> | |
+#include <winnls.h> | |
+#include <winuser.h> | |
+#include <wincon.h> | |
+#include <richedit.h> | |
+#include <shellapi.h> | |
+#include <shlobj.h> | |
+#include <shlwapi.h> | |
+#include <stdio.h> | |
+#include <strsafe.h> | |
+#include <ndk/rtlfuncs.h> | |
+#include <atlcoll.h> | |
+#include <atlsimpcoll.h> | |
+#include <atlstr.h> | |
+#include <rappsmsg.h> | |
+ | |
+#include "resource.h" | |
+#include "winmain.h" | |
+ | |
+#define APPLICATION_DATABASE_URL L"https://svn.reactos.org/packages/rappmgr.cab" | |
+#define MAX_STR_LEN 256 | |
+#define ENUM_ALL_COMPONENTS 30 | |
Property changes on: base/applications/rapps/include/defines.h | |
___________________________________________________________________ | |
Added: svn:eol-style | |
## -0,0 +1 ## | |
+native | |
\ No newline at end of property | |
Index: base/applications/rapps/include/crichedit.h | |
=================================================================== | |
--- base/applications/rapps/include/crichedit.h (.../trunk/reactos) (nonexistent) | |
+++ base/applications/rapps/include/crichedit.h (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -0,0 +1,120 @@ | |
+#pragma once | |
+#include <rosctrls.h> | |
+ | |
+class CRichEdit : | |
+ public CWindow | |
+{ | |
+ HMODULE LoadedLibrary; | |
+ inline VOID GenericInsertText(LPCWSTR lpszText, LONG InsertedTextLen, DWORD dwEffects) | |
+ { | |
+ SETTEXTEX SetText; | |
+ LONG Len = GetTextLen(); | |
+ | |
+ if (InsertedTextLen) | |
+ { | |
+ /* Insert new text */ | |
+ SetText.flags = ST_SELECTION; | |
+ SetText.codepage = 1200; | |
+ | |
+ SendMessageW(EM_SETTEXTEX, (WPARAM) &SetText, (LPARAM) lpszText); | |
+ | |
+ SetRangeFormatting(Len, Len + InsertedTextLen, | |
+ (dwEffects == CFM_LINK) ? (PathIsURLW(lpszText) ? dwEffects : 0) : dwEffects); | |
+ } | |
+ } | |
+ | |
+public: | |
+ VOID SetRangeFormatting(LONG Start, LONG End, DWORD dwEffects) | |
+ { | |
+ CHARFORMAT2W CharFormat; | |
+ | |
+ SendMessageW(EM_SETSEL, Start, End); | |
+ | |
+ ZeroMemory(&CharFormat, sizeof(CharFormat)); | |
+ | |
+ CharFormat.cbSize = sizeof(CharFormat); | |
+ CharFormat.dwMask = dwEffects; | |
+ CharFormat.dwEffects = dwEffects; | |
+ | |
+ SendMessageW(EM_SETCHARFORMAT, SCF_WORD | SCF_SELECTION, (LPARAM) &CharFormat); | |
+ | |
+ SendMessageW(EM_SETSEL, End, End + 1); | |
+ } | |
+ | |
+ LONG GetTextLen() | |
+ { | |
+ GETTEXTLENGTHEX TxtLenStruct; | |
+ | |
+ TxtLenStruct.flags = GTL_NUMCHARS; | |
+ TxtLenStruct.codepage = 1200; | |
+ | |
+ return (LONG) SendMessageW(EM_GETTEXTLENGTHEX, (WPARAM) &TxtLenStruct, 0); | |
+ } | |
+ | |
+ /* | |
+ * Insert text (without cleaning old text) | |
+ * Supported effects: | |
+ * - CFM_BOLD | |
+ * - CFM_ITALIC | |
+ * - CFM_UNDERLINE | |
+ * - CFM_LINK | |
+ */ | |
+ VOID InsertText(LPCWSTR lpszText, DWORD dwEffects) | |
+ { | |
+ GenericInsertText(lpszText, wcslen(lpszText), dwEffects); | |
+ } | |
+ | |
+ VOID InsertText(const ATL::CStringW& szText, DWORD dwEffects) | |
+ { | |
+ GenericInsertText(szText.GetString(), szText.GetLength(), dwEffects); | |
+ } | |
+ /* | |
+ * Clear old text and add new | |
+ */ | |
+ VOID SetText(LPCWSTR lpszText, DWORD dwEffects) | |
+ { | |
+ SetWindowTextW(L""); | |
+ InsertText(lpszText, dwEffects); | |
+ } | |
+ | |
+ VOID SetText(const ATL::CStringW& szText, DWORD dwEffects) | |
+ { | |
+ SetText(szText.GetString(), dwEffects); | |
+ } | |
+ | |
+ HWND Create(HWND hwndParent) | |
+ { | |
+ LoadedLibrary = LoadLibraryW(L"riched20.dll"); | |
+ | |
+ m_hWnd = CreateWindowExW(0, | |
+ L"RichEdit20W", | |
+ NULL, | |
+ WS_CHILD | WS_VISIBLE | ES_MULTILINE | | |
+ ES_LEFT | ES_READONLY, | |
+ 205, 28, 465, 100, | |
+ hwndParent, | |
+ NULL, | |
+ _AtlBaseModule.GetModuleInstance(), | |
+ NULL); | |
+ | |
+ if (m_hWnd) | |
+ { | |
+ SendMessageW(EM_SETBKGNDCOLOR, 0, GetSysColor(COLOR_BTNFACE)); | |
+ SendMessageW(WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
+ SendMessageW(EM_SETEVENTMASK, 0, ENM_LINK | ENM_MOUSEEVENTS); | |
+ SendMessageW(EM_SHOWSCROLLBAR, SB_VERT, TRUE); | |
+ } | |
+ | |
+ return m_hWnd; | |
+ } | |
+ | |
+ virtual VOID OnLink(ENLINK *Link) | |
+ { | |
+ } | |
+ | |
+ ~CRichEdit() | |
+ { | |
+ FreeLibrary(LoadedLibrary); | |
+ } | |
+ | |
+}; | |
Property changes on: base/applications/rapps/include/crichedit.h | |
___________________________________________________________________ | |
Added: svn:eol-style | |
## -0,0 +1 ## | |
+native | |
\ No newline at end of property | |
Index: base/applications/rapps/include/installed.h | |
=================================================================== | |
--- base/applications/rapps/include/installed.h (.../trunk/reactos) (nonexistent) | |
+++ base/applications/rapps/include/installed.h (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -0,0 +1,29 @@ | |
+#pragma once | |
+ | |
+#include <windef.h> | |
+#include <atlstr.h> | |
+ | |
+#define ENUM_APPLICATIONS 31 | |
+#define ENUM_UPDATES 32 | |
+ | |
+#define ENUM_INSTALLED_MIN ENUM_ALL_COMPONENTS | |
+#define ENUM_INSTALLED_MAX ENUM_UPDATES | |
+ | |
+#define IS_INSTALLED_ENUM(a) (a >= ENUM_INSTALLED_MIN && a <= ENUM_INSTALLED_MAX) | |
+ | |
+struct INSTALLED_INFO | |
+{ | |
+ HKEY hRootKey; | |
+ HKEY hSubKey; | |
+ ATL::CStringW szKeyName; | |
+}; | |
+typedef INSTALLED_INFO *PINSTALLED_INFO; | |
+typedef BOOL(CALLBACK *APPENUMPROC)(INT ItemIndex, ATL::CStringW &Name, PINSTALLED_INFO Info); | |
+ | |
+BOOL EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc); | |
+BOOL GetApplicationString(HKEY hKey, LPCWSTR lpKeyName, LPWSTR szString); | |
+BOOL GetApplicationString(HKEY hKey, LPCWSTR RegName, ATL::CStringW &String); | |
+ | |
+BOOL ShowInstalledAppInfo(INT Index); | |
+BOOL UninstallApplication(INT Index, BOOL bModify); | |
+VOID RemoveAppFromRegistry(INT Index); | |
Property changes on: base/applications/rapps/include/installed.h | |
___________________________________________________________________ | |
Added: svn:eol-style | |
## -0,0 +1 ## | |
+native | |
\ No newline at end of property | |
Index: base/applications/rapps/include/available.h | |
=================================================================== | |
--- base/applications/rapps/include/available.h (.../trunk/reactos) (nonexistent) | |
+++ base/applications/rapps/include/available.h (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -0,0 +1,130 @@ | |
+#pragma once | |
+ | |
+#include <windef.h> | |
+#include <atlstr.h> | |
+#include <atlsimpcoll.h> | |
+#include <atlcoll.h> | |
+#include "misc.h" | |
+ | |
+/* EnumType flags for EnumAvailableApplications */ | |
+enum AvailableCategories | |
+{ | |
+ ENUM_ALL_AVAILABLE, | |
+ ENUM_CAT_AUDIO, | |
+ ENUM_CAT_VIDEO, | |
+ ENUM_CAT_GRAPHICS, | |
+ ENUM_CAT_GAMES, | |
+ ENUM_CAT_INTERNET, | |
+ ENUM_CAT_OFFICE, | |
+ ENUM_CAT_DEVEL, | |
+ ENUM_CAT_EDU, | |
+ ENUM_CAT_ENGINEER, | |
+ ENUM_CAT_FINANCE, | |
+ ENUM_CAT_SCIENCE, | |
+ ENUM_CAT_TOOLS, | |
+ ENUM_CAT_DRIVERS, | |
+ ENUM_CAT_LIBS, | |
+ ENUM_CAT_OTHER, | |
+ ENUM_AVAILABLE_MIN = ENUM_ALL_AVAILABLE, | |
+ ENUM_AVAILABLE_MAX = ENUM_CAT_OTHER | |
+}; | |
+ | |
+inline BOOL IsAvailableEnum(INT x) | |
+{ | |
+ return (x >= ENUM_AVAILABLE_MIN && x <= ENUM_AVAILABLE_MAX); | |
+} | |
+ | |
+typedef enum LICENSE_TYPE | |
+{ | |
+ None, | |
+ OpenSource, | |
+ Freeware, | |
+ Trial, | |
+ Max = Trial, | |
+ Min = None | |
+} *PLICENSE_TYPE; | |
+ | |
+struct CAvailableApplicationInfo | |
+{ | |
+ INT Category; | |
+ LICENSE_TYPE LicenseType; | |
+ ATL::CStringW szName; | |
+ ATL::CStringW szRegName; | |
+ ATL::CStringW szVersion; | |
+ ATL::CStringW szLicense; | |
+ ATL::CStringW szDesc; | |
+ ATL::CStringW szSize; | |
+ ATL::CStringW szUrlSite; | |
+ ATL::CStringW szUrlDownload; | |
+ ATL::CStringW szCDPath; | |
+ ATL::CSimpleArray<LCID> Languages; | |
+ | |
+ // Caching mechanism related entries | |
+ ATL::CStringW sFileName; | |
+ FILETIME ftCacheStamp; | |
+ | |
+ // Optional integrity checks (SHA-1 digests are 160 bit = 40 characters in hex string form) | |
+ ATL::CStringW szSHA1; | |
+ ATL::CStringW szInstalledVersion; | |
+ | |
+ CAvailableApplicationInfo(const ATL::CStringW& sFileNameParam); | |
+ | |
+ // Load all info from the file | |
+ VOID RefreshAppInfo(); | |
+ BOOL HasLanguageInfo() const; | |
+ BOOL HasNativeLanguage() const; | |
+ BOOL HasEnglishLanguage() const; | |
+ BOOL IsInstalled() const; | |
+ BOOL HasInstalledVersion() const; | |
+ BOOL HasUpdate() const; | |
+ | |
+ // Set a timestamp | |
+ VOID SetLastWriteTime(FILETIME* ftTime); | |
+ | |
+private: | |
+ BOOL m_IsInstalled = FALSE; | |
+ BOOL m_HasLanguageInfo = FALSE; | |
+ BOOL m_HasInstalledVersion = FALSE; | |
+ CConfigParser m_Parser; | |
+ | |
+ inline BOOL GetString(LPCWSTR lpKeyName, ATL::CStringW& ReturnedString); | |
+ | |
+ // Lazily load general info from the file | |
+ VOID RetrieveGeneralInfo(); | |
+ VOID RetrieveInstalledStatus(); | |
+ VOID RetrieveInstalledVersion(); | |
+ VOID RetrieveLanguages(); | |
+ VOID RetrieveLicenseType(); | |
+ inline BOOL FindInLanguages(LCID what) const; | |
+}; | |
+ | |
+typedef BOOL(CALLBACK *AVAILENUMPROC)(CAvailableApplicationInfo *Info, LPCWSTR szFolderPath); | |
+ | |
+class CAvailableApps | |
+{ | |
+ ATL::CAtlList<CAvailableApplicationInfo*> m_InfoList; | |
+ static ATL::CStringW m_szPath; | |
+ static ATL::CStringW m_szCabPath; | |
+ static ATL::CStringW m_szAppsPath; | |
+ static ATL::CStringW m_szSearchPath; | |
+ | |
+ static BOOL InitializeStaticStrings(); | |
+ | |
+public: | |
+ CAvailableApps(); | |
+ | |
+ static BOOL UpdateAppsDB(); | |
+ static BOOL ForceUpdateAppsDB(); | |
+ | |
+ VOID FreeCachedEntries(); | |
+ static VOID DeleteCurrentAppsDB(); | |
+ BOOL EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc); | |
+ CAvailableApplicationInfo* FindInfo(const ATL::CStringW& szAppName); | |
+ ATL::CSimpleArray<CAvailableApplicationInfo*> FindInfoList(const ATL::CSimpleArray<ATL::CStringW> &arrAppsNames); | |
+ const ATL::CStringW& GetFolderPath(); | |
+ const ATL::CStringW& GetAppPath(); | |
+ const ATL::CStringW& GetCabPath(); | |
+ const LPCWSTR GetFolderPathString(); | |
+ const LPCWSTR GetAppPathString(); | |
+ const LPCWSTR GetCabPathString(); | |
+}; | |
Property changes on: base/applications/rapps/include/available.h | |
___________________________________________________________________ | |
Added: svn:eol-style | |
## -0,0 +1 ## | |
+native | |
\ No newline at end of property | |
Index: base/applications/rapps/include/rosui.h | |
=================================================================== | |
--- base/applications/rapps/include/rosui.h (.../trunk/reactos) (nonexistent) | |
+++ base/applications/rapps/include/rosui.h (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -0,0 +1,803 @@ | |
+/* PROJECT: ReactOS UI Layout Engine | |
+ * LICENSE: GPL - See COPYING in the top level directory | |
+ * AUTHORS: David Quintana <gigaherz@gmail.com> | |
+ */ | |
+#pragma once | |
+ | |
+#include <atlwin.h> | |
+ | |
+template<class T, INT GrowthRate = 10> | |
+class CPointerArray | |
+{ | |
+protected: | |
+ HDPA m_hDpa; | |
+ | |
+public: | |
+ CPointerArray() | |
+ { | |
+ m_hDpa = DPA_Create(GrowthRate); | |
+ } | |
+ | |
+ ~CPointerArray() | |
+ { | |
+ DPA_DestroyCallback(m_hDpa, s_OnRemoveItem, this); | |
+ } | |
+ | |
+private: | |
+ static INT CALLBACK s_OnRemoveItem(PVOID ptr, PVOID context) | |
+ { | |
+ CPointerArray * self = (CPointerArray*) context; | |
+ return (INT) self->OnRemoveItem(reinterpret_cast<T*>(ptr)); | |
+ } | |
+ | |
+ static INT CALLBACK s_OnCompareItems(PVOID p1, PVOID p2, LPARAM lParam) | |
+ { | |
+ CPointerArray * self = (CPointerArray*) lParam; | |
+ return self->OnCompareItems(reinterpret_cast<T*>(p1), reinterpret_cast<T*>(p2)); | |
+ } | |
+ | |
+public: | |
+ virtual BOOL OnRemoveItem(T * ptr) | |
+ { | |
+ return TRUE; | |
+ } | |
+ | |
+ virtual INT OnCompareItems(T * p1, T * p2) | |
+ { | |
+ INT t = (reinterpret_cast<INT>(p2) - reinterpret_cast<INT>(p1)); | |
+ if (t > 0) | |
+ return 1; | |
+ if (t < 0) | |
+ return -1; | |
+ return 0; | |
+ } | |
+ | |
+public: | |
+ INT GetCount() const | |
+ { | |
+ return DPA_GetPtrCount(m_hDpa); | |
+ } | |
+ | |
+ T* Get(INT i) const | |
+ { | |
+ return (T*) DPA_GetPtr(m_hDpa, i); | |
+ } | |
+ | |
+ BOOL Set(INT i, T* ptr) | |
+ { | |
+ return DPA_SetPtr(m_hDpa, i, ptr); | |
+ } | |
+ | |
+ INT Insert(INT at, T* ptr) | |
+ { | |
+ return DPA_InsertPtr(m_hDpa, at, ptr); | |
+ } | |
+ | |
+ INT Append(T* ptr) | |
+ { | |
+ return DPA_InsertPtr(m_hDpa, DA_LAST, ptr); | |
+ } | |
+ | |
+ INT IndexOf(T* ptr) const | |
+ { | |
+ return DPA_GetPtrIndex(m_hDpa, ptr); | |
+ } | |
+ | |
+ BOOL Remove(T* ptr) | |
+ { | |
+ INT i = IndexOf(ptr); | |
+ if (i < 0) | |
+ return FALSE; | |
+ return RemoveAt(i); | |
+ } | |
+ | |
+ BOOL RemoveAt(INT i) | |
+ { | |
+ T* ptr = (T*) DPA_GetPtr(m_hDpa, i); | |
+ OnRemoveItem(ptr); | |
+ return DPA_DeletePtr(m_hDpa, i); | |
+ } | |
+ | |
+ BOOL Clear() | |
+ { | |
+ DPA_EnumCallback(s_OnRemoveItem, this); | |
+ return DPA_DeleteAllPtrs(m_hDpa); | |
+ } | |
+ | |
+ BOOL Sort() | |
+ { | |
+ return DPA_Sort(m_hDpa, s_OnCompareItems, (LPARAM)this); | |
+ } | |
+ | |
+ INT Search(T* item, INT iStart, UINT uFlags) | |
+ { | |
+ return DPA_Search(m_hDpa, s_OnCompareItems, (LPARAM)this); | |
+ } | |
+}; | |
+ | |
+class CUiRect | |
+ : public RECT | |
+{ | |
+public: | |
+ CUiRect() | |
+ { | |
+ left = right = top = bottom = 0; | |
+ } | |
+ | |
+ CUiRect(INT l, INT t, INT r, INT b) | |
+ { | |
+ left = l; | |
+ right = r; | |
+ top = t; | |
+ bottom = b; | |
+ } | |
+}; | |
+ | |
+class CUiMargin | |
+ : public CUiRect | |
+{ | |
+public: | |
+ CUiMargin() | |
+ { | |
+ } | |
+ | |
+ CUiMargin(INT all) | |
+ : CUiRect(all, all, all, all) | |
+ { | |
+ } | |
+ | |
+ CUiMargin(INT horz, INT vert) | |
+ : CUiRect(horz, vert, horz, vert) | |
+ { | |
+ } | |
+}; | |
+ | |
+class CUiMeasure | |
+{ | |
+public: | |
+ enum MeasureType | |
+ { | |
+ Type_FitContent = 0, | |
+ Type_Fixed = 1, | |
+ Type_Percent = 2, | |
+ Type_FitParent = 3 | |
+ }; | |
+ | |
+private: | |
+ MeasureType m_Type; | |
+ INT m_Value; | |
+ | |
+public: | |
+ CUiMeasure() | |
+ { | |
+ m_Type = Type_FitContent; | |
+ m_Value = 0; | |
+ } | |
+ | |
+ CUiMeasure(MeasureType type, INT value) | |
+ { | |
+ m_Type = type; | |
+ m_Value = value; | |
+ } | |
+ | |
+ INT ComputeMeasure(INT parent, INT content) | |
+ { | |
+ switch (m_Type) | |
+ { | |
+ case Type_FitContent: | |
+ return content; | |
+ case Type_Fixed: | |
+ return m_Value; | |
+ case Type_Percent: | |
+ return max(content, parent * m_Value / 100); | |
+ case Type_FitParent: | |
+ return parent; | |
+ } | |
+ | |
+ return 0; | |
+ } | |
+ | |
+public: | |
+ static CUiMeasure FitContent() | |
+ { | |
+ return CUiMeasure(Type_FitContent, 0); | |
+ } | |
+ | |
+ static CUiMeasure FitParent() | |
+ { | |
+ return CUiMeasure(Type_FitParent, 0); | |
+ } | |
+ | |
+ static CUiMeasure Fixed(INT pixels) | |
+ { | |
+ return CUiMeasure(Type_Fixed, pixels); | |
+ } | |
+ | |
+ static CUiMeasure Percent(INT percent) | |
+ { | |
+ return CUiMeasure(Type_Percent, percent); | |
+ } | |
+}; | |
+ | |
+enum CUiAlignment | |
+{ | |
+ UiAlign_LeftTop, | |
+ UiAlign_Middle, | |
+ UiAlign_RightBtm, | |
+ UiAlign_Stretch | |
+}; | |
+ | |
+class CUiBox | |
+{ | |
+public: | |
+ CUiMargin m_Margin; | |
+ | |
+ CUiAlignment m_HorizontalAlignment; | |
+ CUiAlignment m_VerticalAlignment; | |
+ | |
+protected: | |
+ CUiBox() | |
+ { | |
+ m_HorizontalAlignment = UiAlign_LeftTop; | |
+ m_VerticalAlignment = UiAlign_LeftTop; | |
+ } | |
+ | |
+ virtual VOID ComputeRect(RECT parentRect, RECT currentRect, RECT* newRect) | |
+ { | |
+ parentRect.left += m_Margin.left; | |
+ parentRect.right -= m_Margin.right; | |
+ parentRect.top += m_Margin.top; | |
+ parentRect.bottom -= m_Margin.bottom; | |
+ | |
+ if (parentRect.right < parentRect.left) | |
+ parentRect.right = parentRect.left; | |
+ | |
+ if (parentRect.bottom < parentRect.top) | |
+ parentRect.bottom = parentRect.top; | |
+ | |
+ SIZE szParent = {parentRect.right - parentRect.left, parentRect.bottom - parentRect.top}; | |
+ SIZE szCurrent = {currentRect.right - currentRect.left, currentRect.bottom - currentRect.top}; | |
+ | |
+ currentRect = parentRect; | |
+ | |
+ switch (m_HorizontalAlignment) | |
+ { | |
+ case UiAlign_LeftTop: | |
+ currentRect.right = currentRect.left + szCurrent.cx; | |
+ break; | |
+ case UiAlign_Middle: | |
+ currentRect.left = parentRect.left + (szParent.cx - szCurrent.cx) / 2; | |
+ currentRect.right = currentRect.left + szCurrent.cx; | |
+ break; | |
+ case UiAlign_RightBtm: | |
+ currentRect.left = currentRect.right - szCurrent.cx; | |
+ break; | |
+ default: | |
+ break; | |
+ } | |
+ | |
+ switch (m_VerticalAlignment) | |
+ { | |
+ case UiAlign_LeftTop: | |
+ currentRect.bottom = currentRect.top + szCurrent.cy; | |
+ break; | |
+ case UiAlign_Middle: | |
+ currentRect.top = parentRect.top + (szParent.cy - szCurrent.cy) / 2; | |
+ currentRect.bottom = currentRect.top + szCurrent.cy; | |
+ break; | |
+ case UiAlign_RightBtm: | |
+ currentRect.top = currentRect.bottom - szCurrent.cy; | |
+ break; | |
+ default: | |
+ break; | |
+ } | |
+ | |
+ *newRect = currentRect; | |
+ } | |
+ | |
+ | |
+public: | |
+ virtual VOID ComputeMinimalSize(SIZE* size) | |
+ { | |
+ // Override in subclass | |
+ size->cx = max(size->cx, 0); | |
+ size->cy = min(size->cy, 0); | |
+ }; | |
+ | |
+ virtual VOID ComputeContentBounds(RECT* rect) | |
+ { | |
+ // Override in subclass | |
+ }; | |
+ | |
+ virtual DWORD_PTR CountSizableChildren() | |
+ { | |
+ // Override in subclass | |
+ return 0; | |
+ }; | |
+ | |
+ virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp) | |
+ { | |
+ // Override in subclass | |
+ return NULL; | |
+ }; | |
+}; | |
+ | |
+class CUiPrimitive | |
+{ | |
+protected: | |
+ CUiPrimitive * m_Parent; | |
+ | |
+public: | |
+ virtual ~CUiPrimitive() {} | |
+ | |
+ virtual CUiBox * AsBox() { return NULL; } | |
+}; | |
+ | |
+class CUiCollection : | |
+ public CPointerArray < CUiPrimitive > | |
+{ | |
+ virtual BOOL OnRemoveItem(CUiPrimitive * ptr) | |
+ { | |
+ delete ptr; | |
+ return TRUE; | |
+ } | |
+}; | |
+ | |
+class CUiContainer | |
+{ | |
+protected: | |
+ CUiCollection m_Children; | |
+ | |
+public: | |
+ CUiCollection& Children() { return m_Children; } | |
+}; | |
+ | |
+class CUiPanel : | |
+ public CUiPrimitive, | |
+ public CUiBox, | |
+ public CUiContainer | |
+{ | |
+public: | |
+ CUiMeasure m_Width; | |
+ CUiMeasure m_Height; | |
+ | |
+ CUiPanel() | |
+ { | |
+ m_Width = CUiMeasure::FitParent(); | |
+ m_Height = CUiMeasure::FitParent(); | |
+ } | |
+ | |
+ virtual ~CUiPanel() | |
+ { | |
+ } | |
+ | |
+ virtual CUiBox * AsBox() { return this; } | |
+ | |
+ virtual VOID ComputeMinimalSize(SIZE* size) | |
+ { | |
+ for (INT i = 0; i < m_Children.GetCount(); i++) | |
+ { | |
+ CUiBox * box = m_Children.Get(i)->AsBox(); | |
+ if (box) | |
+ { | |
+ box->ComputeMinimalSize(size); | |
+ } | |
+ } | |
+ }; | |
+ | |
+ virtual VOID ComputeContentBounds(RECT* rect) | |
+ { | |
+ for (INT i = 0; i < m_Children.GetCount(); i++) | |
+ { | |
+ CUiBox * box = m_Children.Get(i)->AsBox(); | |
+ if (box) | |
+ { | |
+ box->ComputeContentBounds(rect); | |
+ } | |
+ } | |
+ }; | |
+ | |
+ virtual DWORD_PTR CountSizableChildren() | |
+ { | |
+ INT count = 0; | |
+ for (INT i = 0; i < m_Children.GetCount(); i++) | |
+ { | |
+ CUiBox * box = m_Children.Get(i)->AsBox(); | |
+ if (box) | |
+ { | |
+ count += box->CountSizableChildren(); | |
+ } | |
+ } | |
+ return count; | |
+ } | |
+ | |
+ virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp) | |
+ { | |
+ RECT rect = {0}; | |
+ | |
+ SIZE content = {0}; | |
+ ComputeMinimalSize(&content); | |
+ | |
+ INT preferredWidth = m_Width.ComputeMeasure(parentRect.right - parentRect.left, content.cx); | |
+ INT preferredHeight = m_Height.ComputeMeasure(parentRect.bottom - parentRect.top, content.cy); | |
+ | |
+ rect.right = preferredWidth; | |
+ rect.bottom = preferredHeight; | |
+ | |
+ ComputeRect(parentRect, rect, &rect); | |
+ | |
+ for (INT i = 0; i < m_Children.GetCount(); i++) | |
+ { | |
+ CUiBox * box = m_Children.Get(i)->AsBox(); | |
+ if (box) | |
+ { | |
+ hDwp = box->OnParentSize(rect, hDwp); | |
+ } | |
+ } | |
+ | |
+ return hDwp; | |
+ } | |
+}; | |
+ | |
+template<class T = CWindow> | |
+class CUiWindow : | |
+ public CUiPrimitive, | |
+ public CUiBox, | |
+ public T | |
+{ | |
+public: | |
+ virtual CUiBox * AsBox() { return this; } | |
+ | |
+ HWND GetWindow() { return T::m_hWnd; } | |
+ | |
+ virtual VOID ComputeMinimalSize(SIZE* size) | |
+ { | |
+ // TODO: Maybe use WM_GETMINMAXINFO? | |
+ return CUiBox::ComputeMinimalSize(size); | |
+ }; | |
+ | |
+ virtual VOID ComputeContentBounds(RECT* rect) | |
+ { | |
+ RECT r; | |
+ ::GetWindowRect(T::m_hWnd, &r); | |
+ rect->left = min(rect->left, r.left); | |
+ rect->top = min(rect->top, r.top); | |
+ rect->right = max(rect->right, r.right); | |
+ rect->bottom = max(rect->bottom, r.bottom); | |
+ }; | |
+ | |
+ virtual DWORD_PTR CountSizableChildren() | |
+ { | |
+ return 1; | |
+ }; | |
+ | |
+ virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp) | |
+ { | |
+ RECT rect; | |
+ | |
+ ::GetWindowRect(T::m_hWnd, &rect); | |
+ | |
+ ComputeRect(parentRect, rect, &rect); | |
+ | |
+ if (hDwp) | |
+ { | |
+ return ::DeferWindowPos(hDwp, T::m_hWnd, NULL, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOACTIVATE | SWP_NOZORDER); | |
+ } | |
+ else | |
+ { | |
+ T::SetWindowPos(NULL, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, SWP_NOACTIVATE | SWP_NOZORDER | SWP_DEFERERASE); | |
+ return NULL; | |
+ } | |
+ }; | |
+ | |
+ virtual ~CUiWindow() | |
+ { | |
+ T::DestroyWindow(); | |
+ } | |
+ | |
+ VOID GetWindowTextW(ATL::CStringW& szText) | |
+ { | |
+ INT length = CWindow::GetWindowTextLengthW() + 1; | |
+ CWindow::GetWindowTextW(szText.GetBuffer(length), length); | |
+ szText.ReleaseBuffer(); | |
+ } | |
+}; | |
+ | |
+class CUiSplitPanel : | |
+ public CUiPrimitive, | |
+ public CUiBox, | |
+ public CWindowImpl<CUiSplitPanel> | |
+{ | |
+ static const INT THICKNESS = 4; | |
+ | |
+protected: | |
+ | |
+ HCURSOR m_hCursor; | |
+ | |
+ CUiPanel m_First; | |
+ CUiPanel m_Second; | |
+ | |
+ RECT m_LastRect; | |
+ | |
+ BOOL m_HasOldRect; | |
+ | |
+public: | |
+ INT m_Pos; | |
+ BOOL m_Horizontal; | |
+ BOOL m_DynamicFirst; | |
+ INT m_MinFirst; | |
+ INT m_MinSecond; | |
+ | |
+ CUiMeasure m_Width; | |
+ CUiMeasure m_Height; | |
+ | |
+ CUiSplitPanel() | |
+ { | |
+ m_Width = CUiMeasure::FitParent(); | |
+ m_Height = CUiMeasure::FitParent(); | |
+ m_Pos = 100; | |
+ m_MinFirst = 100; | |
+ m_MinSecond = 100; | |
+ m_DynamicFirst = FALSE; | |
+ m_HasOldRect = FALSE; | |
+ } | |
+ | |
+ virtual ~CUiSplitPanel() | |
+ { | |
+ } | |
+ | |
+ virtual CUiBox * AsBox() { return this; } | |
+ | |
+ CUiCollection& First() { return m_First.Children(); } | |
+ CUiCollection& Second() { return m_Second.Children(); } | |
+ | |
+ virtual VOID ComputeMinimalSize(SIZE* size) | |
+ { | |
+ if (m_Horizontal) | |
+ size->cx = max(size->cx, THICKNESS); | |
+ else | |
+ size->cy = max(size->cy, THICKNESS); | |
+ m_First.ComputeMinimalSize(size); | |
+ m_Second.ComputeMinimalSize(size); | |
+ }; | |
+ | |
+ virtual VOID ComputeContentBounds(RECT* rect) | |
+ { | |
+ RECT r; | |
+ | |
+ m_First.ComputeContentBounds(rect); | |
+ m_Second.ComputeContentBounds(rect); | |
+ | |
+ ::GetWindowRect(m_hWnd, &r); | |
+ | |
+ rect->left = min(rect->left, r.left); | |
+ rect->top = min(rect->top, r.top); | |
+ rect->right = max(rect->right, r.right); | |
+ rect->bottom = max(rect->bottom, r.bottom); | |
+ }; | |
+ | |
+ virtual DWORD_PTR CountSizableChildren() | |
+ { | |
+ INT count = 1; | |
+ count += m_First.CountSizableChildren(); | |
+ count += m_Second.CountSizableChildren(); | |
+ return count; | |
+ }; | |
+ | |
+ virtual HDWP OnParentSize(RECT parentRect, HDWP hDwp) | |
+ { | |
+ RECT rect = {0}; | |
+ | |
+ SIZE content = {0}; | |
+ ComputeMinimalSize(&content); | |
+ | |
+ INT preferredWidth = m_Width.ComputeMeasure(parentRect.right - parentRect.left, content.cx); | |
+ INT preferredHeight = m_Width.ComputeMeasure(parentRect.bottom - parentRect.top, content.cy); | |
+ | |
+ rect.right = preferredWidth; | |
+ rect.bottom = preferredHeight; | |
+ | |
+ ComputeRect(parentRect, rect, &rect); | |
+ | |
+ SIZE growth = {0}; | |
+ if (m_HasOldRect) | |
+ { | |
+ RECT oldRect = m_LastRect; | |
+ | |
+ growth.cx = (parentRect.right - parentRect.left) - (oldRect.right - oldRect.left); | |
+ growth.cy = (parentRect.bottom - parentRect.top) - (oldRect.bottom - oldRect.top); | |
+ } | |
+ | |
+ RECT splitter = rect; | |
+ RECT first = rect; | |
+ RECT second = rect; | |
+ | |
+ if (m_Horizontal) | |
+ { | |
+ rect.top += m_MinFirst; | |
+ rect.bottom -= THICKNESS + m_MinSecond; | |
+ if (m_DynamicFirst) | |
+ { | |
+ if (growth.cy > 0) | |
+ { | |
+ m_Pos += min(growth.cy, rect.bottom - (m_Pos + THICKNESS)); | |
+ } | |
+ else if (growth.cy < 0) | |
+ { | |
+ m_Pos += max(growth.cy, rect.top - m_Pos); | |
+ } | |
+ } | |
+ | |
+ if (m_Pos > rect.bottom) | |
+ m_Pos = rect.bottom; | |
+ | |
+ if (m_Pos < rect.top) | |
+ m_Pos = rect.top; | |
+ | |
+ splitter.top = m_Pos; | |
+ splitter.bottom = m_Pos + THICKNESS; | |
+ first.bottom = splitter.top; | |
+ second.top = splitter.bottom; | |
+ } | |
+ else | |
+ { | |
+ rect.left += m_MinFirst; | |
+ rect.right -= THICKNESS + m_MinSecond; | |
+ if (m_DynamicFirst) | |
+ { | |
+ if (growth.cx > 0) | |
+ { | |
+ m_Pos += min(growth.cx, rect.right - (m_Pos + THICKNESS)); | |
+ } | |
+ else if (growth.cx < 0) | |
+ { | |
+ m_Pos += max(growth.cy, rect.left - m_Pos); | |
+ } | |
+ } | |
+ | |
+ if (m_Pos > rect.right) | |
+ m_Pos = rect.right; | |
+ | |
+ if (m_Pos < rect.left) | |
+ m_Pos = rect.left; | |
+ | |
+ splitter.left = m_Pos; | |
+ splitter.right = m_Pos + THICKNESS; | |
+ first.right = splitter.left; | |
+ second.left = splitter.right; | |
+ } | |
+ | |
+ m_LastRect = parentRect; | |
+ m_HasOldRect = TRUE; | |
+ | |
+ hDwp = m_First.OnParentSize(first, hDwp); | |
+ hDwp = m_Second.OnParentSize(second, hDwp); | |
+ | |
+ if (hDwp) | |
+ { | |
+ return DeferWindowPos(hDwp, NULL, | |
+ splitter.left, splitter.top, | |
+ splitter.right - splitter.left, | |
+ splitter.bottom - splitter.top, | |
+ SWP_NOACTIVATE | SWP_NOZORDER); | |
+ } | |
+ else | |
+ { | |
+ SetWindowPos(NULL, | |
+ splitter.left, splitter.top, | |
+ splitter.right - splitter.left, | |
+ splitter.bottom - splitter.top, | |
+ SWP_NOACTIVATE | SWP_NOZORDER); | |
+ return NULL; | |
+ } | |
+ }; | |
+ | |
+private: | |
+ BOOL ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT& theResult, DWORD dwMapId) | |
+ { | |
+ theResult = 0; | |
+ switch (Msg) | |
+ { | |
+ case WM_SETCURSOR: | |
+ SetCursor(m_hCursor); | |
+ theResult = TRUE; | |
+ break; | |
+ | |
+ case WM_LBUTTONDOWN: | |
+ SetCapture(); | |
+ break; | |
+ | |
+ case WM_LBUTTONUP: | |
+ case WM_RBUTTONDOWN: | |
+ if (GetCapture() == m_hWnd) | |
+ { | |
+ ReleaseCapture(); | |
+ } | |
+ break; | |
+ | |
+ case WM_MOUSEMOVE: | |
+ if (GetCapture() == m_hWnd) | |
+ { | |
+ POINT Point; | |
+ GetCursorPos(&Point); | |
+ ::ScreenToClient(GetParent(), &Point); | |
+ if (m_Horizontal) | |
+ SetPos(Point.y); | |
+ else | |
+ SetPos(Point.x); | |
+ } | |
+ break; | |
+ | |
+ default: | |
+ return FALSE; | |
+ } | |
+ | |
+ return TRUE; | |
+ } | |
+ | |
+public: | |
+ INT GetPos() | |
+ { | |
+ return m_Pos; | |
+ } | |
+ | |
+ VOID SetPos(INT NewPos) | |
+ { | |
+ RECT rcParent; | |
+ | |
+ rcParent = m_LastRect; | |
+ | |
+ if (m_Horizontal) | |
+ { | |
+ rcParent.bottom -= THICKNESS; | |
+ | |
+ m_Pos = NewPos; | |
+ | |
+ if (m_Pos < rcParent.top) | |
+ m_Pos = rcParent.top; | |
+ | |
+ if (m_Pos > rcParent.bottom) | |
+ m_Pos = rcParent.bottom; | |
+ } | |
+ else | |
+ { | |
+ rcParent.right -= THICKNESS; | |
+ | |
+ m_Pos = NewPos; | |
+ | |
+ if (m_Pos < rcParent.left) | |
+ m_Pos = rcParent.left; | |
+ | |
+ if (m_Pos > rcParent.right) | |
+ m_Pos = rcParent.right; | |
+ } | |
+ | |
+ INT count = CountSizableChildren(); | |
+ | |
+ HDWP hdwp = NULL; | |
+ hdwp = BeginDeferWindowPos(count); | |
+ if (hdwp) hdwp = OnParentSize(m_LastRect, hdwp); | |
+ if (hdwp) EndDeferWindowPos(hdwp); | |
+ } | |
+ | |
+public: | |
+ DECLARE_WND_CLASS_EX(_T("SplitterWindowClass"), CS_HREDRAW | CS_VREDRAW, COLOR_BTNFACE) | |
+ | |
+ /* Create splitter bar */ | |
+ HWND Create(HWND hwndParent) | |
+ { | |
+ if (m_Horizontal) | |
+ m_hCursor = LoadCursor(0, IDC_SIZENS); | |
+ else | |
+ m_hCursor = LoadCursor(0, IDC_SIZEWE); | |
+ | |
+ DWORD style = WS_CHILD | WS_VISIBLE; | |
+ DWORD exStyle = WS_EX_TRANSPARENT; | |
+ | |
+ RECT size = {205, 180, 465, THICKNESS}; | |
+ size.right += size.left; | |
+ size.bottom += size.top; | |
+ | |
+ return CWindowImpl::Create(hwndParent, size, NULL, style, exStyle); | |
+ } | |
+}; | |
Property changes on: base/applications/rapps/include/rosui.h | |
___________________________________________________________________ | |
Added: svn:eol-style | |
## -0,0 +1 ## | |
+native | |
\ No newline at end of property | |
Index: base/applications/rapps/include/dialogs.h | |
=================================================================== | |
--- base/applications/rapps/include/dialogs.h (.../trunk/reactos) (nonexistent) | |
+++ base/applications/rapps/include/dialogs.h (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -0,0 +1,42 @@ | |
+#pragma once | |
+ | |
+#include "available.h" | |
+ | |
+#include <windef.h> | |
+#include <atlsimpcoll.h> | |
+ | |
+// Download dialog (loaddlg.cpp) | |
+class CDowloadingAppsListView; | |
+struct DownloadInfo; | |
+ | |
+class CDownloadManager | |
+{ | |
+ static ATL::CSimpleArray<DownloadInfo> AppsToInstallList; | |
+ static CDowloadingAppsListView DownloadsListView; | |
+ static INT iCurrentApp; | |
+ | |
+ static VOID Download(const DownloadInfo& DLInfo, BOOL bIsModal = FALSE); | |
+public: | |
+ static INT_PTR CALLBACK DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM wParam, LPARAM lParam); | |
+ static LRESULT CALLBACK DownloadProgressProc(HWND hWnd, | |
+ UINT uMsg, | |
+ WPARAM wParam, | |
+ LPARAM lParam, | |
+ UINT_PTR uIdSubclass, | |
+ DWORD_PTR dwRefData); | |
+ | |
+ static DWORD WINAPI ThreadFunc(LPVOID Context); | |
+ static BOOL DownloadListOfApplications(const ATL::CSimpleArray<CAvailableApplicationInfo*>& AppsList, BOOL bIsModal = FALSE); | |
+ static BOOL DownloadApplication(CAvailableApplicationInfo* pAppInfo, BOOL bIsModal = FALSE); | |
+ static VOID DownloadApplicationsDB(LPCWSTR lpUrl); | |
+ static VOID LaunchDownloadDialog(BOOL); | |
+}; | |
+ | |
+// Settings dialog (settingsdlg.cpp) | |
+VOID CreateSettingsDlg(HWND hwnd); | |
+ | |
+// About dialog (aboutdlg.cpp) | |
+VOID ShowAboutDialog(); | |
+ | |
+// Installation dialog (installdlg.cpp) | |
+//BOOL InstallApplication(INT Index); | |
Property changes on: base/applications/rapps/include/dialogs.h | |
___________________________________________________________________ | |
Added: svn:eol-style | |
## -0,0 +1 ## | |
+native | |
\ No newline at end of property | |
Index: base/applications/rapps/include/winmain.h | |
=================================================================== | |
--- base/applications/rapps/include/winmain.h (.../trunk/reactos) (nonexistent) | |
+++ base/applications/rapps/include/winmain.h (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -0,0 +1,35 @@ | |
+#pragma once | |
+#include <windef.h> | |
+//TODO: Separate main and settings related definitions | |
+ | |
+struct SETTINGS_INFO | |
+{ | |
+ BOOL bSaveWndPos; | |
+ BOOL bUpdateAtStart; | |
+ BOOL bLogEnabled; | |
+ WCHAR szDownloadDir[MAX_PATH]; | |
+ BOOL bDelInstaller; | |
+ /* Window Pos */ | |
+ BOOL Maximized; | |
+ INT Left; | |
+ INT Top; | |
+ INT Width; | |
+ INT Height; | |
+ /* Proxy settings */ | |
+ INT Proxy; | |
+ WCHAR szProxyServer[MAX_PATH]; | |
+ WCHAR szNoProxyFor[MAX_PATH]; | |
+}; | |
+ | |
+typedef SETTINGS_INFO *PSETTINGS_INFO; | |
+ | |
+extern HWND hMainWnd; | |
+extern HINSTANCE hInst; | |
+extern INT SelectedEnumType; | |
+extern SETTINGS_INFO SettingsInfo; | |
+ | |
+VOID SaveSettings(HWND hwnd); | |
+VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo); | |
+ | |
+// integrity.cpp | |
+BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName); | |
Property changes on: base/applications/rapps/include/winmain.h | |
___________________________________________________________________ | |
Added: svn:eol-style | |
## -0,0 +1 ## | |
+native | |
\ No newline at end of property | |
Index: base/applications/rapps/include/gui.h | |
=================================================================== | |
--- base/applications/rapps/include/gui.h (.../trunk/reactos) (nonexistent) | |
+++ base/applications/rapps/include/gui.h (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -0,0 +1,20 @@ | |
+#pragma once | |
+#include <windef.h> | |
+#include <atlstr.h> | |
+ | |
+class CAvailableApps; | |
+ | |
+HWND CreateMainWindow(); | |
+DWORD_PTR ListViewGetlParam(INT item); | |
+INT ListViewAddItem(INT ItemIndex, INT IconIndex, LPWSTR lpName, LPARAM lParam); | |
+VOID SetStatusBarText(LPCWSTR szText); | |
+VOID NewRichEditText(LPCWSTR szText, DWORD flags); | |
+VOID InsertRichEditText(LPCWSTR szText, DWORD flags); | |
+ | |
+VOID SetStatusBarText(const ATL::CStringW& szText); | |
+INT ListViewAddItem(INT ItemIndex, INT IconIndex, const ATL::CStringW& Name, LPARAM lParam); | |
+VOID NewRichEditText(const ATL::CStringW& szText, DWORD flags); | |
+VOID InsertRichEditText(const ATL::CStringW& szText, DWORD flags); | |
+CAvailableApps * GetAvailableApps(); | |
+extern HWND hListView; | |
+extern ATL::CStringW szSearchPattern; | |
Property changes on: base/applications/rapps/include/gui.h | |
___________________________________________________________________ | |
Added: svn:eol-style | |
## -0,0 +1 ## | |
+native | |
\ No newline at end of property | |
Index: base/applications/rapps/include/rapps.h | |
=================================================================== | |
--- base/applications/rapps/include/rapps.h (.../trunk/reactos) (nonexistent) | |
+++ base/applications/rapps/include/rapps.h (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -0,0 +1,14 @@ | |
+#pragma once | |
+ | |
+#ifndef _RAPPS_H | |
+#define _RAPPS_H | |
+ | |
+#include "defines.h" | |
+ | |
+#include "dialogs.h" | |
+#include "installed.h" | |
+#include "available.h" | |
+#include "misc.h" | |
+#include "gui.h" | |
+ | |
+#endif /* _RAPPS_H */ | |
Property changes on: base/applications/rapps/include/rapps.h | |
___________________________________________________________________ | |
Added: svn:eol-style | |
## -0,0 +1 ## | |
+native | |
\ No newline at end of property | |
Index: base/applications/rapps/include/resource.h | |
=================================================================== | |
--- base/applications/rapps/include/resource.h (.../trunk/reactos) (nonexistent) | |
+++ base/applications/rapps/include/resource.h (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -0,0 +1,206 @@ | |
+#pragma once | |
+ | |
+/* Icons */ | |
+#define IDI_MAIN 10 | |
+#define IDI_EXIT 11 | |
+#define IDI_INSTALL 12 | |
+#define IDI_UNINSTALL 13 | |
+#define IDI_SETTINGS 14 | |
+#define IDI_MODIFY 15 | |
+#define IDI_REFRESH 16 | |
+#define IDI_APPS 17 | |
+#define IDI_APPUPD 18 | |
+#define IDI_CATEGORY 19 | |
+#define IDI_UPDATE_DB 20 | |
+#define IDI_CHECK_ALL 21 | |
+ | |
+/* Icons for categories */ | |
+#define IDI_CAT_AUDIO 50 | |
+#define IDI_CAT_DEVEL 51 | |
+#define IDI_CAT_DRIVERS 52 | |
+#define IDI_CAT_EDU 53 | |
+#define IDI_CAT_ENGINEER 54 | |
+#define IDI_CAT_FINANCE 55 | |
+#define IDI_CAT_GAMES 56 | |
+#define IDI_CAT_GRAPHICS 57 | |
+#define IDI_CAT_INTERNET 58 | |
+#define IDI_CAT_LIBS 59 | |
+#define IDI_CAT_OFFICE 60 | |
+#define IDI_CAT_OTHER 61 | |
+#define IDI_CAT_SCIENCE 62 | |
+#define IDI_CAT_TOOLS 63 | |
+#define IDI_CAT_VIDEO 64 | |
+ | |
+/* Bitmaps */ | |
+ | |
+/* Controls */ | |
+#define IDC_STATUSBAR 1000 | |
+#define IDC_DOWNLOAD_PROGRESS 1001 | |
+#define IDC_DOWNLOAD_STATUS 1002 | |
+#define IDC_SAVE_WINDOW_POS 1003 | |
+#define IDC_UPDATE_AVLIST 1004 | |
+#define IDC_DOWNLOAD_DIR_EDIT 1005 | |
+#define IDC_DEL_AFTER_INSTALL 1006 | |
+#define IDC_LOG_ENABLED 1007 | |
+#define IDC_CHOOSE 1008 | |
+#define IDC_DEFAULT_SETTINGS 1009 | |
+#define IDC_INSTALL_TEXT 1010 | |
+#define IDC_CD_INSTALL 1011 | |
+#define IDC_DOWNLOAD_INSTALL 1012 | |
+#define IDC_PROXY_DEFAULT 1013 | |
+#define IDC_NO_PROXY 1014 | |
+#define IDC_USE_PROXY 1015 | |
+#define IDC_PROXY_SERVER 1016 | |
+#define IDC_NO_PROXY_FOR 1017 | |
+ | |
+/* Dialogs */ | |
+#define IDD_SETTINGS_DIALOG 300 | |
+#define IDD_INSTALL_DIALOG 301 | |
+#define IDD_DOWNLOAD_DIALOG 302 | |
+#define IDD_ABOUT_DIALOG 303 | |
+ | |
+/* Menus */ | |
+#define IDR_MAINMENU 500 | |
+#define IDR_LINKMENU 501 | |
+#define IDR_APPLICATIONMENU 502 | |
+ | |
+/* Menu items */ | |
+#define ID_EXIT 550 | |
+#define ID_INSTALL 551 | |
+#define ID_UNINSTALL 552 | |
+#define ID_HELP 553 | |
+#define ID_ABOUT 554 | |
+#define ID_MODIFY 555 | |
+#define ID_OPEN_LINK 556 | |
+#define ID_COPY_LINK 557 | |
+#define ID_SETTINGS 558 | |
+#define ID_REFRESH 559 | |
+#define ID_REGREMOVE 560 | |
+#define ID_RESETDB 561 | |
+#define ID_CHECK_ALL 562 | |
+ | |
+/* Strings */ | |
+#define IDS_APPTITLE 100 | |
+#define IDS_SEARCH_TEXT 101 | |
+#define IDS_INSTALL 102 | |
+#define IDS_UNINSTALL 103 | |
+#define IDS_MODIFY 104 | |
+#define IDS_APPS_COUNT 105 | |
+#define IDS_WELCOME_TITLE 106 | |
+#define IDS_WELCOME_TEXT 107 | |
+#define IDS_WELCOME_URL 108 | |
+#define IDS_INSTALLED 109 | |
+#define IDS_AVAILABLEFORINST 110 | |
+#define IDS_UPDATES 111 | |
+#define IDS_APPLICATIONS 112 | |
+#define IDS_CHOOSE_FOLDER_TEXT 113 | |
+#define IDS_CHOOSE_FOLDER_ERROR 114 | |
+#define IDS_APP_REG_REMOVE 116 | |
+#define IDS_INFORMATION 117 | |
+#define IDS_UNABLE_TO_REMOVE 118 | |
+#define IDS_UNABLE_TO_DOWNLOAD 119 | |
+#define IDS_UNABLE_TO_DOWNLOAD2 120 | |
+#define IDS_CERT_DOES_NOT_MATCH 121 | |
+#define IDS_INTEG_CHECK_TITLE 122 | |
+#define IDS_INTEG_CHECK_FAIL 123 | |
+#define IDS_INTERRUPTED_DOWNLOAD 124 | |
+#define IDS_UNABLE_TO_WRITE 125 | |
+#define IDS_SELECT_ALL 126 | |
+#define IDS_INSTALL_SELECTED 127 | |
+#define IDS_UNABLE_TO_INSTALL 128 | |
+ | |
+/* Tooltips */ | |
+#define IDS_TOOLTIP_INSTALL 200 | |
+#define IDS_TOOLTIP_UNINSTALL 201 | |
+#define IDS_TOOLTIP_MODIFY 202 | |
+#define IDS_TOOLTIP_SETTINGS 203 | |
+#define IDS_TOOLTIP_REFRESH 204 | |
+#define IDS_TOOLTIP_EXIT 205 | |
+#define IDS_TOOLTIP_UPDATE_DB 206 | |
+ | |
+/* Columns info */ | |
+#define IDS_APP_NAME 250 | |
+#define IDS_APP_INST_VERSION 251 | |
+#define IDS_APP_DESCRIPTION 252 | |
+ | |
+/* Apps info */ | |
+#define IDS_INFO_VERSION 280 | |
+#define IDS_INFO_DESCRIPTION 281 | |
+#define IDS_INFO_PUBLISHER 282 | |
+#define IDS_INFO_HELPLINK 283 | |
+#define IDS_INFO_HELPPHONE 284 | |
+#define IDS_INFO_README 285 | |
+#define IDS_INFO_REGOWNER 286 | |
+#define IDS_INFO_PRODUCTID 287 | |
+#define IDS_INFO_CONTACT 288 | |
+#define IDS_INFO_UPDATEINFO 289 | |
+#define IDS_INFO_INFOABOUT 290 | |
+#define IDS_INFO_COMMENTS 291 | |
+#define IDS_INFO_INSTLOCATION 292 | |
+#define IDS_INFO_INSTALLSRC 293 | |
+#define IDS_INFO_UNINSTALLSTR 294 | |
+#define IDS_INFO_MODIFYPATH 295 | |
+#define IDS_INFO_INSTALLDATE 296 | |
+ | |
+/* Info for available apps */ | |
+#define IDS_AINFO_VERSION 350 | |
+#define IDS_AINFO_DESCRIPTION 351 | |
+#define IDS_AINFO_SIZE 352 | |
+#define IDS_AINFO_URLSITE 353 | |
+#define IDS_AINFO_LICENSE 354 | |
+#define IDS_AINFO_URLDOWNLOAD 355 | |
+#define IDS_AINFO_AVAILABLEVERSION 356 | |
+#define IDS_AINFO_LANGUAGES 357 | |
+ | |
+ | |
+/* Names of categories */ | |
+#define IDS_CAT_AUDIO 700 | |
+#define IDS_CAT_DEVEL 701 | |
+#define IDS_CAT_DRIVERS 702 | |
+#define IDS_CAT_EDU 703 | |
+#define IDS_CAT_ENGINEER 704 | |
+#define IDS_CAT_FINANCE 705 | |
+#define IDS_CAT_GAMES 706 | |
+#define IDS_CAT_GRAPHICS 707 | |
+#define IDS_CAT_INTERNET 708 | |
+#define IDS_CAT_LIBS 709 | |
+#define IDS_CAT_OFFICE 710 | |
+#define IDS_CAT_OTHER 711 | |
+#define IDS_CAT_SCIENCE 712 | |
+#define IDS_CAT_TOOLS 713 | |
+#define IDS_CAT_VIDEO 714 | |
+ | |
+/* App installation status */ | |
+#define IDS_STATUS_INSTALLED 800 | |
+#define IDS_STATUS_NOTINSTALLED 801 | |
+#define IDS_STATUS_DOWNLOADED 802 | |
+#define IDS_STATUS_UPDATE_AVAILABLE 803 | |
+#define IDS_STATUS_DOWNLOADING 804 | |
+#define IDS_STATUS_INSTALLING 805 | |
+#define IDS_STATUS_WAITING 806 | |
+#define IDS_STATUS_FINISHED 807 | |
+ | |
+/* App license names */ | |
+#define IDS_LICENSE_OPENSOURCE 900 | |
+#define IDS_LICENSE_FREEWARE 901 | |
+#define IDS_LICENSE_TRIAL 902 | |
+ | |
+/* Language related strings */ | |
+#define IDS_LANGUAGE_AVAILABLE_TRANSLATION 910 | |
+#define IDS_LANGUAGE_NO_TRANSLATION 911 | |
+#define IDS_LANGUAGE_ENGLISH_TRANSLATION 912 | |
+#define IDS_LANGUAGE_SINGLE 913 | |
+#define IDS_LANGUAGE_MORE_PLACEHOLDER 914 | |
+#define IDS_LANGUAGE_AVAILABLE_PLACEHOLDER 915 | |
+ | |
+/* Dialog related entries */ | |
+#define IDS_DL_DIALOG_DB_DISP 950 | |
+#define IDS_DL_DIALOG_DB_DOWNLOAD_DISP 951 | |
+ | |
+/* Accelerators */ | |
+#define HOTKEYS 715 | |
+ | |
+/* Other */ | |
+#ifndef IDC_STATIC | |
+#define IDC_STATIC -1 | |
+#endif | |
Property changes on: base/applications/rapps/include/resource.h | |
___________________________________________________________________ | |
Added: svn:eol-style | |
## -0,0 +1 ## | |
+native | |
\ No newline at end of property | |
Index: base/applications/rapps/winmain.cpp | |
=================================================================== | |
--- base/applications/rapps/winmain.cpp (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/winmain.cpp (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -5,13 +5,13 @@ | |
* PURPOSE: Main program | |
* PROGRAMMERS: Dmitry Chapyshev (dmitry@reactos.org) | |
* Ismael Ferreras Morezuelas (swyterzone+ros@gmail.com) | |
+ * Alexander Shaposhnikov (chaez.san@gmail.com) | |
*/ | |
- | |
+#include "defines.h" | |
#include "rapps.h" | |
+#include "unattended.h" | |
-#include <atlbase.h> | |
#include <atlcom.h> | |
-#include <shellapi.h> | |
HWND hMainWnd; | |
HINSTANCE hInst; | |
@@ -18,7 +18,7 @@ | |
INT SelectedEnumType = ENUM_ALL_COMPONENTS; | |
SETTINGS_INFO SettingsInfo; | |
-WCHAR szSearchPattern[MAX_STR_LEN] = L""; | |
+ATL::CStringW szSearchPattern; | |
class CRAppsModule : public CComModule | |
{ | |
@@ -28,14 +28,9 @@ | |
BEGIN_OBJECT_MAP(ObjectMap) | |
END_OBJECT_MAP() | |
-CRAppsModule gModule; | |
-CAtlWinModule gWinModule; | |
+CRAppsModule gModule; | |
+CAtlWinModule gWinModule; | |
-void *operator new (size_t, void *buf) | |
-{ | |
- return buf; | |
-} | |
- | |
static VOID InitializeAtlModule(HINSTANCE hInstance, BOOL bInitialize) | |
{ | |
if (bInitialize) | |
@@ -48,54 +43,62 @@ | |
} | |
} | |
-VOID | |
-FillDefaultSettings(PSETTINGS_INFO pSettingsInfo) | |
+VOID FillDefaultSettings(PSETTINGS_INFO pSettingsInfo) | |
{ | |
+ ATL::CStringW szDownloadDir; | |
+ ZeroMemory(pSettingsInfo, sizeof(SETTINGS_INFO)); | |
+ | |
pSettingsInfo->bSaveWndPos = TRUE; | |
pSettingsInfo->bUpdateAtStart = FALSE; | |
pSettingsInfo->bLogEnabled = TRUE; | |
- StringCbCopyW(pSettingsInfo->szDownloadDir, | |
- sizeof(pSettingsInfo->szDownloadDir), | |
- L"C:\\Downloads"); | |
+ | |
+ if (FAILED(SHGetFolderPathW(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, szDownloadDir.GetBuffer(MAX_PATH)))) | |
+ { | |
+ szDownloadDir.ReleaseBuffer(); | |
+ if (!szDownloadDir.GetEnvironmentVariableW(L"SystemDrive")) | |
+ { | |
+ szDownloadDir = L"C:"; | |
+ } | |
+ } | |
+ else | |
+ { | |
+ szDownloadDir.ReleaseBuffer(); | |
+ } | |
+ | |
+ szDownloadDir += L"\\RAPPS Downloads"; | |
+ ATL::CStringW::CopyChars(pSettingsInfo->szDownloadDir, | |
+ _countof(pSettingsInfo->szDownloadDir), | |
+ szDownloadDir.GetString(), | |
+ szDownloadDir.GetLength() + 1); | |
+ | |
pSettingsInfo->bDelInstaller = FALSE; | |
- | |
pSettingsInfo->Maximized = FALSE; | |
pSettingsInfo->Left = CW_USEDEFAULT; | |
pSettingsInfo->Top = CW_USEDEFAULT; | |
pSettingsInfo->Width = 680; | |
pSettingsInfo->Height = 450; | |
- | |
- pSettingsInfo->Proxy = 0; | |
- StringCbCopyW(pSettingsInfo->szProxyServer, sizeof(pSettingsInfo->szProxyServer), L""); | |
- StringCbCopyW(pSettingsInfo->szNoProxyFor, sizeof(pSettingsInfo->szNoProxyFor), L""); | |
} | |
-static BOOL | |
-LoadSettings(VOID) | |
+static BOOL LoadSettings() | |
{ | |
- HKEY hKey; | |
+ ATL::CRegKey RegKey; | |
DWORD dwSize; | |
- | |
- if (RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\ReactOS\\rapps", 0, KEY_READ, &hKey) == ERROR_SUCCESS) | |
+ BOOL bResult = FALSE; | |
+ if (RegKey.Open(HKEY_CURRENT_USER, L"Software\\ReactOS\\rapps", KEY_READ) == ERROR_SUCCESS) | |
{ | |
dwSize = sizeof(SettingsInfo); | |
- if (RegQueryValueExW(hKey, L"Settings", NULL, NULL, (LPBYTE)&SettingsInfo, &dwSize) == ERROR_SUCCESS) | |
- { | |
- RegCloseKey(hKey); | |
- return TRUE; | |
- } | |
+ bResult = (RegKey.QueryBinaryValue(L"Settings", (PVOID) &SettingsInfo, &dwSize) == ERROR_SUCCESS); | |
- RegCloseKey(hKey); | |
+ RegKey.Close(); | |
} | |
- return FALSE; | |
+ return bResult; | |
} | |
-VOID | |
-SaveSettings(HWND hwnd) | |
+VOID SaveSettings(HWND hwnd) | |
{ | |
WINDOWPLACEMENT wp; | |
- HKEY hKey; | |
+ ATL::CRegKey RegKey; | |
if (SettingsInfo.bSaveWndPos) | |
{ | |
@@ -103,38 +106,35 @@ | |
GetWindowPlacement(hwnd, &wp); | |
SettingsInfo.Left = wp.rcNormalPosition.left; | |
- SettingsInfo.Top = wp.rcNormalPosition.top; | |
- SettingsInfo.Width = wp.rcNormalPosition.right - wp.rcNormalPosition.left; | |
+ SettingsInfo.Top = wp.rcNormalPosition.top; | |
+ SettingsInfo.Width = wp.rcNormalPosition.right - wp.rcNormalPosition.left; | |
SettingsInfo.Height = wp.rcNormalPosition.bottom - wp.rcNormalPosition.top; | |
- SettingsInfo.Maximized = (wp.showCmd == SW_MAXIMIZE || (wp.showCmd == SW_SHOWMINIMIZED && (wp.flags & WPF_RESTORETOMAXIMIZED))); | |
+ SettingsInfo.Maximized = (wp.showCmd == SW_MAXIMIZE | |
+ || (wp.showCmd == SW_SHOWMINIMIZED | |
+ && (wp.flags & WPF_RESTORETOMAXIMIZED))); | |
} | |
- if (RegCreateKeyExW(HKEY_CURRENT_USER, L"Software\\ReactOS\\rapps", 0, NULL, | |
- REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL) == ERROR_SUCCESS) | |
+ if (RegKey.Create(HKEY_CURRENT_USER, L"Software\\ReactOS\\rapps", NULL, | |
+ REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, NULL) == ERROR_SUCCESS) | |
{ | |
- RegSetValueExW(hKey, L"Settings", 0, REG_BINARY, (LPBYTE)&SettingsInfo, sizeof(SettingsInfo)); | |
- RegCloseKey(hKey); | |
+ RegKey.SetBinaryValue(L"Settings", (const PVOID) &SettingsInfo, sizeof(SettingsInfo)); | |
+ RegKey.Close(); | |
} | |
} | |
-int WINAPI | |
-wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd) | |
+INT WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, INT nShowCmd) | |
{ | |
- WCHAR szWindowClass[] = L"ROSAPPMGR"; | |
- HANDLE hMutex = NULL; | |
+ LPCWSTR szWindowClass = L"ROSAPPMGR"; | |
+ HANDLE hMutex; | |
HACCEL KeyBrd; | |
MSG Msg; | |
+ BOOL bIsFirstLaunch; | |
InitializeAtlModule(hInstance, TRUE); | |
- switch (GetUserDefaultUILanguage()) | |
+ if (GetUserDefaultUILanguage() == MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT)) | |
{ | |
- case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT): | |
- SetProcessDefaultLayout(LAYOUT_RTL); | |
- break; | |
- | |
- default: | |
- break; | |
+ SetProcessDefaultLayout(LAYOUT_RTL); | |
} | |
hInst = hInstance; | |
@@ -150,40 +150,44 @@ | |
SetForegroundWindow(hWindow); | |
return 1; | |
} | |
- | |
- if (!LoadSettings()) | |
+ bIsFirstLaunch = !LoadSettings(); | |
+ if (bIsFirstLaunch) | |
{ | |
FillDefaultSettings(&SettingsInfo); | |
} | |
InitLogs(); | |
- | |
InitCommonControls(); | |
- hMainWnd = CreateMainWindow(); | |
- if (!hMainWnd) goto Exit; | |
+ // skip window creation if there were some keys | |
+ if (!CmdParser(lpCmdLine)) | |
+ { | |
+ if (SettingsInfo.bUpdateAtStart || bIsFirstLaunch) | |
+ CAvailableApps::ForceUpdateAppsDB(); | |
- /* Maximize it if we must */ | |
- ShowWindow(hMainWnd, (SettingsInfo.bSaveWndPos && SettingsInfo.Maximized ? SW_MAXIMIZE : nShowCmd)); | |
- UpdateWindow(hMainWnd); | |
+ hMainWnd = CreateMainWindow(); | |
- if (SettingsInfo.bUpdateAtStart) | |
- UpdateAppsDB(); | |
+ if (hMainWnd) | |
+ { | |
+ /* Maximize it if we must */ | |
+ ShowWindow(hMainWnd, ((SettingsInfo.bSaveWndPos && SettingsInfo.Maximized) ? SW_MAXIMIZE : nShowCmd)); | |
+ UpdateWindow(hMainWnd); | |
- /* Load the menu hotkeys */ | |
- KeyBrd = LoadAccelerators(NULL, MAKEINTRESOURCE(HOTKEYS)); | |
+ /* Load the menu hotkeys */ | |
+ KeyBrd = LoadAcceleratorsW(NULL, MAKEINTRESOURCEW(HOTKEYS)); | |
- /* Message Loop */ | |
- while (GetMessage(&Msg, NULL, 0, 0)) | |
- { | |
- if (!TranslateAccelerator(hMainWnd, KeyBrd, &Msg)) | |
- { | |
- TranslateMessage(&Msg); | |
- DispatchMessage(&Msg); | |
+ /* Message Loop */ | |
+ while (GetMessageW(&Msg, NULL, 0, 0)) | |
+ { | |
+ if (!TranslateAcceleratorW(hMainWnd, KeyBrd, &Msg)) | |
+ { | |
+ TranslateMessage(&Msg); | |
+ DispatchMessageW(&Msg); | |
+ } | |
+ } | |
} | |
} | |
-Exit: | |
if (hMutex) | |
CloseHandle(hMutex); | |
Index: base/applications/rapps/loaddlg.cpp | |
=================================================================== | |
--- base/applications/rapps/loaddlg.cpp (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/loaddlg.cpp (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -2,31 +2,32 @@ | |
* LICENSE: GPL - See COPYING in the top level directory | |
* FILE: base/applications/rapps/loaddlg.cpp | |
* PURPOSE: Displaying a download dialog | |
- * COPYRIGHT: Copyright 2001 John R. Sheets (for CodeWeavers) | |
- * Copyright 2004 Mike McCormack (for CodeWeavers) | |
- * Copyright 2005 Ge van Geldorp (gvg@reactos.org) | |
- * Copyright 2009 Dmitry Chapyshev (dmitry@reactos.org) | |
+ * COPYRIGHT: Copyright 2001 John R. Sheets (for CodeWeavers) | |
+ * Copyright 2004 Mike McCormack (for CodeWeavers) | |
+ * Copyright 2005 Ge van Geldorp (gvg@reactos.org) | |
+ * Copyright 2009 Dmitry Chapyshev (dmitry@reactos.org) | |
* Copyright 2015 Ismael Ferreras Morezuelas (swyterzone+ros@gmail.com) | |
+ * Copyright 2017 Alexander Shaposhnikov (chaez.san@gmail.com) | |
*/ | |
-/* | |
- * Based on Wine dlls/shdocvw/shdocvw_main.c | |
- * | |
- * This library is free software; you can redistribute it and/or | |
- * modify it under the terms of the GNU Lesser General Public | |
- * License as published by the Free Software Foundation; either | |
- * version 2.1 of the License, or (at your option) any later version. | |
- * | |
- * This library is distributed in the hope that it will be useful, | |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
- * Lesser General Public License for more details. | |
- * | |
- * You should have received a copy of the GNU Lesser General Public | |
- * License along with this library; if not, write to the Free Software | |
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
- */ | |
-#include "rapps.h" | |
+ /* | |
+ * Based on Wine dlls/shdocvw/shdocvw_main.c | |
+ * | |
+ * This library is free software; you can redistribute it and/or | |
+ * modify it under the terms of the GNU Lesser General Public | |
+ * License as published by the Free Software Foundation; either | |
+ * version 2.1 of the License, or (at your option) any later version. | |
+ * | |
+ * This library is distributed in the hope that it will be useful, | |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
+ * Lesser General Public License for more details. | |
+ * | |
+ * You should have received a copy of the GNU Lesser General Public | |
+ * License along with this library; if not, write to the Free Software | |
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
+ */ | |
+#include "defines.h" | |
#include <shlobj_undoc.h> | |
#include <shlguid_undoc.h> | |
@@ -33,12 +34,67 @@ | |
#include <atlbase.h> | |
#include <atlcom.h> | |
+#include <atlwin.h> | |
#include <wininet.h> | |
#include <shellutils.h> | |
+ | |
+#include <rosctrls.h> | |
#include <windowsx.h> | |
-static PAPPLICATION_INFO AppInfo; | |
+#include "rosui.h" | |
+#include "dialogs.h" | |
+#include "misc.h" | |
+#ifdef USE_CERT_PINNING | |
+#define CERT_ISSUER_INFO "BE\r\nGlobalSign nv-sa\r\nGlobalSign Domain Validation CA - SHA256 - G2" | |
+#define CERT_SUBJECT_INFO "Domain Control Validated\r\n*.reactos.org" | |
+#endif | |
+ | |
+typedef enum | |
+{ | |
+ DLWaiting = IDS_STATUS_WAITING, | |
+ DLDownloading = IDS_STATUS_DOWNLOADING, | |
+ DLWaitingToInstall = IDS_STATUS_DOWNLOADED, | |
+ DLInstalling = IDS_STATUS_INSTALLING, | |
+ DLInstalled = IDS_STATUS_INSTALLED, | |
+ DLFinished = IDS_STATUS_FINISHED | |
+} DOWNLOAD_STATUS; | |
+ | |
+ATL::CStringW LoadStatusString(DOWNLOAD_STATUS StatusParam) | |
+{ | |
+ ATL::CStringW szString; | |
+ szString.LoadStringW(StatusParam); | |
+ return szString; | |
+} | |
+ | |
+ | |
+struct DownloadInfo | |
+{ | |
+ DownloadInfo() {} | |
+ DownloadInfo(const CAvailableApplicationInfo& AppInfo) | |
+ :szUrl(AppInfo.szUrlDownload), szName(AppInfo.szName), szSHA1(AppInfo.szSHA1) | |
+ { | |
+ } | |
+ | |
+ ATL::CStringW szUrl; | |
+ ATL::CStringW szName; | |
+ ATL::CStringW szSHA1; | |
+}; | |
+ | |
+struct DownloadParam | |
+{ | |
+ DownloadParam() : Dialog(NULL), AppInfo(), szCaption(NULL) {} | |
+ DownloadParam(HWND dlg, const ATL::CSimpleArray<DownloadInfo> &info, LPCWSTR caption) | |
+ : Dialog(dlg), AppInfo(info), szCaption(caption) | |
+ { | |
+ } | |
+ | |
+ HWND Dialog; | |
+ ATL::CSimpleArray<DownloadInfo> AppInfo; | |
+ LPCWSTR szCaption; | |
+}; | |
+ | |
+ | |
class CDownloadDialog : | |
public CComObjectRootEx<CComMultiThreadModelNoCS>, | |
public IBindStatusCallback | |
@@ -46,15 +102,13 @@ | |
HWND m_hDialog; | |
PBOOL m_pbCancelled; | |
BOOL m_UrlHasBeenCopied; | |
- WCHAR m_ProgressText[MAX_PATH]; | |
- | |
public: | |
~CDownloadDialog() | |
{ | |
- DestroyWindow(m_hDialog); | |
+ //DestroyWindow(m_hDialog); | |
} | |
- | |
+ | |
HRESULT Initialize(HWND Dlg, BOOL *pbCancelled) | |
{ | |
m_hDialog = Dlg; | |
@@ -96,7 +150,7 @@ | |
{ | |
WCHAR szProgress[100]; | |
WCHAR szProgressMax[100]; | |
- UINT uiPercentage = ((ULONGLONG)ulProgress * 100) / ulProgressMax; | |
+ UINT uiPercentage = ((ULONGLONG) ulProgress * 100) / ulProgressMax; | |
/* send the current progress to the progress bar */ | |
SendMessageW(Item, PBM_SETPOS, uiPercentage, 0); | |
@@ -106,13 +160,12 @@ | |
StrFormatByteSizeW(ulProgressMax, szProgressMax, _countof(szProgressMax)); | |
/* ...and post all of it to our subclassed progress bar text subroutine */ | |
- StringCbPrintfW(m_ProgressText, | |
- sizeof(m_ProgressText), | |
- L"%u%% \x2014 %ls / %ls", | |
- uiPercentage, | |
- szProgress, | |
- szProgressMax); | |
- SendMessageW(Item, WM_SETTEXT, 0, (LPARAM)m_ProgressText); | |
+ ATL::CStringW m_ProgressText; | |
+ m_ProgressText.Format(L"%u%% \x2014 %ls / %ls", | |
+ uiPercentage, | |
+ szProgress, | |
+ szProgressMax); | |
+ SendMessageW(Item, WM_SETTEXT, 0, (LPARAM) m_ProgressText.GetString()); | |
} | |
Item = GetDlgItem(m_hDialog, IDC_DOWNLOAD_STATUS); | |
@@ -119,32 +172,28 @@ | |
if (Item && szStatusText && wcslen(szStatusText) > 0 && m_UrlHasBeenCopied == FALSE) | |
{ | |
DWORD len = wcslen(szStatusText) + 1; | |
- PWSTR buf = (PWSTR)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len * sizeof(WCHAR)); | |
+ ATL::CStringW buf; | |
- if (buf) | |
+ /* beautify our url for display purposes */ | |
+ if (!InternetCanonicalizeUrlW(szStatusText, buf.GetBuffer(len), &len, ICU_DECODE | ICU_NO_ENCODE)) | |
{ | |
- /* beautify our url for display purposes */ | |
- InternetCanonicalizeUrl(szStatusText, buf, &len, ICU_DECODE | ICU_NO_ENCODE); | |
+ /* just use the original */ | |
+ buf.ReleaseBuffer(); | |
+ buf = szStatusText; | |
} | |
else | |
{ | |
- /* just use the original */ | |
- buf = (PWSTR)szStatusText; | |
+ buf.ReleaseBuffer(); | |
} | |
/* paste it into our dialog and don't do it again in this instance */ | |
- SendMessageW(Item, WM_SETTEXT, 0, (LPARAM)buf); | |
+ SendMessageW(Item, WM_SETTEXT, 0, (LPARAM) buf.GetString()); | |
m_UrlHasBeenCopied = TRUE; | |
- | |
- if (buf != szStatusText) | |
- { | |
- HeapFree(GetProcessHeap(), 0, buf); | |
- } | |
} | |
- SetLastError(0); | |
+ SetLastError(ERROR_SUCCESS); | |
r = GetWindowLongPtrW(m_hDialog, GWLP_USERDATA); | |
- if (0 != r || 0 != GetLastError()) | |
+ if (r || GetLastError() != ERROR_SUCCESS) | |
{ | |
*m_pbCancelled = TRUE; | |
return E_ABORT; | |
@@ -188,6 +237,74 @@ | |
END_COM_MAP() | |
}; | |
+class CDowloadingAppsListView | |
+ : public CUiWindow<CListView> | |
+{ | |
+public: | |
+ HWND Create(HWND hwndParent) | |
+ { | |
+ RECT r = {10, 150, 320, 350}; | |
+ const DWORD style = WS_CHILD | WS_VISIBLE | LVS_REPORT | LVS_SINGLESEL | |
+ | LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | LVS_NOCOLUMNHEADER; | |
+ | |
+ HWND hwnd = CListView::Create(hwndParent, r, NULL, style, WS_EX_CLIENTEDGE); | |
+ | |
+ AddColumn(0, 150, LVCFMT_LEFT); | |
+ AddColumn(1, 120, LVCFMT_LEFT); | |
+ | |
+ return hwnd; | |
+ } | |
+ | |
+ VOID LoadList(ATL::CSimpleArray<DownloadInfo> arrInfo) | |
+ { | |
+ for (INT i = 0; i < arrInfo.GetSize(); ++i) | |
+ { | |
+ AddRow(i, arrInfo[i].szName.GetString(), DOWNLOAD_STATUS::DLWaiting); | |
+ } | |
+ } | |
+ | |
+ VOID SetDownloadStatus(INT ItemIndex, DOWNLOAD_STATUS Status) | |
+ { | |
+ HWND hListView = GetWindow(); | |
+ ATL::CStringW szBuffer = LoadStatusString(Status); | |
+ ListView_SetItemText(hListView, ItemIndex, 1, const_cast<LPWSTR>(szBuffer.GetString())); | |
+ } | |
+ | |
+ BOOL AddItem(INT ItemIndex, LPWSTR lpText) | |
+ { | |
+ LVITEMW Item; | |
+ | |
+ ZeroMemory(&Item, sizeof(Item)); | |
+ | |
+ Item.mask = LVIF_TEXT | LVIF_STATE; | |
+ Item.pszText = lpText; | |
+ Item.iItem = ItemIndex; | |
+ | |
+ return InsertItem(&Item); | |
+ } | |
+ | |
+ VOID AddRow(INT RowIndex, LPCWSTR szAppName, const DOWNLOAD_STATUS Status) | |
+ { | |
+ ATL::CStringW szStatus = LoadStatusString(Status); | |
+ AddItem(RowIndex, | |
+ const_cast<LPWSTR>(szAppName)); | |
+ SetDownloadStatus(RowIndex, Status); | |
+ } | |
+ | |
+ BOOL AddColumn(INT Index, INT Width, INT Format) | |
+ { | |
+ LVCOLUMNW Column; | |
+ ZeroMemory(&Column, sizeof(Column)); | |
+ | |
+ Column.mask = LVCF_FMT | LVCF_WIDTH | LVCF_SUBITEM; | |
+ Column.iSubItem = Index; | |
+ Column.cx = Width; | |
+ Column.fmt = Format; | |
+ | |
+ return (InsertColumn(Index, &Column) == -1) ? FALSE : TRUE; | |
+ } | |
+}; | |
+ | |
extern "C" | |
HRESULT WINAPI CDownloadDialog_Constructor(HWND Dlg, BOOL *pbCancelled, REFIID riid, LPVOID *ppv) | |
{ | |
@@ -223,7 +340,7 @@ | |
LocalFree(certInfo.lpszEncryptionAlgName); | |
if (certInfo.lpszIssuerInfo) | |
{ | |
- if (strcmp((LPSTR)certInfo.lpszIssuerInfo, CERT_ISSUER_INFO) != 0) | |
+ if (strcmp((LPSTR) certInfo.lpszIssuerInfo, CERT_ISSUER_INFO) != 0) | |
Ret = FALSE; | |
LocalFree(certInfo.lpszIssuerInfo); | |
} | |
@@ -233,7 +350,7 @@ | |
LocalFree(certInfo.lpszSignatureAlgName); | |
if (certInfo.lpszSubjectInfo) | |
{ | |
- if (strcmp((LPSTR)certInfo.lpszSubjectInfo, CERT_SUBJECT_INFO) != 0) | |
+ if (strcmp((LPSTR) certInfo.lpszSubjectInfo, CERT_SUBJECT_INFO) != 0) | |
Ret = FALSE; | |
LocalFree(certInfo.lpszSubjectInfo); | |
} | |
@@ -247,436 +364,530 @@ | |
} | |
#endif | |
- | |
-static | |
-DWORD WINAPI | |
-ThreadFunc(LPVOID Context) | |
+inline VOID MessageBox_LoadString(HWND hMainWnd, INT StringID) | |
{ | |
- CComPtr<IBindStatusCallback> dl; | |
- WCHAR path[MAX_PATH]; | |
- PWSTR p, q; | |
- HWND Dlg = (HWND) Context; | |
- ULONG dwContentLen, dwBytesWritten, dwBytesRead, dwStatus; | |
- ULONG dwCurrentBytesRead = 0; | |
- ULONG dwStatusLen = sizeof(dwStatus); | |
- BOOL bCancelled = FALSE; | |
- BOOL bTempfile = FALSE; | |
- BOOL bCab = FALSE; | |
- HINTERNET hOpen = NULL; | |
- HINTERNET hFile = NULL; | |
- HANDLE hOut = INVALID_HANDLE_VALUE; | |
- unsigned char lpBuffer[4096]; | |
- PCWSTR lpszAgent = L"RApps/1.0"; | |
- URL_COMPONENTS urlComponents; | |
- size_t urlLength, filenameLength; | |
+ ATL::CString szMsgText; | |
+ if (szMsgText.LoadStringW(StringID)) | |
+ { | |
+ MessageBoxW(hMainWnd, szMsgText.GetString(), NULL, MB_OK | MB_ICONERROR); | |
+ } | |
+} | |
- /* build the path for the download */ | |
- p = wcsrchr(AppInfo->szUrlDownload, L'/'); | |
- q = wcsrchr(AppInfo->szUrlDownload, L'?'); | |
- | |
- /* do we have a final slash separator? */ | |
- if (!p) | |
- goto end; | |
+// CDownloadManager | |
+ATL::CSimpleArray<DownloadInfo> CDownloadManager::AppsToInstallList; | |
+CDowloadingAppsListView CDownloadManager::DownloadsListView; | |
+INT CDownloadManager::iCurrentApp; | |
- /* prepare the tentative length of the filename, maybe we've to remove part of it later on */ | |
- filenameLength = wcslen(p) * sizeof(WCHAR); | |
+VOID CDownloadManager::Download(const DownloadInfo &DLInfo, BOOL bIsModal) | |
+{ | |
+ AppsToInstallList.RemoveAll(); | |
+ AppsToInstallList.Add(DLInfo); | |
+ LaunchDownloadDialog(bIsModal); | |
+} | |
- /* do we have query arguments in the target URL after the filename? account for them | |
- (e.g. https://example.org/myfile.exe?no_adware_plz) */ | |
- if (q && q > p && (q - p) > 0) | |
- filenameLength -= wcslen(q - 1) * sizeof(WCHAR); | |
+INT_PTR CALLBACK CDownloadManager::DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | |
+{ | |
+ static WCHAR szCaption[MAX_PATH]; | |
- /* is this URL an update package for RAPPS? if so store it in a different place */ | |
- if (wcscmp(AppInfo->szUrlDownload, APPLICATION_DATABASE_URL) == 0) | |
+ switch (uMsg) | |
{ | |
- bCab = TRUE; | |
- if (!GetStorageDirectory(path, _countof(path))) | |
- goto end; | |
- } | |
- else | |
+ case WM_INITDIALOG: | |
{ | |
- if (FAILED(StringCbCopyW(path, sizeof(path), SettingsInfo.szDownloadDir))) | |
- goto end; | |
+ HICON hIconSm, hIconBg; | |
+ | |
+ hIconBg = (HICON) GetClassLongW(hMainWnd, GCLP_HICON); | |
+ hIconSm = (HICON) GetClassLongW(hMainWnd, GCLP_HICONSM); | |
+ | |
+ if (hIconBg && hIconSm) | |
+ { | |
+ SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) hIconBg); | |
+ SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) hIconSm); | |
+ } | |
+ | |
+ SetWindowLongW(Dlg, GWLP_USERDATA, 0); | |
+ HWND Item = GetDlgItem(Dlg, IDC_DOWNLOAD_PROGRESS); | |
+ if (Item) | |
+ { | |
+ // initialize the default values for our nifty progress bar | |
+ // and subclass it so that it learns to print a status text | |
+ SendMessageW(Item, PBM_SETRANGE, 0, MAKELPARAM(0, 100)); | |
+ SendMessageW(Item, PBM_SETPOS, 0, 0); | |
+ | |
+ SetWindowSubclass(Item, DownloadProgressProc, 0, 0); | |
+ } | |
+ | |
+ // Add a ListView | |
+ HWND hListView = DownloadsListView.Create(Dlg); | |
+ if (!hListView) | |
+ { | |
+ return FALSE; | |
+ } | |
+ DownloadsListView.LoadList(AppsToInstallList); | |
+ | |
+ ShowWindow(Dlg, SW_SHOW); | |
+ | |
+ // Get a dlg string for later use | |
+ GetWindowTextW(Dlg, szCaption, MAX_PATH); | |
+ | |
+ // Start download process | |
+ DownloadParam *param = new DownloadParam(Dlg, AppsToInstallList, szCaption); | |
+ DWORD ThreadId; | |
+ HANDLE Thread = CreateThread(NULL, 0, ThreadFunc, (LPVOID) param, 0, &ThreadId); | |
+ | |
+ if (!Thread) | |
+ { | |
+ return FALSE; | |
+ } | |
+ | |
+ CloseHandle(Thread); | |
+ AppsToInstallList.RemoveAll(); | |
+ return TRUE; | |
} | |
- /* is the path valid? can we access it? */ | |
- if (GetFileAttributesW(path) == INVALID_FILE_ATTRIBUTES) | |
- { | |
- if (!CreateDirectoryW(path, NULL)) | |
- goto end; | |
+ case WM_COMMAND: | |
+ if (wParam == IDCANCEL) | |
+ { | |
+ SetWindowLongW(Dlg, GWLP_USERDATA, 1); | |
+ PostMessageW(Dlg, WM_CLOSE, 0, 0); | |
+ } | |
+ return FALSE; | |
+ | |
+ case WM_CLOSE: | |
+ EndDialog(Dlg, 0); | |
+ //DestroyWindow(Dlg); | |
+ return TRUE; | |
+ | |
+ default: | |
+ return FALSE; | |
} | |
+} | |
- /* append a \ to the provided file system path, and the filename portion from the URL after that */ | |
- if (FAILED(StringCbCatW(path, sizeof(path), L"\\"))) | |
- goto end; | |
- if (FAILED(StringCbCatNW(path, sizeof(path), p + 1, filenameLength))) | |
- goto end; | |
+LRESULT CALLBACK CDownloadManager::DownloadProgressProc(HWND hWnd, | |
+ UINT uMsg, | |
+ WPARAM wParam, | |
+ LPARAM lParam, | |
+ UINT_PTR uIdSubclass, | |
+ DWORD_PTR dwRefData) | |
+{ | |
+ static ATL::CStringW szProgressText; | |
- if (!bCab && AppInfo->szSHA1[0] != 0 && GetFileAttributesW(path) != INVALID_FILE_ATTRIBUTES) | |
+ switch (uMsg) | |
{ | |
- /* only open it in case of total correctness */ | |
- if (VerifyInteg(AppInfo->szSHA1, path)) | |
- goto run; | |
+ case WM_SETTEXT: | |
+ { | |
+ if (lParam) | |
+ { | |
+ szProgressText = (PCWSTR) lParam; | |
+ } | |
+ return TRUE; | |
} | |
- /* download it */ | |
- bTempfile = TRUE; | |
- CDownloadDialog_Constructor(Dlg, &bCancelled, IID_PPV_ARG(IBindStatusCallback, &dl)); | |
+ case WM_ERASEBKGND: | |
+ case WM_PAINT: | |
+ { | |
+ PAINTSTRUCT ps; | |
+ HDC hDC = BeginPaint(hWnd, &ps), hdcMem; | |
+ HBITMAP hbmMem; | |
+ HANDLE hOld; | |
+ RECT myRect; | |
+ UINT win_width, win_height; | |
- if (dl == NULL) | |
- goto end; | |
+ GetClientRect(hWnd, &myRect); | |
- /* FIXME: this should just be using the system-wide proxy settings */ | |
- switch(SettingsInfo.Proxy) | |
- { | |
- case 0: /* preconfig */ | |
- hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); | |
- break; | |
- case 1: /* direct (no proxy) */ | |
- hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); | |
- break; | |
- case 2: /* use proxy */ | |
- hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PROXY, SettingsInfo.szProxyServer, SettingsInfo.szNoProxyFor, 0); | |
- break; | |
- default: /* preconfig */ | |
- hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); | |
- break; | |
- } | |
+ /* grab the progress bar rect size */ | |
+ win_width = myRect.right - myRect.left; | |
+ win_height = myRect.bottom - myRect.top; | |
- if (!hOpen) | |
- goto end; | |
+ /* create an off-screen DC for double-buffering */ | |
+ hdcMem = CreateCompatibleDC(hDC); | |
+ hbmMem = CreateCompatibleBitmap(hDC, win_width, win_height); | |
- hFile = InternetOpenUrlW(hOpen, AppInfo->szUrlDownload, NULL, 0, INTERNET_FLAG_PRAGMA_NOCACHE|INTERNET_FLAG_KEEP_CONNECTION, 0); | |
- if (!hFile) | |
- { | |
- WCHAR szMsgText[MAX_STR_LEN]; | |
+ hOld = SelectObject(hdcMem, hbmMem); | |
- if (!LoadStringW(hInst, IDS_UNABLE_TO_DOWNLOAD2, szMsgText, _countof(szMsgText))) | |
- goto end; | |
+ /* call the original draw code and redirect it to our memory buffer */ | |
+ DefSubclassProc(hWnd, uMsg, (WPARAM) hdcMem, lParam); | |
- MessageBoxW(hMainWnd, szMsgText, NULL, MB_OK | MB_ICONERROR); | |
- goto end; | |
+ /* draw our nifty progress text over it */ | |
+ SelectFont(hdcMem, GetStockFont(DEFAULT_GUI_FONT)); | |
+ DrawShadowText(hdcMem, szProgressText.GetString(), szProgressText.GetLength(), | |
+ &myRect, | |
+ DT_CENTER | DT_VCENTER | DT_NOPREFIX | DT_SINGLELINE, | |
+ GetSysColor(COLOR_CAPTIONTEXT), | |
+ GetSysColor(COLOR_3DSHADOW), | |
+ 1, 1); | |
+ | |
+ /* transfer the off-screen DC to the screen */ | |
+ BitBlt(hDC, 0, 0, win_width, win_height, hdcMem, 0, 0, SRCCOPY); | |
+ | |
+ /* free the off-screen DC */ | |
+ SelectObject(hdcMem, hOld); | |
+ DeleteObject(hbmMem); | |
+ DeleteDC(hdcMem); | |
+ | |
+ EndPaint(hWnd, &ps); | |
+ return 0; | |
} | |
- if (!HttpQueryInfoW(hFile, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &dwStatus, &dwStatusLen, NULL)) | |
- goto end; | |
+ /* Raymond Chen says that we should safely unsubclass all the things! | |
+ (http://blogs.msdn.com/b/oldnewthing/archive/2003/11/11/55653.aspx) */ | |
- if(dwStatus != HTTP_STATUS_OK) | |
+ case WM_NCDESTROY: | |
{ | |
- WCHAR szMsgText[MAX_STR_LEN]; | |
+ szProgressText.Empty(); | |
+ RemoveWindowSubclass(hWnd, DownloadProgressProc, uIdSubclass); | |
+ } | |
+ /* Fall-through */ | |
+ default: | |
+ return DefSubclassProc(hWnd, uMsg, wParam, lParam); | |
+ } | |
+} | |
- if (!LoadStringW(hInst, IDS_UNABLE_TO_DOWNLOAD, szMsgText, _countof(szMsgText))) | |
- goto end; | |
+DWORD WINAPI CDownloadManager::ThreadFunc(LPVOID param) | |
+{ | |
+ CComPtr<IBindStatusCallback> dl; | |
+ ATL::CStringW Path; | |
+ PWSTR p, q; | |
- MessageBoxW(hMainWnd, szMsgText, NULL, MB_OK | MB_ICONERROR); | |
- goto end; | |
- } | |
+ HWND hDlg = static_cast<DownloadParam*>(param)->Dialog; | |
- dwStatusLen = sizeof(dwStatus); | |
+ ULONG dwContentLen, dwBytesWritten, dwBytesRead, dwStatus; | |
+ ULONG dwCurrentBytesRead = 0; | |
+ ULONG dwStatusLen = sizeof(dwStatus); | |
- memset(&urlComponents, 0, sizeof(urlComponents)); | |
- urlComponents.dwStructSize = sizeof(urlComponents); | |
+ BOOL bCancelled = FALSE; | |
+ BOOL bTempfile = FALSE; | |
+ BOOL bCab = FALSE; | |
- if(FAILED(StringCbLengthW(AppInfo->szUrlDownload, sizeof(AppInfo->szUrlDownload), &urlLength))) | |
- goto end; | |
+ HINTERNET hOpen = NULL; | |
+ HINTERNET hFile = NULL; | |
+ HANDLE hOut = INVALID_HANDLE_VALUE; | |
- urlLength /= sizeof(WCHAR); | |
- urlComponents.dwSchemeLength = urlLength + 1; | |
- urlComponents.lpszScheme = (LPWSTR)malloc(urlComponents.dwSchemeLength * sizeof(WCHAR)); | |
- urlComponents.dwHostNameLength = urlLength + 1; | |
- urlComponents.lpszHostName = (LPWSTR)malloc(urlComponents.dwHostNameLength * sizeof(WCHAR)); | |
+ unsigned char lpBuffer[4096]; | |
+ LPCWSTR lpszAgent = L"RApps/1.0"; | |
+ URL_COMPONENTS urlComponents; | |
+ size_t urlLength, filenameLength; | |
- if(!InternetCrackUrlW(AppInfo->szUrlDownload, urlLength+1, ICU_DECODE | ICU_ESCAPE, &urlComponents)) | |
- goto end; | |
- | |
- if(urlComponents.nScheme == INTERNET_SCHEME_HTTP || urlComponents.nScheme == INTERNET_SCHEME_HTTPS) | |
- HttpQueryInfo(hFile, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, &dwContentLen, &dwStatus, 0); | |
+ const INT iAppId = iCurrentApp; | |
+ const ATL::CSimpleArray<DownloadInfo> &InfoArray = static_cast<DownloadParam*>(param)->AppInfo; | |
+ LPCWSTR szCaption = static_cast<DownloadParam*>(param)->szCaption; | |
+ ATL::CStringW szNewCaption; | |
- if(urlComponents.nScheme == INTERNET_SCHEME_FTP) | |
- dwContentLen = FtpGetFileSize(hFile, &dwStatus); | |
-#ifdef USE_CERT_PINNING | |
- /* are we using HTTPS to download the RAPPS update package? check if the certificate is original */ | |
- if ((urlComponents.nScheme == INTERNET_SCHEME_HTTPS) && | |
- (wcscmp(AppInfo->szUrlDownload, APPLICATION_DATABASE_URL) == 0) && | |
- (!CertIsValid(hOpen, urlComponents.lpszHostName))) | |
+ if (InfoArray.GetSize() <= 0) | |
{ | |
- WCHAR szMsgText[MAX_STR_LEN]; | |
- | |
- if (!LoadStringW(hInst, IDS_CERT_DOES_NOT_MATCH, szMsgText, _countof(szMsgText))) | |
- goto end; | |
- | |
- MessageBoxW(Dlg, szMsgText, NULL, MB_OK | MB_ICONERROR); | |
+ MessageBox_LoadString(hMainWnd, IDS_UNABLE_TO_DOWNLOAD); | |
goto end; | |
} | |
-#endif | |
- free(urlComponents.lpszScheme); | |
- free(urlComponents.lpszHostName); | |
+ for (INT iAppId = 0; iAppId < InfoArray.GetSize(); ++iAppId) | |
+ { | |
+ const DownloadInfo &CurrentInfo = InfoArray[iAppId]; | |
- hOut = CreateFileW(path, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, 0, NULL); | |
+ // build the path for the download | |
+ p = wcsrchr(CurrentInfo.szUrl.GetString(), L'/'); | |
+ q = wcsrchr(CurrentInfo.szUrl.GetString(), L'?'); | |
- if (hOut == INVALID_HANDLE_VALUE) | |
- goto end; | |
+ // do we have a final slash separator? | |
+ if (!p) | |
+ goto end; | |
- do | |
- { | |
- if (!InternetReadFile(hFile, lpBuffer, _countof(lpBuffer), &dwBytesRead)) | |
+ // prepare the tentative length of the filename, maybe we've to remove part of it later on | |
+ filenameLength = wcslen(p) * sizeof(WCHAR); | |
+ | |
+ /* do we have query arguments in the target URL after the filename? account for them | |
+ (e.g. https://example.org/myfile.exe?no_adware_plz) */ | |
+ if (q && q > p && (q - p) > 0) | |
+ filenameLength -= wcslen(q - 1) * sizeof(WCHAR); | |
+ | |
+ // is this URL an update package for RAPPS? if so store it in a different place | |
+ if (CurrentInfo.szUrl == APPLICATION_DATABASE_URL) | |
{ | |
- WCHAR szMsgText[MAX_STR_LEN]; | |
- | |
- if (!LoadStringW(hInst, IDS_INTERRUPTED_DOWNLOAD, szMsgText, _countof(szMsgText))) | |
+ bCab = TRUE; | |
+ if (!GetStorageDirectory(Path)) | |
goto end; | |
- | |
- MessageBoxW(hMainWnd, szMsgText, NULL, MB_OK | MB_ICONERROR); | |
- goto end; | |
} | |
- if (!WriteFile(hOut, &lpBuffer[0], dwBytesRead, &dwBytesWritten, NULL)) | |
+ else | |
{ | |
- WCHAR szMsgText[MAX_STR_LEN]; | |
+ Path = SettingsInfo.szDownloadDir; | |
+ } | |
- if (!LoadStringW(hInst, IDS_UNABLE_TO_WRITE, szMsgText, _countof(szMsgText))) | |
+ // is the path valid? can we access it? | |
+ if (GetFileAttributesW(Path.GetString()) == INVALID_FILE_ATTRIBUTES) | |
+ { | |
+ if (!CreateDirectoryW(Path.GetString(), NULL)) | |
goto end; | |
+ } | |
- MessageBoxW(hMainWnd, szMsgText, NULL, MB_OK | MB_ICONERROR); | |
- goto end; | |
+ // append a \ to the provided file system path, and the filename portion from the URL after that | |
+ Path += L"\\"; | |
+ Path += (LPWSTR) (p + 1); | |
+ | |
+ if (!bCab && CurrentInfo.szSHA1[0] && GetFileAttributesW(Path.GetString()) != INVALID_FILE_ATTRIBUTES) | |
+ { | |
+ // only open it in case of total correctness | |
+ if (VerifyInteg(CurrentInfo.szSHA1.GetString(), Path)) | |
+ goto run; | |
} | |
- dwCurrentBytesRead += dwBytesRead; | |
- dl->OnProgress(dwCurrentBytesRead, dwContentLen, 0, AppInfo->szUrlDownload); | |
- } | |
- while (dwBytesRead && !bCancelled); | |
- CloseHandle(hOut); | |
- hOut = INVALID_HANDLE_VALUE; | |
+ // Reset progress bar | |
+ HWND Item = GetDlgItem(hDlg, IDC_DOWNLOAD_PROGRESS); | |
+ if (Item) | |
+ { | |
+ SendMessageW(Item, PBM_SETPOS, 0, 0); | |
+ } | |
- if (bCancelled) | |
- goto end; | |
+ // Change caption to show the currently downloaded app | |
+ if (!bCab) | |
+ { | |
+ szNewCaption.Format(szCaption, CurrentInfo.szName.GetString()); | |
+ } | |
+ else | |
+ { | |
+ szNewCaption.LoadStringW(IDS_DL_DIALOG_DB_DOWNLOAD_DISP); | |
+ } | |
- /* if this thing isn't a RAPPS update and it has a SHA-1 checksum | |
- verify its integrity by using the native advapi32.A_SHA1 functions */ | |
- if (!bCab && AppInfo->szSHA1[0] != 0) | |
- { | |
- WCHAR szMsgText[MAX_STR_LEN]; | |
+ SetWindowTextW(hDlg, szNewCaption.GetString()); | |
- /* change a few strings in the download dialog to reflect the verification process */ | |
- LoadStringW(hInst, IDS_INTEG_CHECK_TITLE, szMsgText, _countof(szMsgText)); | |
+ // Add the download URL | |
+ SetDlgItemTextW(hDlg, IDC_DOWNLOAD_STATUS, CurrentInfo.szUrl.GetString()); | |
- SetWindowText(Dlg, szMsgText); | |
- SendMessageW(GetDlgItem(Dlg, IDC_DOWNLOAD_STATUS), WM_SETTEXT, 0, (LPARAM)path); | |
+ DownloadsListView.SetDownloadStatus(iAppId, DOWNLOAD_STATUS::DLDownloading); | |
- /* this may take a while, depending on the file size */ | |
- if (!VerifyInteg(AppInfo->szSHA1, path)) | |
+ // download it | |
+ bTempfile = TRUE; | |
+ CDownloadDialog_Constructor(hDlg, &bCancelled, IID_PPV_ARG(IBindStatusCallback, &dl)); | |
+ | |
+ if (dl == NULL) | |
+ goto end; | |
+ | |
+ /* FIXME: this should just be using the system-wide proxy settings */ | |
+ switch (SettingsInfo.Proxy) | |
{ | |
- if (!LoadStringW(hInst, IDS_INTEG_CHECK_FAIL, szMsgText, _countof(szMsgText))) | |
- goto end; | |
+ case 0: // preconfig | |
+ hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); | |
+ break; | |
+ case 1: // direct (no proxy) | |
+ hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, 0); | |
+ break; | |
+ case 2: // use proxy | |
+ hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PROXY, SettingsInfo.szProxyServer, SettingsInfo.szNoProxyFor, 0); | |
+ break; | |
+ default: // preconfig | |
+ hOpen = InternetOpenW(lpszAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); | |
+ break; | |
+ } | |
- MessageBoxW(Dlg, szMsgText, NULL, MB_OK | MB_ICONERROR); | |
+ if (!hOpen) | |
goto end; | |
+ | |
+ hFile = InternetOpenUrlW(hOpen, CurrentInfo.szUrl.GetString(), NULL, 0, INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_KEEP_CONNECTION, 0); | |
+ | |
+ if (!hFile) | |
+ { | |
+ MessageBox_LoadString(hMainWnd, IDS_UNABLE_TO_DOWNLOAD2); | |
+ goto end; | |
} | |
- } | |
- ShowWindow(Dlg, SW_HIDE); | |
+ if (!HttpQueryInfoW(hFile, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &dwStatus, &dwStatusLen, NULL)) | |
+ goto end; | |
-run: | |
- /* run it */ | |
- if (!bCab) | |
- ShellExecuteW( NULL, L"open", path, NULL, NULL, SW_SHOWNORMAL ); | |
+ if (dwStatus != HTTP_STATUS_OK) | |
+ { | |
+ MessageBox_LoadString(hMainWnd, IDS_UNABLE_TO_DOWNLOAD); | |
+ goto end; | |
+ } | |
-end: | |
- if (hOut != INVALID_HANDLE_VALUE) | |
- CloseHandle(hOut); | |
+ dwStatusLen = sizeof(dwStatus); | |
- InternetCloseHandle(hFile); | |
- InternetCloseHandle(hOpen); | |
+ memset(&urlComponents, 0, sizeof(urlComponents)); | |
+ urlComponents.dwStructSize = sizeof(urlComponents); | |
- if (bTempfile) | |
- { | |
- if (bCancelled || (SettingsInfo.bDelInstaller && !bCab)) | |
- DeleteFileW(path); | |
- } | |
+ urlLength = CurrentInfo.szUrl.GetLength(); | |
+ urlComponents.dwSchemeLength = urlLength + 1; | |
+ urlComponents.lpszScheme = (LPWSTR) malloc(urlComponents.dwSchemeLength * sizeof(WCHAR)); | |
+ urlComponents.dwHostNameLength = urlLength + 1; | |
+ urlComponents.lpszHostName = (LPWSTR) malloc(urlComponents.dwHostNameLength * sizeof(WCHAR)); | |
- EndDialog(Dlg, 0); | |
+ if (!InternetCrackUrlW(CurrentInfo.szUrl, urlLength + 1, ICU_DECODE | ICU_ESCAPE, &urlComponents)) | |
+ goto end; | |
- return 0; | |
-} | |
+ if (urlComponents.nScheme == INTERNET_SCHEME_HTTP || urlComponents.nScheme == INTERNET_SCHEME_HTTPS) | |
+ HttpQueryInfoW(hFile, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, &dwContentLen, &dwStatus, 0); | |
+ if (urlComponents.nScheme == INTERNET_SCHEME_FTP) | |
+ dwContentLen = FtpGetFileSize(hFile, &dwStatus); | |
-LRESULT CALLBACK | |
-DownloadProgressProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData) | |
-{ | |
- static WCHAR szProgressText[MAX_STR_LEN] = {0}; | |
+#ifdef USE_CERT_PINNING | |
+ // are we using HTTPS to download the RAPPS update package? check if the certificate is original | |
+ if ((urlComponents.nScheme == INTERNET_SCHEME_HTTPS) && | |
+ (wcscmp(CurrentInfo.szUrl, APPLICATION_DATABASE_URL) == 0) && | |
+ (!CertIsValid(hOpen, urlComponents.lpszHostName))) | |
+ { | |
+ MessageBox_LoadString(hMainWnd, IDS_CERT_DOES_NOT_MATCH); | |
+ goto end; | |
+ } | |
+#endif | |
- switch (uMsg) | |
- { | |
- case WM_SETTEXT: | |
+ free(urlComponents.lpszScheme); | |
+ free(urlComponents.lpszHostName); | |
+ | |
+ hOut = CreateFileW(Path.GetString(), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, 0, NULL); | |
+ | |
+ if (hOut == INVALID_HANDLE_VALUE) | |
+ goto end; | |
+ | |
+ dwCurrentBytesRead = 0; | |
+ do | |
{ | |
- if (lParam) | |
+ if (!InternetReadFile(hFile, lpBuffer, _countof(lpBuffer), &dwBytesRead)) | |
{ | |
- StringCbCopyW(szProgressText, | |
- sizeof(szProgressText), | |
- (PCWSTR)lParam); | |
+ MessageBox_LoadString(hMainWnd, IDS_INTERRUPTED_DOWNLOAD); | |
+ goto end; | |
} | |
- return TRUE; | |
- } | |
- case WM_ERASEBKGND: | |
- case WM_PAINT: | |
- { | |
- PAINTSTRUCT ps; | |
- HDC hDC = BeginPaint(hWnd, &ps), hdcMem; | |
- HBITMAP hbmMem; | |
- HANDLE hOld; | |
- RECT myRect; | |
- UINT win_width, win_height; | |
+ if (!WriteFile(hOut, &lpBuffer[0], dwBytesRead, &dwBytesWritten, NULL)) | |
+ { | |
+ MessageBox_LoadString(hMainWnd, IDS_UNABLE_TO_WRITE); | |
+ goto end; | |
+ } | |
- GetClientRect(hWnd, &myRect); | |
+ dwCurrentBytesRead += dwBytesRead; | |
+ dl->OnProgress(dwCurrentBytesRead, dwContentLen, 0, CurrentInfo.szUrl.GetString()); | |
+ } while (dwBytesRead && !bCancelled); | |
- /* grab the progress bar rect size */ | |
- win_width = myRect.right - myRect.left; | |
- win_height = myRect.bottom - myRect.top; | |
+ CloseHandle(hOut); | |
+ hOut = INVALID_HANDLE_VALUE; | |
- /* create an off-screen DC for double-buffering */ | |
- hdcMem = CreateCompatibleDC(hDC); | |
- hbmMem = CreateCompatibleBitmap(hDC, win_width, win_height); | |
+ if (bCancelled) | |
+ goto end; | |
- hOld = SelectObject(hdcMem, hbmMem); | |
+ /* if this thing isn't a RAPPS update and it has a SHA-1 checksum | |
+ verify its integrity by using the native advapi32.A_SHA1 functions */ | |
+ if (!bCab && CurrentInfo.szSHA1[0] != 0) | |
+ { | |
+ ATL::CStringW szMsgText; | |
- /* call the original draw code and redirect it to our memory buffer */ | |
- DefSubclassProc(hWnd, uMsg, (WPARAM)hdcMem, lParam); | |
+ // change a few strings in the download dialog to reflect the verification process | |
+ if (!szMsgText.LoadStringW(IDS_INTEG_CHECK_TITLE)) | |
+ goto end; | |
- /* draw our nifty progress text over it */ | |
- SelectFont(hdcMem, GetStockFont(DEFAULT_GUI_FONT)); | |
- DrawShadowText(hdcMem, szProgressText, wcslen(szProgressText), | |
- &myRect, | |
- DT_CENTER | DT_VCENTER | DT_NOPREFIX | DT_SINGLELINE, | |
- GetSysColor(COLOR_CAPTIONTEXT), | |
- GetSysColor(COLOR_3DSHADOW), | |
- 1, 1); | |
+ SetWindowTextW(hDlg, szMsgText.GetString()); | |
+ SendMessageW(GetDlgItem(hDlg, IDC_DOWNLOAD_STATUS), WM_SETTEXT, 0, (LPARAM) Path.GetString()); | |
- /* transfer the off-screen DC to the screen */ | |
- BitBlt(hDC, 0, 0, win_width, win_height, hdcMem, 0, 0, SRCCOPY); | |
+ // this may take a while, depending on the file size | |
+ if (!VerifyInteg(CurrentInfo.szSHA1.GetString(), Path.GetString())) | |
+ { | |
+ if (!szMsgText.LoadStringW(IDS_INTEG_CHECK_FAIL)) | |
+ goto end; | |
- /* free the off-screen DC */ | |
- SelectObject(hdcMem, hOld); | |
- DeleteObject(hbmMem); | |
- DeleteDC(hdcMem); | |
- | |
- EndPaint(hWnd, &ps); | |
- return 0; | |
+ MessageBoxW(hDlg, szMsgText.GetString(), NULL, MB_OK | MB_ICONERROR); | |
+ goto end; | |
+ } | |
} | |
- /* Raymond Chen says that we should safely unsubclass all the things! | |
- (http://blogs.msdn.com/b/oldnewthing/archive/2003/11/11/55653.aspx) */ | |
- case WM_NCDESTROY: | |
- { | |
- ZeroMemory(szProgressText, sizeof(szProgressText)); | |
- RemoveWindowSubclass(hWnd, DownloadProgressProc, uIdSubclass); | |
- } | |
- /* Fall-through */ | |
- default: | |
- return DefSubclassProc(hWnd, uMsg, wParam, lParam); | |
- } | |
-} | |
+run: | |
+ DownloadsListView.SetDownloadStatus(iAppId, DOWNLOAD_STATUS::DLWaitingToInstall); | |
-static | |
-INT_PTR CALLBACK | |
-DownloadDlgProc(HWND Dlg, UINT uMsg, WPARAM wParam, LPARAM lParam) | |
-{ | |
- HANDLE Thread; | |
- DWORD ThreadId; | |
- HWND Item; | |
- | |
- switch (uMsg) | |
- { | |
- case WM_INITDIALOG: | |
+ // run it | |
+ if (!bCab) | |
{ | |
- HICON hIconSm = NULL, hIconBg = NULL; | |
+ SHELLEXECUTEINFOW shExInfo = {0}; | |
+ shExInfo.cbSize = sizeof(shExInfo); | |
+ shExInfo.fMask = SEE_MASK_NOCLOSEPROCESS; | |
+ shExInfo.lpVerb = L"open"; | |
+ shExInfo.lpFile = Path.GetString(); | |
+ shExInfo.lpParameters = L""; | |
+ shExInfo.nShow = SW_SHOW; | |
- hIconBg = (HICON)GetClassLongPtr(hMainWnd, GCLP_HICON); | |
- hIconSm = (HICON)GetClassLongPtr(hMainWnd, GCLP_HICONSM); | |
- | |
- if (hIconBg && hIconSm) | |
+ if (ShellExecuteExW(&shExInfo)) | |
{ | |
- SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) hIconBg); | |
- SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) hIconSm); | |
+ DownloadsListView.SetDownloadStatus(iAppId, DOWNLOAD_STATUS::DLInstalling); | |
+ //TODO: issue an install operation separately so that the apps could be downloaded in the background | |
+ WaitForSingleObject(shExInfo.hProcess, INFINITE); | |
+ CloseHandle(shExInfo.hProcess); | |
} | |
- | |
- SetWindowLongPtrW(Dlg, GWLP_USERDATA, 0); | |
- Item = GetDlgItem(Dlg, IDC_DOWNLOAD_PROGRESS); | |
- if (Item) | |
+ else | |
{ | |
- /* initialize the default values for our nifty progress bar | |
- and subclass it so that it learns to print a status text */ | |
- SendMessageW(Item, PBM_SETRANGE, 0, MAKELPARAM(0, 100)); | |
- SendMessageW(Item, PBM_SETPOS, 0, 0); | |
- | |
- SetWindowSubclass(Item, DownloadProgressProc, 0, 0); | |
+ MessageBox_LoadString(hMainWnd, IDS_UNABLE_TO_INSTALL); | |
} | |
+ } | |
- /* add a neat placeholder until the download URL is retrieved */ | |
- Item = GetDlgItem(Dlg, IDC_DOWNLOAD_STATUS); | |
- SendMessageW(Item, WM_SETTEXT, 0, (LPARAM)L"\x2022 \x2022 \x2022"); | |
+end: | |
+ if (hOut != INVALID_HANDLE_VALUE) | |
+ CloseHandle(hOut); | |
- Thread = CreateThread(NULL, 0, ThreadFunc, Dlg, 0, &ThreadId); | |
- if (!Thread) | |
- return FALSE; | |
- CloseHandle(Thread); | |
- return TRUE; | |
+ InternetCloseHandle(hFile); | |
+ InternetCloseHandle(hOpen); | |
+ | |
+ if (bTempfile) | |
+ { | |
+ if (bCancelled || (SettingsInfo.bDelInstaller && !bCab)) | |
+ DeleteFileW(Path.GetString()); | |
} | |
- case WM_COMMAND: | |
- if (wParam == IDCANCEL) | |
- { | |
- SetWindowLongPtrW(Dlg, GWLP_USERDATA, 1); | |
- PostMessageW(Dlg, WM_CLOSE, 0, 0); | |
- } | |
- return FALSE; | |
- case WM_CLOSE: | |
- EndDialog(Dlg, 0); | |
- return TRUE; | |
+ DownloadsListView.SetDownloadStatus(iAppId, DOWNLOAD_STATUS::DLFinished); | |
+ } | |
- default: | |
- return FALSE; | |
- } | |
+ delete param; | |
+ SendMessageW(hDlg, WM_CLOSE, 0, 0); | |
+ return 0; | |
} | |
-BOOL | |
-DownloadApplication(INT Index) | |
+BOOL CDownloadManager::DownloadListOfApplications(const ATL::CSimpleArray<CAvailableApplicationInfo*>& AppsList, BOOL bIsModal) | |
{ | |
- if (!IS_AVAILABLE_ENUM(SelectedEnumType)) | |
+ if (AppsList.GetSize() == 0) | |
+ { | |
return FALSE; | |
+ } | |
- AppInfo = (PAPPLICATION_INFO) ListViewGetlParam(Index); | |
- if (!AppInfo) return FALSE; | |
+ // Initialize shared variables | |
+ for (INT i = 0; i < AppsList.GetSize(); ++i) | |
+ { | |
+ if (AppsList[i]) | |
+ { | |
+ AppsToInstallList.Add(*(AppsList[i])); | |
+ } | |
+ } | |
- WriteLogMessage(EVENTLOG_SUCCESS, MSG_SUCCESS_INSTALL, AppInfo->szName); | |
+ // Create a dialog and issue a download process | |
+ LaunchDownloadDialog(bIsModal); | |
- DialogBoxW(hInst, | |
- MAKEINTRESOURCEW(IDD_DOWNLOAD_DIALOG), | |
- hMainWnd, | |
- DownloadDlgProc); | |
+ return TRUE; | |
+} | |
+BOOL CDownloadManager::DownloadApplication(CAvailableApplicationInfo* pAppInfo, BOOL bIsModal) | |
+{ | |
+ if (!pAppInfo) | |
+ return FALSE; | |
+ | |
+ Download(*pAppInfo, bIsModal); | |
return TRUE; | |
} | |
-VOID | |
-DownloadApplicationsDB(LPCWSTR lpUrl) | |
+VOID CDownloadManager::DownloadApplicationsDB(LPCWSTR lpUrl) | |
{ | |
- APPLICATION_INFO IntInfo; | |
+ static DownloadInfo DatabaseDLInfo; | |
+ DatabaseDLInfo.szUrl = lpUrl; | |
+ DatabaseDLInfo.szName.LoadStringW(IDS_DL_DIALOG_DB_DISP); | |
+ Download(DatabaseDLInfo, TRUE); | |
+} | |
- ZeroMemory(&IntInfo, sizeof(IntInfo)); | |
- if (FAILED(StringCbCopyW(IntInfo.szUrlDownload, | |
- sizeof(IntInfo.szUrlDownload), | |
- lpUrl))) | |
+//TODO: Reuse the dialog | |
+VOID CDownloadManager::LaunchDownloadDialog(BOOL bIsModal) | |
+{ | |
+ if (bIsModal) | |
{ | |
- return; | |
+ DialogBoxW(hInst, | |
+ MAKEINTRESOURCEW(IDD_DOWNLOAD_DIALOG), | |
+ hMainWnd, | |
+ DownloadDlgProc); | |
} | |
- | |
- AppInfo = &IntInfo; | |
- | |
- DialogBoxW(hInst, | |
- MAKEINTRESOURCEW(IDD_DOWNLOAD_DIALOG), | |
- hMainWnd, | |
- DownloadDlgProc); | |
+ else | |
+ { | |
+ CreateDialogW(hInst, | |
+ MAKEINTRESOURCEW(IDD_DOWNLOAD_DIALOG), | |
+ hMainWnd, | |
+ DownloadDlgProc); | |
+ } | |
} | |
- | |
+// CDownloadManager | |
Index: base/applications/rapps/rapps.rc | |
=================================================================== | |
--- base/applications/rapps/rapps.rc (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/rapps.rc (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -22,6 +22,7 @@ | |
IDI_APPUPD ICON "res/appupd.ico" | |
IDI_CATEGORY ICON "res/cat.ico" | |
IDI_UPDATE_DB ICON "res/updatedb.ico" | |
+IDI_CHECK_ALL ICON "res/select.ico" | |
/* Categories */ | |
IDI_CAT_AUDIO ICON "res/cats/audio.ico" | |
Index: base/applications/rapps/res/select.ico | |
=================================================================== | |
Cannot display: file marked as a binary type. | |
svn:mime-type = application/octet-stream | |
Index: base/applications/rapps/res/select.ico | |
=================================================================== | |
--- base/applications/rapps/res/select.ico (.../trunk/reactos) (nonexistent) | |
+++ base/applications/rapps/res/select.ico (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
Property changes on: base/applications/rapps/res/select.ico | |
___________________________________________________________________ | |
Added: svn:mime-type | |
## -0,0 +1 ## | |
+application/octet-stream | |
\ No newline at end of property | |
Index: base/applications/rapps/integrity.cpp | |
=================================================================== | |
--- base/applications/rapps/integrity.cpp (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/integrity.cpp (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -6,10 +6,14 @@ | |
* PROGRAMMERS: Ismael Ferreras Morezuelas (swyterzone+ros@gmail.com) | |
* Mark Jansen | |
*/ | |
+#include "defines.h" | |
-#include "rapps.h" | |
#include <sha1.h> | |
+BOOL VerifyInteg(const ATL::CStringW &SHA1Hash, const ATL::CStringW &FileName) | |
+{ | |
+ return VerifyInteg(SHA1Hash.GetString(), FileName.GetString()); | |
+} | |
BOOL VerifyInteg(LPCWSTR lpSHA1Hash, LPCWSTR lpFileName) | |
{ | |
@@ -49,7 +53,7 @@ | |
WCHAR buf[(sizeof(sha) * 2) + 1]; | |
for (UINT i = 0; i < sizeof(sha); i++) | |
- swprintf(buf + 2 * i, L"%02x", ((unsigned char *)sha)[i]); | |
+ swprintf(buf + 2 * i, L"%02x", ((unsigned char *) sha)[i]); | |
/* does the resulting SHA1 match with the provided one? */ | |
if (!_wcsicmp(buf, lpSHA1Hash)) | |
ret = TRUE; | |
Index: base/applications/rapps/installed.cpp | |
=================================================================== | |
--- base/applications/rapps/installed.cpp (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/installed.cpp (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -3,14 +3,28 @@ | |
* LICENSE: GPL - See COPYING in the top level directory | |
* FILE: base/applications/rapps/installed.cpp | |
* PURPOSE: Functions for working with installed applications | |
- * PROGRAMMERS: Dmitry Chapyshev (dmitry@reactos.org) | |
+ * PROGRAMMERS: Dmitry Chapyshev (dmitry@reactos.org) | |
+ * Alexander Shaposhnikov (chaez.san@gmail.com) | |
*/ | |
-#include "rapps.h" | |
+#include "defines.h" | |
+#include "installed.h" | |
+ | |
+#include "gui.h" | |
+#include "misc.h" | |
+ | |
BOOL | |
-GetApplicationString(HKEY hKey, LPCWSTR lpKeyName, LPWSTR lpString) | |
+GetApplicationString(HKEY hKey, LPCWSTR lpKeyName, ATL::CStringW& String) | |
{ | |
+ BOOL result = GetApplicationString(hKey, lpKeyName, String.GetBuffer(MAX_PATH)); | |
+ String.ReleaseBuffer(); | |
+ return result; | |
+} | |
+ | |
+BOOL | |
+GetApplicationString(HKEY hKey, LPCWSTR lpKeyName, LPWSTR szString) | |
+{ | |
DWORD dwSize = MAX_PATH * sizeof(WCHAR); | |
if (RegQueryValueExW(hKey, | |
@@ -17,76 +31,26 @@ | |
lpKeyName, | |
NULL, | |
NULL, | |
- (LPBYTE)lpString, | |
+ (LPBYTE) szString, | |
&dwSize) == ERROR_SUCCESS) | |
{ | |
return TRUE; | |
} | |
- (VOID)StringCchCopyW(lpString, MAX_PATH, L"---"); | |
- | |
+ StringCchCopyW(szString, MAX_PATH, L"---"); | |
return FALSE; | |
} | |
- | |
BOOL | |
-IsInstalledApplication(LPWSTR lpRegName, BOOL IsUserKey) | |
-{ | |
- DWORD dwSize = MAX_PATH, dwType; | |
- WCHAR szName[MAX_PATH]; | |
- WCHAR szDisplayName[MAX_PATH]; | |
- HKEY hKey, hSubKey; | |
- INT ItemIndex = 0; | |
- | |
- if (RegOpenKeyW(IsUserKey ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE, | |
- L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall", | |
- &hKey) != ERROR_SUCCESS) | |
- { | |
- return FALSE; | |
- } | |
- | |
- while (RegEnumKeyExW(hKey, ItemIndex, szName, &dwSize, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) | |
- { | |
- if (RegOpenKeyW(hKey, szName, &hSubKey) == ERROR_SUCCESS) | |
- { | |
- dwType = REG_SZ; | |
- dwSize = sizeof(szDisplayName); | |
- if (RegQueryValueExW(hSubKey, | |
- L"DisplayName", | |
- NULL, | |
- &dwType, | |
- (LPBYTE)szDisplayName, | |
- &dwSize) == ERROR_SUCCESS) | |
- { | |
- if (wcscmp(szDisplayName, lpRegName) == 0) | |
- { | |
- RegCloseKey(hSubKey); | |
- RegCloseKey(hKey); | |
- return TRUE; | |
- } | |
- } | |
- } | |
- | |
- RegCloseKey(hSubKey); | |
- dwSize = MAX_PATH; | |
- ItemIndex++; | |
- } | |
- | |
- RegCloseKey(hKey); | |
- return FALSE; | |
-} | |
- | |
- | |
-BOOL | |
UninstallApplication(INT Index, BOOL bModify) | |
{ | |
- WCHAR szModify[] = L"ModifyPath"; | |
- WCHAR szUninstall[] = L"UninstallString"; | |
+ LPCWSTR szModify = L"ModifyPath"; | |
+ LPCWSTR szUninstall = L"UninstallString"; | |
WCHAR szPath[MAX_PATH]; | |
WCHAR szAppName[MAX_STR_LEN]; | |
DWORD dwType, dwSize; | |
INT ItemIndex; | |
- LVITEM Item; | |
+ LVITEMW Item; | |
HKEY hKey; | |
PINSTALLED_INFO ItemInfo; | |
@@ -114,16 +78,16 @@ | |
if (!ListView_GetItem(hListView, &Item)) | |
return FALSE; | |
- ItemInfo = (PINSTALLED_INFO)Item.lParam; | |
+ ItemInfo = (PINSTALLED_INFO) Item.lParam; | |
hKey = ItemInfo->hSubKey; | |
dwType = REG_SZ; | |
- dwSize = sizeof(szPath); | |
+ dwSize = MAX_PATH * sizeof(WCHAR); | |
if (RegQueryValueExW(hKey, | |
bModify ? szModify : szUninstall, | |
NULL, | |
&dwType, | |
- (LPBYTE)szPath, | |
+ (LPBYTE) szPath, | |
&dwSize) != ERROR_SUCCESS) | |
{ | |
return FALSE; | |
@@ -132,11 +96,11 @@ | |
return StartProcess(szPath, TRUE); | |
} | |
- | |
BOOL | |
ShowInstalledAppInfo(INT Index) | |
{ | |
- WCHAR szText[MAX_PATH], szInfo[MAX_PATH]; | |
+ ATL::CStringW szText; | |
+ ATL::CStringW szInfo; | |
PINSTALLED_INFO Info = (PINSTALLED_INFO) ListViewGetlParam(Index); | |
if (!Info || !Info->hSubKey) return FALSE; | |
@@ -143,13 +107,12 @@ | |
GetApplicationString(Info->hSubKey, L"DisplayName", szText); | |
NewRichEditText(szText, CFE_BOLD); | |
- | |
InsertRichEditText(L"\n", 0); | |
#define GET_INFO(a, b, c, d) \ | |
if (GetApplicationString(Info->hSubKey, a, szInfo)) \ | |
{ \ | |
- LoadStringW(hInst, b, szText, _countof(szText)); \ | |
+ szText.LoadStringW(b); \ | |
InsertRichEditText(szText, c); \ | |
InsertRichEditText(szInfo, d); \ | |
} \ | |
@@ -175,14 +138,13 @@ | |
return TRUE; | |
} | |
- | |
VOID | |
RemoveAppFromRegistry(INT Index) | |
{ | |
PINSTALLED_INFO Info; | |
WCHAR szFullName[MAX_PATH] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\"; | |
- WCHAR szMsgText[MAX_STR_LEN], szMsgTitle[MAX_STR_LEN]; | |
- INT ItemIndex = SendMessage(hListView, LVM_GETNEXTITEM, -1, LVNI_FOCUSED); | |
+ ATL::CStringW szMsgText, szMsgTitle; | |
+ INT ItemIndex = SendMessageW(hListView, LVM_GETNEXTITEM, -1, LVNI_FOCUSED); | |
if (!IS_INSTALLED_ENUM(SelectedEnumType)) | |
return; | |
@@ -190,35 +152,37 @@ | |
Info = (PINSTALLED_INFO) ListViewGetlParam(Index); | |
if (!Info || !Info->hSubKey || (ItemIndex == -1)) return; | |
- if (!LoadStringW(hInst, IDS_APP_REG_REMOVE, szMsgText, _countof(szMsgText)) || | |
- !LoadStringW(hInst, IDS_INFORMATION, szMsgTitle, _countof(szMsgTitle))) | |
+ if (!szMsgText.LoadStringW(IDS_APP_REG_REMOVE) || | |
+ !szMsgTitle.LoadStringW(IDS_INFORMATION)) | |
return; | |
if (MessageBoxW(hMainWnd, szMsgText, szMsgTitle, MB_YESNO | MB_ICONQUESTION) == IDYES) | |
{ | |
- wcsncat(szFullName, Info->szKeyName, MAX_PATH - wcslen(szFullName)); | |
+ ATL::CStringW::CopyChars(szFullName, | |
+ MAX_PATH, | |
+ Info->szKeyName.GetString(), | |
+ MAX_PATH - wcslen(szFullName)); | |
if (RegDeleteKeyW(Info->hRootKey, szFullName) == ERROR_SUCCESS) | |
{ | |
- (VOID) ListView_DeleteItem(hListView, ItemIndex); | |
+ ListView_DeleteItem(hListView, ItemIndex); | |
return; | |
} | |
- if (!LoadStringW(hInst, IDS_UNABLE_TO_REMOVE, szMsgText, _countof(szMsgText))) | |
+ if (!szMsgText.LoadStringW(IDS_UNABLE_TO_REMOVE)) | |
return; | |
- MessageBoxW(hMainWnd, szMsgText, NULL, MB_OK | MB_ICONERROR); | |
+ MessageBoxW(hMainWnd, szMsgText.GetString(), NULL, MB_OK | MB_ICONERROR); | |
} | |
} | |
- | |
BOOL | |
EnumInstalledApplications(INT EnumType, BOOL IsUserKey, APPENUMPROC lpEnumProc) | |
{ | |
DWORD dwSize = MAX_PATH, dwType, dwValue; | |
BOOL bIsSystemComponent, bIsUpdate; | |
- WCHAR pszParentKeyName[MAX_PATH]; | |
- WCHAR pszDisplayName[MAX_PATH]; | |
+ ATL::CStringW szParentKeyName; | |
+ ATL::CStringW szDisplayName; | |
INSTALLED_INFO Info; | |
HKEY hKey; | |
LONG ItemIndex = 0; | |
@@ -232,9 +196,10 @@ | |
return FALSE; | |
} | |
- while (RegEnumKeyExW(hKey, ItemIndex, Info.szKeyName, &dwSize, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) | |
+ while (RegEnumKeyExW(hKey, ItemIndex, Info.szKeyName.GetBuffer(MAX_PATH), &dwSize, NULL, NULL, NULL, NULL) == ERROR_SUCCESS) | |
{ | |
- if (RegOpenKeyW(hKey, Info.szKeyName, &Info.hSubKey) == ERROR_SUCCESS) | |
+ Info.szKeyName.ReleaseBuffer(); | |
+ if (RegOpenKeyW(hKey, Info.szKeyName.GetString(), &Info.hSubKey) == ERROR_SUCCESS) | |
{ | |
dwType = REG_DWORD; | |
dwSize = sizeof(DWORD); | |
@@ -243,7 +208,7 @@ | |
L"SystemComponent", | |
NULL, | |
&dwType, | |
- (LPBYTE)&dwValue, | |
+ (LPBYTE) &dwValue, | |
&dwSize) == ERROR_SUCCESS) | |
{ | |
bIsSystemComponent = (dwValue == 0x1); | |
@@ -254,22 +219,25 @@ | |
} | |
dwType = REG_SZ; | |
- dwSize = sizeof(pszParentKeyName); | |
+ dwSize = MAX_PATH * sizeof(WCHAR); | |
bIsUpdate = (RegQueryValueExW(Info.hSubKey, | |
L"ParentKeyName", | |
NULL, | |
&dwType, | |
- (LPBYTE)pszParentKeyName, | |
+ (LPBYTE) szParentKeyName.GetBuffer(MAX_PATH), | |
&dwSize) == ERROR_SUCCESS); | |
+ szParentKeyName.ReleaseBuffer(); | |
- dwSize = sizeof(pszDisplayName); | |
+ dwType = REG_SZ; | |
+ dwSize = MAX_PATH * sizeof(WCHAR); | |
if (RegQueryValueExW(Info.hSubKey, | |
L"DisplayName", | |
NULL, | |
&dwType, | |
- (LPBYTE)pszDisplayName, | |
+ (LPBYTE) szDisplayName.GetBuffer(MAX_PATH), | |
&dwSize) == ERROR_SUCCESS) | |
{ | |
+ szDisplayName.ReleaseBuffer(); | |
if (EnumType < ENUM_ALL_COMPONENTS || EnumType > ENUM_UPDATES) | |
EnumType = ENUM_ALL_COMPONENTS; | |
@@ -279,7 +247,7 @@ | |
((EnumType == ENUM_APPLICATIONS) && (!bIsUpdate)) || /* Applications only */ | |
((EnumType == ENUM_UPDATES) && (bIsUpdate))) /* Updates only */ | |
{ | |
- if (!lpEnumProc(ItemIndex, pszDisplayName, &Info)) | |
+ if (!lpEnumProc(ItemIndex, szDisplayName, &Info)) | |
break; | |
} | |
else | |
@@ -294,6 +262,7 @@ | |
} | |
else | |
{ | |
+ szDisplayName.ReleaseBuffer(); | |
RegCloseKey(Info.hSubKey); | |
} | |
} | |
@@ -302,6 +271,7 @@ | |
ItemIndex++; | |
} | |
+ Info.szKeyName.ReleaseBuffer(); | |
RegCloseKey(hKey); | |
return TRUE; | |
Index: base/applications/rapps/available.cpp | |
=================================================================== | |
--- base/applications/rapps/available.cpp (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/available.cpp (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -2,244 +2,375 @@ | |
* PROJECT: ReactOS Applications Manager | |
* LICENSE: GPL - See COPYING in the top level directory | |
* FILE: base/applications/rapps/available.cpp | |
- * PURPOSE: Functions for working with available applications | |
+ * PURPOSE: Classes for working with available applications | |
* PROGRAMMERS: Dmitry Chapyshev (dmitry@reactos.org) | |
* Ismael Ferreras Morezuelas (swyterzone+ros@gmail.com) | |
+ * Alexander Shaposhnikov (chaez.san@gmail.com) | |
*/ | |
+#include "defines.h" | |
-#include "rapps.h" | |
+#include "available.h" | |
+#include "misc.h" | |
+#include "dialogs.h" | |
-#define ADD_TEXT(a, b, c, d) \ | |
- if (b[0] != '\0') \ | |
- { \ | |
- LoadStringW(hInst, a, szText, _countof(szText)); \ | |
- InsertRichEditText(szText, c); \ | |
- InsertRichEditText(b, d); \ | |
- } \ | |
+#include <atlcoll.h> | |
+#include <atlsimpcoll.h> | |
+#include <atlstr.h> | |
-#define GET_STRING1(a, b) \ | |
- if (!ParserGetString(a, b, _countof(b), FindFileData.cFileName)) \ | |
- continue; | |
+ // CAvailableApplicationInfo | |
+CAvailableApplicationInfo::CAvailableApplicationInfo(const ATL::CStringW& sFileNameParam) | |
+ : m_Parser(sFileNameParam) | |
+{ | |
+ LicenseType = LICENSE_TYPE::None; | |
-#define GET_STRING2(a, b) \ | |
- if (!ParserGetString(a, b, _countof(b), FindFileData.cFileName)) \ | |
- b[0] = '\0'; | |
+ sFileName = sFileNameParam; | |
-LIST_ENTRY CachedEntriesHead = { &CachedEntriesHead, &CachedEntriesHead }; | |
-PLIST_ENTRY pCachedEntry = &CachedEntriesHead; | |
+ RetrieveGeneralInfo(); | |
+} | |
-BOOL | |
-ShowAvailableAppInfo(INT Index) | |
+VOID CAvailableApplicationInfo::RefreshAppInfo() | |
{ | |
- PAPPLICATION_INFO Info = (PAPPLICATION_INFO) ListViewGetlParam(Index); | |
- WCHAR szText[MAX_STR_LEN]; | |
+ if (szUrlDownload.IsEmpty()) | |
+ { | |
+ RetrieveGeneralInfo(); | |
+ } | |
+} | |
- if (!Info) return FALSE; | |
+// Lazily load general info from the file | |
+VOID CAvailableApplicationInfo::RetrieveGeneralInfo() | |
+{ | |
+ Category = m_Parser.GetInt(L"Category"); | |
- NewRichEditText(Info->szName, CFE_BOLD); | |
+ if (!GetString(L"Name", szName) | |
+ || !GetString(L"URLDownload", szUrlDownload)) | |
+ { | |
+ return; | |
+ } | |
- InsertRichEditText(L"\n", 0); | |
+ GetString(L"RegName", szRegName); | |
+ GetString(L"Version", szVersion); | |
+ GetString(L"License", szLicense); | |
+ GetString(L"Description", szDesc); | |
+ GetString(L"Size", szSize); | |
+ GetString(L"URLSite", szUrlSite); | |
+ GetString(L"CDPath", szCDPath); | |
+ GetString(L"Language", szRegName); | |
+ GetString(L"SHA1", szSHA1); | |
- ADD_TEXT(IDS_AINFO_VERSION, Info->szVersion, CFE_BOLD, 0); | |
- ADD_TEXT(IDS_AINFO_LICENSE, Info->szLicense, CFE_BOLD, 0); | |
- ADD_TEXT(IDS_AINFO_SIZE, Info->szSize, CFE_BOLD, 0); | |
- ADD_TEXT(IDS_AINFO_URLSITE, Info->szUrlSite, CFE_BOLD, CFE_LINK); | |
- ADD_TEXT(IDS_AINFO_DESCRIPTION, Info->szDesc, CFE_BOLD, 0); | |
- ADD_TEXT(IDS_AINFO_URLDOWNLOAD, Info->szUrlDownload, CFE_BOLD, CFE_LINK); | |
+ RetrieveLicenseType(); | |
+ RetrieveLanguages(); | |
+ RetrieveInstalledStatus(); | |
+ if (m_IsInstalled) | |
+ { | |
+ RetrieveInstalledVersion(); | |
+ } | |
+} | |
- return TRUE; | |
+VOID CAvailableApplicationInfo::RetrieveInstalledStatus() | |
+{ | |
+ m_IsInstalled = ::GetInstalledVersion(NULL, szRegName) | |
+ || ::GetInstalledVersion(NULL, szName); | |
} | |
-static BOOL | |
-DeleteCurrentAppsDB(VOID) | |
+VOID CAvailableApplicationInfo::RetrieveInstalledVersion() | |
{ | |
- HANDLE hFind = INVALID_HANDLE_VALUE; | |
- WIN32_FIND_DATAW FindFileData; | |
- WCHAR szCabPath[MAX_PATH]; | |
- WCHAR szSearchPath[MAX_PATH]; | |
- WCHAR szPath[MAX_PATH]; | |
- WCHAR szTmp[MAX_PATH]; | |
- HRESULT hr; | |
- BOOL result = TRUE; | |
+ ATL::CStringW szNameVersion = szName + L" " + szVersion; | |
+ m_HasInstalledVersion = ::GetInstalledVersion(&szInstalledVersion, szRegName) | |
+ || ::GetInstalledVersion(&szInstalledVersion, szName) | |
+ || ::GetInstalledVersion(&szInstalledVersion, szNameVersion); | |
+} | |
- if (!GetStorageDirectory(szPath, _countof(szPath))) | |
- return FALSE; | |
+VOID CAvailableApplicationInfo::RetrieveLanguages() | |
+{ | |
+ const WCHAR cDelimiter = L'|'; | |
+ ATL::CStringW szBuffer; | |
- hr = StringCbPrintfW(szCabPath, sizeof(szCabPath), | |
- L"%ls\\rappmgr.cab", | |
- szPath); | |
- if (FAILED(hr)) | |
- return FALSE; | |
+ // TODO: Get multiline parameter | |
+ if (!m_Parser.GetString(L"Languages", szBuffer)) | |
+ { | |
+ m_HasLanguageInfo = FALSE; | |
+ return; | |
+ } | |
- result = result && DeleteFileW(szCabPath); | |
+ // Parse parameter string | |
+ ATL::CStringW m_szLocale; | |
+ INT iLCID; | |
+ for (INT i = 0; szBuffer[i] != UNICODE_NULL; ++i) | |
+ { | |
+ if (szBuffer[i] != cDelimiter && szBuffer[i] != L'\n') | |
+ { | |
+ m_szLocale += szBuffer[i]; | |
+ } | |
+ else | |
+ { | |
+ if (StrToIntExW(m_szLocale.GetString(), STIF_DEFAULT, &iLCID)) | |
+ { | |
+ Languages.Add(static_cast<LCID>(iLCID)); | |
+ m_szLocale.Empty(); | |
+ } | |
+ } | |
+ } | |
- hr = StringCbCatW(szPath, sizeof(szPath), L"\\rapps\\"); | |
+ // For the text after delimiter | |
+ if (!m_szLocale.IsEmpty()) | |
+ { | |
+ if (StrToIntExW(m_szLocale.GetString(), STIF_DEFAULT, &iLCID)) | |
+ { | |
+ Languages.Add(static_cast<LCID>(iLCID)); | |
+ } | |
+ } | |
- if (FAILED(hr)) | |
- return FALSE; | |
+ m_HasLanguageInfo = TRUE; | |
+} | |
- hr = StringCbPrintfW(szSearchPath, sizeof(szSearchPath), | |
- L"%ls*.txt", | |
- szPath); | |
- if (FAILED(hr)) | |
- return FALSE; | |
+VOID CAvailableApplicationInfo::RetrieveLicenseType() | |
+{ | |
+ INT IntBuffer = m_Parser.GetInt(L"LicenseType"); | |
- hFind = FindFirstFileW(szSearchPath, &FindFileData); | |
+ if (IntBuffer < 0 || IntBuffer > LICENSE_TYPE::Max) | |
+ { | |
+ LicenseType = LICENSE_TYPE::None; | |
+ } | |
+ else | |
+ { | |
+ LicenseType = (LICENSE_TYPE) IntBuffer; | |
+ } | |
+} | |
- if (hFind == INVALID_HANDLE_VALUE) | |
- return result; | |
+BOOL CAvailableApplicationInfo::FindInLanguages(LCID what) const | |
+{ | |
+ if (!m_HasLanguageInfo) | |
+ { | |
+ return FALSE; | |
+ } | |
- do | |
+ //Find locale code in the list | |
+ const INT nLanguagesSize = Languages.GetSize(); | |
+ for (INT i = 0; i < nLanguagesSize; ++i) | |
{ | |
- hr = StringCbPrintfW(szTmp, sizeof(szTmp), | |
- L"%ls%ls", | |
- szPath, FindFileData.cFileName); | |
- if (FAILED(hr)) | |
- continue; | |
- result = result && DeleteFileW(szTmp); | |
+ if (Languages[i] == what) | |
+ { | |
+ return TRUE; | |
+ } | |
+ } | |
- } while (FindNextFileW(hFind, &FindFileData) != 0); | |
+ return FALSE; | |
+} | |
- FindClose(hFind); | |
+BOOL CAvailableApplicationInfo::HasLanguageInfo() const | |
+{ | |
+ return m_HasLanguageInfo; | |
+} | |
- return result; | |
+BOOL CAvailableApplicationInfo::HasNativeLanguage() const | |
+{ | |
+ return FindInLanguages(GetUserDefaultLCID()); | |
} | |
+BOOL CAvailableApplicationInfo::HasEnglishLanguage() const | |
+{ | |
+ return FindInLanguages(MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), SORT_DEFAULT)); | |
+} | |
-BOOL | |
-UpdateAppsDB(VOID) | |
+BOOL CAvailableApplicationInfo::IsInstalled() const | |
{ | |
- WCHAR szPath[MAX_PATH]; | |
- WCHAR szAppsPath[MAX_PATH]; | |
- WCHAR szCabPath[MAX_PATH]; | |
+ return m_IsInstalled; | |
+} | |
- if (!DeleteCurrentAppsDB()) | |
- return FALSE; | |
+BOOL CAvailableApplicationInfo::HasInstalledVersion() const | |
+{ | |
+ return m_HasInstalledVersion; | |
+} | |
- DownloadApplicationsDB(APPLICATION_DATABASE_URL); | |
+BOOL CAvailableApplicationInfo::HasUpdate() const | |
+{ | |
+ return (szInstalledVersion.Compare(szVersion) < 0) ? TRUE : FALSE; | |
+} | |
- if (!GetStorageDirectory(szPath, _countof(szPath))) | |
- return FALSE; | |
+VOID CAvailableApplicationInfo::SetLastWriteTime(FILETIME* ftTime) | |
+{ | |
+ RtlCopyMemory(&ftCacheStamp, ftTime, sizeof(FILETIME)); | |
+} | |
- if (FAILED(StringCbPrintfW(szCabPath, sizeof(szCabPath), | |
- L"%ls\\rappmgr.cab", | |
- szPath))) | |
+inline BOOL CAvailableApplicationInfo::GetString(LPCWSTR lpKeyName, ATL::CStringW& ReturnedString) | |
+{ | |
+ if (!m_Parser.GetString(lpKeyName, ReturnedString)) | |
{ | |
+ ReturnedString.Empty(); | |
return FALSE; | |
} | |
+ return TRUE; | |
+} | |
+// CAvailableApplicationInfo | |
- if (FAILED(StringCbPrintfW(szAppsPath, sizeof(szAppsPath), | |
- L"%ls\\rapps\\", | |
- szPath))) | |
+// CAvailableApps | |
+ATL::CStringW CAvailableApps::m_szPath; | |
+ATL::CStringW CAvailableApps::m_szCabPath; | |
+ATL::CStringW CAvailableApps::m_szAppsPath; | |
+ATL::CStringW CAvailableApps::m_szSearchPath; | |
+ | |
+BOOL CAvailableApps::InitializeStaticStrings() | |
+{ | |
+ | |
+ if (!m_szPath.IsEmpty()) | |
{ | |
- return FALSE; | |
+ // strings are filled | |
+ return TRUE; | |
} | |
- ExtractFilesFromCab(szCabPath, szAppsPath); | |
+ //FIXME: maybe provide a fallback? | |
+ if (GetStorageDirectory(m_szPath)) | |
+ { | |
+ m_szAppsPath = m_szPath + L"\\rapps\\"; | |
+ m_szCabPath = m_szPath + L"\\rappmgr.cab"; | |
+ m_szSearchPath = m_szAppsPath + L"*.txt"; | |
+ return TRUE; | |
+ } | |
- return TRUE; | |
+ return FALSE; | |
} | |
+CAvailableApps::CAvailableApps() | |
+{ | |
+ //set all paths | |
+ InitializeStaticStrings(); | |
+} | |
-BOOL | |
-EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc) | |
+VOID CAvailableApps::FreeCachedEntries() | |
{ | |
+ POSITION InfoListPosition = m_InfoList.GetHeadPosition(); | |
+ | |
+ /* loop and deallocate all the cached app infos in the list */ | |
+ while (InfoListPosition) | |
+ { | |
+ CAvailableApplicationInfo* Info = m_InfoList.GetNext(InfoListPosition); | |
+ delete Info; | |
+ } | |
+ | |
+ m_InfoList.RemoveAll(); | |
+} | |
+ | |
+VOID CAvailableApps::DeleteCurrentAppsDB() | |
+{ | |
HANDLE hFind = INVALID_HANDLE_VALUE; | |
WIN32_FIND_DATAW FindFileData; | |
- WCHAR szPath[MAX_PATH]; | |
- WCHAR szAppsPath[MAX_PATH]; | |
- WCHAR szCabPath[MAX_PATH]; | |
- PAPPLICATION_INFO Info; | |
- HRESULT hr; | |
- if (!GetStorageDirectory(szPath, _countof(szPath))) | |
- return FALSE; | |
+ if (!InitializeStaticStrings()) | |
+ { | |
+ return; | |
+ } | |
- hr = StringCbPrintfW(szCabPath, sizeof(szCabPath), | |
- L"%ls\\rappmgr.cab", | |
- szPath); | |
- if (FAILED(hr)) | |
- return FALSE; | |
+ hFind = FindFirstFileW(m_szSearchPath.GetString(), &FindFileData); | |
- hr = StringCbCatW(szPath, sizeof(szPath), L"\\rapps\\"); | |
+ if (hFind != INVALID_HANDLE_VALUE) | |
+ { | |
+ ATL::CStringW szTmp; | |
+ do | |
+ { | |
+ szTmp = m_szAppsPath + FindFileData.cFileName; | |
+ DeleteFileW(szTmp.GetString()); | |
+ } while (FindNextFileW(hFind, &FindFileData) != 0); | |
+ FindClose(hFind); | |
+ } | |
- if (FAILED(hr)) | |
- return FALSE; | |
+ RemoveDirectoryW(m_szAppsPath); | |
+ RemoveDirectoryW(m_szPath); | |
+} | |
- hr = StringCbCopyW(szAppsPath, sizeof(szAppsPath), szPath); | |
+BOOL CAvailableApps::UpdateAppsDB() | |
+{ | |
+ HANDLE hFind = INVALID_HANDLE_VALUE; | |
+ WIN32_FIND_DATAW FindFileData; | |
- if (FAILED(hr)) | |
+ if (!InitializeStaticStrings()) | |
+ { | |
return FALSE; | |
+ } | |
- if (!CreateDirectory(szPath, NULL) && | |
- GetLastError() != ERROR_ALREADY_EXISTS) | |
+ if (!CreateDirectoryW(m_szPath.GetString(), NULL) && GetLastError() != ERROR_ALREADY_EXISTS) | |
{ | |
return FALSE; | |
} | |
- hr = StringCbCatW(szPath, sizeof(szPath), L"*.txt"); | |
+ //if there are some files in the db folder - we're good | |
+ hFind = FindFirstFileW(m_szSearchPath.GetString(), &FindFileData); | |
+ if (hFind != INVALID_HANDLE_VALUE) | |
+ { | |
+ return TRUE; | |
+ } | |
- if (FAILED(hr)) | |
+ CDownloadManager::DownloadApplicationsDB(APPLICATION_DATABASE_URL); | |
+ | |
+ if (!ExtractFilesFromCab(m_szCabPath, m_szAppsPath)) | |
+ { | |
return FALSE; | |
+ } | |
- hFind = FindFirstFileW(szPath, &FindFileData); | |
+ DeleteFileW(m_szCabPath.GetString()); | |
+ return TRUE; | |
+} | |
+ | |
+BOOL CAvailableApps::ForceUpdateAppsDB() | |
+{ | |
+ DeleteCurrentAppsDB(); | |
+ return UpdateAppsDB(); | |
+} | |
+ | |
+BOOL CAvailableApps::EnumAvailableApplications(INT EnumType, AVAILENUMPROC lpEnumProc) | |
+{ | |
+ | |
+ HANDLE hFind = INVALID_HANDLE_VALUE; | |
+ WIN32_FIND_DATAW FindFileData; | |
+ | |
+ hFind = FindFirstFileW(m_szSearchPath.GetString(), &FindFileData); | |
+ | |
if (hFind == INVALID_HANDLE_VALUE) | |
{ | |
- if (GetFileAttributesW(szCabPath) == INVALID_FILE_ATTRIBUTES) | |
- DownloadApplicationsDB(APPLICATION_DATABASE_URL); | |
- | |
- ExtractFilesFromCab(szCabPath, szAppsPath); | |
- hFind = FindFirstFileW(szPath, &FindFileData); | |
- | |
- if (hFind == INVALID_HANDLE_VALUE) | |
- return FALSE; | |
+ //no db yet | |
+ return FALSE; | |
} | |
do | |
{ | |
- /* loop for all the cached entries */ | |
- for (pCachedEntry = CachedEntriesHead.Flink; pCachedEntry != &CachedEntriesHead; pCachedEntry = pCachedEntry->Flink) | |
+ // loop for all the cached entries | |
+ POSITION CurrentListPosition = m_InfoList.GetHeadPosition(); | |
+ CAvailableApplicationInfo* Info = NULL; | |
+ | |
+ while (CurrentListPosition != NULL) | |
{ | |
- Info = CONTAINING_RECORD(pCachedEntry, APPLICATION_INFO, List); | |
+ POSITION LastListPosition = CurrentListPosition; | |
+ Info = m_InfoList.GetNext(CurrentListPosition); | |
- /* do we already have this entry in cache? */ | |
- if(_wcsicmp(FindFileData.cFileName, Info->cFileName) == 0) | |
+ // do we already have this entry in cache? | |
+ if (Info->sFileName == FindFileData.cFileName) | |
{ | |
- /* is it current enough, or the file has been modified since our last time here? */ | |
+ // is it current enough, or the file has been modified since our last time here? | |
if (CompareFileTime(&FindFileData.ftLastWriteTime, &Info->ftCacheStamp) == 1) | |
{ | |
- /* recreate our cache, this is the slow path */ | |
- RemoveEntryList(&Info->List); | |
- HeapFree(GetProcessHeap(), 0, Info); | |
+ // recreate our cache, this is the slow path | |
+ m_InfoList.RemoveAt(LastListPosition); | |
+ | |
+ delete Info; | |
+ Info = NULL; | |
+ break; | |
} | |
else | |
{ | |
- /* speedy path, compare directly, we already have the data */ | |
+ // speedy path, compare directly, we already have the data | |
goto skip_if_cached; | |
} | |
- | |
- break; | |
} | |
} | |
- /* create a new entry */ | |
- Info = (PAPPLICATION_INFO)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(APPLICATION_INFO)); | |
+ // create a new entry | |
+ Info = new CAvailableApplicationInfo(FindFileData.cFileName); | |
- if(!Info) | |
- break; | |
+ // set a timestamp for the next time | |
+ Info->SetLastWriteTime(&FindFileData.ftLastWriteTime); | |
+ m_InfoList.AddTail(Info); | |
- Info->Category = ParserGetInt(L"Category", FindFileData.cFileName); | |
- | |
- /* copy the cache-related fields for the next time */ | |
- RtlCopyMemory(&Info->cFileName, &FindFileData.cFileName, MAX_PATH); | |
- RtlCopyMemory(&Info->ftCacheStamp, &FindFileData.ftLastWriteTime, sizeof(FILETIME)); | |
- | |
- /* add our cached entry to the cached list */ | |
- InsertTailList(&CachedEntriesHead, &Info->List); | |
- | |
skip_if_cached: | |
- | |
if (Info->Category == FALSE) | |
continue; | |
@@ -246,48 +377,79 @@ | |
if (EnumType != Info->Category && EnumType != ENUM_ALL_AVAILABLE) | |
continue; | |
- /* if our cache hit was only partial, we need to parse | |
- and lazily fill the rest of fields only when needed */ | |
+ Info->RefreshAppInfo(); | |
- if (Info->szUrlDownload[0] == 0) | |
+ if (lpEnumProc) | |
+ lpEnumProc(static_cast<CAvailableApplicationInfo*>(Info), m_szAppsPath.GetString()); | |
+ | |
+ } while (FindNextFileW(hFind, &FindFileData) != 0); | |
+ | |
+ FindClose(hFind); | |
+ return TRUE; | |
+} | |
+ | |
+CAvailableApplicationInfo* CAvailableApps::FindInfo(const ATL::CStringW& szAppName) | |
+{ | |
+ if (m_InfoList.IsEmpty()) | |
+ { | |
+ return NULL; | |
+ } | |
+ | |
+ // linear search | |
+ POSITION CurrentListPosition = m_InfoList.GetHeadPosition(); | |
+ CAvailableApplicationInfo* info; | |
+ while (CurrentListPosition != NULL) | |
+ { | |
+ info = m_InfoList.GetNext(CurrentListPosition); | |
+ if (info->szName == szAppName) | |
{ | |
- GET_STRING1(L"Name", Info->szName); | |
- GET_STRING1(L"URLDownload", Info->szUrlDownload); | |
+ return info; | |
+ } | |
+ } | |
+ return NULL; | |
+} | |
- GET_STRING2(L"RegName", Info->szRegName); | |
- GET_STRING2(L"Version", Info->szVersion); | |
- GET_STRING2(L"License", Info->szLicense); | |
- GET_STRING2(L"Description", Info->szDesc); | |
- GET_STRING2(L"Size", Info->szSize); | |
- GET_STRING2(L"URLSite", Info->szUrlSite); | |
- GET_STRING2(L"CDPath", Info->szCDPath); | |
- GET_STRING2(L"SHA1", Info->szSHA1); | |
+ATL::CSimpleArray<CAvailableApplicationInfo*> CAvailableApps::FindInfoList(const ATL::CSimpleArray<ATL::CStringW> &arrAppsNames) | |
+{ | |
+ ATL::CSimpleArray<CAvailableApplicationInfo*> result; | |
+ for (INT i = 0; i < arrAppsNames.GetSize(); ++i) | |
+ { | |
+ CAvailableApplicationInfo* Info = FindInfo(arrAppsNames[i]); | |
+ if (Info) | |
+ { | |
+ result.Add(Info); | |
} | |
+ } | |
+ return result; | |
+} | |
- if (!lpEnumProc(Info)) | |
- break; | |
+const ATL::CStringW& CAvailableApps::GetFolderPath() | |
+{ | |
+ return m_szPath; | |
+} | |
- } while (FindNextFileW(hFind, &FindFileData) != 0); | |
+const ATL::CStringW& CAvailableApps::GetAppPath() | |
+{ | |
+ return m_szAppsPath; | |
+} | |
- FindClose(hFind); | |
+const ATL::CStringW& CAvailableApps::GetCabPath() | |
+{ | |
+ return m_szCabPath; | |
+} | |
- return TRUE; | |
+const LPCWSTR CAvailableApps::GetFolderPathString() | |
+{ | |
+ return m_szPath.GetString(); | |
} | |
-VOID FreeCachedAvailableEntries(VOID) | |
+const LPCWSTR CAvailableApps::GetAppPathString() | |
{ | |
- PAPPLICATION_INFO Info; | |
- | |
- /* loop and deallocate all the cached app infos in the list */ | |
- for (pCachedEntry = CachedEntriesHead.Flink; pCachedEntry != &CachedEntriesHead;) | |
- { | |
- Info = CONTAINING_RECORD(pCachedEntry, APPLICATION_INFO, List); | |
- | |
- /* grab a reference to the next linked entry before getting rid of the current one */ | |
- pCachedEntry = pCachedEntry->Flink; | |
- | |
- /* flush them down the toilet :D */ | |
- RemoveEntryList(&Info->List); | |
- HeapFree(GetProcessHeap(), 0, Info); | |
- } | |
-} | |
\ No newline at end of file | |
+ return m_szPath.GetString(); | |
+} | |
+ | |
+const LPCWSTR CAvailableApps::GetCabPathString() | |
+{ | |
+ return m_szPath.GetString(); | |
+} | |
+// CAvailableApps | |
Index: base/applications/rapps/gui.cpp | |
=================================================================== | |
--- base/applications/rapps/gui.cpp (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/gui.cpp (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -1,9 +1,13 @@ | |
-/* PROJECT: ReactOS CE Applications Manager | |
+п»ї/* PROJECT: ReactOS CE Applications Manager | |
* LICENSE: GPL - See COPYING in the top level directory | |
- * AUTHORS: David Quintana <gigaherz@gmail.com> | |
+ * AUTHORS: David Quintana <gigaherz@gmail.com> | |
+ * Alexander Shaposhnikov <chaez.san@gmail.com> | |
*/ | |
+#include "defines.h" | |
#include "rapps.h" | |
+#include "rosui.h" | |
+#include "crichedit.h" | |
#include <shlobj_undoc.h> | |
#include <shlguid_undoc.h> | |
@@ -13,16 +17,192 @@ | |
#include <atlwin.h> | |
#include <wininet.h> | |
#include <shellutils.h> | |
- | |
#include <rosctrls.h> | |
-#include "rosui.h" | |
-#include "crichedit.h" | |
- | |
#define SEARCH_TIMER_ID 'SR' | |
+#define LISTVIEW_ICON_SIZE 24 | |
+#define TREEVIEW_ICON_SIZE 24 | |
HWND hListView = NULL; | |
+INT GetSystemColorDepth() | |
+{ | |
+ DEVMODEW pDevMode; | |
+ INT ColorDepth; | |
+ | |
+ pDevMode.dmSize = sizeof(pDevMode); | |
+ pDevMode.dmDriverExtra = 0; | |
+ | |
+ if (!EnumDisplaySettingsW(NULL, ENUM_CURRENT_SETTINGS, &pDevMode)) | |
+ { | |
+ /* TODO: Error message */ | |
+ return ILC_COLOR; | |
+ } | |
+ | |
+ switch (pDevMode.dmBitsPerPel) | |
+ { | |
+ case 32: ColorDepth = ILC_COLOR32; break; | |
+ case 24: ColorDepth = ILC_COLOR24; break; | |
+ case 16: ColorDepth = ILC_COLOR16; break; | |
+ case 8: ColorDepth = ILC_COLOR8; break; | |
+ case 4: ColorDepth = ILC_COLOR4; break; | |
+ default: ColorDepth = ILC_COLOR; break; | |
+ } | |
+ | |
+ return ColorDepth; | |
+} | |
+ | |
+class CAvailableAppView | |
+{ | |
+ static inline VOID InsertTextAfterLoaded_RichEdit(UINT uStringID, | |
+ const ATL::CStringW& szText, | |
+ DWORD StringFlags, | |
+ DWORD TextFlags) | |
+ { | |
+ ATL::CStringW szLoadedText; | |
+ if (!szText.IsEmpty() && szLoadedText.LoadStringW(uStringID)) | |
+ { | |
+ InsertRichEditText(szLoadedText, StringFlags); | |
+ InsertRichEditText(szText, TextFlags); | |
+ } | |
+ } | |
+ | |
+ static inline VOID InsertLoadedTextNewl_RichEdit(UINT uStringID, | |
+ DWORD StringFlags) | |
+ { | |
+ ATL::CStringW szLoadedText; | |
+ if (szLoadedText.LoadStringW(uStringID)) | |
+ { | |
+ InsertRichEditText(L"\n", 0); | |
+ InsertRichEditText(szLoadedText, StringFlags); | |
+ InsertRichEditText(L"\n", 0); | |
+ } | |
+ } | |
+ | |
+ static VOID InsertVersionInfo_RichEdit(CAvailableApplicationInfo* Info) | |
+ { | |
+ if (Info->IsInstalled()) | |
+ { | |
+ if (Info->HasInstalledVersion()) | |
+ { | |
+ if (Info->HasUpdate()) | |
+ InsertLoadedTextNewl_RichEdit(IDS_STATUS_UPDATE_AVAILABLE, CFE_ITALIC); | |
+ else | |
+ InsertLoadedTextNewl_RichEdit(IDS_STATUS_INSTALLED, CFE_ITALIC); | |
+ | |
+ InsertTextAfterLoaded_RichEdit(IDS_AINFO_VERSION, Info->szInstalledVersion, CFE_BOLD, 0); | |
+ } | |
+ else | |
+ { | |
+ InsertLoadedTextNewl_RichEdit(IDS_STATUS_INSTALLED, CFE_ITALIC); | |
+ } | |
+ } | |
+ else | |
+ { | |
+ InsertLoadedTextNewl_RichEdit(IDS_STATUS_NOTINSTALLED, CFE_ITALIC); | |
+ } | |
+ | |
+ InsertTextAfterLoaded_RichEdit(IDS_AINFO_AVAILABLEVERSION, Info->szVersion, CFE_BOLD, 0); | |
+ } | |
+ | |
+ static VOID InsertLicenseInfo_RichEdit(CAvailableApplicationInfo* Info) | |
+ { | |
+ ATL::CStringW szLicense; | |
+ switch (Info->LicenseType) | |
+ { | |
+ case LICENSE_TYPE::OpenSource: | |
+ szLicense.LoadStringW(IDS_LICENSE_OPENSOURCE); | |
+ break; | |
+ case LICENSE_TYPE::Freeware: | |
+ szLicense.LoadStringW(IDS_LICENSE_FREEWARE); | |
+ break; | |
+ case LICENSE_TYPE::Trial: | |
+ szLicense.LoadStringW(IDS_LICENSE_TRIAL); | |
+ break; | |
+ default: | |
+ InsertTextAfterLoaded_RichEdit(IDS_AINFO_LICENSE, Info->szLicense, CFE_BOLD, 0); | |
+ return; | |
+ } | |
+ | |
+ szLicense += L" (" + Info->szLicense + L")"; | |
+ InsertTextAfterLoaded_RichEdit(IDS_AINFO_LICENSE, szLicense, CFE_BOLD, 0); | |
+ } | |
+ | |
+ static VOID InsertLanguageInfo_RichEdit(CAvailableApplicationInfo* Info) | |
+ { | |
+ if (!Info->HasLanguageInfo()) | |
+ { | |
+ return; | |
+ } | |
+ | |
+ const INT nTranslations = Info->Languages.GetSize(); | |
+ ATL::CStringW szLangInfo; | |
+ ATL::CStringW szLoadedTextAvailability; | |
+ ATL::CStringW szLoadedAInfoText; | |
+ | |
+ szLoadedAInfoText.LoadStringW(IDS_AINFO_LANGUAGES); | |
+ | |
+ //TODO: replace those hardcoded strings | |
+ if (Info->HasNativeLanguage()) | |
+ { | |
+ szLoadedTextAvailability.LoadStringW(IDS_LANGUAGE_AVAILABLE_TRANSLATION); | |
+ if (nTranslations > 1) | |
+ { | |
+ ATL::CStringW buf; | |
+ buf.LoadStringW(IDS_LANGUAGE_MORE_PLACEHOLDER); | |
+ szLangInfo.Format(buf, nTranslations - 1); | |
+ } | |
+ else | |
+ { | |
+ szLangInfo.LoadStringW(IDS_LANGUAGE_SINGLE); | |
+ szLangInfo = L" (" + szLangInfo + L")"; | |
+ } | |
+ } | |
+ else if (Info->HasEnglishLanguage()) | |
+ { | |
+ szLoadedTextAvailability.LoadStringW(IDS_LANGUAGE_ENGLISH_TRANSLATION); | |
+ if (nTranslations > 1) | |
+ { | |
+ ATL::CStringW buf; | |
+ buf.LoadStringW(IDS_LANGUAGE_AVAILABLE_PLACEHOLDER); | |
+ szLangInfo.Format(buf, nTranslations - 1); | |
+ } | |
+ else | |
+ { | |
+ szLangInfo.LoadStringW(IDS_LANGUAGE_SINGLE); | |
+ szLangInfo = L" (" + szLangInfo + L")"; | |
+ } | |
+ } | |
+ else | |
+ { | |
+ szLoadedTextAvailability.LoadStringW(IDS_LANGUAGE_NO_TRANSLATION); | |
+ } | |
+ | |
+ InsertRichEditText(szLoadedAInfoText, CFE_BOLD); | |
+ InsertRichEditText(szLoadedTextAvailability, NULL); | |
+ InsertRichEditText(szLangInfo, CFE_ITALIC); | |
+ } | |
+ | |
+public: | |
+ static BOOL ShowAvailableAppInfo(INT Index) | |
+ { | |
+ CAvailableApplicationInfo* Info = (CAvailableApplicationInfo*) ListViewGetlParam(Index); | |
+ if (!Info) return FALSE; | |
+ | |
+ NewRichEditText(Info->szName, CFE_BOLD); | |
+ InsertVersionInfo_RichEdit(Info); | |
+ InsertLicenseInfo_RichEdit(Info); | |
+ InsertLanguageInfo_RichEdit(Info); | |
+ | |
+ InsertTextAfterLoaded_RichEdit(IDS_AINFO_SIZE, Info->szSize, CFE_BOLD, 0); | |
+ InsertTextAfterLoaded_RichEdit(IDS_AINFO_URLSITE, Info->szUrlSite, CFE_BOLD, CFE_LINK); | |
+ InsertTextAfterLoaded_RichEdit(IDS_AINFO_DESCRIPTION, Info->szDesc, CFE_BOLD, 0); | |
+ InsertTextAfterLoaded_RichEdit(IDS_AINFO_URLDOWNLOAD, Info->szUrlDownload, CFE_BOLD, CFE_LINK); | |
+ | |
+ return TRUE; | |
+ } | |
+}; | |
+ | |
class CMainToolbar : | |
public CUiWindow< CToolbar<> > | |
{ | |
@@ -31,17 +211,18 @@ | |
WCHAR szInstallBtn[MAX_STR_LEN]; | |
WCHAR szUninstallBtn[MAX_STR_LEN]; | |
WCHAR szModifyBtn[MAX_STR_LEN]; | |
+ WCHAR szSelectAll[MAX_STR_LEN]; | |
VOID AddImageToImageList(HIMAGELIST hImageList, UINT ImageIndex) | |
{ | |
HICON hImage; | |
- if (!(hImage = (HICON) LoadImage(hInst, | |
- MAKEINTRESOURCE(ImageIndex), | |
- IMAGE_ICON, | |
- TOOLBAR_HEIGHT, | |
- TOOLBAR_HEIGHT, | |
- 0))) | |
+ if (!(hImage = (HICON) LoadImageW(hInst, | |
+ MAKEINTRESOURCE(ImageIndex), | |
+ IMAGE_ICON, | |
+ TOOLBAR_HEIGHT, | |
+ TOOLBAR_HEIGHT, | |
+ 0))) | |
{ | |
/* TODO: Error message */ | |
} | |
@@ -50,16 +231,15 @@ | |
DeleteObject(hImage); | |
} | |
- HIMAGELIST InitImageList(VOID) | |
+ HIMAGELIST InitImageList() | |
{ | |
HIMAGELIST hImageList; | |
/* Create the toolbar icon image list */ | |
hImageList = ImageList_Create(TOOLBAR_HEIGHT,//GetSystemMetrics(SM_CXSMICON), | |
- TOOLBAR_HEIGHT,//GetSystemMetrics(SM_CYSMICON), | |
- ILC_MASK | GetSystemColorDepth(), | |
- 1, | |
- 1); | |
+ TOOLBAR_HEIGHT,//GetSystemMetrics(SM_CYSMICON), | |
+ ILC_MASK | GetSystemColorDepth(), | |
+ 1, 1); | |
if (!hImageList) | |
{ | |
/* TODO: Error message */ | |
@@ -69,6 +249,7 @@ | |
AddImageToImageList(hImageList, IDI_INSTALL); | |
AddImageToImageList(hImageList, IDI_UNINSTALL); | |
AddImageToImageList(hImageList, IDI_MODIFY); | |
+ AddImageToImageList(hImageList, IDI_CHECK_ALL); | |
AddImageToImageList(hImageList, IDI_REFRESH); | |
AddImageToImageList(hImageList, IDI_UPDATE_DB); | |
AddImageToImageList(hImageList, IDI_SETTINGS); | |
@@ -85,31 +266,31 @@ | |
switch (idButton) | |
{ | |
case ID_EXIT: | |
- lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_EXIT); | |
+ lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_EXIT); | |
break; | |
case ID_INSTALL: | |
- lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_INSTALL); | |
+ lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_INSTALL); | |
break; | |
case ID_UNINSTALL: | |
- lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_UNINSTALL); | |
+ lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UNINSTALL); | |
break; | |
case ID_MODIFY: | |
- lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_MODIFY); | |
+ lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_MODIFY); | |
break; | |
case ID_SETTINGS: | |
- lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_SETTINGS); | |
+ lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_SETTINGS); | |
break; | |
case ID_REFRESH: | |
- lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_REFRESH); | |
+ lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_REFRESH); | |
break; | |
- | |
+ | |
case ID_RESETDB: | |
- lpttt->lpszText = MAKEINTRESOURCE(IDS_TOOLTIP_UPDATE_DB); | |
+ lpttt->lpszText = MAKEINTRESOURCEW(IDS_TOOLTIP_UPDATE_DB); | |
break; | |
} | |
} | |
@@ -116,35 +297,33 @@ | |
HWND Create(HWND hwndParent) | |
{ | |
- static TBBUTTON Buttons [] = | |
+ HIMAGELIST hImageList; | |
+ | |
+ // buttons | |
+ static TBBUTTON Buttons[] = | |
{ /* iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString */ | |
{ 0, ID_INSTALL, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, { 0 }, 0, (INT_PTR) szInstallBtn }, | |
{ 1, ID_UNINSTALL, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, { 0 }, 0, (INT_PTR) szUninstallBtn }, | |
{ 2, ID_MODIFY, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, { 0 }, 0, (INT_PTR) szModifyBtn }, | |
- { 5, 0, TBSTATE_ENABLED, BTNS_SEP, { 0 }, 0, 0 }, | |
- { 3, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, { 0 }, 0, 0 }, | |
- { 4, ID_RESETDB, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, {0}, 0, 0}, | |
- { 5, 0, TBSTATE_ENABLED, BTNS_SEP, { 0 }, 0, 0 }, | |
- { 5, ID_SETTINGS, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, { 0 }, 0, 0 }, | |
- { 6, ID_EXIT, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, { 0 }, 0, 0 } | |
+ { 3, ID_CHECK_ALL, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE,{0}, 0, (INT_PTR) szSelectAll}, | |
+ {-1, 0, TBSTATE_ENABLED, BTNS_SEP, { 0 }, 0, 0 }, | |
+ { 4, ID_REFRESH, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, { 0 }, 0, 0 }, | |
+ { 5, ID_RESETDB, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, { 0 }, 0, 0 }, | |
+ {-1, 0, TBSTATE_ENABLED, BTNS_SEP, { 0 }, 0, 0 }, | |
+ { 6, ID_SETTINGS, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, { 0 }, 0, 0 }, | |
+ { 7, ID_EXIT, TBSTATE_ENABLED, BTNS_BUTTON | BTNS_AUTOSIZE, { 0 }, 0, 0 }, | |
}; | |
- INT NumButtons = _countof(Buttons); | |
- HIMAGELIST hImageList; | |
- | |
LoadStringW(hInst, IDS_INSTALL, szInstallBtn, _countof(szInstallBtn)); | |
LoadStringW(hInst, IDS_UNINSTALL, szUninstallBtn, _countof(szUninstallBtn)); | |
LoadStringW(hInst, IDS_MODIFY, szModifyBtn, _countof(szModifyBtn)); | |
+ LoadStringW(hInst, IDS_SELECT_ALL, szSelectAll, _countof(szSelectAll)); | |
- m_hWnd = CreateWindowExW(0, | |
- TOOLBARCLASSNAMEW, | |
- NULL, | |
- WS_CHILD | WS_VISIBLE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS | TBSTYLE_LIST, | |
- 0, 0, 0, 0, | |
- hwndParent, | |
- 0, | |
- hInst, | |
- NULL); | |
+ m_hWnd = CreateWindowExW(0, TOOLBARCLASSNAMEW, NULL, | |
+ WS_CHILD | WS_VISIBLE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS | TBSTYLE_LIST, | |
+ 0, 0, 0, 0, | |
+ hwndParent, | |
+ 0, hInst, NULL); | |
if (!m_hWnd) | |
{ | |
@@ -165,7 +344,7 @@ | |
ImageList_Destroy((HIMAGELIST) SetImageList(hImageList)); | |
- AddButtons(NumButtons, Buttons); | |
+ AddButtons(_countof(Buttons), Buttons); | |
return m_hWnd; | |
} | |
@@ -177,20 +356,38 @@ | |
struct SortContext | |
{ | |
CAppsListView * lvw; | |
- int iSubItem; | |
+ INT iSubItem; | |
}; | |
-public: | |
+ BOOL bHasAllChecked; | |
BOOL bAscending; | |
+ BOOL bHasCheckboxes; | |
- CAppsListView() | |
+public: | |
+ CAppsListView() : | |
+ bAscending(TRUE), | |
+ bHasAllChecked(FALSE), | |
+ bHasCheckboxes(FALSE) | |
{ | |
- bAscending = TRUE; | |
} | |
+ VOID SetCheckboxesVisible(BOOL bIsVisible) | |
+ { | |
+ if (bIsVisible) | |
+ { | |
+ SetExtendedListViewStyle(LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT); | |
+ } | |
+ else | |
+ { | |
+ SetExtendedListViewStyle(LVS_EX_FULLROWSELECT); | |
+ } | |
+ | |
+ bHasCheckboxes = bIsVisible; | |
+ } | |
+ | |
VOID ColumnClick(LPNMLISTVIEW pnmv) | |
{ | |
- SortContext ctx = { this, pnmv->iSubItem }; | |
+ SortContext ctx = {this, pnmv->iSubItem}; | |
SortItems(s_CompareFunc, &ctx); | |
@@ -200,7 +397,7 @@ | |
PVOID GetLParam(INT Index) | |
{ | |
INT ItemIndex; | |
- LVITEM Item; | |
+ LVITEMW Item; | |
if (Index == -1) | |
{ | |
@@ -223,15 +420,20 @@ | |
return (PVOID) Item.lParam; | |
} | |
+ BOOL AddColumn(INT Index, ATL::CStringW& Text, INT Width, INT Format) | |
+ { | |
+ return AddColumn(Index, const_cast<LPWSTR>(Text.GetString()), Width, Format); | |
+ } | |
+ | |
BOOL AddColumn(INT Index, LPWSTR lpText, INT Width, INT Format) | |
{ | |
- LV_COLUMN Column; | |
+ LVCOLUMNW Column; | |
ZeroMemory(&Column, sizeof(Column)); | |
Column.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH | LVCF_SUBITEM; | |
Column.iSubItem = Index; | |
- Column.pszText = (LPTSTR) lpText; | |
+ Column.pszText = lpText; | |
Column.cx = Width; | |
Column.fmt = Format; | |
@@ -240,7 +442,7 @@ | |
INT AddItem(INT ItemIndex, INT IconIndex, LPWSTR lpText, LPARAM lParam) | |
{ | |
- LV_ITEMW Item; | |
+ LVITEMW Item; | |
ZeroMemory(&Item, sizeof(Item)); | |
@@ -258,11 +460,11 @@ | |
SortContext * ctx = ((SortContext*) lParamSort); | |
return ctx->lvw->CompareFunc(lParam1, lParam2, ctx->iSubItem); | |
} | |
- | |
+ | |
INT CompareFunc(LPARAM lParam1, LPARAM lParam2, INT iSubItem) | |
{ | |
- WCHAR Item1[MAX_STR_LEN], Item2[MAX_STR_LEN]; | |
- LVFINDINFO IndexInfo; | |
+ ATL::CStringW Item1, Item2; | |
+ LVFINDINFOW IndexInfo; | |
INT Index; | |
IndexInfo.flags = LVFI_PARAM; | |
@@ -269,16 +471,18 @@ | |
IndexInfo.lParam = lParam1; | |
Index = FindItem(-1, &IndexInfo); | |
- GetItemText(Index, iSubItem, Item1, _countof(Item1)); | |
+ GetItemText(Index, iSubItem, Item1.GetBuffer(MAX_STR_LEN), MAX_STR_LEN); | |
+ Item1.ReleaseBuffer(); | |
IndexInfo.lParam = lParam2; | |
Index = FindItem(-1, &IndexInfo); | |
- GetItemText(Index, iSubItem, Item2, _countof(Item2)); | |
+ GetItemText(Index, iSubItem, Item2.GetBuffer(MAX_STR_LEN), MAX_STR_LEN); | |
+ Item2.ReleaseBuffer(); | |
if (bAscending) | |
- return wcscmp(Item2, Item1); | |
+ return Item2 == Item1; | |
else | |
- return wcscmp(Item1, Item2); | |
+ return Item1 == Item2; | |
return 0; | |
} | |
@@ -285,20 +489,147 @@ | |
HWND Create(HWND hwndParent) | |
{ | |
- RECT r = { 205, 28, 465, 250 }; | |
+ RECT r = {205, 28, 465, 250}; | |
DWORD style = WS_CHILD | WS_VISIBLE | LVS_SORTASCENDING | LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS; | |
HMENU menu = GetSubMenu(LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_APPLICATIONMENU)), 0); | |
- | |
+ | |
HWND hwnd = CListView::Create(hwndParent, r, NULL, style, WS_EX_CLIENTEDGE, menu); | |
if (hwnd) | |
- SetExtendedListViewStyle(LVS_EX_FULLROWSELECT); | |
+ { | |
+ SetCheckboxesVisible(FALSE); | |
+ } | |
return hwnd; | |
} | |
+ BOOL GetCheckState(INT item) | |
+ { | |
+ return (BOOL) (GetItemState(item, LVIS_STATEIMAGEMASK) >> 12) - 1; | |
+ } | |
+ | |
+ VOID SetCheckState(INT item, BOOL fCheck) | |
+ { | |
+ if (bHasCheckboxes) | |
+ { | |
+ SetItemState(item, INDEXTOSTATEIMAGEMASK((fCheck) ? 2 : 1), LVIS_STATEIMAGEMASK); | |
+ } | |
+ } | |
+ | |
+ VOID CheckAll() | |
+ { | |
+ if (bHasCheckboxes) | |
+ { | |
+ bHasAllChecked = !bHasAllChecked; | |
+ SetCheckState(-1, bHasAllChecked); | |
+ } | |
+ } | |
+ | |
+ ATL::CSimpleArray<CAvailableApplicationInfo*> GetCheckedItems() | |
+ { | |
+ if (!bHasCheckboxes) | |
+ { | |
+ return ATL::CSimpleArray<CAvailableApplicationInfo*>(); | |
+ } | |
+ | |
+ ATL::CSimpleArray<CAvailableApplicationInfo*> list; | |
+ for (INT i = 0; i >= 0; i = GetNextItem(i, LVNI_ALL)) | |
+ { | |
+ if (GetCheckState(i) != FALSE) | |
+ { | |
+ CAvailableApplicationInfo* pAppInfo = (CAvailableApplicationInfo*) GetItemData(i); | |
+ list.Add(pAppInfo); | |
+ } | |
+ } | |
+ return list; | |
+ } | |
+ | |
+ CAvailableApplicationInfo* GetSelectedData() | |
+ { | |
+ INT item = GetSelectionMark(); | |
+ return (CAvailableApplicationInfo*) GetItemData(item); | |
+ } | |
}; | |
+class CSideTreeView : | |
+ public CUiWindow<CTreeView> | |
+{ | |
+ HIMAGELIST hImageTreeView = ImageList_Create(TREEVIEW_ICON_SIZE, TREEVIEW_ICON_SIZE, | |
+ GetSystemColorDepth() | ILC_MASK, | |
+ 0, 1); | |
+ | |
+public: | |
+ HTREEITEM AddItem(HTREEITEM hParent, ATL::CStringW &Text, INT Image, INT SelectedImage, LPARAM lParam) | |
+ { | |
+ return CUiWindow<CTreeView>::AddItem(hParent, const_cast<LPWSTR>(Text.GetString()), Image, SelectedImage, lParam); | |
+ } | |
+ | |
+ HTREEITEM AddCategory(HTREEITEM hRootItem, UINT TextIndex, UINT IconIndex) | |
+ { | |
+ ATL::CStringW szText; | |
+ INT Index; | |
+ HICON hIcon; | |
+ | |
+ hIcon = (HICON) LoadImageW(hInst, | |
+ MAKEINTRESOURCE(IconIndex), | |
+ IMAGE_ICON, | |
+ TREEVIEW_ICON_SIZE, | |
+ TREEVIEW_ICON_SIZE, | |
+ LR_CREATEDIBSECTION); | |
+ if (hIcon) | |
+ { | |
+ Index = ImageList_AddIcon(hImageTreeView, hIcon); | |
+ DestroyIcon(hIcon); | |
+ } | |
+ | |
+ szText.LoadStringW(TextIndex); | |
+ return AddItem(hRootItem, szText, Index, Index, TextIndex); | |
+ } | |
+ | |
+ HIMAGELIST SetImageList() | |
+ { | |
+ return CUiWindow<CTreeView>::SetImageList(hImageTreeView, TVSIL_NORMAL); | |
+ } | |
+ | |
+ VOID DestroyImageList() | |
+ { | |
+ if (hImageTreeView) | |
+ ImageList_Destroy(hImageTreeView); | |
+ } | |
+ | |
+ ~CSideTreeView() | |
+ { | |
+ DestroyImageList(); | |
+ CUiWindow<CTreeView>::~CUiWindow(); | |
+ } | |
+}; | |
+ | |
+class CSearchBar : | |
+ public CWindow | |
+{ | |
+public: | |
+ VOID SetText(LPCWSTR lpszText) | |
+ { | |
+ SendMessageW(SB_SETTEXT, SBT_NOBORDERS, (LPARAM) lpszText); | |
+ } | |
+ | |
+ HWND Create(HWND hwndParent) | |
+ { | |
+ ATL::CStringW szBuf; | |
+ m_hWnd = CreateWindowExW(WS_EX_CLIENTEDGE, L"Edit", NULL, | |
+ WS_CHILD | WS_VISIBLE | ES_LEFT | ES_AUTOHSCROLL, | |
+ 0, 0, 200, 22, | |
+ hwndParent, (HMENU) NULL, | |
+ hInst, 0); | |
+ | |
+ SendMessageW(WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
+ szBuf.LoadStringW(IDS_SEARCH_TEXT); | |
+ SetWindowTextW(szBuf); | |
+ return m_hWnd; | |
+ } | |
+ | |
+}; | |
+ | |
class CMainWindow : | |
public CWindowImpl<CMainWindow, CWindow, CFrameWinTraits> | |
{ | |
@@ -309,68 +640,52 @@ | |
CMainToolbar * m_Toolbar; | |
CAppsListView * m_ListView; | |
- CUiWindow<CTreeView> * m_TreeView; | |
+ CSideTreeView * m_TreeView; | |
CUiWindow<CStatusBar> * m_StatusBar; | |
CUiWindow<CRichEdit> * m_RichEdit; | |
- CUiWindow<> * m_SearchBar; | |
+ CUiWindow<CSearchBar> * m_SearchBar; | |
+ CAvailableApps m_AvailableApps; | |
- HIMAGELIST hImageTreeView; | |
+ LPWSTR pLink; | |
- PWSTR pLink; | |
+ INT nSelectedApps; | |
- BOOL SearchEnabled; | |
- | |
+ BOOL bSearchEnabled; | |
+ BOOL bUpdating; | |
public: | |
CMainWindow() : | |
m_ClientPanel(NULL), | |
- hImageTreeView(NULL), | |
pLink(NULL), | |
- SearchEnabled(TRUE) | |
+ bSearchEnabled(FALSE) | |
{ | |
} | |
private: | |
- | |
- VOID InitApplicationsList(VOID) | |
+ VOID InitApplicationsList() | |
{ | |
- WCHAR szText[MAX_STR_LEN]; | |
+ ATL::CStringW szText; | |
/* Add columns to ListView */ | |
- LoadStringW(hInst, IDS_APP_NAME, szText, _countof(szText)); | |
+ szText.LoadStringW(IDS_APP_NAME); | |
m_ListView->AddColumn(0, szText, 200, LVCFMT_LEFT); | |
- LoadStringW(hInst, IDS_APP_INST_VERSION, szText, _countof(szText)); | |
+ szText.LoadStringW(IDS_APP_INST_VERSION); | |
m_ListView->AddColumn(1, szText, 90, LVCFMT_RIGHT); | |
- LoadStringW(hInst, IDS_APP_DESCRIPTION, szText, _countof(szText)); | |
+ szText.LoadStringW(IDS_APP_DESCRIPTION); | |
m_ListView->AddColumn(3, szText, 250, LVCFMT_LEFT); | |
- UpdateApplicationsList(ENUM_ALL_COMPONENTS); | |
+ // Unnesesary since the list updates on every TreeView selection | |
+ // UpdateApplicationsList(ENUM_ALL_COMPONENTS); | |
} | |
HTREEITEM AddCategory(HTREEITEM hRootItem, UINT TextIndex, UINT IconIndex) | |
{ | |
- WCHAR szText[MAX_STR_LEN]; | |
- INT Index; | |
- HICON hIcon; | |
- | |
- hIcon = (HICON) LoadImage(hInst, | |
- MAKEINTRESOURCE(IconIndex), | |
- IMAGE_ICON, | |
- TREEVIEW_ICON_SIZE, | |
- TREEVIEW_ICON_SIZE, | |
- LR_CREATEDIBSECTION); | |
- | |
- Index = ImageList_AddIcon(hImageTreeView, hIcon); | |
- DestroyIcon(hIcon); | |
- | |
- LoadStringW(hInst, TextIndex, szText, _countof(szText)); | |
- | |
- return m_TreeView->AddItem(hRootItem, szText, Index, Index, TextIndex); | |
+ return m_TreeView->AddCategory(hRootItem, TextIndex, IconIndex); | |
} | |
- VOID InitCategoriesList(VOID) | |
+ VOID InitCategoriesList() | |
{ | |
HTREEITEM hRootItem1, hRootItem2; | |
@@ -395,9 +710,9 @@ | |
AddCategory(hRootItem2, IDS_CAT_LIBS, IDI_CAT_LIBS); | |
AddCategory(hRootItem2, IDS_CAT_OTHER, IDI_CAT_OTHER); | |
- m_TreeView->SetImageList(hImageTreeView, TVSIL_NORMAL); | |
+ m_TreeView->SetImageList(); | |
+ m_TreeView->Expand(hRootItem1, TVE_EXPAND); | |
m_TreeView->Expand(hRootItem2, TVE_EXPAND); | |
- m_TreeView->Expand(hRootItem1, TVE_EXPAND); | |
m_TreeView->SelectItem(hRootItem1); | |
} | |
@@ -408,7 +723,7 @@ | |
m_StatusBar->m_HorizontalAlignment = UiAlign_Stretch; | |
m_ClientPanel->Children().Append(m_StatusBar); | |
- return m_StatusBar->Create(m_hWnd, (HMENU)IDC_STATUSBAR) != NULL; | |
+ return m_StatusBar->Create(m_hWnd, (HMENU) IDC_STATUSBAR) != NULL; | |
} | |
BOOL CreateToolbar() | |
@@ -417,17 +732,17 @@ | |
m_Toolbar->m_VerticalAlignment = UiAlign_LeftTop; | |
m_Toolbar->m_HorizontalAlignment = UiAlign_Stretch; | |
m_ClientPanel->Children().Append(m_Toolbar); | |
- | |
+ | |
return m_Toolbar->Create(m_hWnd) != NULL; | |
} | |
BOOL CreateTreeView() | |
{ | |
- m_TreeView = new CUiWindow<CTreeView>(); | |
+ m_TreeView = new CSideTreeView(); | |
m_TreeView->m_VerticalAlignment = UiAlign_Stretch; | |
m_TreeView->m_HorizontalAlignment = UiAlign_Stretch; | |
m_VSplitter->First().Append(m_TreeView); | |
- | |
+ | |
return m_TreeView->Create(m_hWnd) != NULL; | |
} | |
@@ -475,50 +790,27 @@ | |
m_HSplitter->m_Horizontal = TRUE; | |
m_HSplitter->m_Pos = 32768; | |
m_HSplitter->m_MinFirst = 300; | |
- m_HSplitter->m_MinSecond = 80; | |
+ m_HSplitter->m_MinSecond = 150; | |
m_VSplitter->Second().Append(m_HSplitter); | |
return m_HSplitter->Create(m_hWnd) != NULL; | |
} | |
- BOOL CreateSearchBar(VOID) | |
+ BOOL CreateSearchBar() | |
{ | |
- WCHAR szBuf[MAX_STR_LEN]; | |
- | |
- // TODO: WRAPPER | |
- m_SearchBar = new CUiWindow<>(); | |
+ m_SearchBar = new CUiWindow<CSearchBar>(); | |
m_SearchBar->m_VerticalAlignment = UiAlign_LeftTop; | |
m_SearchBar->m_HorizontalAlignment = UiAlign_RightBtm; | |
m_SearchBar->m_Margin.top = 6; | |
m_SearchBar->m_Margin.right = 6; | |
- //m_ClientPanel->Children().Append(m_SearchBar); | |
- HWND hwnd = CreateWindowExW(WS_EX_CLIENTEDGE, | |
- L"Edit", | |
- NULL, | |
- WS_CHILD | WS_VISIBLE | ES_LEFT | ES_AUTOHSCROLL, | |
- 0, | |
- 0, | |
- 200, | |
- 22, | |
- m_Toolbar->m_hWnd, | |
- (HMENU) 0, | |
- hInst, | |
- 0); | |
- | |
- m_SearchBar->m_hWnd = hwnd; | |
- | |
- m_SearchBar->SendMessageW(WM_SETFONT, (WPARAM) GetStockObject(DEFAULT_GUI_FONT), 0); | |
- | |
- LoadStringW(hInst, IDS_SEARCH_TEXT, szBuf, _countof(szBuf)); | |
- m_SearchBar->SetWindowTextW(szBuf); | |
- | |
- return hwnd != NULL; | |
+ return m_SearchBar->Create(m_Toolbar->m_hWnd) != NULL; | |
} | |
BOOL CreateLayout() | |
{ | |
- bool b = TRUE; | |
+ BOOL b = TRUE; | |
+ bUpdating = TRUE; | |
m_ClientPanel = new CUiPanel(); | |
m_ClientPanel->m_VerticalAlignment = UiAlign_Stretch; | |
@@ -544,7 +836,7 @@ | |
RECT rBottom; | |
/* Size status bar */ | |
- m_StatusBar->SendMessage(WM_SIZE, 0, 0); | |
+ m_StatusBar->SendMessageW(WM_SIZE, 0, 0); | |
/* Size tool bar */ | |
m_Toolbar->AutoSize(); | |
@@ -553,32 +845,24 @@ | |
::GetWindowRect(m_StatusBar->m_hWnd, &rBottom); | |
m_VSplitter->m_Margin.top = rTop.bottom - rTop.top; | |
- m_VSplitter->m_Margin.bottom = rBottom.bottom-rBottom.top; | |
+ m_VSplitter->m_Margin.bottom = rBottom.bottom - rBottom.top; | |
} | |
+ bUpdating = FALSE; | |
return b; | |
} | |
BOOL InitControls() | |
{ | |
- /* Create image list */ | |
- hImageTreeView = ImageList_Create(TREEVIEW_ICON_SIZE, TREEVIEW_ICON_SIZE, | |
- GetSystemColorDepth() | ILC_MASK, | |
- 0, 1); | |
- | |
if (CreateLayout()) | |
{ | |
- WCHAR szBuffer1[MAX_STR_LEN], szBuffer2[MAX_STR_LEN]; | |
InitApplicationsList(); | |
- | |
InitCategoriesList(); | |
- LoadStringW(hInst, IDS_APPS_COUNT, szBuffer2, _countof(szBuffer2)); | |
- StringCbPrintfW(szBuffer1, sizeof(szBuffer1), | |
- szBuffer2, | |
- m_ListView->GetItemCount()); | |
- m_StatusBar->SetText(szBuffer1); | |
+ nSelectedApps = 0; | |
+ UpdateStatusBarText(); | |
+ | |
return TRUE; | |
} | |
@@ -593,21 +877,31 @@ | |
/* Size tool bar */ | |
m_Toolbar->AutoSize(); | |
- | |
- RECT r = { 0, 0, LOWORD(lParam), HIWORD(lParam) }; | |
- | |
+ RECT r = {0, 0, LOWORD(lParam), HIWORD(lParam)}; | |
HDWP hdwp = NULL; | |
+ INT count = m_ClientPanel->CountSizableChildren(); | |
- int count = m_ClientPanel->CountSizableChildren(); | |
hdwp = BeginDeferWindowPos(count); | |
- if (hdwp) hdwp = m_ClientPanel->OnParentSize(r, hdwp); | |
- if (hdwp) EndDeferWindowPos(hdwp); | |
+ if (hdwp) | |
+ { | |
+ hdwp = m_ClientPanel->OnParentSize(r, hdwp); | |
+ } | |
+ if (hdwp) | |
+ { | |
+ EndDeferWindowPos(hdwp); | |
+ } | |
// TODO: Sub-layouts for children of children | |
count = m_SearchBar->CountSizableChildren(); | |
hdwp = BeginDeferWindowPos(count); | |
- if (hdwp) hdwp = m_SearchBar->OnParentSize(r, hdwp); | |
- if (hdwp) EndDeferWindowPos(hdwp); | |
+ if (hdwp) | |
+ { | |
+ hdwp = m_SearchBar->OnParentSize(r, hdwp); | |
+ } | |
+ if (hdwp) | |
+ { | |
+ EndDeferWindowPos(hdwp); | |
+ } | |
} | |
BOOL ProcessWindowMessage(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT& theResult, DWORD dwMapId) | |
@@ -626,15 +920,11 @@ | |
SaveSettings(hwnd); | |
FreeLogs(); | |
+ m_AvailableApps.FreeCachedEntries(); | |
- FreeCachedAvailableEntries(); | |
- | |
if (IS_INSTALLED_ENUM(SelectedEnumType)) | |
FreeInstalledAppList(); | |
- if (hImageTreeView) | |
- ImageList_Destroy(hImageTreeView); | |
- | |
delete m_ClientPanel; | |
PostQuitMessage(0); | |
@@ -751,10 +1041,10 @@ | |
EnableMenuItem(lvwMenu, ID_UNINSTALL, MF_ENABLED); | |
EnableMenuItem(lvwMenu, ID_MODIFY, MF_ENABLED); | |
- m_Toolbar->SendMessage(TB_ENABLEBUTTON, ID_REGREMOVE, TRUE); | |
- m_Toolbar->SendMessage(TB_ENABLEBUTTON, ID_INSTALL, FALSE); | |
- m_Toolbar->SendMessage(TB_ENABLEBUTTON, ID_UNINSTALL, TRUE); | |
- m_Toolbar->SendMessage(TB_ENABLEBUTTON, ID_MODIFY, TRUE); | |
+ m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_REGREMOVE, TRUE); | |
+ m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_INSTALL, FALSE); | |
+ m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_UNINSTALL, TRUE); | |
+ m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_MODIFY, TRUE); | |
} | |
else | |
{ | |
@@ -768,10 +1058,10 @@ | |
EnableMenuItem(lvwMenu, ID_UNINSTALL, MF_GRAYED); | |
EnableMenuItem(lvwMenu, ID_MODIFY, MF_GRAYED); | |
- m_Toolbar->SendMessage(TB_ENABLEBUTTON, ID_REGREMOVE, FALSE); | |
- m_Toolbar->SendMessage(TB_ENABLEBUTTON, ID_INSTALL, TRUE); | |
- m_Toolbar->SendMessage(TB_ENABLEBUTTON, ID_UNINSTALL, FALSE); | |
- m_Toolbar->SendMessage(TB_ENABLEBUTTON, ID_MODIFY, FALSE); | |
+ m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_REGREMOVE, FALSE); | |
+ m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_INSTALL, TRUE); | |
+ m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_UNINSTALL, FALSE); | |
+ m_Toolbar->SendMessageW(TB_ENABLEBUTTON, ID_MODIFY, FALSE); | |
} | |
} | |
break; | |
@@ -798,9 +1088,26 @@ | |
{ | |
if (IS_INSTALLED_ENUM(SelectedEnumType)) | |
ShowInstalledAppInfo(ItemIndex); | |
- if (IS_AVAILABLE_ENUM(SelectedEnumType)) | |
- ShowAvailableAppInfo(ItemIndex); | |
+ if (IsAvailableEnum(SelectedEnumType)) | |
+ CAvailableAppView::ShowAvailableAppInfo(ItemIndex); | |
} | |
+ /* Check if the item is checked */ | |
+ if ((pnic->uNewState & LVIS_STATEIMAGEMASK) && !bUpdating) | |
+ { | |
+ BOOL checked = ListView_GetCheckState(pnic->hdr.hwndFrom, pnic->iItem); | |
+ /* FIXME: HAX! | |
+ - preventing decremention below zero as a safeguard for ReactOS | |
+ In ReactOS this action is triggered whenever user changes *selection*, but should be only when *checkbox* state toggled | |
+ Maybe LVIS_STATEIMAGEMASK is set incorrectly | |
+ */ | |
+ nSelectedApps += | |
+ (checked) | |
+ ? 1 | |
+ : ((nSelectedApps > 0) | |
+ ? -1 | |
+ : 0); | |
+ UpdateStatusBarText(); | |
+ } | |
} | |
} | |
break; | |
@@ -819,8 +1126,8 @@ | |
{ | |
if (IS_INSTALLED_ENUM(SelectedEnumType)) | |
ShowInstalledAppInfo(-1); | |
- if (IS_AVAILABLE_ENUM(SelectedEnumType)) | |
- ShowAvailableAppInfo(-1); | |
+ if (IsAvailableEnum(SelectedEnumType)) | |
+ CAvailableAppView::ShowAvailableAppInfo(-1); | |
} | |
} | |
break; | |
@@ -830,7 +1137,7 @@ | |
if (data->hwndFrom == m_ListView->m_hWnd && ((LPNMLISTVIEW) lParam)->iItem != -1) | |
{ | |
/* this won't do anything if the program is already installed */ | |
- SendMessage(hwnd, WM_COMMAND, ID_INSTALL, 0); | |
+ SendMessageW(hwnd, WM_COMMAND, ID_INSTALL, 0); | |
} | |
} | |
break; | |
@@ -875,10 +1182,10 @@ | |
case WM_SYSCOLORCHANGE: | |
{ | |
/* Forward WM_SYSCOLORCHANGE to common controls */ | |
- m_ListView->SendMessage(WM_SYSCOLORCHANGE, 0, 0); | |
- m_TreeView->SendMessage(WM_SYSCOLORCHANGE, 0, 0); | |
- m_Toolbar->SendMessage(WM_SYSCOLORCHANGE, 0, 0); | |
- m_ListView->SendMessage(EM_SETBKGNDCOLOR, 0, GetSysColor(COLOR_BTNFACE)); | |
+ m_ListView->SendMessageW(WM_SYSCOLORCHANGE, 0, 0); | |
+ m_TreeView->SendMessageW(WM_SYSCOLORCHANGE, 0, 0); | |
+ m_Toolbar->SendMessageW(WM_SYSCOLORCHANGE, 0, 0); | |
+ m_ListView->SendMessageW(EM_SETBKGNDCOLOR, 0, GetSysColor(COLOR_BTNFACE)); | |
} | |
break; | |
@@ -886,7 +1193,8 @@ | |
if (wParam == SEARCH_TIMER_ID) | |
{ | |
::KillTimer(hwnd, SEARCH_TIMER_ID); | |
- UpdateApplicationsList(-1); | |
+ if (bSearchEnabled) | |
+ UpdateApplicationsList(-1); | |
} | |
break; | |
} | |
@@ -903,9 +1211,9 @@ | |
{ | |
if (pLink) HeapFree(GetProcessHeap(), 0, pLink); | |
- pLink = (PWSTR) HeapAlloc(GetProcessHeap(), 0, | |
+ pLink = (LPWSTR) HeapAlloc(GetProcessHeap(), 0, | |
(max(Link->chrg.cpMin, Link->chrg.cpMax) - | |
- min(Link->chrg.cpMin, Link->chrg.cpMax) + 1) * sizeof(WCHAR)); | |
+ min(Link->chrg.cpMin, Link->chrg.cpMax) + 1) * sizeof(WCHAR)); | |
if (!pLink) | |
{ | |
/* TODO: Error message */ | |
@@ -921,7 +1229,7 @@ | |
} | |
} | |
- BOOL IsSelectedNodeInstalled(void) | |
+ BOOL IsSelectedNodeInstalled() | |
{ | |
HTREEITEM hSelectedItem = m_TreeView->GetSelection(); | |
TV_ITEM tItem; | |
@@ -946,19 +1254,19 @@ | |
if (lParam == (LPARAM) m_SearchBar->m_hWnd) | |
{ | |
- WCHAR szBuf[MAX_STR_LEN]; | |
+ ATL::CStringW szBuf; | |
switch (HIWORD(wParam)) | |
{ | |
case EN_SETFOCUS: | |
{ | |
- WCHAR szWndText[MAX_STR_LEN]; | |
+ ATL::CStringW szWndText; | |
- LoadStringW(hInst, IDS_SEARCH_TEXT, szBuf, _countof(szBuf)); | |
- m_SearchBar->GetWindowTextW(szWndText, MAX_STR_LEN); | |
- if (wcscmp(szBuf, szWndText) == 0) | |
+ szBuf.LoadStringW(IDS_SEARCH_TEXT); | |
+ m_SearchBar->GetWindowTextW(szWndText); | |
+ if (szBuf == szWndText) | |
{ | |
- SearchEnabled = FALSE; | |
+ bSearchEnabled = FALSE; | |
m_SearchBar->SetWindowTextW(L""); | |
} | |
} | |
@@ -966,12 +1274,12 @@ | |
case EN_KILLFOCUS: | |
{ | |
- m_SearchBar->GetWindowTextW(szBuf, MAX_STR_LEN); | |
- if (wcslen(szBuf) < 1) | |
+ m_SearchBar->GetWindowTextW(szBuf); | |
+ if (szBuf.IsEmpty()) | |
{ | |
- LoadStringW(hInst, IDS_SEARCH_TEXT, szBuf, _countof(szBuf)); | |
- SearchEnabled = FALSE; | |
- m_SearchBar->SetWindowTextW(szBuf); | |
+ szBuf.LoadStringW(IDS_SEARCH_TEXT); | |
+ bSearchEnabled = FALSE; | |
+ m_SearchBar->SetWindowTextW(szBuf.GetString()); | |
} | |
} | |
break; | |
@@ -978,28 +1286,27 @@ | |
case EN_CHANGE: | |
{ | |
- WCHAR szWndText[MAX_STR_LEN]; | |
+ ATL::CStringW szWndText; | |
- if (!SearchEnabled) | |
+ if (!bSearchEnabled) | |
{ | |
- SearchEnabled = TRUE; | |
+ bSearchEnabled = TRUE; | |
break; | |
} | |
- LoadStringW(hInst, IDS_SEARCH_TEXT, szBuf, _countof(szBuf)); | |
- m_SearchBar->GetWindowTextW(szWndText, MAX_STR_LEN); | |
- if (wcscmp(szBuf, szWndText) != 0) | |
+ szBuf.LoadStringW(IDS_SEARCH_TEXT); | |
+ m_SearchBar->GetWindowTextW(szWndText); | |
+ if (szBuf == szWndText) | |
{ | |
- StringCbCopy(szSearchPattern, sizeof(szSearchPattern), | |
- szWndText); | |
+ szSearchPattern.Empty(); | |
} | |
else | |
{ | |
- szSearchPattern[0] = UNICODE_NULL; | |
+ szSearchPattern = szWndText; | |
} | |
DWORD dwDelay; | |
- SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &dwDelay, 0); | |
+ SystemParametersInfoW(SPI_GETMENUSHOWDELAY, 0, &dwDelay, 0); | |
SetTimer(SEARCH_TIMER_ID, dwDelay); | |
} | |
break; | |
@@ -1029,11 +1336,19 @@ | |
break; | |
case ID_INSTALL: | |
- if (DownloadApplication(-1)) | |
- /* TODO: Implement install dialog | |
- * if (InstallApplication(-1)) | |
- */ | |
- UpdateApplicationsList(-1); | |
+ if (IsAvailableEnum(SelectedEnumType)) | |
+ { | |
+ if (nSelectedApps > 0) | |
+ { | |
+ CDownloadManager::DownloadListOfApplications(m_ListView->GetCheckedItems()); | |
+ UpdateApplicationsList(-1); | |
+ } | |
+ else if (CDownloadManager::DownloadApplication(m_ListView->GetSelectedData())) | |
+ { | |
+ UpdateApplicationsList(-1); | |
+ } | |
+ | |
+ } | |
break; | |
case ID_UNINSTALL: | |
@@ -1055,7 +1370,7 @@ | |
break; | |
case ID_RESETDB: | |
- UpdateAppsDB(); | |
+ CAvailableApps::ForceUpdateAppsDB(); | |
UpdateApplicationsList(-1); | |
break; | |
@@ -1066,12 +1381,16 @@ | |
case ID_ABOUT: | |
ShowAboutDialog(); | |
break; | |
+ | |
+ case ID_CHECK_ALL: | |
+ m_ListView->CheckAll(); | |
+ break; | |
} | |
} | |
- VOID FreeInstalledAppList(VOID) | |
+ VOID FreeInstalledAppList() | |
{ | |
- INT Count = ListView_GetItemCount(hListView) - 1; | |
+ INT Count = m_ListView->GetItemCount() - 1; | |
PINSTALLED_INFO Info; | |
while (Count >= 0) | |
@@ -1080,7 +1399,7 @@ | |
if (Info) | |
{ | |
RegCloseKey(Info->hSubKey); | |
- HeapFree(GetProcessHeap(), 0, Info); | |
+ delete Info; | |
} | |
Count--; | |
} | |
@@ -1094,19 +1413,19 @@ | |
return StrStrIW(szHaystack, szNeedle) != NULL; | |
} | |
- static BOOL CALLBACK s_EnumInstalledAppProc(INT ItemIndex, LPWSTR lpName, PINSTALLED_INFO Info) | |
+ static BOOL CALLBACK s_EnumInstalledAppProc(INT ItemIndex, ATL::CStringW &szName, PINSTALLED_INFO Info) | |
{ | |
PINSTALLED_INFO ItemInfo; | |
- WCHAR szText[MAX_PATH]; | |
+ ATL::CStringW szText; | |
INT Index; | |
- if (!SearchPatternMatch(lpName, szSearchPattern)) | |
+ if (!SearchPatternMatch(szName.GetString(), szSearchPattern)) | |
{ | |
RegCloseKey(Info->hSubKey); | |
return TRUE; | |
} | |
- ItemInfo = (PINSTALLED_INFO) HeapAlloc(GetProcessHeap(), 0, sizeof(INSTALLED_INFO)); | |
+ ItemInfo = new INSTALLED_INFO(*Info); | |
if (!ItemInfo) | |
{ | |
RegCloseKey(Info->hSubKey); | |
@@ -1113,25 +1432,26 @@ | |
return FALSE; | |
} | |
- RtlCopyMemory(ItemInfo, Info, sizeof(INSTALLED_INFO)); | |
+ Index = ListViewAddItem(ItemIndex, 0, szName, (LPARAM) ItemInfo); | |
- Index = ListViewAddItem(ItemIndex, 0, lpName, (LPARAM) ItemInfo); | |
- | |
/* Get version info */ | |
GetApplicationString(ItemInfo->hSubKey, L"DisplayVersion", szText); | |
- ListView_SetItemText(hListView, Index, 1, szText); | |
+ ListView_SetItemText(hListView, Index, 1, const_cast<LPWSTR>(szText.GetString())); | |
/* Get comments */ | |
GetApplicationString(ItemInfo->hSubKey, L"Comments", szText); | |
- ListView_SetItemText(hListView, Index, 2, szText); | |
+ ListView_SetItemText(hListView, Index, 2, const_cast<LPWSTR>(szText.GetString())); | |
return TRUE; | |
} | |
- static BOOL CALLBACK s_EnumAvailableAppProc(PAPPLICATION_INFO Info) | |
+ static BOOL CALLBACK s_EnumAvailableAppProc(CAvailableApplicationInfo* Info, LPCWSTR szFolderPath) | |
{ | |
INT Index; | |
+ HICON hIcon = NULL; | |
+ HIMAGELIST hImageListView = ListView_GetImageList(hListView, LVSIL_SMALL); | |
+ | |
if (!SearchPatternMatch(Info->szName, szSearchPattern) && | |
!SearchPatternMatch(Info->szDesc, szSearchPattern)) | |
{ | |
@@ -1138,100 +1458,141 @@ | |
return TRUE; | |
} | |
- /* Only add a ListView entry if... | |
- - no RegName was supplied (so we cannot determine whether the application is installed or not) or | |
- - a RegName was supplied and the application is not installed | |
- */ | |
- if (!*Info->szRegName || (!IsInstalledApplication(Info->szRegName, FALSE) && !IsInstalledApplication(Info->szRegName, TRUE))) | |
+ /* Load icon from file */ | |
+ ATL::CStringW szIconPath; | |
+ szIconPath.Format(L"%lsicons\\%ls.ico", szFolderPath, Info->szName); | |
+ hIcon = (HICON) LoadImageW(NULL, | |
+ szIconPath.GetString(), | |
+ IMAGE_ICON, | |
+ LISTVIEW_ICON_SIZE, | |
+ LISTVIEW_ICON_SIZE, | |
+ LR_LOADFROMFILE); | |
+ | |
+ if (!hIcon || GetLastError() != ERROR_SUCCESS) | |
{ | |
- Index = ListViewAddItem(Info->Category, 0, Info->szName, (LPARAM) Info); | |
- | |
- ListView_SetItemText(hListView, Index, 1, Info->szVersion); | |
- ListView_SetItemText(hListView, Index, 2, Info->szDesc); | |
+ /* Load default icon */ | |
+ hIcon = (HICON) LoadIconW(hInst, MAKEINTRESOURCEW(IDI_MAIN)); | |
} | |
+ Index = ImageList_AddIcon(hImageListView, hIcon); | |
+ DestroyIcon(hIcon); | |
+ | |
+ Index = ListViewAddItem(Info->Category, Index, Info->szName, (LPARAM) Info); | |
+ ListView_SetImageList(hListView, hImageListView, LVSIL_SMALL); | |
+ | |
+ ListView_SetItemText(hListView, Index, 1, const_cast<LPWSTR>(Info->szVersion.GetString())); | |
+ ListView_SetItemText(hListView, Index, 2, const_cast<LPWSTR>(Info->szDesc.GetString())); | |
+ | |
return TRUE; | |
} | |
+ VOID UpdateStatusBarText() | |
+ { | |
+ if (m_StatusBar) | |
+ { | |
+ ATL::CStringW szBuffer; | |
+ | |
+ szBuffer.Format(IDS_APPS_COUNT, m_ListView->GetItemCount(), nSelectedApps); | |
+ m_StatusBar->SetText(szBuffer); | |
+ } | |
+ } | |
+ | |
VOID UpdateApplicationsList(INT EnumType) | |
{ | |
- WCHAR szBuffer1[MAX_STR_LEN], szBuffer2[MAX_STR_LEN]; | |
- HICON hIcon; | |
+ ATL::CStringW szBuffer1, szBuffer2; | |
HIMAGELIST hImageListView; | |
+ BOOL bWasInInstalled = IS_INSTALLED_ENUM(SelectedEnumType); | |
- m_ListView->SendMessage(WM_SETREDRAW, FALSE, 0); | |
+ bUpdating = TRUE; | |
+ m_ListView->SetRedraw(FALSE); | |
- if (EnumType == -1) EnumType = SelectedEnumType; | |
- | |
- if (IS_INSTALLED_ENUM(SelectedEnumType)) | |
+ nSelectedApps = 0; | |
+ if (EnumType < 0) | |
+ { | |
+ EnumType = SelectedEnumType; | |
+ } | |
+ | |
+ //if previous one was INSTALLED purge the list | |
+ //TODO: make the Installed category a separate class to avoid doing this | |
+ if (bWasInInstalled) | |
+ { | |
FreeInstalledAppList(); | |
+ } | |
- (VOID) ListView_DeleteAllItems(hListView); | |
+ m_ListView->DeleteAllItems(); | |
- /* Create image list */ | |
+ // Create new ImageList | |
hImageListView = ImageList_Create(LISTVIEW_ICON_SIZE, | |
- LISTVIEW_ICON_SIZE, | |
- GetSystemColorDepth() | ILC_MASK, | |
- 0, 1); | |
+ LISTVIEW_ICON_SIZE, | |
+ GetSystemColorDepth() | ILC_MASK, | |
+ 0, 1); | |
+ HIMAGELIST hImageListBuf = m_ListView->SetImageList(hImageListView, LVSIL_SMALL); | |
+ if (hImageListBuf) | |
+ { | |
+ ImageList_Destroy(hImageListBuf); | |
+ } | |
- hIcon = (HICON) LoadImage(hInst, | |
- MAKEINTRESOURCE(IDI_MAIN), | |
- IMAGE_ICON, | |
- LISTVIEW_ICON_SIZE, | |
- LISTVIEW_ICON_SIZE, | |
- LR_CREATEDIBSECTION); | |
+ //if previous one was INSTALLED purge the list | |
+ if (IS_INSTALLED_ENUM(EnumType)) | |
+ { | |
+ if (!bWasInInstalled) | |
+ { | |
+ m_ListView->SetCheckboxesVisible(FALSE); | |
+ } | |
- ImageList_AddIcon(hImageListView, hIcon); | |
- DestroyIcon(hIcon); | |
+ HICON hIcon = (HICON) LoadIconW(hInst, MAKEINTRESOURCEW(IDI_MAIN)); | |
+ ImageList_AddIcon(hImageListView, hIcon); | |
+ DestroyIcon(hIcon); | |
- if (IS_INSTALLED_ENUM(EnumType)) | |
- { | |
- /* Enum installed applications and updates */ | |
+ // Enum installed applications and updates | |
EnumInstalledApplications(EnumType, TRUE, s_EnumInstalledAppProc); | |
EnumInstalledApplications(EnumType, FALSE, s_EnumInstalledAppProc); | |
} | |
- else if (IS_AVAILABLE_ENUM(EnumType)) | |
+ else if (IsAvailableEnum(EnumType)) | |
{ | |
- /* Enum available applications */ | |
- EnumAvailableApplications(EnumType, s_EnumAvailableAppProc); | |
+ if (bWasInInstalled) | |
+ { | |
+ m_ListView->SetCheckboxesVisible(TRUE); | |
+ } | |
+ | |
+ // Enum available applications | |
+ m_AvailableApps.EnumAvailableApplications(EnumType, s_EnumAvailableAppProc); | |
} | |
- /* Set image list for ListView */ | |
- hImageListView = ListView_SetImageList(hListView, hImageListView, LVSIL_SMALL); | |
- | |
- /* Destroy old image list */ | |
- if (hImageListView) | |
- ImageList_Destroy(hImageListView); | |
- | |
SelectedEnumType = EnumType; | |
- | |
- LoadStringW(hInst, IDS_APPS_COUNT, szBuffer2, _countof(szBuffer2)); | |
- StringCbPrintfW(szBuffer1, sizeof(szBuffer1), | |
- szBuffer2, | |
- ListView_GetItemCount(hListView)); | |
- SetStatusBarText(szBuffer1); | |
- | |
+ UpdateStatusBarText(); | |
SetWelcomeText(); | |
- /* set automatic column width for program names if the list is not empty */ | |
- if (ListView_GetItemCount(hListView) > 0) | |
- ListView_SetColumnWidth(hListView, 0, LVSCW_AUTOSIZE); | |
+ // Set automatic column width for program names if the list is not empty | |
+ if (m_ListView->GetItemCount() > 0) | |
+ { | |
+ ListView_SetColumnWidth(m_ListView->GetWindow(), 0, LVSCW_AUTOSIZE); | |
+ } | |
- SendMessage(hListView, WM_SETREDRAW, TRUE, 0); | |
+ bUpdating = FALSE; | |
+ m_ListView->SetRedraw(TRUE); | |
} | |
public: | |
static ATL::CWndClassInfo& GetWndClassInfo() | |
{ | |
- DWORD csStyle = CS_VREDRAW |CS_HREDRAW; | |
+ DWORD csStyle = CS_VREDRAW | CS_HREDRAW; | |
static ATL::CWndClassInfo wc = | |
{ | |
- { sizeof(WNDCLASSEX), csStyle, StartWindowProc, | |
- 0, 0, NULL, | |
- LoadIcon(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCE(IDI_MAIN)), | |
- LoadCursor(NULL, IDC_ARROW), | |
- (HBRUSH) (COLOR_BTNFACE + 1), MAKEINTRESOURCE(IDR_MAINMENU), | |
- L"RAppsWnd", NULL }, | |
+ { | |
+ sizeof(WNDCLASSEX), | |
+ csStyle, | |
+ StartWindowProc, | |
+ 0, | |
+ 0, | |
+ NULL, | |
+ LoadIconW(_AtlBaseModule.GetModuleInstance(), MAKEINTRESOURCEW(IDI_MAIN)), | |
+ LoadCursorW(NULL, IDC_ARROW), | |
+ (HBRUSH) (COLOR_BTNFACE + 1), | |
+ MAKEINTRESOURCEW(IDR_MAINMENU), | |
+ L"RAppsWnd", | |
+ NULL | |
+ }, | |
NULL, NULL, IDC_ARROW, TRUE, 0, _T("") | |
}; | |
return wc; | |
@@ -1239,10 +1600,9 @@ | |
HWND Create() | |
{ | |
- WCHAR szWindowName[MAX_STR_LEN]; | |
+ ATL::CStringW szWindowName; | |
+ szWindowName.LoadStringW(IDS_APPTITLE); | |
- LoadStringW(hInst, IDS_APPTITLE, szWindowName, _countof(szWindowName)); | |
- | |
RECT r = { | |
(SettingsInfo.bSaveWndPos ? SettingsInfo.Left : CW_USEDEFAULT), | |
(SettingsInfo.bSaveWndPos ? SettingsInfo.Top : CW_USEDEFAULT), | |
@@ -1252,7 +1612,7 @@ | |
r.right += r.left; | |
r.bottom += r.top; | |
- return CWindowImpl::Create(NULL, r, szWindowName, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, WS_EX_WINDOWEDGE); | |
+ return CWindowImpl::Create(NULL, r, szWindowName.GetString(), WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, WS_EX_WINDOWEDGE); | |
} | |
CStatusBar * GetStatusBar() | |
@@ -1269,8 +1629,15 @@ | |
{ | |
return m_RichEdit; | |
} | |
+ | |
+ CAvailableApps * GetAvailableApps() | |
+ { | |
+ return &m_AvailableApps; | |
+ } | |
}; | |
+// File interface | |
+ | |
CMainWindow * g_MainWindow; | |
HWND CreateMainWindow() | |
@@ -1288,22 +1655,48 @@ | |
return g_MainWindow->GetListView()->GetItemData(item); | |
} | |
-VOID SetStatusBarText(PCWSTR szText) | |
+VOID SetStatusBarText(LPCWSTR szText) | |
{ | |
g_MainWindow->GetStatusBar()->SetText(szText); | |
} | |
-INT ListViewAddItem(INT ItemIndex, INT IconIndex, PWSTR lpName, LPARAM lParam) | |
+INT ListViewAddItem(INT ItemIndex, INT IconIndex, LPWSTR lpName, LPARAM lParam) | |
{ | |
return g_MainWindow->GetListView()->AddItem(ItemIndex, IconIndex, lpName, lParam); | |
} | |
-VOID NewRichEditText(PCWSTR szText, DWORD flags) | |
+VOID NewRichEditText(LPCWSTR szText, DWORD flags) | |
{ | |
g_MainWindow->GetRichEdit()->SetText(szText, flags); | |
} | |
-VOID InsertRichEditText(PCWSTR szText, DWORD flags) | |
+VOID InsertRichEditText(LPCWSTR szText, DWORD flags) | |
{ | |
g_MainWindow->GetRichEdit()->InsertText(szText, flags); | |
-} | |
\ No newline at end of file | |
+} | |
+ | |
+/* ATL version of functions */ | |
+VOID SetStatusBarText(const ATL::CStringW& szText) | |
+{ | |
+ SetStatusBarText(szText.GetString()); | |
+} | |
+ | |
+INT ListViewAddItem(INT ItemIndex, INT IconIndex, const ATL::CStringW& Name, LPARAM lParam) | |
+{ | |
+ return ListViewAddItem(ItemIndex, IconIndex, const_cast<LPWSTR>(Name.GetString()), lParam); | |
+} | |
+ | |
+VOID NewRichEditText(const ATL::CStringW& szText, DWORD flags) | |
+{ | |
+ NewRichEditText(szText.GetString(), flags); | |
+} | |
+ | |
+VOID InsertRichEditText(const ATL::CStringW& szText, DWORD flags) | |
+{ | |
+ InsertRichEditText(szText.GetString(), flags); | |
+} | |
+ | |
+CAvailableApps* GetAvailableApps() | |
+{ | |
+ return g_MainWindow->GetAvailableApps(); | |
+} | |
Index: base/applications/rapps/settingsdlg.cpp | |
=================================================================== | |
--- base/applications/rapps/settingsdlg.cpp (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/settingsdlg.cpp (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -3,42 +3,48 @@ | |
* LICENSE: GPL - See COPYING in the top level directory | |
* FILE: base/applications/rapps/settingsdlg.cpp | |
* PURPOSE: Settings Dialog | |
- * PROGRAMMERS: Dmitry Chapyshev (dmitry@reactos.org) | |
+ * PROGRAMMERS: Dmitry Chapyshev (dmitry@reactos.org) | |
+ * Alexander Shaposhnikov (chaez.san@gmail.com) | |
*/ | |
+#include "defines.h" | |
-#include "rapps.h" | |
+#include "dialogs.h" | |
SETTINGS_INFO NewSettingsInfo; | |
#define IS_CHECKED(a, b) \ | |
- a = (SendDlgItemMessage(hDlg, b, BM_GETCHECK, 0, 0) == BST_CHECKED) ? TRUE : FALSE | |
+ a = (SendDlgItemMessageW(hDlg, b, BM_GETCHECK, 0, 0) == BST_CHECKED) ? TRUE : FALSE | |
BOOL | |
ChooseFolder(HWND hwnd) | |
{ | |
BOOL bRet = FALSE; | |
- BROWSEINFO bi; | |
- WCHAR szPath[MAX_PATH], szBuf[MAX_STR_LEN]; | |
+ BROWSEINFOW bi; | |
+ ATL::CStringW szBuf; | |
- LoadStringW(hInst, IDS_CHOOSE_FOLDER_TEXT, szBuf, _countof(szBuf)); | |
+ szBuf.LoadStringW(IDS_CHOOSE_FOLDER_TEXT); | |
ZeroMemory(&bi, sizeof(bi)); | |
bi.hwndOwner = hwnd; | |
- bi.pidlRoot = NULL; | |
- bi.lpszTitle = szBuf; | |
- bi.ulFlags = BIF_USENEWUI | BIF_DONTGOBELOWDOMAIN | BIF_RETURNONLYFSDIRS | /* BIF_BROWSEFILEJUNCTIONS | */ BIF_VALIDATE; | |
+ bi.pidlRoot = NULL; | |
+ bi.lpszTitle = szBuf.GetString(); | |
+ bi.ulFlags = BIF_USENEWUI | BIF_DONTGOBELOWDOMAIN | BIF_RETURNONLYFSDIRS | /* BIF_BROWSEFILEJUNCTIONS | */ BIF_VALIDATE; | |
+ szBuf.Empty(); | |
if (SUCCEEDED(CoInitializeEx(NULL, COINIT_APARTMENTTHREADED))) | |
{ | |
- LPITEMIDLIST lpItemList = SHBrowseForFolder(&bi); | |
- if (lpItemList && SHGetPathFromIDList(lpItemList, szPath)) | |
+ LPITEMIDLIST lpItemList = SHBrowseForFolderW(&bi); | |
+ if (lpItemList && SHGetPathFromIDListW(lpItemList, szBuf.GetBuffer(MAX_PATH))) | |
{ | |
- if (szPath[0] != 0) | |
+ szBuf.ReleaseBuffer(); | |
+ if (!szBuf.IsEmpty()) | |
{ | |
- SetDlgItemTextW(hwnd, IDC_DOWNLOAD_DIR_EDIT, szPath); | |
+ SetDlgItemTextW(hwnd, IDC_DOWNLOAD_DIR_EDIT, szBuf); | |
bRet = TRUE; | |
} | |
} | |
+ else | |
+ szBuf.ReleaseBuffer(); | |
CoTaskMemFree(lpItemList); | |
CoUninitialize(); | |
@@ -47,20 +53,19 @@ | |
return bRet; | |
} | |
-static VOID | |
-InitSettingsControls(HWND hDlg, PSETTINGS_INFO Info) | |
+static VOID InitSettingsControls(HWND hDlg, PSETTINGS_INFO Info) | |
{ | |
- SendDlgItemMessage(hDlg, IDC_SAVE_WINDOW_POS, BM_SETCHECK, Info->bSaveWndPos, 0); | |
- SendDlgItemMessage(hDlg, IDC_UPDATE_AVLIST, BM_SETCHECK, Info->bUpdateAtStart, 0); | |
- SendDlgItemMessage(hDlg, IDC_LOG_ENABLED, BM_SETCHECK, Info->bLogEnabled, 0); | |
- SendDlgItemMessage(hDlg, IDC_DEL_AFTER_INSTALL, BM_SETCHECK, Info->bDelInstaller, 0); | |
+ SendDlgItemMessageW(hDlg, IDC_SAVE_WINDOW_POS, BM_SETCHECK, Info->bSaveWndPos, 0); | |
+ SendDlgItemMessageW(hDlg, IDC_UPDATE_AVLIST, BM_SETCHECK, Info->bUpdateAtStart, 0); | |
+ SendDlgItemMessageW(hDlg, IDC_LOG_ENABLED, BM_SETCHECK, Info->bLogEnabled, 0); | |
+ SendDlgItemMessageW(hDlg, IDC_DEL_AFTER_INSTALL, BM_SETCHECK, Info->bDelInstaller, 0); | |
SetWindowTextW(GetDlgItem(hDlg, IDC_DOWNLOAD_DIR_EDIT), | |
Info->szDownloadDir); | |
- CheckRadioButton(hDlg, IDC_PROXY_DEFAULT, IDC_USE_PROXY, IDC_PROXY_DEFAULT+Info->Proxy); | |
+ CheckRadioButton(hDlg, IDC_PROXY_DEFAULT, IDC_USE_PROXY, IDC_PROXY_DEFAULT + Info->Proxy); | |
- if(IDC_PROXY_DEFAULT + Info->Proxy == IDC_USE_PROXY) | |
+ if (IDC_PROXY_DEFAULT + Info->Proxy == IDC_USE_PROXY) | |
{ | |
EnableWindow(GetDlgItem(hDlg, IDC_PROXY_SERVER), TRUE); | |
EnableWindow(GetDlgItem(hDlg, IDC_NO_PROXY_FOR), TRUE); | |
@@ -70,133 +75,137 @@ | |
SetWindowTextW(GetDlgItem(hDlg, IDC_NO_PROXY_FOR), Info->szNoProxyFor); | |
} | |
-static | |
-INT_PTR CALLBACK | |
-SettingsDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) | |
+static INT_PTR CALLBACK SettingsDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) | |
{ | |
switch (Msg) | |
{ | |
- case WM_INITDIALOG: | |
- { | |
- NewSettingsInfo = SettingsInfo; | |
- InitSettingsControls(hDlg, &SettingsInfo); | |
- } | |
- break; | |
+ case WM_INITDIALOG: | |
+ { | |
+ NewSettingsInfo = SettingsInfo; | |
+ InitSettingsControls(hDlg, &SettingsInfo); | |
+ } | |
+ break; | |
- case WM_COMMAND: | |
+ case WM_COMMAND: | |
+ { | |
+ switch (LOWORD(wParam)) | |
{ | |
- switch (LOWORD(wParam)) | |
- { | |
- case IDC_CHOOSE: | |
- ChooseFolder(hDlg); | |
- break; | |
+ case IDC_CHOOSE: | |
+ ChooseFolder(hDlg); | |
+ break; | |
- case IDC_SAVE_WINDOW_POS: | |
- IS_CHECKED(NewSettingsInfo.bSaveWndPos, IDC_SAVE_WINDOW_POS); | |
- break; | |
+ case IDC_SAVE_WINDOW_POS: | |
+ IS_CHECKED(NewSettingsInfo.bSaveWndPos, IDC_SAVE_WINDOW_POS); | |
+ break; | |
- case IDC_UPDATE_AVLIST: | |
- IS_CHECKED(NewSettingsInfo.bUpdateAtStart, IDC_UPDATE_AVLIST); | |
- break; | |
+ case IDC_UPDATE_AVLIST: | |
+ IS_CHECKED(NewSettingsInfo.bUpdateAtStart, IDC_UPDATE_AVLIST); | |
+ break; | |
- case IDC_LOG_ENABLED: | |
- IS_CHECKED(NewSettingsInfo.bLogEnabled, IDC_LOG_ENABLED); | |
- break; | |
+ case IDC_LOG_ENABLED: | |
+ IS_CHECKED(NewSettingsInfo.bLogEnabled, IDC_LOG_ENABLED); | |
+ break; | |
- case IDC_DEL_AFTER_INSTALL: | |
- IS_CHECKED(NewSettingsInfo.bDelInstaller, IDC_DEL_AFTER_INSTALL); | |
- break; | |
+ case IDC_DEL_AFTER_INSTALL: | |
+ IS_CHECKED(NewSettingsInfo.bDelInstaller, IDC_DEL_AFTER_INSTALL); | |
+ break; | |
- case IDC_PROXY_DEFAULT: | |
- NewSettingsInfo.Proxy = 0; | |
- EnableWindow(GetDlgItem(hDlg, IDC_PROXY_SERVER), FALSE); | |
- EnableWindow(GetDlgItem(hDlg, IDC_NO_PROXY_FOR), FALSE); | |
- break; | |
+ case IDC_PROXY_DEFAULT: | |
+ NewSettingsInfo.Proxy = 0; | |
+ EnableWindow(GetDlgItem(hDlg, IDC_PROXY_SERVER), FALSE); | |
+ EnableWindow(GetDlgItem(hDlg, IDC_NO_PROXY_FOR), FALSE); | |
+ break; | |
- case IDC_NO_PROXY: | |
- NewSettingsInfo.Proxy = 1; | |
- EnableWindow(GetDlgItem(hDlg, IDC_PROXY_SERVER), FALSE); | |
- EnableWindow(GetDlgItem(hDlg, IDC_NO_PROXY_FOR), FALSE); | |
- break; | |
+ case IDC_NO_PROXY: | |
+ NewSettingsInfo.Proxy = 1; | |
+ EnableWindow(GetDlgItem(hDlg, IDC_PROXY_SERVER), FALSE); | |
+ EnableWindow(GetDlgItem(hDlg, IDC_NO_PROXY_FOR), FALSE); | |
+ break; | |
- case IDC_USE_PROXY: | |
- NewSettingsInfo.Proxy = 2; | |
- EnableWindow(GetDlgItem(hDlg, IDC_PROXY_SERVER), TRUE); | |
- EnableWindow(GetDlgItem(hDlg, IDC_NO_PROXY_FOR), TRUE); | |
- break; | |
+ case IDC_USE_PROXY: | |
+ NewSettingsInfo.Proxy = 2; | |
+ EnableWindow(GetDlgItem(hDlg, IDC_PROXY_SERVER), TRUE); | |
+ EnableWindow(GetDlgItem(hDlg, IDC_NO_PROXY_FOR), TRUE); | |
+ break; | |
- case IDC_DEFAULT_SETTINGS: | |
- FillDefaultSettings(&NewSettingsInfo); | |
- InitSettingsControls(hDlg, &NewSettingsInfo); | |
- break; | |
+ case IDC_DEFAULT_SETTINGS: | |
+ FillDefaultSettings(&NewSettingsInfo); | |
+ InitSettingsControls(hDlg, &NewSettingsInfo); | |
+ break; | |
- case IDOK: | |
- { | |
- WCHAR szDir[MAX_PATH]; | |
- WCHAR szProxy[MAX_PATH]; | |
- WCHAR szNoProxy[MAX_PATH]; | |
- DWORD dwAttr; | |
+ case IDOK: | |
+ { | |
+ ATL::CStringW szDir; | |
+ ATL::CStringW szProxy; | |
+ ATL::CStringW szNoProxy; | |
+ DWORD dwAttr; | |
- GetWindowTextW(GetDlgItem(hDlg, IDC_DOWNLOAD_DIR_EDIT), | |
- szDir, MAX_PATH); | |
+ GetWindowTextW(GetDlgItem(hDlg, IDC_DOWNLOAD_DIR_EDIT), | |
+ szDir.GetBuffer(MAX_PATH), MAX_PATH); | |
+ szDir.ReleaseBuffer(); | |
- GetWindowTextW(GetDlgItem(hDlg, IDC_PROXY_SERVER), | |
- szProxy, MAX_PATH); | |
- StringCbCopyW(NewSettingsInfo.szProxyServer, sizeof(NewSettingsInfo.szProxyServer), szProxy); | |
+ GetWindowTextW(GetDlgItem(hDlg, IDC_PROXY_SERVER), | |
+ szProxy.GetBuffer(MAX_PATH), MAX_PATH); | |
+ szProxy.ReleaseBuffer(); | |
+ ATL::CStringW::CopyChars(NewSettingsInfo.szProxyServer, | |
+ _countof(NewSettingsInfo.szProxyServer), | |
+ szProxy.GetString(), | |
+ szProxy.GetLength() + 1); | |
- GetWindowTextW(GetDlgItem(hDlg, IDC_NO_PROXY_FOR), | |
- szNoProxy, MAX_PATH); | |
- StringCbCopyW(NewSettingsInfo.szNoProxyFor, sizeof(NewSettingsInfo.szNoProxyFor), szNoProxy); | |
+ GetWindowTextW(GetDlgItem(hDlg, IDC_NO_PROXY_FOR), | |
+ szNoProxy.GetBuffer(MAX_PATH), MAX_PATH); | |
+ szNoProxy.ReleaseBuffer(); | |
+ ATL::CStringW::CopyChars(NewSettingsInfo.szNoProxyFor, | |
+ _countof(NewSettingsInfo.szNoProxyFor), | |
+ szNoProxy.GetString(), | |
+ szNoProxy.GetLength() + 1); | |
- dwAttr = GetFileAttributesW(szDir); | |
- if (dwAttr != INVALID_FILE_ATTRIBUTES && | |
- (dwAttr & FILE_ATTRIBUTE_DIRECTORY)) | |
+ dwAttr = GetFileAttributesW(szDir.GetString()); | |
+ if (dwAttr != INVALID_FILE_ATTRIBUTES && | |
+ (dwAttr & FILE_ATTRIBUTE_DIRECTORY)) | |
+ { | |
+ ATL::CStringW::CopyChars(NewSettingsInfo.szDownloadDir, | |
+ _countof(NewSettingsInfo.szDownloadDir), | |
+ szDir.GetString(), | |
+ szDir.GetLength() + 1); | |
+ } | |
+ else | |
+ { | |
+ ATL::CStringW szMsgText; | |
+ szMsgText.LoadStringW(IDS_CHOOSE_FOLDER_ERROR); | |
+ | |
+ if (MessageBoxW(hDlg, szMsgText.GetString(), NULL, MB_YESNO) == IDYES) | |
+ { | |
+ if (CreateDirectoryW(szDir.GetString(), NULL)) | |
{ | |
- StringCbCopyW(NewSettingsInfo.szDownloadDir, | |
- sizeof(NewSettingsInfo.szDownloadDir), | |
- szDir); | |
+ EndDialog(hDlg, LOWORD(wParam)); | |
} | |
- else | |
- { | |
- WCHAR szMsgText[MAX_STR_LEN]; | |
- | |
- LoadStringW(hInst, | |
- IDS_CHOOSE_FOLDER_ERROR, | |
- szMsgText, _countof(szMsgText)); | |
- | |
- if (MessageBoxW(hDlg, szMsgText, NULL, MB_YESNO) == IDYES) | |
- { | |
- if (CreateDirectoryW(szDir, NULL)) | |
- { | |
- EndDialog(hDlg, LOWORD(wParam)); | |
- } | |
- } | |
- else | |
- { | |
- SetFocus(GetDlgItem(hDlg, IDC_DOWNLOAD_DIR_EDIT)); | |
- break; | |
- } | |
- } | |
- | |
- SettingsInfo = NewSettingsInfo; | |
- SaveSettings(GetParent(hDlg)); | |
- EndDialog(hDlg, LOWORD(wParam)); | |
} | |
- break; | |
- | |
- case IDCANCEL: | |
- EndDialog(hDlg, LOWORD(wParam)); | |
+ else | |
+ { | |
+ SetFocus(GetDlgItem(hDlg, IDC_DOWNLOAD_DIR_EDIT)); | |
break; | |
+ } | |
} | |
+ | |
+ SettingsInfo = NewSettingsInfo; | |
+ SaveSettings(GetParent(hDlg)); | |
+ EndDialog(hDlg, LOWORD(wParam)); | |
} | |
break; | |
+ | |
+ case IDCANCEL: | |
+ EndDialog(hDlg, LOWORD(wParam)); | |
+ break; | |
+ } | |
} | |
+ break; | |
+ } | |
return FALSE; | |
} | |
-VOID | |
-CreateSettingsDlg(HWND hwnd) | |
+VOID CreateSettingsDlg(HWND hwnd) | |
{ | |
DialogBoxW(hInst, | |
MAKEINTRESOURCEW(IDD_SETTINGS_DIALOG), | |
Index: base/applications/rapps/unattended.cpp | |
=================================================================== | |
--- base/applications/rapps/unattended.cpp (.../trunk/reactos) (nonexistent) | |
+++ base/applications/rapps/unattended.cpp (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -0,0 +1,69 @@ | |
+#include "unattended.h" | |
+#include "defines.h" | |
+#include "available.h" | |
+#include "dialogs.h" | |
+ | |
+#include "setupapi.h" | |
+ | |
+BOOL CmdParser(LPWSTR lpCmdLine) | |
+{ | |
+ INT argc; | |
+ LPWSTR* argv = CommandLineToArgvW(lpCmdLine, &argc); | |
+ ATL::CString szName; | |
+ | |
+ if (!argv || argc < 2) | |
+ { | |
+ return FALSE; | |
+ } | |
+ | |
+ // Setup key - single app expected | |
+ // TODO: use DB filenames as names because they're shorter | |
+ | |
+ ATL::CSimpleArray<ATL::CStringW> arrNames; | |
+ if (!StrCmpW(argv[0], CMD_KEY_INSTALL)) | |
+ { | |
+ for (INT i = 1; i < argc; ++i) | |
+ { | |
+ arrNames.Add(argv[i]); | |
+ } | |
+ } | |
+ else | |
+ if (!StrCmpW(argv[0], CMD_KEY_SETUP)) | |
+ { | |
+ HINF InfHandle = SetupOpenInfFileW(argv[1], NULL, INF_STYLE_WIN4, NULL); | |
+ if (InfHandle == INVALID_HANDLE_VALUE) | |
+ { | |
+ return FALSE; | |
+ } | |
+ | |
+ INFCONTEXT Context; | |
+ if (SetupFindFirstLineW(InfHandle, L"RAPPS", L"Install", &Context)) | |
+ { | |
+ WCHAR szName[MAX_PATH]; | |
+ do | |
+ { | |
+ if (SetupGetStringFieldW(&Context, 1, szName, MAX_PATH, NULL)) | |
+ { | |
+ arrNames.Add(szName); | |
+ } | |
+ } while (SetupFindNextLine(&Context, &Context)); | |
+ } | |
+ SetupCloseInfFile(InfHandle); | |
+ } | |
+ else | |
+ { | |
+ return FALSE; | |
+ } | |
+ | |
+ CAvailableApps apps; | |
+ CAvailableApps::UpdateAppsDB(); | |
+ apps.EnumAvailableApplications(ENUM_ALL_AVAILABLE, NULL); | |
+ ATL::CSimpleArray<CAvailableApplicationInfo*> arrAppInfo = apps.FindInfoList(arrNames); | |
+ if (arrAppInfo.GetSize() > 0) | |
+ { | |
+ CDownloadManager::DownloadListOfApplications(arrAppInfo, TRUE); | |
+ return TRUE; | |
+ } | |
+ | |
+ return FALSE; | |
+} | |
Property changes on: base/applications/rapps/unattended.cpp | |
___________________________________________________________________ | |
Added: svn:eol-style | |
## -0,0 +1 ## | |
+native | |
\ No newline at end of property | |
Index: base/applications/rapps/misc.cpp | |
=================================================================== | |
--- base/applications/rapps/misc.cpp (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/misc.cpp (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -5,81 +5,51 @@ | |
* PURPOSE: Misc functions | |
* PROGRAMMERS: Dmitry Chapyshev (dmitry@reactos.org) | |
* Ismael Ferreras Morezuelas (swyterzone+ros@gmail.com) | |
+ * Alexander Shaposhnikov (chaez.san@gmail.com) | |
*/ | |
+#include "defines.h" | |
-#include "rapps.h" | |
+#include "gui.h" | |
+#include "misc.h" | |
-/* SESSION Operation */ | |
+ /* SESSION Operation */ | |
#define EXTRACT_FILLFILELIST 0x00000001 | |
#define EXTRACT_EXTRACTFILES 0x00000002 | |
static HANDLE hLog = NULL; | |
-WCHAR szCachedINISectionLocale[MAX_PATH] = L"Section."; | |
-WCHAR szCachedINISectionLocaleNeutral[MAX_PATH] = {0}; | |
-BYTE bCachedSectionStatus = FALSE; | |
-typedef struct | |
+struct ERF | |
{ | |
- int erfOper; | |
- int erfType; | |
+ INT erfOper; | |
+ INT erfType; | |
BOOL fError; | |
-} ERF, *PERF; | |
+}; | |
struct FILELIST | |
{ | |
LPSTR FileName; | |
- struct FILELIST *next; | |
+ FILELIST *next; | |
BOOL DoExtract; | |
}; | |
-typedef struct | |
+struct SESSION | |
{ | |
INT FileSize; | |
ERF Error; | |
- struct FILELIST *FileList; | |
+ FILELIST *FileList; | |
INT FileCount; | |
INT Operation; | |
CHAR Destination[MAX_PATH]; | |
CHAR CurrentFile[MAX_PATH]; | |
CHAR Reserved[MAX_PATH]; | |
- struct FILELIST *FilterList; | |
-} SESSION; | |
+ FILELIST *FilterList; | |
+}; | |
typedef HRESULT(WINAPI *fnExtract)(SESSION *dest, LPCSTR szCabName); | |
fnExtract pfnExtract; | |
- | |
-INT | |
-GetSystemColorDepth(VOID) | |
+INT GetWindowWidth(HWND hwnd) | |
{ | |
- DEVMODE pDevMode; | |
- INT ColorDepth; | |
- | |
- pDevMode.dmSize = sizeof(pDevMode); | |
- pDevMode.dmDriverExtra = 0; | |
- | |
- if (!EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &pDevMode)) | |
- { | |
- /* TODO: Error message */ | |
- return ILC_COLOR; | |
- } | |
- | |
- switch (pDevMode.dmBitsPerPel) | |
- { | |
- case 32: ColorDepth = ILC_COLOR32; break; | |
- case 24: ColorDepth = ILC_COLOR24; break; | |
- case 16: ColorDepth = ILC_COLOR16; break; | |
- case 8: ColorDepth = ILC_COLOR8; break; | |
- case 4: ColorDepth = ILC_COLOR4; break; | |
- default: ColorDepth = ILC_COLOR; break; | |
- } | |
- | |
- return ColorDepth; | |
-} | |
- | |
-int | |
-GetWindowWidth(HWND hwnd) | |
-{ | |
RECT Rect; | |
GetWindowRect(hwnd, &Rect); | |
@@ -86,8 +56,7 @@ | |
return (Rect.right - Rect.left); | |
} | |
-int | |
-GetWindowHeight(HWND hwnd) | |
+INT GetWindowHeight(HWND hwnd) | |
{ | |
RECT Rect; | |
@@ -95,8 +64,7 @@ | |
return (Rect.bottom - Rect.top); | |
} | |
-int | |
-GetClientWindowWidth(HWND hwnd) | |
+INT GetClientWindowWidth(HWND hwnd) | |
{ | |
RECT Rect; | |
@@ -104,8 +72,7 @@ | |
return (Rect.right - Rect.left); | |
} | |
-int | |
-GetClientWindowHeight(HWND hwnd) | |
+INT GetClientWindowHeight(HWND hwnd) | |
{ | |
RECT Rect; | |
@@ -113,52 +80,51 @@ | |
return (Rect.bottom - Rect.top); | |
} | |
-VOID | |
-CopyTextToClipboard(LPCWSTR lpszText) | |
+VOID CopyTextToClipboard(LPCWSTR lpszText) | |
{ | |
+ if (!OpenClipboard(NULL)) | |
+ { | |
+ return; | |
+ } | |
+ | |
HRESULT hr; | |
+ HGLOBAL ClipBuffer; | |
+ LPWSTR Buffer; | |
+ DWORD cchBuffer; | |
- if (OpenClipboard(NULL)) | |
- { | |
- HGLOBAL ClipBuffer; | |
- WCHAR *Buffer; | |
- DWORD cchBuffer; | |
+ EmptyClipboard(); | |
+ cchBuffer = wcslen(lpszText) + 1; | |
+ ClipBuffer = GlobalAlloc(GMEM_DDESHARE, cchBuffer * sizeof(WCHAR)); | |
- EmptyClipboard(); | |
- cchBuffer = wcslen(lpszText) + 1; | |
- ClipBuffer = GlobalAlloc(GMEM_DDESHARE, cchBuffer * sizeof(WCHAR)); | |
- Buffer = (PWCHAR)GlobalLock(ClipBuffer); | |
- hr = StringCchCopyW(Buffer, cchBuffer, lpszText); | |
- GlobalUnlock(ClipBuffer); | |
+ Buffer = (PWCHAR) GlobalLock(ClipBuffer); | |
+ hr = StringCchCopyW(Buffer, cchBuffer, lpszText); | |
+ GlobalUnlock(ClipBuffer); | |
- if (SUCCEEDED(hr)) | |
- SetClipboardData(CF_UNICODETEXT, ClipBuffer); | |
+ if (SUCCEEDED(hr)) | |
+ SetClipboardData(CF_UNICODETEXT, ClipBuffer); | |
- CloseClipboard(); | |
- } | |
+ CloseClipboard(); | |
} | |
-VOID | |
-SetWelcomeText(VOID) | |
+VOID SetWelcomeText() | |
{ | |
- WCHAR szText[MAX_STR_LEN*3]; | |
+ ATL::CStringW szText; | |
- LoadStringW(hInst, IDS_WELCOME_TITLE, szText, _countof(szText)); | |
+ szText.LoadStringW(IDS_WELCOME_TITLE); | |
NewRichEditText(szText, CFE_BOLD); | |
- LoadStringW(hInst, IDS_WELCOME_TEXT, szText, _countof(szText)); | |
+ szText.LoadStringW(IDS_WELCOME_TEXT); | |
InsertRichEditText(szText, 0); | |
- LoadStringW(hInst, IDS_WELCOME_URL, szText, _countof(szText)); | |
+ szText.LoadStringW(IDS_WELCOME_URL); | |
InsertRichEditText(szText, CFM_LINK); | |
} | |
-VOID | |
-ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem) | |
+VOID ShowPopupMenu(HWND hwnd, UINT MenuID, UINT DefaultItem) | |
{ | |
HMENU hMenu = NULL; | |
HMENU hPopupMenu; | |
- MENUITEMINFO mii; | |
+ MENUITEMINFO ItemInfo; | |
POINT pt; | |
if (MenuID) | |
@@ -167,15 +133,20 @@ | |
hPopupMenu = GetSubMenu(hMenu, 0); | |
} | |
else | |
+ { | |
hPopupMenu = GetMenu(hwnd); | |
+ } | |
- ZeroMemory(&mii, sizeof(mii)); | |
- mii.cbSize = sizeof(mii); | |
- mii.fMask = MIIM_STATE; | |
- GetMenuItemInfo(hPopupMenu, DefaultItem, FALSE, &mii); | |
+ ZeroMemory(&ItemInfo, sizeof(ItemInfo)); | |
+ ItemInfo.cbSize = sizeof(ItemInfo); | |
+ ItemInfo.fMask = MIIM_STATE; | |
- if (!(mii.fState & MFS_GRAYED)) | |
+ GetMenuItemInfoW(hPopupMenu, DefaultItem, FALSE, &ItemInfo); | |
+ | |
+ if (!(ItemInfo.fState & MFS_GRAYED)) | |
+ { | |
SetMenuDefaultItem(hPopupMenu, DefaultItem, FALSE); | |
+ } | |
GetCursorPos(&pt); | |
@@ -183,12 +154,18 @@ | |
TrackPopupMenu(hPopupMenu, 0, pt.x, pt.y, 0, hMainWnd, NULL); | |
if (hMenu) | |
+ { | |
DestroyMenu(hMenu); | |
+ } | |
} | |
-BOOL | |
-StartProcess(LPWSTR lpPath, BOOL Wait) | |
+BOOL StartProcess(ATL::CStringW &Path, BOOL Wait) | |
{ | |
+ return StartProcess(const_cast<LPWSTR>(Path.GetString()), Wait);; | |
+} | |
+ | |
+BOOL StartProcess(LPWSTR lpPath, BOOL Wait) | |
+{ | |
PROCESS_INFORMATION pi; | |
STARTUPINFOW si; | |
DWORD dwRet; | |
@@ -205,8 +182,12 @@ | |
} | |
CloseHandle(pi.hThread); | |
- if (Wait) EnableWindow(hMainWnd, FALSE); | |
+ if (Wait) | |
+ { | |
+ EnableWindow(hMainWnd, FALSE); | |
+ } | |
+ | |
while (Wait) | |
{ | |
dwRet = MsgWaitForMultipleObjects(1, &pi.hProcess, FALSE, INFINITE, QS_ALLEVENTS); | |
@@ -215,7 +196,7 @@ | |
while (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE)) | |
{ | |
TranslateMessage(&msg); | |
- DispatchMessage(&msg); | |
+ DispatchMessageW(&msg); | |
} | |
} | |
else | |
@@ -237,30 +218,27 @@ | |
return TRUE; | |
} | |
-BOOL | |
-GetStorageDirectory(PWCHAR lpDirectory, DWORD cch) | |
+BOOL GetStorageDirectory(ATL::CStringW& Directory) | |
{ | |
- if (cch < MAX_PATH) | |
- return FALSE; | |
- | |
- if (!SHGetSpecialFolderPathW(NULL, lpDirectory, CSIDL_LOCAL_APPDATA, TRUE)) | |
- return FALSE; | |
- | |
- if (FAILED(StringCchCatW(lpDirectory, cch, L"\\rapps"))) | |
- return FALSE; | |
- | |
- if (!CreateDirectoryW(lpDirectory, NULL) && | |
- GetLastError() != ERROR_ALREADY_EXISTS) | |
+ if (!SHGetSpecialFolderPathW(NULL, Directory.GetBuffer(MAX_PATH), CSIDL_LOCAL_APPDATA, TRUE)) | |
{ | |
+ Directory.ReleaseBuffer(); | |
return FALSE; | |
} | |
- return TRUE; | |
+ Directory.ReleaseBuffer(); | |
+ Directory += L"\\rapps"; | |
+ | |
+ return (CreateDirectoryW(Directory.GetString(), NULL) || GetLastError() == ERROR_ALREADY_EXISTS); | |
} | |
-BOOL | |
-ExtractFilesFromCab(LPWSTR lpCabName, LPWSTR lpOutputPath) | |
+BOOL ExtractFilesFromCab(const ATL::CStringW &CabName, const ATL::CStringW &OutputPath) | |
{ | |
+ return ExtractFilesFromCab(CabName.GetString(), OutputPath.GetString()); | |
+} | |
+ | |
+BOOL ExtractFilesFromCab(LPCWSTR lpCabName, LPCWSTR lpOutputPath) | |
+{ | |
HINSTANCE hCabinetDll; | |
CHAR szCabName[MAX_PATH]; | |
SESSION Dest; | |
@@ -282,6 +260,8 @@ | |
if (Result == S_OK) | |
{ | |
Dest.Operation = EXTRACT_EXTRACTFILES; | |
+ CreateDirectoryW(lpOutputPath, NULL); | |
+ | |
Result = pfnExtract(&Dest, szCabName); | |
if (Result == S_OK) | |
{ | |
@@ -288,6 +268,10 @@ | |
FreeLibrary(hCabinetDll); | |
return TRUE; | |
} | |
+ else | |
+ { | |
+ RemoveDirectoryW(lpOutputPath); | |
+ } | |
} | |
} | |
FreeLibrary(hCabinetDll); | |
@@ -296,204 +280,232 @@ | |
return FALSE; | |
} | |
-VOID | |
-InitLogs(VOID) | |
+VOID InitLogs() | |
{ | |
- WCHAR szBuf[MAX_PATH] = L"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\ReactOS Application Manager"; | |
+ if (!SettingsInfo.bLogEnabled) | |
+ { | |
+ return; | |
+ } | |
+ | |
WCHAR szPath[MAX_PATH]; | |
DWORD dwCategoryNum = 1; | |
DWORD dwDisp, dwData; | |
- HKEY hKey; | |
+ ATL::CRegKey key; | |
- if (!SettingsInfo.bLogEnabled) return; | |
- | |
- if (RegCreateKeyExW(HKEY_LOCAL_MACHINE, | |
- szBuf, 0, NULL, | |
- REG_OPTION_NON_VOLATILE, | |
- KEY_WRITE, NULL, &hKey, &dwDisp) != ERROR_SUCCESS) | |
+ if (key.Create(HKEY_LOCAL_MACHINE, | |
+ L"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\ReactOS Application Manager", | |
+ REG_NONE, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &dwDisp) != ERROR_SUCCESS) | |
{ | |
return; | |
} | |
if (!GetModuleFileNameW(NULL, szPath, _countof(szPath))) | |
- return; | |
- | |
- if (RegSetValueExW(hKey, | |
- L"EventMessageFile", | |
- 0, | |
- REG_EXPAND_SZ, | |
- (LPBYTE)szPath, | |
- (DWORD)(wcslen(szPath) + 1) * sizeof(WCHAR)) != ERROR_SUCCESS) | |
{ | |
- RegCloseKey(hKey); | |
return; | |
} | |
dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | | |
- EVENTLOG_INFORMATION_TYPE; | |
+ EVENTLOG_INFORMATION_TYPE; | |
- if (RegSetValueExW(hKey, | |
- L"TypesSupported", | |
- 0, | |
- REG_DWORD, | |
- (LPBYTE)&dwData, | |
- sizeof(DWORD)) != ERROR_SUCCESS) | |
+ if ((key.SetStringValue(L"EventMessageFile", | |
+ szPath, | |
+ REG_EXPAND_SZ) == ERROR_SUCCESS) | |
+ && (key.SetStringValue(L"CategoryMessageFile", | |
+ szPath, | |
+ REG_EXPAND_SZ) == ERROR_SUCCESS) | |
+ && (key.SetDWORDValue(L"TypesSupported", | |
+ dwData) == ERROR_SUCCESS) | |
+ && (key.SetDWORDValue(L"CategoryCount", | |
+ dwCategoryNum) == ERROR_SUCCESS)) | |
+ | |
{ | |
- RegCloseKey(hKey); | |
- return; | |
+ hLog = RegisterEventSourceW(NULL, L"ReactOS Application Manager"); | |
} | |
- if (RegSetValueExW(hKey, | |
- L"CategoryMessageFile", | |
- 0, | |
- REG_EXPAND_SZ, | |
- (LPBYTE)szPath, | |
- (DWORD)(wcslen(szPath) + 1) * sizeof(WCHAR)) != ERROR_SUCCESS) | |
+ key.Close(); | |
+} | |
+ | |
+ | |
+VOID FreeLogs() | |
+{ | |
+ if (hLog) | |
{ | |
- RegCloseKey(hKey); | |
- return; | |
+ DeregisterEventSource(hLog); | |
} | |
+} | |
- if (RegSetValueExW(hKey, | |
- L"CategoryCount", | |
- 0, | |
- REG_DWORD, | |
- (LPBYTE)&dwCategoryNum, | |
- sizeof(DWORD)) != ERROR_SUCCESS) | |
+ | |
+BOOL WriteLogMessage(WORD wType, DWORD dwEventID, LPCWSTR lpMsg) | |
+{ | |
+ if (!SettingsInfo.bLogEnabled) | |
{ | |
- RegCloseKey(hKey); | |
- return; | |
+ return TRUE; | |
} | |
- RegCloseKey(hKey); | |
+ if (!ReportEventW(hLog, wType, 0, dwEventID, | |
+ NULL, 1, 0, &lpMsg, NULL)) | |
+ { | |
+ return FALSE; | |
+ } | |
- hLog = RegisterEventSourceW(NULL, L"ReactOS Application Manager"); | |
+ return TRUE; | |
} | |
- | |
-VOID | |
-FreeLogs(VOID) | |
+BOOL GetInstalledVersion_WowUser(ATL::CStringW* szVersionResult, | |
+ const ATL::CStringW& RegName, | |
+ BOOL IsUserKey, | |
+ REGSAM keyWow) | |
{ | |
- if (hLog) DeregisterEventSource(hLog); | |
-} | |
+ BOOL bHasSucceded = FALSE; | |
+ ATL::CRegKey key; | |
+ ATL::CStringW szVersion; | |
+ ATL::CStringW szPath = L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\" + RegName; | |
+ if (key.Open(IsUserKey ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE, | |
+ szPath.GetString(), | |
+ keyWow | KEY_READ) != ERROR_SUCCESS) | |
+ { | |
+ return FALSE; | |
+ } | |
-BOOL | |
-WriteLogMessage(WORD wType, DWORD dwEventID, LPWSTR lpMsg) | |
-{ | |
- if (!SettingsInfo.bLogEnabled) return TRUE; | |
+ if (szVersionResult != NULL) | |
+ { | |
+ ULONG dwSize = MAX_PATH * sizeof(WCHAR); | |
- if (!ReportEventW(hLog, | |
- wType, | |
- 0, | |
- dwEventID, | |
- NULL, | |
- 1, | |
- 0, | |
- (LPCWSTR*)&lpMsg, | |
- NULL)) | |
+ if (key.QueryStringValue(L"DisplayVersion", | |
+ szVersion.GetBuffer(MAX_PATH), | |
+ &dwSize) == ERROR_SUCCESS) | |
+ { | |
+ szVersion.ReleaseBuffer(); | |
+ *szVersionResult = szVersion; | |
+ bHasSucceded = TRUE; | |
+ } | |
+ else | |
+ { | |
+ szVersion.ReleaseBuffer(); | |
+ } | |
+ } | |
+ else | |
{ | |
- return FALSE; | |
+ bHasSucceded = TRUE; | |
+ szVersion.ReleaseBuffer(); | |
} | |
+ key.Close(); | |
- return TRUE; | |
+ return bHasSucceded; | |
} | |
+BOOL GetInstalledVersion(ATL::CStringW *pszVersion, const ATL::CStringW &szRegName) | |
+{ | |
+ return (!szRegName.IsEmpty() | |
+ && (GetInstalledVersion_WowUser(pszVersion, szRegName, TRUE, KEY_WOW64_32KEY) | |
+ || GetInstalledVersion_WowUser(pszVersion, szRegName, FALSE, KEY_WOW64_32KEY) | |
+ || GetInstalledVersion_WowUser(pszVersion, szRegName, TRUE, KEY_WOW64_64KEY) | |
+ || GetInstalledVersion_WowUser(pszVersion, szRegName, FALSE, KEY_WOW64_64KEY))); | |
+} | |
-LPWSTR GetINIFullPath(LPCWSTR lpFileName) | |
+// CConfigParser | |
+ATL::CStringW CConfigParser::m_szLocaleID; | |
+ATL::CStringW CConfigParser::m_szCachedINISectionLocale; | |
+ATL::CStringW CConfigParser::m_szCachedINISectionLocaleNeutral; | |
+ | |
+CConfigParser::CConfigParser(const ATL::CStringW& FileName) : szConfigPath(GetINIFullPath(FileName)) | |
{ | |
- WCHAR szDir[MAX_PATH]; | |
- static WCHAR szBuffer[MAX_PATH]; | |
+ // we don't have cached section strings for the current system language, create them, lazy | |
+ CacheINILocaleLazy(); | |
+} | |
- GetStorageDirectory(szDir, _countof(szDir)); | |
- StringCbPrintfW(szBuffer, sizeof(szBuffer), L"%ls\\rapps\\%ls", szDir, lpFileName); | |
+ATL::CStringW CConfigParser::GetINIFullPath(const ATL::CStringW& FileName) | |
+{ | |
+ ATL::CStringW szDir; | |
+ ATL::CStringW szBuffer; | |
+ GetStorageDirectory(szDir); | |
+ szBuffer.Format(L"%ls\\rapps\\%ls", szDir, FileName); | |
+ | |
return szBuffer; | |
} | |
- | |
-UINT ParserGetString(LPCWSTR lpKeyName, LPWSTR lpReturnedString, UINT nSize, LPCWSTR lpFileName) | |
+VOID CConfigParser::CacheINILocaleLazy() | |
{ | |
- PWSTR lpFullFileName = GetINIFullPath(lpFileName); | |
- DWORD dwResult; | |
- | |
- /* we don't have cached section strings for the current system language, create them */ | |
- if(bCachedSectionStatus == FALSE) | |
+ if (m_szLocaleID.IsEmpty()) | |
{ | |
- WCHAR szLocale[4 + 1]; | |
- DWORD len; | |
- | |
- /* find out what is the current system lang code (e.g. "0a") and append it to SectionLocale */ | |
+ // TODO: Set default locale if call fails | |
+ // find out what is the current system lang code (e.g. "0a") and append it to SectionLocale | |
GetLocaleInfoW(GetUserDefaultLCID(), LOCALE_ILANGUAGE, | |
- szLocale, _countof(szLocale)); | |
+ m_szLocaleID.GetBuffer(m_cchLocaleSize), m_cchLocaleSize); | |
- StringCbCatW(szCachedINISectionLocale, sizeof(szCachedINISectionLocale), szLocale); | |
+ m_szLocaleID.ReleaseBuffer(); | |
+ m_szCachedINISectionLocale = L"Section." + m_szLocaleID; | |
- /* copy the locale-dependent string into the buffer of the future neutral one */ | |
- StringCbCopyW(szCachedINISectionLocaleNeutral, | |
- sizeof(szCachedINISectionLocaleNeutral), | |
- szCachedINISectionLocale); | |
+ // turn "Section.0c0a" into "Section.0a", keeping just the neutral lang part | |
+ m_szCachedINISectionLocaleNeutral = m_szCachedINISectionLocale + m_szLocaleID.Right(2); | |
+ } | |
+} | |
- /* turn "Section.0c0a" into "Section.0a", keeping just the neutral lang part */ | |
- len = wcslen(szCachedINISectionLocale); | |
+const ATL::CStringW& CConfigParser::GetLocale() | |
+{ | |
+ CacheINILocaleLazy(); | |
+ return m_szLocaleID; | |
+} | |
- memmove((szCachedINISectionLocaleNeutral + len) - 4, | |
- (szCachedINISectionLocaleNeutral + len) - 2, | |
- (2 * sizeof(WCHAR)) + sizeof(UNICODE_NULL)); | |
+INT CConfigParser::GetLocaleSize() | |
+{ | |
+ return m_cchLocaleSize; | |
+} | |
- /* finally, mark us as cache-friendly for the next time */ | |
- bCachedSectionStatus = TRUE; | |
- } | |
+UINT CConfigParser::GetString(const ATL::CStringW& KeyName, ATL::CStringW& ResultString) | |
+{ | |
+ DWORD dwResult; | |
- /* 1st - find localized strings (e.g. "Section.0c0a") */ | |
- dwResult = GetPrivateProfileStringW(szCachedINISectionLocale, | |
- lpKeyName, | |
+ LPWSTR ResultStringBuffer = ResultString.GetBuffer(MAX_PATH); | |
+ // 1st - find localized strings (e.g. "Section.0c0a") | |
+ dwResult = GetPrivateProfileStringW(m_szCachedINISectionLocale.GetString(), | |
+ KeyName.GetString(), | |
NULL, | |
- lpReturnedString, | |
- nSize, | |
- lpFullFileName); | |
+ ResultStringBuffer, | |
+ MAX_PATH, | |
+ szConfigPath.GetString()); | |
- if (dwResult != 0) | |
- return TRUE; | |
+ if (!dwResult) | |
+ { | |
+ // 2nd - if they weren't present check for neutral sub-langs/ generic translations (e.g. "Section.0a") | |
+ dwResult = GetPrivateProfileStringW(m_szCachedINISectionLocaleNeutral.GetString(), | |
+ KeyName.GetString(), | |
+ NULL, | |
+ ResultStringBuffer, | |
+ MAX_PATH, | |
+ szConfigPath.GetString()); | |
+ if (!dwResult) | |
+ { | |
+ // 3rd - if they weren't present fallback to standard english strings (just "Section") | |
+ dwResult = GetPrivateProfileStringW(L"Section", | |
+ KeyName.GetString(), | |
+ NULL, | |
+ ResultStringBuffer, | |
+ MAX_PATH, | |
+ szConfigPath.GetString()); | |
+ } | |
+ } | |
- /* 2nd - if they weren't present check for neutral sub-langs/ generic translations (e.g. "Section.0a") */ | |
- dwResult = GetPrivateProfileStringW(szCachedINISectionLocaleNeutral, | |
- lpKeyName, | |
- NULL, | |
- lpReturnedString, | |
- nSize, | |
- lpFullFileName); | |
- | |
- if (dwResult != 0) | |
- return TRUE; | |
- | |
- /* 3rd - if they weren't present fallback to standard english strings (just "Section") */ | |
- dwResult = GetPrivateProfileStringW(L"Section", | |
- lpKeyName, | |
- NULL, | |
- lpReturnedString, | |
- nSize, | |
- lpFullFileName); | |
- | |
+ ResultString.ReleaseBuffer(); | |
return (dwResult != 0 ? TRUE : FALSE); | |
} | |
-UINT ParserGetInt(LPCWSTR lpKeyName, LPCWSTR lpFileName) | |
+UINT CConfigParser::GetInt(const ATL::CStringW& KeyName) | |
{ | |
- WCHAR Buffer[30]; | |
- UNICODE_STRING BufferW; | |
- ULONG Result; | |
+ ATL::CStringW Buffer; | |
- /* grab the text version of our entry */ | |
- if (!ParserGetString(lpKeyName, Buffer, _countof(Buffer), lpFileName)) | |
+ // grab the text version of our entry | |
+ if (!GetString(KeyName, Buffer)) | |
return FALSE; | |
- if (!Buffer[0]) | |
+ if (Buffer.IsEmpty()) | |
return FALSE; | |
- /* convert it to an actual integer */ | |
- RtlInitUnicodeString(&BufferW, Buffer); | |
- RtlUnicodeStringToInteger(&BufferW, 0, &Result); | |
+ // convert it to an actual integer | |
+ INT result = StrToIntW(Buffer.GetString()); | |
- return Result; | |
-} | |
\ No newline at end of file | |
+ return (UINT) (result <= 0) ? 0 : result; | |
+} | |
+// CConfigParser | |
Index: base/applications/rapps/CMakeLists.txt | |
=================================================================== | |
--- base/applications/rapps/CMakeLists.txt (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/CMakeLists.txt (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -4,6 +4,7 @@ | |
include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/atl) | |
include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/cryptlib) | |
+include_directories(include) | |
list(APPEND SOURCE | |
aboutdlg.cpp | |
@@ -16,7 +17,20 @@ | |
misc.cpp | |
settingsdlg.cpp | |
winmain.cpp | |
- rapps.h) | |
+ unattended.cpp | |
+ include/rapps.h | |
+ include/available.h | |
+ include/gui.h | |
+ include/dialogs.h | |
+ include/installed.h | |
+ include/crichedit.h | |
+ include/defines.h | |
+ include/misc.h | |
+ include/resource.h | |
+ include/rosui.h | |
+ include/winmain.h | |
+ include/unattended.h | |
+) | |
add_definitions(-DUSE_CERT_PINNING) | |
file(GLOB_RECURSE rapps_rc_deps res/*.*) | |
@@ -24,8 +38,8 @@ | |
add_executable(rapps ${SOURCE} rapps.rc) | |
set_module_type(rapps win32gui UNICODE) | |
target_link_libraries(rapps atlnew uuid wine) | |
-add_importlibs(rapps advapi32 comctl32 gdi32 wininet user32 shell32 shlwapi ole32 msvcrt kernel32 ntdll) | |
-add_pch(rapps rapps.h SOURCE) | |
+add_importlibs(rapps advapi32 comctl32 gdi32 wininet user32 shell32 shlwapi ole32 setupapi msvcrt kernel32 ntdll) | |
+add_pch(rapps include/rapps.h SOURCE) | |
add_dependencies(rapps rappsmsg) | |
add_message_headers(ANSI rappsmsg.mc) | |
add_cd_file(TARGET rapps DESTINATION reactos/system32 FOR all) | |
Index: base/applications/rapps/installdlg.cpp | |
=================================================================== | |
--- base/applications/rapps/installdlg.cpp (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps/installdlg.cpp (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
@@ -5,10 +5,12 @@ | |
* PURPOSE: "Download and Install" Dialog | |
* PROGRAMMERS: Dmitry Chapyshev (dmitry@reactos.org) | |
*/ | |
+#include "defines.h" | |
-#include "rapps.h" | |
+#include "dialogs.h" | |
+#include "available.h" | |
-static PAPPLICATION_INFO AppInfo; | |
+static CAvailableApplicationInfo* AppInfo; | |
static | |
INT_PTR CALLBACK | |
@@ -16,24 +18,23 @@ | |
{ | |
switch (Msg) | |
{ | |
- case WM_INITDIALOG: | |
- { | |
+ case WM_INITDIALOG: | |
+ { | |
+ } | |
+ break; | |
- } | |
- break; | |
- | |
- case WM_COMMAND: | |
+ case WM_COMMAND: | |
+ { | |
+ switch (LOWORD(wParam)) | |
{ | |
- switch (LOWORD(wParam)) | |
- { | |
- case IDOK: | |
- case IDCANCEL: | |
- EndDialog(hDlg, LOWORD(wParam)); | |
- break; | |
- } | |
+ case IDOK: | |
+ case IDCANCEL: | |
+ EndDialog(hDlg, LOWORD(wParam)); | |
+ break; | |
} | |
- break; | |
} | |
+ break; | |
+ } | |
return FALSE; | |
} | |
@@ -41,16 +42,16 @@ | |
BOOL | |
InstallApplication(INT Index) | |
{ | |
- if (!IS_AVAILABLE_ENUM(SelectedEnumType)) | |
+ if (!IsAvailableEnum(SelectedEnumType)) | |
return FALSE; | |
- AppInfo = (PAPPLICATION_INFO) ListViewGetlParam(Index); | |
+ AppInfo = (CAvailableApplicationInfo*) ListViewGetlParam(Index); | |
if (!AppInfo) return FALSE; | |
- DialogBox(hInst, | |
- MAKEINTRESOURCE(IDD_INSTALL_DIALOG), | |
- hMainWnd, | |
- InstallDlgProc); | |
+ DialogBoxW(hInst, | |
+ MAKEINTRESOURCEW(IDD_INSTALL_DIALOG), | |
+ hMainWnd, | |
+ InstallDlgProc); | |
return TRUE; | |
} | |
Index: base/applications/rapps | |
=================================================================== | |
--- base/applications/rapps (.../trunk/reactos) (revision 74645) | |
+++ base/applications/rapps (.../branches/GSoC_2017/rapps/reactos) (revision 75702) | |
Property changes on: base/applications/rapps | |
___________________________________________________________________ | |
Added: svn:global-ignores | |
## -0,0 +1 ## | |
+CMakeFiles | |
Added: svn:ignore | |
## -0,0 +1,3 ## | |
+CMakeCache.txt | |
+RCa10764 | |
+rapps.aps |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment