JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 27.03.2020, 20:59
zreenmkr zreenmkr is offline
JD Addict
 
Join Date: Feb 2020
Posts: 174
Default Create Toolbar Checkbox Button

Is there any documentation to create 'Toolbar Button' with checkbox similar to
'Clipboard Monitoring', 'Premium Downloads' & 'Silent Mode'?

Want to use in EventScripter, return button IsCheck.

Code:
var IsCheck = true or 1 | false or 0 //get IsCheck status

switch(IsCheck) {
   case 0:
      alert('IsUserCheckbox = false or 0'); //if check is uncheck
      break;
   case 1:
      alert('IsUserCheckbox = true or 1'); //if checkbox is checked
      break;
}
Reply With Quote
  #2  
Old 29.03.2020, 03:08
zreenmkr zreenmkr is offline
JD Addict
 
Join Date: Feb 2020
Posts: 174
Default

just found out from @mgpai that new checkbox button cannot be created as of right now.

@Mods could we have a sticket for this option?

find it to be useful to implement into eventscripter as manual switch. e.g if checkboxN is checked do 'A work', else if uncheck then do 'B work'

for right now the existing buttons status can be returned to do desired work. if interested. here are the buttons described.


Code:
// Name : get checkbox status
// Trigger : "Toolbar Button Pressed" Click 'Main Toolbar' above to create button or goto Settings > User Interface > Main Toolbar

//--------------------------------------------------------
disablePermissionChecks(); //no prompting persmision dialog
//enablePermissionChecks(); //required prompting permision

//--------------------------------------------------------
//setDisableOnException(Boolean); // enable/disable script on error exceptions
//setNotifyOnException(Boolean); // enable/disable notification on exceptions



//---------------------------------------------------------
if (name == "aManualSwitch") {

    //var key = 'EnableChatExtension'; //checkbox enable/disable
    //var key = 'ClipboardMonitored'; //checkbox enable/disable
    //var key = 'UseAvailableAccounts'; //Premiunum Account checkbox enable/disable
    var key = 'ManualEnabled'; //Silent mode checkbox enable/disable

    switch (key) {
        case 'EnableChatExtension':
            var interfaceName = "org.jdownloader.settings.GraphicalUserInterfaceSettings";
            break;
        case 'ClipboardMonitored':
            var interfaceName = "org.jdownloader.settings.GraphicalUserInterfaceSettings";
            break;
        case 'UseAvailableAccounts':
            var interfaceName = "org.jdownloader.settings.GeneralSettings";
            break;
        case 'ManualEnabled':
            var interfaceName = "org.jdownloader.settings.SilentModeSettings";
            break;
        default:
            break;
    }

    var IsCheck = callAPI("config", "get", interfaceName, null, key);
    //alert(IsCheck);

    if (IsCheck) {
        alert(key + ': ' + IsCheck + ' - do A work');
    } else {
        alert(key + ': ' + IsCheck + ' - do B work');
    }
}

Last edited by zreenmkr; 29.03.2020 at 03:12.
Reply With Quote
  #3  
Old 30.03.2020, 13:22
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,103
Default

Ticket:


-psp-
__________________
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
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 04:08.
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.