/* ####################### */ /* ### Session Manager ### */ /* ####################### */ /* */ /* by FluxTorpedoe */ /* */ /* ----------------------- */ /* Use/Modify freely */ /* ----------------------- */ // Button: Session Manager [Ctrl: Switch - Shift: QuickSave - Alt: Reset - Ctrl+Alt: Reset Layout] /* version 6.60 - 2020-06-02 */ /* initial 0.# ~ 2012-01-01 */ // v6.60 +++ Options > AutoUpdate All: every session can now be updated automatically on session change // Note: To discard any changes made to the current session, just Reset it before loading a new one // Note: Using this option disables the ability to Autosave temporary version of specific session // + Performance improvements (even more noticeable when clicking on toolbar button) // * Options > AutoUpdate Single: Previously Enable Autosave/Reset of Temporary Version of session // This option now uses an ON/OFF checkbox, and disabling it now opens a confirmation dialog // Note: Using this option disables the ability to AutoUpdate all sessions // * Options > Save Temporary Session is now disabled if no session exists // ! Toolbar icon was changed (then not reset) when saving Temporary Session if no other icon used // ! Leading spaces now always removed when saving new session (even with layout) // v6.51 ! Changing icon of current session would not refresh toolbar button /* ######################################################################################### */ /* ############################ FluxTorpedoe's (ir)Rationale ############################# */ /* ######################################################################################### */ // $Var = local variable; // $CAP_Var = global variable; // $FULLCAPVAR = permanent variable; // $*... = any string; $*d_... = delta string (to be added); $*b_... = binary value; $*l_... = list; $*n_... = number; $*a_...= array; // - - - // e.g. $PRE_Item = (Predefined) Item Name; $b_Item = Item exists (or not); $l_Items = List of items; $n_Items = Number of items; // ----------------------------------------------------------------------------------------- */ "_Initialize" // ------------------<> Language file $SM_LANGUAGE_FILE = gettoken(listfolder(self("path"), self("base").".??"), 1, "|"); perm $SM_LANGUAGE_FILE = ($SM_LANGUAGE_FILE)? $SM_LANGUAGE_FILE : self("file"); // TRANSLATORS: Append the content of "SessionManager.en" at the end of your local language file and remove "//" below // perm $SM_LANGUAGE_FILE = "\Language+SM.lng"; /* ######################################################################################### */ /* ######################################################################################### */ // global $Clock_1; // Timer initialize (to help speed optimization) // $Clock_1 = now("ssfff"); global $GEN_SMVersion; $GEN_SMVersion = "6.60"; // ------------------<> Version compatibility check $minver = "19.90.0106"; end ( < $minver), " ".i(1,01)." $GEN_SMVersion ".i(1,03)." ".i(1,02)." $minver --------------------------- ".i(1,04)." XYplorer < $minver => Session Manager v6.0 XYplorer < v17.50.0211 => Session Manager v4.7 XYplorer < v15.00.0518 => Session Manager v3.7 ".i(1,05)." "; // ------------------<> INI file initialization global $GEN_CurScript, $GEN_Ini; $GEN_CurScript = self("file"); $IniName = self("base").".ini"; $GEN_Ini = self("path")."\".$IniName; // ------------------<> Use alternate INI if exists("\[User]\$IniName") { $GEN_Ini = "\[User]\$IniName"; } // ------------------<> On first run, if XY not optimized, propose to update/tweak if !exists("$GEN_Ini") { if !getkey("TabsetsNoPaneActivation", "Settings") { load "$GEN_CurScript", "_Options-Tweak"; }} // --------------------------------------------------------->> INI // Create INI file on first run, or rebuild default INI file if it has been damaged global $DYN_InpSessLay; if !getkey("", "General", $GEN_Ini){ setkey 0, "Reserved", "General", $GEN_Ini; } // ---------------------------------------------> Save default settings if !getkey("", "Settings", $GEN_Ini){ setkey 1, "EnableLayouts", "Settings", $GEN_Ini; setkey 0, "UseIcons", "Settings", $GEN_Ini; // ------------------<> setkey 0, "AutoUpdateAll", "Settings", $GEN_Ini; setkey 1, "AutoSave", "Settings", $GEN_Ini; // ------------------<> setkey 0, "AutoOptimizeTree", "Settings", $GEN_Ini; setkey 0, "Xtras", "Settings", $GEN_Ini; // ------------------<> setkey 1, "LayWinPosSize", "Settings", $GEN_Ini; setkey 0, "LayCatalog", "Settings", $GEN_Ini; setkey 1, "LayInfoPanelPreview", "Settings", $GEN_Ini; setkey 0, "LayFallbackDef", "Settings", $GEN_Ini; setkey 0, "StdResetWithLay", "Settings", $GEN_Ini; // ------------------<> setkey 0, "Confirmation", "Settings", $GEN_Ini; setkey 0, "SessionListOnTop", "Settings", $GEN_Ini; setkey 1, "Separator", "Settings", $GEN_Ini; } // ---------------------------------------------< // ---------------------------------------------> Save default layout (if none) if !getkey("", "Layout ¦‡¦-Default-¦‡¦", $GEN_Ini){ $DYN_InpSessLay = "¦‡¦-Default-¦‡¦"; load "$GEN_CurScript", "_Layout-Save"; setkey toolbar(), "XTRA-Toolbar", "Layout ¦‡¦-Default-¦‡¦", $GEN_Ini; } // ---------------------------------------------< // ---------------------------------------------> Save last layout (if none) if !getkey("", "Layout ¦‡¦-Last-¦‡¦", $GEN_Ini){ $DYN_InpSessLay = "¦‡¦-Last-¦‡¦"; load "$GEN_CurScript", "_Layout-Save"; setkey toolbar(), "XTRA-Toolbar", "Layout ¦‡¦-Last-¦‡¦", $GEN_Ini; } // ---------------------------------------------< // ---------------------------------------------> Save default mouse modifiers (if none) and update toolbar button if !getkey("", "MouseModifiers", $GEN_Ini) { perm $SM_CTBINDEX = -1; } // ---------------------------------------------< // General - RESERVED (not needed anymore, maybe later...) // global $GEN_###; // $GEN_### = getkey("Reserved", "General", $GEN_Ini); // ---------------------------------------------------------<< / INI // ---------------------------------------------> Toolbar icon $ctb_set = ($SM_CTBINDEX > 0)? (ctbname(, $SM_CTBINDEX) LikeI "*Session Manager*") : 0; if !$ctb_set { // If button name and (stored) index don't match $ctbindex = get("Trigger", "ctbindex"); // TODO previously why !caller("base")? // if (($ctbindex != -1) && !caller("base") && ($SM_CTBINDEX != -2)) { // If click on script's button (not CKS, Catalog, other button...) then store/update button index if ($ctbindex != -1) { if ($SM_CTBINDEX != -2) { // If click on script's button (not CKS, Catalog, other button...) then store/update button index perm $SM_CTBINDEX = -1; }} sub "_ToolbarButton"; } // ---------------------------------------------< / Toolbar icon // ---------------------------------------------> Settings global $STG_EnableLayouts, $STG_UseIcons, $STG_AutoUpdateAll, $STG_AutoSave, $STG_Xtras, $STG_AutoOptimizeTree; global $STG_LayWinPosSize, $STG_LayCatalog, $STG_LayInfoPanelPreview, $STG_LayFallbackDef, $STG_StdResetWithLay; global $STG_Confirmation, $STG_SessionListOnTop, $STG_Separator; $STG_EnableLayouts = getkey("EnableLayouts", "Settings", $GEN_Ini); $STG_UseIcons = getkey("UseIcons", "Settings", $GEN_Ini); // ------------------<> $STG_AutoUpdateAll = getkey("AutoUpdateAll", "Settings", $GEN_Ini); $STG_AutoSave = getkey("AutoSave", "Settings", $GEN_Ini); // ------------------<> $STG_Xtras = getkey("Xtras", "Settings", $GEN_Ini); $STG_AutoOptimizeTree = getkey("AutoOptimizeTree", "Settings", $GEN_Ini); // ------------------<> $STG_LayWinPosSize = getkey("LayWinPosSize", "Settings", $GEN_Ini); $STG_LayCatalog = getkey("LayCatalog", "Settings", $GEN_Ini); $STG_LayInfoPanelPreview = getkey("LayInfoPanelPreview", "Settings", $GEN_Ini); $STG_LayFallbackDef = getkey("LayFallbackDef", "Settings", $GEN_Ini); $STG_StdResetWithLay = getkey("StdResetWithLay", "Settings", $GEN_Ini); // ------------------<> $STG_Confirmation = getkey("Confirmation", "Settings", $GEN_Ini); $STG_SessionListOnTop = getkey("SessionListOnTop", "Settings", $GEN_Ini); $STG_Separator = getkey("Separator", "Settings", $GEN_Ini); // ---------------------------------------------< // ------------------<> Layout variables global $GEN_LayUsed, $GEN_LayON; $GEN_LayUsed = (strlen(regexreplace(readfile("$GEN_Ini"), "[^\[]", "")) > 4 )? 1 : 0; // Check existence of user layouts (other than the 4 SM's default [Ini entries]) $GEN_LayON = ($STG_EnableLayouts && $GEN_LayUsed)? 1 : 0; // Layout loading is active $STG_LayWinPosSize = $GEN_LayON * $STG_LayWinPosSize; // Disable window settings if layouts not used /* ######################################################################################### */ /* ######################################################################################### */ // --------------------------------------------------------->> Variables declaration: generic global $PRE_l_AvailSess, // [$| ] List of available sessions (sep and end "|") $PRE_l_AvailSessDet, // [$| ] Detailed list of available sessions (w/ layout) (sep and end "|") $PRE_n_AvailSess, // [#|0] Number of available sessions $PRE_CurSess, // [$| ] Current session name - if valid $PRE_CurSessInv, // [$| ] Current session name - if inverted $PRE_CurSessLay, // [$| ] Current session name - if valid and has layout $PRE_CurSessBase, $PRE_FavoriteSession; global $PRE_SessTab1, // [$| ] Pane 1 tabset name - if from session (valid or not) $PRE_SessTab1Inv, // [$| ] Pane 1 tabset name - if from session inverted $PRE_SessTab2, // [$| ] Pane 2 tabset name - if from session (valid or not) $PRE_SessTab2Inv; // [$| ] Pane 2 tabset name - if from session inverted global $PRE_AutoSave, // [$| ] Name of Autosaved session - if exists $PRE_CurAutoSave, // [$| ] Current Autosaved session name - if valid $PRE_TmpSession, // [$| ] Name of Temporary session - if exists $PRE_CurTmpSession; // [$| ] Current Temporary session name - if valid /* - FYI - Defined dynamically (Do not declare here) - $DYN_InpSess, // [$] Input session name to act upon $DYN_InpSessLay, // [$] Input layout-session name to act upon $DYN_b_InpSessLay, // [1|0] Input session has layout */ // ------------------------------<> Visual affixes global $GEN_AutoSave_Suffix, $GEN_Lay_Prefix, $GEN_Lay_Suffix, $GEN_Lay_Icon, $GEN_XToolbar_Suffix, $GEN_XScript_Suffix, $GEN_TmpSession; $GEN_AutoSave_Suffix = " ".i(1,07); // Suffix of Autosave session $GEN_Lay_Prefix = "· "; // Prefix of inactive layout sessions $GEN_Lay_Suffix = " ".i(1,06); // Suffix of layout sessions for detailed list (used for Delete+) $GEN_Lay_Icon = ":panelshow"; // Icon of inactive layout sessions, and layout menu entries $GEN_XToolbar_Suffix = " Ά"; // Suffix of sessions with toolbar $GEN_XScript_Suffix = " °"; // Suffix of sessions with script $GEN_TmpSession = i(1,08); // Name of Temporary session // Use custom icon for active standard or layout session (e.g. XYplorer\Data\Icons\SessionManager.ico / XYplorer\Data\Icons\SessionManager_Layout.ico) $CustomIcon_Std = "\".self("base").".ico"; $CustomIcon_Lay = "\".self("base")."_Layout.ico"; if (!exists($CustomIcon_Std) || !exists($CustomIcon_Lay)) { $CustomIcon_Std = ":select"; $CustomIcon_Lay = ":select"; } $d_Icon_ActiveSession_Std = "|$CustomIcon_Std|1"; // Icon of active non-layout session $d_Icon_ActiveSession_Lay = "|$CustomIcon_Lay|1"; // Icon of active layout session // ---------------------------------------------------------<< // --------------------------------------------------------->> Variables declaration: current session $oset1 = gettoken(, -1, "\"); $oset2 = gettoken(, -1, "\"); $sset1 = regexreplace($oset1, "§(1|2)§_", ""); $sset2 = regexreplace($oset2, "§(1|2)§_", ""); $PRE_SessTab1 = ($sset1 != $oset1)? $sset1 : ""; $PRE_SessTab2 = ($sset2 != $oset2)? $sset2 : ""; $PRE_SessTab1Inv = ($oset1 Like "*§2§_*")? $sset1 : ""; $PRE_SessTab2Inv = ($oset2 Like "*§1§_*")? $sset2 : ""; $PRE_CurSessInv = ($PRE_SessTab1Inv && ($PRE_SessTab1Inv == $PRE_SessTab2Inv)) ? $PRE_SessTab1Inv : ""; $PRE_CurSess = (!$PRE_CurSessInv && ($PRE_SessTab1 == $PRE_SessTab2))? $PRE_SessTab1 : ""; $PRE_CurSessBase = replace($PRE_CurSess, $GEN_AutoSave_Suffix); $PRE_CurSessLay = (getkey("", "Layout ".$PRE_CurSessBase, $GEN_Ini))? $PRE_CurSessBase : ""; $PRE_FavoriteSession = replace(getkey("FavoriteSession", "General", $GEN_Ini), $GEN_AutoSave_Suffix); // ---------------------------------------------> Toolbar global $PRE_Xtra_Toolbar; if $PRE_CurSessLay { $Section = "Layout ".$PRE_CurSessLay; $PRE_Xtra_Toolbar = getkey("XTRA-Toolbar", $Section, $GEN_Ini); } // ---------------------------------------------< // ---------------------------------------------> Xtras-WIP /* if $STG_Xtras { global $PRE_Xtra_Catalog, $PRE_Xtra_Tags, $PRE_Xtra_FileAssoc; if $PRE_CurSessLay { $Section = "Layout ".$PRE_CurSessLay; $PRE_Xtra_Catalog = getkey("Catalog", $Section, $GEN_Ini); $PRE_Xtra_Tags = getkey("XTRA-Tags", $Section, $GEN_Ini); $PRE_Xtra_FileAssoc = getkey("XTRA-FileAssoc", $Section, $GEN_Ini); } }*/ // ---------------------------------------------< // ---------------------------------------------------------<< // --------------------------------------------------------->> Building-up list of sessions global $MEN_l_sessions, $MEN_About; set $d_xtra; $l_AllTabsets = listfolder(."\Panes", , "6"); $l_AllTabsets_1 = replace(regexmatches($l_AllTabsets, "§1§_[^\|]+", "|"), "§1§_"); $l_AllTabsets_2 = replace(regexmatches($l_AllTabsets, "§2§_[^\|]+", "|"), "§2§_"); if ($l_AllTabsets_1 != $l_AllTabsets_2) { // If incomplete sessions set $l_AllTabsets; foreach ($tsession, $l_AllTabsets_1, "|") { if (strpos($l_AllTabsets_2, "|".$tsession."|") != -1) { $l_AllTabsets = $tsession."|".$l_AllTabsets; } } } else { $l_AllTabsets = "|".$l_AllTabsets_1."|"; } status "Session Manager", , "progress"; // ------------------------------<> Autosave identification if $STG_AutoSave { $PRE_AutoSave = regexmatches($l_AllTabsets, "[^\|]+?(?=".$GEN_AutoSave_Suffix.")"); if $PRE_AutoSave { $l_AllTabsets = replace($l_AllTabsets, "$PRE_AutoSave$GEN_AutoSave_Suffix|"); } } // ------------------------------<> Temporary session identification $PRE_TmpSession = regexmatches($l_AllTabsets, $GEN_TmpSession); if $PRE_TmpSession { $l_AllTabsets = replace($l_AllTabsets, "$GEN_TmpSession|"); $PRE_CurTmpSession = ($PRE_CurSess == $PRE_TmpSession)? $PRE_TmpSession : ""; } // ------------------------------<> Order list of sessions $l_SessionsOrder = replace(formatlist(getkey("SessionsOrder", "General", $GEN_Ini), "v", "|"), "||", "|"); set $l_OrderedTabsets; $l_UnorderedTabsets = $l_AllTabsets; if $l_SessionsOrder { foreach ($tsession, $l_SessionsOrder, "|") { if ($tsession == "-") { $l_OrderedTabsets = "-|".$l_OrderedTabsets; } elseif ($l_UnorderedTabsets Like "*|$tsession|*") { $l_UnorderedTabsets = replace($l_UnorderedTabsets, "|".$tsession."|", "|"); $l_OrderedTabsets = $tsession."|".$l_OrderedTabsets; } } } // ------------------<> Order quick sessions $l_QuickSessions = regexmatches($l_UnorderedTabsets, "(\d\d-)*\d\d-\d\d [^”]+”\|", ""); $l_UnorderedTabsets = trim(replace($l_UnorderedTabsets, $l_QuickSessions), "|")."|-|".$l_QuickSessions."-|$PRE_TmpSession|"; // ------------------<> Cleanup extra | and - $l_AllTabsets = $l_OrderedTabsets."|-|".$l_UnorderedTabsets; $l_AllTabsets = regexreplace(replace(replace($l_AllTabsets, "||", "|"), "-|-|", "-|"), "((^\|-\|)|(-\|$))"); // ---------------------------------------------------------<< / Building up list of sessions // ------------------------------------------------------------------------>>> Listing all (potential) sessions one by one foreach ($tsession, $l_AllTabsets, "|") { if !$tsession {continue;} if ($tsession == "-") { $MEN_l_sessions = $MEN_l_sessions.."""-""".; } else { // --------------------------------------------------------->> If valid session // ------------------<> Indent inactive sessions $d_Lay_Prefix = (($tsession == $PRE_CurSessBase) || ($tsession == $PRE_FavoriteSession))? "" : "     "; // ------------------<> Add suffix to scripted or Elevated sessions $d_Script = getkey("Script", $tsession, $GEN_Ini)? $GEN_XScript_Suffix : ""; /* Elevated $d_Script = (getkey("Script", $tsession, $GEN_Ini) || getkey("Elevated", $tsession, $GEN_Ini))? " °" : ""; */ // ------------------<> Iconize active session $d_SessAct = ($tsession == $PRE_CurSessBase)? "$d_Script$d_Icon_ActiveSession_Std" : $d_Script; // ---------------------------------------------> Layout sessions if ($GEN_LayON && getkey("", "Layout ".$tsession, $GEN_Ini)) { // ---------------------------------------------> Add suffix to sessions with toolbar $d_xtra = getkey("XTRA-Toolbar", "Layout ".$tsession, $GEN_Ini)? $GEN_XToolbar_Suffix : $d_xtra; // ---------------------------------------------< // ------------------------------> Xtras-WIP /* if $STG_Xtras { $d_xtra = getkey("Catalog", "Layout ".$tsession, $GEN_Ini)? "$d_xtra [C]": $d_xtra; $d_xtra = getkey("XTRA-Tags", "Layout ".$tsession, $GEN_Ini)? "$d_xtra [T]": $d_xtra; $d_xtra = getkey("XTRA-FileAssoc", "Layout ".$tsession, $GEN_Ini)? "$d_xtra [F]": $d_xtra; $d_xtra = replace($d_xtra, "] [", ","); }*/ // ------------------------------< // ------------------<> Create detailed list of available sessions for Delete $PRE_l_AvailSessDet = $PRE_l_AvailSessDet.$tsession.$GEN_Lay_Suffix.$d_xtra."|"; // ------------------<> Prefix layout sessions $d_Lay_Prefix = ($tsession == $PRE_CurSessBase)? $GEN_Lay_Prefix : "  $GEN_Lay_Prefix "; // ------------------<> Iconize layout sessions if $STG_UseIcons { $d_Lay_Icon = ""; } else { $d_Lay_Icon = "|:panelshow"; } // ------------------<> Iconize active layout session $d_SessAct = ($tsession == $PRE_CurSessBase)? "$d_Script$d_xtra$d_Icon_ActiveSession_Lay" : "$d_Script$d_xtra$d_Lay_Icon"; // ------------------<> Reset Xtras $d_xtra = ""; // ---------------------------------------------< // ---------------------------------------------> Regular sessions } else { $PRE_l_AvailSessDet = $PRE_l_AvailSessDet.$tsession."|"; set $LayoutSessionsOnly; } // ---------------------------------------------< // ---------------------------------------------> Iconize session if UseIcons $d_SessSuffix = $d_SessAct; if $STG_UseIcons { $CurSessIcon = getkey("Icon", $tsession, $GEN_Ini); if ($d_SessAct UnLike "*|*") { if $CurSessIcon { // If not active session $d_SessSuffix = $d_Script."|".resolvepath($CurSessIcon, "\", 0); }} } // ---------------------------------------------< // ------------------------------<> Add current session to list if ($tsession UnLike "*$GEN_AutoSave_Suffix") { if ($STG_AutoSave && (($tsession == $PRE_AutoSave) || (!$PRE_AutoSave && ($tsession == $PRE_CurSess)))) { if ($tsession == $PRE_CurSessBase) { $PRE_CurAutoSave = ($PRE_AutoSave)? $tsession : ""; $MEN_l_sessions = $MEN_l_sessions."""$d_Lay_Prefix$tsession$GEN_AutoSave_Suffix$d_SessSuffix""".." global $DYN_InpSess; $DYN_InpSess = ""$tsession""; load ""$GEN_CurScript"", ""_Reset"";"; } else { $MEN_l_sessions = $MEN_l_sessions."""$d_Lay_Prefix$tsession$GEN_AutoSave_Suffix$d_SessSuffix""".." global $DYN_InpSess; $DYN_InpSess = ""$tsession$GEN_AutoSave_Suffix""; load ""$GEN_CurScript"", ""_Load"";"; } } else { $action = ($tsession != $PRE_CurSess)? "_Load" : "_Reset"; $MEN_l_sessions = $MEN_l_sessions."""$d_Lay_Prefix$tsession$d_SessSuffix""".." global $DYN_InpSess; $DYN_InpSess = ""$tsession""; load ""$GEN_CurScript"", ""$action"";"; } // ------------------------------<> Create list of available sessions $PRE_l_AvailSess = $PRE_l_AvailSess.$tsession."|"; $PRE_n_AvailSess++; } // ---------------------------------------------------------<< / Valid session } } // ------------------------------------------------------------------------<<< / Listing all sessions // ------------------------------------------------------------------------>>> Compiling and ordering list of sessions if $MEN_l_sessions { // ------------------<> Do not display prefix · if only layout sessions // Removed because misleading when starting fresh /* if $LayoutSessionsOnly { $MEN_l_sessions = regexreplace($MEN_l_sessions, "· ", ""); }*/ if $STG_AutoSave { if ($PRE_n_AvailSess < 2) { $MEN_l_sessions = replace($MEN_l_sessions, $GEN_AutoSave_Suffix); }} // ------------------<> Session list at bottom if !$STG_SessionListOnTop { if $STG_Separator { $MEN_l_sessions = ."""-""".."""               •••••••••••••••••••••""".."""-"""..$MEN_l_sessions; } else { $MEN_l_sessions = ."""-"""..$MEN_l_sessions; } } // ------------------<> Temporary session // $TmpSession = regexmatches($MEN_l_sessions, '"[ •]*'.$GEN_TmpSession.'[^\n]*\n[^\n]*\r\n'); if $PRE_TmpSession { // $PRE_TmpSession = $TmpSession; if ($PRE_n_AvailSess > 1) { // Reorder last if misplaced (legacy) // $MEN_l_sessions = replace($MEN_l_sessions, $TmpSession).."""-"""..$TmpSession; // $PRE_l_AvailSessDet = replace($PRE_l_AvailSessDet, "|$GEN_TmpSession$GEN_AutoSave_Suffix"); // No autosave for temp anymore $TmpSessionName = (strpos($PRE_l_AvailSessDet, "$GEN_TmpSession$GEN_Lay_Suffix") != -1)? "$GEN_TmpSession$GEN_Lay_Suffix" : $GEN_TmpSession; $PRE_l_AvailSessDet = replace($PRE_l_AvailSessDet, "|$TmpSessionName").$TmpSessionName; } $MEN_l_sessions = regexreplace($MEN_l_sessions, '("-"\r\n\r\n){2}', "$1"); // Remove separator if no real session exists } // ------------------<> About $MEN_About = i(1,09)."|:info"; $MEN_About2 = i(1,10)."|:favs|1"; $MEN_About = ($PRE_CurSess)? $MEN_About : $MEN_About2; if !$STG_SessionListOnTop { $MEN_l_sessions = $MEN_l_sessions.."""-""".."""$MEN_About""".." load ""$GEN_CurScript"", ""_About"";"; } // ------------------<> Session list on top if $STG_SessionListOnTop { if $STG_Separator { $MEN_l_sessions = $MEN_l_sessions.."""-""".."""               •••••••••••••••••••••""".."""-""".; } else { $MEN_l_sessions = $MEN_l_sessions.."""-""".; } } // ------------------<> About when no session exists } else { $MEN_About = i(1,10)."|:favs|1"; if !$STG_SessionListOnTop { $MEN_l_sessions = ."""-""".."""$MEN_About""".." load ""$GEN_CurScript"", ""_About"";"; } } // ------------------------------------------------------------------------<<< / Compiling and ordering list of sessions // ------------------<> Clean extra separators in case of missing entries $MEN_l_sessions = regexreplace($MEN_l_sessions, '"-"(\s*"-"\s*)+', """-"""); // ------------------------------------------------------------------------>>> Mouse modifiers - Quick Control via CTRL/SHIFT/ALT+Click on Session Manager toolbar button if (get("Trigger", "ctbindex") == $SM_CTBINDEX) { // Only if Session Manager button is pressed if get("Trigger") { if get("Shift") { $l_MM_commands = "_QuickLoad|_SwitchSessions|_Reset|_Update|_Save-QuickSession|_LoadFavoriteSession|_DefineFavoriteSession|_Save-Temporary|_Layout-Reset|_Layout-Alternate|_Layout-Switch"; $command = getkey(get("Shift"), "MouseModifiers", $GEN_Ini); $command = gettoken($l_MM_commands, $command, "|"); if $command { sub "$command"; } end 1; }} } // ------------------------------------------------------------------------<<< /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* #######################*/ /* ### Main+Sub Menus ###*/ /* #######################*/ "MainMenu" global $GEN_CurScript, $GEN_Ini, $GEN_LayON, $GEN_LayUsed, $GEN_Lay_Ico, $GEN_AutoSave_Suffix, $GEN_TmpSession, $GEN_SMVersion; global $STG_EnableLayouts, $STG_AutoOptimizeTree, $STG_AutoSave, $STG_Confirmation, $STG_SessionListOnTop, $STG_LayInfoPanelPreview, $STG_LayWinPosSize, $STG_LayCatalog, $STG_AutoUpdateAll; global $STG_Xtras, $STG_LayFallbackDef, $STG_StdResetWithLay, $STG_Separator; global $PRE_CurSess, $PRE_CurSessBase, $PRE_CurSessLay, $PRE_n_AvailSess, $PRE_l_AvailSess, $PRE_AutoSave, $PRE_CurAutoSave, $PRE_TmpSession, $PRE_CurTmpSession, $PRE_FavoriteSession; global $PRE_Xtra_Toolbar, $PRE_Xtra_Catalog, $PRE_Xtra_Tags, $PRE_Xtra_FileAssoc; global $MEN_l_sessions, $MEN_About; $Menu = ""; $d_Conf = ($STG_Confirmation)? "..." : ""; if $STG_SessionListOnTop { $Menu = $Menu.$MEN_l_sessions; } // ------------------------------------------------------------------------>>> Reset and Update // --------------------------------------------------------->> If using valid session if $PRE_CurSess { // ---------------------------------------------> If temporary session if ($PRE_CurSess == $GEN_TmpSession) { $Menu = $Menu.'"'.i(2,01)."$d_Conf|:tabsets".'"'.." load ""$GEN_CurScript"", ""_Reset"";"; // $Menu = $Menu.'"'.i(2,02)."$d_Conf|".'"'.." load ""$GEN_CurScript"", ""_Update"";"; // ---------------------------------------------< // ---------------------------------------------> If Autosave activated and session is autosaved } elseif ($STG_AutoSave && (!$PRE_AutoSave || $PRE_CurAutoSave)) { // ------------------<> If session is autosaved and has layout if ($GEN_LayON && $PRE_CurSessLay) { // ------------------<> Without toolbar if !$PRE_Xtra_Toolbar { $Menu = $Menu.'"'.i(2,03)."$d_Conf|:tabsets".'"'.." load ""$GEN_CurScript"", ""_Reset"";"; $Menu = $Menu.'"'.i(2,04)."$d_Conf|".'"'.." load ""$GEN_CurScript"", ""_Update"";"; // ------------------<> With toolbar } else { $Menu = $Menu.'"'.i(2,21)."$d_Conf|:tabsets".'"'.." load ""$GEN_CurScript"", ""_Reset"";"; $Menu = $Menu.'"'.i(2,22)."$d_Conf|".'"'.." load ""$GEN_CurScript"", ""_Update"";"; } // ------------------<> if session is autosaved and doesn't have layout } else { $Menu = $Menu.'"'.i(2,05)."$d_Conf|:tabsets".'"'.." load ""$GEN_CurScript"", ""_Reset"";"; $Menu = $Menu.'"'.i(2,06)."$d_Conf|".'"'.." load ""$GEN_CurScript"", ""_Update"";"; } // ---------------------------------------------< // ---------------------------------------------> If layouts enabled and active session has layout } elseif ($GEN_LayON && $PRE_CurSessLay) { // ------------------<> Without toolbar if !$PRE_Xtra_Toolbar { $Menu = $Menu.'"'.i(2,07)."$d_Conf|:tabsets".'"'.." load ""$GEN_CurScript"", ""_Reset"";"; $Menu = $Menu.'"'.i(2,08)."$d_Conf|".'"'.." load ""$GEN_CurScript"", ""_Update"";"; // ------------------<> With toolbar } else { $Menu = $Menu.'"'.i(2,19)."$d_Conf|:tabsets".'"'.." load ""$GEN_CurScript"", ""_Reset"";"; $Menu = $Menu.'"'.i(2,20)."$d_Conf|".'"'.." load ""$GEN_CurScript"", ""_Update"";"; } // ---------------------------------------------< } else { // ---------------------------------------------> If layouts enabled and active session doesn't have layout, but 'Reset with Default' ON if ((!$GEN_LayON && $STG_StdResetWithLay) || ($GEN_LayON && $STG_LayFallbackDef)) { $Menu = $Menu.'"'.i(2,09)."$d_Conf|:tabsets".'"'.." load ""$GEN_CurScript"", ""_Reset"";"; // ---------------------------------------------< // ---------------------------------------------> Regular session } else { $Menu = $Menu.'"'.i(2,10)."$d_Conf|:tabsets".'"'.." load ""$GEN_CurScript"", ""_Reset"";"; } $Menu = $Menu.'"'.i(2,11)."$d_Conf|".'"'.." load ""$GEN_CurScript"", ""_Update"";"; // ---------------------------------------------< } // ---------------------------------------------------------<< / Valid session // --------------------------------------------------------->> If using invalid session } else { $Menu = $Menu.'"'.i(2,10)."$d_Conf".'"'.; $Menu = $Menu.'"'.i(2,11)."$d_Conf".'"'.; } // ---------------------------------------------------------<< $Menu = $Menu.."""-""".; // ------------------------------------------------------------------------<<< / Reset and update /* // ------------------------------------------------------------------------>>> Autosave if ($STG_AutoSave && ($PRE_n_AvailSess > 1)) { $ResetAutoSave = " delete 1, 0, ""\Panes\§1§_$PRE_AutoSave$GEN_AutoSave_Suffix|\Panes\§2§_$PRE_AutoSave$GEN_AutoSave_Suffix""; setkey """", """", ""$PRE_AutoSave$GEN_AutoSave_Suffix"", ""$GEN_Ini""; wait 300; status ""Autosave reset successfully"";"; if (!$PRE_AutoSave || $PRE_CurAutoSave) { $Menu = $Menu.'"'.i(2,12).'"'.; } else { $Menu = $Menu.'"'.i(2,12)."|:queue".'"'..$ResetAutoSave; } $Menu = $Menu.."""-""".; } // ------------------------------------------------------------------------<<< */ // ------------------------------------------------------------------------>>> Save, SaveTemp, Rename, Delete // ------------------<> Save $Menu = $Menu.'"'.i(2,13)."...|:savesett".'"'.." load ""$GEN_CurScript"", ""_Save"";"; // ------------------<> Save temporary if !$PRE_CurSess { $Menu = $Menu.'"'.i(2,14)."$d_Conf|:openwith".'"'.; } elseif !$PRE_CurTmpSession { $TmpSession = $PRE_TmpSession? i(2,02) : i(2,14); $Menu = $Menu.'"'.$TmpSession.'|:openwith"'.." load ""$GEN_CurScript"", ""_Save-Temporary"";"; } else { $Menu = $Menu.'"'.i(2,02)."$d_Conf|:openwith".'"'.." load ""$GEN_CurScript"", ""_Update"";"; } // ------------------<> Rename if ($PRE_CurSess && ($PRE_CurSess != $GEN_TmpSession)) { $Menu = $Menu.'"'.i(2,15)."...|:rename".'"'.." load ""$GEN_CurScript"", ""_Rename"";"; } else { $Menu = $Menu.'"'.i(2,15)."...".'"'.; } // ------------------<> Delete if $PRE_n_AvailSess { // if session active $Menu = $Menu.'"'.i(2,16)."...|:del".'"'.." load ""$GEN_CurScript"", ""_Delete"";"; } else { $Menu = $Menu.'"'.i(2,16)."...".'"'.; } $Menu = $Menu.."""-""".; // ------------------------------------------------------------------------<<< /* ######################################################################################### */ /* > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > */ /* ######################################################################################### */ /* #######################*/ /* ### Layout Submenu ###*/ /* #######################*/ $Menu = $Menu.'"'.i(2,17)."|$GEN_Lay_Icon".'"'.; // ---------------------------------------------> Use session layouts if $STG_EnableLayouts { $Menu = $Menu.'"'.i(11,01)."||2|1".'"'.." global $OPT_b_State, $OPT_Setting; $OPT_b_State = 1; $OPT_Setting = ""EnableLayouts""; load ""$GEN_CurScript"", ""_Options-Settings"";"; } else { $Menu = $Menu.'"'.i(11,01)."|||1".'"'.." global $OPT_b_State, $OPT_Setting; $OPT_b_State = 0; $OPT_Setting = ""EnableLayouts""; load ""$GEN_CurScript"", ""_Options-Settings"";"; } // ---------------------------------------------< $Menu = $Menu."""-|||1""".; $Menu = $Menu.'"'.i(11,17)."|||1".'"'.; // SEPARATOR text: Default Layout $Menu = $Menu."""-|||1""".; // ------------------------------------------------------------------------>>> Generic window layout // --------------------------------------------------------->> Default layout // ------------------------------<> Reset default $Menu = $Menu.'"'.i(11,04)."|$GEN_Lay_Icon||1".'"'.." load ""$GEN_CurScript"", ""_Layout-Reset"";"; // ------------------------------<> Update default $Menu = $Menu.'"'.i(11,05)."|||1".'"'.." global $DYN_InpSessLay; $DYN_InpSessLay = ""¦‡¦-Default-¦‡¦""; load ""$GEN_CurScript"", ""_Layout-Save""; wait 400; status """.i(11,06).""";"; $Menu = $Menu."""-|||1""".; // ---------------------------------------------------------<< / Default layout // --------------------------------------------------------->> Alternate layout // ------------------------------<> Reset alternate $Menu = $Menu.'"'.i(11,34)."|:dp12||1".'"'.." global $DYN_InpSessLay; $DYN_InpSessLay = ""¦‡¦-Alternate-¦‡¦""; load ""$GEN_CurScript"", ""_Layout-Load""; wait 400; status """.i(11,36).""";"; // ------------------------------<> Update alternate $Menu = $Menu.'"'.i(11,35)."|||1".'"'.." global $DYN_InpSessLay; $DYN_InpSessLay = ""¦‡¦-Alternate-¦‡¦""; load ""$GEN_CurScript"", ""_Layout-Save""; wait 400; status """.i(11,37).""";"; $Menu = $Menu."""-|||1""".; // ---------------------------------------------------------<< / Alternate layout // --------------------------------------------------------->> Default toolbar and window $Menu = $Menu.'"'.i(11,38)."|\||1".'"'.; // ---------------------------------------------> Default window position and size // ------------------<> Reset default window settings $Menu = $Menu.'"'.i(11,39)."|\||2".'"'.." global $DYN_InpSessLay; $DYN_InpSessLay = ""¦‡¦-Default-¦‡¦""; load ""$GEN_CurScript"", ""_Layout-Load-WinPosSize""; wait 400; status """.i(11,41)."""};"; // ------------------<> Update default window settings $Menu = $Menu.'"'.i(11,40)."|||2".'"'.." global $DYN_InpSessLay; $DYN_InpSessLay = ""¦‡¦-Default-¦‡¦""; load ""$GEN_CurScript"", ""_Layout-Save-WinPosSize""; wait 400; status """.i(11,42).""";"; $Menu = $Menu."""-|||2""".; // ---------------------------------------------< // ---------------------------------------------> Default toolbar // ------------------<> Reset default toolbar $Menu = $Menu.'"'.i(11,19)."|:ctb59||2".'"'.." toolbar(getkey(""XTRA-Toolbar"", ""Layout ¦‡¦-Default-¦‡¦"", ""$GEN_Ini"")); wait 400; status """.i(11,20).""";"; // ------------------<> Update default toolbar $Menu = $Menu.'"'.i(11,21)."|||2".'"'.." setkey toolbar(), ""XTRA-Toolbar"", ""Layout ¦‡¦-Default-¦‡¦"", ""$GEN_Ini""; wait 400; status """.i(11,22).""";"; // ---------------------------------------------< // ---------------------------------------------------------<< / Default toolbar and window // ------------------------------------------------------------------------<<< / Generic window layout $Menu = $Menu."""-|||1""".; $Menu = $Menu.'"'.i(11,23)."|||1".'"'.; // SEPARATOR text: Current session $Menu = $Menu."""-|||1""".; // ------------------------------------------------------------------------>>> Current session layout if $PRE_CurSess { if $STG_EnableLayouts { // ------------------------------<> Autosave note if ($STG_AutoSave && (!$PRE_AutoSave || $PRE_CurAutoSave)) { $Menu = $Menu.'"'.i(1,07).' '.i(11,07)."|||1".'"'.; $Menu = $Menu."""-|||1""".; } // --------------------------------------------------------->> Regular session (no layout) if !$PRE_CurSessLay { // ------------------------------<> Save current $Menu = $Menu.'"'.i(11,14)."|$GEN_Lay_Icon||1".'"'.." end ((""$PRE_CurSess"" Like ""*[*"") || (""$PRE_CurSess"" Like ""*]*"")), """.i(11,15)." "";"; $Menu = $Menu." global $DYN_InpSessLay; $PRE_CurSessMaster = replace(""$PRE_CurSess"", ""$GEN_AutoSave_Suffix""); $DYN_InpSessLay = ""$PRE_CurSessMaster""; load ""$GEN_CurScript"", ""_Layout-Save""; wait 400; status """.i(11,09)." '$PRE_CurSessMaster' ".i(11,12).""";"; // ---------------------------------------------------------<< / Regular session // ------------------------------<> No layout note if !$PRE_CurSessLay { $Menu = $Menu.'"'.i(11,24)."|||1".'"'.; // Load layout session to acces options } // --------------------------------------------------------->> Layout session } else { // ---------------------------------------------> Current layout // ------------------<> Reset $Menu = $Menu.'"'.i(11,32)."|$GEN_Lay_Icon||1".'"'.." global $DYN_b_InpSessLay = 1; load ""$GEN_CurScript"", ""_Layout-Reset"";"; // $Menu = $Menu." $PRE_CurSessMaster = replace(""$PRE_CurSess"", ""$GEN_AutoSave_Suffix""); $DYN_Xtra_Toolbar = getkey(""XTRA-Toolbar"", ""Layout $PRE_CurSessMaster"", ""$GEN_Ini""); if $DYN_Xtra_Toolbar {toolbar(""$DYN_Xtra_Toolbar"");};"; // ------------------<> Update $Menu = $Menu.'"'.i(11,13)."|||1".'"'.." global $DYN_InpSessLay; $DYN_InpSessLay = ""$PRE_CurSessLay""; load ""$GEN_CurScript"", ""_Layout-Save""; wait 400; status """.i(11,09)." '$PRE_CurSessLay' ".i(11,11).""";"; $Menu = $Menu."""-|||1""".; // ---------------------------------------------< / Current layout // ---------------------------------------------> Session toolbar if (getkey("XTRA-Toolbar", "Layout ".$PRE_CurSessBase, $GEN_Ini)) { // ------------------<> Update toolbar $Menu = $Menu.'"'.i(11,27)."|:ctb59||1".'"'.." setkey toolbar(), ""XTRA-Toolbar"", ""Layout $PRE_CurSessLay"", ""$GEN_Ini""; wait 400; status """.i(11,28).""";"; // ------------------<> Remove toolbar $Menu = $Menu.'"'.i(11,25)."|||1".'"'.." toolbar(getkey(""XTRA-Toolbar"", ""Layout ¦‡¦-Default-¦‡¦"", ""$GEN_Ini"")); setkey """", ""XTRA-Toolbar"", ""Layout $PRE_CurSessLay"", ""$GEN_Ini""; wait 400; status """.i(11,26).""";"; } else { // ------------------<> Save toolbar $Menu = $Menu.'"'.i(11,29)."|:ctb59||1".'"'.." setkey toolbar(), ""XTRA-Toolbar"", ""Layout $PRE_CurSessLay"", ""$GEN_Ini""; wait 400; status """.i(11,30).""";"; } $Menu = $Menu."""-|||1""".; // ---------------------------------------------< / Session toolbar // ---------------------------------------------> Delete complete layout // CAUTION: Icon caption used by "_Layout-Reset" $Menu = $Menu.'"'.i(11,08)."|:del||1".'"'.." if (getkey(""XTRA-Toolbar"", ""Layout "".replace(""$PRE_CurSess"", ""$GEN_AutoSave_Suffix""), ""$GEN_Ini"")) {toolbar(getkey(""XTRA-Toolbar"", ""Layout ¦‡¦-Default-¦‡¦"", ""$GEN_Ini""));}"; $Menu = $Menu." if (getkey(""XYWinPosSize"", ""Layout "".replace(""$PRE_CurSess"", ""$GEN_AutoSave_Suffix""), ""$GEN_Ini"")) {global $DYN_InpSessLay; $DYN_InpSessLay = ""¦‡¦-Default-¦‡¦""; load ""$GEN_CurScript"", ""_Layout-Load-WinPosSize"";}"; $Menu = $Menu." load ""$GEN_CurScript"", ""_Layout-Reset""; global $DYN_InpSessLay; $DYN_InpSessLay = ""$PRE_CurSessLay""; load ""$GEN_CurScript"", ""_Layout-Delete""; wait 400; status """.i(11,09)." '$PRE_CurSessLay' ".i(11,10).""";"; } // ---------------------------------------------< / Delete complete layout // ---------------------------------------------------------<< / Layout session // --------------------------------------------------------->> Layouts disabled } else { $Menu = $Menu.'"'.i(11,31)."|||1".'"'.; // Enable layouts to acces options } // ---------------------------------------------------------<< // ------------------------------------------------------------------------<<< / Current session layout // ------------------------------------------------------------------------>>> Invalid session } else { $Menu = $Menu.'"'.i(11,16)."|||1".'"'.; // Load valid session to access options } // ------------------------------------------------------------------------<<< // < < < Layout submenu < < < */ /* ######################################################################################### */ /* < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < */ /* ######################################################################################### */ /* ######################################################################################### */ /* > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > */ /* ######################################################################################### */ /* #######################*/ /* ### Options Submenu ###*/ /* #######################*/ $Menu = $Menu.'"'.i(2,18)."|:conf".'"'.; // --------------------------------------------------------->> Quick session $Menu = $Menu.'"'.i(14,56)."|:savesett||1".'"'.." load ""$GEN_CurScript"", ""_Save-QuickSession"";"; $Menu = $Menu."""-|||1""".; // ---------------------------------------------------------<< // --------------------------------------------------------->> Set/Unset as favorite if ($PRE_CurSess) { // ------------------<> Set or Unset if (replace("$PRE_CurSess", "$GEN_AutoSave_Suffix") == getkey("FavoriteSession", "General", $GEN_Ini)) { $Menu = $Menu.'"'.i(14,76)."|:favs||1".'"'.." load ""$GEN_CurScript"", ""_SetFavoriteSession"";"; } else { $Menu = $Menu.'"'.i(14,75)."...|:favs||1".'"'.." load ""$GEN_CurScript"", ""_SetFavoriteSession"";"; } } else { $Menu = $Menu.'"'.i(14,75)."...|:favs||1".'"'.; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Associate script with session if $PRE_CurSess { $AutoScriptedSess = ($STG_AutoSave && $PRE_CurAutoSave)? $PRE_CurAutoSave : $PRE_CurSess; $ScriptEdition = " if ($Script != """.i(0,07).""") {if $Script {setkey ""$Script"", ""Script"", ""$AutoScriptedSess"", ""$GEN_Ini""; wait 300; status """.i(14,04).""";} else {setkey """", ""Script"", ""$AutoScriptedSess"", ""$GEN_Ini""; wait 300; status """.i(14,05).""";}}"; if getkey("Script", "$AutoScriptedSess", $GEN_Ini) { // ------------------<> Edit script $Menu = $Menu.'"'.i(14,06)."|:steps||1".'"'.." $Script = input(""".i(14,07)." '$AutoScriptedSess'"", """.'• '.i(14,08).' ""::"" .- '.i(14,09).' ::msg ""Hello World""; • '.i(14,10).' - '.i(14,11).' RunAntivirus.xys - '.i(14,12).' ""Run App.xys"", ""My Antivirus"" • '.i(14,13).''.""", getkey(""Script"", ""$AutoScriptedSess"", ""$GEN_Ini""), , """.i(0,07).""");"; $Menu = $Menu.$ScriptEdition; } else { // ------------------<> Associate script $Menu = $Menu.'"'.i(14,14)."|:steps||1".'"'.." $Script = input(""".i(14,15)." '$AutoScriptedSess'"", """.'• '.i(14,08).' ""::"" .- '.i(14,09).' ::msg ""Hello World""; • '.i(14,10).' - '.i(14,11).' RunAntivirus.xys - '.i(14,12).' ""Run App.xys"", ""My Antivirus"" '.""", , , """.i(0,07).""");"; $Menu = $Menu.$ScriptEdition; } } else { // ------------------<> Invalid session note $Menu = $Menu.'"'.i(14,16)."|:steps||1".'"'.; // Script only available for valid session } $Menu = $Menu."""-|||1""".; // ---------------------------------------------------------<< // --------------------------------------------------------->> AutoUpdate if ($STG_AutoSave || ($PRE_n_AvailSess < 2)) { $Menu = $Menu.'"'.i(14,93)." ".i(14,94)."|||1".'"'.; } else { $MenuText_AutoUpdateAll = "global $OPT_Setting = ""AutoUpdateAll""; load ""$GEN_CurScript"", ""_Options-Settings"";"; // ---------------------------------------------> Disable if $STG_AutoUpdateAll { $Menu = $Menu.'"'.i(14,93)." ".i(14,94)."||2|1".'"'.." global $OPT_b_State = 1; $MenuText_AutoUpdateAll"; // ---------------------------------------------< // ---------------------------------------------> Enable } else { $Menu = $Menu.'"'.i(14,93)." ".i(14,94)."|||1".'"'.." global $OPT_b_State = 0; $MenuText_AutoUpdateAll"; } } // ---------------------------------------------< // ---------------------------------------------------------<< // --------------------------------------------------------->> Autosave if $STG_AutoUpdateAll { $Menu = $Menu.'"'.i(14,91)." ".i(14,03)."|||1".'"'.; $Menu = $Menu.'"'.i(14,91)." ".i(2,12)."|:queue||1".'"'.; } else { // ---------------------------------------------> Autosave enabled or disabled if ($PRE_n_AvailSess > 1 && $PRE_CurSess) { $MenuText_AutoSave = "global $OPT_Setting = ""AutoSave""; load ""$GEN_CurScript"", ""_Options-Settings"";"; // ------------------------------<> Disable Autosave if $STG_AutoSave { // ------------------<> Autosave of current session if ($PRE_CurAutoSave || !$PRE_AutoSave) { $Menu = $Menu.'"'.i(14,91)." ".i(14,03)."...||2|1".'"'.; $Menu = $Menu." end !confirm(""".i(14,01).""");"; $Menu = $Menu." load ""$GEN_CurScript"", ""_Reset""; delete 1, 0, ""\Panes\§1§_$PRE_AutoSave$GEN_AutoSave_Suffix|\Panes\§2§_$PRE_AutoSave$GEN_AutoSave_Suffix"";"; $Menu = $Menu." global $OPT_b_State = 1; $MenuText_AutoSave"; // ------------------<> Autosave of different session } else { $Menu = $Menu.'"'.i(14,91)." ".i(14,03)."...||2|1".'"'.; $Menu = $Menu." end !confirm(""".i(14,02).""");"; $Menu = $Menu." delete 1, 0, ""\Panes\§1§_$PRE_AutoSave$GEN_AutoSave_Suffix|\Panes\§2§_$PRE_AutoSave$GEN_AutoSave_Suffix"";"; $Menu = $Menu." global $OPT_b_State = 1; $MenuText_AutoSave"; } // ------------------------------<> Enable Autosave } else { $Menu = $Menu.'"'.i(14,91)." ".i(14,03)."|||1".'"'.; $Menu = $Menu." global $OPT_b_State = 0; $MenuText_AutoSave"; $Menu = $Menu.'"'.i(14,91)." ".i(2,12)."|:queue||1".'"'.; } // ---------------------------------------------< // ---------------------------------------------> Only one session or invalid session } else { $Menu = $Menu.'"'.i(14,91)." ".i(14,03)."|||1".'"'.; $Menu = $Menu.'"'.i(14,91)." ".i(2,12)."|:queue||1".'"'.; } // ---------------------------------------------< // ---------------------------------------------> Autosave enabled on different session // ------------------<> Set autosave to current session if ($STG_AutoSave && ($PRE_n_AvailSess > 1)) { $ResetAutoSave = " delete 1, 0, ""\Panes\§1§_$PRE_AutoSave$GEN_AutoSave_Suffix|\Panes\§2§_$PRE_AutoSave$GEN_AutoSave_Suffix""; setkey """", """", ""$PRE_AutoSave$GEN_AutoSave_Suffix"", ""$GEN_Ini""; wait 300; status """.i(14,92).""";"; if (!$PRE_AutoSave || $PRE_CurAutoSave || $PRE_CurTmpSession) { $Menu = $Menu.'"'.i(14,91)." ".i(2,12).'|:queue||1"'.; } else { $Menu = $Menu.'"'.i(14,91)." ".i(2,12)."|:queue||1".'"'..$ResetAutoSave; } } // ---------------------------------------------< } // ---------------------------------------------------------<< $Menu = $Menu."""-|||1""".; // --------------------------------------------------------->> Reorder session list if ($PRE_n_AvailSess > 1) { $Menu = $Menu.'"'.i(14,17)."|:viewlist||1".'"'.." load ""$GEN_CurScript"", ""_ReorderSessionList"";"; $Menu = $Menu." global $DYN_SessionsOrder; setkey ""$DYN_SessionsOrder"", ""SessionsOrder"", ""General"", ""$GEN_Ini""; wait 500; status """.i(14,18).""";}"; } else { // ------------------<> Reorder disabled (only 1 session available) $Menu = $Menu.'"'.i(14,17)."|:viewlist||1".'"'.; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Change icons of sessions if $PRE_n_AvailSess { $Menu = $Menu.'"'.i(14,42)."|:icf||1".'"'.." load ""$GEN_CurScript"", ""_ChangeIcons"";"; } else { $Menu = $Menu.'"'.i(14,42)."|:icf||1".'"'.; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Edit mouse modifiers $Menu = $Menu.'"'.i(14,67)."|||1".'"'.." load ""$GEN_CurScript"", ""_MouseModifiers"";"; $Menu = $Menu."""-|||1""".; // ---------------------------------------------------------<< // --------------------------------------------------------->> Strong separator $Menu = $Menu."""                                                      •••••••••••••••••••••••••••|||1""".; $Menu = $Menu."""-|||1""".; // ---------------------------------------------------------<< // --------------------------------------------------------->> Auto optimize tree $MenuText_AutoOptimizeTree = "global $OPT_Setting = ""AutoOptimizeTree""; load ""$GEN_CurScript"", ""_Options-Settings"";"; if $STG_AutoOptimizeTree { $Menu = $Menu.'"'.i(14,31)."||2|1".'"'.." global $OPT_b_State = 1; $MenuText_AutoOptimizeTree"; } else { $Menu = $Menu.'"'.i(14,31)."|||1".'"'.." global $OPT_b_State = 0; $MenuText_AutoOptimizeTree"; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Xtras $confirmXtras = "end !confirm('".i(14,81).chr(13).chr(13).i(14,82).chr(13).i(14,83).chr(13).chr(13).i(14,84).chr(13).i(14,85)."')"; $MenuText_Xtras = "global $OPT_Setting = ""Xtras""; load ""$GEN_CurScript"", ""_Options-Settings"";"; if $STG_Xtras { $Menu = $Menu.'"'.i(14,35)."||2|1".'"'.." global $OPT_b_State = 1; $MenuText_Xtras"; } else { $Menu = $Menu.'"'.i(14,35)."...|||1".'"'.." $confirmXtras; global $OPT_b_State = 0; $MenuText_Xtras"; } $Menu = $Menu."""-|||1""".; // ---------------------------------------------------------<< // --------------------------------------------------------->> Layout options - If using layouts if $GEN_LayON { // ------------------<> Window position and size $MenuText_LayWinPosSize = "global $OPT_Setting = ""LayWinPosSize""; load ""$GEN_CurScript"", ""_Options-Settings"";"; if $STG_LayWinPosSize { $Menu = $Menu.'"'.i(14,65)."||2|1".'"'.." global $OPT_b_State = 1; $MenuText_LayWinPosSize"; } else { $Menu = $Menu.'"'.i(14,65)."|||1".'"'.." global $DYN_InpSessLay; $DYN_InpSessLay = ""¦‡¦-Default-¦‡¦""; load ""$GEN_CurScript"", ""_Layout-Save-WinPosSize""; global $OPT_b_State = 0; $MenuText_LayWinPosSize"; } // ------------------<> Catalog $MenuText_LayCatalog = "global $OPT_Setting = ""LayCatalog""; load ""$GEN_CurScript"", ""_Options-Settings"";"; if $STG_LayCatalog { $Menu = $Menu.'"'.i(14,66)."||2|1".'"'.." global $OPT_b_State = 1; $MenuText_LayCatalog"; } else { $Menu = $Menu.'"'.i(14,66)."|||1".'"'.." savesettings 3; $CurCat = getkey(""CatalogPerm"", ""General""); if !(""$CurCat"") {$CurCat = ""catalog.dat""; setkey ""$CurCat"", ""CatalogPerm"", ""General"";} setkey ""$CurCat"", ""Catalog"", ""Layout ¦‡¦-Default-¦‡¦"", ""$GEN_Ini""; global $OPT_b_State = 0; $MenuText_LayCatalog"; } // ------------------<> Info panel $MenuText_LayInfoPanelPreview = "global $OPT_Setting = ""LayInfoPanelPreview""; load ""$GEN_CurScript"", ""_Options-Settings"";"; if $STG_LayInfoPanelPreview { $Menu = $Menu.'"'.i(14,34)."||2|1".'"'.." global $OPT_b_State = 1; $MenuText_LayInfoPanelPreview"; } else { $Menu = $Menu.'"'.i(14,34)."|||1".'"'.." global $OPT_b_State = 0; $MenuText_LayInfoPanelPreview"; } // ------------------<> Layout fallback $MenuText_LayFallbackDef = "global $OPT_Setting = ""LayFallbackDef""; load ""$GEN_CurScript"", ""_Options-Settings"";"; if $STG_LayFallbackDef { $Menu = $Menu.'"'.i(14,33)."||2|1".'"'.." global $OPT_b_State = 1; $MenuText_LayFallbackDef"; } else { $Menu = $Menu.'"'.i(14,33)."|||1".'"'.." global $OPT_b_State = 0; $MenuText_LayFallbackDef"; } // ------------------<> Standard fallback $Menu = $Menu.'"'.i(14,32)."|||1".'"'.; // ---------------------------------------------------------<< // --------------------------------------------------------->> Layout options - If not using layouts } else { // ------------------<> Window position and size $Menu = $Menu.'"'.i(14,65)."|||1".'"'.; // ------------------<> Catalog $Menu = $Menu.'"'.i(14,66)."|||1".'"'.; // ------------------<> Info panel $Menu = $Menu.'"'.i(14,34)."|||1".'"'.; // ------------------<> Layout fallback $Menu = $Menu.'"'.i(14,33)."|||1".'"'.; // ------------------<> Standard fallback $MenuText_StdResetWithLay = "global $OPT_Setting = ""StdResetWithLay""; load ""$GEN_CurScript"", ""_Options-Settings"";"; if $STG_StdResetWithLay { $Menu = $Menu.'"'.i(14,32)."||2|1".'"'.." global $OPT_b_State = 1; $MenuText_StdResetWithLay"; } else { $Menu = $Menu.'"'.i(14,32)."|||1".'"'.." global $OPT_b_State = 0; $MenuText_StdResetWithLay"; } } $Menu = $Menu."""-|||1""".; // ---------------------------------------------------------<< // --------------------------------------------------------->> Interface // ------------------<> Confirmation $MenuText_Confirmation = "global $OPT_Setting = ""Confirmation""; load ""$GEN_CurScript"", ""_Options-Settings"";"; if $STG_Confirmation { $Menu = $Menu.'"'.i(14,38)."||2|1".'"'.." global $OPT_b_State = 1; $MenuText_Confirmation"; } else { $Menu = $Menu.'"'.i(14,38)."|||1".'"'.." global $OPT_b_State = 0; $MenuText_Confirmation"; } // ------------------<> Sessions on top $MenuText_SessionListOnTop = "global $OPT_Setting = ""SessionListOnTop""; load ""$GEN_CurScript"", ""_Options-Settings"";"; if $STG_SessionListOnTop { $Menu = $Menu.'"'.i(14,36)."||2|1".'"'.." global $OPT_b_State = 1; $MenuText_SessionListOnTop"; } else { $Menu = $Menu.'"'.i(14,36)."|||1".'"'.." global $OPT_b_State = 0; $MenuText_SessionListOnTop"; } // ------------------<> Separator $MenuText_Separator = "global $OPT_Setting = ""Separator""; load ""$GEN_CurScript"", ""_Options-Settings"";"; if $STG_Separator { $Menu = $Menu.'"'.i(14,37)."||2|1".'"'.." global $OPT_b_State = 1; $MenuText_Separator"; } else { $Menu = $Menu.'"'.i(14,37)."|||1".'"'.." global $OPT_b_State = 0; $MenuText_Separator"; } $Menu = $Menu."""-|||1""".; // ---------------------------------------------------------<< /* // --------------------------------------------------------->> Reduce flickering // Probably not needed anymore if !getkey("TabsetsNoPaneActivation", "Settings") { $Menu = $Menu.'"'.i(14,39)."|%winsysdir%\ieframe.dll /62||1".'"'.." load ""$GEN_CurScript"", ""_Options-Tweak"";"; } else { $Menu = $Menu.'"'.i(14,40)."||2|1".'"'.; } $Menu = $Menu."""-|||1""".; // ---------------------------------------------------------<< */ // --------------------------------------------------------->> Strong separator $Menu = $Menu."""                                                      •••••••••••••••••••••••••••|||1""".; $Menu = $Menu."""-|||1""".; // ---------------------------------------------------------<< // --------------------------------------------------------->> XYplorer Toggle main menu & go to tabsets folder $Menu = $Menu.'"'.i(14,19)."|\||1".'"'.." #1061;"; $Menu = $Menu.'"'.i(14,70)."|||1".'"'.." tab(""new"", ""\panes"");;"; $Menu = $Menu."""-|||1""".; // ---------------------------------------------------------<< // --------------------------------------------------------->> Help $Menu = $Menu.'"'.i(14,41)." Session Manager v$GEN_SMVersion|:info||1".'"'.." load ""$GEN_CurScript"", ""_Help"";"; // ---------------------------------------------------------<< // --------------------------------------------------------->> Help - Copy code for CTB/CKS/UDC $Menu = $Menu.'"'.i(14,41)." ".i(14,20)."|:sticky||1".'"'.." load ""$GEN_CurScript"", ""_CheatSheet"";"; // ---------------------------------------------------------<< // < < < Options submenu < < < */ /* ######################################################################################### */ /* < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < */ /* ######################################################################################### */ if !$STG_SessionListOnTop { $Menu = $Menu.$MEN_l_sessions; } else { // ------------------<> About $Menu = $Menu.."""-""".."""$MEN_About""".." load ""$GEN_CurScript"", ""_About"";"; } // global $Clock_1; // Timer Check // status eval(now("ssfff") - $Clock_1), "FF0000"; load $Menu, , s; /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ########################*/ /* ### Processes ###*/ /* ########################*/ /* ######################################################################################### */ /* ######################################################################################### */ "_QuickLoad" global $DYN_InpSess = input(i(3,11), i(3,12)..i(3,13)); if $DYN_InpSess { sub "_Load"; } else { sub "_SwitchSessions"; } /* ######################################################################################### */ /* ######################################################################################### */ "_Load" global $GEN_CurScript, $GEN_Ini, $GEN_LayON, $GEN_AutoSave_Suffix; global $STG_AutoOptimizeTree, $STG_AutoSave, $STG_AutoUpdateAll, $STG_LayInfoPanelPreview, $STG_LayFallbackDef, $STG_StdResetWithLay, $STG_Xtras, $STG_UseIcons; global $PRE_l_AvailSess, $PRE_CurSess, $PRE_CurSessBase, $PRE_CurSessLay, $PRE_CurSessInv, $PRE_SessTab1Inv, $PRE_SessTab2Inv, $PRE_AutoSave, $PRE_CurAutoSave; global $DYN_InpSess, $DYN_InpSessLay, $DYN_b_InpSessLay, $DYN_NoInput; if !$GEN_CurScript { // If accessed externally from Quick Control, Catalog, CKS, UDC, etc. sub "_Initialize"; if ($DYN_InpSess && ("|$PRE_l_AvailSess|" UnLikeI "*|$DYN_InpSess|*")) { // For quick load with partial name: find first matching session $DYN_InpSess = gettoken(regexmatches($PRE_l_AvailSess, "[^\|]*\b".$DYN_InpSess."[^\|]*"), 1, "|"); end !$DYN_InpSess, "".i(3,14)."", 1; } } // --------------------------------------------------------->> Autosave if $STG_AutoSave { if ($PRE_CurAutoSave && (($DYN_InpSess == $PRE_CurSess) || ("$DYN_InpSess$GEN_AutoSave_Suffix" == $PRE_CurSess))) { // Reset Autosave session to original $DYN_InpSess = $PRE_CurAutoSave; setkey "", "", $PRE_CurSessBase.$GEN_AutoSave_Suffix, $GEN_Ini; // Remove INI entry } elseif ($PRE_CurSess && ((replace($DYN_InpSess, $GEN_AutoSave_Suffix) != $PRE_CurSessBase) && ($PRE_CurAutoSave || !$PRE_AutoSave))) { if $PRE_CurAutoSave { // Update $PRE_CurAutoSave = $PRE_CurSess; $DYN_NoInput = 1; tabset("save", , 1); wait 10; tabset("save", , 2); } else { // Save tabset("saveas", "§1§_$PRE_CurSess$GEN_AutoSave_Suffix", 1); wait 10; tabset("saveas", "§2§_$PRE_CurSess$GEN_AutoSave_Suffix", 2); } // ---------------------------------------------> Store status of Show Hidden/System/Protected if $STG_Xtras { setkey get("#493"), "ShowHidden", $PRE_CurSessBase.$GEN_AutoSave_Suffix, $GEN_Ini; setkey get("#494"), "ShowSystem", $PRE_CurSessBase.$GEN_AutoSave_Suffix, $GEN_Ini; setkey get("#388"), "ShowProtected", $PRE_CurSessBase.$GEN_AutoSave_Suffix, $GEN_Ini; } // ---------------------------------------------< } elseif ($DYN_InpSess == $PRE_AutoSave) { // If accessed externally and session has AutoSave, load AutoSave instead $DYN_InpSess = "$PRE_AutoSave$GEN_AutoSave_Suffix"; } } // ---------------------------------------------------------<< / Autosave // --------------------------------------------------------->> Reset if trying to reload active session if (!$PRE_CurAutoSave && ($DYN_InpSess == $PRE_CurSess)) { sub "_Reset"; end 1, , 1; } // ---------------------------------------------------------<< // --------------------------------------------------------->> AutoUpdate All if ($STG_AutoUpdateAll && $PRE_CurSess) { sub "_Update"; } // ---------------------------------------------------------<< // ------------------------------------------------------------------------>>> Loading end ($DYN_InpSess == ""); end ($PRE_CurSessInv == $DYN_InpSess), "".i(3,01)." '$DYN_InpSess' , ".i(3,02)." ".i(3,03)." '$DYN_InpSess' . "; $DYN_InpSessMaster = replace($DYN_InpSess, $GEN_AutoSave_Suffix); // --------------------------------------------------------->> Change button icon if $STG_UseIcons && ($SM_CTBINDEX > -1) { // If using icons and Session Manager button index known $Icon = getkey("Icon", $DYN_InpSessMaster, $GEN_Ini); // Session Custom icon $DefaultIcon = "\".self("base").".ico"; // SM Custom icon $DefaultIcon = (exists($DefaultIcon))? $DefaultIcon : ":tabsets"; // SM Embedded icon $Icon = ($Icon)? $Icon : $DefaultIcon; ctbicon($Icon, $SM_CTBINDEX); } // ---------------------------------------------------------<< // --------------------------------------------------------->> Layout // Load (and save previous if needed) $DYN_b_InpSessLay = (getkey("", "Layout ".$DYN_InpSessMaster, $GEN_Ini))? 1 : 0; if (($GEN_LayON && ($PRE_CurSessLay || $DYN_b_InpSessLay || $STG_LayFallbackDef)) || (!$GEN_LayON && $STG_StdResetWithLay)) { // ------------------------------<> Layout to load: Default, Last, or Session if (($STG_LayFallbackDef && !$DYN_b_InpSessLay) || !$GEN_LayON) { // If 'Reset to default' or 'Fallback to default' ON $DYN_InpSessLay = "¦‡¦-Default-¦‡¦"; } else { $DYN_InpSessLay = (!$STG_LayFallbackDef && $PRE_CurSessLay && !$DYN_b_InpSessLay)? "¦‡¦-Last-¦‡¦" : $DYN_InpSessMaster; } load "$GEN_CurScript", "_Layout-Load"; } // ---------------------------------------------------------<< / Layout // ---------------------------------------------> Xtras Regular - Show H/S/P // Must be set before loading tabset to prevent flatview reset if $STG_Xtras { sub "_Xtras-Regular-Load"; } // ---------------------------------------------< // --------------------------------------------------------->> Load or revert // (Check if session tabset is already loaded, to revert instead of load) $x = 1; $y = 2; $osetx = gettoken(eval(""), -1, "\"); $ssetx = replace($osetx, "§".$x."§_", ""); $actionx = (($DYN_InpSess != $ssetx) || ($osetx == $ssetx))? "load" : "revert"; tabset($actionx, "§$x§_$DYN_InpSess", $x); wait 10; $osety = gettoken(eval(""), -1, "\"); $ssety = replace($osety, "§".$y."§_", ""); $actiony = (($DYN_InpSess != $ssety) || ($osety == $ssety))? "load" : "revert"; tabset($actiony, "§$y§_$DYN_InpSess", $y); wait 10; if $STG_AutoOptimizeTree { #1040; // Optimize Tree #1010; // Fully Collapse } #482; // Refresh Tree (clean remaining unavailable drives) // ---------------------------------------------------------<< / Load or revert // --------------------------------------------------------->> Autosave Reset if ($PRE_CurAutoSave && ($DYN_InpSess == $PRE_CurAutoSave)) { delete 1, 0, "\Panes\§1§_$PRE_CurAutoSave$GEN_AutoSave_Suffix|\Panes\§2§_$PRE_CurAutoSave$GEN_AutoSave_Suffix"; wait 300; status i(0,01)." '$PRE_CurAutoSave' ".i(0,02); // ---------------------------------------------------------<< // --------------------------------------------------------->> Store last session name for Quick Control } else { setkey replace($DYN_InpSess, $GEN_AutoSave_Suffix), "CurrentSession", "General", $GEN_Ini; if ($PRE_CurSess && ($PRE_CurSess != $DYN_InpSess)) { setkey $PRE_CurSessBase, "PreviousSession", "General", $GEN_Ini; } } // ---------------------------------------------------------<< // ------------------------------<> Force activation of SyncBrowse/Scroll (which can be ON but deactivated) if $STG_Xtras { if !get("#813") {#813;} #813; } /* Elevated if $STG_Xtras { sub "_Xtras-Elevated"; } */ // --------------------------------------------------------->> Status wait 250; if ($actionx == "revert") && ($actionx == $actiony) { status i(0,01)." '$DYN_InpSess' ".i(0,02); } else { status i(0,01)." '$DYN_InpSess' ".i(0,04); } // ---------------------------------------------------------<< // ---------------------------------------------> Autorun Script sub "_AutorunScript" // ---------------------------------------------< // ------------------------------------------------------------------------<<< / Loading /* ######################################################################################### */ /* ######################################################################################### */ "_Reset" global $GEN_CurScript, $GEN_Ini, $GEN_LayON, $GEN_AutoSave_Suffix; global $STG_AutoOptimizeTree, $STG_AutoSave, $STG_Confirmation, $STG_LayInfoPanelPreview, $STG_LayFallbackDef, $STG_StdResetWithLay, $STG_Xtras; global $PRE_CurSessLay, $PRE_CurSess, $PRE_CurSessBase, $DYN_InpSess, $DYN_InpSessLay, $PRE_CurAutoSave; // ------------------<> No active or valid session end !$PRE_CurSess, i(5,03); // ------------------<> If accessed externally from Quick Control, Catalog, CKS, UDC, etc. if !$GEN_CurScript { sub "_Initialize"; } $d_WithLay = ($GEN_LayON && ($PRE_CurSessLay || $DYN_InpSessLay))? i(4,01) : i(4,02); $d_WithLay2 = ($GEN_LayON && ($PRE_CurSessLay || $DYN_InpSessLay))? i(4,03) : i(0,01); if $STG_Confirmation {end !confirm("$d_WithLay $PRE_CurSess ".i(4,04)." ");} // --------------------------------------------------------->> Autosave if ($STG_AutoSave && $PRE_CurAutoSave) { $DYN_InpSess = $PRE_CurAutoSave; sub "_Load"; delete 1, 0, "\Panes\§1§_$PRE_CurAutoSave$GEN_AutoSave_Suffix|\Panes\§2§_$PRE_CurAutoSave$GEN_AutoSave_Suffix"; wait 300; status "$d_WithLay2 '$PRE_CurAutoSave' ".i(0,02); end 1, , 1; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Layout - Load $PRE_CurSessMaster = $PRE_CurSessBase; $DYN_InpSess = $PRE_CurSessMaster; if ($GEN_LayON && ($PRE_CurSessLay || $STG_LayFallbackDef)) || (!$GEN_LayON && $STG_StdResetWithLay) { $DYN_InpSessLay = ($GEN_LayON && $PRE_CurSessLay)? $PRE_CurSessMaster : "¦‡¦-Default-¦‡¦"; load "$GEN_CurScript", "_Layout-Load"; } // ---------------------------------------------------------<< // ---------------------------------------------> Xtras Regular - Show H/S/P // Must be set before loading tabset to prevent flatview reset if $STG_Xtras { sub "_Xtras-Regular-Load"; } // ---------------------------------------------< // --------------------------------------------------------->> Session - Load tabset("revert", , 1); wait 10; tabset("revert", , 2); wait 10; if $STG_AutoOptimizeTree { #1040; // Optimize Tree #1010; // Fully Collapse } #482; // Refresh Tree (clean remaining unavailable drives) // ---------------------------------------------------------<< status "$d_WithLay2 '$PRE_CurSess' ".i(0,02); // ------------------------------<> Force activation of SyncBrowse/Scroll (which can be ON but deactivated) if $STG_Xtras { if !get("#813") {#813;} #813; } /* Elevated if ($GEN_LayON && $STG_Xtras) { sub "_Xtras-Elevated"; } */ // ---------------------------------------------> Autorun Script sub "_AutorunScript" // ---------------------------------------------< /* ######################################################################################### */ /* ######################################################################################### */ "_Xtras-Regular-Load" // Hidden/System/Protected global $GEN_Ini, $GEN_AutoSave_Suffix, $DYN_InpSess; set $LayAct; // ---------------------------------------------> Visibility of Hidden/System/Protected $Section = $DYN_InpSess; $v_VH = get("#493"); $I_VH = getkey("ShowHidden", $Section, $GEN_Ini); $v_VS = get("#494"); $I_VS = getkey("ShowSystem", $Section, $GEN_Ini); $v_VP = get("#388"); $I_VP = getkey("ShowProtected", $Section, $GEN_Ini); // Display Hidden files $LayAct = ($v_VH != $I_VH + 0)? "$LayAct#493;" : $LayAct; // Display System files $LayAct = ($v_VS != $I_VS + 0)? "$LayAct#494;" : $LayAct; // Display Protected files $LayAct = ($v_VP != $I_VP + 0)? "$LayAct#388;" : $LayAct; // ---------------------------------------------< if $LayAct {load $LayAct,,"s";} /* ######################################################################################### */ /* ######################################################################################### */ "_AutorunScript" global $GEN_Ini, $GEN_AutoSave_Suffix, $DYN_InpSess; $Script = getkey("Script", replace("$DYN_InpSess", $GEN_AutoSave_Suffix), $GEN_Ini); if $Script { if ($Script Like "::*") { // Run script load $Script, , "s"; } else { // Load script $Label = trim(gettoken($Script, 2, ","), ' "'); $Script = trim(gettoken($Script, 1, ","), ' "'); load $Script, $Label; } } /* ######################################################################################### */ /* ######################################################################################### */ "_Xtras-Elevated" global $GEN_Ini, $DYN_InpSess; if (getkey("Elevated", $DYN_InpSess, $GEN_Ini) && regexmatches(runret("net session", %temp%), "err[^\n]+ 5 ")) { if confirm(.i(3,04).." - ".i(0,10)..i(3,05).." - ".i(0,11)..i(3,06), , , 3) { exit "sre"; } } elseif (!getkey("Elevated", $DYN_InpSess, $GEN_Ini) && !regexmatches(runret("net session", %temp%), "err[^\n]+ 5 ")) { if confirm(.i(3,07).." - ".i(0,10)..i(3,08)...i(3,09).." - ".i(0,11)..i(3,10), , , 3) { exit "s"; } } /* ######################################################################################### */ /* ######################################################################################### */ "_Update" global $GEN_CurScript, $GEN_Ini, $GEN_LayON, $GEN_AutoSave_Suffix, $STG_Confirmation, $STG_AutoSave, $STG_Xtras, $STG_LayWinPosSize; global $PRE_CurSess, $PRE_CurSessBase, $PRE_CurSessLay, $PRE_SessTab1, $PRE_SessTab2, $PRE_CurAutoSave, $DYN_InpSess, $DYN_NoInput, $DYN_InpSessLay; global $PRE_Xtra_Toolbar; $d_WithLay = ($GEN_LayON && ($PRE_CurSessLay || $DYN_InpSessLay))? i(4,01) : i(4,02); $d_WithLay2 = ($GEN_LayON && ($PRE_CurSessLay || $DYN_InpSessLay))? i(4,03) : i(0,01); // ------------------<> If accessed externally from Quick Control, Catalog, CKS, UDC, etc. if !$GEN_CurScript { sub "_Initialize"; } // ------------------------------------------------------------------------>>> If valid session // (two current tabsets from a single session, and in their appropriate pane - i.e. §1§ in Pane1) if $PRE_CurSess { // --------------------------------------------------------->> Autosave if ($STG_AutoSave && $PRE_CurAutoSave) { delete 1, 0, "\Panes\§1§_$PRE_CurAutoSave|\Panes\§2§_$PRE_CurAutoSave"; tabset("saveas", "§1§_$PRE_CurAutoSave", 1); wait 10; tabset("saveas", "§2§_$PRE_CurAutoSave", 2); delete 1, 0, "\Panes\§1§_$PRE_CurAutoSave$GEN_AutoSave_Suffix|\Panes\§2§_$PRE_CurAutoSave$GEN_AutoSave_Suffix"; $PRE_CurSess = $PRE_CurAutoSave; // ---------------------------------------------------------<< // --------------------------------------------------------->> Session - Save } else { if (!$DYN_NoInput && $STG_Confirmation) {end !confirm("$d_WithLay $PRE_CurSess ".i(5,01)." ");} tabset("save", , 1); wait 10; tabset("save", , 2); wait 10; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Layout - Save if (($GEN_LayON && $PRE_CurSessLay) || $DYN_InpSessLay) { // If session has layout, or coming from 'Save' with layout $DYN_InpSessLay = $PRE_CurSessBase; // ------------------<> Toolbar // TODO why here and not in layout-save? if $PRE_Xtra_Toolbar {setkey toolbar(), "XTRA-Toolbar", "Layout $PRE_CurSessLay", $GEN_Ini;} // ------------------<> Layout load "$GEN_CurScript", "_Layout-Save"; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Store status of Show Hidden/System/Protected if $STG_Xtras { setkey get("#493"), "ShowHidden", $PRE_CurSess, $GEN_Ini; setkey get("#494"), "ShowSystem", $PRE_CurSess, $GEN_Ini; setkey get("#388"), "ShowProtected", $PRE_CurSess, $GEN_Ini; /* Elevated if !regexmatches(runret("net session", %temp%), "err[^\n]+ 5 "){ setkey 1, "Elevated", $PRE_CurSess, $GEN_Ini; }*/ } // ---------------------------------------------------------<< wait 400; status "$d_WithLay2 '$PRE_CurSess' ".i(0,03); // ------------------------------------------------------------------------<<< // ------------------------------------------------------------------------>>> If invalid session } else { status i(5,02), "883333", "stop"; $d_Valid = ($PRE_SessTab1 || $PRE_SessTab2)? i(5,03) : i(5,04); msg "$d_Valid ".i(5,05)." ---> ".i(5,06)." "; sub "_About"; } // ------------------------------------------------------------------------<<< /* ######################################################################################### */ /* ######################################################################################### */ "_Delete" global $GEN_CurScript, $GEN_Ini, $GEN_TmpSession, $GEN_Lay_Suffix, $GEN_XToolbar_Suffix, $GEN_XScript_Suffix, $GEN_AutoSave_Suffix; global $PRE_l_AvailSessDet, $PRE_n_AvailSess, $PRE_SessTab1, $PRE_SessTab2, $PRE_CurAutoSave, $PRE_AutoSave; global $DYN_InpSessLay; // --------------------------------------------------------->> List available sessions not in use set $l_AvailSessDet; set $n_SessAvailDel; foreach($DelSess, $PRE_l_AvailSessDet, "|") { if !$DelSess {continue;} $DelSessBase = replacelist($DelSess, "$GEN_Lay_Suffix|$GEN_XToolbar_Suffix", , "|"); if ($DelSessBase != replace($PRE_SessTab1, $GEN_AutoSave_Suffix)) && ($DelSessBase != replace($PRE_SessTab2, $GEN_AutoSave_Suffix)) { $n_SessAvailDel++; $l_AvailSessDet = $l_AvailSessDet.$DelSess."|"; } } // ---------------------------------------------------------<< // --------------------------------------------------------->> Delete Validation if (!$n_SessAvailDel) { // End if only sessions are in use if ($PRE_n_AvailSess == 1) { if ($PRE_SessTab1 == $PRE_SessTab2) { // active session (valid or not) $d_NoDel = "".i(6,01)." $PRE_SessTab1 ".i(6,02)." ---> ".i(6,03); } else { $d_NoDel = "".i(6,04)." $PRE_SessTab1$PRE_SessTab2 ".i(6,02)." ---> ".i(6,05); } } elseif ($PRE_n_AvailSess == 2) { // 'if' shouldn't be needed. TBD $d_NoDel = "".i(6,06)." $PRE_SessTab1 $PRE_SessTab2 ".i(6,07)." ---> "i(6,08); } status i(6,09), "883333", "stop"; msg "$d_NoDel "; end 1; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Delete Dialog if (!$PRE_SessTab1 && !$PRE_SessTab2) { $d = i(6,12); $d2 = 2; } elseif ($PRE_SessTab1 == $PRE_SessTab2) { // active session (valid or not) $d = i(4,02)." ".replace($PRE_SessTab1, $GEN_AutoSave_Suffix)." "; $d2 = 1; } elseif ($PRE_SessTab1 && $PRE_SessTab2) { $d = i(6,10)." ".i(6,11)." '$PRE_SessTab1' , ".i(6,11)." '$PRE_SessTab2' ."; $d2 = 1; } elseif (($PRE_SessTab1 && !$PRE_SessTab2) || (!$PRE_SessTab1 && $PRE_SessTab2)) { $d = i(6,10)." ".i(6,11)." '$PRE_SessTab1$PRE_SessTab2' ."; $d2 = 1; } // ---------------------------------------------------------<< $d_SessAvail = ($n_SessAvailDel > 1)? i(6,15) : i(6,14); $d3 = ($d2 == 1)? $d_SessAvail : i(6,16); $l_AvailSessDet = inputselect("$d".i(6,13)." $d3", $l_AvailSessDet, , 2, i(6,09), 500, 700, i(6,17)); // ------------------------------------------------------------------------>>> Delete Action if $l_AvailSessDet && ($l_AvailSessDet != i(6,09)) { // --------------------------------------------------------->> Session - Delete foreach ($InpSess, $l_AvailSessDet, "|") { $i++; $InpSessLay = $InpSess; $InpSess = replacelist($InpSess, "$GEN_Lay_Suffix|$GEN_XToolbar_Suffix|$GEN_XScript_Suffix", "", "|"); $InpSessLay = ($InpSess != $InpSessLay)? $InpSess : ""; delete 1, 0, "\Panes\§1§_$InpSess|\Panes\§2§_$InpSess"; setkey "", "", $InpSess, $GEN_Ini; // Remove INI entry if ($InpSess == $PRE_AutoSave) { // If session had autosave session delete 1, 0, "\Panes\§1§_$InpSess$GEN_AutoSave_Suffix|\Panes\§2§_$InpSess$GEN_AutoSave_Suffix"; setkey "", "", $InpSess.$GEN_AutoSave_Suffix, $GEN_Ini; // Remove INI entry } if getkey("Script", $InpSess, $GEN_Ini) { // If session has associated script setkey "", "", $InpSess, $GEN_Ini; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Layout - Delete if $InpSessLay { $DYN_InpSessLay = $InpSess; load "$GEN_CurScript", "_Layout-Delete"; } // ---------------------------------------------------------<< } // --------------------------------------------------------->> Clean session order list $l_AllTabsets = listfolder(."\Panes", , "6")."|"; $l_SessionsOrder = getkey("SessionsOrder", "General", $GEN_Ini); if $l_SessionsOrder { foreach ($tsession, $l_SessionsOrder, "|") { if (($tsession != "-") && (($l_AllTabsets UnLikeI "*§1§_$tsession|*") || ($l_AllTabsets UnLikeI "*§2§_$tsession|*"))) { $l_SessionsOrder = replace("$l_SessionsOrder|", $tsession."|"); } } $l_SessionsOrder = trim(replacelist($l_SessionsOrder, "-|-,$GEN_TmpSession|", "-,", ","), "|-"); setkey "$l_SessionsOrder", "SessionsOrder", "General", $GEN_Ini; } // ---------------------------------------------------------<< wait 300; $del = i(0,01)." '$InpSess' ".i(0,06); // Single session $del_tmp = $GEN_TmpSession." ".i(0,06); // Temporary session $del2 = $i." ".i(6,18); // Multiple sessions $del = ($InpSess == $GEN_TmpSession)? $del_tmp : $del; $del = ($i == 1)? $del : $del2; status $del; // ------------------------------------------------------------------------<<< } else { wait 50; status i(6,09), "883333", "stop"; } /* ######################################################################################### */ /* ######################################################################################### */ "_Save" global $GEN_CurScript, $GEN_Ini, $GEN_LayON, $GEN_AutoSave_Suffix, $STG_EnableLayouts, $STG_AutoSave, $STG_UseIcons; global $PRE_CurSess, $PRE_CurSessBase, $PRE_CurSessLay, $PRE_CurSessInv, $PRE_SessTab1, $PRE_SessTab2, $PRE_l_AvailSess, $PRE_AutoSave, $PRE_CurAutoSave; global $DYN_InpSess, $DYN_NoInput, $DYN_InpSessLay; // --------------------------------------------------------->> If accessed externally from Quick Control, Catalog, CKS, UDC, etc. if $DYN_InpSess { $InpSess = $DYN_InpSess; // ---------------------------------------------------------<< // --------------------------------------------------------->> If regular save with user input } else { // ------------------<> Dialog text $d_Save1 = "".i(4,02)." $PRE_CurSess "; $d_Save1 = ($PRE_CurSess)? $d_Save1 : ""; $d_Save2 = "• ".i(7,01)." - ".i(7,02)." - ".i(7,03)." ".i(0,12)." - ".i(7,20)." - ".i(7,04).""; $d_Save2 = ($STG_EnableLayouts)? $d_Save2 : ""; // ------------------<> Input $InpSess = input(i(7,05).$d_Save1, " ".i(7,06)." ".i(7,07)." • ".i(7,08)." $d_Save2 ", , , "§CANCEL§", 1000); $InpSess = trim($InpSess); } // ---------------------------------------------------------<< // --------------------------------------------------------->> Layout - Detection if (substr($InpSess, 0, 1) == "?") { $InpSess = trim(substr($InpSess, 1)); $DYN_InpSessLay = $InpSess; } $d_CurWithLay = ($GEN_LayON && $PRE_CurSessLay)? i(4,01) : i(4,02); $d_InpWithLay = ($GEN_LayON && $DYN_InpSessLay)? i(4,03) : i(0,01); // ---------------------------------------------------------<< // ------------------<> Save validation $InvalidName = regexmatches($InpSess, '[\\/:\*\?"<>\|\[\]]', " "); end $InvalidName, " ".i(7,09)." $InvalidName ---> ".i(7,10)." "; if ($InpSess && ($InpSess != "§CANCEL§")) { // ------------------------------------------------------------------------>>> Conflict with current session if ($InpSess LikeI $PRE_SessTab1) || ($InpSess LikeI $PRE_SessTab2) { // If at least one loaded tabset belongs to the session to save // --------------------------------------------------------->> Update if $PRE_CurSess { // If saving name is name of current session $Update = confirm("$d_CurWithLay $PRE_CurSess ".i(5,01)." "); if $Update { $DYN_NoInput = 1; sub "_Update"; } else { status i(7,11), "883333", "stop"; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Cancel // ------------------<> Inverted session } elseif $PRE_CurSessInv { status , , "stop"; msg "".i(7,12)." $PRE_CurSessInv ".i(7,13)." ---> ".i(7,14)." "; // ------------------<> One tabset in use } else { status , , "stop"; msg "".i(7,15)." ".recase($InpSess, t)." ".i(7,16)." ---> ".i(7,14)." "; } } else { // ---------------------------------------------------------<< // ------------------------------------------------------------------------<<< // ------------------------------------------------------------------------>>> Save action if ($PRE_l_AvailSess == replace($PRE_l_AvailSess, "|".$InpSess."|", "")) { // If session doesn't exist (i.e. no tabset exists with same name as sesion) // --------------------------------------------------------->> Autosave if ($STG_AutoSave && $PRE_CurSess && ($PRE_CurAutoSave || !$PRE_AutoSave)) { if $PRE_CurAutoSave { // Update $PRE_CurAutoSave = $PRE_CurSess; tabset("save", , 1); wait 10; tabset("save", , 2); } else { // Save tabset("saveas", "§1§_$PRE_CurSess$GEN_AutoSave_Suffix", 1); wait 10; tabset("saveas", "§2§_$PRE_CurSess$GEN_AutoSave_Suffix", 2); } // ---------------------------------------------> Store status of Show Hidden/System/Protected if $STG_Xtras { setkey get("#493"), "ShowHidden", $PRE_CurSessBase.$GEN_AutoSave_Suffix, $GEN_Ini; setkey get("#494"), "ShowSystem", $PRE_CurSessBase.$GEN_AutoSave_Suffix, $GEN_Ini; setkey get("#388"), "ShowProtected", $PRE_CurSessBase.$GEN_AutoSave_Suffix, $GEN_Ini; } // ---------------------------------------------< } // ---------------------------------------------------------<< // --------------------------------------------------------->> Layout - Save if $DYN_InpSessLay { load "$GEN_CurScript", "_Layout-Save"; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Session - Save tabset("saveas", "§1§_$InpSess", 1); wait 10; tabset("saveas", "§2§_$InpSess", 2); wait 400; // DEBUG: status disappear with MiniTree,OptimizeTree+? status "$d_InpWithLay '$InpSess' ".i(0,05); // ---------------------------------------------------------<< // --------------------------------------------------------->> Store last session name for Quick Control setkey $InpSess, "CurrentSession", "General", $GEN_Ini; if ($PRE_CurSess && ($PRE_CurSessBase != $InpSess)) { setkey $PRE_CurSessBase, "PreviousSession", "General", $GEN_Ini; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Store status of Show Hidden/System/Protected if $STG_Xtras { setkey get("#493"), "ShowHidden", $InpSess, $GEN_Ini; setkey get("#494"), "ShowSystem", $InpSess, $GEN_Ini; setkey get("#388"), "ShowProtected", $InpSess, $GEN_Ini; /* Elevated if !regexmatches(runret("net session", %temp%), "err[^\n]+ 5 "){ setkey 1, "Elevated", $InpSess, $GEN_Ini; } */ } // ---------------------------------------------------------<< // --------------------------------------------------------->> Cancel if session already exists } else { msg "".i(7,17)." '".recase($InpSess, t)."' ".i(7,18)." ".i(7,19)." "; wait 400; status i(7,11), "883333", "stop"; } // ---------------------------------------------------------<< // ---------------------------------------------> Change button icon if $STG_UseIcons && ($SM_CTBINDEX > -1) { // If using icons and Session Manager button index known $Icon = getkey("Icon", $InpSess, $GEN_Ini); // Session Custom icon $DefaultIcon = "\".self("base").".ico"; // SM Custom icon $DefaultIcon = (exists($DefaultIcon))? $DefaultIcon : ":tabsets"; // SM Embedded icon $Icon = ($Icon)? $Icon : $DefaultIcon; ctbicon($Icon, $SM_CTBINDEX); } // ---------------------------------------------< } // ------------------------------------------------------------------------<<< } else { wait 400; status i(7,11), "883333", "stop"; } /* ######################################################################################### */ /* ######################################################################################### */ "_Save-Temporary" global $GEN_CurScript, $GEN_Ini, $GEN_TmpSession, $GEN_AutoSave_Suffix, $STG_AutoSave, $STG_UseIcons; global $PRE_CurSess, $PRE_CurSessBase, $PRE_CurSessLay, $PRE_CurSessInv, $PRE_SessTab1, $PRE_SessTab2, $PRE_SessTab1Inv, $PRE_AutoSave, $PRE_CurAutoSave, $PRE_TmpSession; global $DYN_InpSessLay; if !$GEN_CurScript { // If accessed externally from Catalog, CKS, UDC, etc. sub "_Initialize"; } $DYN_InpSessLay = $PRE_CurSessLay? $GEN_TmpSession : ""; // ------------------------------------------------------------------------>>> Update if ($GEN_TmpSession == $PRE_CurSess) { // If TMP is current session if $DYN_InpSessLay { load "$GEN_CurScript", "_Layout-Save"; } tabset("save", , 1); wait 10; tabset("save", , 2); // ------------------------------------------------------------------------<<< // ------------------------------------------------------------------------>>> Cancel } elseif (($PRE_CurSessInv == $GEN_TmpSession) || ($InpSess LikeI $PRE_SessTab1) || ($InpSess LikeI $PRE_SessTab2)) { // If TMP inverted or tabset from TMP msg "".i(8,01)." ".i(8,02)." "; end 1; // ------------------------------------------------------------------------<<< // ------------------------------------------------------------------------>>> Save - Temporary session } else { delete 1, 0, "\Panes\§1§_$GEN_TmpSession|\Panes\§2§_$GEN_TmpSession"; // --------------------------------------------------------->> Autosave if ($STG_AutoSave && ($PRE_CurAutoSave || !$PRE_AutoSave)) { if $PRE_CurAutoSave { // Update $PRE_CurAutoSave = $PRE_CurSess; tabset("save", , 1); wait 10; tabset("save", , 2); } else { // Save tabset("saveas", "§1§_$PRE_CurSess$GEN_AutoSave_Suffix", 1); wait 10; tabset("saveas", "§2§_$PRE_CurSess$GEN_AutoSave_Suffix", 2); } // ---------------------------------------------> Store status of Show Hidden/System/Protected if $STG_Xtras { setkey get("#493"), "ShowHidden", $PRE_CurSessBase.$GEN_AutoSave_Suffix, $GEN_Ini; setkey get("#494"), "ShowSystem", $PRE_CurSessBase.$GEN_AutoSave_Suffix, $GEN_Ini; setkey get("#388"), "ShowProtected", $PRE_CurSessBase.$GEN_AutoSave_Suffix, $GEN_Ini; } // ---------------------------------------------< } // ---------------------------------------------------------<< // --------------------------------------------------------->> Change button icon if $STG_UseIcons { setkey ":openwith", "Icon", $GEN_TmpSession, $GEN_Ini; if ($SM_CTBINDEX > -1) { // If using icons and Session Manager button index known ctbicon(":openwith", $SM_CTBINDEX); } } // ---------------------------------------------------------<< if $DYN_InpSessLay { load "$GEN_CurScript", "_Layout-Save"; } if !$PRE_SessTab1Inv { tabset("saveas", "§1§_$GEN_TmpSession", 1); wait 10; tabset("saveas", "§2§_$GEN_TmpSession", 2); } else { tabset("saveas", "§2§_$GEN_TmpSession", 2); wait 10; tabset("saveas", "§1§_$GEN_TmpSession", 1); } // --------------------------------------------------------->> Store last session name for Quick Control setkey $GEN_TmpSession, "CurrentSession", "General", $GEN_Ini; if $PRE_CurSess { setkey $PRE_CurSessBase, "PreviousSession", "General", $GEN_Ini; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Store status of Show Hidden/System/Protected if $STG_Xtras { setkey get("#493"), "ShowHidden", $GEN_TmpSession, $GEN_Ini; setkey get("#494"), "ShowSystem", $GEN_TmpSession, $GEN_Ini; setkey get("#388"), "ShowProtected", $GEN_TmpSession, $GEN_Ini; /* Elevated if !regexmatches(runret("net session", %temp%), "err[^\n]+ 5 "){ setkey 1, "Elevated", $GEN_TmpSession, $GEN_Ini; } */ } // ---------------------------------------------------------<< } // ------------------------------------------------------------------------<<< wait 400; // DEBUG: status disappear with MiniTree, OptimizeTree+? $TmpSession = $PRE_TmpSession? i(0,03) : i(0,05); status $GEN_TmpSession." ".$TmpSession; /* ######################################################################################### */ /* ######################################################################################### */ "_Rename" global $GEN_CurScript, $GEN_Ini, $GEN_AutoSave_Suffix; global $PRE_l_AvailSess, $PRE_CurSess, $PRE_CurSessBase, $PRE_CurSessLay, $PRE_SessTab1, $PRE_SessTab2, $PRE_AutoSave, $PRE_CurAutoSave; global $DYN_InpSessLay; if $PRE_CurSess { // If a valid session is active $PRE_CurSess = ($PRE_CurAutoSave)? $PRE_AutoSave : $PRE_CurSess; $InpSess = input(i(9,01)." '$PRE_CurSess'", "".i(9,02)." ".i(7,08)." ", $PRE_CurSess, , "§CANCEL§"); if ($InpSess && ($InpSess != "§CANCEL§")) { $InvalidName = regexmatches($InpSess, '[\\/:\*\?"<>\|\[\]]', " "); end $InvalidName, " ".i(7,09)." $InvalidName ---> ".i(9,03)." "; // ------------------------------------------------------------------------>>> Rename if (($InpSess UnLikeI $PRE_CurSess) && ("$InpSess$GEN_AutoSave_Suffix" UnLikeI $PRE_CurSess)) { // If new session name is different than current session name if ($PRE_l_AvailSess == replace($PRE_l_AvailSess, "|".$InpSess."|", "")) { // If session doesn't exist (i.e. no tabset exists with same name as sesion) $x = 1; $y = 1; if (get("pane") == 1) {$x = 2;} else {$y = 2;} $d_AutoSave = ($PRE_CurAutoSave)? $GEN_AutoSave_Suffix : ""; tabset("rename", "§$x§_$InpSess$d_AutoSave", $x); wait 10; tabset("rename", "§$y§_$InpSess$d_AutoSave", $y); if $PRE_CurAutoSave { renameitem("§1§_".$InpSess, "\Panes\§1§_$PRE_CurSess"); renameitem("§2§_".$InpSess, "\Panes\§2§_$PRE_CurSess"); } // --------------------------------------------------------->> Layout - Rename if $PRE_CurSessLay { $DYN_InpSessLay = replace($InpSess, $GEN_AutoSave_Suffix); load "$GEN_CurScript", "_Layout-Rename"; } // ---------------------------------------------------------<< // --------------------------------------------------------->> INI Entry - Rename $New_Ini = replace(readfile($GEN_Ini), "[".$PRE_CurSess."]", "[".$InpSess."]"); $New_Ini = replace($New_Ini, "[".$PRE_CurSess.$GEN_AutoSave_Suffix."]", "[".$InpSess.$GEN_AutoSave_Suffix."]"); writefile($GEN_Ini, $New_Ini, "o"); // ---------------------------------------------------------<< // --------------------------------------------------------->> Sessions order $SessionsOrder = replace(getkey("SessionsOrder", "General", $GEN_Ini), $PRE_CurSessBase, $InpSess); setkey "$SessionsOrder", "SessionsOrder", "General", $GEN_Ini; // ---------------------------------------------------------<< $Script = getkey("Script", $PRE_CurSess, $GEN_Ini); if $Script { setkey "", "", $PRE_CurSess, $GEN_Ini; setkey $Script, "Script", $InpSess, $GEN_Ini; } wait 500; status i(9,04)." '$PRE_CurSess' ".i(9,05)." '$InpSess'"; // ------------------------------------------------------------------------<<< // --------------------------------------------------------->> Cancel // ------------------<> Session already exists } else { msg "".i(7,17)." '".recase($InpSess, t)."' ".i(7,18)." ---> ".i(7,19)." "; status i(9,06), "883333", "stop"; } // ------------------<> Same name as current session } else { msg "".i(9,07)." '$PRE_CurSess' . "; status i(9,06), "883333", "stop"; } } else { wait 50; status i(9,06), "883333", "stop"; } // ------------------<> Invalid session } else { $d_Valid = ($PRE_SessTab1 || $PRE_SessTab2)? i(5,03) : i(5,04); msg "$d_Valid ---> ".i(9,08)." "; status i(9,06), "883333", "stop"; } // ---------------------------------------------------------<< /* ######################################################################################### */ /* ######################################################################################### */ "_ReorderSessionList" global $GEN_Ini, $GEN_TmpSession, $PRE_l_AvailSess, $DYN_SessionsOrder; $l_AllTabsets = listfolder(."\Panes", , "6")."|"; $l_SessionsOrder = getkey("SessionsOrder", "General", $GEN_Ini); $l_AvailSess = $PRE_l_AvailSess; while ($i++ < 2) { // ------------------<> 1st: Clean original (INI) list // ------------------<> 2nd: Clean new user-input list if $l_SessionsOrder { foreach ($tsession, $l_SessionsOrder, "|") { if ($tsession != "-") { if (($l_AllTabsets UnLikeI "*§1§_$tsession|*") || ($l_AllTabsets UnLikeI "*§2§_$tsession|*")) { $l_SessionsOrder = replace("|$l_SessionsOrder|", "|$tsession|", "|"); } if (gettoken("|$l_SessionsOrder|", "count", "|$tsession|") > 2) { // Remove (improbable) duplicates $l_SessionsOrder = gettoken("|$l_SessionsOrder|", 1, "|$tsession|")."|$tsession".replace("|".gettoken("|$l_SessionsOrder|", 2, "|$tsession|", , 2), "$tsession|"); } $l_AvailSess = formatlist(replace("|$l_AvailSess|", "|$tsession|", "|"), "dents", "|"); } } if ($i == 1) { // Display ordered sessions, empty lines, then unordered sessions $l_SessionsOrder = trim($l_SessionsOrder, "|")."||||".replace(replace($l_AvailSess, $GEN_TmpSession), "||", "|"); } } elseif ($i == 1) { $l_SessionsOrder = replace($PRE_l_AvailSess, "$GEN_TmpSession"); } $l_SessionsOrder = regexreplace(trim(regexreplace($l_SessionsOrder, "(-\|)+", "-|"), "|"), "(^-\|)|(\|-$)"); $l_AvailSess = replace(formatlist($l_SessionsOrder, "dents", "|"), "-|"); if ($i == 1) { $Input = input(i(10,01), i(10,02), replace("$l_SessionsOrder", "|", ""), "m", , 600, 700); $l_SessionsOrder = trim(formatlist(replace($Input, "", "|"), "e", "|"), "|")."|-"; } } $DYN_SessionsOrder = $l_SessionsOrder; /* ######################################################################################### */ /* ######################################################################################### */ "_SwitchSessions" global $GEN_CurScript, $GEN_Ini, $PRE_CurSess, $PRE_l_AvailSess, $DYN_InpSess; if !$GEN_CurScript { // If accessed externally from Catalog, CKS, UDC, etc. sub "_Initialize"; } if $PRE_CurSess { $LastSession = getkey("PreviousSession", "General", $GEN_Ini); } else { $LastSession = getkey("CurrentSession", "General", $GEN_Ini); } if ("|$PRE_l_AvailSess" LikeI "*|$LastSession|*") { $DYN_InpSess = $LastSession; sub "_Load"; } else { msg " ".i(1,11); } /* ######################################################################################### */ /* ######################################################################################### */ "_Save-QuickSession" global $GEN_CurScript, $DYN_InpSess; if !$GEN_CurScript { // If accessed externally from Catalog, CKS, UDC, etc. sub "_Initialize"; } $d_Layout = (get("Shift") == 3)? "?" : ""; // If CTRL+SHIFT+Click save session with layout $QuickName = trim(tab("get", "path"), "\"); if ($QuickName Like "*\*") { $d_SubPath = (strpos($QuickName, "\", 3) > 0)? "... › " : ""; $QuickName = replacelist(gettoken($QuickName, -1, "\"), "[]", "¦"); $d_Ellips = (strlen($QuickName) > 20)? "..." : ""; $QuickName = $d_SubPath.substr($QuickName, 0, 20).$d_Ellips; } else { $QuickName = ""; } $QuickName = $d_Layout.regexreplace(, "(\d\d)$", "h$1")." - “".substr(tab("get", "path"), 0, 1)." › ".$QuickName."”"; $DYN_InpSess = $QuickName; sub "_Save"; /* ######################################################################################### */ /* ######################################################################################### */ "_LoadFavoriteSession" global $GEN_CurScript, $GEN_Ini, $PRE_l_AvailSess, $PRE_FavoriteSession, $DYN_InpSess; if !$GEN_CurScript { // If accessed externally from Catalog, CKS, UDC, etc. sub "_Initialize"; } if ("|$PRE_l_AvailSess" Like "*|$PRE_FavoriteSession|*") { $DYN_InpSess = $PRE_FavoriteSession; sub "_Load"; } else { msg " ".i(1,12); status , , "alert"; } /* ######################################################################################### */ /* ######################################################################################### */ "_SetFavoriteSession" global $GEN_CurScript, $GEN_Ini, $GEN_AutoSave_Suffix, $PRE_CurSess, $PRE_CurSessBase, $PRE_FavoriteSession; // ------------------<> No active or valid session end !$PRE_CurSess, i(5,03); // ------------------<> If accessed externally from Quick Control, Catalog, CKS, UDC, etc. if !$GEN_CurScript { sub "_Initialize"; } // ------------------<> Unset as favorite if (replace("$PRE_CurSess", "$GEN_AutoSave_Suffix") == $PRE_FavoriteSession) { setkey "", "FavoriteSession", "General", $GEN_Ini; status i(1,14)." ".i(0,14), , "ready"; // ------------------<> Set as favorite } elseif $PRE_CurSess { $MM_number = getkey("favorite", "MouseModifiers", $GEN_Ini); if $MM_number { $MM_name = "Shift|Ctrl|Ctrl+Shift|Alt|Alt+Shift|Ctrl+Alt|Ctrl+Alt+Shift"; $MM_name = gettoken($MM_name, $MM_number, "|"); } else { $MM_name = i(18,07); } end !confirm("".i(0,01)." '".$PRE_CurSessBase."' ".i(1,13)." - ".i(14,77)." ".i(14,78)." $MM_name - ".i(14,79)." "); setkey $PRE_CurSessBase, "FavoriteSession", "General", $GEN_Ini; status i(1,14)." ".i(0,13), , "ready"; // ------------------<> Invalid session } else { msg " ".i(5,03); status , , "alert"; } /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ########################*/ /* ### Layout Manager ###*/ /* ########################*/ "_Layout-Load" global $GEN_Ini, $GEN_LayON, $GEN_AutoSave_Suffix, $STG_LayFallbackDef, $STG_StdResetWithLay, $STG_LayInfoPanelPreview, $STG_LayWinPosSize, $STG_LayCatalog; global $PRE_CurSessLay, $PRE_Xtra_Toolbar, $DYN_InpSess, $DYN_InpSessLay, $DYN_b_InpSessLay; set $LayAct; $Section = "Layout ".$DYN_InpSessLay; // TODO load alternate > save? // ------------------------------------------------------------------------>>> Save current layout // If entering a layout-session AND leaving a Non-layout-session AND 'Fallback to Default' OFF if ($GEN_LayON && !$PRE_CurSessLay && $DYN_b_InpSessLay && !$STG_LayFallbackDef) { $bkp = $DYN_InpSessLay; $DYN_InpSessLay = "¦‡¦-Last-¦‡¦"; // remember fallback layout (i.e. current unsaved layout) sub "_Layout-Save"; // to be loaded next time a non-layout-session is loaded $DYN_InpSessLay = $bkp; } // ------------------------------------------------------------------------<<< // ------------------------------------------------------------------------>>> Load layout // --------------------------------------------------------->> Regular layout, XY default setlayout(getkey("FullLayout", $Section, $GEN_Ini)); // ---------------------------------------------------------<< // --------------------------------------------------------->> Regular layout, Bonus features - ActivePane, ShowSortHeaders // $v = what is ('v'isually exists); $I = what must be (read from 'I'ni); $v_AP = get("pane"); $I_AP = getkey("ActivePane", $Section, $GEN_Ini); $v_SH = get("#312"); $I_SH = getkey("ShowSortHeaders", $Section, $GEN_Ini); // ------------------<> Restore active pane $LayAct = ($v_AP != $I_AP)? "$LayAct#802;" : $LayAct; // ------------------<> Show sort headers in all views $LayAct = ($v_SH != $I_SH + 0)? "$LayAct#312;" : $LayAct; // +0 needed for update when $I-SH key doesn't exist // ------------------<> Force Preview visible $LayAct = (get("#665") && $STG_LayInfoPanelPreview)? "$LayAct#1021;#1023;" : $LayAct; // #1021 switch to prevent IP close when preview already visible // ---------------------------------------------------------<< // --------------------------------------------------------->> Xtras layout - SyncScroll, SyncBrowse, DarkMode, ThumbsConf if $STG_Xtras { $Section = "Layout ".$DYN_InpSessLay; $v_SS = get("#813"); $I_SS = getkey("SyncScroll", $Section, $GEN_Ini); $v_SB = get("#814"); $I_SB = getkey("SyncBrowse", $Section, $GEN_Ini); $v_DM = get("#316"); $I_DM = getkey("DarkMode", $Section, $GEN_Ini); $I_TC = getkey("ThumbsConf", $Section, $GEN_Ini); $LayAct = ($v_SS != $I_SS + 0)? "$LayAct#813;" : $LayAct; $LayAct = ($v_SB != $I_SB + 0)? "$LayAct#814;" : $LayAct; $LayAct = ($v_DM != $I_DM + 0)? "$LayAct#316;" : $LayAct; $LayAct = $I_TC? "$LayAct"."thumbsconf(""".$I_TC.""");" : $LayAct; } // ---------------------------------------------------------<< / Xtras layout // --------------------------------------------------------->> Toolbar and window if $DYN_InpSess { // If not reset layout from menu (but loading session) $revert = $STG_LayFallbackDef? "¦‡¦-Default-¦‡¦" : "¦‡¦-Last-¦‡¦"; // ---------------------------------------------> Toolbar $DYN_Xtra_Toolbar = getkey("XTRA-Toolbar", "Layout ".replace($DYN_InpSess, $GEN_AutoSave_Suffix), $GEN_Ini); if ($DYN_Xtra_Toolbar || $PRE_Xtra_Toolbar) { $DYN_Xtra_Toolbar = !$DYN_Xtra_Toolbar? getkey("XTRA-Toolbar", "Layout ".$revert, $GEN_Ini) : $DYN_Xtra_Toolbar; toolbar($DYN_Xtra_Toolbar); // Load new Toolbar --- Note: Visual BUG caused by button menu overlay } // ---------------------------------------------< } // ---------------------------------------------------------<< // --------------------------------------------------------->> Other layout extras: Window position and size, catalog... sub "_Layout-Load-WinPosSize"; // ------------------<> Catalog if $STG_LayCatalog { $DYN_Xtra_Catalog = getkey("Catalog", $Section, $GEN_Ini); $DYN_Xtra_Catalog = !$DYN_Xtra_Catalog? getkey("Catalog", "Layout ¦‡¦-Last-¦‡¦", $GEN_Ini) : $DYN_Xtra_Catalog; catalogload $DYN_Xtra_Catalog; setkey $DYN_Xtra_Catalog, "CatalogPerm", "General"; savesettings 2; // Save catalog } // ---------------------------------------------------------<< if $LayAct {load $LayAct,,"s";} // ------------------------------------------------------------------------<<< /* ######################################################################################### */ /* ######################################################################################### */ "_Layout-Load-WinPosSize" global $GEN_Ini, $STG_LayWinPosSize, $DYN_InpSessLay; if $STG_LayWinPosSize { // ---------------------------------------------> Maximize window if getkey("Maximize", "Layout ".$DYN_InpSessLay, $GEN_Ini) { #1028; // ---------------------------------------------< // ---------------------------------------------> Restore window, and adjust position and size } else { // ------------------<> Restore if fullscreen $fullwidth = ((get("Screen", "width") - (gettoken(controlposition("XY"), 3, "|") - gettoken(controlposition("XY"), 1, "|"))) > 100)? 0 : 1; $fullheight = ((get("Screen", "height") - (gettoken(controlposition("XY"), 4, "|") - gettoken(controlposition("XY"), 2, "|"))) > 100)? 0 : 1; if $fullwidth*$fullheight { #1029; } // ------------------<> Position and size $XYWinPosSize = getkey("XYWinPosSize", "Layout ".$DYN_InpSessLay, $GEN_Ini); if ($XYWinPosSize && ($XYWinPosSize != replace(controlposition("XY"), "|", " "))) { // If different position and size winpos gettoken($XYWinPosSize, 1), gettoken($XYWinPosSize, 2); winsize gettoken($XYWinPosSize, 3), gettoken($XYWinPosSize, 4); } } // ---------------------------------------------< } /* ######################################################################################### */ /* ######################################################################################### */ "_Layout-Save-WinPosSize" global $GEN_Ini, $STG_LayWinPosSize, $DYN_InpSessLay; $Section = "Layout ".$DYN_InpSessLay; // ---------------------------------------------> Window settings if ($STG_LayWinPosSize || ($DYN_InpSessLay == "¦‡¦-Default-¦‡¦")) { // Also force write settings to default layout $fullwidth = ((get("Screen", "width") - (gettoken(controlposition("XY"), 3, "|") - gettoken(controlposition("XY"), 1, "|"))) > 100)? 0 : 1; $fullheight = ((get("Screen", "height") - (gettoken(controlposition("XY"), 4, "|") - gettoken(controlposition("XY"), 2, "|"))) > 100)? 0 : 1; setkey $fullwidth*$fullheight, "Maximize", $Section, $GEN_Ini; if !($fullwidth*$fullheight) { // If not fullscreen, store position and size setkey replace(controlposition("XY"), "|", " "), "XYWinPosSize", $Section, $GEN_Ini; } } // ---------------------------------------------< /* ######################################################################################### */ /* ######################################################################################### */ "_Layout-Save" global $GEN_Ini, $STG_Xtras, $STG_LayWinPosSize, $STG_LayCatalog; global $DYN_InpSessLay, $PRE_Xtra_Toolbar; $Section = "Layout ".$DYN_InpSessLay; // --------------------------------------------------------->> Regular layout, XY default setkey setlayout(), "FullLayout", $Section, $GEN_Ini; // ---------------------------------------------------------<< // --------------------------------------------------------->> Regular layout, Bonus features - ActivePane, ShowSortHeaders setkey get("pane"), "ActivePane", $Section, $GEN_Ini; setkey get("#312"), "ShowSortHeaders", $Section, $GEN_Ini; // ---------------------------------------------------------<< // --------------------------------------------------------->> Xtras layout - SyncScroll, SyncBrowse, DarkMode, ThumbsConf if ($STG_Xtras || ($DYN_InpSessLay == "¦‡¦-Default-¦‡¦")) { // Also include Xtras in default layout setkey get("#813"), "SyncScroll", $Section, $GEN_Ini; setkey get("#814"), "SyncBrowse", $Section, $GEN_Ini; setkey get("#316"), "DarkMode", $Section, $GEN_Ini; setkey thumbsconf(), "ThumbsConf", $Section, $GEN_Ini; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Other layout extras - Window position and size, Catalog... sub "_Layout-Save-WinPosSize"; // ------------------<> Catalog if $STG_LayCatalog { savesettings 3; // Save XYplorer.ini and catalog setkey getkey("CatalogPerm", "General"), "Catalog", $Section, $GEN_Ini; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Autosave to last layout // ---------------------------------------------> Toolbar $DYN_Xtra_Toolbar = getkey("XTRA-Toolbar", "Layout ".$DYN_InpSessLay, $GEN_Ini); if ($DYN_Xtra_Toolbar && !$PRE_Xtra_Toolbar) { // TODO check if working with regular save // if could be streamline Dyn_inpsesslay setkey toolbar(), "XTRA-Toolbar", "Layout ¦‡¦-Last-¦‡¦", $GEN_Ini; // Save last Toolbar } // ---------------------------------------------< // ---------------------------------------------------------<< /* ######################################################################################### */ /* ######################################################################################### */ "_Layout-Rename" global $GEN_Ini, $PRE_CurSessLay, $DYN_InpSessLay; // ------------------<> Read old layout $LayIni = replace(readfile("$GEN_Ini"), $PRE_CurSessLay,"¦‡¦-#########-¦‡¦"); $LayIni = regexreplace($LayIni, "^(.|\n)*(\[Layout ¦‡¦-#########-¦‡¦\][^\[]*)(.|\n)*$", "$2"); // ------------------<> Delete old layout $Section = "Layout ".$PRE_CurSessLay; setkey "", "", $Section, $GEN_Ini; // ------------------<> Save renamed layout $LayIni = replace($LayIni, "¦‡¦-#########-¦‡¦", $DYN_InpSessLay); writefile("$GEN_Ini", $LayIni, "a"); /* ######################################################################################### */ /* ######################################################################################### */ "_Layout-Delete" global $GEN_Ini, $DYN_InpSessLay; $Section = "Layout ".$DYN_InpSessLay; setkey "", "", $Section, $GEN_Ini; /* ######################################################################################### */ /* ######################################################################################### */ "_Layout-Reset" global $GEN_CurScript, $PRE_CurSessLay, $DYN_InpSessLay, $DYN_b_InpSessLay, $DYN_InfoPanel; if !$GEN_CurScript { // If accessed externally from Catalog, CKS, UDC, etc. sub "_Initialize"; } $DYN_InpSessLay = ($DYN_b_InpSessLay)? $PRE_CurSessLay : "¦‡¦-Default-¦‡¦"; if ($DYN_InpSessLay == "¦‡¦-Default-¦‡¦") { perm $SM_LAYOUT = $DYN_InpSessLay; } /* Behaviour changed // ------------------<> CAUTION: uses icon from menu entries if ((caller("icon") == ":autorefresh") || (caller("icon") == ":del")) { // If accessed internaly $DYN_InpSessLay = "¦‡¦-Default-¦‡¦"; } else { $DYN_InpSessLay = !($PRE_CurSessLay)? "¦‡¦-Default-¦‡¦" : $PRE_CurSessLay; } $DYN_b_InpSessLay = 0; */ load $GEN_CurScript, "_Layout-Load"; wait 400; status i(11,18); /* ######################################################################################### */ /* ######################################################################################### */ "_Layout-Alternate" // External Access only, from Catalog, CKS, UDC, etc. global $GEN_CurScript, $DYN_InpSessLay; sub "_Initialize"; $DYN_InpSessLay = "¦‡¦-Alternate-¦‡¦"; perm $SM_LAYOUT = $DYN_InpSessLay; load $GEN_CurScript, "_Layout-Load"; wait 400; status i(11,36); /* ######################################################################################### */ /* ######################################################################################### */ "_Layout-Switch" // External Access only, from Catalog, CKS, UDC, etc. global $GEN_CurScript, $DYN_InpSessLay; sub "_Initialize"; $DYN_InpSessLay = ($SM_LAYOUT == "¦‡¦-Default-¦‡¦")? "¦‡¦-Alternate-¦‡¦" : "¦‡¦-Default-¦‡¦"; perm $SM_LAYOUT = $DYN_InpSessLay; load $GEN_CurScript, "_Layout-Load"; wait 400; status i(11,36); /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* #######################*/ /* ### Options ###*/ /* #######################*/ "_Options-Settings" global $GEN_Ini, $OPT_b_State, $OPT_Setting; if $OPT_b_State { setkey "0", $OPT_Setting, "Settings", $GEN_Ini; $d = i(15,02); } else { setkey "1", $OPT_Setting, "Settings", $GEN_Ini; $d = i(15,03); } if ($OPT_Setting == "Confirmation") { $status = i(15,07); } elseif ($OPT_Setting == "SessionListOnTop") { $status = i(15,08); } elseif ($OPT_Setting == "AutoOptimizeTree") { $status = i(15,09); } elseif ($OPT_Setting == "EnableLayouts") { $status = i(15,10); } elseif ($OPT_Setting == "LayFallbackDef") { $status = i(15,11); } elseif ($OPT_Setting == "StdResetWithLay") { $status = i(15,12); } elseif ($OPT_Setting == "LayInfoPanelPreview") { $status = i(15,13); } elseif ($OPT_Setting == "Xtras") { $status = i(15,14); } elseif ($OPT_Setting == "AutoSave") { $status = i(15,15); } elseif ($OPT_Setting == "Separator") { $status = i(15,16); } elseif ($OPT_Setting == "LayWinPosSize") { $status = i(15,17); } elseif ($OPT_Setting == "LayCatalog") { $status = i(15,18); } elseif ($OPT_Setting == "AutoUpdateAll") { $status = i(15,19); } // ------------------<> Setting changed if (getkey($OPT_Setting, "Settings", $GEN_Ini) != $OPT_b_State) { wait 400; status i(15,01)." '".$status."' $d ".i(15,04); // ------------------<> Problem accessing INI } else { msg " ".i(15,05)." $GEN_Ini ".i(15,01)." '".$status."' ".i(15,06).". "; wait 400; status i(15,01)." '".$status."' ".i(15,06), "883333", "stop"; } /* ######################################################################################### */ /* ######################################################################################### */ "_Options-Tweak" // Compatibility with updates from old XY versions (pane deactivation tweak) if confirm("".i(16,01)." TabsetsNoPaneActivation ".i(16,02)." ".i(16,03)." ---> ".i(16,04)." • ".i(16,05)." '".i(2,18)."' > '".i(14,39)."'. ") { #193; // Save configuration setkey "1", "TabsetsNoPaneActivation", "Settings"; status i(16,06)." 'TabsetsNoPaneActivation' ".i(0,06); wait 50; #190; // Restart without saving } else { status i(16,06)." 'TabsetsNoPaneActivation' ".i(16,07), , "stop"; } /* ######################################################################################### */ /* ######################################################################################### */ "_ChangeIcons" global $SM_CTBINDEX; global $GEN_Ini, $GEN_CurScript, $GEN_AutoSave_Suffix, $PRE_CurSess, $PRE_CurSessBase, $PRE_l_AvailSess; $CurSession = inputselect(i(14,43), "$PRE_l_AvailSess", "|", 8, , 500, 650, i(14,44)); if "$CurSession" { $d_remove = getkey("Icon", "$CurSession", "$GEN_Ini")? "Ά".i(14,71)."|remove|:del" : ""; $Icon = inputselect(i(14,44)." '$CurSession'", i(14,73).."|internal|xyplorer.exeΆ".i(14,74)."|external|:newfile".$d_remove, "Ά", 1+1024+8192, , 500, 300, i(14,44)); // ---------------------------------------------> Add icon if ($Icon != "remove") { // ------------------<> Source XYplorer internal if ($Icon == "internal") { global $DYN_icon; load "$GEN_CurScript", "_IconList"; $Icon = $DYN_icon; // ------------------<> Source external } else { $Icon = resolvepath(inputfile("", "ico|exe", i(14,44)), "", 1); } // ------------------<> Change icon if !$Icon {continue} setkey "$Icon", "Icon", "$CurSession", "$GEN_Ini"; setkey 1, "UseIcons", "Settings", "$GEN_Ini"; if ($CurSession == replace("$PRE_CurSess", "$GEN_AutoSave_Suffix")) && ($SM_CTBINDEX > -1) { // If session is current and Session Manager button index known ctbicon($Icon, $SM_CTBINDEX); } status i(14,47)." '$CurSession' ".i(0,08); // ---------------------------------------------< / Add icon // ---------------------------------------------> Remove icon } else { setkey "", "Icon", "$CurSession", "$GEN_Ini"; if ($CurSession == replace("$PRE_CurSess", "$GEN_AutoSave_Suffix")) && ($SM_CTBINDEX > -1) { // If session is current and Session Manager button index known $DefaultIcon = "\".caller("base").".ico"; // SM Custom icon $DefaultIcon = (exists($DefaultIcon))? $DefaultIcon : ":tabsets"; // SM Embedded icon ctbicon($DefaultIcon, $SM_CTBINDEX); } if (readfile("$GEN_Ini") UnLike "*Icon=*") { setkey 0, "UseIcons", "Settings", "$GEN_Ini"; // Reset UseIcons setting } status i(14,47)." '$CurSession' ".i(0,09); } // ---------------------------------------------< / Remove icon } /* ######################################################################################### */ /* ######################################################################################### */ "_MouseModifiers-SaveDefault" global $GEN_Ini; setkey "02", 2, "MouseModifiers", $GEN_Ini; // Ctrl setkey "03", 4, "MouseModifiers", $GEN_Ini; // Alt setkey "05", 1, "MouseModifiers", $GEN_Ini; // Shift setkey "09", 6, "MouseModifiers", $GEN_Ini; // Ctrl+Alt setkey "00", 3, "MouseModifiers", $GEN_Ini; // Ctrl+Shift setkey "06", 5, "MouseModifiers", $GEN_Ini; // Alt+Shift setkey "00", 7, "MouseModifiers", $GEN_Ini; // Ctrl+Alt+Shift setkey 5, "favorite", "MouseModifiers", $GEN_Ini; "_MouseModifiers" global $GEN_CurScript, $GEN_Ini; if !getkey("", "MouseModifiers", $GEN_Ini) { sub "_MouseModifiers-SaveDefault"; } // ---------------------------------------------> Select mouse modifier set $l_MM; $l_MM = $l_MM."Ctrl".i(51,getkey(2, "MouseModifiers", $GEN_Ini)).; $l_MM = $l_MM."Alt".i(51,getkey(4, "MouseModifiers", $GEN_Ini)).; $l_MM = $l_MM."Shift".i(51,getkey(1, "MouseModifiers", $GEN_Ini)).; $l_MM = $l_MM."Ctrl+Alt".i(51,getkey(6, "MouseModifiers", $GEN_Ini)).; $l_MM = $l_MM."Ctrl+Shift".i(51,getkey(3, "MouseModifiers", $GEN_Ini)).; $l_MM = $l_MM."Alt+Shift".i(51,getkey(5, "MouseModifiers", $GEN_Ini)).; $l_MM = $l_MM."Ctrl+Alt+Shift".i(51,getkey(7, "MouseModifiers", $GEN_Ini)).; $l_MM = $l_MM."< Reset >".i(18,02); $MM_number = inputselect(i(18,03)..i(18,04)..i(18,05)..i(18,06), $l_MM, , 8+64+128+1024, , , 450, i(18,01)); if ($MM_number < 8) { $MM_number = gettoken("2 4 1 6 3 5 7", $MM_number); $MM_command = getkey($MM_number, "MouseModifiers", $GEN_Ini); } else { sub "_MouseModifiers-SaveDefault"; sub "_ToolbarButton"; status i(18,21); end 1; } $MM_name = "Shift|Ctrl|Ctrl+Shift|Alt|Alt+Shift|Ctrl+Alt|Ctrl+Alt+Shift"; $MM_name = gettoken($MM_name, $MM_number, "|"); // ---------------------------------------------< // ---------------------------------------------> Select command set $l_MMC; while ($i++ < 11) { $itxt = ($i < 10)? "0".$i : $i; $sel = ($i == $MM_command)? "*" : ""; $l_MMC = $l_MMC..$sel.i(51,$itxt); } $l_MMC = trim($l_MMC, ).."< ".i(18,07)." >"; $MM_newcommand = inputselect(i(18,08)." ".$MM_name..i(18,09), $l_MMC, , 8+128+1024, , 800, 500, i(18,01), "*"); if ($MM_newcommand < 10) { $MM_newcommand = "0".$MM_newcommand; if ($MM_newcommand == "06") { // Set as favorite setkey $MM_number, "favorite", "MouseModifiers", $GEN_Ini; } } elseif ($MM_newcommand > 11) { $MM_newcommand = "00"; } if (($MM_command == "06") && ($MM_newcommand != "06")) { // Set favorite removed from mouse modifiers // TODO (safeguard) check if other MM may also be 6 setkey "", "favorite", "MouseModifiers", $GEN_Ini; } setkey $MM_newcommand, $MM_number, "MouseModifiers", $GEN_Ini; // ---------------------------------------------< // ---------------------------------------------> Update Session Manager button text sub "_ToolbarButton"; status i(18,22); // ---------------------------------------------< /* ######################################################################################### */ /* ######################################################################################### */ "_About" global $GEN_SMVersion, $GEN_CurScript, $GEN_Ini, $GEN_LayUsed, $STG_UseIcons; global $PRE_CurSess, $PRE_CurSessBase, $PRE_CurSessInv, $PRE_SessTab1, $PRE_SessTab2, $DYN_InpSessLay; $d_SM_Version = "Session Manager v$GEN_SMVersion ---------------------------"; // --------------------------------------------------------->> Analyze session/tabsets // ------------------<> Valid session if ($PRE_CurSess) { $SessStatus = $d_SM_Version.i(4,02)." $PRE_CurSess "; // ------------------<> Inverted session } elseif ($PRE_CurSessInv) { $SessStatus = $d_SM_Version.i(4,02)." $PRE_CurSessInv ".i(17,01)." ---> ".i(17,02)." "; // ------------------<> Mixed session } elseif ($PRE_SessTab1 && $PRE_SessTab2) { $SessStatus = $d_SM_Version.i(17,03)." ".i(17,04)." $PRE_SessTab1 ".i(17,05)." $PRE_SessTab2 "; // ------------------<> 1st session & 2nd tabset } elseif ($PRE_SessTab1 && !$PRE_SessTab2) { $SessStatus = $d_SM_Version.i(17,06)." ".i(17,04)." $PRE_SessTab1 ".i(17,07)." ".gettoken(, -1, "\")." "; // ------------------<> 1st tabset & 2nd session } elseif (!$PRE_SessTab1 && $PRE_SessTab2) { $SessStatus = $d_SM_Version.i(17,06)." ".i(17,08)." ".gettoken(, -1, "\")." ".i(17,05)." $PRE_SessTab2 "; // ------------------<> Tabsets only } else { $SessStatus = $d_SM_Version.i(17,09)." ".i(17,10)." ".gettoken(, -1, "\")." ".i(17,11)." ".gettoken(, -1, "\")." "; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Update toolbar button icon if ($STG_UseIcons && !$PRE_CurSess && ($SM_CTBINDEX > -1)) { // if no valid active session and Session Manager button index known $DefaultIcon = "\".caller("base").".ico"; // SM Custom icon $DefaultIcon = (exists($DefaultIcon))? $DefaultIcon : ":tabsets"; // SM Embedded icon ctbicon($DefaultIcon, $SM_CTBINDEX); } // ---------------------------------------------------------<< // --------------------------------------------------------->> Check orphans // Unique tabsets previously belonging to a session (e.g. '§1§_MySession' present but not '§2§_MySession') $l_AllTabsets = listfolder(."\Panes", , "6")."|"; status "Session Manager", , "progress"; set $OrphSess; set $l_OrphSess; foreach ($tsession, $l_AllTabsets, "|") { if ($tsession && ($tsession Like "*§1§_*")) { $tsession = replace($tsession, "§1§_", ""); if ($l_AllTabsets == replace($l_AllTabsets, "§2§_".$tsession."|", "")) { $i++; $OrphSess = $OrphSess." §1§_".$tsession." "; $l_OrphSess = $l_OrphSess."§1§_".$tsession."|"; } } elseif ($tsession Like "*§2§_*") { $tsession = replace($tsession, "§2§_", ""); if ($l_AllTabsets == replace($l_AllTabsets, "§1§_".$tsession."|", "")) { $i++; $OrphSess = $OrphSess." §2§_".$tsession." "; $l_OrphSess = $l_OrphSess."§2§_".$tsession."|"; } } } // ---------------------------------------------------------<< // --------------------------------------------------------->> Display About window // ---------------------------------------------> Clean orphan tabsets manually if ($i > 0) { $i = ($i > 1)? i(17,12) : i(17,13); // Orphan tabsets/tabset if (confirm("$SessStatus _________________________ $i, ".i(17,14)." $OrphSess---> ".i(17,15)." ")) { #340; #858; #523; // Open tabsets folder in new tab #1016; selectitems $l_OrphSess; } // ---------------------------------------------< } else { msg "$SessStatus"; } // ---------------------------------------------------------<< // --------------------------------------------------------->> Clean up orphan entries automatically if $GEN_LayUsed { $l_LayIni = regexreplace(readfile($GEN_Ini), "\n(\w|\s).*\r", ""); // Remove everything but sections $l_LayIni = regexreplace($l_LayIni, "(\[General|\[Settings|\[MouseModifiers|.*¦‡¦)\]\r\n", ""); // Remove SessionManager Data $l_LayIni = regexreplace($l_LayIni, "\[(?:Layout )*([^\]]+)\]\r\n", "$1|"); // Keep only session names $l_LayIni = formatlist($l_LayIni, "dents"); foreach ($tlayout, $l_LayIni, "|") { if (!$tlayout || ($tlayout != replacelist($tlayout, "[]{}()^$\+."))) {continue;} // Regex Comply: Do not process if session name contains forbidden characters if ($l_AllTabsets == regexreplace($l_AllTabsets, "§(1|2)§_".$tlayout."|", "")) { // Layout doesn't have a single corresponding session tabset setkey "", "", $tlayout, $GEN_Ini; setkey "", "", "Layout $tlayout", $GEN_Ini; setkey "", "", "$tlayout$GEN_AutoSave_Suffix", $GEN_Ini; } } } // ---------------------------------------------------------<< // --------------------------------------------------------->> Clean up obsolete Session Manager entries (before XY’s setlayout) $obsolete = "ShowMainMenu|DualPane|HorizontalPanes|ShowAddressBar|ShowToolbar|ShowTabBar|ShowStatusBar|ShowStatusBarButtons|ShowNavigationPanel|ShowTree|ShowCatalog|CatalogAboveTree|ShowInfoPanel|WideInfoPanel|ShowBreadCrumbBar"; $New_Ini = readfile($GEN_Ini); foreach ($entry, $obsolete) { if !$entry {continue;} $New_Ini = regexreplace($New_Ini, "$entry=\d\r\n"); writefile($GEN_Ini, $New_Ini, "o"); } // ---------------------------------------------------------<< // --------------------------------------------------------->> Reset/Update Session Manager toolbar button name perm $SM_CTBINDEX = -1; sub "_ToolbarButton"; // ---------------------------------------------------------<< status , , "ready"; /* ######################################################################################### */ /* ######################################################################################### */ "_ToolbarButton" global $GEN_Ini; // ---------------------------------------------> Build-up mouse modifiers list if !getkey("", "MouseModifiers", $GEN_Ini) { sub "_MouseModifiers-SaveDefault"; } $l_MM_commands = "QuickLoad|Switch|Reset|Update|QuickSave|LoadFavorite|SetFavorite|SaveTemp|LayoutReset|LayoutAlt|LayoutSwitch"; // $l_MM_names = "Shift|Ctrl|Ctrl+Shift|Alt|Alt+Shift|Ctrl+Alt|Ctrl+Alt+Shift"; $l_MM_names = "Shift|Ctrl|C+S|Alt|A+S|C+A|C+A+S"; set $MM_text; foreach ($MM_number, "2|4|1|6|3|5|7") { $MM_command = regexreplace(getkey($MM_number, "MouseModifiers", $GEN_Ini), "^0([^0])", "$1"); if ($MM_command != 0) { $MM_text = $MM_text.gettoken($l_MM_names, $MM_number, "|").": ".gettoken($l_MM_commands, $MM_command, "|")." - "; } } $MM_text = regexreplace($MM_text, " - $"); // ---------------------------------------------< // ---------------------------------------------> If click on script's button or "About" menu (not CKS, Catalog, other button...) then store/update button index if (isset($SM_CTBINDEX) && ($SM_CTBINDEX < 0) && (get("Trigger", "ctbindex") != -1)) { $btn_status = $SM_CTBINDEX; perm $SM_CTBINDEX = get("Trigger", "ctbindex"); ctbname("Session Manager [".$MM_text."]", $SM_CTBINDEX); // ------------------<> Popup success message if mandatory reset end ($btn_status == -2), i(17,17); // ---------------------------------------------< // ---------------------------------------------> If external call, check all CTB to find Session Manager CTB index } else { perm $SM_CTBINDEX = 0; while ($i++ <= 63) { if (ctbname(, $i) LikeI "*Session Manager*") { perm $SM_CTBINDEX = $i; ctbname("Session Manager [".$MM_text."]", $SM_CTBINDEX); break; } } // ------------------<> Mandatory reset of button name if !$SM_CTBINDEX { perm $SM_CTBINDEX = -2; end 1, i(17,18)." ".i(17,19)." 'Session Manager'. ".i(17,20); } } /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ########################*/ /* ######## help ########*/ /* ########################*/ "_CheatSheet" global $GEN_Ini, $PRE_CurSess; set $l_MM; $l_MM = $l_MM." Ctrl".i(51,getkey(2, "MouseModifiers", $GEN_Ini)).chr(13); $l_MM = $l_MM." Alt".i(51,getkey(4, "MouseModifiers", $GEN_Ini)).chr(13); $l_MM = $l_MM." Shift".i(51,getkey(1, "MouseModifiers", $GEN_Ini)).chr(13); $l_MM = $l_MM." Ctrl+Alt".i(51,getkey(6, "MouseModifiers", $GEN_Ini)).chr(13); $l_MM = $l_MM." Ctrl+Shift".i(51,getkey(3, "MouseModifiers", $GEN_Ini)).chr(13); $l_MM = $l_MM." Alt+Shift".i(51,getkey(5, "MouseModifiers", $GEN_Ini)).chr(13); $l_MM = $l_MM." Ctrl+Alt+Shift".i(51,getkey(7, "MouseModifiers", $GEN_Ini)).chr(13); set $Code; $Code = $Code.chr(13); $Code = $Code." ".i(14,21).chr(13); $Code = $Code." ".i(14,22).chr(13); $Code = $Code." ".i(14,23).chr(13); $Code = $Code." ".i(14,24).chr(13); $Code = $Code." ".i(14,25).chr(13); $Code = $Code.''.chr(13).chr(13); $Code = $Code.'• '.i(14,48).chr(13); $Code = $Code.''.chr(13); $Code = $Code.''.$l_MM; $Code = $Code.''.chr(13).chr(13); $Code = $Code.' '.i(14,21).chr(13); $Code = $Code.''.chr(13).chr(13); $Code = $Code.'• '.i(14,26).chr(13); $Code = $Code.''.chr(13); $Code = $Code.' global $DYN_InpSess = "'.$PRE_CurSess.'"; load "SessionManager.xys", "_Load";'.chr(13); $Code = $Code.''.chr(13).chr(13); $Code = $Code.' '.i(14,21).chr(13); $Code = $Code.''.chr(13).chr(13); $Code = $Code.'• '.i(14,57).chr(13); $Code = $Code.''.chr(13); $Code = $Code.' > '.i(14,58).chr(13); $Code = $Code.' '.i(14,59).chr(13); $Code = $Code.' ::load "SessionManager", "_QuickLoad";'.chr(13); $Code = $Code.''.chr(13); $Code = $Code.' > '.i(14,60).chr(13); $Code = $Code.' - '.i(14,61).chr(13); $Code = $Code.' - '.i(14,62).chr(13); $Code = $Code.''.chr(13).chr(13); $Code = $Code.' '.i(14,21).chr(13); $Code = $Code.''.chr(13).chr(13); $Code = $Code.'• '.i(14,49).chr(13); $Code = $Code.''.chr(13); $Code = $Code.' > '.i(51,51).chr(13); $Code = $Code.' global $DYN_InpSess = "Session Name"; load "SessionManager.xys", "_Load";'.chr(13); $Code = $Code.''.chr(13); $Code = $Code.' > '.i(51,01).chr(13); $Code = $Code.' load "SessionManager.xys", "_QuickLoad";'.chr(13); $Code = $Code.''.chr(13); $Code = $Code.' > '.i(51,02).chr(13); $Code = $Code.' load "SessionManager.xys", "_SwitchSessions";'.chr(13); $Code = $Code.''.chr(13); $Code = $Code.' > '.i(51,03).chr(13); $Code = $Code.' load "SessionManager.xys", "_Reset";'.chr(13); $Code = $Code.''.chr(13); $Code = $Code.' > '.i(51,04).chr(13); $Code = $Code.' load "SessionManager.xys", "_Update";'.chr(13); $Code = $Code.''.chr(13); $Code = $Code.' > '.i(51,05).chr(13); $Code = $Code.' load "SessionManager.xys", "_Save-QuickSession";'.chr(13); $Code = $Code.''.chr(13); $Code = $Code.' > '.i(51,06).chr(13); $Code = $Code.' load "SessionManager.xys", "_LoadFavoriteSession";'.chr(13); $Code = $Code.''.chr(13); $Code = $Code.' > '.i(51,07).chr(13); $Code = $Code.' load "SessionManager.xys", "_SetFavoriteSession";'.chr(13); $Code = $Code.''.chr(13); $Code = $Code.' > '.i(51,08).chr(13); $Code = $Code.' load "SessionManager.xys", "_Save-Temporary";'.chr(13); $Code = $Code.''.chr(13); $Code = $Code.' > '.i(51,09).chr(13); $Code = $Code.' load "SessionManager.xys", "_Layout-Reset";'.chr(13); $Code = $Code.''.chr(13); $Code = $Code.' > '.i(51,10).chr(13); $Code = $Code.' load "SessionManager.xys", "_Layout-Alternate";'.chr(13); $Code = $Code.''.chr(13); $Code = $Code.' > '.i(51,11).chr(13); $Code = $Code.' load "SessionManager.xys", "_Layout-Switch";'.chr(13); text "$Code", 850, 700, i(14,30); /* ######################################################################################### */ /* ######################################################################################### */ "_Help" // --- WORK IN PROGRESS + Obsolete code --- global $GEN_SMVersion, $STX_EnableLayouts, $STX_Confirmation, $STX_LayInfoPanelPreview, $STX_LayFallbackDef, $STX_StdResetWithLay; $STX_EnableLayouts = replace($STX_EnableLayouts, "&", ""); $STX_Confirmation = replace($STX_Confirmation, "&", ""); $STX_LayInfoPanelPreview = replace($STX_LayInfoPanelPreview, "&", ""); $STX_LayFallbackDef = replace($STX_LayFallbackDef, "&", ""); $STX_StdResetWithLay = replace($STX_StdResetWithLay, "&", ""); $Help = "
Session Manager   -   v".$GEN_SMVersion."

