Search in sources :

Example 6 with SubscriptionResultFilterable

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);
    }
}
Also used : SubscriptionResultFilterable(com.biglybt.core.subs.util.SubscriptionResultFilterable)

Example 7 with SubscriptionResultFilterable

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();
        }
    }
}
Also used : SubscriptionResultFilterable(com.biglybt.core.subs.util.SubscriptionResultFilterable)

Example 8 with SubscriptionResultFilterable

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);
        }
    });
}
Also used : SWTSkinCheckboxListener(com.biglybt.ui.swt.skin.SWTSkinCheckboxListener) SWTSkinObjectCheckbox(com.biglybt.ui.swt.skin.SWTSkinObjectCheckbox) SubscriptionResultFilterable(com.biglybt.core.subs.util.SubscriptionResultFilterable) SWTSkin(com.biglybt.ui.swt.skin.SWTSkin) Shell(org.eclipse.swt.widgets.Shell) UserPrompterResultListener(com.biglybt.ui.UserPrompterResultListener) SWTSkinObjectContainer(com.biglybt.ui.swt.skin.SWTSkinObjectContainer) VuzeMessageBoxListener(com.biglybt.ui.swt.views.skin.VuzeMessageBoxListener) VuzeMessageBox(com.biglybt.ui.swt.views.skin.VuzeMessageBox)

Example 9 with SubscriptionResultFilterable

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);
    }
}
Also used : SubscriptionResultFilter(com.biglybt.core.subs.SubscriptionResultFilter) SubscriptionResultFilterable(com.biglybt.core.subs.util.SubscriptionResultFilterable)

Aggregations

SubscriptionResultFilterable (com.biglybt.core.subs.util.SubscriptionResultFilterable)9 Subscription (com.biglybt.core.subs.Subscription)2 UserPrompterResultListener (com.biglybt.ui.UserPrompterResultListener)2 Engine (com.biglybt.core.metasearch.Engine)1 WebEngine (com.biglybt.core.metasearch.impl.web.WebEngine)1 SubscriptionResult (com.biglybt.core.subs.SubscriptionResult)1 SubscriptionResultFilter (com.biglybt.core.subs.SubscriptionResultFilter)1 UIFunctions (com.biglybt.ui.UIFunctions)1 TableColumnManager (com.biglybt.ui.common.table.impl.TableColumnManager)1 DownloadUrlInfo (com.biglybt.ui.selectedcontent.DownloadUrlInfo)1 ISelectedContent (com.biglybt.ui.selectedcontent.ISelectedContent)1 SelectedContent (com.biglybt.ui.selectedcontent.SelectedContent)1 SWTSkin (com.biglybt.ui.swt.skin.SWTSkin)1 SWTSkinCheckboxListener (com.biglybt.ui.swt.skin.SWTSkinCheckboxListener)1 SWTSkinObjectCheckbox (com.biglybt.ui.swt.skin.SWTSkinObjectCheckbox)1 SWTSkinObjectContainer (com.biglybt.ui.swt.skin.SWTSkinObjectContainer)1 VuzeMessageBox (com.biglybt.ui.swt.views.skin.VuzeMessageBox)1 VuzeMessageBoxListener (com.biglybt.ui.swt.views.skin.VuzeMessageBoxListener)1 TableViewSWTMenuFillListener (com.biglybt.ui.swt.views.table.TableViewSWTMenuFillListener)1 URL (java.net.URL)1