";
+// QMessageBox::critical(m_view, tr("Cannot start external viewer"), tr("Cannot start external viewer! %1").arg(info));
+// }
+}
+void OpenInMpv::actionSlot()
+{
+ const QUrl url = qobject_cast(sender())->data().toUrl();
+ work(url);
+}
+
+void OpenInMpv::actionIconSlot()
+{
+ WebView *view = m_icon->webView();
+ if (!view) {
+ return;
+ }
+
+ const QUrl pageUrl = view->url();
+ work(pageUrl);
+}
diff --git a/src/plugins/OpenInMpv/openinmpv.h b/src/plugins/OpenInMpv/openinmpv.h
new file mode 100644
index 00000000..1b4ab0d4
--- /dev/null
+++ b/src/plugins/OpenInMpv/openinmpv.h
@@ -0,0 +1,65 @@
+/* ============================================================
+* Falkon - Qt web browser
+* Copyright (C) 2010-2014 David Rosca
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see .
+* ============================================================ */
+#ifndef OPENINMPVPLUGIN_H
+#define OPENINMPVPLUGIN_H
+
+// Include plugininterface.h for your version of Falkon
+#include "plugininterface.h"
+
+#include
+#include
+#include
+#include
+
+class BrowserWindow;
+class OpenInMpvIcon;
+
+class OpenInMpv : public QObject, public PluginInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(PluginInterface)
+ Q_PLUGIN_METADATA(IID "Falkon.Browser.plugin.OpenInMpv")
+
+public:
+ explicit OpenInMpv();
+
+ DesktopFile metaData() const;
+ void init(InitState state, const QString &settingsPath) override;
+ void unload() override;
+ bool testPlugin() override;
+// void showSettings(QWidget *parent) override;
+
+ void populateWebViewMenu(QMenu *menu, WebView *view, const WebHitTestResult &r) override;
+// bool mousePress(Qz::ObjectName type, QObject *obj, QMouseEvent *event) override;
+
+public slots:
+ void mainWindowCreated(BrowserWindow *window);
+ void mainWindowDeleted(BrowserWindow *window);
+private Q_SLOTS:
+ void actionSlot();
+ void actionIconSlot();
+private:
+// QPointer m_settings;
+
+// WebView* m_view;
+ QString m_settingsPath;
+ OpenInMpvIcon* m_icon;
+ void work(const QUrl);
+};
+
+#endif // OPENINMPVPLUGIN_H
diff --git a/src/plugins/OpenInMpv/openinmpv.qrc b/src/plugins/OpenInMpv/openinmpv.qrc
new file mode 100644
index 00000000..7c448114
--- /dev/null
+++ b/src/plugins/OpenInMpv/openinmpv.qrc
@@ -0,0 +1,7 @@
+
+
+ metadata.desktop
+ data/icon-white.svg
+ data/icon.svg
+
+