Hi all, this cleanup patch is the result from some debugging work to find out why settings saving didn't work. Turned out that "Default" != "Properties" ;-) (shouldn't we make "Default" really be "Save as default" and then save the last "Properties" configuration once you select "Save as default" ? Much better IMHO.) - fix some spelling problems - move WCUSER_SetMenuDetails to other menu related functions -- Andreas Mohr Stauferstr. 6, D-71272 Renningen, Germany
Determining best CVS host... Using CVSROOT :pserver:cvs@rhlx01.fht-esslingen.de:/home/wine ? programs/wineconsole/wineconsole_De.rc.sic Index: programs/wineconsole/dialog.c =================================================================== RCS file: /home/wine/wine/programs/wineconsole/dialog.c,v retrieving revision 1.10 diff -u -r1.10 dialog.c --- programs/wineconsole/dialog.c 31 May 2002 23:40:59 -0000 1.10 +++ programs/wineconsole/dialog.c 22 Jul 2002 20:54:38 -0000 @@ -528,7 +528,7 @@ if (!hFont) return FALSE; if (config.cell_height != di->font[size_idx].height) - WINE_TRACE("select_font: mismatched heights (%u<>%u)\n", + WINE_TRACE("mismatched heights (%u<>%u)\n", config.cell_height, di->font[size_idx].height); hOldFont = (HFONT)SendDlgItemMessage(di->hDlg, IDC_FNT_PREVIEW, WM_GETFONT, 0L, 0L); @@ -747,7 +747,7 @@ /****************************************************************** * WCUSER_GetProperties * - * Runs the dialog box to set up the winconsole options + * Runs the dialog box to set up the wineconsole options */ BOOL WCUSER_GetProperties(struct inner_data* data, BOOL current) { Index: programs/wineconsole/registry.c =================================================================== RCS file: /home/wine/wine/programs/wineconsole/registry.c,v retrieving revision 1.7 diff -u -r1.7 registry.c --- programs/wineconsole/registry.c 31 May 2002 23:40:59 -0000 1.7 +++ programs/wineconsole/registry.c 22 Jul 2002 20:54:38 -0000 @@ -53,6 +53,7 @@ DWORD count; DWORD val; + WINE_TRACE("loading registry settings.\n"); if (RegOpenKey(HKEY_CURRENT_USER, wszConsole, &hConKey)) hConKey = 0; count = sizeof(val); @@ -133,6 +134,7 @@ HKEY hConKey; DWORD val; + WINE_TRACE("saving registry settings.\n"); if (RegCreateKey(HKEY_CURRENT_USER, wszConsole, &hConKey)) { WINE_ERR("Can't open registry for saving\n"); Index: programs/wineconsole/user.c =================================================================== RCS file: /home/wine/wine/programs/wineconsole/user.c,v retrieving revision 1.14 diff -u -r1.14 user.c --- programs/wineconsole/user.c 2 Jul 2002 02:14:08 -0000 1.14 +++ programs/wineconsole/user.c 22 Jul 2002 20:54:39 -0000 @@ -82,8 +82,8 @@ /****************************************************************** * WCUSER_NewBitmap * - * Either the font geometry or the sb geometry has changed. we need to recreate the - * bitmap geometry + * Either the font geometry or the sb geometry has changed. we need + * to recreate the bitmap geometry. */ static void WCUSER_NewBitmap(struct inner_data* data, BOOL fill) { @@ -149,7 +149,7 @@ PRIVATE(data)->cursor_bitmap = (HBITMAP)0; if (size != 100) { - int w16b; /* number of byets per row, aligned on word size */ + int w16b; /* number of bytes per row, aligned on word size */ BYTE* ptr; int i, j, nbl; @@ -193,7 +193,7 @@ } /****************************************************************** - * INECON_ComputePositions + * WCUSER_ComputePositions * * Recomputes all the components (mainly scroll bars) positions */ @@ -298,7 +298,7 @@ } /****************************************************************** - * FontEqual + * WCUSER_AreFontsEqual * * */ @@ -401,7 +401,7 @@ } /****************************************************************** - * CopyFont + * WCUSER_CopyFont * * get the relevant information from the font described in lf and store them * in config @@ -422,15 +422,15 @@ /* FIXME: * the current freetype engine (at least 2.0.x with x <= 8) and its implementation * in Wine don't return adequate values for fixed fonts - * In Windows, those fonts are expectes to return the same value for + * In Windows, those fonts are expected to return the same value for * - the average width * - the largest width * - the width of all characters in the font - * This isn't true in Wine. As a temporary workaound, we get as the width of the + * This isn't true in Wine. As a temporary workaround, we get as the width of the * cell, the width of the first character in the font, after checking that all * characters in the font have the same width (I hear parano�a coming) - * when this gets fixed, the should be using tm.tmAveCharWidth or tm.tmMaxCharWidth - * as the cell width. + * when this gets fixed, the code should be using tm.tmAveCharWidth + * or tm.tmMaxCharWidth as the cell width. */ GetCharWidth32(hDC, tm.tmFirstChar, tm.tmFirstChar, &w); for (i = tm.tmFirstChar + 1; i <= tm.tmLastChar; i += sizeof(buf) / sizeof(buf[0])) @@ -557,7 +557,7 @@ /****************************************************************** * WCUSER_GetCell * - * Get a cell from the a relative coordinate in window (takes into + * Get a cell from a relative coordinate in window (takes into * account the scrolling) */ static COORD WCUSER_GetCell(const struct inner_data* data, LPARAM lParam) @@ -723,7 +723,7 @@ } /****************************************************************** - * Refresh + * WCUSER_Refresh * * */ @@ -827,6 +827,24 @@ } /****************************************************************** + * WCUSER_SetMenuDetails + * + * Grays / ungrays the menu items according to their state + */ +static void WCUSER_SetMenuDetails(const struct inner_data* data, HMENU hMenu) +{ + if (!hMenu) {WINE_ERR("Issue in getting menu bits\n");return;} + + EnableMenuItem(hMenu, IDS_COPY, + MF_BYCOMMAND|(PRIVATE(data)->has_selection ? MF_ENABLED : MF_GRAYED)); + EnableMenuItem(hMenu, IDS_PASTE, + MF_BYCOMMAND|(IsClipboardFormatAvailable(CF_UNICODETEXT) + ? MF_ENABLED : MF_GRAYED)); + EnableMenuItem(hMenu, IDS_SCROLL, MF_BYCOMMAND|MF_GRAYED); + EnableMenuItem(hMenu, IDS_SEARCH, MF_BYCOMMAND|MF_GRAYED); +} + +/****************************************************************** * WCUSER_Create * * Creates the window for the rendering @@ -855,24 +873,6 @@ data->curcfg.quick_edit = FALSE; return 0; -} - -/****************************************************************** - * WCUSER_SetMenuDetails - * - * Grays / ungrays the menu items according to their state - */ -static void WCUSER_SetMenuDetails(const struct inner_data* data, HMENU hMenu) -{ - if (!hMenu) {WINE_ERR("Issue in getting menu bits\n");return;} - - EnableMenuItem(hMenu, IDS_COPY, - MF_BYCOMMAND|(PRIVATE(data)->has_selection ? MF_ENABLED : MF_GRAYED)); - EnableMenuItem(hMenu, IDS_PASTE, - MF_BYCOMMAND|(IsClipboardFormatAvailable(CF_UNICODETEXT) - ? MF_ENABLED : MF_GRAYED)); - EnableMenuItem(hMenu, IDS_SCROLL, MF_BYCOMMAND|MF_GRAYED); - EnableMenuItem(hMenu, IDS_SEARCH, MF_BYCOMMAND|MF_GRAYED); } /******************************************************************