Example #1
0
void ListView::keyPressEvent(QKeyEvent *e)
{
    if (e->key()){
        int key = e->key();
        if (e->state() & ShiftButton)
            key |= SHIFT;
        if (e->state() & ControlButton)
            key |= CTRL;
        if (e->state() & AltButton)
            key |= ALT;
        QListViewItem *item = currentItem();
        if (item){
            ProcessMenuParam *mp = getMenu(item);
            if (mp){
                mp->key	 = key;
                Event eMenu(EventProcessMenu, mp);
                if (eMenu.process())
                    return;
            }
        }
    }
    if (e->key() == Key_F10){
        showPopup(currentItem(), QPoint());
        return;
    }
    QListView::keyPressEvent(e);
}
bool DocumentWindow::loadDocument(const QString& path)
{
    if (!closeDocument())
    {
        return false;
    }

    const QFile::FileError loading = m_document.loadFromFile(path);
    if (loading != QFile::NoError)
    {
        showPopup(tr("Error"), tr("Failed to load file: %1").arg(path));
        return false;
    }

    m_path = path;
    m_synchronized = true;

    setWindowTitle(separateName(path));

    setDocumentModel();

    emit documentLoaded(path);

    return true;
}
bool DocumentWindow::saveDocument(const QString& path)
{
    const bool samePath = m_path == path;
    const QString oldPath = m_path;

    if (m_synchronized && samePath)
    {
        return true;
    }

    const QFile::FileError saving = m_document.saveToFile(path);
    if (saving != QFile::NoError)
    {
        showPopup(tr("Error"), tr("Failed to save to file: %1").arg(path));
        return false;
    }

    if (!samePath)
    {
        m_path = path;
    }

    m_synchronized = true;

    setWindowTitle(separateName(m_path));

    emit documentSaved(path);

    if (!samePath)
    {
        emit documentClosed(oldPath);
    }

    return true;
}
Example #4
0
void ComboBox::mouseDrag (const MouseEvent& e)
{
    beginDragAutoRepeat (50);

    if (isButtonDown && ! e.mouseWasClicked())
        showPopup();
}
Example #5
0
//==============================================================================
bool ComboBox::keyPressed (const KeyPress& key)
{
    if (key.isKeyCode (KeyPress::upKey) || key.isKeyCode (KeyPress::leftKey))
    {
        int index = getSelectedItemIndex() - 1;

        while (index >= 0 && ! selectIfEnabled (index))
            --index;

        return true;
    }
    else if (key.isKeyCode (KeyPress::downKey) || key.isKeyCode (KeyPress::rightKey))
    {
        int index = getSelectedItemIndex() + 1;

        while (index < getNumItems() && ! selectIfEnabled (index))
            ++index;

        return true;
    }
    else if (key.isKeyCode (KeyPress::returnKey))
    {
        showPopup();
        return true;
    }

    return false;
}
Example #6
0
menix::menix(QWidget *parent) :
        QMainWindow(parent),
        m_ui(new Ui::menix) {
    m_ui->setupUi(this);


    QToolBar *toolbarIconos = addToolBar(tr("Iconos"));
    toolbarIconos->addAction(QIcon(":/preferences-system.png"),"Opciones",this,SLOT( abrirOpciones() ) );
    toolbarIconos->addAction(QIcon(":/terminal.png"),"Debug",this,SLOT(abrirDebug()));

    opciones = new opcionesGlobales();
    numero = opciones->NumeroDestino();
    puerto = opciones->Puerto();
    pin = opciones->Pin();
    centro = opciones->CentroMensajes();
    fixok = opciones->Fixok();
    
    ips = new QStringList( opciones->Ips() );

    file = new QFile( opciones->fileLog() );
    file->open( QIODevice::WriteOnly | QIODevice::Text );
    flog = new QTextStream( file );
    
    mensaje = new smsat(centro,puerto,flog,pin,fixok);
    crearAcciones();
    crearBandeja();
//    testPuerto( mensaje );
    Server *tcp = new Server(ips,this);
    connect(tcp,SIGNAL(sendMessage(QString)),this,SLOT(sendMessage(QString)));
    connect(mensaje,SIGNAL(sendAt(QString)),this,SLOT(sendedMessage(QString)));
    connect(mensaje,SIGNAL(displayMsg(QString)),this,SLOT(showPopup(QString)));
}
Example #7
0
void PopupContainer::showInRect(const FloatQuad& controlPosition, const IntSize& controlSize, FrameView* v, int index)
{
    // The controlSize is the size of the select box. It's usually larger than
    // we need. Subtract border size so that usually the container will be
    // displayed exactly the same width as the select box.
    m_listBox->setBaseWidth(max(controlSize.width() - borderSize * 2, 0));

    m_listBox->updateFromElement();

    // We set the selected item in updateFromElement(), and disregard the
    // index passed into this function (same as Webkit's PopupMenuWin.cpp)
    // FIXME: make sure this is correct, and add an assertion.
    // ASSERT(popupWindow(popup)->listBox()->selectedIndex() == index);

    // Save and convert the controlPosition to main window coords. Each point is converted separately
    // to window coordinates because the control could be in a transformed webview and then each point
    // would be transformed by a different delta.
    m_controlPosition.setP1(v->contentsToWindow(IntPoint(controlPosition.p1().x(), controlPosition.p1().y())));
    m_controlPosition.setP2(v->contentsToWindow(IntPoint(controlPosition.p2().x(), controlPosition.p2().y())));
    m_controlPosition.setP3(v->contentsToWindow(IntPoint(controlPosition.p3().x(), controlPosition.p3().y())));
    m_controlPosition.setP4(v->contentsToWindow(IntPoint(controlPosition.p4().x(), controlPosition.p4().y())));

    m_controlSize = controlSize;

    // Position at (0, 0) since the frameRect().location() is relative to the
    // parent WebWidget.
    setFrameRect(IntRect(IntPoint(), controlSize));
    showPopup(v);
}
Example #8
0
void QxtLookupLineEdit::keyPressEvent ( QKeyEvent * event )
{
    QKeySequence currSeq = QKeySequence(event->key() | event->modifiers());
    if(currSeq.matches(qxt_d().m_trigger))
        showPopup ();
    else
        QLineEdit::keyPressEvent(event);
}
Example #9
0
//==============================================================================
void ComboBox::showPopupIfNotActive()
{
    if (! menuActive)
    {
        menuActive = true;
        showPopup();
    }
}
Example #10
0
void DockWnd::showPopup()
{
    POINT pos;
    GetCursorPos(&pos);
    if (qApp->activeWindow() == NULL)
        setFocus();
    emit showPopup(QPoint(pos.x, pos.y));
}
Example #11
0
/**
 * @brief Slot connected to MarblePopupItem::editAlbumSignal
 * @param p_marker_id
 * @param p_album_id
 */
