Esempio n. 1
0
void MainWindow::on_input_sct()
{
    const bool needDeg = ui->pushButton_13->isChecked();
    const bool needArc = ui->pushButton_14->isChecked();

    if (ui->pushButton_12->isChecked())
    {
        // Insert "deg()" for arc func
        if (needDeg && needArc)
        {
            doInsert("deg()", -1);
        }

        // Insert the string from the button's text and "arc" button
        doInsert(
              (needArc ? "a" : "")
            + ((QPushButton *) sender())->text()
            + "()"
        , -1);

        // Insert "rad()" for non-arc func
        if (needDeg && !needArc)
        {
            doInsert("rad()", -1);
        }
    }
    else
    {
        // Apply "rad()" for non-arc func
        if (needDeg && !needArc)
        {
            doApply("rad(", ")");
        }

        // Apply the string from the button's text and "arc" button
        doApply(
              (needArc ? "a" : "")
            + ((QPushButton *) sender())->text()
            + "("
        , ")");

        // Apply "deg()" for arc func
        if (needDeg && needArc)
        {
            doApply("deg(", ")");
        }
    }

}
Esempio n. 2
0
TER Transactor::apply ()
{
    TER terResult (preCheck ());

    if (terResult != tesSUCCESS)
        return (terResult);

    // Restructure this to avoid the dependency on LedgerBase::mLock
    Ledger::ScopedLockType sl (mEngine->getLedger ()->mLock);

    mTxnAccount = mEngine->entryCache (ltACCOUNT_ROOT,
        Ledger::getAccountRootIndex (mTxnAccountID));
    calculateFee ();

    // Find source account
    // If are only forwarding, due to resource limitations, we might verifying
    // only some transactions, this would be probabilistic.

    if (!mTxnAccount)
    {
        if (mustHaveValidAccount ())
        {
            m_journal.trace <<
                "apply: delay transaction: source account does not exist " <<
                mTxn.getSourceAccount ().humanAccountID ();
            return terNO_ACCOUNT;
        }
    }
    else
    {
        mPriorBalance   = mTxnAccount->getFieldAmount (sfBalance);
        mSourceBalance  = mPriorBalance;
        mHasAuthKey     = mTxnAccount->isFieldPresent (sfRegularKey);
    }

    terResult = checkSeq ();

    if (terResult != tesSUCCESS) return (terResult);

    terResult = payFee ();

    if (terResult != tesSUCCESS) return (terResult);

    terResult = checkSig ();

    if (terResult != tesSUCCESS) return (terResult);

    terResult = precheckAgainstLedger();

    if (terResult != tesSUCCESS) return (terResult);

    if (!mEngine->mClosingLedger) {
        return tesSUCCESS;
    }

    if (mTxnAccount)
        mEngine->entryModify (mTxnAccount);

    return doApply ();
}
Esempio n. 3
0
TER Transactor::apply ()
{
    preCompute();

    // If the transactor requires a valid account and the transaction doesn't
    // list one, preflight will have already a flagged a failure.
    auto const sle = view().peek (keylet::account(account_));

    // sle must exist except for transactions
    // that allow zero account.
    assert(sle != nullptr || account_ == beast::zero);

    if (sle)
    {
        mPriorBalance   = STAmount ((*sle)[sfBalance]).xrp ();
        mSourceBalance  = mPriorBalance;

        setSeq();

        auto result = payFee ();

        if (result  != tesSUCCESS)
            return result;

        view().update (sle);
    }

    return doApply ();
}
Esempio n. 4
0
std::pair<TER, bool>
apply (Application& app, OpenView& view,
    STTx const& tx, ApplyFlags flags,
        beast::Journal j)
{
    STAmountSO saved(view.info().parentCloseTime);
    auto pfresult = preflight(app, view.rules(), tx, flags, j);
    auto pcresult = preclaim(pfresult, app, view);
    return doApply(pcresult, app, view);
}
Esempio n. 5
0
TER Transactor::apply ()
{
    TER     terResult   = tesSUCCESS;
    terResult = preCheck ();

    if (terResult != tesSUCCESS) return (terResult);

    Ledger::ScopedLockType sl (mEngine->getLedger ()->mLock, __FILE__, __LINE__);

    mTxnAccount = mEngine->entryCache (ltACCOUNT_ROOT, Ledger::getAccountRootIndex (mTxnAccountID));
    calculateFee ();

    // Find source account
    // If are only forwarding, due to resource limitations, we might verifying only some transactions, this would be probabilistic.

    if (!mTxnAccount)
    {
        if (mustHaveValidAccount ())
        {
            WriteLog (lsTRACE, Transactor) << boost::str (boost::format ("applyTransaction: Delay transaction: source account does not exist: %s") %
                                           mTxn.getSourceAccount ().humanAccountID ());

            return terNO_ACCOUNT;
        }
    }
    else
    {
        mPriorBalance   = mTxnAccount->getFieldAmount (sfBalance);
        mSourceBalance  = mPriorBalance;
        mHasAuthKey     = mTxnAccount->isFieldPresent (sfRegularKey);
    }

    terResult = checkSeq ();

    if (terResult != tesSUCCESS) return (terResult);

    terResult = payFee ();

    if (terResult != tesSUCCESS) return (terResult);

    terResult = checkSig ();

    if (terResult != tesSUCCESS) return (terResult);

    if (mTxnAccount)
        mEngine->entryModify (mTxnAccount);

    return doApply ();
}
Esempio n. 6
0
void MainWindow::on_input_o()
{
    if (ui->pushButton_12->isChecked())
    {
        // Insert the string from the button's tool tip
        doInsert(
            ((QPushButton *) sender())->toolTip()
        );
    }
    else
    {
        // Apply the string from the button's tool tip
        doApply("(", ")" + ((QPushButton *) sender())->toolTip());
    }
}
Esempio n. 7
0
void EditCommand::apply()
{
    ASSERT(m_document);
    ASSERT(m_document->frame());
 
    Frame* frame = m_document->frame();
    
    if (isTopLevelCommand()) {
        if (!endingSelection().isContentRichlyEditable()) {
            switch (editingAction()) {
                case EditActionTyping:
                case EditActionPaste:
                case EditActionDrag:
                case EditActionSetWritingDirection:
                case EditActionCut:
                case EditActionUnspecified:
                    break;
                default:
                    ASSERT_NOT_REACHED();
                    return;
            }
        }
    }
    
    // Changes to the document may have been made since the last editing operation that 
    // require a layout, as in <rdar://problem/5658603>.  Low level operations, like 
    // RemoveNodeCommand, don't require a layout because the high level operations that 
    // use them perform one if one is necessary (like for the creation of VisiblePositions).
    if (isTopLevelCommand())
        updateLayout();

    {
        EventQueueScope scope;
        DeleteButtonController* deleteButtonController = frame->editor()->deleteButtonController();
        deleteButtonController->disable();
        doApply();
        deleteButtonController->enable();
    }

    if (isTopLevelCommand()) {
        // Only need to call appliedEditing for top-level commands, and TypingCommands do it on their
        // own (see TypingCommand::typingAddedToOpenCommand).
        if (!isTypingCommand())
            frame->editor()->appliedEditing(this);
    }

    setShouldRetainAutocorrectionIndicator(false);
}
Esempio n. 8
0
void MainWindow::on_input_f()
{
    if (ui->pushButton_12->isChecked())
    {
        // Insert the string from the button's text
        doInsert(
              ((QPushButton *) sender())->text()
            + "()"
        , -1);
    }
    else
    {
        // Apply the string from the button's text
        doApply(((QPushButton *) sender())->text() + "(", ")");
    }
}
Esempio n. 9
0
void MainWindow::on_input_scth()
{
    const bool needArc = ui->pushButton_14->isChecked();

    if (ui->pushButton_12->isChecked())
    {
        // Insert the string from the button's text and "arc" button
        doInsert(
              (needArc ? "a" : "")
            + ((QPushButton *) sender())->text()
            + "()"
        , -1);
    }
    else
    {
        // Apply the string from the button's text and "arc" button
        doApply(
              (needArc ? "a" : "")
            + ((QPushButton *) sender())->text()
            + "("
        , ")");
    }
}
Esempio n. 10
0
void SimpleEditCommand::doReapply()
{
    doApply();
}
Esempio n. 11
0
void LLFloaterBulkPermission::onApplyBtn()
{
	doApply();
}
Esempio n. 12
0
void SimpleEditCommand::doReapply() {
  EditingState editingState;
  doApply(&editingState);
}
Esempio n. 13
0
void PropertiesDialog::applyAndClose()
{
	if(doApply())
		accept();
}
Esempio n. 14
0
void PropertiesDialog::apply()
{
	doApply();
}
Esempio n. 15
0
void EditCommand::doReapply()
{
    doApply();
}