Skip to content

Commit

Permalink
UI: Further work to move trade history to cached map
Browse files Browse the repository at this point in the history
  • Loading branch information
zathras-crypto committed May 19, 2015
1 parent 644fe91 commit 033b6ce
Show file tree
Hide file tree
Showing 6 changed files with 219 additions and 67 deletions.
2 changes: 1 addition & 1 deletion src/mastercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3246,7 +3246,7 @@ int CMPSTOList::deleteAboveBlock(int blockNum)
}

// MPTradeList here
bool CMPTradeList::getMatchingTrades(const uint256 txid, unsigned int propertyId, Array *tradeArray, uint64_t *totalSold, uint64_t *totalBought)
bool CMPTradeList::getMatchingTrades(const uint256 txid, unsigned int propertyId, Array *tradeArray, int64_t *totalSold, int64_t *totalBought)
{
if (!pdb) return false;
leveldb::Slice skey, svalue;
Expand Down
2 changes: 1 addition & 1 deletion src/mastercore.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ class CMPTradeList : public CDBBase
bool exists(const uint256 &txid);
void printStats();
void printAll();
bool getMatchingTrades(const uint256 txid, unsigned int propertyId, Array *tradeArray, uint64_t *totalSold, uint64_t *totalBought);
bool getMatchingTrades(const uint256 txid, unsigned int propertyId, Array *tradeArray, int64_t *totalSold, int64_t *totalBought);
int getMPTradeCountTotal();
};

Expand Down
6 changes: 3 additions & 3 deletions src/mastercore_rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1948,12 +1948,12 @@ Value gettrade_MP(const Array& params, bool fHelp)
}

// get the amount for sale in this sell offer to see if filled
uint64_t amountForSale = mp_obj.getAmount();
int64_t amountForSale = mp_obj.getAmount();

// create array of matches
Array tradeArray;
uint64_t totalBought = 0;
uint64_t totalSold = 0;
int64_t totalBought = 0;
int64_t totalSold = 0;
t_tradelistdb->getMatchingTrades(hash, propertyId, &tradeArray, &totalSold, &totalBought);

// get action byte
Expand Down
4 changes: 2 additions & 2 deletions src/qt/guiutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ void TableViewLastColumnResizingFixer::on_geometriesChanged()
bool omniTradeHistoryLayout = false;
if (abstractModel->columnCount() > 3) { // ensure the columns are there before we try to reference them
if (abstractModel->headerData(2, Qt::Horizontal).toString()=="Reserved") { omniLayout = true; omniBalanceLayout = true; }
if (abstractModel->headerData(2, Qt::Horizontal).toString()=="Date") { omniLayout = true; omniTradeHistoryLayout = true; }
if (abstractModel->headerData(3, Qt::Horizontal).toString()=="Date") { omniLayout = true; omniTradeHistoryLayout = true; }
}
if (omniLayout) { // this is an Omni balance or trade layout, override column resize
if (omniBalanceLayout) resizeColumn(omniBalanceOverrideColumnIndex, getAvailableWidthForColumn(omniBalanceOverrideColumnIndex));
Expand All @@ -577,7 +577,7 @@ TableViewLastColumnResizingFixer::TableViewLastColumnResizingFixer(QTableView* t
lastColumnIndex = columnCount - 1;
secondToLastColumnIndex = columnCount - 2;
omniBalanceOverrideColumnIndex = 1; // we can safely hardcode this for now
omniTradeHistoryOverrideColumnIndex = 4; // as above
omniTradeHistoryOverrideColumnIndex = 5; // as above
tableView->horizontalHeader()->setMinimumSectionSize(allColumnsMinimumWidth);
setViewHeaderResizeMode(secondToLastColumnIndex, QHeaderView::Interactive);
setViewHeaderResizeMode(lastColumnIndex, QHeaderView::Interactive);
Expand Down
Loading

0 comments on commit 033b6ce

Please sign in to comment.