void MarbleMap::editAlbumSlot(int p_marker_id, int p_album_id)
{
#ifdef DBG_MARBLE_MAP
  qDebug() << "MarbleMap::editAlbumSlot(" << p_marker_id << "," << p_album_id << ")";
#endif
  destroyPopup();
  showPopup(m_current_marker, EDIT_ALBUM, p_album_id);
}
Example #12
0
void StackFolder::timerEvent(QTimerEvent *event)
{
    if (event->timerId() == m_delayedShowTimer.timerId()) {
        m_delayedShowTimer.stop();
        showPopup();
    }
    Plasma::PopupApplet::timerEvent(event);
}
Example #13
0
void pTreeComboBox::mousePressEvent( QMouseEvent* event )
{
    if ( mView ) {
        mFrame->isVisible() ? hidePopup() : showPopup();
    }
    
    QWidget::mousePressEvent( event );
}
Example #14
0
/**
 * @brief Slot connected to MarblePopupItem::cancelAlbumEditSignal
 */
void MarbleMap::disposeAlbumEditSlot()
{
#ifdef DBG_MARBLE_MAP
  qDebug() << "MarbleMap::disposeAlbumEditSlot()";
#endif
  destroyPopup();
  showPopup(m_current_marker);
}
Example #15
0
void GameScene::buyTimer(CCObject* pSender ,cocos2d::ui::TouchEventType type) {
    if (type == cocos2d::ui::TOUCH_EVENT_ENDED) {
        if(GameManager::getXu() >= 3) {
            //buy xu
            GameManager::addXu(-3);
            GameManager::addTimer(2);
            showPopup(popupBuyItem,false);
            validateTimer();
            lb_xu->setText(Utils::convertIntToChar(GameManager::getXu()));
        } else {
            //native jni call function
//		Utils::sendSms5k("callbackSMS");
            showPopup(popupBuyItem,false);

        }
    }
}
Example #16
0
void QuickOpenManager::showById(const QString &id)
{
    IQuickOpen *i = findById(id);
    if (i) {
        setCurrentFilter(i);
        showPopup();
    }
}
Example #17
0
/**
 * @brief Slot connected to MarblePopupHeader::newAlbumSignal
 * @param p_marker_id
 */
