void VideoCaptureNode::loadSettings( QSettings &pSettings ) { int DevIdx = pSettings.value( "index", mDeviceIndex ).toInt(); int CfgIdx = pSettings.value( "format", mFormatIndex ).toInt(); setCurrentDevice( DevIdx, CfgIdx ); }
void K3bFileTreeView::setSelectedDevice( K3bDevice::Device* dev ) { setCurrentDevice( dev ); K3bDeviceBranch* b = branch( dev ); setCurrentItem( b->root() ); setSelected( b->root(), true ); }
void VideoCaptureNode::chooseDevice() { #if defined( VIDEOCAPTURE_SUPPORTED ) DeviceDialog DD( mDeviceIndex, mFormatIndex ); if( DD.exec() == QDialog::Accepted ) { setCurrentDevice( DD.deviceIdx(), DD.formatIdx() ); } #endif }
bool VideoCaptureNode::initialise( void ) { if( !NodeControlBase::initialise() ) { return( false ); } if( mDeviceIndex < 0 || mFormatIndex < 0 ) { setCurrentDevice( qMax( mDeviceIndex, 0 ), qMax( mFormatIndex, 0 ) ); } return( true ); }
void QHiMDMainWindow::open_device(QMDDevice * dev) { QMessageBox mdStatus; QString error; QMDTracksModel * mod; int index = ui->himd_devices->currentIndex(); // remember current index of devices combo box, will be resetted by current_device_closed() function if (!dev) { current_device_closed(); ui->himd_devices->setCurrentIndex(0); return; } if(current_device) { current_device_closed(); ui->himd_devices->setCurrentIndex(index); // set correct device index in the combo box } if(dev->deviceType() == HIMD_DEVICE && dev->path().isEmpty()) { ui->himd_devices->setCurrentIndex(0); on_action_Connect_triggered(); return; } setCurrentDevice(dev); mod = (QMDTracksModel *)ui->TrackList->model(); error = mod->open(dev); if (!error.isEmpty()) { mdStatus.setText(tr("Error opening minidisc device (") + current_device->name() + "):\n" + error); mdStatus.exec(); set_buttons_enable(1,0,0,0,0,0,1); ui->himd_devices->setCurrentIndex(0); return; } localmodel.setSelectableExtensions(current_device->downloadableFileExtensions()); QModelIndex curdir = localmodel.index(ui->updir->text()); ui->localScan->expand(curdir); ui->localScan->setCurrentIndex(curdir); ui->DiscTitle->setText(current_device->discTitle()); set_buttons_enable(1,0,0,1,1,1,1); }