MgServerFeatureTransaction* MgServerFeatureTransactionPool::CreateTransaction(MgResourceIdentifier* resource) { Ptr<MgServerFeatureTransaction> tran = new MgServerFeatureTransaction(resource); // Add it to the pool. AddTransaction(tran); return tran.Detach(); }
struct Transaction *DialogNewTransaction(struct Dialog *dialog, MESSAGE *message, int type) { struct DialogId *id = GetDialogId(dialog); struct Transaction *t = AddTransaction(message, (struct TransactionUser *)dialog, type); dialog->transaction = t; if (type == TRANSACTION_TYPE_CLIENT_INVITE) { SetLocalTag(id, MessageGetFromTag(message)); SetCallId(id, MessageGetCallId(message)); SetLocalSeqNumber(dialog, MessageGetCSeqNumber(message)); } else if (type == TRANSACTION_TYPE_SERVER_INVITE) { SetRemoteTag(id, MessageGetFromTag(message)); SetCallId(id, MessageGetCallId(message)); ExtractRemoteTarget(dialog, message); if (NotifyCm != NULL) { NotifyCm(CALL_INCOMING, DialogGetUserAgent(dialog)); } } return t; }
TransactionDialog::TransactionDialog( Account* acc, QList<Account*>* accs, QList<Category*>* cats, ConnectionManager* manager, QWidget *parent) : QDialog(parent), ui(new Ui::TransactionDialog) { ui->setupUi(this); WRONGCOLOR = "#FF3D64"; account = acc; accounts = accs; categories = cats; this->manager = manager; connect(ui->pushButtonCancel, SIGNAL(clicked()), this, SLOT(close())); connect(ui->pushButtonAdd, SIGNAL(clicked()), this, SLOT(AddTransaction())); connect(ui->pushButtonAddClose, SIGNAL(clicked()), this, SLOT(AddTransactionAndClose())); buttonGroup = new QButtonGroup(); buttonGroup->addButton(ui->pushButtonOutcome); buttonGroup->addButton(ui->pushButtonExchange); buttonGroup->addButton(ui->pushButtonIncome); connect(ui->pushButtonOutcome, SIGNAL(toggled(bool)), this, SLOT(outcomeChecked(bool))); connect(ui->pushButtonIncome, SIGNAL(toggled(bool)), this, SLOT(incomeChecked(bool))); connect(ui->pushButtonExchange, SIGNAL(toggled(bool)), this, SLOT(exchangeChecked(bool))); connect(ui->comboBoxAccountFrom, SIGNAL(currentIndexChanged(int)), this, SLOT(fromChanged(int))); connect(ui->comboBoxAccountTo, SIGNAL(currentIndexChanged(int)), this, SLOT(toChanged(int))); fillAccounts(); setInitState(); }