Bitcoin Core  0.19.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 }
19 
21 {
22  delete ui;
23 }
24 
26 {
27  return ui->uriEdit->text();
28 }
29 
31 {
33  if(GUIUtil::parseBitcoinURI(getURI(), &rcp))
34  {
35  /* Only accept value URIs */
36  QDialog::accept();
37  } else {
38  ui->uriEdit->setValid(false);
39  }
40 }
Ui::OpenURIDialog * ui
Definition: openuridialog.h:28
OpenURIDialog(QWidget *parent)
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
Definition: guiutil.cpp:117
QString getURI()