Search in sources :

Example 1 with TRTrackerBTScraperResponseImpl

use of com.biglybt.core.tracker.client.impl.bt.TRTrackerBTScraperResponseImpl in project BiglyBT by BiglySoftware.

the class TrackerCellUtils method updateColor.

public static void updateColor(TableCell cell, DownloadManager dm, boolean show_errors) {
    if (dm == null || cell == null)
        return;
    if (show_errors) {
        if (dm.isTrackerError()) {
            cell.setForegroundToErrorColor();
            return;
        }
    }
    TRTrackerScraperResponse response = dm.getTrackerScrapeResponse();
    if (response instanceof TRTrackerBTScraperResponseImpl && response.getStatus() == TRTrackerScraperResponse.ST_ONLINE) {
        boolean bMultiHashScrapes = ((TRTrackerBTScraperResponseImpl) response).getTrackerStatus().getSupportsMultipeHashScrapes();
        Color color = (bMultiHashScrapes) ? null : Colors.grey;
        cell.setForeground(Utils.colorToIntArray(color));
    } else {
        cell.setForeground(Utils.colorToIntArray(null));
    }
}
Also used : TRTrackerScraperResponse(com.biglybt.core.tracker.client.TRTrackerScraperResponse) Color(org.eclipse.swt.graphics.Color) TRTrackerBTScraperResponseImpl(com.biglybt.core.tracker.client.impl.bt.TRTrackerBTScraperResponseImpl)

Example 2 with TRTrackerBTScraperResponseImpl

use of com.biglybt.core.tracker.client.impl.bt.TRTrackerBTScraperResponseImpl in project BiglyBT by BiglySoftware.

the class TrackerCellUtils method getTooltipText.

public static String getTooltipText(TableCell cell, DownloadManager dm, boolean show_errors) {
    if (dm == null || cell == null)
        return null;
    if (show_errors) {
        if (dm.isTrackerError()) {
            return (null);
        }
    }
    String sToolTip = null;
    TRTrackerScraperResponse response = dm.getTrackerScrapeResponse();
    if (response instanceof TRTrackerBTScraperResponseImpl && response.getStatus() == TRTrackerScraperResponse.ST_ONLINE) {
        String sPrefix = ((TRTrackerBTScraperResponseImpl) response).getTrackerStatus().getSupportsMultipeHashScrapes() ? "" : "No";
        sToolTip = MessageText.getString("Tracker.tooltip." + sPrefix + "MultiSupport");
    }
    return sToolTip;
}
Also used : TRTrackerScraperResponse(com.biglybt.core.tracker.client.TRTrackerScraperResponse) TRTrackerBTScraperResponseImpl(com.biglybt.core.tracker.client.impl.bt.TRTrackerBTScraperResponseImpl)

Aggregations

TRTrackerScraperResponse (com.biglybt.core.tracker.client.TRTrackerScraperResponse)2 TRTrackerBTScraperResponseImpl (com.biglybt.core.tracker.client.impl.bt.TRTrackerBTScraperResponseImpl)2 Color (org.eclipse.swt.graphics.Color)1