void MarbleMap::newAlbumSlot(int p_marker_id)
{
#ifdef DBG_MARBLE_MAP
  qDebug() << "MarbleMap::newAlbumSlot(" << p_marker_id << ")";
#endif
  destroyPopup();
  showPopup(m_current_marker, EDIT_NEW_ALBUM, m_current_marker->getAlbumsCount());
}
Example #18
0
void QFontComboBox_QtDShell::__override_showPopup(bool static_call)
{
    if (static_call) {
        QComboBox::showPopup();
    } else {
        showPopup();
    }
}
bool PHIAComboBox::event( QEvent *e )
{
    if ( e->type()==QEvent::MouseButtonPress || e->type()==QEvent::MouseButtonDblClick ) {
        showPopup();
        e->ignore();
        return true;
    }
    return QComboBox::event( e );
}
void PHIAComboBox::keyPressEvent( QKeyEvent *e )
{
    if ( e->key()==Qt::Key_Space ) {
        showPopup();
        e->ignore();
        return;
    }
    return QComboBox::keyPressEvent( e );
}
Example #21
0
//==============================================================================
void ComboBox::mouseDown (const MouseEvent& e)
{
    beginDragAutoRepeat (300);

    isButtonDown = isEnabled() && ! e.mods.isPopupMenu();

    if (isButtonDown && (e.eventComponent == this || ! label->isEditable()))
        showPopup();
}
Example #22
0
void GameScene::showWin() {
    char* buffer = new char[strlen(text_next_popup)+5];
    currentTime -= startTime;
    if(currentTime < 0) currentTime = 0;
    sprintf(buffer, text_next_popup,Utils::convertIntToChar(GameManager::getCurrentTime()+currentTime));
    lb_next_popup->setText(buffer);
    showPopup(popup_next,true);

}
Example #23
0
UserInfoButton::UserInfoButton( QWidget *parent ) :
    QPushButton( parent ),
    userInfo(0)
{
  active = false;
  timer = new QTimer( this );
  timer->setSingleShot( true );
  connect( timer, SIGNAL(timeout()), this, SLOT(showPopup()) );
}
Example #24
0
void SpecialButton::mousePressEvent(QMouseEvent *)
{
    if (!isPopupVisible) {
        showPopup();
    }
    else {
        hidePopup();
    }
}
Example #25
0
void AttentionPlugin::sendAttention(int account, const QString& yourJid, const QString& jid) {

    if(accInfoHost->getStatus(account) == "offline")
        return;

    QString msg = QString("<message from=\"%1\" to=\"%2\" type=\"headline\"><attention xmlns='urn:xmpp:attention:0'/></message>").arg(yourJid).arg(jid);
    stanzaSender->sendStanza(account, msg);

    showPopup(FakeAccount, QString(), tr("You sent Attention message to %1").arg(jid));
}
Example #26
0
void CToolButton::mousePressEvent(QMouseEvent *e)
{
#if QT_VERSION < 300
    if (e->button() == RightButton){
        emit showPopup(e->globalPos());
        return;
    }
#endif
    QToolButton::mousePressEvent(e);
}
Example #27
0
void GameScene::playContinue(CCObject* pSender ,cocos2d::ui::TouchEventType type) {
    if (type == cocos2d::ui::TOUCH_EVENT_ENDED) {
        isPause = false;
        gameLayer->setVisible(true);
//	CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(gameLayer, 0, true);
        schedule(schedule_selector(GameScene::onTimer));
        showPopup(popup_pause_game,false);
        bt_pause->setVisible(true);
    }
}
Example #28
0
void GameScene::showPopupBuyItems() {


    /*char* text_buy_hint = new char[(strlen(this->text_buy_hint) + 1)];
    char* text_buy_time = new char[(strlen(this->text_buy_hint) + 1)];
    strcpy(text_buy_hint, this->text_buy_hint);
    strcpy(text_buy_time, this->text_buy_time);*/

    showPopup(popupBuyItem,true);

    if(GameManager::getXu() > 0) {
        //buy xu
        CCLog("text buy hint:%s",text_buy_hint);
        char buffer[10] = {0};
        sprintf(buffer, text_buy_hint,"1 coin");
        bt_buy_hint->setEnabled(true);
        lb_buy_hint->setText(buffer);
    } else {
        char buffer[15] = {0};
        CCLog("text buy hint:%s",text_buy_hint);
        //sprintf(buffer, text_buy_hint,"sms 2,000");
        sprintf(buffer, text_buy_hint,"1 coin");
        bt_buy_hint->setEnabled(false);
        lb_buy_hint->setText(buffer);
    }
    if(GameManager::getXu() >= 3) {
        char buffer[10] = {0};
        CCLog("text buy hint:%s",text_buy_time);
        sprintf(buffer, text_buy_time,"3 coin");
        bt_buy_time->setEnabled(true);
        lb_buy_time->setText(buffer);
    } else {
        char buffer[15] = {0};
        CCLog("text buy hint:%s",text_buy_time);
        //sprintf(buffer, text_buy_time,"sms 5,000");
        sprintf(buffer, text_buy_time,"3 coin");
        bt_buy_time->setEnabled(false);
        lb_buy_time->setText(buffer);
    }

    if(GameManager::getXu() >= 10) {
        char buffer[10] = {0};
        CCLog("text buy hint:%s",text_buy_time);
        bt_buy_time_3->setEnabled(true);
        sprintf(buffer, text_buy_time,"10 coin");
        lb_comboo->setText(buffer);
    } else {
        char buffer[15] = {0};
        CCLog("text buy hint:%s",text_buy_time);
        sprintf(buffer, text_buy_time,"10 coin");
        //sprintf(buffer, text_buy_time,"sms 15,000");
        bt_buy_time_3->setEnabled(false);
        lb_comboo->setText(buffer);
    }
}
bool QtFallbackWebPopupCombo::eventFilter(QObject* watched, QEvent* event)
{
    Q_ASSERT(watched == view());

    if (event->type() == QEvent::Show && !m_ownerPopup.m_popupVisible)
        showPopup();
    else if (event->type() == QEvent::Hide && m_ownerPopup.m_popupVisible)
        hidePopup();

    return false;
}
/**
 * search next unread message
 */
void KLinPopup::unreadPopup()
{
	for (uint i = 0; i < messageList.count(); i++) {
		if (messageList.at(i)->isRead() == false) {
			break;
		}
	}

	showPopup();
	popupHelper();
}