From: fsb4000 Date: Sat, 22 Nov 2014 00:33:43 +0000 (+0600) Subject: deleted address and txid columns, added context menu X-Git-Tag: nvc-v0.5.0~18^2^2~13 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=e0bc1bad2b8578158adf0fb352cfffc4262560a2 deleted address and txid columns, added context menu В PoS вкладке убраны столбцы адреса и хеша транзакции, добавлено контекстное меню с пунктами: Скопировать ID транзакции входа Скопировать адрес входа --- diff --git a/src/qt/locale/bitcoin_ru.ts b/src/qt/locale/bitcoin_ru.ts index b71a3b5..b16e1e6 100644 --- a/src/qt/locale/bitcoin_ru.ts +++ b/src/qt/locale/bitcoin_ru.ts @@ -45,6 +45,16 @@ 90 дней + + Copy transaction ID of input + Скопировать ID транзакции входа + + + + Copy address of input + Скопировать адрес входа + + Export Minting Data Экспортировать данные таблицы @@ -143,8 +153,8 @@ QObject - Potential PoS reward = from %1 to %2 - Потенциальная PoS награда = от %1 до %2 + from %1 NVC to %2 NVC + от %1 NVC до %2 NVC %1 d diff --git a/src/qt/mintingtablemodel.cpp b/src/qt/mintingtablemodel.cpp index f97520c..139116c 100644 --- a/src/qt/mintingtablemodel.cpp +++ b/src/qt/mintingtablemodel.cpp @@ -369,7 +369,7 @@ QString MintingTableModel::formatTxPoSReward(KernelRecord *wtx) const QString posReward; const CBlockIndex *p = GetLastBlockIndex(pindexBest, true); double difficulty = GetDifficulty(p); - posReward += QString(QObject::tr("Potential PoS reward = from %1 to %2 ")).arg(QString::number(wtx->getPoSReward(difficulty, 0),'f', 6), + posReward += QString(QObject::tr("from %1 NVC to %2 NVC")).arg(QString::number(wtx->getPoSReward(difficulty, 0),'f', 6), QString::number(wtx->getPoSReward(difficulty, mintingInterval),'f', 6)); return posReward; } diff --git a/src/qt/mintingview.cpp b/src/qt/mintingview.cpp index 40bd5ee..fe672a2 100644 --- a/src/qt/mintingview.cpp +++ b/src/qt/mintingview.cpp @@ -17,6 +17,7 @@ #include #include #include +#include MintingView::MintingView(QWidget *parent) : QWidget(parent), model(0), mintingView(0) @@ -96,6 +97,18 @@ MintingView::MintingView(QWidget *parent) : connect(mintingCombo, SIGNAL(activated(int)), this, SLOT(chooseMintingInterval(int))); + // Actions + QAction *copyTxIDAction = new QAction(tr("Copy transaction ID of input"), this); + QAction *copyAddressAction = new QAction(tr("Copy address of input"), this); + + contextMenu = new QMenu(); + contextMenu->addAction(copyAddressAction); + contextMenu->addAction(copyTxIDAction); + + connect(copyAddressAction, SIGNAL(triggered()), this, SLOT(copyAddress())); + connect(copyTxIDAction, SIGNAL(triggered()), this, SLOT(copyTxID())); + + connect(view, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(contextualMenu(QPoint))); } @@ -118,15 +131,6 @@ void MintingView::setModel(WalletModel *model) mintingView->verticalHeader()->hide(); mintingView->horizontalHeader()->resizeSection( - MintingTableModel::Address, 300); -#if QT_VERSION < 0x050000 - mintingView->horizontalHeader()->setResizeMode( - MintingTableModel::TxHash, QHeaderView::Stretch); -#else - mintingView->horizontalHeader()->setSectionResizeMode( - MintingTableModel::TxHash, QHeaderView::Stretch); -#endif - mintingView->horizontalHeader()->resizeSection( MintingTableModel::Age, 120); mintingView->horizontalHeader()->resizeSection( MintingTableModel::Balance, 120); @@ -134,8 +138,16 @@ void MintingView::setModel(WalletModel *model) MintingTableModel::CoinDay,120); mintingView->horizontalHeader()->resizeSection( MintingTableModel::MintProbability, 120); +#if QT_VERSION < 0x050000 + mintingView->horizontalHeader()->setResizeMode( + MintingTableModel::MintReward, QHeaderView::Stretch); +#else + mintingView->horizontalHeader()->setSectionResizeMode(MintingTableModel::MintReward, QHeaderView::Stretch); +#endif mintingView->horizontalHeader()->resizeSection( - MintingTableModel::MintReward, 300); + MintingTableModel::Address, 0); + mintingView->horizontalHeader()->resizeSection( + MintingTableModel::TxHash, 0); } } @@ -189,3 +201,22 @@ void MintingView::exportClicked() QMessageBox::Abort, QMessageBox::Abort); } } + +void MintingView::copyTxID() +{ + GUIUtil::copyEntryData(mintingView, MintingTableModel::TxHash, 0); +} + +void MintingView::copyAddress() +{ + GUIUtil::copyEntryData(mintingView, MintingTableModel::Address, 0 ); +} + +void MintingView::contextualMenu(const QPoint &point) +{ + QModelIndex index = mintingView->indexAt(point); + if(index.isValid()) + { + contextMenu->exec(QCursor::pos()); + } +} \ No newline at end of file diff --git a/src/qt/mintingview.h b/src/qt/mintingview.h index 452deaa..547bc73 100644 --- a/src/qt/mintingview.h +++ b/src/qt/mintingview.h @@ -10,6 +10,7 @@ class WalletModel; QT_BEGIN_NAMESPACE class QTableView; +class QMenu; QT_END_NAMESPACE class MintingView : public QWidget @@ -35,11 +36,16 @@ private: MintingFilterProxy *mintingProxyModel; + QMenu *contextMenu; + signals: public slots: void exportClicked(); void chooseMintingInterval(int idx); + void copyTxID(); + void copyAddress(); + void contextualMenu(const QPoint &point); }; #endif // MINTINGVIEW_H