From 0bcec49b8211ad55d8c23b6867c43a4c8a6c55c8 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Mon, 29 Sep 2014 17:04:36 +0200 Subject: [PATCH] Prompt when installing a resolver from file. --- src/libtomahawk/GlobalActionManager.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/libtomahawk/GlobalActionManager.cpp b/src/libtomahawk/GlobalActionManager.cpp index f986451fa..fcd014673 100644 --- a/src/libtomahawk/GlobalActionManager.cpp +++ b/src/libtomahawk/GlobalActionManager.cpp @@ -57,6 +57,7 @@ #include #include +#include #include @@ -190,6 +191,22 @@ GlobalActionManager::installResolverFromFile( const QString& resolverPath ) return; } + int result = QMessageBox::question( JobStatusView::instance(), + tr( "Install plug-in" ), + tr( "%1 %2
" + "by %3

" + "You are attempting to install a Tomahawk " + "plug-in from an unknown source. Plug-ins from " + "untrusted sources may put your data at risk.
" + "Do you want to install this plug-in?" ) + .arg( acct->accountFriendlyName() ) + .arg( acct->version() ) + .arg( acct->author() ), + QMessageBox::Yes, + QMessageBox::No ); + if ( result != QMessageBox::Yes ) + return; + Accounts::AccountManager::instance()->addAccount( acct ); TomahawkSettings::instance()->addAccount( acct->accountId() ); Accounts::AccountManager::instance()->enableAccount( acct );