"; // $Help = $Help."

General

"; $Help = $Help."

--------- ### Work In Progress ### ---------
"; $Help = $Help."
--------- Please refer to Cheat Sheet (just below this entry in menu) ---------

"; $Help = $Help."
Session Manager Homepage (Updates and Discussions)"; // --------- $Help = $Help."

• Main Concept

"; $Help = $Help."

Each session is composed of two tabsets.
Each tabset has the name of its session,
preceded by '§1§_' for pane 1 and '§2§_' for pane 2.
(e.g. Session 'Work' uses tabsets '§1§_Work' and '§2§_Work')

"; // --------- $Help = $Help."

• Settings

"; $Help = $Help."

- $STX_EnableLayouts

"; $Help = $Help."

- $STX_Confirmation

"; $Help = $Help."

- $STX_LayInfoPanelPreview

"; $Help = $Help."

- $STX_LayFallbackDef

"; $Help = $Help."

- $STX_StdResetWithLay

"; /* ######################################################################################### */ /* ######################################################################################### */ $Help = $Help.<<<#>>>

••  HOW TO RUN  ••

 
• Session Manager can be used:
 — via its main menu:
   › by clicking on its toolbar icon
   › by clicking on its toolbar icon while pressing a modifier (Ctrl/Alt/Shift)
 — via an external run of one of its commands, from XYplorer’s:
   › catalog
   › custom keyboard shortcut (CKS)
   › custom toolbar button (CTB)
   › user defined command (UDC)
   › another script
   › etc. (anywhere in XY where a script can be run)

 »»» List of modifiers and commands in SM’s menu "Options | Display Commands..."


