Ticket #8381: 8381-speedlimit-menu.patch

File 8381-speedlimit-menu.patch, 760 bytes (added by Jorrit Schippers, 11 years ago)
  • src/interface/menu_bar.cpp

     
    105105        break;
    106106    }
    107107
     108    bool enablespeedlimit = COptions::Get()->GetOptionVal(OPTION_SPEEDLIMIT_ENABLE) != 0;
     109
     110    int downloadLimit = COptions::Get()->GetOptionVal(OPTION_SPEEDLIMIT_INBOUND);
     111    int uploadLimit = COptions::Get()->GetOptionVal(OPTION_SPEEDLIMIT_OUTBOUND);
     112
     113    if (!downloadLimit && !uploadLimit)
     114            enablespeedlimit = false;
     115
     116    menubar->Check(XRCID("ID_MENU_TRANSFER_SPEEDLIMITS_ENABLE"), enablespeedlimit);
     117
    108118    if (COptions::Get()->GetOptionVal(OPTION_MESSAGELOG_POSITION) == 2)
    109119        menubar->HideItem(XRCID("ID_VIEW_MESSAGELOG"));
    110120