K3b::ImageWritingDialog::ImageWritingDialog( QWidget* parent ) : K3b::InteractionDialog( parent, i18n("Burn Image"), "iso cue toc", START_BUTTON|CANCEL_BUTTON, START_BUTTON, "image writing" ) // config group { d = new Private(); const KColorScheme colorScheme( QPalette::Normal, KColorScheme::View ); d->infoTextColor = palette().color( QPalette::Disabled, QPalette::Text ); d->negativeTextColor = colorScheme.foreground( KColorScheme::NegativeText ).color(); d->normalTextColor = colorScheme.foreground( KColorScheme::NormalText ).color(); setAcceptDrops( true ); setupGui(); d->md5Job = new K3b::Md5Job( 0, this ); connect( d->md5Job, SIGNAL(finished(bool)), this, SLOT(slotMd5JobFinished(bool)) ); connect( d->md5Job, SIGNAL(percent(int)), this, SLOT(slotMd5JobPercent(int)) ); connect( d->writerSelectionWidget, SIGNAL(writerChanged()), this, SLOT(slotToggleAll()) ); connect( d->writerSelectionWidget, SIGNAL(writingAppChanged(K3b::WritingApp)), this, SLOT(slotToggleAll()) ); connect( d->writerSelectionWidget, SIGNAL(writerChanged(K3b::Device::Device*)), d->writingModeWidget, SLOT(setDevice(K3b::Device::Device*)) ); connect( d->comboImageType, SIGNAL(activated(int)), this, SLOT(slotToggleAll()) ); connect( d->writingModeWidget, SIGNAL(writingModeChanged(WritingMode)), this, SLOT(slotToggleAll()) ); connect( d->editImagePath, SIGNAL(textChanged(QString)), this, SLOT(slotUpdateImage(QString)) ); connect( d->checkDummy, SIGNAL(toggled(bool)), this, SLOT(slotToggleAll()) ); connect( d->checkCacheImage, SIGNAL(toggled(bool)), this, SLOT(slotToggleAll()) ); }
K3bIsoImageWritingDialog::K3bIsoImageWritingDialog( QWidget* parent, const char* name, bool modal ) : K3bInteractionDialog( parent, name, i18n("Burn Iso9660 Image"), i18n("to DVD"), START_BUTTON|CANCEL_BUTTON, START_BUTTON, "DVD image writing", modal ) { d = new Private(); setAcceptDrops(true); setupGui(); m_writerSelectionWidget->setWantedMediumType( K3bDevice::MEDIA_WRITABLE_DVD ); m_writerSelectionWidget->setWantedMediumState( K3bDevice::STATE_EMPTY ); m_writerSelectionWidget->setSupportedWritingApps( K3b::GROWISOFS ); m_writingModeWidget->setSupportedModes( K3b::DAO|K3b::WRITING_MODE_INCR_SEQ|K3b::WRITING_MODE_RES_OVWR ); m_md5Job = new K3bMd5Job( 0, this ); connect( m_md5Job, SIGNAL(finished(bool)), this, SLOT(slotMd5JobFinished(bool)) ); connect( m_md5Job, SIGNAL(percent(int)), this, SLOT(slotMd5JobPercent(int)) ); updateImageSize( imagePath() ); connect( m_writerSelectionWidget, SIGNAL(writerChanged()), this, SLOT(slotWriterChanged()) ); connect( m_writerSelectionWidget, SIGNAL(writingAppChanged(int)), this, SLOT(slotWriterChanged()) ); connect( m_writingModeWidget, SIGNAL(writingModeChanged(int)), this, SLOT(slotWriterChanged()) ); connect( m_editImagePath, SIGNAL(textChanged(const QString&)), this, SLOT(updateImageSize(const QString&)) ); connect( m_checkDummy, SIGNAL(toggled(bool)), this, SLOT(slotWriterChanged()) ); }
K3b::WriterSelectionWidget::WriterSelectionWidget( QWidget *parent ) : QWidget( parent ) { d = new Private; d->forceAutoSpeed = false; d->supportedWritingApps = K3b::WritingAppCdrecord|K3b::WritingAppCdrdao|K3b::WritingAppGrowisofs; d->lastSetSpeed = -1; QGroupBox* groupWriter = new QGroupBox( this ); groupWriter->setTitle( i18n( "Burn Medium" ) ); QGridLayout* groupWriterLayout = new QGridLayout( groupWriter ); groupWriterLayout->setAlignment( Qt::AlignTop ); QLabel* labelSpeed = new QLabel( groupWriter ); labelSpeed->setText( i18n( "Speed:" ) ); m_comboSpeed = new K3b::IntMapComboBox( groupWriter ); m_comboMedium = new MediaSelectionComboBox( groupWriter ); m_writingAppLabel = new QLabel( i18n("Writing app:"), groupWriter ); m_comboWritingApp = new K3b::IntMapComboBox( groupWriter ); groupWriterLayout->addWidget( m_comboMedium, 0, 0 ); groupWriterLayout->addWidget( labelSpeed, 0, 1 ); groupWriterLayout->addWidget( m_comboSpeed, 0, 2 ); groupWriterLayout->addWidget( m_writingAppLabel, 0, 3 ); groupWriterLayout->addWidget( m_comboWritingApp, 0, 4 ); groupWriterLayout->setColumnStretch( 0, 1 ); QGridLayout* mainLayout = new QGridLayout( this ); mainLayout->setAlignment( Qt::AlignTop ); mainLayout->setContentsMargins( 0, 0, 0, 0 ); mainLayout->addWidget( groupWriter, 0, 0 ); // tab order setTabOrder( m_comboMedium, m_comboSpeed ); setTabOrder( m_comboSpeed, m_comboWritingApp ); connect( m_comboMedium, SIGNAL(selectionChanged(K3b::Device::Device*)), this, SIGNAL(writerChanged()) ); connect( m_comboMedium, SIGNAL(selectionChanged(K3b::Device::Device*)), this, SIGNAL(writerChanged(K3b::Device::Device*)) ); connect( m_comboMedium, SIGNAL(newMedia()), this, SIGNAL(newMedia()) ); connect( m_comboMedium, SIGNAL(newMedium(K3b::Device::Device*)), this, SIGNAL(newMedium(K3b::Device::Device*)) ); connect( m_comboMedium, SIGNAL(newMedium(K3b::Device::Device*)), this, SLOT(slotNewBurnMedium(K3b::Device::Device*)) ); connect( m_comboWritingApp, SIGNAL(valueChanged(int)), this, SLOT(slotWritingAppSelected(int)) ); connect( this, SIGNAL(writerChanged()), SLOT(slotWriterChanged()) ); connect( m_comboSpeed, SIGNAL(valueChanged(int)), this, SLOT(slotSpeedChanged(int)) ); m_comboMedium->setToolTip( i18n("The medium that will be used for burning") ); m_comboSpeed->setToolTip( i18n("The speed at which to burn the medium") ); m_comboWritingApp->setToolTip( i18n("The external application to actually burn the medium") ); m_comboMedium->setWhatsThis( i18n("<p>Select the medium that you want to use for burning." "<p>In most cases there will only be one medium available which " "does not leave much choice.") ); m_comboSpeed->setWhatsThis( i18n("<p>Select the speed with which you want to burn." "<p><b>Auto</b><br>" "This will choose the maximum writing speed possible with the used " "medium. " "This is the recommended selection for most media.</p>" "<p><b>Ignore</b> (DVD only)<br>" "This will leave the speed selection to the writer device. " "Use this if K3b is unable to set the writing speed." "<p>1x refers to 175 KB/s for CD, 1385 KB/s for DVD, and 4496 KB/s for Blu-ray.</p>" "<p><b>Caution:</b> Make sure your system is able to send the data " "fast enough to prevent buffer underruns.") ); m_comboWritingApp->setWhatsThis( i18n("<p>K3b uses the command line tools cdrecord, growisofs, and cdrdao " "to actually write a CD or DVD." "<p>Normally K3b chooses the best " "suited application for every task automatically but in some cases it " "may be possible that one of the applications does not work as intended " "with a certain writer. In this case one may select the " "application manually.") ); clearSpeedCombo(); slotConfigChanged( KGlobal::config() ); slotWriterChanged(); }
K3b::MediaCopyDialog::MediaCopyDialog( QWidget *parent ) : K3b::InteractionDialog( parent, i18n("Disk Copy"), i18n("and CD Cloning"), START_BUTTON|CANCEL_BUTTON, START_BUTTON, "Disk Copy" ) { QWidget* main = mainWidget(); QGridLayout* mainGrid = new QGridLayout( main ); mainGrid->setContentsMargins( 0, 0, 0, 0 ); QGroupBox* groupSource = new QGroupBox( i18n("Source Medium"), main ); m_comboSourceDevice = new K3b::MediaSelectionComboBox( groupSource ); m_comboSourceDevice->setWantedMediumType( K3b::Device::MEDIA_ALL ); m_comboSourceDevice->setWantedMediumState( K3b::Device::STATE_COMPLETE|K3b::Device::STATE_INCOMPLETE ); QHBoxLayout* groupSourceLayout = new QHBoxLayout( groupSource ); groupSourceLayout->addWidget( m_comboSourceDevice ); m_writerSelectionWidget = new K3b::WriterSelectionWidget( main ); m_writerSelectionWidget->setWantedMediumState( K3b::Device::STATE_EMPTY ); // tab widget -------------------- QTabWidget* tabWidget = new QTabWidget( main ); // // option tab -------------------- // QWidget* optionTab = new QWidget( tabWidget ); QGridLayout* optionTabGrid = new QGridLayout( optionTab ); QGroupBox* groupCopyMode = new QGroupBox( i18n("Copy Mode"), optionTab ); m_comboCopyMode = new QComboBox( groupCopyMode ); m_comboCopyMode->addItem( i18n("Normal Copy") ); m_comboCopyMode->addItem( i18n("Clone Copy") ); QHBoxLayout* groupCopyModeLayout = new QHBoxLayout( groupCopyMode ); groupCopyModeLayout->addWidget( m_comboCopyMode ); QGroupBox* groupWritingMode = new QGroupBox( i18n("Writing Mode"), optionTab ); m_writingModeWidget = new K3b::WritingModeWidget( groupWritingMode ); QHBoxLayout* groupWritingModeLayout = new QHBoxLayout( groupWritingMode ); groupWritingModeLayout->addWidget( m_writingModeWidget ); QGroupBox* groupCopies = new QGroupBox( i18n("Copies"), optionTab ); QLabel* pixLabel = new QLabel( groupCopies ); pixLabel->setPixmap( SmallIcon( "tools-media-optical-copy", KIconLoader::SizeMedium ) ); pixLabel->setScaledContents( false ); m_spinCopies = new QSpinBox( groupCopies ); m_spinCopies->setRange( 1, 999 ); QHBoxLayout* groupCopiesLayout = new QHBoxLayout( groupCopies ); groupCopiesLayout->addWidget( pixLabel ); groupCopiesLayout->addWidget( m_spinCopies ); QGroupBox* groupOptions = new QGroupBox( i18n("Settings"), optionTab ); m_checkSimulate = K3b::StdGuiItems::simulateCheckbox( groupOptions ); m_checkCacheImage = K3b::StdGuiItems::createCacheImageCheckbox( groupOptions ); m_checkOnlyCreateImage = K3b::StdGuiItems::onlyCreateImagesCheckbox( groupOptions ); m_checkDeleteImages = K3b::StdGuiItems::removeImagesCheckbox( groupOptions ); m_checkVerifyData = K3b::StdGuiItems::verifyCheckBox( groupOptions ); QVBoxLayout* groupOptionsLayout = new QVBoxLayout( groupOptions ); groupOptionsLayout->addWidget( m_checkSimulate ); groupOptionsLayout->addWidget( m_checkCacheImage ); groupOptionsLayout->addWidget( m_checkOnlyCreateImage ); groupOptionsLayout->addWidget( m_checkDeleteImages ); groupOptionsLayout->addWidget( m_checkVerifyData ); groupOptionsLayout->addStretch( 1 ); optionTabGrid->addWidget( groupCopyMode, 0, 0 ); optionTabGrid->addWidget( groupWritingMode, 1, 0 ); optionTabGrid->addWidget( groupOptions, 0, 1, 3, 1 ); optionTabGrid->addWidget( groupCopies, 2, 0 ); optionTabGrid->setRowStretch( 2, 1 ); optionTabGrid->setColumnStretch( 1, 1 ); tabWidget->addTab( optionTab, i18n("&Options") ); // // image tab ------------------ // QWidget* imageTab = new QWidget( tabWidget ); QGridLayout* imageTabGrid = new QGridLayout( imageTab ); m_tempDirSelectionWidget = new K3b::TempDirSelectionWidget( imageTab ); imageTabGrid->addWidget( m_tempDirSelectionWidget, 0, 0 ); tabWidget->addTab( imageTab, i18n("&Image") ); // // advanced tab ------------------ // QWidget* advancedTab = new QWidget( tabWidget ); QGridLayout* advancedTabGrid = new QGridLayout( advancedTab ); m_groupAdvancedDataOptions = new QGroupBox( i18n("Data"), advancedTab ); QGridLayout* groupAdvancedDataOptionsLayout = new QGridLayout( m_groupAdvancedDataOptions ); m_spinDataRetries = new QSpinBox( m_groupAdvancedDataOptions ); m_spinDataRetries->setRange( 1, 128 ); m_checkIgnoreDataReadErrors = K3b::StdGuiItems::ignoreAudioReadErrorsCheckBox( m_groupAdvancedDataOptions ); m_checkNoCorrection = new QCheckBox( i18n("No error correction"), m_groupAdvancedDataOptions ); groupAdvancedDataOptionsLayout->addWidget( new QLabel( i18n("Read retries:"), m_groupAdvancedDataOptions ), 0, 0 ); groupAdvancedDataOptionsLayout->addWidget( m_spinDataRetries, 0, 1 ); groupAdvancedDataOptionsLayout->addWidget( m_checkIgnoreDataReadErrors, 1, 0, 1, 2 ); groupAdvancedDataOptionsLayout->addWidget( m_checkNoCorrection, 2, 0, 1, 2 ); groupAdvancedDataOptionsLayout->setRowStretch( 4, 1 ); m_groupAdvancedAudioOptions = new QGroupBox( i18n("Audio"), advancedTab ); QGridLayout* groupAdvancedAudioOptionsLayout = new QGridLayout( m_groupAdvancedAudioOptions ); m_spinAudioRetries = new QSpinBox( m_groupAdvancedAudioOptions ); m_spinAudioRetries->setRange( 1, 128 ); m_checkIgnoreAudioReadErrors = K3b::StdGuiItems::ignoreAudioReadErrorsCheckBox( m_groupAdvancedAudioOptions ); m_comboParanoiaMode = K3b::StdGuiItems::paranoiaModeComboBox( m_groupAdvancedAudioOptions ); m_checkReadCdText = new QCheckBox( i18n("Copy CD-Text"), m_groupAdvancedAudioOptions ); groupAdvancedAudioOptionsLayout->addWidget( new QLabel( i18n("Read retries:"), m_groupAdvancedAudioOptions ), 0, 0 ); groupAdvancedAudioOptionsLayout->addWidget( m_spinAudioRetries, 0, 1 ); groupAdvancedAudioOptionsLayout->addWidget( m_checkIgnoreAudioReadErrors, 1, 0, 1, 2 ); groupAdvancedAudioOptionsLayout->addWidget( new QLabel( i18n("Paranoia mode:"), m_groupAdvancedAudioOptions ), 2, 0 ); groupAdvancedAudioOptionsLayout->addWidget( m_comboParanoiaMode, 2, 1 ); groupAdvancedAudioOptionsLayout->addWidget( m_checkReadCdText, 3, 0, 1, 2 ); groupAdvancedAudioOptionsLayout->setRowStretch( 4, 1 ); advancedTabGrid->addWidget( m_groupAdvancedDataOptions, 0, 1 ); advancedTabGrid->addWidget( m_groupAdvancedAudioOptions, 0, 0 ); tabWidget->addTab( advancedTab, i18n("&Advanced") ); mainGrid->addWidget( groupSource, 0, 0 ); mainGrid->addWidget( m_writerSelectionWidget, 1, 0 ); mainGrid->addWidget( tabWidget, 2, 0 ); mainGrid->setRowStretch( 2, 1 ); connect( m_comboSourceDevice, SIGNAL(selectionChanged(K3b::Device::Device*)), this, SLOT(slotToggleAll()) ); connect( m_comboSourceDevice, SIGNAL(selectionChanged(K3b::Device::Device*)), this, SLOT(slotToggleAll()) ); connect( m_writerSelectionWidget, SIGNAL(writerChanged()), this, SLOT(slotToggleAll()) ); connect( m_writerSelectionWidget, SIGNAL(writerChanged(K3b::Device::Device*)), m_writingModeWidget, SLOT(setDevice(K3b::Device::Device*)) ); connect( m_writingModeWidget, SIGNAL(writingModeChanged(WritingMode)), this, SLOT(slotToggleAll()) ); connect( m_checkCacheImage, SIGNAL(toggled(bool)), this, SLOT(slotToggleAll()) ); connect( m_checkSimulate, SIGNAL(toggled(bool)), this, SLOT(slotToggleAll()) ); connect( m_checkOnlyCreateImage, SIGNAL(toggled(bool)), this, SLOT(slotToggleAll()) ); connect( m_comboCopyMode, SIGNAL(activated(int)), this, SLOT(slotToggleAll()) ); connect( m_checkReadCdText, SIGNAL(toggled(bool)), this, SLOT(slotToggleAll()) ); m_checkIgnoreDataReadErrors->setToolTip( i18n("Skip unreadable data sectors") ); m_checkNoCorrection->setToolTip( i18n("Disable the source drive's error correction") ); m_checkReadCdText->setToolTip( i18n("Copy CD-Text from the source CD if available.") ); m_checkNoCorrection->setWhatsThis( i18n("<p>If this option is checked K3b will disable the " "source drive's ECC/EDC error correction. This way sectors " "that are unreadable by intention can be read." "<p>This may be useful for cloning CDs with copy " "protection based on corrupted sectors.") ); m_checkReadCdText->setWhatsThis( i18n("<p>If this option is checked K3b will search for CD-Text on the source CD. " "Disable it if your CD drive has problems with reading CD-Text or you want " "to stick to CDDB info.") ); m_checkIgnoreDataReadErrors->setWhatsThis( i18n("<p>If this option is checked and K3b is not able to read a data sector from the " "source medium it will be replaced with zeros on the resulting copy.") ); m_comboCopyMode->setWhatsThis( "<p><b>" + i18n("Normal Copy") + "</b>" + i18n("<p>This is the normal copy mode for DVD, Blu-ray, and most CD media types. " "It allows copying Audio CDs, multi and single session Data Media, and " "Enhanced Audio CDs (an Audio CD containing an additional data session)." "<p>For Video CDs please use the CD Cloning mode.") + "<p><b>" + i18n("Clone Copy") + "</b>" + i18n("<p>In CD Cloning mode K3b performs a raw copy of the CD. That means it does " "not care about the content but simply copies the CD bit by bit. It may be used " "to copy Video CDs or CDs which contain erroneous sectors." "<p><b>Caution:</b> Only single session CDs can be cloned.") ); }