From: Maarten Bosma Date: Sun, 10 Apr 2005 17:03:40 +0000 (+0000) Subject: PackageManager: Cmdline fix X-Git-Tag: backups/powerpc@14753~135 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=c1a2f01875cd19e3ad6080f0ad8affca6cdf05a5 PackageManager: Cmdline fix svn path=/trunk/; revision=14580 --- diff --git a/rosapps/packmgr/cmd-line/main.cpp b/rosapps/packmgr/cmd-line/main.cpp index e37a4edf4f7..2a2b05add59 100644 --- a/rosapps/packmgr/cmd-line/main.cpp +++ b/rosapps/packmgr/cmd-line/main.cpp @@ -90,6 +90,25 @@ int Help (void) return 0; } + +int Ask (const WCHAR* question) +{ + char answer[255]; + + wprintf(question); + + cout << " [y/n] "; + cin >> answer; + cout << endl; + + if (answer[0]=='y') + return 1; + + else if (answer[0]=='n') + return 0; + + return Ask(question); +} int SetStatus (int status1, int status2, WCHAR* text) { @@ -125,14 +144,14 @@ int Install (void) int id = PML_FindItem(tree, cmdline[i].c_str()); if(id) - PML_SetAction(tree, id, 1, NULL); + PML_SetAction(tree, id, 1, NULL, Ask); else cout << "Could not find the Package \"" << cmdline[i] << "\"\n"; } // do it - error = PML_DoIt (tree, SetStatus); + error = PML_DoIt (tree, SetStatus, Ask); if(error) { wprintf(L"%s\n", PML_TransError(error)); @@ -168,15 +187,12 @@ int Show (void) { int id = PML_FindItem(tree, cmdline[i].c_str()); - cout << i << "<" << cmdline.size() << endl; - if(id) cout << PML_GetDescription (tree, id) << "\n"; else cout << "Could not find the Package \"" << cmdline[i] << "\"\n"; } - cout << i << "<" << cmdline.size() << endl; // clean up PML_CloseTree (tree); diff --git a/rosapps/packmgr/lib/download.cpp b/rosapps/packmgr/lib/download.cpp index f0d2f6bd974..6528ae5da0a 100644 --- a/rosapps/packmgr/lib/download.cpp +++ b/rosapps/packmgr/lib/download.cpp @@ -16,7 +16,7 @@ #include // Server there all the files lie -const char* tree_server = "http://maarten-online.de/xml/"; +const char* tree_server = "http://svn.reactos.com/viewcvs/*checkout*/trunk/rosapps/packmgr/tree/"; HRESULT WINAPI URLDownloadToFileA( LPUNKNOWN pCaller, diff --git a/rosapps/packmgr/lib/tree.cpp b/rosapps/packmgr/lib/tree.cpp index 6cae038e0b3..00d27a81d6e 100644 --- a/rosapps/packmgr/lib/tree.cpp +++ b/rosapps/packmgr/lib/tree.cpp @@ -99,7 +99,8 @@ void tree_start (void* usrdata, const char* tag, const char** arg) // do some manipulation at the parent else { - tree->addItem(id, tree->packages[id].name, parents.back(), icon); + if(tree->addItem) + tree->addItem(id, tree->packages[id].name, parents.back(), icon); // list as child in the parent node tree->packages[parents.back()].children.push_back(id); diff --git a/rosapps/packmgr/tree/mozcontrol.xml b/rosapps/packmgr/tree/mozcontrol.xml index 01e953692b8..db04a048584 100644 --- a/rosapps/packmgr/tree/mozcontrol.xml +++ b/rosapps/packmgr/tree/mozcontrol.xml @@ -1,7 +1,7 @@ -MozillaControl -Provide the Gekko Engine for ReactOS. - - + MozillaControl + Provide the Gekko Engine for ReactOS. + + abiword