1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 03:10:12 +02:00

* Style fixes.

This commit is contained in:
Christian Muehlhaeuser
2013-09-03 22:30:30 +02:00
parent 1e545dcc6c
commit a5ff52ca91
2 changed files with 23 additions and 25 deletions

View File

@@ -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-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org> * Copyright 2010-2013, 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, Teo Mrnjavac <teo@kde.org> * Copyright 2012, Teo Mrnjavac <teo@kde.org>
@@ -88,9 +88,7 @@ SettingsDialog::SettingsDialog(QObject *parent )
m_advancedWidgetUi->setupUi( m_advancedWidget ); m_advancedWidgetUi->setupUi( m_advancedWidget );
m_accountsWidgetUi->accountsFilterCombo->setFocusPolicy( Qt::NoFocus ); m_accountsWidgetUi->accountsFilterCombo->setFocusPolicy( Qt::NoFocus );
m_dialog = new QToolbarTabDialog; m_dialog = new QToolbarTabDialog;
TomahawkSettings* s = TomahawkSettings::instance(); TomahawkSettings* s = TomahawkSettings::instance();
m_advancedWidgetUi->checkBoxReporter->setChecked( s->crashReporterEnabled() ); m_advancedWidgetUi->checkBoxReporter->setChecked( s->crashReporterEnabled() );
@@ -138,8 +136,8 @@ SettingsDialog::SettingsDialog(QObject *parent )
m_accountsWidgetUi->accountsView->setVerticalScrollMode( QAbstractItemView::ScrollPerPixel ); m_accountsWidgetUi->accountsView->setVerticalScrollMode( QAbstractItemView::ScrollPerPixel );
m_accountsWidgetUi->accountsView->setMouseTracking( true ); m_accountsWidgetUi->accountsView->setMouseTracking( true );
connect( accountDelegate, SIGNAL( openConfig( Tomahawk::Accounts::Account* ) ), this, SLOT( openAccountConfig( Tomahawk::Accounts::Account* ) ) ); connect( accountDelegate, SIGNAL( openConfig( Tomahawk::Accounts::Account* ) ), SLOT( openAccountConfig( Tomahawk::Accounts::Account* ) ) );
connect( accountDelegate, SIGNAL( openConfig( Tomahawk::Accounts::AccountFactory* ) ), this, SLOT( openAccountFactoryConfig( Tomahawk::Accounts::AccountFactory* ) ) ); connect( accountDelegate, SIGNAL( openConfig( Tomahawk::Accounts::AccountFactory* ) ), SLOT( openAccountFactoryConfig( Tomahawk::Accounts::AccountFactory* ) ) );
connect( accountDelegate, SIGNAL( update( QModelIndex ) ), m_accountsWidgetUi->accountsView, SLOT( update( QModelIndex ) ) ); connect( accountDelegate, SIGNAL( update( QModelIndex ) ), m_accountsWidgetUi->accountsView, SLOT( update( QModelIndex ) ) );
m_accountModel = new AccountModel( this ); m_accountModel = new AccountModel( this );
@@ -149,26 +147,26 @@ SettingsDialog::SettingsDialog(QObject *parent )
connect( m_accountProxy, SIGNAL( startInstalling( QPersistentModelIndex ) ), accountDelegate, SLOT( startInstalling(QPersistentModelIndex) ) ); connect( m_accountProxy, SIGNAL( startInstalling( QPersistentModelIndex ) ), accountDelegate, SLOT( startInstalling(QPersistentModelIndex) ) );
connect( m_accountProxy, SIGNAL( doneInstalling( QPersistentModelIndex ) ), accountDelegate, SLOT( doneInstalling(QPersistentModelIndex) ) ); connect( m_accountProxy, SIGNAL( doneInstalling( QPersistentModelIndex ) ), accountDelegate, SLOT( doneInstalling(QPersistentModelIndex) ) );
connect( m_accountProxy, SIGNAL( errorInstalling( QPersistentModelIndex ) ), accountDelegate, SLOT( errorInstalling(QPersistentModelIndex) ) ); connect( m_accountProxy, SIGNAL( errorInstalling( QPersistentModelIndex ) ), accountDelegate, SLOT( errorInstalling(QPersistentModelIndex) ) );
connect( m_accountProxy, SIGNAL( scrollTo( QModelIndex ) ), this, SLOT( scrollTo( QModelIndex ) ) ); connect( m_accountProxy, SIGNAL( scrollTo( QModelIndex ) ), SLOT( scrollTo( QModelIndex ) ) );
m_accountsWidgetUi->accountsView->setModel( m_accountProxy ); m_accountsWidgetUi->accountsView->setModel( m_accountProxy );
connect( m_accountsWidgetUi->installFromFileBtn, SIGNAL( clicked( bool ) ), this, SLOT( installFromFile() ) ); connect( m_accountsWidgetUi->installFromFileBtn, SIGNAL( clicked( bool ) ), SLOT( installFromFile() ) );
connect( m_accountModel, SIGNAL( createAccount( Tomahawk::Accounts::AccountFactory* ) ), this, SLOT( createAccountFromFactory( Tomahawk::Accounts::AccountFactory* ) ) ); connect( m_accountModel, SIGNAL( createAccount( Tomahawk::Accounts::AccountFactory* ) ), SLOT( createAccountFromFactory( Tomahawk::Accounts::AccountFactory* ) ) );
m_accountsWidgetUi->accountsFilterCombo->addItem( tr( "All" ), Accounts::NoType ); m_accountsWidgetUi->accountsFilterCombo->addItem( tr( "All" ), Accounts::NoType );
m_accountsWidgetUi->accountsFilterCombo->addItem( accountTypeToString( SipType ), SipType ); m_accountsWidgetUi->accountsFilterCombo->addItem( accountTypeToString( SipType ), SipType );
m_accountsWidgetUi->accountsFilterCombo->addItem( accountTypeToString( ResolverType ), ResolverType ); m_accountsWidgetUi->accountsFilterCombo->addItem( accountTypeToString( ResolverType ), ResolverType );
m_accountsWidgetUi->accountsFilterCombo->addItem( accountTypeToString( StatusPushType ), StatusPushType ); m_accountsWidgetUi->accountsFilterCombo->addItem( accountTypeToString( StatusPushType ), StatusPushType );
connect( m_accountsWidgetUi->accountsFilterCombo, SIGNAL( activated( int ) ), this, SLOT( accountsFilterChanged( int ) ) ); connect( m_accountsWidgetUi->accountsFilterCombo, SIGNAL( activated( int ) ), SLOT( accountsFilterChanged( int ) ) );
if ( !Servent::instance()->isReady() ) if ( !Servent::instance()->isReady() )
{ {
m_sipSpinner = new AnimatedSpinner( m_accountsWidgetUi->accountsView ); m_sipSpinner = new AnimatedSpinner( m_accountsWidgetUi->accountsView );
m_sipSpinner->fadeIn(); m_sipSpinner->fadeIn();
connect( Servent::instance(), SIGNAL( ready() ), this, SLOT( serventReady() ) ); connect( Servent::instance(), SIGNAL( ready() ), SLOT( serventReady() ) );
} }
// ADVANCED // ADVANCED
@@ -244,16 +242,16 @@ SettingsDialog::SettingsDialog(QObject *parent )
m_dialog->setCurrentIndex( 0 ); m_dialog->setCurrentIndex( 0 );
connect( m_advancedWidgetUi->proxyButton, SIGNAL( clicked() ), SLOT( showProxySettings() ) ); connect( m_advancedWidgetUi->proxyButton, SIGNAL( clicked() ), SLOT( showProxySettings() ) );
connect( m_advancedWidgetUi->lanOnlyRadioButton, SIGNAL( toggled(bool) ), SLOT( requiresRestart() ) ); connect( m_advancedWidgetUi->lanOnlyRadioButton, SIGNAL( toggled( bool ) ), SLOT( requiresRestart() ) );
connect( m_advancedWidgetUi->staticIpRadioButton, SIGNAL( toggled(bool) ), SLOT( requiresRestart() ) ); connect( m_advancedWidgetUi->staticIpRadioButton, SIGNAL( toggled( bool ) ), SLOT( requiresRestart() ) );
connect( m_advancedWidgetUi->upnpRadioButton, SIGNAL( toggled(bool) ), SLOT( requiresRestart() ) ); connect( m_advancedWidgetUi->upnpRadioButton, SIGNAL( toggled( bool ) ), SLOT( requiresRestart() ) );
connect( m_advancedWidgetUi->lanOnlyRadioButton, SIGNAL( toggled(bool) ), SLOT( toggleRemoteMode() ) ); connect( m_advancedWidgetUi->lanOnlyRadioButton, SIGNAL( toggled( bool ) ), SLOT( toggleRemoteMode() ) );
connect( m_advancedWidgetUi->staticIpRadioButton, SIGNAL( toggled(bool) ), SLOT( toggleRemoteMode() ) ); connect( m_advancedWidgetUi->staticIpRadioButton, SIGNAL( toggled( bool ) ), SLOT( toggleRemoteMode() ) );
connect( m_advancedWidgetUi->upnpRadioButton, SIGNAL( toggled(bool) ), SLOT( toggleRemoteMode() ) ); connect( m_advancedWidgetUi->upnpRadioButton, SIGNAL( toggled( bool ) ), SLOT( toggleRemoteMode() ) );
connect( m_advancedWidgetUi->autoDetectIpCheckBox, SIGNAL( toggled( bool ) ), SLOT( toggleAutoDetectIp( bool ) ) ); connect( m_advancedWidgetUi->autoDetectIpCheckBox, SIGNAL( toggled( bool ) ), SLOT( toggleAutoDetectIp( bool ) ) );
connect( m_advancedWidgetUi->enableProxyCheckBox, SIGNAL( toggled(bool) ), SLOT( toggleProxyEnabled() ) ); connect( m_advancedWidgetUi->enableProxyCheckBox, SIGNAL( toggled( bool ) ), SLOT( toggleProxyEnabled() ) );
connect( m_advancedWidgetUi->enableProxyCheckBox, SIGNAL( toggled(bool) ), SLOT( requiresRestart() ) ); connect( m_advancedWidgetUi->enableProxyCheckBox, SIGNAL( toggled( bool ) ), SLOT( requiresRestart() ) );
connect( m_dialog, SIGNAL( accepted() ), SLOT( saveSettings() ) ); connect( m_dialog, SIGNAL( accepted() ), SLOT( saveSettings() ) );
connect( m_dialog, SIGNAL( rejected() ), SLOT( onRejected() ) ); connect( m_dialog, SIGNAL( rejected() ), SLOT( onRejected() ) );
@@ -329,6 +327,7 @@ SettingsDialog::show()
m_dialog->show(); m_dialog->show();
} }
void void
SettingsDialog::serventReady() SettingsDialog::serventReady()
{ {
@@ -349,10 +348,12 @@ SettingsDialog::changeEvent( QEvent *e )
switch ( e->type() ) switch ( e->type() )
{ {
case QEvent::LanguageChange: case QEvent::LanguageChange:
{
m_accountsWidgetUi->retranslateUi( m_accountsWidget ); m_accountsWidgetUi->retranslateUi( m_accountsWidget );
m_collectionWidgetUi->retranslateUi( m_collectionWidget ); m_collectionWidgetUi->retranslateUi( m_collectionWidget );
m_advancedWidgetUi->retranslateUi( m_advancedWidget ); m_advancedWidgetUi->retranslateUi( m_advancedWidget );
break; break;
}
default: default:
break; break;
@@ -562,13 +563,12 @@ SettingsDialog::requiresRestart()
ProxyDialog::ProxyDialog( QWidget *parent ) ProxyDialog::ProxyDialog( QWidget *parent )
: QDialog( parent ) : QDialog( parent )
, ui( new Ui::ProxyDialog ) , ui( new Ui::ProxyDialog )
{ {
ui->setupUi( this ); ui->setupUi( this );
// ugly, I know, but... // ugly, I know, but...
TomahawkSettings* s = TomahawkSettings::instance(); TomahawkSettings* s = TomahawkSettings::instance();
ui->hostLineEdit->setText( s->proxyHost() ); ui->hostLineEdit->setText( s->proxyHost() );

View File

@@ -77,6 +77,7 @@ public:
~SettingsDialog(); ~SettingsDialog();
void show(); void show();
protected: protected:
void changeEvent( QEvent* e ); void changeEvent( QEvent* e );
@@ -98,11 +99,8 @@ private slots:
void scrollTo( const QModelIndex& ); void scrollTo( const QModelIndex& );
void updateScanOptionsView(); void updateScanOptionsView();
void serventReady(); void serventReady();
void aclEntryClearButtonClicked(); void aclEntryClearButtonClicked();
void requiresRestart(); void requiresRestart();
private slots: private slots: