Skip to content

Commit d5590de

Browse files
finalized the stuff for deleting Scripts & Apps
you can now delete Scripts within MASTER-SETTINGS.AHK and Apps within BPTV-LAUNCHER.AHK and it will get updated in settings.ini
1 parent 5f8b491 commit d5590de

File tree

4 files changed

+163
-28
lines changed

4 files changed

+163
-28
lines changed

BPTV-LAUNCHER.ahk

Lines changed: 77 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ Gui, Show, w%guiWidth% h%guiHeight%
114114

115115
;timer code section here
116116
;the timeout period is stored in settings.ini - under the [Settings] section as milliseconds - other values designated in above GUI code
117-
118-
;this code creates and upadtes the timer text & progress bar
117+
launcherTimeoutSleep := 1000
118+
;this code creates and updates the timer text & progress bar
119119
loop, %timeoutSegments%
120120
{
121121
GuiControl, , timeoutTextProgress, %timeoutRemaining%
122-
sleep, 1000
122+
sleep, %launcherTimeoutSleep%
123123
GuiControl, , timeoutProgress, +1
124124
timeoutRemaining := (timeoutSegments - A_Index)
125125
}
@@ -214,7 +214,80 @@ reload
214214
return
215215

216216
ButtonDeleteApp:
217-
MsgBox Not implemented yet. Edit the settings.ini file to remove items for now.
217+
launcherTimeoutSleep := 10000
218+
delTimeoutRemain := (timeoutRemaining * 10)
219+
delAppGUIH := 40
220+
appSectionKeys := round(section3_keys / 3)
221+
delAppGUIH += (appSectionKeys * 60)
222+
delAppGUIW := 580
223+
delAppLVH := (delAppGUIH - 60)
224+
delAppLVW := 560
225+
226+
Gui, DelApp:New, , Delete an App
227+
Gui, DelApp:Font, S12 CDefault, Franklin Gothic Medium
228+
Gui, DelApp:Add, Text, x10 y10 , Double-click the app you would like to remove below:
229+
Gui, DelApp:Font, S9 CDefault, Franklin Gothic Medium
230+
Gui, DelApp:Add, Text, x10 y30 , (You have about %delTimeoutRemain% seconds to make a choice.)
231+
Gui, DelApp:Font, S12 CDefault, Franklin Gothic Medium
232+
Gui, DelApp:Add, ListView, r%appSectionKeys% w%delAppLVW% h%delAppLVH% gdelListView, #|App|Enabled?
233+
234+
loop, %appSectionKeys%
235+
{
236+
LV_Add(,A_Index, Apps_nameApp%A_Index%, Apps_loadApp%A_Index% )
237+
}
238+
LV_ModifyCol(2)
239+
Gui, DelApp:Show, w580 h%delAppGUIH%
240+
241+
delListView:
242+
if (A_GuiEvent = "DoubleClick")
243+
{
244+
LV_GetText(RowText, A_EventInfo)
245+
appToDel := % Apps_nameApp%A_EventInfo% ; Get the text from the row's first field.
246+
MsgBox, 36, Delete this App?, Is this the app you want to delete?`n#%A_EventInfo%: %appToDel%
247+
IfMsgBox, No
248+
goto delAppNo
249+
IfMsgBox, Yes
250+
newNumberOfKeySets := (section3_keys - 3)
251+
currentAltCounter := 1
252+
Loop, %appSectionKeys%
253+
{
254+
If (A_Index = A_EventInfo) {
255+
Continue
256+
}
257+
tempApps_loadApp%currentAltCounter% := % Apps_loadApp%A_Index%
258+
tempApps_nameApp%currentAltCounter% := % Apps_nameApp%A_Index%
259+
tempApps_pathApp%currentAltCounter% := % Apps_pathApp%A_Index%
260+
currentNameValue := % tempApps_nameApp%currentAltCounter%
261+
currentPathValue := % tempApps_pathApp%currentAltCounter%
262+
currentLoadValue := % tempApps_loadApp%currentAltCounter%
263+
currentAltCounter += 1
264+
}
265+
Loop, %section2_keys%
266+
{
267+
Apps_loadApp%A_Index% := % tempApps_loadApp%A_Index%
268+
Apps_nameApp%A_Index% := % tempApps_nameApp%A_Index%
269+
Apps_pathApp%A_Index% := % tempApps_pathApp%A_Index%
270+
}
271+
Apps_loadApp%appSectionKeys% := 0
272+
Apps_nameApp%appSectionKeys% :=
273+
Apps_pathApp%appSectionKeys% :=
274+
IniDelete, %inifile%, Apps, loadApp%appSectionKeys%
275+
IniDelete, %inifile%, Apps, nameApp%appSectionKeys%
276+
IniDelete, %inifile%, Apps, pathApp%appSectionKeys%
277+
appSectionKeys -= 1
278+
Loop, %appSectionKeys%
279+
{
280+
currentLoadValue := % Apps_loadApp%A_Index%
281+
currentNameValue := % Apps_nameApp%A_Index%
282+
currentPathValue := % Apps_pathApp%A_Index%
283+
IniWrite, %currentLoadValue%, %inifile%, Apps, loadApp%A_Index%
284+
IniWrite, %currentNameValue%, %inifile%, Apps, nameApp%A_Index%
285+
IniWrite, %currentPathValue%, %inifile%, Apps, pathApp%A_Index%
286+
}
287+
delAppNo:
288+
Gui, DelApp:Destroy
289+
reload
290+
}
218291
return
219292

220293
ButtonChangeTimeout:

MASTER-FUNCTIONS.ahk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ rootFolder=
9595
), settings.ini
9696
FileAppend,
9797
(
98-
98+
9999
timeoutPeriod=15000
100100
splashScreenTimeout=4000
101101
CapsLockToggleTimeoutThreshold=4

MASTER-SETTINGS.ahk

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ loop, %section2_keys%
108108
Gui, Font, S12 CDefault, Franklin Gothic Medium
109109
Gui, Add, Button, x30 y%buttonStartingY% w100 h30, Add Script
110110
Gui, Add, Button, x150 y%buttonStartingY% w100 h30, Delete Script
111-
Gui, Add, Button, x275 y%buttonStartingY% w100 h30, Variables ; Uncomment if you wish to have a button to show Variables assigned by the script
111+
;Gui, Add, Button, x275 y%buttonStartingY% w100 h30, Variables ; Uncomment if you wish to have a button to show Variables assigned by the script
112112
Gui, Add, Button, x400 y%buttonStartingY% w100 h30, Cancel
113113
Gui, Add, Button, x520 yp w100 h30, SAVE
114114
Gui, Font, S10 CDefault, Franklin Gothic Medium
@@ -170,33 +170,51 @@ if (A_GuiEvent = "DoubleClick")
170170
scriptToDel := % Scripts_nameScript%A_EventInfo% ; Get the text from the row's first field.
171171
MsgBox, 36, Delete this Script?, Is this the script you want to delete?`n#%A_EventInfo%: %scriptToDel%
172172
IfMsgBox, No
173-
delScriptNo()
173+
goto delScriptNo
174174
IfMsgBox, Yes
175-
numberOfKeySets := round(section2_keys / 3)
176-
newNumberOfKeySets := (numberOfKeySets + 1)
177-
newScriptEnableKey := (section2_keys + 1)
178-
newScriptPathKey := (section2_keys + 2)
179-
newScriptNameKey := (section2_keys + 3)
180-
section2_key%newScriptEnableKey% := "loadScript" . newNumberOfKeySets
181-
section2_key%newScriptPathKey% := "pathScript" . newNumberOfKeySets
182-
section2_key%newScriptNameKey% := "nameScript" . newNumberOfKeySets
183-
Scripts_loadScript%newNumberOfKeySets% := 1
184-
Scripts_pathScript%newNumberOfKeySets% := newScriptPathValue
185-
Scripts_nameScript%newNumberOfKeySets% := newScriptNameValue
186-
section2_keys += 3
187-
;INI_Save(inifile)
175+
newNumberOfKeySets := (section2_keys - 3)
176+
currentAltCounter := 1
177+
Loop, %scriptSectionKeys%
178+
{
179+
If (A_Index = A_EventInfo) {
180+
Continue
181+
}
182+
tempScripts_loadScript%currentAltCounter% := % Scripts_loadScript%A_Index%
183+
tempScripts_nameScript%currentAltCounter% := % Scripts_nameScript%A_Index%
184+
tempScripts_pathScript%currentAltCounter% := % Scripts_pathScript%A_Index%
185+
currentNameValue := % tempScripts_nameScript%currentAltCounter%
186+
currentPathValue := % tempScripts_pathScript%currentAltCounter%
187+
currentLoadValue := % tempScripts_loadScript%currentAltCounter%
188+
currentAltCounter += 1
189+
}
190+
Loop, %section2_keys%
191+
{
192+
Scripts_loadScript%A_Index% := % tempScripts_loadScript%A_Index%
193+
Scripts_nameScript%A_Index% := % tempScripts_nameScript%A_Index%
194+
Scripts_pathScript%A_Index% := % tempScripts_pathScript%A_Index%
195+
}
196+
Scripts_loadScript%scriptSectionKeys% := 0
197+
Scripts_nameScript%scriptSectionKeys% :=
198+
Scripts_pathScript%scriptSectionKeys% :=
199+
IniDelete, %inifile%, Scripts, loadScript%scriptSectionKeys%
200+
IniDelete, %inifile%, Scripts, nameScript%scriptSectionKeys%
201+
IniDelete, %inifile%, Scripts, pathScript%scriptSectionKeys%
202+
scriptSectionKeys -= 1
203+
Loop, %scriptSectionKeys%
204+
{
205+
currentLoadValue := % Scripts_loadScript%A_Index%
206+
currentNameValue := % Scripts_nameScript%A_Index%
207+
currentPathValue := % Scripts_pathScript%A_Index%
208+
IniWrite, %currentLoadValue%, %inifile%, Scripts, loadScript%A_Index%
209+
IniWrite, %currentNameValue%, %inifile%, Scripts, nameScript%A_Index%
210+
IniWrite, %currentPathValue%, %inifile%, Scripts, pathScript%A_Index%
211+
}
212+
delScriptNo:
213+
Gui, DelScript:Destroy
188214
reload
189215
}
190216
return
191217

