Search in sources :

Example 1 with DeviceTemplateChooser

use of com.biglybt.ui.swt.devices.add.DeviceTemplateChooser in project BiglyBT by BiglySoftware.

the class DeviceManagerUI method addNewDevice.

/**
 * @since 4.1.0.5
 */
protected void addNewDevice() {
    ManufacturerChooser mfChooser = new ManufacturerChooser();
    mfChooser.open(new ManufacturerChooser.ClosedListener() {

        @Override
        public void MfChooserClosed(DeviceManufacturer mf) {
            if (mf == null) {
                return;
            }
            DeviceTemplateChooser deviceTemplateChooser = new DeviceTemplateChooser(mf);
            deviceTemplateChooser.open(new DeviceTemplateChooser.DeviceTemplateClosedListener() {

                @Override
                public void deviceTemplateChooserClosed(DeviceTemplate deviceTemplate) {
                    if (deviceTemplate == null) {
                        return;
                    }
                    Device device;
                    try {
                        device = deviceTemplate.createInstance(deviceTemplate.getName() + " test!");
                        device.requestAttention();
                    } catch (DeviceManagerException e) {
                        Debug.out(e);
                    }
                /*  Don't really need to choose a profile now..
						TranscodeProfile[] profiles = null;// deviceTemplate.getTranscodeProfiles();
						new TranscodeChooser(profiles) {
							public void closed() {
								Utils.openMessageBox(null, 0, "CHOSE", "You chose "
										+ (selectedProfile == null ? "NULL"
												: selectedProfile.getName()));

							}
						};
						*/
                }
            });
        }
    });
}
Also used : DeviceTemplateChooser(com.biglybt.ui.swt.devices.add.DeviceTemplateChooser) UPnPDevice(com.biglybt.net.upnp.UPnPDevice) UnassociatedDevice(com.biglybt.core.devices.DeviceManager.UnassociatedDevice) UPnPRootDevice(com.biglybt.net.upnp.UPnPRootDevice) DeviceManufacturer(com.biglybt.core.devices.DeviceManager.DeviceManufacturer) ManufacturerChooser(com.biglybt.ui.swt.devices.add.ManufacturerChooser)

Aggregations

DeviceManufacturer (com.biglybt.core.devices.DeviceManager.DeviceManufacturer)1 UnassociatedDevice (com.biglybt.core.devices.DeviceManager.UnassociatedDevice)1 UPnPDevice (com.biglybt.net.upnp.UPnPDevice)1 UPnPRootDevice (com.biglybt.net.upnp.UPnPRootDevice)1 DeviceTemplateChooser (com.biglybt.ui.swt.devices.add.DeviceTemplateChooser)1 ManufacturerChooser (com.biglybt.ui.swt.devices.add.ManufacturerChooser)1