••  DEFINITONS  ••


• A standard Session is a “pack” of what you see on screen

 It stores, then restores when loaded:
 — the tabsets, i.e. the list of tabs showing your folders (whether you’re in Single or Dual Pane)
 — and, optionnally and independently:
   › the layout, i.e. the visual interface of XYplorer (visibility of Single or Dual Pane, tree, preview...)
   › the toolbar
   › a script

• A Temporary Session is a unique autonamed standard session:

 — saved quickly: via SM’s main menu, or external command
 — named automatically: as "— Temporary Session —" (may vary depending on your language)
 — listed separately at the bottom of the session list
 — supports all attributes of standard sessions (layout, Autosave...)

• Quick Sessions are unlimited autonamed standard sessions:

 — only saved externally: via Shift+Click on SM’s button, or external command
 — named automatically: based on time and active tab folder name
 — listed separately at the end of the session list
 — supports all attributes of standard sessions (layout, Autosave...)
 »»» Difference with Temporary Session: +:unlimited , -:less identifiable , ~:only external run

• Autosave is a feature that remembers the last state of a single chosen session (of any kind):

 — when switching from another session to the session with Autosave, its latest state is loaded with the session exactly where and how it was last used;
      whereas when switching between other sessions, it’s their user-saved state that is loaded, regardless of how it’s been used in the meantime
 — session with Autosave can be reset to its original state at any time (menu "Reset to Original Session")
 — Autosave can be assigned to another session at any time (previous session with Autosave will be reset to its original state),
      by loading the new desired session, then menu "Reset Autosave to Current Session"
 »»» Enable Autosave in menu "Options | Enable Autosave..."


