1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +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) {
setText(m_webView->url().toEncoded());
qDebug(m_webView->url().toEncoded());
event->accept();
return;
}

View File

@ -94,7 +94,8 @@ ClickToFlash::ClickToFlash(const QUrl &pluginUrl, const QStringList &argumentNam
void ClickToFlash::customContextMenuRequested(const QPoint &pos)
{
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.addAction(tr("Add %1 to whitelist").arg(m_url.host()), this, SLOT(toWhitelist()));
menu.actions().at(0)->setEnabled(false);
@ -192,3 +193,26 @@ bool ClickToFlash::checkElement(QWebElement el)
}
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 <QAction>
#include <QMenu>
#include <QFormLayout>
class QWebElement;
class ClickToFlash : public QWidget
@ -70,6 +71,7 @@ private slots:
void findElement();
void hideAdBlocked();
void showInfo();
private:
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(loadStarted()), this, SLOT(loadingStarted()));
connect(this, SIGNAL(loadProgress(int)), this, SLOT(progress(int)));
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(finished()));
}
void WebPage::progress(int prog)
@ -54,6 +55,11 @@ void WebPage::progress(int prog)
}
}
void WebPage::finished()
{
progress(100);
}
void WebPage::loadingStarted()
{
m_adBlockedEntries.clear();

View File

@ -65,6 +65,7 @@ protected slots:
void handleUnsupportedContent(QNetworkReply* url);
void loadingStarted();
void progress(int prog);
void finished();
private:
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