Author: pschweitzer
Date: Sun Nov 4 23:29:50 2007
New Revision: 30129
URL:
http://svn.reactos.org/svn/reactos?rev=30129&view=rev
Log:
Second part of my previous patch.
- Previous settings are loaded
- TODO list is now empty !
Modified:
trunk/tools/RosBE-Windows/Tools/config/options.c
trunk/tools/RosBE-Windows/Tools/config/todo.txt
Modified: trunk/tools/RosBE-Windows/Tools/config/options.c
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Tools/config/o…
==============================================================================
--- trunk/tools/RosBE-Windows/Tools/config/options.c (original)
+++ trunk/tools/RosBE-Windows/Tools/config/options.c Sun Nov 4 23:29:50 2007
@@ -104,35 +104,93 @@
VOID LoadSettings(HWND hwnd, PSETTINGS LoadedSettings)
{
- // Loading settings is not yet implemented. This function just apply default
settings.
-#if 0
FILE *pFile;
-#endif
+ INT NbLines = 0;
WCHAR optionsfile[MAX_PATH];
+ PVOID *res;
+ WCHAR *ptr, *ptr2;
+ TCHAR TTempLine[25+MAX_PATH];
+ WCHAR WTempLine[25+MAX_PATH];
wcscpy(optionsfile, _wgetenv(L"APPDATA"));
if ((wcslen(optionsfile) + wcslen(L"\\RosBE\\rosbe-options.cmd")) <
MAX_PATH)
wcscat(optionsfile, L"\\RosBE\\rosbe-options.cmd");
-#if 0
pFile = _wfopen(optionsfile, L"r");
if (pFile)
{
+ res = (PVOID)fgets((char *)TTempLine, 24+MAX_PATH, pFile);
+ while (res)
+ {
+ MultiByteToWideChar(CP_ACP, 0, TTempLine, -1, WTempLine,
(25+MAX_PATH)*sizeof(WCHAR));
+ ptr = wcstok(WTempLine, L" ");
+ if (wcscmp(ptr, L"color") == 0)
+ {
+ ptr = wcstok(NULL, L" ");
+ LoadedSettings->background = strtoul((WCHAR*)&ptr[0], NULL, 16);
+ LoadedSettings->foreground = strtoul((WCHAR*)&ptr[1], NULL, 16);
+ }
+ else if (wcscmp(ptr, L"set") == 0)
+ {
+ ptr = wcstok(NULL, L" ");
+ ptr = wcstok(ptr, L"=");
+ ptr2 = wcstok(NULL, L"=");
+ if (wcscmp(ptr, L"_ROSBE_SHOWTIME") == 0)
+ {
+ LoadedSettings->showtime = strtoul(ptr2, NULL, 2);
+ }
+ else if (wcscmp(ptr, L"_ROSBE_USECCACHE") == 0)
+ {
+ LoadedSettings->useccache = strtoul(ptr2, NULL, 2);
+ }
+ else if (wcscmp(ptr, L"_ROSBE_STRIP") == 0)
+ {
+ LoadedSettings->strip = strtoul(ptr2, NULL, 2);
+ }
+ else if (wcscmp(ptr, L"_ROSBE_WRITELOG") == 0)
+ {
+ LoadedSettings->writelog = strtoul(ptr2, NULL, 2);
+ }
+ else if (wcscmp(ptr, L"_ROSBE_LOGDIR") == 0)
+ {
+ wcscpy(LoadedSettings->logdir, ptr2);
+ }
+ else if (wcscmp(ptr, L"_ROSBE_MINGWPATH") == 0)
+ {
+ wcscpy(LoadedSettings->mingwpath, ptr2);
+ }
+ else if (wcscmp(ptr, L"_ROSBE_OBJPATH") == 0)
+ {
+ wcscpy(LoadedSettings->objdir, ptr2);
+ }
+ else if (wcscmp(ptr, L"_ROSBE_OUTPATH") == 0)
+ {
+ wcscpy(LoadedSettings->outdir, ptr2);
+ }
+ }
+ res = (PVOID)fgets((char *)TTempLine, 24+MAX_PATH, pFile);
+ NbLines++;
+ }
fclose(pFile);
+ free(pFile);
}
else
{
-#endif
LoadedSettings->foreground = 0xa;
LoadedSettings->background = 0;
GetCurrentDirectory(MAX_PATH, LoadedSettings->mingwpath);
if ((wcslen(LoadedSettings->mingwpath) + wcslen(MINGWVERSION)) < MAX_PATH)
wcscat(LoadedSettings->mingwpath, MINGWVERSION);
-#if 0
- }
-#endif
+ }
SendDlgItemMessageW(hwnd, IDC_FONT, CB_SETCURSEL, LoadedSettings->foreground, 0);
SendDlgItemMessageW(hwnd, IDC_BACK, CB_SETCURSEL, LoadedSettings->background, 0);
+ SendDlgItemMessage(hwnd, ID_SHOWBUILDTIME, BM_SETCHECK, LoadedSettings->showtime,
0);
+ SendDlgItemMessage(hwnd, ID_SAVELOGS, BM_SETCHECK, LoadedSettings->writelog, 0);
+ SendDlgItemMessage(hwnd, ID_USECCACHE, BM_SETCHECK, LoadedSettings->useccache,
0);
+ SendDlgItemMessageW(hwnd, ID_STRIP, BM_SETCHECK, LoadedSettings->strip, 0);
SetDlgItemText(hwnd, ID_MGWDIR, LoadedSettings->mingwpath);
+ SetDlgItemText(hwnd, ID_LOGDIR, LoadedSettings->logdir);
+ SetDlgItemText(hwnd, ID_OBJDIR, LoadedSettings->objdir);
+ SetDlgItemText(hwnd, ID_OUTDIR, LoadedSettings->outdir);
}
VOID SetSaveState(HWND hwnd, PSETTINGS DefaultSettings)
Modified: trunk/tools/RosBE-Windows/Tools/config/todo.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/RosBE-Windows/Tools/config/t…
==============================================================================
--- trunk/tools/RosBE-Windows/Tools/config/todo.txt (original)
+++ trunk/tools/RosBE-Windows/Tools/config/todo.txt Sun Nov 4 23:29:50 2007
@@ -1,2 +1,2 @@
-ToDo:
-- Load old settings
+Empty :).
+Feel free to fill in it with your desire