use of com.biglybt.core.subs.util.SubscriptionResultFilterable in project BiglyBT by BiglySoftware.
the class ColumnSubResultNew method refresh.
@Override
public void refresh(TableCell cell) {
SubscriptionResultFilterable entry = (SubscriptionResultFilterable) cell.getDataSource();
if (entry != null) {
boolean unread = !entry.getRead();
long sortVal = ((unread ? 2 : 1L) << 61);
if (cell.isSecondarySortEnabled()) {
sortVal -= (SystemTime.getCurrentTime() - entry.getTime()) / 1000;
}
cell.setSortValue(sortVal);
}
}
use of com.biglybt.core.subs.util.SubscriptionResultFilterable in project BiglyBT by BiglySoftware.
the class ColumnSubResultNew method cellMouseTrigger.
@Override
public void cellMouseTrigger(final TableCellMouseEvent event) {
if (event.eventType == TableRowMouseEvent.EVENT_MOUSEDOWN && event.button == 1) {
SubscriptionResultFilterable entry = (SubscriptionResultFilterable) event.cell.getDataSource();
if (entry != null) {
entry.setRead(!entry.getRead());
event.cell.invalidate();
}
}
}
use of com.biglybt.core.subs.util.SubscriptionResultFilterable in project BiglyBT by BiglySoftware.
the class SBC_SearchResultsView method showDownloadFTUX.
protected static void showDownloadFTUX(SearchSubsResultBase entry, final UserPrompterResultListener listener) {
if (entry instanceof SubscriptionResultFilterable) {
listener.prompterClosed(0);
return;
}
if (RememberedDecisionsManager.getRememberedDecision("searchsubs.dl.ftux") == 1) {
listener.prompterClosed(0);
return;
}
final VuzeMessageBox box = new VuzeMessageBox(MessageText.getString("searchsubs.dl.ftux.title"), null, new String[] { MessageText.getString("Button.ok"), MessageText.getString("Button.cancel") }, 0);
box.setSubTitle(MessageText.getString("searchsubs.dl.ftux.heading"));
final boolean[] check_state = new boolean[] { true };
box.setListener(new VuzeMessageBoxListener() {
@Override
public void shellReady(Shell shell, SWTSkinObjectContainer soExtra) {
SWTSkin skin = soExtra.getSkin();
addResourceBundle(skin, "com/biglybt/ui/swt/columns/searchsubs/", "skin3_dl_ftux");
String id = "searchsubs.dlftux.shell";
skin.createSkinObject(id, id, soExtra);
final SWTSkinObjectCheckbox cb = (SWTSkinObjectCheckbox) skin.getSkinObject("agree-checkbox");
cb.setChecked(true);
cb.addSelectionListener(new SWTSkinCheckboxListener() {
@Override
public void checkboxChanged(SWTSkinObjectCheckbox so, boolean checked) {
check_state[0] = checked;
}
});
}
});
box.open(new UserPrompterResultListener() {
@Override
public void prompterClosed(int result) {
if (result == 0 && check_state[0]) {
RememberedDecisionsManager.setRemembered("searchsubs.dl.ftux", 1);
}
listener.prompterClosed(result);
}
});
}
use of com.biglybt.core.subs.util.SubscriptionResultFilterable in project BiglyBT by BiglySoftware.
the class SubscriptionDownloader method checkAutoDownload.
protected void checkAutoDownload(SubscriptionResultImpl[] results) {
if (!subs.getHistory().isAutoDownload()) {
return;
}
SubscriptionResultFilter filter;
try {
filter = subs.getFilters();
if (!filter.isActive()) {
filter = null;
}
} catch (Throwable e) {
filter = null;
}
for (int i = 0; i < results.length; i++) {
SubscriptionResultImpl result = results[i];
if (result.isDeleted() || result.getRead()) {
continue;
}
if (filter != null && filter.isFiltered(new SubscriptionResultFilterable(subs, result))) {
continue;
}
manager.getScheduler().download(subs, result);
}
}
Aggregations