Search in sources :

Example 1 with AllTransfersBar

use of com.biglybt.ui.swt.minibar.AllTransfersBar in project BiglyBT by BiglySoftware.

the class BuddyPluginView method setBetaStatus.

private void setBetaStatus(final Image image) {
    beta_status.setImage(image);
    final AllTransfersBar bar = AllTransfersBar.getBarIfOpen(CoreFactory.getSingleton().getGlobalManager());
    if (bar != null) {
        Utils.execSWTThread(new Runnable() {

            @Override
            public void run() {
                bar.setIconImage(image == bs_chat_gray ? null : image);
            }
        });
    }
}
Also used : AllTransfersBar(com.biglybt.ui.swt.minibar.AllTransfersBar)

Example 2 with AllTransfersBar

use of com.biglybt.ui.swt.minibar.AllTransfersBar in project BiglyBT by BiglySoftware.

the class MainWindowDelayStub method dispose.

@Override
public boolean dispose(boolean for_restart) {
    if (main_window != null) {
        return (main_window.dispose(for_restart));
    }
    log("dispose");
    UIExitUtilsSWT.uiShutdown();
    if (swt_tray != null) {
        swt_tray.dispose();
    }
    try {
        AllTransfersBar transfer_bar = AllTransfersBar.getBarIfOpen(core.getGlobalManager());
        if (transfer_bar != null) {
            transfer_bar.forceSaveLocation();
        }
    } catch (Exception ignore) {
    }
    SWTThread instance = SWTThread.getInstance();
    if (instance != null && !instance.isTerminated()) {
        Utils.getOffOfSWTThread(new AERunnable() {

            @Override
            public void runSupport() {
                SWTThread instance = SWTThread.getInstance();
                if (instance != null && !instance.isTerminated()) {
                    instance.getInitializer().stopIt(for_restart);
                }
            }
        });
    }
    return true;
}
Also used : AllTransfersBar(com.biglybt.ui.swt.minibar.AllTransfersBar)

Example 3 with AllTransfersBar

use of com.biglybt.ui.swt.minibar.AllTransfersBar in project BiglyBT by BiglySoftware.

the class MainWindowImpl method disposeOnlyUI.

@Override
public void disposeOnlyUI() {
    MainMDISetup.dispose();
    isReady = false;
    UIExitUtilsSWT.uiShutdown();
    if (systemTraySWT != null) {
        systemTraySWT.dispose();
        systemTraySWT = null;
    }
    try {
        // if we go straight from a text control (say) to the File menu (say) and select
        // exit/restart then the text control doesn't get a focus-lost before the application closes.
        // This can cause confusion if the control is a config option that the user has amended and hit
        // exit/restart - the value isn't updated and therefore the change ignored. Inject an explicit traversal
        // to pick it up
        Display display = Display.getCurrent();
        if (display != null && !display.isDisposed()) {
            Control control = display.getFocusControl();
            if (control != null) {
                control.traverse(SWT.TRAVERSE_TAB_NEXT);
            }
        }
    } catch (Throwable e) {
    }
    /**
     * Explicitly force the transfer bar location to be saved (if appropriate and open).
     *
     * We can't rely that the normal mechanism for doing this won't fail (which it usually does)
     * when the GUI is being disposed of.
     */
    try {
        if (core != null) {
            AllTransfersBar transfer_bar = AllTransfersBar.getBarIfOpen(core.getGlobalManager());
            if (transfer_bar != null) {
                transfer_bar.forceSaveLocation();
            }
        }
    } catch (Exception ignore) {
    }
}
Also used : AllTransfersBar(com.biglybt.ui.swt.minibar.AllTransfersBar)

Aggregations

AllTransfersBar (com.biglybt.ui.swt.minibar.AllTransfersBar)3