Пример #1
0
void StatusWidget::createMenu()
{
    menu = new QMenu( this );
    signalMapper = new QSignalMapper( this );

    replyAction = new QAction( this );
    replyAction->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_R ) );
    menu->addAction( replyAction );
    connect( replyAction, SIGNAL(triggered()), this, SLOT(slotReply()) );
    connect( this, SIGNAL(reply(QString,quint64)), StatusModel::instance(), SIGNAL(reply(QString,quint64)) );

    retweetAction = new QAction( tr( "Retweet" ), this );
    retweetAction->setShortcut( QKeySequence( Qt::CTRL + Qt::Key_T ) );
    menu->addAction( retweetAction );
    connect( retweetAction, SIGNAL(triggered()), this, SLOT(slotRetweet()) );
    connect( this, SIGNAL(retweet(QString)), StatusModel::instance(), SIGNAL(retweet(QString)) );

    dmAction = new QAction( this );
    dmAction->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_D ) );
    menu->addAction( dmAction );
    connect( dmAction, SIGNAL(triggered()), this, SLOT(slotDM()) );

    menu->addSeparator();

    favoriteAction = new QAction( tr( "Add to Favorites" ), this );
    favoriteAction->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_F ) );
    menu->addAction( favoriteAction );
    connect( favoriteAction, SIGNAL(triggered()), this, SLOT(slotFavorite()) );

    copylinkAction = new QAction( tr( "Copy link to this status" ), this );
    copylinkAction->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_C ) );
    menu->addAction( copylinkAction );
    connect( copylinkAction, SIGNAL(triggered()), this, SLOT(slotCopyLink()) );

    deleteAction = new QAction( this );
    deleteAction->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_Backspace ) );
    menu->addAction( deleteAction );
    connect( deleteAction, SIGNAL(triggered()), this, SLOT(slotDelete()) );

    markallasreadAction = new QAction( tr( "Mark list as read" ), this );
    markallasreadAction->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_A ) );
    menu->addAction( markallasreadAction );
    connect( markallasreadAction, SIGNAL(triggered()), StatusModel::instance(), SLOT(markAllAsRead()) );

    markeverythingasreadAction = new QAction( tr( "Mark everything as read" ), this );
    markeverythingasreadAction->setShortcut( QKeySequence( Qt::CTRL + Qt::ALT + Qt::Key_A ) );
    menu->addAction( markeverythingasreadAction );
    connect( markeverythingasreadAction, SIGNAL(triggered()), StatusModel::instance(), SIGNAL(markEverythingAsRead()) );

    menu->addSeparator();

    gototwitterpageAction = new QAction( this );
    gototwitterpageAction->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_T ) );
    menu->addAction( gototwitterpageAction );
    connect( gototwitterpageAction, SIGNAL(triggered()), signalMapper, SLOT(map()) );
    connect( signalMapper, SIGNAL(mapped(QString)), StatusModel::instance(), SLOT(emitOpenBrowser(QString)) );

    gotohomepageAction = new QAction( tr( "Go to User's homepage" ), this);
    gotohomepageAction->setShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_H ) );
    menu->addAction( gotohomepageAction );
    connect( gotohomepageAction, SIGNAL(triggered()), signalMapper, SLOT(map()) );
}
Пример #2
0
void QTweetStatusRetweet::retweet()
{
    retweet(m_id, m_trimUser, m_includeEntities);
}
Пример #3
0
void StatusWidget::slotRetweet()
{
    emit retweet( QString("RT @" + statusData->userInfo.screenName + ": " + statusData->originalText ) );
}