19 #include <QMessageBox>
21 #include <QTextDocument>
26 columnResizingFixer(nullptr),
28 platformStyle(_platformStyle)
45 QAction *copyURIAction =
new QAction(tr(
"Copy URI"),
this);
46 QAction *copyLabelAction =
new QAction(tr(
"Copy label"),
this);
47 QAction *copyMessageAction =
new QAction(tr(
"Copy message"),
this);
48 QAction *copyAmountAction =
new QAction(tr(
"Copy amount"),
this);
79 tableView->verticalHeader()->hide();
80 tableView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
82 tableView->setAlternatingRowColors(
true);
83 tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
84 tableView->setSelectionMode(QAbstractItemView::ContiguousSelection);
89 connect(tableView->selectionModel(),
90 &QItemSelectionModel::selectionChanged,
this,
163 case AddressTableModel::EditStatus::OK: {
168 dialog->setAttribute(Qt::WA_DeleteOnClose);
177 case AddressTableModel::EditStatus::WALLET_UNLOCK_FAILURE:
178 QMessageBox::critical(
this, windowTitle(),
179 tr(
"Could not unlock wallet."),
180 QMessageBox::Ok, QMessageBox::Ok);
182 case AddressTableModel::EditStatus::KEY_GENERATION_FAILURE:
183 QMessageBox::critical(
this, windowTitle(),
184 tr(
"Could not generate new %1 address").arg(QString::fromStdString(
FormatOutputType(address_type))),
185 QMessageBox::Ok, QMessageBox::Ok);
188 case AddressTableModel::EditStatus::INVALID_ADDRESS:
189 case AddressTableModel::EditStatus::DUPLICATE_ADDRESS:
190 case AddressTableModel::EditStatus::NO_CHANGES:
202 dialog->setAttribute(Qt::WA_DeleteOnClose);
220 for (
const QModelIndex& index : selection) {
230 if(selection.empty())
233 QModelIndex firstIndex = selection.at(0);
241 QWidget::resizeEvent(event);
248 return QModelIndex();
250 if(selection.empty())
251 return QModelIndex();
253 QModelIndex firstIndex = selection.at(0);
261 if (!firstIndex.isValid()) {
280 if (!sel.isValid()) {
EditStatus getEditStatus() const
QString addRow(const QString &type, const QString &label, const QString &address, const OutputType address_type)
static const QString Receive
Specifies receive address.
void setDisplayUnit(int unit)
Change unit used to display amount.
void clear()
Make field empty and ready for new input.
Makes a QTableView last column feel as if it was being resized from its left border.
void stretchColumnWidth(int column)
int getDisplayUnit() const
void displayUnitChanged(int unit)
Dialog for requesting payment of bitcoins.
Ui::ReceiveCoinsDialog * ui
void on_removeRequestButton_clicked()
@ AMOUNT_MINIMUM_COLUMN_WIDTH
void on_showRequestButton_clicked()
void on_recentRequestsView_doubleClicked(const QModelIndex &index)
GUIUtil::TableViewLastColumnResizingFixer * columnResizingFixer
void recentRequestsView_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
void setModel(WalletModel *model)
void showMenu(const QPoint &point)
void on_receiveButton_clicked()
ReceiveCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent=nullptr)
virtual void resizeEvent(QResizeEvent *event) override
QModelIndex selectedRow()
void copyColumnToClipboard(int column)
void setModel(WalletModel *model)
void setInfo(const SendCoinsRecipient &info)
SendCoinsRecipient recipient
Model for list of recently generated payment requests / bitcoin: URIs.
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex()) override
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
const RecentRequestEntry & entry(int row) const
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder) override
void addNewRequest(const SendCoinsRecipient &recipient)
BitcoinAmountField * reqAmount
void setupUi(QDialog *ReceiveCoinsDialog)
QPushButton * removeRequestButton
QPushButton * receiveButton
QPushButton * showRequestButton
QTableView * recentRequestsView
QPushButton * clearButton
Interface to Bitcoin wallet from Qt view code.
AddressTableModel * getAddressTableModel()
OptionsModel * getOptionsModel()
interfaces::Wallet & wallet() const
RecentRequestsTableModel * getRecentRequestsTableModel()
void canGetAddressesChanged()
virtual OutputType getDefaultAddressType()=0
virtual bool canGetAddresses()=0
QString formatBitcoinURI(const SendCoinsRecipient &info)
void setClipboard(const QString &str)
const std::string & FormatOutputType(OutputType type)