Esempio n. 1
0
void ImageWindow::setupConnections()
{
    setupStandardConnections();

    connect(this, SIGNAL(loadCurrentLater()),
            this, SLOT(slotLoadCurrent()), Qt::QueuedConnection);

    // To toggle properly keyboards shortcuts from comments & tags side bar tab.

    connect(d->rightSideBar, SIGNAL(signalNextItem()),
            this, SLOT(slotForward()));

    connect(d->rightSideBar, SIGNAL(signalPrevItem()),
            this, SLOT(slotBackward()));

    connect(d->rightSideBar->getFiltersHistoryTab(), SIGNAL(actionTriggered(const ImageInfo&)),
            this, SLOT(openImage(const ImageInfo&)));

    connect(this, SIGNAL(signalSelectionChanged( const QRect&)),
            d->rightSideBar, SLOT(slotImageSelectionChanged( const QRect&)));

    connect(this, SIGNAL(signalNoCurrentItem()),
            d->rightSideBar, SLOT(slotNoCurrentItem()));

    ImageAttributesWatch* watch = ImageAttributesWatch::instance();

    connect(watch, SIGNAL(signalFileMetadataChanged(const KUrl&)),
            this, SLOT(slotFileMetadataChanged(const KUrl&)));

    /*connect(DatabaseAccess::databaseWatch(), SIGNAL(collectionImageChange(const CollectionImageChangeset&)),
            this, SLOT(slotCollectionImageChange(const CollectionImageChangeset&)),
            Qt::QueuedConnection);*/

    connect(ThemeEngine::instance(), SIGNAL(signalThemeChanged()),
            this, SLOT(slotThemeChanged()));

    /*connect(d->imageFilterModel, SIGNAL(rowsAboutToBeRemoved(const QModelIndex&, int, int)),
            this, SLOT(slotRowsAboutToBeRemoved(const QModelIndex&, int, int)));*/

    connect(d->thumbBar, SIGNAL(currentChanged(const ImageInfo&)),
            this, SLOT(slotThumbBarImageSelected(const ImageInfo&)));

    connect(d->dragDropHandler, SIGNAL(imageInfosDropped(const QList<ImageInfo>&)),
            this, SLOT(slotDroppedOnThumbbar(const QList<ImageInfo>&)));

    connect(d->thumbBarDock, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)),
            d->thumbBar, SLOT(slotDockLocationChanged(Qt::DockWidgetArea)));

    connect(AlbumSettings::instance(), SIGNAL(setupChanged()),
            this, SLOT(slotSetupChanged()));
}
Esempio n. 2
0
void MainWnd::keyPressEvent( QKeyEvent * event )
{
    switch(  event->key() )
    {
    case Qt::Key_W:
        slotForward();
        break;
    case Qt::Key_S:
        slotBackward();
        break;
    case Qt::Key_A:
        slotLeft();
        break;
    case Qt::Key_D:
        slotRight();
        break;
    }
}
Esempio n. 3
0
MainWnd::MainWnd( QWidget * parent )
: QMainWindow( parent )
{
    ui.setupUi( this );
    connect( this, SIGNAL(sigLog(const QString &)), this, SLOT(slotLog(const QString &)), Qt::QueuedConnection );
    connect( ui.console, SIGNAL(line_validate(const QString &)), this, SLOT(slotSend(const QString &)), Qt::QueuedConnection );

    QObject::connect( ui.clearLog,    SIGNAL(triggered()), this, SLOT(slotClearLog()) );
    QObject::connect( ui.dontSleep,   SIGNAL(triggered()), this, SLOT(slotDontSleep()) );

    QObject::connect( ui.showFullLog, SIGNAL(triggered()), this, SLOT(slotShowFullLog()) );
    QObject::connect( ui.queryStatus, SIGNAL(triggered()), this, SLOT(slotStatus()) );
    QObject::connect( ui.queryOsc,    SIGNAL(triggered()), this, SLOT(slotOsc()) );
    QObject::connect( ui.shutdown,    SIGNAL(triggered()), this, SLOT(slotShutdown()) );
    QObject::connect( ui.setupPipe,   SIGNAL(triggered()), this, SLOT(slotSetupPipe()) );

    QObject::connect( ui.lightBtn,    SIGNAL(clicked()),   this, SLOT(slotLight()) );
    QObject::connect( ui.motoEnBtn,   SIGNAL(clicked()),   this, SLOT(slotMotoEn()) );

    QObject::connect( ui.fwdBtn,      SIGNAL(pressed()),   this, SLOT(slotForward()) );
    QObject::connect( ui.bwdBtn,      SIGNAL(pressed()),   this, SLOT(slotBackward()) );
    QObject::connect( ui.leftBtn,     SIGNAL(pressed()),   this, SLOT(slotLeft()) );
    QObject::connect( ui.rightBtn,    SIGNAL(pressed()),   this, SLOT(slotRight()) );

    QObject::connect( ui.fwdBtn,      SIGNAL(released()),  this, SLOT(slotStop()) );
    QObject::connect( ui.bwdBtn,      SIGNAL(released()),  this, SLOT(slotStop()) );
    QObject::connect( ui.leftBtn,     SIGNAL(released()),  this, SLOT(slotStop()) );
    QObject::connect( ui.rightBtn,    SIGNAL(released()),  this, SLOT(slotStop()) );


    QObject::connect( ui.showFullLog, SIGNAL(triggered()), this, SLOT(slotShowFullLog()) );

    m_peer = new QXmppPeer( this );
    QObject::connect( m_peer, SIGNAL(connected()),      this, SLOT(slotConnected()) );
    QObject::connect( m_peer, SIGNAL(disconnected()),   this, SLOT(slotDisconnected()) );
    QObject::connect( m_peer, SIGNAL(textmsg(QString)), this, SLOT(qxmppMessageReceived(QString)) );

    m_video = new QXmppVideo( m_peer );
    // It also connects frameReady() signal to an appropriate slot.
    ui.view->setVideo( m_video );
    this->setCentralWidget( ui.view );

    QSettings ini( CONFIG_FILE, QSettings::IniFormat );
    ini.beginGroup( "main" );
    QString selfJid  = ini.value( "selfJid",    "client@xmpp" ).toString();
    QString destJid  = ini.value( "destJid",    "host@xmpp" ).toString();
    QString password = ini.value( "password",   "12345" ).toString();
    QString host     = ini.value( "host",       QString() ).toString();
    int     port     = ini.value( "port",       -1 ).toInt();
    bool    tls      = ini.value( "tls",        true ).toBool();
    bool updateDest  = ini.value( "updateDest", true ).toBool();

    m_peer->setTarget( destJid, updateDest );
    m_video->setTarget( destJid );
    m_peer->connect( selfJid, password, host, port, tls );
    m_jidDest = destJid;

    m_pipe = new QXmppMsgPipe( m_peer, 1 );
    m_pipe->setOutPipe( m_jidDest, 1234, 22, "localhost" );

    m_dontSleepTimer = new QTimer( this );
    m_dontSleepTimer->setInterval( 15000 );
    QObject::connect( m_dontSleepTimer, SIGNAL(timeout()), 
                      this,             SLOT(slotDontSleepTimeout()) );
}