MainController::MainController(): m_mw(new MainWindow), m_search(m_mw) { connect(m_mw, SIGNAL(s_save(QString)), this, SLOT(save(QString))); connect(m_mw, SIGNAL(s_load(QString)), this, SLOT(load(QString))); connect(m_mw, SIGNAL(s_newBase()), this, SLOT(newBase())); connect(m_mw, SIGNAL(s_addCategory(QString)), this, SLOT(newCategory(QString))); connect(m_mw, SIGNAL(s_removeCategory(QString)), this, SLOT(removeCategory(QString))); connect(m_mw, SIGNAL(s_seeCategory()), this, SLOT(editCategory())); connect(m_mw, SIGNAL(s_showCategory()), this, SLOT(showCategory())); connect(m_mw, SIGNAL(s_addMedia(QString)), this, SLOT(newMedia(QString))); connect(m_mw, SIGNAL(s_removeMedia(QString,QString)), this, SLOT(removeMedia(QString,QString))); connect(m_mw, SIGNAL(s_seeMedia()), this, SLOT(editMedia())); connect(m_mw, SIGNAL(s_showUser()), this, SLOT(setUser())); connect(m_mw, SIGNAL(s_search()), this, SLOT(search())); connect(&m_search, SIGNAL(s_find(QList<MediaSPointer>)), this, SLOT(showSearch(QList<MediaSPointer>))); connect(m_mw, SIGNAL(s_settings()), this, SLOT(settings())); m_mw->setShortcut(SettingsController::settings()); SettingsController artemis; artemis.newSettings(SettingsController::settings()); if(UserController::userCount() == 0) UserController().exec(); else UserController::connectUser(); }
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(); }