int QDeclarativeViewer::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QMainWindow::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: setDesignModeBehavior((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 1: sceneResized((*reinterpret_cast< QSize(*)>(_a[1]))); break;
        case 2: { bool _r = open((*reinterpret_cast< const QString(*)>(_a[1])));
            if (_a[0]) *reinterpret_cast< bool*>(_a[0]) = _r; }  break;
        case 3: openFile(); break;
        case 4: openUrl(); break;
        case 5: reload(); break;
        case 6: takeSnapShot(); break;
        case 7: toggleRecording(); break;
        case 8: toggleRecordingWithSelection(); break;
        case 9: ffmpegFinished((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 10: showProxySettings(); break;
        case 11: proxySettingsChanged(); break;
        case 12: rotateOrientation(); break;
        case 13: statusChanged(); break;
        case 14: pauseAnimations(); break;
        case 15: stepAnimations(); break;
        case 16: setAnimationStep(); break;
        case 17: changeAnimationSpeed(); break;
        case 18: launch((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 19: appAboutToQuit(); break;
        case 20: autoStartRecording(); break;
        case 21: autoStopRecording(); break;
        case 22: recordFrame(); break;
        case 23: chooseRecordingOptions(); break;
        case 24: pickRecordingFile(); break;
        case 25: toggleFullScreen(); break;
        case 26: changeOrientation((*reinterpret_cast< QAction*(*)>(_a[1]))); break;
        case 27: orientationChanged(); break;
        case 28: animationSpeedChanged((*reinterpret_cast< qreal(*)>(_a[1]))); break;
        case 29: showWarnings((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 30: warningsWidgetOpened(); break;
        case 31: warningsWidgetClosed(); break;
        default: ;
        }
        _id -= 32;
    }
    return _id;
}
Esempio n. 2
0
SettingsDialog::SettingsDialog( QWidget *parent )
    : QDialog( parent )
    , ui( new Ui_StackedSettingsDialog )
    , m_proxySettings( this )
    , m_rejected( false )
    , m_sipModel( 0 )
    , m_resolversModel( 0 )
{
    ui->setupUi( this );
    TomahawkSettings* s = TomahawkSettings::instance();

    ui->checkBoxHttp->setChecked( s->httpEnabled() );
    ui->checkBoxStaticPreferred->setChecked( s->preferStaticHostPort() );
    ui->checkBoxUpnp->setChecked( s->externalAddressMode() == TomahawkSettings::Upnp );
    ui->checkBoxUpnp->setEnabled( !s->preferStaticHostPort() );

    createIcons();
#ifdef Q_WS_X11
    ui->listWidget->setFrameShape( QFrame::StyledPanel );
    ui->listWidget->setFrameShadow( QFrame::Sunken );
    setContentsMargins( 4, 4, 4, 4 );
#else
    ui->verticalLayout->removeItem( ui->verticalSpacer_3 );
#endif

#ifdef Q_WS_MAC
    // Avoid resize handles on sheets on osx
    m_proxySettings.setSizeGripEnabled( true );
    QSizeGrip* p = m_proxySettings.findChild< QSizeGrip* >();
    p->setFixedSize( 0, 0 );
#endif

    // SIP PLUGINS
    SipConfigDelegate* sipdel = new SipConfigDelegate( this );
    ui->accountsView->setItemDelegate( sipdel );
    ui->accountsView->setContextMenuPolicy( Qt::CustomContextMenu );

    connect( ui->accountsView, SIGNAL( clicked( QModelIndex ) ), this, SLOT( sipItemClicked( QModelIndex ) ) );
    connect( sipdel, SIGNAL( openConfig( SipPlugin* ) ), this, SLOT( openSipConfig( SipPlugin* ) ) );
    connect( ui->accountsView, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( sipContextMenuRequest( QPoint ) ) );
    m_sipModel = new SipModel( this );
    ui->accountsView->setModel( m_sipModel );

    setupSipButtons();

    ui->staticHostName->setText( s->externalHostname() );
    ui->staticPort->setValue( s->externalPort() );

    ui->proxyButton->setVisible( true );

    // MUSIC SCANNER
    //FIXME: MULTIPLECOLLECTIONDIRS
    if ( s->scannerPaths().count() )
        ui->lineEditMusicPath_2->setText( s->scannerPaths().first() );
    else
    {
        ui->lineEditMusicPath_2->setText( QDesktopServices::storageLocation( QDesktopServices::MusicLocation ) );
    }

    // WATCH CHANGES
    // FIXME: QFileSystemWatcher is broken (as we know) and deprecated. Find another way.
    ui->checkBoxWatchForChanges->setChecked( s->watchForChanges() );
    ui->checkBoxWatchForChanges->setVisible( false );

    // LAST FM
    ui->checkBoxEnableLastfm->setChecked( s->scrobblingEnabled() );
    ui->lineEditLastfmUsername->setText( s->lastFmUsername() );
    ui->lineEditLastfmPassword->setText(s->lastFmPassword() );
    connect( ui->pushButtonTestLastfmLogin, SIGNAL( clicked( bool) ), this, SLOT( testLastFmLogin() ) );

    // SCRIPT RESOLVER
    ui->removeScript->setEnabled( false );
    ResolverConfigDelegate* del = new ResolverConfigDelegate( this );
    connect( del, SIGNAL( openConfig( QString ) ), this, SLOT( openResolverConfig( QString ) ) );
    ui->scriptList->setItemDelegate( del );
    m_resolversModel = new ResolversModel( s->allScriptResolvers(), s->enabledScriptResolvers(), this );
    ui->scriptList->setModel( m_resolversModel );

    connect( ui->scriptList->selectionModel(), SIGNAL( selectionChanged( QItemSelection,QItemSelection ) ), this, SLOT( scriptSelectionChanged() ) );
    connect( ui->addScript, SIGNAL( clicked( bool ) ), this, SLOT( addScriptResolver() ) );
    connect( ui->removeScript, SIGNAL( clicked( bool ) ), this, SLOT( removeScriptResolver() ) );

    connect( ui->buttonBrowse_2, SIGNAL( clicked() ),  SLOT( showPathSelector() ) );
    connect( ui->proxyButton,  SIGNAL( clicked() ),  SLOT( showProxySettings() ) );
    connect( ui->checkBoxStaticPreferred, SIGNAL( toggled(bool) ), SLOT( toggleUpnp(bool) ) );
    connect( this,             SIGNAL( rejected() ), SLOT( onRejected() ) );

    ui->listWidget->setCurrentRow( 0 );
}