••  SUGGESTED BASIC USE  ••


• Concept:
  Define a default/favorite session and set it to autosave; define a default layout;
  create other sessions to your taste, with or without layout, and enjoy! 8)

 »»» Now, work and switch between your sessions:
   Each time you’ll load your favorite “default” session (e.g. via Alt+Ctrl+Click), SM will resume with things exactly how and where you’ve left them!
   And when it’s becoming too messed-up, just reset it to its original state (Alt+Click, or menu "Reset...")

• How-to:
 — Adjust your tabsets (folders, view type, sort...) to your most regular/favorite content, then save session as e.g. "Default", and place it first in list
   › menu "Options | Reorder List of Sessions" > Erase everything and leave only "Default", it will be listed first, on top of all other sessions listed alpabetically below a separator
 — Assign Autosave to "Default" session
   › make sure "Default" session is loaded, then
     menu "Options | Enable Autosave..."
     or menu "Reset Autosave to Current Session" if already enabled for another session
 — Set session as “favorite” so that later you can load it faster by Ctrl+Alt + Click on SM’s button
   › make sure "Default" session is loaded, then
     Ctrl+Alt+Shift + Click on SM’s main button
 — Adjust your layout according to your favorite state, then define as default
   › menu "Layout Tools | Update Default Layout"


