7 #include "ui_receivecoinsdialog.h" 22 #include <QItemSelection> 23 #include <QMessageBox> 25 #include <QTextDocument> 26 #include <QGraphicsDropShadowEffect> 31 columnResizingFixer(0),
33 platformStyle(_platformStyle)
38 ui->clearButton->setIcon(QIcon());
39 ui->receiveButton->setIcon(QIcon());
40 ui->showRequestButton->setIcon(QIcon());
41 ui->removeRequestButton->setIcon(QIcon());
44 ui->receiveButton->setIcon(_platformStyle->
SingleColorIcon(
":/icons/receiving_addresses"));
46 ui->removeRequestButton->setIcon(_platformStyle->
SingleColorIcon(
":/icons/remove"));
50 QAction *copyURIAction =
new QAction(tr(
"Copy URI"),
this);
51 QAction *copyLabelAction =
new QAction(tr(
"Copy label"),
this);
52 QAction *copyMessageAction =
new QAction(tr(
"Copy message"),
this);
53 QAction *copyAmountAction =
new QAction(tr(
"Copy amount"),
this);
63 connect(
ui->recentRequestsView, SIGNAL(customContextMenuRequested(QPoint)),
this, SLOT(
showMenu(QPoint)));
64 connect(copyURIAction, SIGNAL(triggered()),
this, SLOT(
copyURI()));
65 connect(copyLabelAction, SIGNAL(triggered()),
this, SLOT(
copyLabel()));
66 connect(copyMessageAction, SIGNAL(triggered()),
this, SLOT(
copyMessage()));
67 connect(copyAmountAction, SIGNAL(triggered()),
this, SLOT(
copyAmount()));
69 connect(
ui->clearButton, SIGNAL(clicked()),
this, SLOT(
clear()));
85 QTableView* tableView =
ui->recentRequestsView;
87 tableView->verticalHeader()->hide();
88 tableView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
90 tableView->setAlternatingRowColors(
true);
91 tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
92 tableView->setSelectionMode(QAbstractItemView::ContiguousSelection);
97 connect(tableView->selectionModel(),
98 SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
this,
114 ui->reqAmount->clear();
115 ui->reqLabel->setText(
"");
116 ui->reqMessage->setText(
"");
117 ui->reuseAddress->setChecked(
false);
134 ui->frame2->setStyleSheet(QString(
".QFrame {background-color: %1; border: none;}").arg(platformStyle->
WidgetBackGroundColor().name()));
173 ui->frame->setStyleSheet(QString(
".QFrame {background-color: %1; border: none;}").arg(platformStyle->
WidgetBackGroundColor().name()));
198 QString label =
ui->reqLabel->text();
199 if(
ui->reuseAddress->isChecked())
219 ui->reqAmount->value(),
ui->reqMessage->text());
221 dialog->setAttribute(Qt::WA_DeleteOnClose);
223 dialog->setInfo(info);
236 dialog->
setInfo(submodel->
entry(index.row()).recipient);
237 dialog->setAttribute(Qt::WA_DeleteOnClose);
244 bool enable = !
ui->recentRequestsView->selectionModel()->selectedRows().isEmpty();
245 ui->showRequestButton->setEnabled(enable);
246 ui->removeRequestButton->setEnabled(enable);
253 QModelIndexList selection =
ui->recentRequestsView->selectionModel()->selectedRows();
255 for (
const QModelIndex& index : selection) {
264 QModelIndexList selection =
ui->recentRequestsView->selectionModel()->selectedRows();
265 if(selection.empty())
268 QModelIndex firstIndex = selection.at(0);
276 QWidget::resizeEvent(event);
282 if (event->key() == Qt::Key_Return)
285 if (
ui->reqLabel->hasFocus() ||
ui->reqAmount->hasFocus() ||
ui->reqMessage->hasFocus())
293 this->QDialog::keyPressEvent(event);
299 return QModelIndex();
300 QModelIndexList selection =
ui->recentRequestsView->selectionModel()->selectedRows();
301 if(selection.empty())
302 return QModelIndex();
304 QModelIndex firstIndex = selection.at(0);
312 if (!firstIndex.isValid()) {
331 if (!sel.isValid()) {
void stretchColumnWidth(int column)
Model for list of recently generated payment requests / raven: URIs.
void addNewRequest(const SendCoinsRecipient &recipient)
void sort(int column, Qt::SortOrder order=Qt::AscendingOrder)
Dialog for requesting payment of ravens.
bool removeRows(int row, int count, const QModelIndex &parent=QModelIndex())
QGraphicsDropShadowEffect * getShadowEffect()
void recentRequestsView_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
void setModel(AddressTableModel *model)
GUIUtil::TableViewLastColumnResizingFixer * columnResizingFixer
ReceiveCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent=0)
Open address book to pick address.
AddressTableModel * getAddressTableModel()
Ui::ReceiveCoinsDialog * ui
QModelIndex selectedRow()
int getDisplayUnit() const
void setModel(WalletModel *model)
void copyColumnToClipboard(int column)
void setupHistoryFrame(const PlatformStyle *platformStyle)
void setClipboard(const QString &str)
#define STRING_LABEL_COLOR
void on_recentRequestsView_doubleClicked(const QModelIndex &index)
void setInfo(const SendCoinsRecipient &info)
QString labelForAddress(const QString &address) const
Makes a QTableView last column feel as if it was being resized from its left border.
virtual void keyPressEvent(QKeyEvent *event)
const RecentRequestEntry & entry(int row) const
Widget that shows a list of sending or receiving addresses.
QVariant data(const QModelIndex &index, int role) const
virtual void resizeEvent(QResizeEvent *event)
void on_removeRequestButton_clicked()
QString addRow(const QString &type, const QString &label, const QString &address)
RecentRequestsTableModel * getRecentRequestsTableModel()
void on_receiveButton_clicked()
QString formatRavenURI(const SendCoinsRecipient &info)
Interface to Raven wallet from Qt view code.
void on_showRequestButton_clicked()
static const QString Receive
Specifies receive address.
const PlatformStyle * platformStyle
void showMenu(const QPoint &point)
void setModel(OptionsModel *model)
void setupRequestFrame(const PlatformStyle *platformStyle)
QFont getSubLabelFontBolded()
OptionsModel * getOptionsModel()
const QString & getReturnValue() const