[PATCH] winecfg => control panel applets patch

Vitaliy Margolen wine-devel at kievinfo.com
Thu Apr 10 09:42:41 CDT 2008


pure_evil at mail.bg wrote:
> Allows access to different winecfg tabs via control-panel applets (without 
> showing all of the cfg's tabs when accessed thusly)
>    
> +LONG APIENTRY EXECUTE_APPLET(HWND hwndCpl, UINT message, LPARAM lParam1, 
> LPARAM lParam2)
> +{
> +
> + int NumOfApplet = (int)lParam1;
> +
> + switch (NumOfApplet)
> + {
> +
> +  case 0:

You patch is wrapped. Also please for new files follow standard Wine codding 
style - 4 spaces indentation, no tabs.

> +    /*It would get messier with an or statement everywhere, so...*/
> +    BOOL Do_App = FALSE;
> +    BOOL Do_Lib = FALSE;
> +    BOOL Do_Graph = FALSE;
> +    BOOL Do_Desktop = FALSE;
> +    BOOL Do_Drives = FALSE;
> +    BOOL Do_Audio = FALSE;

> +    if (display_what_tabs == 2) { Do_Lib = TRUE; }
> +    if (display_what_tabs == 3) { Do_Graph = TRUE; }
> +    if (display_what_tabs == 4) { Do_Desktop = TRUE; }
> +    if (display_what_tabs == 5) { Do_Drives = TRUE; }
> +    if (display_what_tabs == 6) { Do_Audio = TRUE; }

> +   if ( lstrcmpi(CommandLine,"applications") == 0 ) display_what_tabs = 1;
> +   if ( lstrcmpi(CommandLine,"libraries") == 0 ) display_what_tabs = 2;
> +   if ( lstrcmpi(CommandLine,"graphics") == 0 ) display_what_tabs = 3;
> +   if ( lstrcmpi(CommandLine,"desktop") == 0 ) display_what_tabs = 4;
> +   if ( lstrcmpi(CommandLine,"drives") == 0 ) display_what_tabs = 5;
> +   if ( lstrcmpi(CommandLine,"audio") == 0 ) display_what_tabs = 6;


This is ugly and redundant. You should make it a bit-mask instead. However 
with all this you removing really big functionality from the winecfg - 
ability to set this on per application basis.

Vitaliy.



More information about the wine-devel mailing list