••  EXAMPLES  ••

// Writing in progress... To be replaced by much more evocative screenshots!!! (one day...)
 — “Default” session with Autosave assigned: listing your favorite folders (default layout used automatically)
 — “Project” session: listing only specific folders related to your project in one or two panes
 — “Photos” session with layout: single pane listing all your photo folders opened in separate tabs with thumbnails view, other pane hidden, tree and catalog hidden (to save space), and Preview opened and maximized
 — “Movies” or “Posters” sessions with layout: idem, maximize preview and minimize the rest
 — “Backup” session: full layout listing your usual source folders in one pane, and your destination folders in the other
 — “Sandboxie” session: real "%program...%" and "%user...%" locations in one pane, and corresponding sandboxed ones in the other
 — “Ebooks/Musical Scores” session with layout: Ultra-maximized layout with only one pane and tree, and maximized/enlarged preview, no menu, no tabs (one ), no catalog, addressbar next to toolbar...


••  MENTION OF GOOD PRACTICE  ••


 »»» Session Manager only edits its own files, either its own INI or its own tabsets

 »»» Precisely, Session Manager has only 2 kinds of write operations:

 • it directly edits only 1 file:
   — its own SessionManager.ini

 • it sends only 1 set of file-tampering commands to XY:
   — save/rename/delete of its own tabsets (named "§1§..." and "§2§...")
     › all this is managed directly by XYplorer itself
       (in xydata obviously since tabsets are saved in "Data\Panes" by default)
