Changeset View
Changeset View
Standalone View
Standalone View
src/qt/openuridialog.cpp
// Copyright (c) 2011-2014 The Bitcoin Core developers | // Copyright (c) 2011-2014 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include "openuridialog.h" | #include "openuridialog.h" | ||||
#include "ui_openuridialog.h" | #include "ui_openuridialog.h" | ||||
#include "guiutil.h" | #include "guiutil.h" | ||||
#include "walletmodel.h" | #include "walletmodel.h" | ||||
#include <QUrl> | #include <QUrl> | ||||
OpenURIDialog::OpenURIDialog(QWidget *parent) | OpenURIDialog::OpenURIDialog(const Config *cfg, QWidget *parent) | ||||
: QDialog(parent), ui(new Ui::OpenURIDialog) { | : QDialog(parent), ui(new Ui::OpenURIDialog), cfg(cfg) { | ||||
ui->setupUi(this); | ui->setupUi(this); | ||||
#if QT_VERSION >= 0x040700 | #if QT_VERSION >= 0x040700 | ||||
ui->uriEdit->setPlaceholderText(GUIUtil::URI_SCHEME + ":"); | ui->uriEdit->setPlaceholderText(GUIUtil::URI_SCHEME + ":"); | ||||
#endif | #endif | ||||
} | } | ||||
OpenURIDialog::~OpenURIDialog() { | OpenURIDialog::~OpenURIDialog() { | ||||
delete ui; | delete ui; | ||||
Show All 13 Lines | void OpenURIDialog::accept() { | ||||
} | } | ||||
} | } | ||||
void OpenURIDialog::on_selectFileButton_clicked() { | void OpenURIDialog::on_selectFileButton_clicked() { | ||||
QString filename = GUIUtil::getOpenFileName( | QString filename = GUIUtil::getOpenFileName( | ||||
this, tr("Select payment request file to open"), "", "", nullptr); | this, tr("Select payment request file to open"), "", "", nullptr); | ||||
if (filename.isEmpty()) return; | if (filename.isEmpty()) return; | ||||
QUrl fileUri = QUrl::fromLocalFile(filename); | QUrl fileUri = QUrl::fromLocalFile(filename); | ||||
ui->uriEdit->setText(GUIUtil::URI_SCHEME + | ui->uriEdit->setText(GUIUtil::URI_SCHEME + ":?r=" + | ||||
":?r=" + QUrl::toPercentEncoding(fileUri.toString())); | QUrl::toPercentEncoding(fileUri.toString())); | ||||
} | } |