1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-14 02:52:12 +01:00

New option in ClickToFlash plugin to show detailed informations about

flash object.
This commit is contained in:
nowrep 2011-07-11 22:53:32 +02:00
parent a63dc4c317
commit ff4314db25
8 changed files with 427 additions and 353 deletions

Binary file not shown.

View File

@ -262,6 +262,7 @@ void LocationBar::keyPressEvent(QKeyEvent *event)
{ {
if (event->key() == Qt::Key_Escape) { if (event->key() == Qt::Key_Escape) {
setText(m_webView->url().toEncoded()); setText(m_webView->url().toEncoded());
qDebug(m_webView->url().toEncoded());
event->accept(); event->accept();
return; return;
} }

View File

@ -94,7 +94,8 @@ ClickToFlash::ClickToFlash(const QUrl &pluginUrl, const QStringList &argumentNam
void ClickToFlash::customContextMenuRequested(const QPoint &pos) void ClickToFlash::customContextMenuRequested(const QPoint &pos)
{ {
QMenu menu; QMenu menu;
menu.addAction(tr("Flash blocked by ClickToFlash")); menu.addAction(tr("Object blocked by ClickToFlash"));
menu.addAction(tr("Show more informations about object"), this, SLOT(showInfo()));
menu.addSeparator(); menu.addSeparator();
menu.addAction(tr("Add %1 to whitelist").arg(m_url.host()), this, SLOT(toWhitelist())); menu.addAction(tr("Add %1 to whitelist").arg(m_url.host()), this, SLOT(toWhitelist()));
menu.actions().at(0)->setEnabled(false); menu.actions().at(0)->setEnabled(false);
@ -192,3 +193,26 @@ bool ClickToFlash::checkElement(QWebElement el)
} }
return false; return false;
} }
void ClickToFlash::showInfo()
{
QWidget* widg = new QWidget();
widg->setAttribute(Qt::WA_DeleteOnClose);
widg->setWindowTitle(tr("Flash Object"));
QFormLayout* lay = new QFormLayout(widg);
lay->addRow(new QLabel(tr("<b>Attribute Name</b>")), new QLabel(tr("<b>Value</b>")));
int i = 0;
foreach (QString name, m_argumentNames) {
QString value = m_argumentValues.at(i);
lay->addRow(new QLabel(name), new QLabel(value));
i++;
}
if (i == 0)
lay->addRow(new QLabel(tr("No more informations available.")));
widg->show();
}

View File

@ -54,6 +54,7 @@
#include <QFrame> #include <QFrame>
#include <QAction> #include <QAction>
#include <QMenu> #include <QMenu>
#include <QFormLayout>
class QWebElement; class QWebElement;
class ClickToFlash : public QWidget class ClickToFlash : public QWidget
@ -70,6 +71,7 @@ private slots:
void findElement(); void findElement();
void hideAdBlocked(); void hideAdBlocked();
void showInfo();
private: private:
bool checkElement(QWebElement el); bool checkElement(QWebElement el);

View File

@ -41,6 +41,7 @@ WebPage::WebPage(WebView* parent, QupZilla* mainClass)
connect(this, SIGNAL(unsupportedContent(QNetworkReply*)), SLOT(handleUnsupportedContent(QNetworkReply*))); connect(this, SIGNAL(unsupportedContent(QNetworkReply*)), SLOT(handleUnsupportedContent(QNetworkReply*)));
connect(this, SIGNAL(loadStarted()), this, SLOT(loadingStarted())); connect(this, SIGNAL(loadStarted()), this, SLOT(loadingStarted()));
connect(this, SIGNAL(loadProgress(int)), this, SLOT(progress(int))); connect(this, SIGNAL(loadProgress(int)), this, SLOT(progress(int)));
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(finished()));
} }
void WebPage::progress(int prog) void WebPage::progress(int prog)
@ -54,6 +55,11 @@ void WebPage::progress(int prog)
} }
} }
void WebPage::finished()
{
progress(100);
}
void WebPage::loadingStarted() void WebPage::loadingStarted()
{ {
m_adBlockedEntries.clear(); m_adBlockedEntries.clear();

View File

@ -65,6 +65,7 @@ protected slots:
void handleUnsupportedContent(QNetworkReply* url); void handleUnsupportedContent(QNetworkReply* url);
void loadingStarted(); void loadingStarted();
void progress(int prog); void progress(int prog);
void finished();
private: private:
virtual bool supportsExtension(Extension extension) const { return (extension == ErrorPageExtension); } virtual bool supportsExtension(Extension extension) const { return (extension == ErrorPageExtension); }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff