X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fqt%2Ftransactionview.cpp;h=88b119a9e65601dab388fdd1a73320792d7fb607;hb=f8ea0dd6459856f2df18ca2ad532d49432a087dd;hp=764900134a16f44035ec55bcd0808bbd1f59de20;hpb=de5cfb709af6c48f8c3ca0b64dec469ec720a5c8;p=novacoin.git diff --git a/src/qt/transactionview.cpp b/src/qt/transactionview.cpp index 7649001..88b119a 100644 --- a/src/qt/transactionview.cpp +++ b/src/qt/transactionview.cpp @@ -32,6 +32,7 @@ #include #include #include +#include TransactionView::TransactionView(QWidget *parent) : QWidget(parent), model(0), transactionProxyModel(0), @@ -167,7 +168,7 @@ TransactionView::TransactionView(QWidget *parent) : connect(clearOrphansAction, SIGNAL(triggered()), this, SLOT(clearOrphans())); } -void TransactionView::setModel(WalletModel *model) +void TransactionView::setModel(WalletModel *model, bool fShoudAddThirdPartyURL) { this->model = model; if(model) @@ -178,8 +179,8 @@ void TransactionView::setModel(WalletModel *model) transactionProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive); transactionProxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive); -// transactionProxyModel->setSortRole(Qt::EditRole); - transactionProxyModel->setSortRole(TransactionTableModel::DateRole); + transactionProxyModel->setSortRole(Qt::EditRole); +// transactionProxyModel->setSortRole(TransactionTableModel::DateRole); transactionView->setModel(transactionProxyModel); transactionView->setAlternatingRowColors(true); @@ -202,9 +203,9 @@ void TransactionView::setModel(WalletModel *model) transactionView->horizontalHeader()->setSectionResizeMode(TransactionTableModel::ToAddress, QHeaderView::Stretch); #endif transactionView->horizontalHeader()->resizeSection( - TransactionTableModel::Amount, 100); + TransactionTableModel::Amount, 130); - if (model->getOptionsModel()) + if (model->getOptionsModel() && fShoudAddThirdPartyURL) { // Add third party transaction URLs to context menu QStringList listUrls = model->getOptionsModel()->getThirdPartyTxUrls().split("|", QString::SkipEmptyParts); @@ -258,7 +259,7 @@ void TransactionView::chooseDate(int idx) break; case LastMonth: transactionProxyModel->setDateRange( - QDateTime(QDate(current.year(), current.month()-1, 1)), + QDateTime(QDate(current.year(), current.month(), 1).addMonths(-1)), QDateTime(QDate(current.year(), current.month(), 1))); break; case ThisYear: @@ -415,7 +416,13 @@ void TransactionView::showDetails() if(!selection.isEmpty()) { TransactionDescDialog dlg(selection.at(0)); - dlg.exec(); + dlg.setWindowModality(Qt::ApplicationModal); + dlg.show(); + + // This loop will wait for the window is closed + QEventLoop loop; + connect(&dlg, SIGNAL(stopExec()), &loop, SLOT(quit())); + loop.exec(); } } @@ -427,7 +434,7 @@ void TransactionView::clearOrphans() model->clearOrphans(); model->getTransactionTableModel()->refresh(); delete transactionProxyModel; - setModel(model); + setModel(model, false); transactionView->sortByColumn(TransactionTableModel::Status, Qt::DescendingOrder); transactionView->sortByColumn(TransactionTableModel::Date, Qt::DescendingOrder); }