1: /*
     2:  ============================================================================
     3:  xoblite™ -> an advanced "extended shell" for Microsoft® Windows® 11
     4:  Copyright © 2002-2026 Karl Henrik Henriksson [qwilk/@xoblite]
     5:  Copyright © 2001-2004 The Blackbox for Windows Development Team
     6:  http://xoblite.net/ + https://github.com/xoblite/
     7:  ============================================================================
     8: 
     9:   Blackbox for Windows is free software, released under the
    10:   GNU General Public License (GPL version 2 or later), with an extension
    11:   that allows linking of proprietary modules under a controlled interface.
    12:   What this means is that plugins etc. are allowed to be released
    13:   under any license the author wishes. Please note, however, that the
    14:   original Blackbox gradient math code used in Blackbox for Windows
    15:   is available under the BSD license.
    16: 
    17:   http://www.fsf.org/licenses/gpl.html
    18:   http://www.fsf.org/licenses/gpl-faq.html#LinkingOverControlledInterface
    19:   http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5
    20: 
    21:   This program is distributed in the hope that it will be useful,
    22:   but WITHOUT ANY WARRANTY; without even the implied warranty of
    23:   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    24:   GNU General Public License for more details.
    25: 
    26:   For additional license information, please read the included license.html.
    27: 
    28:  ============================================================================
    29: */
    30: 
    31: #include "ConfigMenu.h" 
    32: #include "..\Menu\MenuCommon.h" 
    33: 
    34: #include "..\Settings\Settings.h" 
    35: 
    36: #include "..\Console\ConsoleMenu.h" 
    37: #include "..\Desktop\DesktopMenu.h" 
    38: #include "..\Dock\DockMenu.h" 
    39: #include "..\Hotkeys\HotkeysMenu.h" 
    40: #include "..\Plugins\PluginsMenu.h" 
    41: #include "..\Toolbar\ToolbarMenu.h" 
    42: #include "..\Workspaces\WorkspacesMenu.h" 
    43: 
    44: extern MenuCommon *pMenuCommon;
    45: extern Settings *pSettings;
    46: 
    47: #define GROUP_DESKTOP_CLOCK 1 
    48: 
    49: //===========================================================================
    50: 
    51: ConfigMenu::ConfigMenu(LPCSTR pszTitle) : Menu(pMenuCommon->hInst)
    52: {
    53:     m_pszTitle = pszTitle ? _strdup(pszTitle) : _strdup("");
    54:     UpdateFolder();
    55: }
    56: 
    57: ConfigMenu::~ConfigMenu()
    58: {
    59:     if (m_pszTitle) free(m_pszTitle);
    60:     m_pszTitle = NULL;
    61: }
    62: 
    63: //====================
    64: 
    65: void ConfigMenu::OnShow(bool fShow)
    66: {
    67:     if (fShow) UpdateFolder();
    68: }
    69: 
    70: //====================
    71: 
    72: void ConfigMenu::UpdateFolder()
    73: {
    74:     DeleteMenuItems();
    75:     pMenuCommon->AddHeaderItem(this, m_pszTitle);
    76:     MenuItem* pMenuItem;
    77: 
    78:     //====================
    79: 
    80:     // The "Configuration" menu serves as a container for all the element submenus...
    81: 
    82:     //====================
    83: 
    84:     Menu* designSubMenu = MakeMenu("Design");
    85: 
    86: //  Menu* designChildMenu = MakeMenu("Themes");
    87: //  pMenuCommon->InsertFolder(designChildMenu, pSettings->themesFolder, FOLDER_THEMES, false);
    88: //  MakeSubmenu(designSubMenu, designChildMenu, "Themes");
    89:     pMenuItem = new SpecialFolder("Themes", NULL, pSettings->themesFolder, FOLDER_THEMES);
    90:     pMenuItem->SetHeight(pMenuCommon->m_nSubmenuHeight);
    91:     designSubMenu->AddMenuItem(pMenuItem);
    92: 
    93: //  designChildMenu = MakeMenu("Styles");
    94: //  pMenuCommon->InsertFolder(designChildMenu, pSettings->stylesFolder, FOLDER_STYLES, true);
    95: //  MakeSubmenu(designSubMenu, designChildMenu, "Styles");
    96:     pMenuItem = new SpecialFolder("Styles", NULL, pSettings->stylesFolder, FOLDER_STYLES);
    97:     pMenuItem->SetHeight(pMenuCommon->m_nSubmenuHeight);
    98:     designSubMenu->AddMenuItem(pMenuItem);
    99: 
   100: //  designChildMenu = MakeMenu("Wallpapers");
   101: //  pMenuCommon->InsertFolder(designChildMenu, pSettings->wallpapersFolder, FOLDER_PATH, false);
   102: //  MakeSubmenu(designSubMenu, designChildMenu, "Wallpapers");
   103:     pMenuItem = new SpecialFolder("Wallpapers", NULL, pSettings->wallpapersFolder, FOLDER_PATH);
   104:     pMenuItem->SetHeight(pMenuCommon->m_nSubmenuHeight);
   105:     designSubMenu->AddMenuItem(pMenuItem);
   106: 
   107:     pMenuCommon->CreateMenuItem(designSubMenu, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   108:     pMenuCommon->CreateMenuItem(designSubMenu, MENUITEM_COMMAND, "@xoblite Random Style", NULL, "Random style...", false);
   109:     pMenuCommon->CreateMenuItem(designSubMenu, MENUITEM_COMMAND, "@xoblite Random Wallpaper", NULL, "Random wallpaper...", false);
   110: 
   111:     pMenuCommon->CreateMenuItem(designSubMenu, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   112:     pMenuCommon->CreateMenuItem(designSubMenu, MENUITEM_COMMAND, "@xoblite Edit", pSettings->styleFile, "Edit current style", false);
   113:     pMenuCommon->CreateMenuItem(designSubMenu, MENUITEM_COMMAND, "@xoblite About Style", NULL, "About current style...", false);
   114: 
   115:     pMenuCommon->CreateMenuItem(designSubMenu, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   116:     pMenuItem = new SpecialFolder("Current theme folder", NULL, pSettings->SF_currentThemePath, FOLDER_PATH);
   117:     pMenuItem->SetHeight(pMenuCommon->m_nSubmenuHeight);
   118:     designSubMenu->AddMenuItem(pMenuItem);
   119:     pMenuItem = new SpecialFolder("Default theme folder", NULL, pSettings->SF_blackboxPath, FOLDER_PATH);
   120:     pMenuItem->SetHeight(pMenuCommon->m_nSubmenuHeight);
   121:     designSubMenu->AddMenuItem(pMenuItem);
   122: 
   123:     MakeSubmenu(this, designSubMenu, "Design");
   124: 
   125:     pMenuCommon->CreateMenuItem(this, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   126: 
   127:     //====================
   128: 
   129:     pMenuItem = new MenuConfig("Menu");
   130:     pMenuItem->SetHeight(pMenuCommon->m_nSubmenuHeight);
   131:     AddMenuItem(pMenuItem);
   132: 
   133:     pMenuItem = new ToolbarMenu("Toolbar");
   134:     pMenuItem->SetHeight(pMenuCommon->m_nSubmenuHeight);
   135:     AddMenuItem(pMenuItem);
   136: 
   137:     pMenuItem = new DockMenu("Dock");
   138:     pMenuItem->SetHeight(pMenuCommon->m_nSubmenuHeight);
   139:     AddMenuItem(pMenuItem);
   140: 
   141:     pMenuItem = new ConsoleMenu("Console");
   142:     pMenuItem->SetHeight(pMenuCommon->m_nSubmenuHeight);
   143:     AddMenuItem(pMenuItem);
   144: 
   145:     pMenuItem = new DesktopMenu("Desktop");
   146:     pMenuItem->SetHeight(pMenuCommon->m_nSubmenuHeight);
   147:     AddMenuItem(pMenuItem);
   148: /*
   149:     // Note: No window commands are currently applicable for the menu
   150:     // (cf. e.g. opening the menu stealing the focus from any previously focused window!),
   151:     // only as hotkey'ed bro@ms, so this was put here only as a possible future reminder... ;)
   152:     Menu* windowSubMenu = MakeMenu("Window");
   153:     pMenuCommon->CreateMenuItem(windowSubMenu, MENUITEM_COMMAND, "@xoblite Window xxxxxxxx", NULL, "xxxxxxxx", false);
   154:     MakeSubmenu(this, windowSubMenu, "Window");
   155: */
   156:     pMenuCommon->CreateMenuItem(this, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   157: 
   158:     //====================
   159: 
   160:     pMenuItem = new HotkeysMenu("Hotkeys");
   161:     pMenuItem->SetHeight(pMenuCommon->m_nSubmenuHeight);
   162:     AddMenuItem(pMenuItem);
   163: 
   164:     pMenuItem = new FolderItem(new WorkspacesMenu("Workspaces"), "Workspaces", NULL);
   165:     pMenuItem->SetHeight(pMenuCommon->m_nSubmenuHeight);
   166:     AddMenuItem(pMenuItem);
   167: 
   168:     PluginMenu *PlugMenu = new PluginMenu("Plugins");
   169:     PlugMenu->SetHeight(pMenuCommon->m_nSubmenuHeight);
   170:     AddMenuItem(PlugMenu);
   171: 
   172:     pMenuCommon->CreateMenuItem(this, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   173: 
   174:     //====================
   175: 
   176:     pMenuItem = new GlobalConfig("Global");
   177:     pMenuItem->SetHeight(pMenuCommon->m_nSubmenuHeight);
   178:     AddMenuItem(pMenuItem);
   179: 
   180:     pMenuCommon->CreateMenuItem(this, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   181: 
   182:     //====================
   183: 
   184:     pMenuCommon->CreateMenuItem(this, MENUITEM_COMMAND, "@xoblite Reconfigure", NULL, "Reconfigure", false);
   185:     pMenuCommon->CreateMenuItem(this, MENUITEM_COMMAND, "@xoblite Restart", NULL, "Restart", false);
   186:     pMenuCommon->CreateMenuItem(this, MENUITEM_COMMAND, "@xoblite Quit", NULL, "Quit", false);
   187: 
   188:     pMenuCommon->CreateMenuItem(this, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   189: 
   190:     Menu* shutdownSubMenu = MakeMenu("Session");
   191:     pMenuCommon->CreateMenuItem(shutdownSubMenu, MENUITEM_COMMAND, "[lockworkstation]", NULL, "Lock workstation", false);
   192:     pMenuCommon->CreateMenuItem(shutdownSubMenu, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   193:     pMenuCommon->CreateMenuItem(shutdownSubMenu, MENUITEM_COMMAND, "[standby]", NULL, "Standby [sleep]", false);
   194:     pMenuCommon->CreateMenuItem(shutdownSubMenu, MENUITEM_COMMAND, "[hibernate]", NULL, "Hibernate [suspend]", false);
   195:     pMenuCommon->CreateMenuItem(shutdownSubMenu, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   196:     pMenuCommon->CreateMenuItem(shutdownSubMenu, MENUITEM_COMMAND, "[logoff]", NULL, "Log off", false);
   197:     pMenuCommon->CreateMenuItem(shutdownSubMenu, MENUITEM_COMMAND, "[reboot]", NULL, "Restart [reboot]", false);
   198:     pMenuCommon->CreateMenuItem(shutdownSubMenu, MENUITEM_COMMAND, "[shutdown]", NULL, "Shutdown", false);
   199:     MakeSubmenu(this, shutdownSubMenu, "Session");
   200: 
   201:     pMenuCommon->CreateMenuItem(this, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   202: 
   203:     pMenuCommon->CreateMenuItem(this, MENUITEM_COMMAND, "@xoblite Edit", pSettings->xobrcFile, "Edit xoblite.rc", false);
   204: 
   205:     pMenuCommon->CreateMenuItem(this, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   206: 
   207:     pMenuCommon->CreateMenuItem(this, MENUITEM_COMMAND, "@xoblite About", NULL, "About xoblite...", false);
   208: 
   209:     //====================
   210: /*
   211:     // Extract currently running xoblite version...
   212:     // (make sure the correct version encoding is used, currently "000004b0" = language neutral)
   213:     ULONG* size = 0;
   214:     void* versionPtr;
   215:     UINT bytes;
   216:     DWORD number = GetFileVersionInfoSize("Blackbox.exe", size);
   217:     char temp[MAX_LINE_LENGTH];
   218:     GetFileVersionInfo("Blackbox.exe", NULL, number, (LPVOID)temp);
   219:     VerQueryValue(temp, TEXT("\\StringFileInfo\\000004b0\\FileVersion"), &versionPtr, &bytes);
   220:     strcpy_s(temp, sizeofArray(temp), (LPCSTR)versionPtr);
   221:     if ((temp[strnlen_s(temp, sizeofArray(temp))-1] == '\n') || (temp[strnlen_s(temp, sizeofArray(temp))-1] == '\r')) temp[strnlen_s(temp, sizeofArray(temp))-1] = '\0'; // Failsafe
   222:     pMenuCommon->AddFooterItem(this, temp);
   223: */
   224:     char version[255];
   225:     strcpy_s(version, sizeofArray(version), "xoblite ");
   226:     strcat_s(version, sizeofArray(version), (LPSTR)GetBBVersion());
   227:     pMenuCommon->AddFooterItem(this, version);
   228: 
   229:     Invalidate();
   230:     Validate();
   231: }
   232: 
   233: //===========================================================================
   234: 
   235: MenuConfig::MenuConfig(char* pszTitle) : FolderItem(NULL, pszTitle, NULL)
   236: {
   237: }
   238: 
   239: MenuConfig::~MenuConfig()
   240: {
   241:     m_pParent->RemoveChild(m_pSubMenu);
   242:     if (m_pSubMenu) delete m_pSubMenu;
   243:     m_pSubMenu = NULL;
   244: }
   245: 
   246: //====================
   247: 
   248: bool MenuConfig::Active(bool bActivate)
   249: {
   250:     if (bActivate && !m_bActive) UpdateFolder();
   251:     return FolderItem::Active(bActivate);
   252: }
   253: 
   254: void MenuConfig::Attached(Menu* pMenu)
   255: {
   256:     m_pParent = pMenu;
   257:     m_pSubMenu = new Menu(pMenuCommon->hInst);
   258:     m_pParent->AddChild(m_pSubMenu);
   259:     m_pSubMenu->SetParent(m_pParent);
   260: }
   261: 
   262: //====================
   263: 
   264: void MenuConfig::UpdateFolder()
   265: {
   266:     m_pSubMenu->DeleteMenuItems();
   267:     pMenuCommon->AddHeaderItem(m_pSubMenu, m_pszTitleANSI);
   268: 
   269:     //====================
   270: 
   271:     Menu* transparencySubMenu = MakeMenu("Transparency");
   272: 
   273:     char command[128];
   274:     sprintf_s(command, sizeofArray(command), "\"@xoblite Menu Transparency\" %d 1 255", pSettings->menuTransparencyAlpha);
   275:     pMenuCommon->CreateMenuItem(transparencySubMenu, MENUITEM_EDITINT, command, NULL, "Menu:", false);
   276:     sprintf_s(command, sizeofArray(command), "\"@xoblite Menu Transparency Title\" %d 1 255", pSettings->menuTitleTransparencyAlpha);
   277:     pMenuCommon->CreateMenuItem(transparencySubMenu, MENUITEM_EDITINT, command, NULL, "Title:", false);
   278:     sprintf_s(command, sizeofArray(command), "\"@xoblite Menu Transparency Frame\" %d 1 255", pSettings->menuFrameTransparencyAlpha);
   279:     pMenuCommon->CreateMenuItem(transparencySubMenu, MENUITEM_EDITINT, command, NULL, "Frame:", false);
   280:     sprintf_s(command, sizeofArray(command), "\"@xoblite Menu Transparency Active\" %d 1 255", pSettings->menuActiveTransparencyAlpha);
   281:     pMenuCommon->CreateMenuItem(transparencySubMenu, MENUITEM_EDITINT, command, NULL, "Active:", false);
   282:     sprintf_s(command, sizeofArray(command), "\"@xoblite Menu Transparency Grip\" %d 1 255", pSettings->menuGripTransparencyAlpha);
   283:     pMenuCommon->CreateMenuItem(transparencySubMenu, MENUITEM_EDITINT, command, NULL, "Grip:", false);
   284: 
   285:     MakeSubmenu(m_pSubMenu, transparencySubMenu, "Transparency");
   286: 
   287:     //====================
   288: 
   289:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   290: 
   291:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_BOOLEAN, "@xoblite Menu ToggleRoundedCorners", NULL, "Rounded corners", pSettings->menuRoundedCorners);
   292:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_BOOLEAN, "@xoblite Menu ToggleSeparators", NULL, "Hide separators", !pSettings->menuSeparators);
   293: 
   294:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   295: 
   296:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_COMMAND, "@xoblite Edit", pSettings->menuFile, "Edit menu.rc", false);
   297: 
   298:     //====================
   299: 
   300:     pMenuCommon->AddFooterItem(m_pSubMenu, "");
   301: 
   302:     m_pSubMenu->Invalidate();
   303:     m_pSubMenu->Validate();
   304: }
   305: 
   306: //===========================================================================
   307: 
   308: GlobalConfig::GlobalConfig(char* pszTitle) : FolderItem(NULL, pszTitle, NULL)
   309: {
   310: }
   311: 
   312: GlobalConfig::~GlobalConfig()
   313: {
   314:     m_pParent->RemoveChild(m_pSubMenu);
   315:     if (m_pSubMenu) delete m_pSubMenu;
   316:     m_pSubMenu = NULL;
   317: }
   318: 
   319: //====================
   320: 
   321: bool GlobalConfig::Active(bool bActivate)
   322: {
   323:     if (bActivate && !m_bActive) UpdateFolder();
   324:     return FolderItem::Active(bActivate);
   325: }
   326: 
   327: void GlobalConfig::Attached(Menu* pMenu)
   328: {
   329:     m_pParent = pMenu;
   330:     m_pSubMenu = new Menu(pMenuCommon->hInst);
   331:     m_pParent->AddChild(m_pSubMenu);
   332:     m_pSubMenu->SetParent(m_pParent);
   333: }
   334: 
   335: //====================
   336: 
   337: void GlobalConfig::UpdateFolder()
   338: {
   339:     m_pSubMenu->DeleteMenuItems();
   340:     pMenuCommon->AddHeaderItem(m_pSubMenu, m_pszTitleANSI);
   341: 
   342:     //====================
   343: /*
   344:     Menu* windowHandlingSubMenu = MakeMenu("Window handling");
   345: 
   346:     Menu* focusModelSubMenu = MakeMenu("Window focus model");
   347:     pMenuCommon->CreateMenuItem(focusModelSubMenu, MENUITEM_COMMAND, "<config_menu_item>", "ClickToFocus", "Click to focus", (!_stricmp(pSettings->focusModel, "ClickToFocus")) ? true : false);
   348:     pMenuCommon->CreateMenuItem(focusModelSubMenu, MENUITEM_COMMAND, "<config_menu_item>", "SloppyFocus", "Sloppy focus", (!_stricmp(pSettings->focusModel, "SloppyFocus")) ? true : false);
   349:     pMenuCommon->CreateMenuItem(focusModelSubMenu, MENUITEM_COMMAND, "<config_menu_item>", "AutoRaiseSloppyFocus", "Auto raise", (!_stricmp(pSettings->focusModel, "AutoRaiseSloppyFocus")) ? true : false);
   350:     MakeSubmenu(windowHandlingSubMenu, focusModelSubMenu, "Window focus model");
   351: 
   352:     pMenuCommon->CreateMenuItem(windowHandlingSubMenu, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   353: 
   354:     //  pMenuCommon->CreateMenuItem(windowHandlingSubMenu, MENUITEM_COMMAND, "@xoblite Global", "FocusNewWindows", "Focus new windows", pSettings->focusNewWindows);
   355:     //  pMenuCommon->CreateMenuItem(windowHandlingSubMenu, MENUITEM_COMMAND, "@xoblite Global", "FocusLastWindow", "Focus window on workspace change", pSettings->focusLastWindow);
   356:     pMenuCommon->CreateMenuItem(windowHandlingSubMenu, MENUITEM_BOOLEAN, "@xoblite Global", "OpaqueWindowMoving", "Opaque window moving", pSettings->opaqueMove);
   357: //  pMenuCommon->CreateMenuItem(windowHandlingSubMenu, MENUITEM_BOOLEAN, "@xoblite Global", "FullMaximization", "Full maximization", pSettings->fullMaximization);
   358:     //  pMenuCommon->CreateMenuItem(windowHandlingSubMenu, MENUITEM_BOOLEAN, "@xoblite Global", "ToggleFollowActive", "Follow active task", pSettings->followActive);
   359: 
   360:     MakeSubmenu(m_pSubMenu, windowHandlingSubMenu, "Window handling");
   361: 
   362:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   363: */
   364:     //====================
   365: 
   366:     char command[128];
   367:     sprintf_s(command, sizeofArray(command), "\"@xoblite Global HiDPI\" %d 1 4", pSettings->scalingFactorHiDPI);
   368:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_EDITINT, command, NULL, "HiDPI scaling factor:", false);
   369:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_BOOLEAN, "@xoblite Global ToggleMultiMonitorPlacements", NULL, "Multi-monitor placements", pSettings->multimonPlacements);
   370:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_BOOLEAN, "@xoblite Global ToggleFullscreenDetection", NULL, "Fullscreen detection", pSettings->fullscreenDetection);
   371:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_BOOLEAN, "@xoblite Global ToggleSoundFX", NULL, "Enable sound effects", pSettings->enableSoundFX);
   372: 
   373:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   374: 
   375:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_BOOLEAN, "@xoblite Global ToggleDesignerMode", NULL, "Enable Designer mode", pSettings->designerModeEnabled);
   376: 
   377:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   378: 
   379:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_BOOLEAN, "@xoblite ToggleWriteProtection", NULL, "Write protection", pSettings->writeProtection);
   380:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_BOOLEAN, "@xoblite Global ToggleRootCommands", NULL, "Disable rootCommands", pSettings->disableRootCommands);
   381:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_BOOLEAN, "@xoblite Global ToggleThemeFonts", NULL, "Disable theme fonts", pSettings->disableThemeFonts);
   382:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_BOOLEAN, "@xoblite Global ToggleScriptSupport", NULL, "Disable @Script support", pSettings->disableScriptSupport);
   383: 
   384:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   385: 
   386:     Menu* editorSubMenu = MakeMenu("Preferred editor");
   387:     pMenuCommon->CreateMenuItem(editorSubMenu, MENUITEM_EDITSTRING, "@xoblite Global SetEditor", pSettings->preferredEditor, pSettings->preferredEditor, false);
   388:     MakeSubmenu(m_pSubMenu, editorSubMenu, "Preferred editor");
   389: 
   390:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   391:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_COMMAND, "@xoblite Run", NULL, "@xoblite Run...", false);
   392:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_COMMAND, "@xoblite CheckForUpdates", NULL, "Check for updates...", false);
   393:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_COMMAND, "[exec]", "http://xoblite.net/shell/", "Online documentation...", false);
   394:     pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_COMMAND, "@xoblite Edit", "$Blackbox$\\xoblite.log", "Open xoblite.log", false);
   395: 
   396:     if (pSettings->underExplorer)
   397:     {
   398: //      if (pSettings->explorerHidden)
   399:         {
   400:             pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   401:             pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_BOOLEAN, "@xoblite EmptyRecycleBin", NULL, "Empty Recycle Bin...", false);
   402:         }
   403: 
   404:         pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_SEPARATOR, NULL, NULL, NULL, false);
   405:         pMenuCommon->CreateMenuItem(m_pSubMenu, MENUITEM_BOOLEAN, "@xoblite ToggleExplorer", NULL, "Hide Explorer taskbar", pSettings->explorerHidden);
   406:     }
   407: 
   408:     //====================
   409: 
   410:     pMenuCommon->AddFooterItem(m_pSubMenu, "");
   411: 
   412:     m_pSubMenu->Invalidate();
   413:     m_pSubMenu->Validate();
   414: }
   415: 
   416: //===========================================================================
   417: