#1
|
|||
|
|||
Shortcuts for different JD Shutdown settings?
I have a "JD Shutdown after downloads" button in my main command bar.
Depending on usage, I often need JD Shutdown to either: - just exit JDL (if I just need a quick download during the day) - shut down PC (if I load a download batch for the night before going to bed) To switch this setting, I have to manually go in the settings tabs, find the JD Shutdown tab, and change the JD Shutdown setting to either function. Maybe sometimes I may even forget that I set it to shut down PC a previous night when I just want to exit JDL. Point is it's not very convenient to have a single shortcut for this dual usage. Question: is there a way to have two different, dedicated command bar buttons, one to exit the program and one to shut down PC once downloads are done? That would be very useful, thanks. |
#2
|
||||
|
||||
@Jdlxber: Do you mean the toggle button/action to enable/disable the *JDShutdown extension*? or do you mean something different?
Quote:
I'm still little lost. I'm asking because there is just a *close/exit JDownloader* button and another button to enable/disable the JDShutdown extension. Just disabling the shutdown(via button) is enough to not trigger it and you can normal close JDownloader. Please know that the JDShutdown extension will ONLY trigger if there has been at least one download. Starting JDownloader, set to poweroff/standby/xy and hit the button will not trigger it.
__________________
JD-Dev & Server-Admin Last edited by Jiaz; 12.06.2022 at 08:55. |
#3
|
|||
|
|||
JD Shutdown > Mode > Shutdown
JD Shutdown > Mode > Close JDownloader |
#4
|
||||
|
||||
@mgpai: Yes I know, but there is no such action button. There is only action button to enable/disable the JDShutdown extension. With extension disabled, close/exit JDownloader will just close it. If you want to disable shutdown, then just disable the checkbox button for this extension?!
__________________
JD-Dev & Server-Admin |
#5
|
|||
|
|||
@Jiaz:Think OP wants separate buttons on toolbar which gives the option to either Close JD or Shutdown PC, when the downloads are finished.
|
#6
|
||||
|
||||
@mgpai: but there is no *Shutdown PC* button. only *Close JD* and if the JDShutdown extension is enabled, then this will take over.
I could add custom modifier to "Close JD" action to NOT trigger JDShutdown. @Jdlxber: would that solve your issue? so you can add the "Close JD" button multiple times and customize if/if not to trigger the JDShutdown extension?
__________________
JD-Dev & Server-Admin |
#7
|
|||
|
|||
@Jiaz: Talking about "CLOSE" and "SHUTDOWN" values in (org.jdownloader.extensions.shutdown.ShutdownExtension.json). Currently user has to open the "JD Shutdown" extension to view/change them. Hope I am not adding to the confusion.
|
#8
|
||||
|
||||
@mgpai: yes I know, but instead of changing the value, he can also easily enable/disable the JDShutdown extension. As far as I understood, he is pressing the "Close JD" button. so with JDShutdown extension disabled, this button will just close JD. With it enabled, it will do what is setup.
__________________
JD-Dev & Server-Admin |
#9
|
|||
|
|||
Hi Jiaz, thanks for replying. There seems to be somewhat of a misunderstanding so I'll try to be more clear again.
It's the "Disable ShutdownExtension after Downloads (Description: Enable ShutdownExtension after Downloads)" toggle button. Not the "close JD" button. I would like two different buttons: - One button to toggle enable/disable JD shutdown extension, with the exit/close JDL setting (so it'll exit JDL after current downloads are finished.) - One button to toggle enable/disable JD shutdown extension, with the shut down PC setting (so it'll shut down PC after current downloads are finished.) Currently there is only 1 "perform 'default JD Shutdown action', after current downloads are finished" button. But you have to manually select the default JD Shutdown action mode in the settings. And the button only executes this default setting. Distinct toggle buttons parameters would be preferable. "Disable ShutdownExtension / exitJDL" toggle button and "Disable ShutdownExtension / shutdownPC" toggle button Hope it's understandable. Thanks. |
#10
|
||||
|
||||
@Jdlxber: maybe just add custom setting in that button to change mode or leave it untouched.
then you can add the button multiple times and can decide the mode by yourself what do you think about that?
__________________
JD-Dev & Server-Admin |
#11
|
||||
|
||||
Wouldn't all of this already possible using an EventScripter script?
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#12
|
||||
|
||||
__________________
JD-Dev & Server-Admin |
#13
|
||||
|
||||
Quote:
__________________
JD-Dev & Server-Admin |
#14
|
|||
|
|||
Quote:
Optionally, can use a script to either close JD or shutdown PC, based on time the downloads are finished. |
#15
|
||||
|
||||
@mgpai: it's advanced setting, ShutdownMode , so script use api to change advanced setting should be possible, right?
__________________
JD-Dev & Server-Admin |
#16
|
|||
|
|||
Quote:
Can provide a script, but will have to use simple buttons. |
#17
|
||||
|
||||
I guess a simple script that changes mode to X or Y depending on name of the button would make the user happy
__________________
JD-Dev & Server-Admin |
#18
|
|||
|
|||
Quote:
Code:
/* Change Shutdown mode Trigger: Toolbar button pressed */ /* Cusomize toolbar > Create a new "Eventscripter Trigger" button > Rename it to "Close JD" > Change Icon */ if (name == "Close JD") { setMode("CLOSE"); alert("Mode: Close JD"); } /* Cusomize toolbar > Create a new "Eventscripter Trigger" button > Rename it to "Shutown PC" > Change Icon */ if (name == "Shutdown PC") { setMode("SHUTDOWN"); alert("Mode: Shutdown PC"); } function setMode(mode) { var storage = "cfg/org.jdownloader.extensions.shutdown.ShutdownExtension", interfaceName = "org.jdownloader.extensions.shutdown.ShutdownConfig", key = "ShutdownMode"; callAPI("config", "set", interfaceName, storage, key, mode); } |
#19
|
||||
|
||||
@mgpai: always nice to see how simple and easy (to understand) your scripts are
__________________
JD-Dev & Server-Admin |
#20
|
|||
|
|||
Thank you very much, mgpai. This is very useful and helpful!
Is there perhaps also a way to make it so each button also calls/enables the "Enable ShutdownExtension after Downloads" toggle button after it changes the mode? This would be the cherry on top! |
#21
|
|||
|
|||
@Jiaz: Glad you think so.
Code:
/* Change Shutdown mode Trigger: Toolbar button pressed */ /* Customize toolbar > Create a new "Eventscripter Trigger" button > Rename it to "Close JD" > Change Icon */ name == "Close JD" && setMode("CLOSE"); /* Customize toolbar > Create a new "Eventscripter Trigger" button > Rename it to "Shutown PC" > Change Icon */ name == "Shutdown PC" && setMode("SHUTDOWN"); /* Function */ function setMode(mode) { var storage = "cfg/org.jdownloader.extensions.shutdown.ShutdownExtension", interfaceName = "org.jdownloader.extensions.shutdown.ShutdownConfig"; callAPI("config", "set", interfaceName, storage, "ShutdownMode", mode); callAPI("config", "set", interfaceName, storage, "ShutdownActive", true); alert("Mode: " + name); } Last edited by mgpai; 15.06.2022 at 09:37. Reason: Modified Script |
#22
|
|||
|
|||
Perfect, thanks again
|
#23
|
||||
|
||||
@mgpai: thanks for your help!
__________________
JD-Dev & Server-Admin |
Thread Tools | |
Display Modes | |
|
|