Skip to content

Commit

Permalink
SessionRestore: fixed dialog for when no layout matches
Browse files Browse the repository at this point in the history
and added some nfo for multi-selection
  • Loading branch information
ewerybody committed Aug 5, 2021
1 parent 1cd23de commit 0f144ea
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions SessionRestore/sessionrestore.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ sessionrestore_session_restore() {
for name, layout_data in SessionRestore_List
{
if (layout_data["size"] == this_vs_size) {
; MsgBox %name% - this_vs_size: %this_vs_size%
layouts.Push(name)
}
}

if (!layouts) {
nope_msg := "No layouts f0r this Screen size (" this_vs_size ")!"
if (layouts.Length() < 1) {
nope_msg := "No layouts for this Screen size (" this_vs_size ")!"
MsgBox, SessionRestore, %nope_msg%
Return
}
Expand All @@ -34,13 +33,25 @@ sessionrestore_session_restore() {
_sessionrestore_session_restore(layouts[1])
else
{
label := "SessionRestore - Multilpe Layouts for Desktop size (" this_vs_size ")"

Menu, SessionRestoreMenu, Add, %label%, _sessionrestore_nop
Menu, SessionRestoreMenu, Disable, %label%

for i, name in layouts
Menu, SessionRestoreMenu, Add, %name%, _sessionrestore_session_restore

Menu, SessionRestoreMenu, Add
Menu, SessionRestoreMenu, Add, Cancel, _sessionrestore_nop
Menu, SessionRestoreMenu, Show
Menu, SessionRestoreMenu, DeleteAll
}
}

_sessionrestore_nop() {
Return
}

_sessionrestore_session_restore(layout_name) {
global SessionRestore_List
this_vs_size_list := SessionRestore_List[layout_name]["setups"]
Expand Down

0 comments on commit 0f144ea

Please sign in to comment.