mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-21 08:21:54 +02:00
* A few settings / default cleanups.
This commit is contained in:
parent
27f606b2e4
commit
35484b0357
@ -8,6 +8,8 @@
|
||||
#include <QDir>
|
||||
#include <QDebug>
|
||||
|
||||
#define VERSION 1
|
||||
|
||||
TomahawkSettings* TomahawkSettings::s_instance = 0;
|
||||
|
||||
|
||||
@ -23,21 +25,19 @@ TomahawkSettings::TomahawkSettings( QObject* parent )
|
||||
{
|
||||
s_instance = this;
|
||||
|
||||
#ifndef TOMAHAWK_HEADLESS
|
||||
if( !contains( "configversion") )
|
||||
{
|
||||
setValue( "configversion", SettingsDialog::VERSION );
|
||||
setValue( "configversion", VERSION );
|
||||
}
|
||||
else if( value( "configversion" ).toUInt() != SettingsDialog::VERSION )
|
||||
else if( value( "configversion" ).toUInt() != VERSION )
|
||||
{
|
||||
qDebug() << "Config version outdated, old:" << value( "configversion" ).toUInt()
|
||||
<< "new:" << SettingsDialog::VERSION
|
||||
<< "new:" << VERSION
|
||||
<< "Doing upgrade, if any...";
|
||||
|
||||
// insert upgrade code here as required
|
||||
setValue( "configversion", SettingsDialog::VERSION );
|
||||
setValue( "configversion", VERSION );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,8 +34,6 @@ class SettingsDialog : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static const unsigned int VERSION = 1; // config version
|
||||
|
||||
explicit SettingsDialog( QWidget *parent = 0 );
|
||||
~SettingsDialog();
|
||||
|
||||
|
@ -173,14 +173,17 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
||||
#endif
|
||||
|
||||
// Connect up shortcuts
|
||||
connect( m_shortcutHandler, SIGNAL( playPause() ), m_audioEngine, SLOT( playPause() ) );
|
||||
connect( m_shortcutHandler, SIGNAL( pause() ), m_audioEngine, SLOT( pause() ) );
|
||||
connect( m_shortcutHandler, SIGNAL( stop() ), m_audioEngine, SLOT( stop() ) );
|
||||
connect( m_shortcutHandler, SIGNAL( previous() ), m_audioEngine, SLOT( previous() ) );
|
||||
connect( m_shortcutHandler, SIGNAL( next() ), m_audioEngine, SLOT( next() ) );
|
||||
connect( m_shortcutHandler, SIGNAL( volumeUp() ), m_audioEngine, SLOT( raiseVolume() ) );
|
||||
connect( m_shortcutHandler, SIGNAL( volumeDown() ), m_audioEngine, SLOT( lowerVolume() ) );
|
||||
connect( m_shortcutHandler, SIGNAL( mute() ), m_audioEngine, SLOT( mute() ) );
|
||||
if ( m_shortcutHandler )
|
||||
{
|
||||
connect( m_shortcutHandler, SIGNAL( playPause() ), m_audioEngine, SLOT( playPause() ) );
|
||||
connect( m_shortcutHandler, SIGNAL( pause() ), m_audioEngine, SLOT( pause() ) );
|
||||
connect( m_shortcutHandler, SIGNAL( stop() ), m_audioEngine, SLOT( stop() ) );
|
||||
connect( m_shortcutHandler, SIGNAL( previous() ), m_audioEngine, SLOT( previous() ) );
|
||||
connect( m_shortcutHandler, SIGNAL( next() ), m_audioEngine, SLOT( next() ) );
|
||||
connect( m_shortcutHandler, SIGNAL( volumeUp() ), m_audioEngine, SLOT( raiseVolume() ) );
|
||||
connect( m_shortcutHandler, SIGNAL( volumeDown() ), m_audioEngine, SLOT( lowerVolume() ) );
|
||||
connect( m_shortcutHandler, SIGNAL( mute() ), m_audioEngine, SLOT( mute() ) );
|
||||
}
|
||||
|
||||
#ifndef NO_LIBLASTFM
|
||||
qDebug() << "Init Scrobbler.";
|
||||
@ -189,16 +192,16 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
||||
TomahawkUtils::setNam( new lastfm::NetworkAccessManager( this ) );
|
||||
|
||||
connect( m_audioEngine, SIGNAL( started( const Tomahawk::result_ptr& ) ),
|
||||
m_scrobbler, SLOT( trackStarted( const Tomahawk::result_ptr& ) ), Qt::QueuedConnection );
|
||||
m_scrobbler, SLOT( trackStarted( const Tomahawk::result_ptr& ) ), Qt::QueuedConnection );
|
||||
|
||||
connect( m_audioEngine, SIGNAL( paused() ),
|
||||
m_scrobbler, SLOT( trackPaused() ), Qt::QueuedConnection );
|
||||
m_scrobbler, SLOT( trackPaused() ), Qt::QueuedConnection );
|
||||
|
||||
connect( m_audioEngine, SIGNAL( resumed() ),
|
||||
m_scrobbler, SLOT( trackResumed() ), Qt::QueuedConnection );
|
||||
m_scrobbler, SLOT( trackResumed() ), Qt::QueuedConnection );
|
||||
|
||||
connect( m_audioEngine, SIGNAL( stopped() ),
|
||||
m_scrobbler, SLOT( trackStopped() ), Qt::QueuedConnection );
|
||||
m_scrobbler, SLOT( trackStopped() ), Qt::QueuedConnection );
|
||||
#else
|
||||
qDebug() << "Setting NAM.";
|
||||
TomahawkUtils::setNam( new QNetworkAccessManager );
|
||||
@ -206,7 +209,7 @@ TomahawkApp::TomahawkApp( int& argc, char *argv[] )
|
||||
|
||||
// Set up proxy
|
||||
if( TomahawkSettings::instance()->proxyType() != QNetworkProxy::NoProxy &&
|
||||
!TomahawkSettings::instance()->proxyHost().isEmpty() )
|
||||
!TomahawkSettings::instance()->proxyHost().isEmpty() )
|
||||
{
|
||||
qDebug() << "Setting proxy to saved values";
|
||||
TomahawkUtils::setProxy( new QNetworkProxy( static_cast<QNetworkProxy::ProxyType>(TomahawkSettings::instance()->proxyType()), TomahawkSettings::instance()->proxyHost(), TomahawkSettings::instance()->proxyPort(), TomahawkSettings::instance()->proxyUsername(), TomahawkSettings::instance()->proxyPassword() ) );
|
||||
|
@ -252,6 +252,7 @@ TomahawkWindow::rescanCollectionManually()
|
||||
ScanManager::instance()->runManualScan( path );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkWindow::addPeerManually()
|
||||
{
|
||||
@ -312,6 +313,7 @@ TomahawkWindow::loadSpiff()
|
||||
loader->load( url );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkWindow::createAutomaticPlaylist()
|
||||
{
|
||||
@ -329,6 +331,7 @@ TomahawkWindow::createAutomaticPlaylist()
|
||||
playlist->createNewRevision( uuid(), playlist->currentrevision(), playlist->type(), playlist->generator()->controls(), playlist->entries() );
|
||||
}
|
||||
|
||||
|
||||
void TomahawkWindow::createStation()
|
||||
{
|
||||
bool ok;
|
||||
@ -345,6 +348,7 @@ void TomahawkWindow::createStation()
|
||||
playlist->createNewRevision( uuid(), playlist->currentrevision(), playlist->type(), playlist->generator()->controls() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkWindow::createPlaylist()
|
||||
{
|
||||
@ -367,6 +371,7 @@ TomahawkWindow::createPlaylist()
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
TomahawkWindow::onPlaybackLoading( const Tomahawk::result_ptr& result )
|
||||
{
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>480</height>
|
||||
<width>1000</width>
|
||||
<height>660</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -34,7 +34,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<width>1000</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
Loading…
x
Reference in New Issue
Block a user