Bitcoin Core  21.99.0
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, GUIUtil::dialog_flags),
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 }
OpenURIDialog
Definition: openuridialog.h:14
OpenURIDialog::~OpenURIDialog
~OpenURIDialog()
Definition: openuridialog.cpp:22
OpenURIDialog::OpenURIDialog
OpenURIDialog(QWidget *parent)
Definition: openuridialog.cpp:13
GUIUtil
Utility functions used by the Bitcoin Qt UI.
Definition: bitcoingui.h:59
GUIUtil::parseBitcoinURI
bool parseBitcoinURI(const QUrl &uri, SendCoinsRecipient *out)
Definition: guiutil.cpp:131
GUIUtil::dialog_flags
constexpr auto dialog_flags
Definition: guiutil.h:59
SendCoinsRecipient
Definition: sendcoinsrecipient.h:19
OpenURIDialog::ui
Ui::OpenURIDialog * ui
Definition: openuridialog.h:28
guiutil.h
OpenURIDialog::accept
void accept() override
Definition: openuridialog.cpp:32
Ui
Definition: addressbookpage.h:14
OpenURIDialog::getURI
QString getURI()
Definition: openuridialog.cpp:27
GUIUtil::handleCloseWindowShortcut
void handleCloseWindowShortcut(QWidget *w)
Definition: guiutil.cpp:402
openuridialog.h
sendcoinsrecipient.h