/**
* toTheTop function
* Changes shown content to the first in index
*/
void TwitterApp::toTheTop() {
    actionButtonArea->changeToNone();
    switch (currentstate)
    {
    case WALL:
        wallContentArea->tweetIndex = 0;
        updateCurrentPage();
        break;
    case CONNECT:
        connectPageArea->index = 0;
        updateCurrentPage();
        break;
    case DISCOVER:

        break;
    case PROFILE:
        profileContentArea->tweetIndex = 0;
        updateCurrentPage();
        break;
    case SEARCH:
        searchPageArea->index = 0;
        updateCurrentPage();
        break;
    default:
        break;
    }
}
Example #2
0
void ClipboardBrowser::connectModelAndDelegate()
{
    Q_ASSERT(&m != model());

    // set new model
    QAbstractItemModel *oldModel = model();
    setModel(&m);
    delete oldModel;

    // delegate for rendering and editing items
    setItemDelegate(&d);

    connect( &m, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
             SLOT(onDataChanged(QModelIndex,QModelIndex)) );
    connect( &m, SIGNAL(tabNameChanged(QString)),
             SLOT(onTabNameChanged(QString)) );
    connect( &m, SIGNAL(unloaded()),
             SLOT(onModelUnloaded()) );

    // update on change
    connect( &m, SIGNAL(rowsInserted(QModelIndex, int, int)),
             SLOT(onModelDataChanged()) );
    connect( &m, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
             SLOT(onModelDataChanged()) );
    connect( &m, SIGNAL(rowsInserted(QModelIndex, int, int)),
             SLOT(onItemCountChanged()) );
    connect( &m, SIGNAL(rowsRemoved(QModelIndex,int,int)),
             SLOT(onItemCountChanged()) );
    connect( &m, SIGNAL(rowsAboutToBeMoved(QModelIndex, int, int, QModelIndex, int)),
             SLOT(onModelDataChanged()) );
    connect( &m, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
             SLOT(onModelDataChanged()) );
    connect( &d, SIGNAL(rowSizeChanged()),
             SLOT(updateCurrentPage()) );

    connect( &m, SIGNAL(rowsInserted(QModelIndex, int, int)),
             &d, SLOT(rowsInserted(QModelIndex, int, int)) );
    connect( &m, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
             &d, SLOT(rowsRemoved(QModelIndex,int,int)) );
    connect( &m, SIGNAL(rowsAboutToBeMoved(QModelIndex, int, int, QModelIndex, int)),
             &d, SLOT(rowsMoved(QModelIndex, int, int, QModelIndex, int)) );
    connect( &m, SIGNAL(dataChanged(QModelIndex,QModelIndex)),
             &d, SLOT(dataChanged(QModelIndex,QModelIndex)) );

    updateCurrentPage();
}
Example #3
0
void ClipboardBrowser::unlock()
{
    Q_ASSERT(m_spinLock > 0);

    if (m_spinLock == 1) {
        setUpdatesEnabled(true);
        updateCurrentPage();

        m_scrollSaver->restore();
        if (m_spinLock == 1)
            m_scrollSaver.reset(NULL);
    }

    --m_spinLock;
}