JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 11.06.2022, 16:30
Jdlxber Jdlxber is offline
Baby Loader
 
Join Date: Aug 2021
Posts: 5
Smile 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.
Reply With Quote
  #2  
Old 12.06.2022, 08:52
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,524
Default

@Jdlxber: Do you mean the toggle button/action to enable/disable the *JDShutdown extension*? or do you mean something different?

Quote:
Originally Posted by Jdlxber View Post
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.
Which one exactly do you mean? The *close/exit JDownloader* button?

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.
Reply With Quote
  #3  
Old 12.06.2022, 09:02
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by Jiaz View Post
Which one exactly do you mean?
JD Shutdown > Mode > Shutdown
JD Shutdown > Mode > Close JDownloader
Reply With Quote
  #4  
Old 12.06.2022, 09:25
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,524
Default

@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
Reply With Quote
  #5  
Old 12.06.2022, 09:39
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

@Jiaz:Think OP wants separate buttons on toolbar which gives the option to either Close JD or Shutdown PC, when the downloads are finished.
Reply With Quote
  #6  
Old 12.06.2022, 10:04
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,524
Default

@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
Reply With Quote
  #7  
Old 12.06.2022, 10:18
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

@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.
Reply With Quote
  #8  
Old 12.06.2022, 10:58
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,524
Default

@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
Reply With Quote
  #9  
Old 12.06.2022, 19:53
Jdlxber Jdlxber is offline
Baby Loader
 
Join Date: Aug 2021
Posts: 5
Default

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.
Reply With Quote
  #10  
Old 13.06.2022, 19:58
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,524
Default

@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
Reply With Quote
  #11  
Old 14.06.2022, 12:07
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,088
Default

Wouldn't all of this already possible using an EventScripter script?
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
  #12  
Old 14.06.2022, 12:11
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,524
Default

__________________
JD-Dev & Server-Admin
Reply With Quote
  #13  
Old 14.06.2022, 12:11
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,524
Default

Quote:
Originally Posted by pspzockerscene View Post
Wouldn't all of this already possible using an EventScripter script?
Calling mgpai for help
__________________
JD-Dev & Server-Admin
Reply With Quote
  #14  
Old 14.06.2022, 12:29
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by pspzockerscene View Post
Wouldn't all of this already possible using an EventScripter script?
Quote:
Originally Posted by Jiaz View Post
Calling mgpai for help
Had already checked before I first replied to this thread. Couldn't find any API call to modify the "shutdownmode" property using eventscripter. Only possible to enable/disable the extension.

Optionally, can use a script to either close JD or shutdown PC, based on time the downloads are finished.
Reply With Quote
  #15  
Old 14.06.2022, 12:33
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,524
Default

@mgpai: it's advanced setting, ShutdownMode , so script use api to change advanced setting should be possible, right?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #16  
Old 14.06.2022, 12:46
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: it's advanced setting, ShutdownMode , so script use api to change advanced setting should be possible, right?
Yes. It's there is the settings list. Does not exist in my list on disk, which If found was quite outdated (Jan 2020).

Can provide a script, but will have to use simple buttons.
Reply With Quote
  #17  
Old 14.06.2022, 12:48
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,524
Default

Quote:
Originally Posted by mgpai View Post
Can provide a script, but will have to use simple buttons.
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
Reply With Quote
  #18  
Old 14.06.2022, 13:26
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

Quote:
Originally Posted by Jiaz View Post
...script that changes mode to X or Y depending on name of the button ...
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);
}
Reply With Quote
  #19  
Old 14.06.2022, 15:07
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,524
Default

@mgpai: always nice to see how simple and easy (to understand) your scripts are
__________________
JD-Dev & Server-Admin
Reply With Quote
  #20  
Old 15.06.2022, 03:48
Jdlxber Jdlxber is offline
Baby Loader
 
Join Date: Aug 2021
Posts: 5
Default

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!
Reply With Quote
  #21  
Old 15.06.2022, 09:17
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,545
Default

@Jiaz: Glad you think so.

Quote:
Originally Posted by Jdlxber View Post
...toggle button after it changes the mode?
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
Reply With Quote
  #22  
Old 16.06.2022, 06:12
Jdlxber Jdlxber is offline
Baby Loader
 
Join Date: Aug 2021
Posts: 5
Default

Perfect, thanks again
Reply With Quote
  #23  
Old 16.06.2022, 09:48
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,524
Default

@mgpai: thanks for your help!
__________________
JD-Dev & Server-Admin
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 20:59.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.