#>>>; /* ######################################################################################### */ /* ######################################################################################### */ // --------- $Help = $Help.""; html($Help, 900, 700, "Session Manager Help"); "_Terminate" unset $SM_LANGUAGE_FILE; /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ########################*/ /* ###### Functions #####*/ /* ########################*/ function i($section, $key) { $value = gettoken(getkey("sm.00$key", $section, $SM_LANGUAGE_FILE), 4, "|"); return ($value)? $value : gettoken(getkey("sm.00$key", $section, caller("file")), 4, "|"); } /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ########################*/ /* ###### Icon List #####*/ /* ########################*/ "_IconList" global $DYN_icon; $Menu = <<<#>>> XYplorer - A-C ac;":ac";:ac autorefresh;":autorefresh";:autorefresh back;":back";:back back-;":back-";:back- backtab;":backtab";:backtab backup;":backup";:backup backupto;":backupto";:backupto bfop;":bfop";:bfop browsenetwork;":browsenetwork";:browsenetwork calcfosi;":calcfosi";:calcfosi cat;":cat";:cat cbx;":cbx";:cbx cfi;":cfi";:cfi cherries**;":cherries**";:cherries** cks;":cks";:cks clip;":clip";:clip closetab;":closetab";:closetab cofi;":cofi";:cofi conf;":conf";:conf copy;":copy";:copy copypath;":copypath";:copypath copyto;":copyto";:copyto crl;":crl";:crl ctb1;":ctb1";:ctb1 cucopy;":cucopy";:cucopy cut;":cut";:cut XYplorer - D-F dark;":dark";:dark del;":del";:del dosbox;":dosbox";:dosbox dp;":dp";:dp dp1;":dp1";:dp1 dp2;":dp2";:dp2 dpcopyto;":dpcopyto";:dpcopyto dph;":dph";:dph dpmoveto;":dpmoveto";:dpmoveto dpv;":dpv";:dpv drives;":drives";:drives excopy;":excopy";:excopy exitnosave;":exitnosave";:exitnosave favfiles;":favfiles";:favfiles favfiles-;":favfiles-";:favfiles- favs;":favs";:favs favs-;":favs-";:favs- find;":find";:find findlabel;":findlabel";:findlabel findlabeldark;":findlabeldark";:findlabeldark flatview;":flatview";:flatview fore;":fore";:fore fore-;":fore-";:fore- foretab;":foretab";:foretab fp;":fp";:fp fvs;":fvs";:fvs fvsd;":fvsd";:fvsd fvsp;":fvsp";:fvsp XYplorer - G-J ghost;":ghost";:ghost ghostdark;":ghostdark";:ghostdark go;":go";:go goprev;":goprev";:goprev grid;":grid";:grid gvf;":gvf";:gvf gvfoff;":gvfoff";:gvfoff gvfon;":gvfon";:gvfon gvfset;":gvfset";:gvfset hidenav;":hidenav";:hidenav hideos;":hideos";:hideos hideosdark;":hideosdark";:hideosdark hightree;":hightree";:hightree home;":home";:home home-;":home-";:home- hotlist;":hotlist";:hotlist icf;":icf";:icf icfdark;":icfdark";:icfdark ip;":ip";:ip ipdown;":ipdown";:ipdown jump;":jump";:jump XYplorer - L-N labels;":labels";:labels labelsdark;":labelsdark";:labelsdark lasttarget;":lasttarget";:lasttarget live;":live";:live live**;":live**";:live** live2;":live2";:live2 live2**;":live2**";:live2** locktab;":locktab";:locktab lstmgmt;":lstmgmt";:lstmgmt mansort;":mansort";:mansort maxitree;":maxitree";:maxitree meta;":meta";:meta minitree;":minitree";:minitree moveto;":moveto";:moveto mrl;":mrl";:mrl mru;":mru";:mru myco;":myco";:myco netmap;":netmap";:netmap netunmap;":netunmap";:netunmap newfile;":newfile";:newfile newfolder;":newfolder";:newfolder newtab;":newtab";:newtab noiconw;":noiconw";:noiconw nuke;":nuke";:nuke XYplorer - O-R oks;":oks";:oks openwith;":openwith";:openwith openwith-;":openwith-";:openwith- panellast;":panellast";:panellast panelmax;":panelmax";:panelmax panelshow;":panelshow";:panelshow paper;":paper";:paper paperdark;":paperdark";:paperdark paste;":paste";:paste pp;":pp";:pp preview***;":preview***";:preview*** previewfull;":previewfull";:previewfull props;":props";:props qfv;":qfv";:qfv qns;":qns";:qns qnstgl;":qnstgl";:qnstgl qsoff;":qsoff";:qsoff qson;":qson";:qson queue;":queue";:queue queue-;":queue-";:queue- queuepaused;":queuepaused";:queuepaused redo;":redo";:redo redo-;":redo-";:redo- refresh;":refresh";:refresh refreshsus;":refreshsus";:refreshsus refreshsus-;":refreshsus-";:refreshsus- rename;":rename";:rename rfo;":rfo";:rfo XYplorer - S-T savedirty;":savedirty";:savedirty savesett;":savesett";:savesett script;":script";:script select;":select";:select sfs;":sfs";:sfs shellprops;":shellprops";:shellprops showfolders;":showfolders";:showfolders showhidden;":showhidden";:showhidden showsystem;":showsystem";:showsystem sort;":sort";:sort spot;":spot";:spot steps;":steps";:steps stepsp;":stepsp";:stepsp sticky;":sticky";:sticky stop;":stop";:stop sync;":sync";:sync syncbrowse;":syncbrowse";:syncbrowse syncscroll;":syncscroll";:syncscroll tablist;":tablist";:tablist tabsets;":tabsets";:tabsets tagsadd;":tagsadd";:tagsadd tagsfind;":tagsfind";:tagsfind tagsrmv;":tagsrmv";:tagsrmv tagsset;":tagsset";:tagsset tpt;":tpt";:tpt treeshow;":treeshow";:treeshow tsf;":tsf";:tsf tsm;":tsm";:tsm XYplorer - U-Z udc;":udc";:udc undo;":undo";:undo undo-;":undo-";:undo- up;":up";:up vfoff;":vfoff";:vfoff vfon;":vfon";:vfon vfset;":vfset";:vfset viewdetails;":viewdetails";:viewdetails viewlist;":viewlist";:viewlist views;":views";:views viewthumbs;":viewthumbs";:viewthumbs visualfilter;":visualfilter";:visualfilter wipe;":wipe";:wipe zoomin;":zoomin";:zoomin zoomout;":zoomout";:zoomout #>>>; $Menu = replace($Menu, "XYplorer", i(14,72)); $DYN_icon = replace(popupnested($Menu), '"'); /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ########################### ########################### */ /* ########################### Embedded Language ########################### */ /* ########################### ########################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### */ /* ######################################################################################### *//* ; ######################## ; ### Session Manager #### ; ######################## [Translation Notes] ;••• Sentences not ending with a "." dot are: menu entries; status text; or syntagmas of longer sentences ;••• I M P O R T A N T: If space needed before ":" use only non-breaking space " " - else menu breaks before colon [SessionManagerHeader] Language=English LanguageNameInEnglish=English Translator= Email= Website= Comments= SessionManagerVersion= Date= ; ############### ; ### Default ### ; ############### [0] ;••• Ex.: [Session] '$name' [reset successfully] sm.0001=00|Session|--|Session sm.0002=00|reset successfully|--|reset successfully sm.0003=00|updated successfully|--|updated successfully sm.0004=00|loaded successfully|--|loaded successfully sm.0005=00|saved successfully|--|saved successfully sm.0006=00|deleted successfully|--|deleted successfully sm.0007=00|Cancel|--|Cancel sm.0008=00|assigned successfully|--|assigned successfully sm.0009=00|removed successfully|--|removed successfully sm.0010=00|YES:|--|YES: sm.0011=00|NO:|--|NO: sm.0012=00|Note:|--|Note: sm.0013=00|set successfully|--|set successfully sm.0014=00|unset successfully|--|unset successfully ; ################## ; ### Initialize ### ; ################## [1] sm.0001=00|Session Manager version:|--|Session Manager version: sm.0002=00|XYplorer minimum required version:|--|XYplorer minimum required version: sm.0003=00|XYplorer current version:|--|XYplorer current version: sm.0004=00|Please use latest Session Manager compatible version:|--|Please use latest Session Manager compatible version: sm.0005=00|or update XYplorer.|--|or update XYplorer. sm.0006=00|[Layout Session]|--|[Layout Session] sm.0007=00|•• Autosave ••|--|•• Autosave •• sm.0008=00|— Temporary Session —|--|— Temporary Session — sm.0009=00|About Current Session|--|About Current Session sm.0010=00|About Current Tabsets|--|About Current Tabsets sm.0011=00|No previous session to load.|--|No previous session to load. sm.0012=00|No favorite session to load.|--|No favorite session to load. sm.0013=00|will be set as the favorite.|--|will be set as the favorite. sm.0014=00|Favorite session|--|Favorite session ; ################ ; ### MainMenu ### ; ################ [2] sm.0001=00|Reset Temporary Session|--|Reset Temporary Session sm.0002=00|Update Temporary Session|--|Update Temporary Session sm.0003=00|Reset to Original Session (and Layout)|--|Reset to Original Session (and Layout) sm.0004=00|Update Original Session (and Layout)|--|Update Original Session (and Layout) sm.0005=00|Reset to Original Session|--|Reset to Original Session sm.0006=00|Update Original Session|--|Update Original Session sm.0007=00|Reset Session (and Layout)|--|Reset Session (and Layout) sm.0008=00|Update Session (and Layout)|--|Update Session (and Layout) sm.0009=00|Reset Session (with Default Layout)|--|Reset Session (with Default Layout) sm.0010=00|Reset Session|--|Reset Session sm.0011=00|Update Session|--|Update Session sm.0012=00|Set Autosave to Current Session|--|Set Autosave to Current Session sm.0013=00|Save Session As|--|Save Session As sm.0014=00|Save Temporary Session|--|Save Temporary Session sm.0015=00|Rename Session|--|Rename Session sm.0016=00|Delete Sessions|--|Delete Sessions sm.0017=00|Layout Tools|--|Layout Tools sm.0018=00|Options|--|Options sm.0019=00|Reset Session (and Layout Ά ))|--|Reset Session (and Layout Ά ) sm.0020=00|Update Session (and Layout Ά ))|--|Update Session (and Layout Ά ) sm.0021=00|Reset to Original Session (and Layout Ά ))|--|Reset to Original Session (and Layout Ά ) sm.0022=00|Update Original Session (and Layout Ά ))|--|Update Original Session (and Layout Ά ) ; ############ ; ### Load ### ; ############ [3] sm.0001=00|You're already using session|--|You're already using session sm.0002=00|but you've inverted its panes.|--|but you've inverted its panes. sm.0003=00|Please load another session before reloading session|--|Please load another session before reloading session sm.0004=00|XYplorer should be elevated, do you want to restart it?|--|XYplorer should be elevated, do you want to restart it? sm.0005=00|XYplorer will restart elevated (after saving settings).|--|XYplorer will restart elevated (after saving settings). sm.0006=00|Just open session (XYplorer will remain non-elevated).|--|Just open session (XYplorer will remain non-elevated). sm.0007=00|XYplorer is still elevated, do you want to close it?|--|XYplorer is still elevated, do you want to close it? sm.0008=00|XYplorer will close (after saving settings).|--|XYplorer will close (after saving settings). sm.0009=00|You will have to restart manually.|--|You will have to restart manually. sm.0010=00|Just open session (XYplorer will remain elevated).|--|Just open session (XYplorer will remain elevated). sm.0011=00|Session Manager Quick Load|--|Session Manager Quick Load sm.0012=00|Enter first letter(s) of session meaningful name.|--|Enter first letter(s) of session meaningful name. sm.0013=00|Leave empty to switch to previous session.|--|Leave empty to switch to previous session. sm.0014=00|No matching session found, check spelling.|--|No matching session found, check spelling. ; ############# ; ### Reset ### ; ############# [4] sm.0001=00|You're currently using session (with layout):|--|You're currently using session (with layout): sm.0002=00|You're currently using session:|--|You're currently using session: sm.0003=00|Session (with layout)|--|Session (with layout) sm.0004=00|Are you sure you want to reset it?|--|Are you sure you want to reset it? ; ############## ; ### Update ### ; ############## [5] sm.0001=00|Are you sure you want to update it?|--|Are you sure you want to update it? sm.0002=00|No session to update|--|No session to update sm.0003=00|You're not using a valid session.|--|You're not using a valid session. sm.0004=00|You're not using a session.|--|You're not using a session. sm.0005=00|It wouldn't be wise to update the tabsets.|--|It wouldn't be wise to update the tabsets. sm.0006=00|Another window will open with the information about your current tabsets.|--|Another window will open with the information about your current tabsets. ; ############## ; ### Delete ### ; ############## [6] sm.0001=00|You're currently using the only session:|--|You're currently using the only session: sm.0002=00|It can't be deleted right now.|--|It can't be deleted right now. sm.0003=00|Load regular tabsets or save a new session first.|--|Load regular tabsets or save a new session first. sm.0004=00|You're currently using a tabset of the only session:|--|You're currently using a tabset of the only session: sm.0005=00|Load regular tabsets or save a new session first.|--|Load regular tabsets or save a new session first. sm.0006=00|You're currently using tabsets of the only two sessions:|--|You're currently using tabsets of the only two sessions: sm.0007=00|None of them can be deleted right now.|--|None of them can be deleted right now. sm.0008=00|Load regular tabsets or a single session first.|--|Load regular tabsets or a single session first. sm.0009=00|No session deleted|--|No session deleted ;••• Ex.: [You're currently using:] [- one tabset from session:] $Name [You can delete] [the other following sessions.] sm.0010=00|You're currently using:|--|You're currently using: sm.0011=00|- one tabset from session:|--|- one tabset from session: sm.0012=00|You're currently using tabsets.|--|You're currently using tabsets. sm.0013=00|You can delete|--|You can delete sm.0014=00|the following session:|--|the following session: sm.0015=00|the other following sessions:|--|the other following sessions: sm.0016=00|all sessions:|--|all sessions: sm.0017=00|Delete Sessions|--|Delete Sessions ;••• Ex.: 6 sessions deleted successfully sm.0018=00|sessions deleted successfully|--|sessions deleted successfully ; ############ ; ### Save ### ; ############ [7] sm.0001=00|To save a session with its layout, add a question mark '?' before its name.|--|To save a session with its layout, add a question mark '?' before its name. sm.0002=00|Ex1: My Session --> Save 'My Session' without layout.|--|Ex1: My Session --> Save 'My Session' without layout. sm.0003=00|Ex2: ?My Session --> Save 'My Session' with layout.|--|Ex2: ?My Session --> Save 'My Session' with layout. sm.0004=00|Layouts can also be managed in 'Layout Tools' > 'Save/Update Layout of Current Session'.|--|Layouts can also be managed in 'Layout Tools' > 'Save/Update Layout of Current Session'. sm.0005=00|Save & Use session|--|Save & Use session sm.0006=00|Enter the name of the tabsets session to save.|--|Enter the name of the tabsets session to save. sm.0007=00|This session will be in use after you press OK.|--|This session will be in use after you press OK. sm.0008=00|The name has to be a valid filename, and can not contain '[' or ']'.|--|The name has to be a valid filename, and can not contain '[' or ']'. sm.0009=00|Session name is invalid because it contains:|--|Session name is invalid because it contains: sm.0010=00|Save under a different name.|--|Save under a different name. sm.0011=00|No session saved|--|No session saved sm.0012=00|You're currently using an inverted session:|--|You're currently using an inverted session: sm.0013=00|It wouldn't be safe to overwrite this session.|--|It wouldn't be safe to overwrite this session. sm.0014=00|Try saving under a different name.|--|Try saving under a different name. sm.0015=00|You're currently using one tabset of session:|--|You're currently using one tabset of session: sm.0016=00|It wouldn't be safe to overwrite the whole session.|--|It wouldn't be safe to overwrite the whole session. sm.0017=00|Session|--|Session sm.0018=00|already exists.|--|already exists. sm.0019=00|Choose another name.|--|Choose another name. sm.0020=00|Layout sessions will be prefixed with a · in the list of sessions.|--|Layout sessions will be prefixed with a · in the list of sessions. ; ###################### ; ### Save-Temporary ### ; ###################### [8] sm.0001=00|You're using an inverted Temporary Session.|--|You're using an inverted Temporary Session. sm.0002=00|It can't be overwritten.|--|It can't be overwritten. ; ############## ; ### Rename ### ; ############## [9] sm.0001=00|Rename session:|--|Rename session: sm.0002=00|Enter a new session name.|--|Enter a new session name. sm.0003=00|Rename with a different name.|--|Rename with a different name. sm.0004=00|Session|--|Session sm.0005=00|successfully renamed to|--|successfully renamed to sm.0006=00|No session renamed|--|No session renamed sm.0007=00|The current session is already named|--|The current session is already named sm.0008=00|Reload a session before trying to rename.|--|Reload a session before trying to rename. ; ########################## ; ### ReorderSessionList ### ; ########################## [10] sm.0001=00|Write one or more session(s) name(s).|--|Write one or more session(s) name(s). sm.0002=00|One per line / - as separator / Empty to reset / Unordered will be listed last|--|One per line / - as separator / Empty to reset / Unordered will be listed last ; ###################### ; ### LayoutSessions ### ; ###################### [11] sm.0001=00|Use Session Layouts|--|Use Session Layouts sm.0002=00|ON|--|ON sm.0003=00|OFF|--|OFF sm.0004=00|Reset Layout to Default|--|Reset Layout to Default sm.0005=00|Update Default Layout|--|Update Default Layout sm.0006=00|Default layout updated successfully|--|Default layout updated successfully sm.0007=00|Note: Changes will Affect Original Session|--|Note: Changes will Affect Original Session sm.0008=00|Delete Complete Layout of Current Session (and Reset Layout to Default)|--|Delete Complete Layout of Current Session (and Reset Layout to Default) sm.0009=00|Layout of session|--|Layout of session sm.0010=00|deleted successfully|--|deleted successfully sm.0011=00|updated successfully|--|updated successfully sm.0012=00|saved successfully|--|saved successfully sm.0013=00|Update Layout of Current Session (Prefixed: · )|--|Update Layout of Current Session (Prefixed: · ) sm.0014=00|Save Layout of Current Session (Session Will Be Prefixed: · )|--|Save Layout of Current Session (Session Will Be Prefixed: · ) sm.0015=00|Layout sessions can't have '[' or ']' in their name. Save session under a different name.|--|Layout sessions can't have '[' or ']' in their name. Save session under a different name. sm.0016=00|Note: Load a Valid Session to Access More Options|--|Note: Load a Valid Session to Access More Options sm.0017=00|------------ GENERIC LAYOUT ------------|--|------------ GENERIC LAYOUT ------------ sm.0018=00|Layout reset to default|--|Layout reset to default sm.0019=00|Reset Toolbar to Default Toolbar|--|Reset Toolbar to Default sm.0020=00|Toolbar reset to default|--|Toolbar reset to default sm.0021=00|Update Default Toolbar|--|Update Default Toolbar sm.0022=00|Default toolbar updated successfully|--|Default toolbar updated successfully sm.0023=00|------------ CURRENT SESSION ------------|--|------------ CURRENT SESSION ------------ sm.0024=00|Note: Use a Session with Layout to Access More Options|--|Note: Use a Session with Layout to Access More Options sm.0025=00|Remove Toolbar from Session Layout (and Reset Toolbar to Default)|--|Remove Toolbar from Session Layout (and Reset Toolbar to Default) sm.0026=00|Toolbar removed from layout successfully|--|Toolbar removed from layout successfully sm.0027=00|Update Toolbar in Session Layout (Suffixed: Ά )|--|Update Toolbar in Session Layout (Suffixed: Ά ) sm.0028=00|Toolbar updated (in layout) successfully|--|Toolbar updated (in layout) successfully sm.0029=00|Save Toolbar with Session Layout (Session Will Be Suffixed: Ά )|--|Save Toolbar with Session Layout (Session Will Be Suffixed: Ά ) sm.0030=00|Toolbar saved (in layout) successfully|--|Toolbar saved (in layout) successfully sm.0031=00|Note: Enable 'Use Session Layouts' to Access More Options|--|Note: Enable 'Use Session Layouts' to Access More Options sm.0032=00|Reset Layout to Original Layout of Current Session|--|Reset Layout to Original Layout of Current Session sm.0033=00|------------ ALTERNATE LAYOUT ------------|--|------------ ALTERNATE LAYOUT ------------ sm.0034=00|Load Alternate Layout|--|Load Alternate Layout sm.0035=00|Update Alternate Layout|--|Update Alternate Layout sm.0036=00|Alternate layout loaded successfully|--|Alternate layout loaded successfully sm.0037=00|Alternate layout updated successfully|--|Alternate layout updated successfully sm.0038=00|Default Window and Toolbar Settings|--|Default Window and Toolbar Settings sm.0039=00|Reset Window Position and Size to Default|--|Reset Window Position and Size to Default sm.0040=00|Update Default Window Position and Size|--|Update Default Window Position and Size sm.0041=00|Default window position and size reset successfully|--|Default window position and size reset successfully sm.0042=00|Default window position and size updated successfully|--|Default window position and size updated successfully ; ########################## ; ### Layout-DefaultSave ### ; ########################## [12] sm.0001=00|Sessions with '[' or ']' can't have a layout.|--|Sessions with '[' or ']' can't have a layout. ; #################### ; ### Options-Menu ### ; #################### [14] sm.0001=00|Disable autosave of specific session (and reset current session)?|--|Disable autosave of specific session (and reset current session)? sm.0002=00|Disable autosave of specific session?|--|Disable autosave of specific session? sm.0003=00|Autosave (Temporary Version of) Specific Session on Session Change|--|Autosave (Temporary Version of) Specific Session on Session Change sm.0004=00|Script associated successfully|--|Script associated successfully sm.0005=00|Script association removed successfully|--|Script association removed successfully sm.0006=00|Edit Script Associated with Current Session... (Suffixed: ° )|--|Edit Script Associated with Current Session... (Suffixed: ° ) sm.0007=00|Edit Script Associated with Session:|--|Edit Script Associated with Session: sm.0008=00|Enter script directly (like in Address Bar), preceded by|--|Enter script directly (like in Address Bar), preceded by sm.0009=00|Ex:|--|Ex: sm.0010=00|Or enter name of script file, with or without label.|--|Or enter name of script file, with or without label. sm.0011=00|Ex1:|--|Ex1: sm.0012=00|Ex2:|--|Ex2: sm.0013=00|Leave empty to remove script association from session.|--|Leave empty to remove script association from session. sm.0014=00|Associate Script with Current Session (Session Will Be Suffixed: ° )...|--|Associate Script with Current Session (Session Will Be Suffixed: ° )... sm.0015=00|Associate Script with Session:|--|Associate Script with Session: sm.0016=00|Associate Script with Current Session (Only Available for Valid Sessions)...|--|Associate Script with Current Session (Only Available for Valid Sessions)... sm.0017=00|Reorder List of Sessions...|--|Reorder List of Sessions... sm.0018=00|Sessions reordered successfully|--|Sessions reordered successfully sm.0019=00|Toggle Visibility of XYplorer Main Menu|--|Toggle Visibility of XYplorer Main Menu sm.0020=00|Cheat Sheet (Quick Control Via Buttons, Shortcuts, Catalogue...)|--|Cheat Sheet (Quick Control Via Buttons, Shortcuts, Catalogue...) ;••• I M P O R T A N T: In entries 0021-0029, do not use straight single quote "'". If needed, use oblique quote "’". sm.0021=00| ---------------------------------------------------------------------|--| --------------------------------------------------------------------- sm.0022=00| --- Commands for external access from: ---|--| --- Commands for external access from: --- sm.0023=00| --- Catalog, Toolbar buttons (CTB), Keyboard shortcuts (CKS), ---|--| --- Catalog, Toolbar buttons (CTB), Keyboard shortcuts (CKS), --- sm.0024=00| --- User commands (UDC), Scripts... ---|--| --- User commands (UDC), Scripts... --- sm.0025=00| ---------------------------------------------------------------------|--| --------------------------------------------------------------------- sm.0026=00|Load specific session (e.g. with current session):|--|Load specific session (e.g. with current session): sm.0030=00|Codes to copy and paste into Catalog, CTB, CKS, UDC, Scripts...|--|Codes to copy and paste into Catalog, CTB, CKS, UDC, Scripts... sm.0031=00|General: Auto-Optimize Tree on Session Change|--|General: Auto-Optimize Tree on Session Change sm.0032=00|Standard: Always Load Default Layout on Session Change|--|Standard: Always Load Default Layout on Session Change sm.0033=00|Layouts: Always Load Default Layout (Instead of Last) When Returning to Standard Sessions|--|Layouts: Always Load Default Layout (Instead of Last) When Returning to Standard Sessions sm.0034=00|Layouts: Activate Preview When Loading Layout Session with Info Panel Visible|--|Layouts: Activate Preview When Loading Layout Session with Info Panel Visible sm.0035=00|General: Enable Autosave of Extra Settings|--|General: Enable Autosave of Extra Settings sm.0036=00|Menu: Display List of Sessions on Top (Instead of Bottom)|--|Menu: Display List of Sessions on Top (Instead of Bottom) sm.0037=00|Menu: Display Separator Between List of Sessions and Rest of Menu|--|Menu: Display Separator Between List of Sessions and Rest of Menu sm.0038=00|Menu: Enable Confirmation Dialog for Reset and Update|--|Menu: Enable Confirmation Dialog for Reset and Update sm.0039=00|Tweak: Reduce Flickering...|--|Tweak: Reduce Flickering... sm.0040=00|Tweak: Flickering is reduced|--|Tweak: Flickering is reduced sm.0041=00|Help:|--|Help: sm.0042=00|Change Icon of Sessions...|--|Change Icon of Sessions... sm.0043=00|Select the session for which you want to change the icon|--|Select the session for which you want to change the icon sm.0044=00|Change Icon of Session|--|Change Icon of Session sm.0047=00|Icon of session|--|Icon of session sm.0048=00|Current mouse modifiers (used when clicking on Session Manager toolbar button):|--|Current mouse modifiers (used when clicking on Session Manager toolbar button): sm.0049=00|List of all available commands:|--|List of all available commands: sm.0050=00|Click|--|Click sm.0056=00|Save New Auto-Named Quick Session|--|Save New Auto-Named Quick Session sm.0057=00|Load/Switch sessions via Quick Load dialog:|--|Load/Switch sessions via Quick Load dialog: sm.0058=00|First, assign a shortcut (e.g. ~) to Session Manager Quick Load command:|--|First, assign a shortcut (e.g. ~) to Session Manager Quick Load command: sm.0059=00|XYplorer menu: User > Manage Commands... > Run Script > New... > Add New Command > Script:|--|XYplorer menu: User > Manage Commands... > Run Script > New... > Add New Command > Script: sm.0060=00|To use, press your shortcut, then either:|--|To use, press your shortcut, then either: sm.0061=00|type the first letter(s) of the session you want to load, then Enter, or|--|type the first letter(s) of the session you want to load, then Enter, or sm.0062=00|only press Enter to automatically switch to the previous session|--|only press Enter to automatically switch to the previous session sm.0065=00|Layouts: Autosave Window Position and Size with Layouts (Including Default and Alternate)|--|Layouts: Autosave Window Position and Size with Layouts (Including Default and Alternate) sm.0066=00|Layouts: Autosave Catalog Association with Layouts|--|Layouts: Autosave Catalog Association with Layouts sm.0067=00|Edit Mouse Modifiers (Used When Clicking On Session Manager Button)...|--|Edit Mouse Modifiers (Used When Clicking On Session Manager Button)... sm.0070=00|Go to XYplorer Tabsets Folder|--|Go to XYplorer Tabsets Folder sm.0071=00|Remove icon from session|--|Remove icon from session sm.0072=00|XYplorer internal icons|--|XYplorer internal icons sm.0073=00|Use an internal icon...|--|Use an internal icon... sm.0074=00|Use an external icon file...|--|Use an external icon file... sm.0075=00|Set Current Session As The Favorite|--|Set Current Session As The Favorite sm.0076=00|Unset Current Session As The Favorite|--|Unset Current Session As The Favorite sm.0077=00|The favorite session can be loaded by clicking on Session Manager button while holding mouse modifiers.|--|The favorite session can be loaded by clicking on Session Manager button while holding mouse modifiers. sm.0078=00|Mouse modifiers currently assigned:|--|Mouse modifiers currently assigned: sm.0079=00|As a visual indicator, the favorite session will always appear unindented in the list of sessions.|--|As a visual indicator, the favorite session will always appear unindented in the list of sessions. sm.0081=00|The following extras settings will be saved automatically:|--|The following extras settings will be saved automatically: sm.0082=00|- With all sessions:|--|- With all sessions: sm.0083=00|Show Hidden / System / Protected files and folders|--|Show Hidden / System / Protected files and folders sm.0084=00|- With layout sessions:|--|- With layout sessions: sm.0085=00|Sync Browse, Sync Scroll, Dark Mode, Thumbnails configuration|--|Sync Browse, Sync Scroll, Dark Mode, Thumbnails configuration sm.0091=00|AutoUpdate Single:|--|AutoUpdate Single: sm.0092=00|Autosave set to current session successfully|--|Autosave set to current session successfully sm.0093=00|AutoUpdate All:|--|AutoUpdate All: sm.0094=00|Update Every Session on Session Change|--|Update Every Session on Session Change ; ######################## ; ### Options-Settings ### ; ######################## [15] ;••• Ex.: [Setting] '[Confirmation Dialog]' [enabled] [successfully] sm.0001=00|Setting|--|Setting sm.0002=00|disabled|--|disabled sm.0003=00|enabled|--|enabled sm.0004=00|successfully|--|successfully sm.0005=00|Couldn't access INI file:|--|Couldn't access INI file: sm.0006=00|unchanged|--|unchanged sm.0007=00|Confirmation Dialog|--|Confirmation Dialog sm.0008=00|Session List on Top|--|Session List on Top sm.0009=00|Auto-Optimization of Tree|--|Auto-Optimization of Tree sm.0010=00|Use of Layouts|--|Use of Layouts sm.0011=00|Layout Fallback to Default|--|Layout Fallback to Default sm.0012=00|Reset Layout on Session Change|--|Reset Layout on Session Change sm.0013=00|Preview Activation on Layout Load|--|Preview Activation on Layout Load sm.0014=00|Autosave Extra Settings|--|Autosave Extra Settings sm.0015=00|Autosave|--|Autosave sm.0016=00|Separator|--|Separator sm.0017=00|Window Position and Size|--|Window Position and Size sm.0018=00|Catalog Association|--|Catalog Association sm.0019=00|AutoUpdate All|--|AutoUpdate All ; ##################### ; ### Options-Tweak ### ; ##################### [16] sm.0001=00|A tweak is required for a smoother experience (less flickering):|--|A tweak is required for a smoother experience (less flickering): sm.0002=00|It is enabled by default on XYplorer installs, but is currently disabled.|--|It is enabled by default on XYplorer installs, but is currently disabled. sm.0003=00|Do you want to activate it now? (recommended)|--|Do you want to activate it now? (recommended) sm.0004=00|Your current configuration will be saved and XYplorer will restart.|--|Your current configuration will be saved and XYplorer will restart. sm.0005=00|Note: You can still activate it later on|--|Note: You can still activate it later on sm.0006=00|Tweak|--|Tweak sm.0007=00|unchanged|--|unchanged ; ############# ; ### About ### ; ############# [17] sm.0001=00|but you've inverted the tabsets.|--|but you've inverted the tabsets. sm.0002=00|It would be wise to save it to another name.|--|It would be wise to save it to another name. sm.0003=00|You've mixed your sessions.|--|You've mixed your sessions. sm.0004=00|Your first tabset is from session:|--|Your first tabset is from session: sm.0005=00|Your second tabset is from session:|--|Your second tabset is from session: sm.0006=00|You're not using a full session.|--|You're not using a full session. sm.0007=00|Your second tabset is a regular tabset:|--|Your second tabset is a regular tabset: sm.0008=00|Your first tabset is a regular tabset:|--|Your first tabset is a regular tabset: sm.0009=00|You're not using a session but two different tabsets.|--|You're not using a session but two different tabsets. sm.0010=00|Your first tabset is:|--|Your first tabset is: sm.0011=00|Your second tabset is:|--|Your second tabset is: sm.0012=00|The following tabsets are orphans|--|The following tabsets are orphans sm.0013=00|The following tabset is an orphan|--|The following tabset is an orphan sm.0014=00|and can no longer be used in a session:|--|and can no longer be used in a session: sm.0015=00|Do you want to open the tabsets folder (in a new tab)?|--|Do you want to open the tabsets folder (in a new tab)? sm.0017=00|The name of Session Manager toolbar button has been reset successfully.|--|The name of Session Manager toolbar button has been reset successfully. sm.0018=00|No valid Session Manager toolbar button found:|--|No valid Session Manager toolbar button found: sm.0019=00|its name should contain|--|its name should contain sm.0020=00|Please click once on Session Manager button to reset its name.|--|Please click once on Session Manager button to reset its name. ; ####################### ; ### Mouse modifiers ### ; ####################### [18] sm.0001=00|Edit Mouse Modifiers|--|Edit Mouse Modifiers sm.0002=00|Select this to reset all mouse modifiers to factory default|--|Select this to reset all mouse modifiers to factory default sm.0003=00|Select the mouse modifier to edit|--|Select the mouse modifier to edit sm.0004=00|Note: Clicking on Session Manager toolbar button while pressing a mouse modifier will run the matching command.|--|Note: Clicking on Session Manager toolbar button while pressing a mouse modifier will run the matching command. sm.0005=00|Mouse modifier|--|Mouse modifier sm.0006=00|Current command|--|Current command sm.0007=00|None|--|None sm.0008=00|Mouse modifier to edit:|--|Mouse modifier to edit: sm.0009=00|Select the command to assign to this mouse modifier|--|Select the command to assign to this mouse modifier sm.0021=00|Mouse modifiers reset successfully|--|Mouse modifiers reset successfully sm.0022=00|Mouse modifier edited successfully|--|Mouse modifier edited successfully ; ######################### ; ### External commands ### ; ######################### [51] sm.0001=00|Load/Switch sessions via Quick Load dialog|--|Load/Switch sessions via Quick Load dialog sm.0002=00|Switch between the last two sessions|--|Switch between the last two sessions sm.0003=00|Reset current session|--|Reset current session sm.0004=00|Update current session|--|Update current session sm.0005=00|Save auto-named quick session (name based on current date and active tab)|--|Save auto-named quick session (name based on current date and active tab) sm.0006=00|Load favorite session|--|Load favorite session sm.0007=00|Set current session as the favorite|--|Set current session as the favorite sm.0008=00|Save temporary session|--|Save temporary session sm.0009=00|Reset layout to default|--|Reset layout to default sm.0010=00|Load alternate layout|--|Load alternate layout sm.0011=00|Switch between default and alternate layouts|--|Switch between default and alternate layouts sm.0051=00|Load specific session|--|Load specific session ; ############ ; ### Help ### ; ############ [99] */