aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoingui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r--src/qt/bitcoingui.cpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index e15bc6690a..c143411c76 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -744,12 +744,19 @@ void BitcoinGUI::dropEvent(QDropEvent *event)
{
if(event->mimeData()->hasUrls())
{
- gotoSendCoinsPage();
+ int nValidUrisFound = 0;
QList<QUrl> uris = event->mimeData()->urls();
foreach(const QUrl &uri, uris)
{
- sendCoinsPage->handleURI(uri.toString());
+ if (sendCoinsPage->handleURI(uri.toString()))
+ nValidUrisFound++;
}
+
+ // if valid URIs were found
+ if (nValidUrisFound)
+ gotoSendCoinsPage();
+ else
+ notificator->notify(Notificator::Warning, tr("URI handling"), tr("URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters."));
}
event->acceptProposedAction();
@@ -757,10 +764,14 @@ void BitcoinGUI::dropEvent(QDropEvent *event)
void BitcoinGUI::handleURI(QString strURI)
{
- gotoSendCoinsPage();
- sendCoinsPage->handleURI(strURI);
-
- showNormalIfMinimized();
+ // URI has to be valid
+ if (sendCoinsPage->handleURI(strURI))
+ {
+ showNormalIfMinimized();
+ gotoSendCoinsPage();
+ }
+ else
+ notificator->notify(Notificator::Warning, tr("URI handling"), tr("URI can not be parsed! This can be caused by an invalid Bitcoin address or malformed URI parameters."));
}
void BitcoinGUI::setEncryptionStatus(int status)