mirror of
https://github.com/reactos/reactos.git
synced 2025-04-30 11:08:51 +00:00
- changed name of package library to package.dll
- fixed PML_TransError function (possibly fixes bug 730) svn path=/trunk/; revision=19570
This commit is contained in:
parent
7a8e31d41b
commit
48fa464e43
10 changed files with 49 additions and 45 deletions
|
@ -1,12 +1,12 @@
|
||||||
<module name="rosget" type="win32cui" installbase="system32" installname="rosget.exe">
|
<module name="rosget" type="win32cui" installbase="system32" installname="rosget.exe">
|
||||||
<include base="packlib">.</include>
|
<include base="package">.</include>
|
||||||
<define name="__USE_W32API" />
|
<define name="__USE_W32API" />
|
||||||
<define name="UNICODE" />
|
<define name="UNICODE" />
|
||||||
<define name="_WIN32_IE">0x0501</define>
|
<define name="_WIN32_IE">0x0501</define>
|
||||||
<define name="_WIN32_WINNT">0x0501</define>
|
<define name="_WIN32_WINNT">0x0501</define>
|
||||||
|
|
||||||
<library>kernel32</library>
|
<library>kernel32</library>
|
||||||
<library>packlib</library>
|
<library>package</library>
|
||||||
<file>main.c</file>
|
<file>main.c</file>
|
||||||
<file>ros-get.rc</file>
|
<file>ros-get.rc</file>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
@ -5,5 +5,5 @@
|
||||||
<xi:include href="gui/packmgr.xml" />
|
<xi:include href="gui/packmgr.xml" />
|
||||||
</directory>
|
</directory>
|
||||||
<directory name="lib">
|
<directory name="lib">
|
||||||
<xi:include href="lib/packlib.xml" />
|
<xi:include href="lib/package.xml" />
|
||||||
</directory>
|
</directory>
|
|
@ -40,6 +40,7 @@ int WINAPI WinMain (HINSTANCE hinst, HINSTANCE hPrevInstance, PSTR szCmdLine, in
|
||||||
HWND hwnd;
|
HWND hwnd;
|
||||||
MSG msg;
|
MSG msg;
|
||||||
WNDCLASSEX wc = {0};
|
WNDCLASSEX wc = {0};
|
||||||
|
WCHAR errbuf[2000];
|
||||||
|
|
||||||
// Window creation
|
// Window creation
|
||||||
wc.cbSize = sizeof(WNDCLASSEX);
|
wc.cbSize = sizeof(WNDCLASSEX);
|
||||||
|
@ -78,7 +79,7 @@ int WINAPI WinMain (HINSTANCE hinst, HINSTANCE hPrevInstance, PSTR szCmdLine, in
|
||||||
|
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
MessageBox(0,PML_TransError(error),0,0);
|
MessageBox(0,PML_TransError(error, (WCHAR*)errbuf, sizeof(errbuf)/sizeof(WCHAR)),0,0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,12 +155,13 @@ void InitControls (HWND hwnd)
|
||||||
{
|
{
|
||||||
|
|
||||||
HINSTANCE hinst = GetModuleHandle(NULL);
|
HINSTANCE hinst = GetModuleHandle(NULL);
|
||||||
|
WCHAR errbuf[2000];
|
||||||
|
|
||||||
// Create the controls
|
// Create the controls
|
||||||
hTree = CreateWindowEx(0, WC_TREEVIEW, L"TreeView", WS_CHILD|WS_VISIBLE|WS_BORDER|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS,
|
hTree = CreateWindowEx(0, WC_TREEVIEW, L"TreeView", WS_CHILD|WS_VISIBLE|WS_BORDER|TVS_HASLINES|TVS_LINESATROOT|TVS_HASBUTTONS,
|
||||||
0, 0, 0, 0, hwnd, NULL, hinst, NULL);
|
0, 0, 0, 0, hwnd, NULL, hinst, NULL);
|
||||||
|
|
||||||
hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, L"edit", PML_TransError(IDS_LOAD), WS_CHILD|WS_VISIBLE|ES_MULTILINE,
|
hEdit = CreateWindowEx(WS_EX_CLIENTEDGE, L"edit", PML_TransError(IDS_LOAD, (WCHAR*)errbuf, sizeof(errbuf)/sizeof(WCHAR)), WS_CHILD|WS_VISIBLE|ES_MULTILINE,
|
||||||
0, 0, 100, 100, hwnd, NULL, hinst, NULL);
|
0, 0, 100, 100, hwnd, NULL, hinst, NULL);
|
||||||
|
|
||||||
hPopup = LoadMenu(hinst, MAKEINTRESOURCE(IDR_POPUP));
|
hPopup = LoadMenu(hinst, MAKEINTRESOURCE(IDR_POPUP));
|
||||||
|
@ -388,6 +390,8 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
// Warning: This function is called from another thread
|
// Warning: This function is called from another thread
|
||||||
int SetStatus (int status1, int status2, WCHAR* text)
|
int SetStatus (int status1, int status2, WCHAR* text)
|
||||||
{
|
{
|
||||||
|
WCHAR errbuf[2000];
|
||||||
|
|
||||||
// Set the Rage to 1000
|
// Set the Rage to 1000
|
||||||
SendMessage(GetDlgItem(hStatus, IDC_STATUS1), PBM_SETRANGE32, 0, 1000);
|
SendMessage(GetDlgItem(hStatus, IDC_STATUS1), PBM_SETRANGE32, 0, 1000);
|
||||||
SendMessage(GetDlgItem(hStatus, IDC_STATUS2), PBM_SETRANGE32, 0, 1000);
|
SendMessage(GetDlgItem(hStatus, IDC_STATUS2), PBM_SETRANGE32, 0, 1000);
|
||||||
|
@ -406,7 +410,7 @@ int SetStatus (int status1, int status2, WCHAR* text)
|
||||||
if(status1==1000)
|
if(status1==1000)
|
||||||
{
|
{
|
||||||
EndDialog(hStatus, TRUE);
|
EndDialog(hStatus, TRUE);
|
||||||
MessageBox(0,PML_TransError(status2),0,0);
|
MessageBox(0,PML_TransError(status2, (WCHAR*)errbuf, sizeof(errbuf)/sizeof(WCHAR)),0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<module name="packmgr" type="win32gui" installbase="system32" installname="packmgr.exe">
|
<module name="packmgr" type="win32gui" installbase="system32" installname="packmgr.exe">
|
||||||
<include base="packlib">.</include>
|
<include base="package">.</include>
|
||||||
<include base="packmgr">.</include>
|
<include base="packmgr">.</include>
|
||||||
<define name="__USE_W32API" />
|
<define name="__USE_W32API" />
|
||||||
<define name="UNICODE" />
|
<define name="UNICODE" />
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
<library>kernel32</library>
|
<library>kernel32</library>
|
||||||
<library>user32</library>
|
<library>user32</library>
|
||||||
<library>comctl32</library>
|
<library>comctl32</library>
|
||||||
<library>packlib</library>
|
<library>package</library>
|
||||||
|
|
||||||
<file>main.c</file>
|
<file>main.c</file>
|
||||||
<file>packmgr.rc</file>
|
<file>packmgr.rc</file>
|
||||||
|
|
|
@ -119,7 +119,9 @@ extern "C" int PML_DoIt (TREE* tree, PML_SetStatus SetStatus, PML_Ask Ask)
|
||||||
|
|
||||||
//ask
|
//ask
|
||||||
WCHAR buffer [2000];
|
WCHAR buffer [2000];
|
||||||
wsprintf(buffer, PML_TransError(ERR_READY), tree->todo.size());
|
WCHAR errbuf [2000];
|
||||||
|
|
||||||
|
wsprintf(buffer, PML_TransError(ERR_READY, (WCHAR*)errbuf, sizeof(errbuf)/sizeof(WCHAR)), tree->todo.size());
|
||||||
|
|
||||||
if(!Ask(buffer))
|
if(!Ask(buffer))
|
||||||
return ERR_GENERIC;
|
return ERR_GENERIC;
|
||||||
|
@ -136,13 +138,11 @@ extern "C" int PML_DoIt (TREE* tree, PML_SetStatus SetStatus, PML_Ask Ask)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Translates Errorcode into human language
|
// Translates Errorcode into human language
|
||||||
extern "C" WCHAR* PML_TransError (int code)
|
extern "C" WCHAR* PML_TransError (int code, WCHAR *string, INT maxchar)
|
||||||
{
|
{
|
||||||
// I know we, got a memory leak here
|
|
||||||
static WCHAR string [256];
|
|
||||||
|
|
||||||
if(!LoadString(GetModuleHandle(L"package"), code, string, 256))
|
if(!LoadString(GetModuleHandle(L"package"), code, string, maxchar))
|
||||||
return PML_TransError(ERR_GENERIC);
|
return PML_TransError(ERR_GENERIC, string, maxchar);
|
||||||
|
|
||||||
return string;
|
return string;
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,8 +167,8 @@ extern "C" int PML_SetAction (TREE* tree, int id, int action, PML_SetIcon SetIco
|
||||||
if(pack->depencies.size() && action)
|
if(pack->depencies.size() && action)
|
||||||
{
|
{
|
||||||
UINT count = pack->depencies.size();
|
UINT count = pack->depencies.size();
|
||||||
WCHAR buffer[2000], buffer2[200];
|
WCHAR buffer[2000], buffer2[200], errbuf[2000];
|
||||||
wcscpy(buffer, PML_TransError(ERR_DEP1));
|
PML_TransError(ERR_DEP1, (WCHAR*)buffer, sizeof(buffer)/sizeof(WCHAR));
|
||||||
|
|
||||||
for (i=0; i<pack->depencies.size(); i++)
|
for (i=0; i<pack->depencies.size(); i++)
|
||||||
{
|
{
|
||||||
|
@ -187,7 +187,7 @@ extern "C" int PML_SetAction (TREE* tree, int id, int action, PML_SetIcon SetIco
|
||||||
wsprintf(buffer, L"%s - %s\n", buffer, buffer2);//
|
wsprintf(buffer, L"%s - %s\n", buffer, buffer2);//
|
||||||
}
|
}
|
||||||
|
|
||||||
wcscat(buffer, PML_TransError(ERR_DEP2));
|
wcscat(buffer, PML_TransError(ERR_DEP2, (WCHAR*)errbuf, sizeof(errbuf)/sizeof(WCHAR)));
|
||||||
|
|
||||||
if(count)
|
if(count)
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,7 @@ typedef void* pTree;
|
||||||
/* Prototypes */
|
/* Prototypes */
|
||||||
|
|
||||||
void PML_Abort (void);
|
void PML_Abort (void);
|
||||||
WCHAR* PML_TransError (int code);
|
WCHAR* PML_TransError (int code, WCHAR* string, INT maxchar);
|
||||||
|
|
||||||
int PML_LoadTree (pTree*, char* url, PML_AddItem);
|
int PML_LoadTree (pTree*, char* url, PML_AddItem);
|
||||||
int PML_FindItem (pTree tree, const char* what);
|
int PML_FindItem (pTree tree, const char* what);
|
||||||
|
|
|
@ -72,7 +72,7 @@ typedef struct
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
void PML_Abort (void);
|
void PML_Abort (void);
|
||||||
WCHAR* PML_TransError (int code);
|
WCHAR* PML_TransError (int code, WCHAR* string, INT maxchar);
|
||||||
|
|
||||||
int PML_LoadTree (pTree*, char* url, PML_AddItem);
|
int PML_LoadTree (pTree*, char* url, PML_AddItem);
|
||||||
int PML_FindItem (TREE* tree, const char* what);
|
int PML_FindItem (TREE* tree, const char* what);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<module name="packlib" type="win32dll" installbase="system32" installname="package.dll">
|
<module name="package" type="win32dll" installbase="system32" installname="package.dll">
|
||||||
<importlibrary definition="package.def" />
|
<importlibrary definition="package.def" />
|
||||||
<include base="packlib">.</include>
|
<include base="package">.</include>
|
||||||
|
|
||||||
<define name="UNICODE" />
|
<define name="UNICODE" />
|
||||||
<define name="__USE_W32API" />
|
<define name="__USE_W32API" />
|
Loading…
Reference in a new issue