mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 03:40:16 +02:00
Handle preferred download format in SettingsDialog.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
*
|
*
|
||||||
* Copyright 2010-2013, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
* Copyright 2010-2015, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||||
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
|
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
|
||||||
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
|
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
|
||||||
* Copyright 2012-2014, Teo Mrnjavac <teo@kde.org>
|
* Copyright 2012-2014, Teo Mrnjavac <teo@kde.org>
|
||||||
@@ -218,6 +218,19 @@ SettingsDialog::SettingsDialog(QObject *parent )
|
|||||||
m_downloadsWidgetUi->downloadsFolder->setText( TomahawkSettings::instance()->downloadsPath() );
|
m_downloadsWidgetUi->downloadsFolder->setText( TomahawkSettings::instance()->downloadsPath() );
|
||||||
connect( m_downloadsWidgetUi->pickFolderButton, SIGNAL( clicked() ), SLOT( pickDownloadsPath() ) );
|
connect( m_downloadsWidgetUi->pickFolderButton, SIGNAL( clicked() ), SLOT( pickDownloadsPath() ) );
|
||||||
|
|
||||||
|
m_downloadsFormats.insert( "MP3", tr( "MP3" ) );
|
||||||
|
m_downloadsFormats.insert( "FLAC", tr( "FLAC" ) );
|
||||||
|
m_downloadsFormats.insert( "M4A", tr( "M4A" ) );
|
||||||
|
m_downloadsFormats.insert( "MP4", tr( "MP4" ) );
|
||||||
|
foreach ( const QString& format, m_downloadsFormats.values() )
|
||||||
|
{
|
||||||
|
m_downloadsWidgetUi->preferredFormatComboBox->addItem( format );
|
||||||
|
}
|
||||||
|
int i = m_downloadsWidgetUi->preferredFormatComboBox->findText( m_downloadsFormats.value( TomahawkSettings::instance()->downloadsPreferredFormat() ) );
|
||||||
|
if ( i < 0 )
|
||||||
|
i = m_downloadsWidgetUi->preferredFormatComboBox->findText( "MP3" );
|
||||||
|
m_downloadsWidgetUi->preferredFormatComboBox->setCurrentIndex( i );
|
||||||
|
|
||||||
#ifndef Q_OS_MAC
|
#ifndef Q_OS_MAC
|
||||||
m_advancedWidget->setMinimumSize( m_advancedWidget->sizeHint() );
|
m_advancedWidget->setMinimumSize( m_advancedWidget->sizeHint() );
|
||||||
m_accountsWidget->setMinimumWidth( 500 );
|
m_accountsWidget->setMinimumWidth( 500 );
|
||||||
@@ -302,6 +315,7 @@ SettingsDialog::saveSettings()
|
|||||||
s->setScannerTime( m_collectionWidgetUi->scannerTimeSpinBox->value() );
|
s->setScannerTime( m_collectionWidgetUi->scannerTimeSpinBox->value() );
|
||||||
s->setEnableEchonestCatalogs( m_collectionWidgetUi->enableEchonestCatalog->isChecked() );
|
s->setEnableEchonestCatalogs( m_collectionWidgetUi->enableEchonestCatalog->isChecked() );
|
||||||
s->setDownloadsPath( m_downloadsWidgetUi->downloadsFolder->text() );
|
s->setDownloadsPath( m_downloadsWidgetUi->downloadsFolder->text() );
|
||||||
|
s->setDownloadsPreferredFormat( m_downloadsFormats.key( m_downloadsWidgetUi->preferredFormatComboBox->currentText() ) );
|
||||||
|
|
||||||
// s->setNowPlayingEnabled( ui->checkBoxEnableAdium->isChecked() );
|
// s->setNowPlayingEnabled( ui->checkBoxEnableAdium->isChecked() );
|
||||||
|
|
||||||
|
@@ -150,6 +150,7 @@ private:
|
|||||||
bool m_restartRequired;
|
bool m_restartRequired;
|
||||||
Tomahawk::Accounts::AccountModel* m_accountModel;
|
Tomahawk::Accounts::AccountModel* m_accountModel;
|
||||||
Tomahawk::Accounts::AccountModelFilterProxy* m_accountProxy;
|
Tomahawk::Accounts::AccountModelFilterProxy* m_accountProxy;
|
||||||
|
QHash<QString, QString> m_downloadsFormats;
|
||||||
AnimatedSpinner* m_sipSpinner;
|
AnimatedSpinner* m_sipSpinner;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -48,6 +48,20 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Preferred download format:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QComboBox" name="preferredFormatComboBox"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
Reference in New Issue
Block a user