Bitcoin Core  0.20.99
P2P Digital Currency
openuridialog.cpp
Go to the documentation of this file.
1 // Copyright (c) 2011-2019 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <qt/openuridialog.h>
6 #include <qt/forms/ui_openuridialog.h>
7 
8 #include <qt/guiutil.h>
10 
11 #include <QUrl>
12 
13 OpenURIDialog::OpenURIDialog(QWidget *parent) :
14  QDialog(parent),
15  ui(new Ui::OpenURIDialog)
16 {
17  ui->setupUi(this);
18 
20 }
21 
23 {
24  delete ui;
25 }
26 
28 {
29  return ui->uriEdit->text();
30 }
31 
33 {
35  if(GUIUtil::parseBitcoinURI(getURI(), &rcp))
36  {
37  /* Only accept value URIs */
38  QDialog::accept();
39  } else {
40  ui->uriEdit->setValid(false);
41  }
42 }
Ui::OpenURIDialog * ui
Definition: openuridialog.h:28
OpenURIDialog(QWidget *parent)
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
Definition: guiutil.cpp:114
void handleCloseWindowShortcut(QWidget *w)
Definition: guiutil.cpp:385
void accept() override
QString getURI()