OrganizeCollectionDialog::OrganizeCollectionDialog( const Meta::TrackList &tracks, const QStringList &folders, const QString &targetExtension, QWidget *parent, const char *name, bool modal, const QString &caption, QFlags<KDialog::ButtonCode> buttonMask ) : KDialog( parent ) , ui( new Ui::OrganizeCollectionDialogBase ) , m_detailed( true ) , m_schemeModified( false ) , m_conflict( false ) { Q_UNUSED( name ) setCaption( caption ); setModal( modal ); setButtons( buttonMask ); showButtonSeparator( true ); m_targetFileExtension = targetExtension; if( tracks.size() > 0 ) m_allTracks = tracks; KVBox *mainVBox = new KVBox( this ); setMainWidget( mainVBox ); QWidget *mainContainer = new QWidget( mainVBox ); ui->setupUi( mainContainer ); m_trackOrganizer = new TrackOrganizer( m_allTracks, this ); m_organizeCollectionWidget = new OrganizeCollectionWidget( mainContainer ); connect( this, SIGNAL(accepted()), m_organizeCollectionWidget, SLOT(onAccept()) ); ui->verticalLayout->insertWidget( 1, m_organizeCollectionWidget ); ui->folderCombo->insertItems( 0, folders ); if( ui->folderCombo->contains( AmarokConfig::organizeDirectory() ) ) ui->folderCombo->setCurrentItem( AmarokConfig::organizeDirectory() ); else ui->folderCombo->setCurrentIndex( 0 ); //TODO possible bug: assumes folder list is not empty. ui->overwriteCheck->setChecked( AmarokConfig::overwriteFiles() ); m_optionsWidget = new OrganizeCollectionOptionWidget(); ui->verticalLayout->insertWidget( 2, m_optionsWidget ); m_optionsWidget->setReplaceSpaces( AmarokConfig::replaceSpace() ); m_optionsWidget->setPostfixThe( AmarokConfig::ignoreThe() ); m_optionsWidget->setVfatCompatible( AmarokConfig::vfatCompatible() ); m_optionsWidget->setAsciiOnly( AmarokConfig::asciiOnly() ); m_optionsWidget->setRegexpText( AmarokConfig::replacementRegexp() ); m_optionsWidget->setReplaceText( AmarokConfig::replacementString() ); // save some space if the screensize is too small (BR: 283361) const QRect screenRect = QApplication::desktop()->screenGeometry(); if( screenRect.height() < 800 ) ui->previewTableWidget->hide(); ui->previewTableWidget->horizontalHeader()->setResizeMode( QHeaderView::ResizeToContents ); ui->conflictLabel->setText(""); QPalette p = ui->conflictLabel->palette(); KColorScheme::adjustForeground( p, KColorScheme::NegativeText ); // TODO this isn't working, the color is still normal ui->conflictLabel->setPalette( p ); // to show the conflict error connect( ui->overwriteCheck, SIGNAL(stateChanged(int)), SLOT(slotUpdatePreview()) ); connect( ui->folderCombo, SIGNAL(currentIndexChanged(QString)), SLOT(slotUpdatePreview()) ); connect( m_organizeCollectionWidget, SIGNAL(schemeChanged()), SLOT(slotUpdatePreview()) ); connect( m_optionsWidget, SIGNAL(optionsChanged()), SLOT(slotUpdatePreview())); connect( this, SIGNAL(finished(int)), m_organizeCollectionWidget, SLOT(slotSaveFormatList()) ); connect( this, SIGNAL(accepted()), SLOT(slotDialogAccepted()) ); connect( ui->folderCombo, SIGNAL(currentIndexChanged(QString)), SLOT(slotEnableOk(QString)) ); slotEnableOk( ui->folderCombo->currentText() ); init(); }
SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString& inputMRL ) : QVLCDialog( parent, _p_intf ) { setWindowTitle( qtr( "Stream Output" ) ); setWindowRole( "vlc-stream-output" ); /* UI stuff */ ui.setupUi( this ); ui.inputBox->setMRL( inputMRL ); ui.helpEdit->setPlainText( qtr("This dialog will allow you to stream or " "convert your media for use locally, on your private network, " "or on the Internet.\n" "You should start by checking that source matches what you want " "your input to be and then press the \"Next\" " "button to continue.\n") ); ui.mrlEdit->setToolTip ( qtr( "Stream output string.\n" "This is automatically generated " "when you change the above settings,\n" "but you can change it manually." ) ) ; #if 0 /* This needs Qt4.5 to be cool */ ui.destTab->setTabsClosable( true ); #else closeTabButton = new QToolButton( this ); ui.destTab->setCornerWidget( closeTabButton ); closeTabButton->hide(); closeTabButton->setAutoRaise( true ); closeTabButton->setIcon( QIcon( ":/toolbar/clear" ) ); closeTabButton->setToolTip( qtr("Clear") ); BUTTONACT( closeTabButton, closeTab() ); #endif CONNECT( ui.destTab, currentChanged( int ), this, tabChanged( int ) ); ui.destTab->setTabIcon( 0, QIcon( ":/buttons/playlist/playlist_add" ) ); ui.destBox->addItem( qtr( "File" ) ); ui.destBox->addItem( "HTTP" ); ui.destBox->addItem( "MS-WMSP (MMSH)" ); ui.destBox->addItem( "RTSP" ); ui.destBox->addItem( "RTP / MPEG Transport Stream" ); ui.destBox->addItem( "RTP Audio/Video Profile" ); ui.destBox->addItem( "UDP (legacy)" ); ui.destBox->addItem( "IceCast" ); BUTTONACT( ui.addButton, addDest() ); // /* Connect everything to the updateMRL function */ #define CB( x ) CONNECT( ui.x, toggled( bool ), this, updateMRL() ); #define CT( x ) CONNECT( ui.x, textChanged( const QString& ), this, updateMRL() ); #define CS( x ) CONNECT( ui.x, valueChanged( int ), this, updateMRL() ); #define CC( x ) CONNECT( ui.x, currentIndexChanged( int ), this, updateMRL() ); /* Misc */ CB( soutAll ); CS( ttl ); CT( sapName ); CT( sapGroup ); CB( localOutput ); CB( transcodeBox ); CONNECT( ui.profileSelect, optionsChanged(), this, updateMRL() ); okButton = new QPushButton( qtr( "&Stream" ) ); QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ) ); okButton->setDefault( true ); ui.acceptButtonBox->addButton( okButton, QDialogButtonBox::AcceptRole ); ui.acceptButtonBox->addButton( cancelButton, QDialogButtonBox::RejectRole ); BUTTONACT( okButton, ok() ); BUTTONACT( cancelButton, cancel() ); BUTTONACT( ui.nextButton, next() ); BUTTONACT( ui.nextButton2, next() ); BUTTONACT( ui.prevButton, prev() ); BUTTONACT( ui.prevButton2, prev() ); #undef CC #undef CS #undef CT #undef CB }
void SynthSettings::setOptions(const QStringList &options) { m_options = options; emit optionsChanged(); }
/*! \brief Clear all the \l CoordinateConversionOptions from the list of options. */ void CoordinateConversionController::clearOptions() { m_options.clear(); emit optionsChanged(); }
void PrefGeneral::optionsChangedSlot() { emit optionsChanged(); }
void OptionsSimple::somethingChanged() { emit optionsChanged(); }
void OptionsForm::maxVoicesChanged(int /*iMaxVoices*/) { bMaxVoicesModified = true; optionsChanged(); }
void OptionsForm::maxStreamsChanged(int /*iMaxStreams*/) { bMaxStreamsModified = true; optionsChanged(); }
void ImageTab::selectionChanged() { _autoThreshold->setEnabled(_matrix->selectedMatrix() && !realTimeAutoThreshold()); _smartThreshold->setEnabled(_matrix->selectedMatrix() && !realTimeAutoThreshold()); emit optionsChanged(); }
tagTab::tagTab(int id, QMap<QString,Site*> *sites, QList<Favorite> favorites, mainWindow *parent) : searchTab(id, sites, parent), ui(new Ui::tagTab), m_id(id), m_parent(parent), m_favorites(favorites), m_pagemax(-1), m_lastTags(QString()), m_sized(false), m_from_history(false), m_stop(true), m_history_cursor(0), m_history(QList<QMap<QString,QString> >()), m_modifiers(QStringList()) { ui->setupUi(this); ui->widgetMeant->hide(); setAttribute(Qt::WA_DeleteOnClose); QSettings settings(savePath("settings.ini"), QSettings::IniFormat, this); m_ignored = loadIgnored(); // Search fields QStringList favs; for (Favorite fav : m_favorites) favs.append(fav.getName()); m_search = new TextEdit(favs, this); m_postFiltering = new TextEdit(favs, this); m_search->setContextMenuPolicy(Qt::CustomContextMenu); m_postFiltering->setContextMenuPolicy(Qt::CustomContextMenu); if (settings.value("autocompletion", true).toBool()) { QFile words("words.txt"); if (words.open(QIODevice::ReadOnly | QIODevice::Text)) { while (!words.atEnd()) m_completion.append(QString(words.readLine()).trimmed().split(" ", QString::SkipEmptyParts)); words.close(); } QFile wordsc(savePath("wordsc.txt")); if (wordsc.open(QIODevice::ReadOnly | QIODevice::Text)) { while (!wordsc.atEnd()) m_completion.append(QString(wordsc.readLine()).trimmed().split(" ", QString::SkipEmptyParts)); wordsc.close(); } for (int i = 0; i < sites->size(); i++) if (sites->value(sites->keys().at(i))->contains("Modifiers")) m_modifiers.append(sites->value(sites->keys().at(i))->value("Modifiers").trimmed().split(" ", QString::SkipEmptyParts)); m_completion.append(m_modifiers); m_completion.append(favs); m_completion.removeDuplicates(); m_completion.sort(); QCompleter *completer = new QCompleter(m_completion, this); completer->setCaseSensitivity(Qt::CaseInsensitive); m_search->setCompleter(completer); m_postFiltering->setCompleter(completer); } connect(m_search, SIGNAL(returnPressed()), this, SLOT(load())); connect(m_search, SIGNAL(favoritesChanged()), _mainwindow, SLOT(updateFavorites())); connect(m_search, SIGNAL(favoritesChanged()), _mainwindow, SLOT(updateFavoritesDock())); connect(m_search, SIGNAL(kflChanged()), _mainwindow, SLOT(updateKeepForLater())); connect(m_postFiltering, SIGNAL(returnPressed()), this, SLOT(load())); connect(ui->labelMeant, SIGNAL(linkActivated(QString)), this, SLOT(setTags(QString))); ui->layoutFields->insertWidget(1, m_search, 1); ui->layoutPlus->addWidget(m_postFiltering, 1, 1, 1, 3); // Sources QString sel = '1'+QString().fill('0',m_sites->count()-1); QString sav = settings.value("sites", sel).toString(); for (int i = 0; i < sel.count(); i++) { if (sav.count() <= i) { sav[i] = '0'; } m_selectedSources.append(sav.at(i) == '1' ? true : false); } // Others ui->checkMergeResults->setChecked(settings.value("mergeresults", false).toBool()); optionsChanged(); ui->widgetPlus->hide(); setWindowIcon(QIcon()); updateCheckboxes(); m_search->setFocus(); }
OptionsDetailed::OptionsDetailed( Config* _config, QWidget* parent ) : QWidget( parent ), config( _config ) { const int fontHeight = QFontMetrics(QApplication::font()).boundingRect("M").size().height(); int gridRow = 0; grid = new QGridLayout( this ); QHBoxLayout *topBox = new QHBoxLayout(); grid->addLayout( topBox, 0, 0 ); QLabel *lFormat = new QLabel( i18n("Format:"), this ); topBox->addWidget( lFormat ); cFormat = new KComboBox( this ); topBox->addWidget( cFormat ); cFormat->addItems( config->pluginLoader()->formatList(PluginLoader::Encode,PluginLoader::CompressionType(PluginLoader::InferiorQuality|PluginLoader::Lossy|PluginLoader::Lossless|PluginLoader::Hybrid)) ); connect( cFormat, SIGNAL(activated(const QString&)), this, SLOT(formatChanged(const QString&)) ); // connect( cFormat, SIGNAL(activated(const QString&)), this, SLOT(somethingChanged()) ); topBox->addStretch(); lPlugin = new QLabel( i18n("Use Plugin:"), this ); topBox->addWidget( lPlugin ); cPlugin = new KComboBox( this ); topBox->addWidget( cPlugin ); cPlugin->setSizeAdjustPolicy( QComboBox::AdjustToContents ); connect( cPlugin, SIGNAL(activated(const QString&)), this, SLOT(encoderChanged(const QString&)) ); connect( cPlugin, SIGNAL(activated(const QString&)), this, SLOT(somethingChanged()) ); pConfigurePlugin = new KPushButton( KIcon("configure"), "", this ); pConfigurePlugin->setFixedSize( cPlugin->sizeHint().height(), cPlugin->sizeHint().height() ); pConfigurePlugin->setFlat( true ); topBox->addWidget( pConfigurePlugin ); topBox->setStretchFactor( pConfigurePlugin, 1 ); connect( pConfigurePlugin, SIGNAL(clicked()), this, SLOT(configurePlugin()) ); // draw a horizontal line QFrame *lineFrame = new QFrame( this ); lineFrame->setFrameShape( QFrame::HLine ); lineFrame->setFrameShadow( QFrame::Sunken ); lineFrame->setFixedHeight( fontHeight ); grid->addWidget( lineFrame, 1, 0 ); // prepare the plugin widget wPlugin = 0; grid->setRowStretch( 2, 1 ); grid->setRowMinimumHeight( 2, 20 ); gridRow = 3; // draw a horizontal line lineFrame = new QFrame( this ); lineFrame->setFrameShape( QFrame::HLine ); lineFrame->setFrameShadow( QFrame::Sunken ); lineFrame->setFixedHeight( fontHeight ); grid->addWidget( lineFrame, gridRow++, 0 ); int filterCount = 0; foreach( const QString& pluginName, config->data.backends.enabledFilters ) { FilterPlugin *plugin = qobject_cast<FilterPlugin*>(config->pluginLoader()->backendPluginByName(pluginName)); if( !plugin ) continue; FilterWidget *widget = plugin->newFilterWidget(); if( !widget ) continue; wFilter.insert( widget, plugin ); connect( widget, SIGNAL(optionsChanged()), this, SLOT(somethingChanged()) ); grid->addWidget( widget, gridRow++, 0 ); widget->show(); filterCount++; } if( filterCount > 0 ) { // draw a horizontal line lineFrame = new QFrame( this ); lineFrame->setFrameShape( QFrame::HLine ); lineFrame->setFrameShadow( QFrame::Sunken ); lineFrame->setFixedHeight( fontHeight ); grid->addWidget( lineFrame, gridRow++, 0 ); } // the output directory QHBoxLayout *middleBox = new QHBoxLayout( ); grid->addLayout( middleBox, gridRow++, 0 ); QLabel *lOutput = new QLabel( i18n("Destination:"), this ); middleBox->addWidget( lOutput ); outputDirectory = new OutputDirectory( config, this ); middleBox->addWidget( outputDirectory ); QHBoxLayout *bottomBox = new QHBoxLayout(); grid->addLayout( bottomBox, gridRow++, 0 ); cReplayGain = new QCheckBox( i18n("Calculate Replay Gain tags"), this ); bottomBox->addWidget( cReplayGain ); //connect( cReplayGain, SIGNAL(toggled(bool)), this, SLOT(somethingChanged()) ); bottomBox->addStretch(); lEstimSize = new QLabel( QString(QChar(8776))+"? B / min." ); lEstimSize->hide(); // hide for now because most plugins report inaccurate data bottomBox->addWidget( lEstimSize ); pProfileSave = new KPushButton( KIcon("document-save"), "", this ); bottomBox->addWidget( pProfileSave ); pProfileSave->setFixedWidth( pProfileSave->height() ); pProfileSave->setToolTip( i18n("Save current options as a profile") ); connect( pProfileSave, SIGNAL(clicked()), this, SLOT(saveCustomProfile()) ); pProfileLoad = new QToolButton( this ); bottomBox->addWidget( pProfileLoad ); pProfileLoad->setIcon( KIcon("document-open") ); pProfileLoad->setPopupMode( QToolButton::InstantPopup ); pProfileLoad->setFixedWidth( pProfileLoad->height() ); pProfileLoad->setToolTip( i18n("Load saved profiles") ); }
void EventMonitorTab::selectionChanged() { emit optionsChanged(); }
void MainWindow::toggleFilteredLineNumbersVisibility( bool isVisible ) { Configuration& config = Persistent<Configuration>( "settings" ); config.setFilteredLineNumbersVisible( isVisible ); emit optionsChanged(); }
void MainWindow::toggleOverviewVisibility( bool isVisible ) { Configuration& config = Persistent<Configuration>( "settings" ); config.setOverviewVisible( isVisible ); emit optionsChanged(); }
// Opens the 'Options' modal dialog box void MainWindow::options() { OptionsDialog dialog(this); connect(&dialog, SIGNAL( optionsChanged() ), crawlerWidget, SLOT( applyConfiguration() )); dialog.exec(); }