mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Fixed saving settings in plugins.
This commit is contained in:
parent
6560459418
commit
7c7c1787bc
@ -104,7 +104,7 @@ void AdBlockIcon::createMenu(QMenu* menu)
|
||||
}
|
||||
|
||||
menu->addSeparator();
|
||||
QList<WebPage::AdBlockedEntry> entries = p_QupZilla->weView()->webPage()->adBlockedEntries();
|
||||
QList<WebPage::AdBlockedEntry> entries = p_QupZilla->weView()->page()->adBlockedEntries();
|
||||
if (entries.isEmpty()) {
|
||||
menu->addAction(tr("No content blocked"))->setEnabled(false);
|
||||
}
|
||||
|
@ -1467,7 +1467,7 @@ void QupZilla::savePage()
|
||||
}
|
||||
|
||||
DownloadManager* dManager = mApp->downManager();
|
||||
dManager->download(request, weView()->webPage(), false, suggestedFileName);
|
||||
dManager->download(request, weView()->page(), false, suggestedFileName);
|
||||
}
|
||||
|
||||
void QupZilla::sendLink()
|
||||
@ -1746,7 +1746,7 @@ void QupZilla::disconnectObjects()
|
||||
foreach(WebTab * tab, m_tabWidget->allTabs()) {
|
||||
tab->disconnectObjects();
|
||||
tab->view()->disconnectObjects();
|
||||
tab->view()->webPage()->disconnectObjects();
|
||||
tab->view()->page()->disconnectObjects();
|
||||
}
|
||||
|
||||
foreach(const QWeakPointer<QWidget> &pointer, m_deleteOnCloseWidgets) {
|
||||
|
@ -372,7 +372,7 @@ QString QupZillaSchemeReply::configPage()
|
||||
}
|
||||
|
||||
QString page = cPage;
|
||||
page.replace("%USER-AGENT%", mApp->getWindow()->weView()->webPage()->userAgentForUrl(QUrl()));
|
||||
page.replace("%USER-AGENT%", mApp->getWindow()->weView()->page()->userAgentForUrl(QUrl()));
|
||||
|
||||
QString pluginsString;
|
||||
const QList<Plugins::Plugin> &availablePlugins = mApp->plugins()->getAvailablePlugins();
|
||||
|
@ -65,7 +65,7 @@ void AboutDialog::showAbout()
|
||||
m_aboutHtml += QString("<p>© %1 %2<br/>").arg(QupZilla::COPYRIGHT, QupZilla::AUTHOR);
|
||||
m_aboutHtml += tr("<small>Build time: %1 </small></p>").arg(QupZilla::BUILDTIME);
|
||||
m_aboutHtml += QString("<p><a href=%1>%1</a></p>").arg(QupZilla::WWWADDRESS);
|
||||
m_aboutHtml += "<p>" + mApp->getWindow()->weView()->webPage()->userAgentForUrl(QUrl()) + "</p>";
|
||||
m_aboutHtml += "<p>" + mApp->getWindow()->weView()->page()->userAgentForUrl(QUrl()) + "</p>";
|
||||
m_aboutHtml += "</div></center>";
|
||||
}
|
||||
ui->textBrowser->setHtml(m_aboutHtml);
|
||||
|
@ -30,7 +30,7 @@
|
||||
PopupWindow::PopupWindow(PopupWebView* view, bool showStatusBar)
|
||||
: QWidget()
|
||||
, m_view(view)
|
||||
, m_page(view->webPage())
|
||||
, m_page(qobject_cast<PopupWebPage*>(view->page()))
|
||||
{
|
||||
m_layout = new QVBoxLayout(this);
|
||||
m_layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
@ -40,7 +40,6 @@ TabbedWebView::TabbedWebView(QupZilla* mainClass, WebTab* webTab)
|
||||
: WebView(webTab)
|
||||
, p_QupZilla(mainClass)
|
||||
, m_tabWidget(p_QupZilla->tabWidget())
|
||||
, m_page(0)
|
||||
, m_webTab(webTab)
|
||||
, m_menu(new Menu(this))
|
||||
, m_mouseTrack(false)
|
||||
@ -68,21 +67,11 @@ TabbedWebView::TabbedWebView(QupZilla* mainClass, WebTab* webTab)
|
||||
|
||||
void TabbedWebView::setWebPage(WebPage* page)
|
||||
{
|
||||
if (m_page == page) {
|
||||
return;
|
||||
}
|
||||
page->setWebView(this);
|
||||
page->setParent(this);
|
||||
setPage(page);
|
||||
|
||||
if (m_page) {
|
||||
delete m_page;
|
||||
m_page = 0;
|
||||
}
|
||||
|
||||
m_page = page;
|
||||
m_page->setWebView(this);
|
||||
m_page->setParent(this);
|
||||
setPage(m_page);
|
||||
|
||||
connect(m_page, SIGNAL(linkHovered(QString, QString, QString)), this, SLOT(linkHovered(QString, QString, QString)));
|
||||
connect(page, SIGNAL(linkHovered(QString, QString, QString)), this, SLOT(linkHovered(QString, QString, QString)));
|
||||
}
|
||||
|
||||
void TabbedWebView::slotIconChanged()
|
||||
@ -104,11 +93,6 @@ void TabbedWebView::inspectElement()
|
||||
triggerPageAction(QWebPage::InspectElement);
|
||||
}
|
||||
|
||||
WebPage* TabbedWebView::webPage() const
|
||||
{
|
||||
return m_page;
|
||||
}
|
||||
|
||||
WebTab* TabbedWebView::webTab() const
|
||||
{
|
||||
return m_webTab;
|
||||
@ -234,7 +218,6 @@ void TabbedWebView::linkHovered(const QString &link, const QString &title, const
|
||||
p_QupZilla->statusBarMessage()->clearMessage();
|
||||
}
|
||||
}
|
||||
m_hoveredLink = link;
|
||||
}
|
||||
|
||||
int TabbedWebView::tabIndex() const
|
||||
|
@ -37,9 +37,8 @@ public:
|
||||
explicit TabbedWebView(QupZilla* mainClass, WebTab* webTab);
|
||||
~TabbedWebView();
|
||||
|
||||
void setWebPage(WebPage* page);
|
||||
void setWebPage(WebPage* pag);
|
||||
|
||||
WebPage* webPage() const;
|
||||
WebTab* webTab() const;
|
||||
TabWidget* tabWidget() const;
|
||||
|
||||
@ -93,10 +92,8 @@ private:
|
||||
QupZilla* p_QupZilla;
|
||||
TabWidget* m_tabWidget;
|
||||
|
||||
QString m_hoveredLink;
|
||||
QString m_currentIp;
|
||||
|
||||
WebPage* m_page;
|
||||
WebTab* m_webTab;
|
||||
Menu* m_menu;
|
||||
|
||||
|
@ -309,7 +309,7 @@ int TabWidget::addView(QNetworkRequest req, const QString &title, const Qz::NewT
|
||||
p_QupZilla->locationBar()->setFocus();
|
||||
}
|
||||
|
||||
if (openFlags & Qz::NT_SelectedTab) {
|
||||
if (openFlags & Qz::NT_SelectedTab || openFlags & Qz::NT_NotSelectedTab) {
|
||||
m_isClosingToLastTabIndex = true;
|
||||
}
|
||||
|
||||
@ -329,7 +329,7 @@ void TabWidget::closeTab(int index)
|
||||
}
|
||||
|
||||
TabbedWebView* webView = webTab->view();
|
||||
WebPage* webPage = webView->webPage();
|
||||
WebPage* webPage = webView->page();
|
||||
|
||||
if (count() == 1) {
|
||||
if (m_dontQuitWithOneTab) {
|
||||
@ -376,7 +376,7 @@ void TabWidget::currentTabChanged(int index)
|
||||
return;
|
||||
}
|
||||
|
||||
m_isClosingToLastTabIndex = false;
|
||||
m_isClosingToLastTabIndex = m_lastBackgroundTabIndex == index;
|
||||
m_lastBackgroundTabIndex = -1;
|
||||
|
||||
WebTab* webTab = weTab(index);
|
||||
|
@ -90,7 +90,7 @@ WebTab::WebTab(QupZilla* mainClass, LocationBar* locationBar)
|
||||
connect(m_view, SIGNAL(loadFinished(bool)), m_locationBar.data(), SLOT(siteIconChanged()));
|
||||
connect(m_view, SIGNAL(urlChanged(QUrl)), m_locationBar.data(), SLOT(showUrl(QUrl)));
|
||||
connect(m_view, SIGNAL(rssChanged(bool)), m_locationBar.data(), SLOT(showRSSIcon(bool)));
|
||||
connect(m_view->webPage(), SIGNAL(privacyChanged(bool)), m_locationBar.data(), SLOT(setPrivacy(bool)));
|
||||
connect(m_view, SIGNAL(privacyChanged(bool)), m_locationBar.data(), SLOT(setPrivacy(bool)));
|
||||
connect(m_locationBar.data(), SIGNAL(loadUrl(QUrl)), m_view, SLOT(load(QUrl)));
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,8 @@ void WebView::setPage(QWebPage* page)
|
||||
m_page = qobject_cast<WebPage*>(page);
|
||||
|
||||
setZoom(WebViewSettings::defaultZoom);
|
||||
connect(page, SIGNAL(saveFrameStateRequested(QWebFrame*, QWebHistoryItem*)), this, SLOT(frameStateChanged()));
|
||||
connect(m_page, SIGNAL(saveFrameStateRequested(QWebFrame*, QWebHistoryItem*)), this, SLOT(frameStateChanged()));
|
||||
connect(m_page, SIGNAL(privacyChanged(bool)), this, SIGNAL(privacyChanged(bool)));
|
||||
|
||||
mApp->plugins()->emitWebPageCreated(m_page);
|
||||
}
|
||||
|
@ -56,6 +56,7 @@ public:
|
||||
signals:
|
||||
void viewportResized(QSize);
|
||||
void showNotification(QWidget*);
|
||||
void privacyChanged(bool);
|
||||
|
||||
public slots:
|
||||
void zoomIn();
|
||||
|
@ -66,19 +66,19 @@ Qt::Key keyFromCode(int code)
|
||||
AKN_Handler::AKN_Handler(const QString &sPath, QObject* parent)
|
||||
: QObject(parent)
|
||||
, m_accessKeysVisible(false)
|
||||
, m_settingsPath(sPath)
|
||||
, m_settingsFile(sPath + "extensions.ini")
|
||||
{
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
QString AKN_Handler::settingsPath()
|
||||
QString AKN_Handler::settingsFile()
|
||||
{
|
||||
return m_settingsPath;
|
||||
return m_settingsFile;
|
||||
}
|
||||
|
||||
void AKN_Handler::loadSettings()
|
||||
{
|
||||
QSettings settings(m_settingsPath, QSettings::IniFormat);
|
||||
QSettings settings(m_settingsFile, QSettings::IniFormat);
|
||||
|
||||
settings.beginGroup("AccessKeysNavigation");
|
||||
m_key = keyFromCode(settings.value("Key", 0).toInt());
|
||||
|
@ -37,7 +37,7 @@ class AKN_Handler : public QObject
|
||||
public:
|
||||
explicit AKN_Handler(const QString &sPath, QObject* parent = 0);
|
||||
|
||||
QString settingsPath();
|
||||
QString settingsFile();
|
||||
void loadSettings();
|
||||
|
||||
bool handleKeyPress(QObject* obj, QKeyEvent* event);
|
||||
@ -66,7 +66,7 @@ private:
|
||||
Qt::Key m_key;
|
||||
bool m_isDoublePress;
|
||||
QTime m_lastKeyPressTime;
|
||||
QString m_settingsPath;
|
||||
QString m_settingsFile;
|
||||
};
|
||||
|
||||
#endif // AKN_HANDLER_H
|
||||
|
@ -28,7 +28,7 @@ AKN_Settings::AKN_Settings(AKN_Handler* handler, QWidget* parent)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::AKN_Settings)
|
||||
, m_handler(handler)
|
||||
, m_settingsFile(handler->settingsPath() + "extensions.ini")
|
||||
, m_settingsFile(handler->settingsFile())
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user