192-
delScriptNo(){
193-
MSGBOX, , DEBUG, pressed no
194-
Gui, DelScript:Destroy
195-
Return
196-
}
197-
198-
Return
199-
200218
ButtonSAVE:
201219
Gui, Submit
202220
;Setting the location if it got changed

settings.ini.bak

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[Location]
2+
currentSystemLocation=2
3+
systemLocation1=EDIT-2
4+
systemLocation2=RYZEN-PC
5+
systemLocation3=LAPTOP
6+
systemLocation4=LAPTOP-PREONIC
7+
[Scripts]
8+
loadScript1=1
9+
pathScript1=SCRIPTS-PPRO\PREMIERE-PRO-HOTKEYS.ahk
10+
nameScript1=PPRO Hotkeys
11+
loadScript2=0
12+
pathScript2=SCRIPTS-PPRO\PPRO_Right_click_timeline_to_move_playhead.ahk
13+
nameScript2=PPRO - Right-click to move playhead
14+
loadScript3=0
15+
pathScript3=SCRIPTS-UTIL\Accelerated-Scrolling-1-3.ahk
16+
nameScript3=PPRO - Accelerated Scrolling
17+
loadScript4=0
18+
pathScript4=SCRIPTS-ILLUS\ILLUS-HOTKEYS.ahk
19+
nameScript4=ILLUSTRATOR Hotkeys
20+
loadScript5=1
21+
pathScript5=SCRIPTS-UTIL\ATOM-AHK.ahk
22+
nameScript5=ATOM-AHK Helper
23+
loadScript6=1
24+
pathScript6=BPTV-CHEAT-SHEETS.ahk
25+
nameScript6=BPTV-KB Cheat Sheets
26+
[Apps]
27+
loadApp1=1
28+
pathApp1=MASTER-SCRIPT.ahk
29+
nameApp1=Run MASTER-SCRIPT.AHK
30+
loadApp2=0
31+
pathApp2=BAT-FILES\launch-QAP.cmd
32+
nameApp2=Quick Access Popup
33+
loadApp3=1
34+
pathApp3=BAT-FILES\SCHEDULED-BATS\scheduled-bats.cmd
35+
nameApp3=Run Scheduled BATs
36+
[Settings]
37+
rootFolder=C:\BPTV-KB
38+
pathToFCXE=C:\Program Files\FreeCommander XE\FreeCommander.exe
39+
FCXEParams=/C /R=
40+
timeoutPeriod=7000
41+
splashScreenTimeout=5000
42+
CapsLockToggleTimeoutThreshold=4
43+
CapsLockToggleOffTimeout=8
44+
CapsLockCheckPeriod=10000

0 commit comments

Comments
 (0)