mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
Updated code model
This commit is contained in:
parent
c44d844c87
commit
d9d8506536
3
src/3rdparty/qtwin.cpp
vendored
3
src/3rdparty/qtwin.cpp
vendored
@ -109,6 +109,7 @@ static bool resolveLibs()
|
|||||||
*/
|
*/
|
||||||
bool QtWin::isRunningWindows7()
|
bool QtWin::isRunningWindows7()
|
||||||
{
|
{
|
||||||
|
#ifdef Q_WS_WIN
|
||||||
OSVERSIONINFO osvi;
|
OSVERSIONINFO osvi;
|
||||||
|
|
||||||
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
|
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
|
||||||
@ -117,6 +118,8 @@ bool QtWin::isRunningWindows7()
|
|||||||
GetVersionEx(&osvi);
|
GetVersionEx(&osvi);
|
||||||
|
|
||||||
return ( (osvi.dwMajorVersion > 6) || ( (osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion >= 1) ));
|
return ( (osvi.dwMajorVersion > 6) || ( (osvi.dwMajorVersion == 6) && (osvi.dwMinorVersion >= 1) ));
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -256,6 +256,8 @@ void QupZilla::setupMenu()
|
|||||||
m_menuView->addAction(QIcon::fromTheme("zoom-in"), tr("Zoom In"), this, SLOT(zoomIn()))->setShortcut(QKeySequence("Ctrl++"));
|
m_menuView->addAction(QIcon::fromTheme("zoom-in"), tr("Zoom In"), this, SLOT(zoomIn()))->setShortcut(QKeySequence("Ctrl++"));
|
||||||
m_menuView->addAction(QIcon::fromTheme("zoom-out"), tr("Zoom Out"), this, SLOT(zoomOut()))->setShortcut(QKeySequence("Ctrl+-"));
|
m_menuView->addAction(QIcon::fromTheme("zoom-out"), tr("Zoom Out"), this, SLOT(zoomOut()))->setShortcut(QKeySequence("Ctrl+-"));
|
||||||
m_menuView->addAction(QIcon::fromTheme("zoom-original"), tr("Reset"), this, SLOT(zoomReset()))->setShortcut(QKeySequence("Ctrl+0"));
|
m_menuView->addAction(QIcon::fromTheme("zoom-original"), tr("Reset"), this, SLOT(zoomReset()))->setShortcut(QKeySequence("Ctrl+0"));
|
||||||
|
m_menuView->addSeparator();
|
||||||
|
|
||||||
m_menuView->addSeparator();
|
m_menuView->addSeparator();
|
||||||
m_menuView->addAction(QIcon::fromTheme("text-html"), tr("Page Source"), this, SLOT(showSource()))->setShortcut(QKeySequence("Ctrl+U"));
|
m_menuView->addAction(QIcon::fromTheme("text-html"), tr("Page Source"), this, SLOT(showSource()))->setShortcut(QKeySequence("Ctrl+U"));
|
||||||
m_menuView->addAction(m_actionShowFullScreen);
|
m_menuView->addAction(m_actionShowFullScreen);
|
||||||
@ -282,7 +284,7 @@ void QupZilla::setupMenu()
|
|||||||
|
|
||||||
//Make shortcuts available even in fullscreen (menu hidden)
|
//Make shortcuts available even in fullscreen (menu hidden)
|
||||||
QList<QAction*> actions = menuBar()->actions();
|
QList<QAction*> actions = menuBar()->actions();
|
||||||
foreach (QAction *action, actions) {
|
foreach (QAction* action, actions) {
|
||||||
if (action->menu())
|
if (action->menu())
|
||||||
actions += action->menu()->actions();
|
actions += action->menu()->actions();
|
||||||
addAction(action);
|
addAction(action);
|
||||||
|
@ -18,13 +18,13 @@
|
|||||||
#include "autosaver.h"
|
#include "autosaver.h"
|
||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
|
|
||||||
AutoSaver::AutoSaver(QObject *parent) :
|
AutoSaver::AutoSaver(QObject* parent) :
|
||||||
QObject(parent)
|
QObject(parent)
|
||||||
{
|
{
|
||||||
m_timer.start(1000*5, this);
|
m_timer.start(1000*5, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoSaver::timerEvent(QTimerEvent *event)
|
void AutoSaver::timerEvent(QTimerEvent* event)
|
||||||
{
|
{
|
||||||
if (event->timerId() == m_timer.timerId() && mApp->isChanged())
|
if (event->timerId() == m_timer.timerId() && mApp->isChanged())
|
||||||
emit saveApp();
|
emit saveApp();
|
||||||
|
@ -36,7 +36,7 @@ class AutoSaver : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit AutoSaver(QObject *parent = 0);
|
explicit AutoSaver(QObject* parent = 0);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void saveApp();
|
void saveApp();
|
||||||
@ -44,7 +44,7 @@ signals:
|
|||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void timerEvent(QTimerEvent *);
|
void timerEvent(QTimerEvent* event);
|
||||||
QBasicTimer m_timer;
|
QBasicTimer m_timer;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -403,7 +403,7 @@ AutoFillModel* MainApplication::autoFill()
|
|||||||
return m_autofill;
|
return m_autofill;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainApplication::aboutToCloseWindow(QupZilla *window)
|
void MainApplication::aboutToCloseWindow(QupZilla* window)
|
||||||
{
|
{
|
||||||
if (!window)
|
if (!window)
|
||||||
return;
|
return;
|
||||||
@ -452,7 +452,7 @@ bool MainApplication::saveStateSlot()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MainApplication::restoreStateSlot(QupZilla *window)
|
bool MainApplication::restoreStateSlot(QupZilla* window)
|
||||||
{
|
{
|
||||||
QSettings settings(m_activeProfil+"settings.ini", QSettings::IniFormat);
|
QSettings settings(m_activeProfil+"settings.ini", QSettings::IniFormat);
|
||||||
settings.beginGroup("SessionRestore");
|
settings.beginGroup("SessionRestore");
|
||||||
|
@ -192,7 +192,7 @@ void QupZilla::refreshHistory(int index)
|
|||||||
|
|
||||||
void QupZilla::goAtHistoryIndex()
|
void QupZilla::goAtHistoryIndex()
|
||||||
{
|
{
|
||||||
if (QAction *action = qobject_cast<QAction*>(sender())) {
|
if (QAction* action = qobject_cast<QAction*>(sender())) {
|
||||||
weView()->page()->history()->goToItem(weView()->page()->history()->itemAt(action->data().toInt()));
|
weView()->page()->history()->goToItem(weView()->page()->history()->itemAt(action->data().toInt()));
|
||||||
}
|
}
|
||||||
refreshHistory();
|
refreshHistory();
|
||||||
@ -407,7 +407,7 @@ void QupZilla::bookmarkAllTabs()
|
|||||||
|
|
||||||
void QupZilla::loadActionUrl()
|
void QupZilla::loadActionUrl()
|
||||||
{
|
{
|
||||||
if (QAction *action = qobject_cast<QAction*>(sender())) {
|
if (QAction* action = qobject_cast<QAction*>(sender())) {
|
||||||
loadAddress(action->data().toUrl());
|
loadAddress(action->data().toUrl());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -204,6 +204,7 @@ private:
|
|||||||
QMenu* m_menuHistory;
|
QMenu* m_menuHistory;
|
||||||
QMenu* m_menuBack;
|
QMenu* m_menuBack;
|
||||||
QMenu* m_menuForward;
|
QMenu* m_menuForward;
|
||||||
|
QMenu* m_menuEncoding;
|
||||||
QAction* m_actionShowToolbar;
|
QAction* m_actionShowToolbar;
|
||||||
QAction* m_actionShowBookmarksToolbar;
|
QAction* m_actionShowBookmarksToolbar;
|
||||||
QAction* m_actionShowStatusbar;
|
QAction* m_actionShowStatusbar;
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
#include "autofillnotification.h"
|
#include "autofillnotification.h"
|
||||||
|
|
||||||
AutoFillModel::AutoFillModel(QupZilla* mainClass, QObject *parent) :
|
AutoFillModel::AutoFillModel(QupZilla* mainClass, QObject* parent) :
|
||||||
QObject(parent)
|
QObject(parent)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
,m_isStoring(false)
|
,m_isStoring(false)
|
||||||
|
@ -32,7 +32,7 @@ class AutoFillModel : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit AutoFillModel(QupZilla* mainClass, QObject *parent = 0);
|
explicit AutoFillModel(QupZilla* mainClass, QObject* parent = 0);
|
||||||
void completePage(WebView* view);
|
void completePage(WebView* view);
|
||||||
|
|
||||||
bool isStored(const QUrl &url);
|
bool isStored(const QUrl &url);
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
#include "notification.h"
|
#include "notification.h"
|
||||||
|
|
||||||
AutoFillNotification::AutoFillNotification(QUrl url, QByteArray data, QString pass, QWidget *parent)
|
AutoFillNotification::AutoFillNotification(QUrl url, QByteArray data, QString pass, QWidget* parent)
|
||||||
:Notification(parent)
|
:Notification(parent)
|
||||||
,ui(new Ui::AutoFillWidget)
|
,ui(new Ui::AutoFillWidget)
|
||||||
,m_url(url)
|
,m_url(url)
|
||||||
|
@ -34,7 +34,7 @@ class AutoFillNotification : public Notification
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AutoFillNotification(QUrl url, QByteArray data, QString pass, QWidget *parent = 0);
|
explicit AutoFillNotification(QUrl url, QByteArray data, QString pass, QWidget* parent = 0);
|
||||||
~AutoFillNotification();
|
~AutoFillNotification();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -42,7 +42,7 @@ private slots:
|
|||||||
void never();
|
void never();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AutoFillWidget *ui;
|
Ui::AutoFillWidget* ui;
|
||||||
QUrl m_url;
|
QUrl m_url;
|
||||||
QByteArray m_data;
|
QByteArray m_data;
|
||||||
QString m_pass;
|
QString m_pass;
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
//Won't be bad idea to rewrite bookmarks access via bookmarksmodel
|
//Won't be bad idea to rewrite bookmarks access via bookmarksmodel
|
||||||
|
|
||||||
BookmarksManager::BookmarksManager(QupZilla* mainClass, QWidget *parent) :
|
BookmarksManager::BookmarksManager(QupZilla* mainClass, QWidget* parent) :
|
||||||
QWidget(parent)
|
QWidget(parent)
|
||||||
,m_isRefreshing(false)
|
,m_isRefreshing(false)
|
||||||
,ui(new Ui::BookmarksManager)
|
,ui(new Ui::BookmarksManager)
|
||||||
@ -56,7 +56,7 @@ QupZilla* BookmarksManager::getQupZilla()
|
|||||||
return p_QupZilla;
|
return p_QupZilla;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BookmarksManager::setMainWindow(QupZilla *window)
|
void BookmarksManager::setMainWindow(QupZilla* window)
|
||||||
{
|
{
|
||||||
if (window)
|
if (window)
|
||||||
p_QupZilla = window;
|
p_QupZilla = window;
|
||||||
@ -72,7 +72,7 @@ void BookmarksManager::addFolder()
|
|||||||
refreshTable();
|
refreshTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BookmarksManager::itemChanged(QTreeWidgetItem *item)
|
void BookmarksManager::itemChanged(QTreeWidgetItem* item)
|
||||||
{
|
{
|
||||||
if (!item || m_isRefreshing)
|
if (!item || m_isRefreshing)
|
||||||
return;
|
return;
|
||||||
@ -84,7 +84,7 @@ void BookmarksManager::itemChanged(QTreeWidgetItem *item)
|
|||||||
m_bookmarksModel->editBookmark(id, url, name);
|
m_bookmarksModel->editBookmark(id, url, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BookmarksManager::itemControlClicked(QTreeWidgetItem *item)
|
void BookmarksManager::itemControlClicked(QTreeWidgetItem* item)
|
||||||
{
|
{
|
||||||
if (!item || item->text(1).isEmpty())
|
if (!item || item->text(1).isEmpty())
|
||||||
return;
|
return;
|
||||||
@ -93,7 +93,7 @@ void BookmarksManager::itemControlClicked(QTreeWidgetItem *item)
|
|||||||
|
|
||||||
void BookmarksManager::loadInNewTab()
|
void BookmarksManager::loadInNewTab()
|
||||||
{
|
{
|
||||||
if (QAction *action = qobject_cast<QAction*>(sender()))
|
if (QAction* action = qobject_cast<QAction*>(sender()))
|
||||||
getQupZilla()->tabWidget()->addView(action->data().toUrl(), tr("New Tab"), TabWidget::NewNotSelectedTab);
|
getQupZilla()->tabWidget()->addView(action->data().toUrl(), tr("New Tab"), TabWidget::NewNotSelectedTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ void BookmarksManager::deleteItem()
|
|||||||
getQupZilla()->bookmarksToolbar()->refreshBookmarks();
|
getQupZilla()->bookmarksToolbar()->refreshBookmarks();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BookmarksManager::addBookmark(WebView *view)
|
void BookmarksManager::addBookmark(WebView* view)
|
||||||
{
|
{
|
||||||
insertBookmark(view->url(), view->title());
|
insertBookmark(view->url(), view->title());
|
||||||
}
|
}
|
||||||
@ -132,7 +132,7 @@ void BookmarksManager::moveBookmark()
|
|||||||
QTreeWidgetItem* item = ui->bookmarksTree->currentItem();
|
QTreeWidgetItem* item = ui->bookmarksTree->currentItem();
|
||||||
if (!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
if (QAction *action = qobject_cast<QAction*>(sender())) {
|
if (QAction* action = qobject_cast<QAction*>(sender())) {
|
||||||
m_bookmarksModel->editBookmark(item->whatsThis(1).toInt(), item->text(0), action->data().toString());
|
m_bookmarksModel->editBookmark(item->whatsThis(1).toInt(), item->text(0), action->data().toString());
|
||||||
}
|
}
|
||||||
refreshTable();
|
refreshTable();
|
||||||
|
@ -39,7 +39,7 @@ class BookmarksManager : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit BookmarksManager(QupZilla* mainClass, QWidget *parent = 0);
|
explicit BookmarksManager(QupZilla* mainClass, QWidget* parent = 0);
|
||||||
~BookmarksManager();
|
~BookmarksManager();
|
||||||
void addBookmark(WebView* view);
|
void addBookmark(WebView* view);
|
||||||
void insertBookmark(const QUrl &url, const QString &title);
|
void insertBookmark(const QUrl &url, const QString &title);
|
||||||
@ -62,7 +62,7 @@ private:
|
|||||||
QupZilla* getQupZilla();
|
QupZilla* getQupZilla();
|
||||||
|
|
||||||
bool m_isRefreshing;
|
bool m_isRefreshing;
|
||||||
Ui::BookmarksManager *ui;
|
Ui::BookmarksManager* ui;
|
||||||
QPointer<QupZilla> p_QupZilla;
|
QPointer<QupZilla> p_QupZilla;
|
||||||
BookmarksModel* m_bookmarksModel;
|
BookmarksModel* m_bookmarksModel;
|
||||||
};
|
};
|
||||||
|
@ -123,7 +123,7 @@ bool BookmarksModel::saveBookmark(QUrl url, QString title, QString folder)
|
|||||||
return query.exec();
|
return query.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BookmarksModel::saveBookmark(WebView *view, QString folder)
|
bool BookmarksModel::saveBookmark(WebView* view, QString folder)
|
||||||
{
|
{
|
||||||
return saveBookmark(view->url(), view->title(), folder);
|
return saveBookmark(view->url(), view->title(), folder);
|
||||||
}
|
}
|
||||||
@ -141,7 +141,7 @@ bool BookmarksModel::removeBookmark(QUrl url)
|
|||||||
return removeBookmark(bookmarkId(url));
|
return removeBookmark(bookmarkId(url));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BookmarksModel::removeBookmark(WebView *view)
|
bool BookmarksModel::removeBookmark(WebView* view)
|
||||||
{
|
{
|
||||||
return removeBookmark(bookmarkId(view->url()));
|
return removeBookmark(bookmarkId(view->url()));
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "locationbar.h"
|
#include "locationbar.h"
|
||||||
#include "bookmarksmodel.h"
|
#include "bookmarksmodel.h"
|
||||||
|
|
||||||
BookmarksToolbar::BookmarksToolbar(QupZilla* mainClass, QWidget *parent) :
|
BookmarksToolbar::BookmarksToolbar(QupZilla* mainClass, QWidget* parent) :
|
||||||
QToolBar(parent)
|
QToolBar(parent)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
,m_bookmarksModel(0)
|
,m_bookmarksModel(0)
|
||||||
|
@ -33,7 +33,7 @@ class BookmarksToolbar : public QToolBar
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit BookmarksToolbar(QupZilla* mainClass, QWidget *parent = 0);
|
explicit BookmarksToolbar(QupZilla* mainClass, QWidget* parent = 0);
|
||||||
void setColor(QColor color);
|
void setColor(QColor color);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "bookmarksmodel.h"
|
#include "bookmarksmodel.h"
|
||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
|
|
||||||
BookmarksWidget::BookmarksWidget(int bookmarkId, QWidget *parent) :
|
BookmarksWidget::BookmarksWidget(int bookmarkId, QWidget* parent) :
|
||||||
QMenu(parent)
|
QMenu(parent)
|
||||||
,ui(new Ui::BookmarksWidget)
|
,ui(new Ui::BookmarksWidget)
|
||||||
,m_bookmarkId(bookmarkId)
|
,m_bookmarkId(bookmarkId)
|
||||||
|
@ -41,7 +41,7 @@ class BookmarksWidget : public QMenu
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit BookmarksWidget(int bookmarkId, QWidget *parent = 0);
|
explicit BookmarksWidget(int bookmarkId, QWidget* parent = 0);
|
||||||
~BookmarksWidget();
|
~BookmarksWidget();
|
||||||
void showAt(QWidget* _parent);
|
void showAt(QWidget* _parent);
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#define COOKIE_DEBUG
|
#define COOKIE_DEBUG
|
||||||
|
|
||||||
//TODO: black/white listing
|
//TODO: black/white listing
|
||||||
CookieJar::CookieJar(QupZilla* mainClass, QObject *parent) :
|
CookieJar::CookieJar(QupZilla* mainClass, QObject* parent) :
|
||||||
QNetworkCookieJar(parent)
|
QNetworkCookieJar(parent)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ class CookieJar : public QNetworkCookieJar
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit CookieJar(QupZilla* mainClass, QObject *parent = 0);
|
explicit CookieJar(QupZilla* mainClass, QObject* parent = 0);
|
||||||
|
|
||||||
void loadSettings();
|
void loadSettings();
|
||||||
bool setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const QUrl &url);
|
bool setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const QUrl &url);
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "cookiejar.h"
|
#include "cookiejar.h"
|
||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
|
|
||||||
CookieManager::CookieManager(QWidget *parent) :
|
CookieManager::CookieManager(QWidget* parent) :
|
||||||
QWidget(parent)
|
QWidget(parent)
|
||||||
,ui(new Ui::CookieManager)
|
,ui(new Ui::CookieManager)
|
||||||
{
|
{
|
||||||
@ -83,7 +83,7 @@ void CookieManager::removeCookie()
|
|||||||
search();
|
search();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CookieManager::currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *parent)
|
void CookieManager::currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* parent)
|
||||||
{
|
{
|
||||||
Q_UNUSED(parent);
|
Q_UNUSED(parent);
|
||||||
if (!current)
|
if (!current)
|
||||||
|
@ -37,7 +37,7 @@ class CookieManager : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CookieManager(QWidget *parent = 0);
|
explicit CookieManager(QWidget* parent = 0);
|
||||||
~CookieManager();
|
~CookieManager();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
@ -50,7 +50,7 @@ private slots:
|
|||||||
void search();
|
void search();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::CookieManager *ui;
|
Ui::CookieManager* ui;
|
||||||
|
|
||||||
QList<QNetworkCookie> m_cookies;
|
QList<QNetworkCookie> m_cookies;
|
||||||
};
|
};
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "downloaditem.h"
|
#include "downloaditem.h"
|
||||||
#include "ui_downloaditem.h"
|
#include "ui_downloaditem.h"
|
||||||
|
|
||||||
DownloadItem::DownloadItem(QListWidgetItem *item, QNetworkReply *reply, QString path, QString fileName, QPixmap fileIcon, QWidget *parent)
|
DownloadItem::DownloadItem(QListWidgetItem* item, QNetworkReply* reply, QString path, QString fileName, QPixmap fileIcon, QWidget* parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
,ui(new Ui::DownloadItem)
|
,ui(new Ui::DownloadItem)
|
||||||
,m_item(item)
|
,m_item(item)
|
||||||
@ -98,7 +98,7 @@ void DownloadItem::downloadProgress(qint64 received, qint64 total)
|
|||||||
m_total = total;
|
m_total = total;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DownloadItem::timerEvent(QTimerEvent *event)
|
void DownloadItem::timerEvent(QTimerEvent* event)
|
||||||
{
|
{
|
||||||
if (event->timerId() == m_timer.timerId()) {
|
if (event->timerId() == m_timer.timerId()) {
|
||||||
updateDownloadInfo(m_currSpeed, m_received, m_total);
|
updateDownloadInfo(m_currSpeed, m_received, m_total);
|
||||||
@ -189,7 +189,7 @@ void DownloadItem::stop()
|
|||||||
m_downloading = false;
|
m_downloading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DownloadItem::mouseDoubleClickEvent(QMouseEvent *e)
|
void DownloadItem::mouseDoubleClickEvent(QMouseEvent* e)
|
||||||
{
|
{
|
||||||
openFile();
|
openFile();
|
||||||
e->accept();
|
e->accept();
|
||||||
|
@ -42,7 +42,7 @@ class DownloadItem : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DownloadItem(QListWidgetItem* item, QNetworkReply* reply ,QString path, QString fileName, QPixmap fileIcon, QWidget *parent = 0);
|
explicit DownloadItem(QListWidgetItem* item, QNetworkReply* reply ,QString path, QString fileName, QPixmap fileIcon, QWidget* parent = 0);
|
||||||
bool isDownloading() { return m_downloading; }
|
bool isDownloading() { return m_downloading; }
|
||||||
bool isCancelled();
|
bool isCancelled();
|
||||||
QTime remainingTime() { return m_remTime; }
|
QTime remainingTime() { return m_remTime; }
|
||||||
@ -70,10 +70,10 @@ private slots:
|
|||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void timerEvent(QTimerEvent *event);
|
void timerEvent(QTimerEvent* event);
|
||||||
void updateDownloadInfo(double currSpeed, qint64 received, qint64 total);
|
void updateDownloadInfo(double currSpeed, qint64 received, qint64 total);
|
||||||
void mouseDoubleClickEvent(QMouseEvent *e);
|
void mouseDoubleClickEvent(QMouseEvent* e);
|
||||||
Ui::DownloadItem *ui;
|
Ui::DownloadItem* ui;
|
||||||
|
|
||||||
QListWidgetItem* m_item;
|
QListWidgetItem* m_item;
|
||||||
QNetworkReply* m_reply;
|
QNetworkReply* m_reply;
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include "downloaditem.h"
|
#include "downloaditem.h"
|
||||||
#include "ecwin7.h"
|
#include "ecwin7.h"
|
||||||
|
|
||||||
DownloadManager::DownloadManager(QWidget *parent) :
|
DownloadManager::DownloadManager(QWidget* parent) :
|
||||||
QWidget(parent)
|
QWidget(parent)
|
||||||
,ui(new Ui::DownloadManager)
|
,ui(new Ui::DownloadManager)
|
||||||
,m_isClosing(false)
|
,m_isClosing(false)
|
||||||
@ -51,13 +51,13 @@ DownloadManager::DownloadManager(QWidget *parent) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef W7TASKBAR
|
#ifdef W7TASKBAR
|
||||||
bool DownloadManager::winEvent(MSG *message, long *result)
|
bool DownloadManager::winEvent(MSG* message, long* result)
|
||||||
{
|
{
|
||||||
return win7.winEvent(message, result);
|
return win7.winEvent(message, result);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void DownloadManager::timerEvent(QTimerEvent *event)
|
void DownloadManager::timerEvent(QTimerEvent* event)
|
||||||
{
|
{
|
||||||
QList<QTime> remTimes;
|
QList<QTime> remTimes;
|
||||||
QList<int> progresses;
|
QList<int> progresses;
|
||||||
@ -133,7 +133,7 @@ void DownloadManager::download(const QNetworkRequest &request)
|
|||||||
handleUnsupportedContent(m_networkManager->get(request));
|
handleUnsupportedContent(m_networkManager->get(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
void DownloadManager::handleUnsupportedContent(QNetworkReply *reply)
|
void DownloadManager::handleUnsupportedContent(QNetworkReply* reply)
|
||||||
{
|
{
|
||||||
// DownloadOptionsDialog* dialog = new DownloadOptionsDialog();
|
// DownloadOptionsDialog* dialog = new DownloadOptionsDialog();
|
||||||
// dialog->show();
|
// dialog->show();
|
||||||
@ -184,13 +184,13 @@ void DownloadManager::handleUnsupportedContent(QNetworkReply *reply)
|
|||||||
activateWindow();
|
activateWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DownloadManager::deleteItem(DownloadItem *item)
|
void DownloadManager::deleteItem(DownloadItem* item)
|
||||||
{
|
{
|
||||||
if (item && !item->isDownloading())
|
if (item && !item->isDownloading())
|
||||||
delete item;
|
delete item;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DownloadManager::getFileName(QNetworkReply *reply)
|
QString DownloadManager::getFileName(QNetworkReply* reply)
|
||||||
{
|
{
|
||||||
QString path;
|
QString path;
|
||||||
if (reply->hasRawHeader("Content-Disposition")) {
|
if (reply->hasRawHeader("Content-Disposition")) {
|
||||||
@ -239,7 +239,7 @@ bool DownloadManager::canClose()
|
|||||||
return !isDownloading;
|
return !isDownloading;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DownloadManager::closeEvent(QCloseEvent *e)
|
void DownloadManager::closeEvent(QCloseEvent* e)
|
||||||
{
|
{
|
||||||
if (mApp->windowCount() == 0) { // No main windows -> we are going to quit
|
if (mApp->windowCount() == 0) { // No main windows -> we are going to quit
|
||||||
if (!canClose()){
|
if (!canClose()){
|
||||||
|
@ -53,7 +53,7 @@ class DownloadManager : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DownloadManager(QWidget *parent = 0);
|
explicit DownloadManager(QWidget* parent = 0);
|
||||||
~DownloadManager();
|
~DownloadManager();
|
||||||
|
|
||||||
void download(const QNetworkRequest &request);
|
void download(const QNetworkRequest &request);
|
||||||
@ -64,7 +64,7 @@ public:
|
|||||||
|
|
||||||
#ifdef W7TASKBAR
|
#ifdef W7TASKBAR
|
||||||
protected:
|
protected:
|
||||||
virtual bool winEvent(MSG *message, long *result);
|
virtual bool winEvent(MSG* message, long* result);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -75,11 +75,11 @@ private:
|
|||||||
#ifdef W7TASKBAR
|
#ifdef W7TASKBAR
|
||||||
EcWin7 win7;
|
EcWin7 win7;
|
||||||
#endif
|
#endif
|
||||||
void timerEvent(QTimerEvent *event);
|
void timerEvent(QTimerEvent* event);
|
||||||
QString getFileName(QNetworkReply* reply);
|
QString getFileName(QNetworkReply* reply);
|
||||||
void closeEvent(QCloseEvent *e);
|
void closeEvent(QCloseEvent* e);
|
||||||
|
|
||||||
Ui::DownloadManager *ui;
|
Ui::DownloadManager* ui;
|
||||||
QNetworkAccessManager* m_networkManager;
|
QNetworkAccessManager* m_networkManager;
|
||||||
QFileIconProvider* m_iconProvider;
|
QFileIconProvider* m_iconProvider;
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "downloadoptionsdialog.h"
|
#include "downloadoptionsdialog.h"
|
||||||
#include "ui_downloadoptionsdialog.h"
|
#include "ui_downloadoptionsdialog.h"
|
||||||
|
|
||||||
DownloadOptionsDialog::DownloadOptionsDialog(QWidget *parent) :
|
DownloadOptionsDialog::DownloadOptionsDialog(QWidget* parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::DownloadOptionsDialog)
|
ui(new Ui::DownloadOptionsDialog)
|
||||||
{
|
{
|
||||||
|
@ -29,11 +29,11 @@ class DownloadOptionsDialog : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DownloadOptionsDialog(QWidget *parent = 0);
|
explicit DownloadOptionsDialog(QWidget* parent = 0);
|
||||||
~DownloadOptionsDialog();
|
~DownloadOptionsDialog();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::DownloadOptionsDialog *ui;
|
Ui::DownloadOptionsDialog* ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DOWNLOADOPTIONSDIALOG_H
|
#endif // DOWNLOADOPTIONSDIALOG_H
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "qupzilla.h"
|
#include "qupzilla.h"
|
||||||
#include "locationbar.h"
|
#include "locationbar.h"
|
||||||
|
|
||||||
HistoryManager::HistoryManager(QupZilla* mainClass, QWidget *parent) :
|
HistoryManager::HistoryManager(QupZilla* mainClass, QWidget* parent) :
|
||||||
QWidget(parent)
|
QWidget(parent)
|
||||||
,ui(new Ui::HistoryManager)
|
,ui(new Ui::HistoryManager)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
@ -51,20 +51,20 @@ QupZilla* HistoryManager::getQupZilla()
|
|||||||
return p_QupZilla;
|
return p_QupZilla;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryManager::setMainWindow(QupZilla *window)
|
void HistoryManager::setMainWindow(QupZilla* window)
|
||||||
{
|
{
|
||||||
if (window)
|
if (window)
|
||||||
p_QupZilla = window;
|
p_QupZilla = window;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryManager::itemDoubleClicked(QTreeWidgetItem *item)
|
void HistoryManager::itemDoubleClicked(QTreeWidgetItem* item)
|
||||||
{
|
{
|
||||||
if (!item || item->text(1).isEmpty())
|
if (!item || item->text(1).isEmpty())
|
||||||
return;
|
return;
|
||||||
getQupZilla()->loadAddress(QUrl(item->text(1)));
|
getQupZilla()->loadAddress(QUrl(item->text(1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryManager::itemControlClicked(QTreeWidgetItem *item)
|
void HistoryManager::itemControlClicked(QTreeWidgetItem* item)
|
||||||
{
|
{
|
||||||
if (!item || item->text(1).isEmpty())
|
if (!item || item->text(1).isEmpty())
|
||||||
return;
|
return;
|
||||||
@ -73,7 +73,7 @@ void HistoryManager::itemControlClicked(QTreeWidgetItem *item)
|
|||||||
|
|
||||||
void HistoryManager::loadInNewTab()
|
void HistoryManager::loadInNewTab()
|
||||||
{
|
{
|
||||||
if (QAction *action = qobject_cast<QAction*>(sender()))
|
if (QAction* action = qobject_cast<QAction*>(sender()))
|
||||||
getQupZilla()->tabWidget()->addView(action->data().toUrl(), tr("New Tab"), TabWidget::NewNotSelectedTab);
|
getQupZilla()->tabWidget()->addView(action->data().toUrl(), tr("New Tab"), TabWidget::NewNotSelectedTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,10 +36,10 @@ class HistoryManager : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit HistoryManager(QupZilla* mainClass, QWidget *parent = 0);
|
explicit HistoryManager(QupZilla* mainClass, QWidget* parent = 0);
|
||||||
~HistoryManager();
|
~HistoryManager();
|
||||||
|
|
||||||
void setMainWindow(QupZilla *window);
|
void setMainWindow(QupZilla* window);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void refreshTable();
|
void refreshTable();
|
||||||
@ -55,7 +55,7 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
QupZilla* getQupZilla();
|
QupZilla* getQupZilla();
|
||||||
Ui::HistoryManager *ui;
|
Ui::HistoryManager* ui;
|
||||||
QPointer<QupZilla> p_QupZilla;
|
QPointer<QupZilla> p_QupZilla;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "webview.h"
|
#include "webview.h"
|
||||||
#include "qupzilla.h"
|
#include "qupzilla.h"
|
||||||
|
|
||||||
HistoryModel::HistoryModel(QupZilla *mainClass, QObject *parent)
|
HistoryModel::HistoryModel(QupZilla* mainClass, QObject* parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
,m_isSaving(true)
|
,m_isSaving(true)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
@ -66,7 +66,7 @@ int HistoryModel::addHistoryEntry(const QString &url, QString &title)
|
|||||||
return query.lastInsertId().toInt();
|
return query.lastInsertId().toInt();
|
||||||
}
|
}
|
||||||
|
|
||||||
int HistoryModel::addHistoryEntry(WebView *view)
|
int HistoryModel::addHistoryEntry(WebView* view)
|
||||||
{
|
{
|
||||||
if (!m_isSaving)
|
if (!m_isSaving)
|
||||||
return -2;
|
return -2;
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include "siteinfowidget.h"
|
#include "siteinfowidget.h"
|
||||||
#include "rsswidget.h"
|
#include "rsswidget.h"
|
||||||
|
|
||||||
LocationBar::LocationBar(QupZilla* mainClass, QWidget *parent)
|
LocationBar::LocationBar(QupZilla* mainClass, QWidget* parent)
|
||||||
: LineEdit(parent)
|
: LineEdit(parent)
|
||||||
,m_selectAllOnDoubleClick(false)
|
,m_selectAllOnDoubleClick(false)
|
||||||
,m_addComWithCtrl(false)
|
,m_addComWithCtrl(false)
|
||||||
@ -267,7 +267,7 @@ void LocationBar::setPrivacy(bool state)
|
|||||||
m_siteIcon->setStyleSheet("QToolButton{border-image: url(:/icons/locationbar/searchchoose.png); margin-left:2px;}");
|
m_siteIcon->setStyleSheet("QToolButton{border-image: url(:/icons/locationbar/searchchoose.png); margin-left:2px;}");
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocationBar::focusOutEvent(QFocusEvent *e)
|
void LocationBar::focusOutEvent(QFocusEvent* e)
|
||||||
{
|
{
|
||||||
QLineEdit::focusOutEvent(e);
|
QLineEdit::focusOutEvent(e);
|
||||||
if (!selectedText().isEmpty() && e->reason() != Qt::TabFocusReason)
|
if (!selectedText().isEmpty() && e->reason() != Qt::TabFocusReason)
|
||||||
@ -276,7 +276,7 @@ void LocationBar::focusOutEvent(QFocusEvent *e)
|
|||||||
hideGoButton();
|
hideGoButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocationBar::dropEvent(QDropEvent *event)
|
void LocationBar::dropEvent(QDropEvent* event)
|
||||||
{
|
{
|
||||||
if (event->mimeData()->hasUrls()) {
|
if (event->mimeData()->hasUrls()) {
|
||||||
QUrl dropUrl = event->mimeData()->urls().at(0);
|
QUrl dropUrl = event->mimeData()->urls().at(0);
|
||||||
@ -300,7 +300,7 @@ void LocationBar::dropEvent(QDropEvent *event)
|
|||||||
QLineEdit::dropEvent(event);
|
QLineEdit::dropEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocationBar::mouseDoubleClickEvent(QMouseEvent *event)
|
void LocationBar::mouseDoubleClickEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::LeftButton && m_selectAllOnDoubleClick)
|
if (event->button() == Qt::LeftButton && m_selectAllOnDoubleClick)
|
||||||
selectAll();
|
selectAll();
|
||||||
|
@ -46,7 +46,7 @@ class LocationBar : public LineEdit
|
|||||||
{
|
{
|
||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
public:
|
public:
|
||||||
explicit LocationBar(QupZilla* mainClass, QWidget *parent = 0);
|
explicit LocationBar(QupZilla* mainClass, QWidget* parent = 0);
|
||||||
~LocationBar();
|
~LocationBar();
|
||||||
static QIcon icon(const QUrl &url);
|
static QIcon icon(const QUrl &url);
|
||||||
|
|
||||||
@ -67,9 +67,9 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void focusOutEvent(QFocusEvent* e);
|
void focusOutEvent(QFocusEvent* e);
|
||||||
void mouseDoubleClickEvent(QMouseEvent *event);
|
void mouseDoubleClickEvent(QMouseEvent* event);
|
||||||
void keyPressEvent(QKeyEvent *event);
|
void keyPressEvent(QKeyEvent* event);
|
||||||
void dropEvent(QDropEvent *event);
|
void dropEvent(QDropEvent* event);
|
||||||
|
|
||||||
void showGoButton();
|
void showGoButton();
|
||||||
void hideGoButton();
|
void hideGoButton();
|
||||||
|
@ -18,14 +18,14 @@
|
|||||||
#include "locationcompleter.h"
|
#include "locationcompleter.h"
|
||||||
#include "locationbar.h"
|
#include "locationbar.h"
|
||||||
|
|
||||||
LocationCompleter::LocationCompleter(QObject *parent) :
|
LocationCompleter::LocationCompleter(QObject* parent) :
|
||||||
QCompleter(parent)
|
QCompleter(parent)
|
||||||
{
|
{
|
||||||
setMaxVisibleItems(6);
|
setMaxVisibleItems(6);
|
||||||
QStandardItemModel* completeModel = new QStandardItemModel();
|
QStandardItemModel* completeModel = new QStandardItemModel();
|
||||||
|
|
||||||
setModel(completeModel);
|
setModel(completeModel);
|
||||||
QTreeView *treeView = new QTreeView;
|
QTreeView* treeView = new QTreeView;
|
||||||
|
|
||||||
setPopup(treeView);
|
setPopup(treeView);
|
||||||
treeView->setRootIsDecorated(false);
|
treeView->setRootIsDecorated(false);
|
||||||
@ -113,7 +113,7 @@ void LocationCompleter::refreshCompleter(QString string)
|
|||||||
query.exec("SELECT title, url FROM history WHERE title LIKE '%"+string+"%' OR url LIKE '%"+string+"%' ORDER BY count DESC LIMIT "+QString::number(limit));
|
query.exec("SELECT title, url FROM history WHERE title LIKE '%"+string+"%' OR url LIKE '%"+string+"%' ORDER BY count DESC LIMIT "+QString::number(limit));
|
||||||
int i = 0;
|
int i = 0;
|
||||||
QStandardItemModel* cModel = (QStandardItemModel*)model();
|
QStandardItemModel* cModel = (QStandardItemModel*)model();
|
||||||
QTreeView *treeView = (QTreeView*)popup();
|
QTreeView* treeView = (QTreeView*)popup();
|
||||||
|
|
||||||
cModel->clear();
|
cModel->clear();
|
||||||
while(query.next()) {
|
while(query.next()) {
|
||||||
|
@ -36,7 +36,7 @@ class LocationCompleter : public QCompleter
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit LocationCompleter(QObject *parent = 0);
|
explicit LocationCompleter(QObject* parent = 0);
|
||||||
|
|
||||||
//virtual QString pathFromIndex(const QModelIndex &index) const;
|
//virtual QString pathFromIndex(const QModelIndex &index) const;
|
||||||
virtual QStringList splitPath(const QString &path) const;
|
virtual QStringList splitPath(const QString &path) const;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
#include "locationpopup.h"
|
#include "locationpopup.h"
|
||||||
LocationPopup::LocationPopup(QWidget *parent)
|
LocationPopup::LocationPopup(QWidget* parent)
|
||||||
:QAbstractItemView()
|
:QAbstractItemView()
|
||||||
,m_parent(parent)
|
,m_parent(parent)
|
||||||
{
|
{
|
||||||
|
@ -25,7 +25,7 @@ class LocationPopup : public QAbstractItemView
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit LocationPopup(QWidget *parent = 0);
|
explicit LocationPopup(QWidget* parent = 0);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "webview.h"
|
#include "webview.h"
|
||||||
#include "clickablelabel.h"
|
#include "clickablelabel.h"
|
||||||
|
|
||||||
WebSearchBar::WebSearchBar(QupZilla* mainClass, QWidget *parent)
|
WebSearchBar::WebSearchBar(QupZilla* mainClass, QWidget* parent)
|
||||||
:LineEdit(parent)
|
:LineEdit(parent)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
{
|
{
|
||||||
@ -74,7 +74,7 @@ void WebSearchBar::setupSearchTypes()
|
|||||||
|
|
||||||
void WebSearchBar::searchChanged()
|
void WebSearchBar::searchChanged()
|
||||||
{
|
{
|
||||||
if (QAction *action = qobject_cast<QAction*>(sender())) {
|
if (QAction* action = qobject_cast<QAction*>(sender())) {
|
||||||
if (action->data().toString() == "Google")
|
if (action->data().toString() == "Google")
|
||||||
m_boxSearchType->setIcon(QIcon(":/icons/menu/google.png"));
|
m_boxSearchType->setIcon(QIcon(":/icons/menu/google.png"));
|
||||||
else if (action->data().toString() == "Seznam")
|
else if (action->data().toString() == "Seznam")
|
||||||
@ -114,7 +114,7 @@ void WebSearchBar::search()
|
|||||||
p_QupZilla->weView()->setFocus();
|
p_QupZilla->weView()->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebSearchBar::focusOutEvent(QFocusEvent *e)
|
void WebSearchBar::focusOutEvent(QFocusEvent* e)
|
||||||
{
|
{
|
||||||
if (text().isEmpty()) {
|
if (text().isEmpty()) {
|
||||||
QString search = m_boxSearchType->toolTip();
|
QString search = m_boxSearchType->toolTip();
|
||||||
@ -124,7 +124,7 @@ void WebSearchBar::focusOutEvent(QFocusEvent *e)
|
|||||||
QLineEdit::focusOutEvent(e);
|
QLineEdit::focusOutEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebSearchBar::focusInEvent(QFocusEvent *e)
|
void WebSearchBar::focusInEvent(QFocusEvent* e)
|
||||||
{
|
{
|
||||||
QString search = m_boxSearchType->toolTip();
|
QString search = m_boxSearchType->toolTip();
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ class WebSearchBar : public LineEdit
|
|||||||
{
|
{
|
||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
public:
|
public:
|
||||||
explicit WebSearchBar(QupZilla* mainClass, QWidget *parent = 0);
|
explicit WebSearchBar(QupZilla* mainClass, QWidget* parent = 0);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void searchChanged();
|
void searchChanged();
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "networkmanagerproxy.h"
|
#include "networkmanagerproxy.h"
|
||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
|
|
||||||
NetworkManager::NetworkManager(QupZilla* mainClass, QObject *parent) :
|
NetworkManager::NetworkManager(QupZilla* mainClass, QObject* parent) :
|
||||||
NetworkManagerProxy(mainClass, parent)
|
NetworkManagerProxy(mainClass, parent)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
,m_ignoreAllWarnings(false)
|
,m_ignoreAllWarnings(false)
|
||||||
@ -47,7 +47,7 @@ void NetworkManager::loadSettings()
|
|||||||
settings.endGroup();
|
settings.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkManager::sslError(QNetworkReply *reply, QList<QSslError> errors)
|
void NetworkManager::sslError(QNetworkReply* reply, QList<QSslError> errors)
|
||||||
{
|
{
|
||||||
if (m_ignoreAllWarnings) {
|
if (m_ignoreAllWarnings) {
|
||||||
reply->ignoreSslErrors(errors);
|
reply->ignoreSslErrors(errors);
|
||||||
@ -145,7 +145,7 @@ void NetworkManager::authentication(QNetworkReply* reply, QAuthenticator* auth)
|
|||||||
fill->addEntry(reply->url(), user->text(), pass->text());
|
fill->addEntry(reply->url(), user->text(), pass->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
QNetworkReply *NetworkManager::createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData)
|
QNetworkReply* NetworkManager::createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice* outgoingData)
|
||||||
{
|
{
|
||||||
if (op == PostOperation && outgoingData) {
|
if (op == PostOperation && outgoingData) {
|
||||||
QByteArray outgoingDataByteArray = outgoingData->peek(1024 * 1024);
|
QByteArray outgoingDataByteArray = outgoingData->peek(1024 * 1024);
|
||||||
|
@ -40,8 +40,8 @@ class NetworkManager : public NetworkManagerProxy
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit NetworkManager(QupZilla* mainClass, QObject *parent = 0);
|
explicit NetworkManager(QupZilla* mainClass, QObject* parent = 0);
|
||||||
QNetworkReply *createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData);
|
QNetworkReply* createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice* outgoingData);
|
||||||
|
|
||||||
QList<QSslCertificate> getCertExceptions() { return m_certExceptions; }
|
QList<QSslCertificate> getCertExceptions() { return m_certExceptions; }
|
||||||
void setCertExceptions(QList<QSslCertificate> certs) { m_certExceptions = certs; }
|
void setCertExceptions(QList<QSslCertificate> certs) { m_certExceptions = certs; }
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include "cookiejar.h"
|
#include "cookiejar.h"
|
||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
|
|
||||||
NetworkManagerProxy::NetworkManagerProxy(QupZilla* mainClass, QObject *parent) :
|
NetworkManagerProxy::NetworkManagerProxy(QupZilla* mainClass, QObject* parent) :
|
||||||
QNetworkAccessManager(parent)
|
QNetworkAccessManager(parent)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
,m_view(0)
|
,m_view(0)
|
||||||
@ -38,21 +38,21 @@ void NetworkManagerProxy::populateNetworkRequest(QNetworkRequest &request)
|
|||||||
request.setAttribute((QNetworkRequest::Attribute)(QNetworkRequest::User + 100), variant);
|
request.setAttribute((QNetworkRequest::Attribute)(QNetworkRequest::User + 100), variant);
|
||||||
}
|
}
|
||||||
|
|
||||||
void NetworkManagerProxy::setPrimaryNetworkAccessManager(NetworkManagerProxy *manager)
|
void NetworkManagerProxy::setPrimaryNetworkAccessManager(NetworkManagerProxy* manager)
|
||||||
{
|
{
|
||||||
Q_ASSERT(manager);
|
Q_ASSERT(manager);
|
||||||
m_manager = manager;
|
m_manager = manager;
|
||||||
|
|
||||||
connect(this, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)),
|
connect(this, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)),
|
||||||
manager, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)));
|
manager, SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)));
|
||||||
connect(this, SIGNAL(finished(QNetworkReply *)),
|
connect(this, SIGNAL(finished(QNetworkReply*)),
|
||||||
manager, SIGNAL(finished(QNetworkReply *)));
|
manager, SIGNAL(finished(QNetworkReply*)));
|
||||||
|
|
||||||
connect(this, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)),
|
connect(this, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)),
|
||||||
manager, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)));
|
manager, SIGNAL(sslErrors(QNetworkReply*, const QList<QSslError>&)));
|
||||||
}
|
}
|
||||||
|
|
||||||
QNetworkReply *NetworkManagerProxy::createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData)
|
QNetworkReply* NetworkManagerProxy::createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice* outgoingData)
|
||||||
{
|
{
|
||||||
if (m_manager && m_page) {
|
if (m_manager && m_page) {
|
||||||
QNetworkRequest pageRequest = request;
|
QNetworkRequest pageRequest = request;
|
||||||
|
@ -34,12 +34,12 @@ class NetworkManagerProxy : public QNetworkAccessManager
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit NetworkManagerProxy(QupZilla* mainClass, QObject *parent = 0);
|
explicit NetworkManagerProxy(QupZilla* mainClass, QObject* parent = 0);
|
||||||
void setView(WebView* view) { m_view = view; }
|
void setView(WebView* view) { m_view = view; }
|
||||||
void setPage(WebPage* page) { m_page = page; }
|
void setPage(WebPage* page) { m_page = page; }
|
||||||
|
|
||||||
void setPrimaryNetworkAccessManager(NetworkManagerProxy *manager);
|
void setPrimaryNetworkAccessManager(NetworkManagerProxy* manager);
|
||||||
QNetworkReply* createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData);
|
QNetworkReply* createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice* outgoingData);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void populateNetworkRequest(QNetworkRequest &request);
|
virtual void populateNetworkRequest(QNetworkRequest &request);
|
||||||
@ -48,7 +48,7 @@ private:
|
|||||||
QupZilla* p_QupZilla;
|
QupZilla* p_QupZilla;
|
||||||
WebView* m_view;
|
WebView* m_view;
|
||||||
WebPage* m_page;
|
WebPage* m_page;
|
||||||
NetworkManagerProxy *m_manager;
|
NetworkManagerProxy* m_manager;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // NETWORKMANAGERPROXY_H
|
#endif // NETWORKMANAGERPROXY_H
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "webview.h"
|
#include "webview.h"
|
||||||
#include "webpage.h"
|
#include "webpage.h"
|
||||||
|
|
||||||
AboutDialog::AboutDialog(QWidget *parent) :
|
AboutDialog::AboutDialog(QWidget* parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::AboutDialog)
|
ui(new Ui::AboutDialog)
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ class AboutDialog : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AboutDialog(QWidget *parent = 0);
|
explicit AboutDialog(QWidget* parent = 0);
|
||||||
~AboutDialog();
|
~AboutDialog();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -42,7 +42,7 @@ private slots:
|
|||||||
void buttonClicked();
|
void buttonClicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AboutDialog *ui;
|
Ui::AboutDialog* ui;
|
||||||
|
|
||||||
QString m_aboutHtml;
|
QString m_aboutHtml;
|
||||||
QString m_authorsHtml;
|
QString m_authorsHtml;
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include "networkmanager.h"
|
#include "networkmanager.h"
|
||||||
#include "clickablelabel.h"
|
#include "clickablelabel.h"
|
||||||
|
|
||||||
ClearPrivateData::ClearPrivateData(QupZilla* mainClass, QWidget *parent) :
|
ClearPrivateData::ClearPrivateData(QupZilla* mainClass, QWidget* parent) :
|
||||||
QDialog(parent)
|
QDialog(parent)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
{
|
{
|
||||||
|
@ -34,7 +34,7 @@ class ClearPrivateData : public QDialog
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit ClearPrivateData(QupZilla* mainClass, QWidget *parent = 0);
|
explicit ClearPrivateData(QupZilla* mainClass, QWidget* parent = 0);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "webview.h"
|
#include "webview.h"
|
||||||
#include "htmlhighlighter.h"
|
#include "htmlhighlighter.h"
|
||||||
|
|
||||||
SourceViewer::SourceViewer(QWebPage* page, QWidget *parent) :
|
SourceViewer::SourceViewer(QWebPage* page, QWidget* parent) :
|
||||||
QWidget(parent)
|
QWidget(parent)
|
||||||
,m_page(page)
|
,m_page(page)
|
||||||
{
|
{
|
||||||
@ -104,6 +104,7 @@ void SourceViewer::save()
|
|||||||
QFile file(filePath);
|
QFile file(filePath);
|
||||||
if (!file.open(QFile::WriteOnly)) {
|
if (!file.open(QFile::WriteOnly)) {
|
||||||
QMessageBox::critical(this, tr("Error!"), tr("Cannot write to file!"));
|
QMessageBox::critical(this, tr("Error!"), tr("Cannot write to file!"));
|
||||||
|
m_statusBar->showMessage(tr("Error writing to file"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
file.write(m_sourceEdit->toPlainText().toAscii());
|
file.write(m_sourceEdit->toPlainText().toAscii());
|
||||||
|
@ -42,7 +42,7 @@ class SourceViewer : public QWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit SourceViewer(QWebPage* page, QWidget *parent = 0);
|
explicit SourceViewer(QWebPage* page, QWidget* parent = 0);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "qupzilla.h"
|
#include "qupzilla.h"
|
||||||
#include "tabwidget.h"
|
#include "tabwidget.h"
|
||||||
|
|
||||||
Updater::Updater(QupZilla* mainClass, QObject *parent) :
|
Updater::Updater(QupZilla* mainClass, QObject* parent) :
|
||||||
QObject(parent)
|
QObject(parent)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
{
|
{
|
||||||
@ -55,7 +55,7 @@ void Updater::startDownloadingUpdateInfo(const QUrl &url)
|
|||||||
QNetworkReply* reply;
|
QNetworkReply* reply;
|
||||||
reply=manager->get(QNetworkRequest(QUrl(url)));
|
reply=manager->get(QNetworkRequest(QUrl(url)));
|
||||||
|
|
||||||
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(downCompleted(QNetworkReply *)));
|
connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(downCompleted(QNetworkReply*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Updater::downCompleted(QNetworkReply* reply)
|
void Updater::downCompleted(QNetworkReply* reply)
|
||||||
|
@ -32,7 +32,7 @@ class Updater : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit Updater(QupZilla* mainClass, QObject *parent = 0);
|
explicit Updater(QupZilla* mainClass, QObject* parent = 0);
|
||||||
~Updater();
|
~Updater();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -43,14 +43,14 @@
|
|||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
#include "pluginproxy.h"
|
#include "pluginproxy.h"
|
||||||
|
|
||||||
ClickToFlash::ClickToFlash(const QUrl &pluginUrl, QWidget *parent)
|
ClickToFlash::ClickToFlash(const QUrl &pluginUrl, QWidget* parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, m_url(pluginUrl)
|
, m_url(pluginUrl)
|
||||||
{
|
{
|
||||||
QHBoxLayout *horizontalLayout;
|
QHBoxLayout* horizontalLayout;
|
||||||
QFrame *frame;
|
QFrame* frame;
|
||||||
QHBoxLayout *horizontalLayout_2;
|
QHBoxLayout* horizontalLayout_2;
|
||||||
QToolButton *toolButton;
|
QToolButton* toolButton;
|
||||||
|
|
||||||
horizontalLayout = new QHBoxLayout(this);
|
horizontalLayout = new QHBoxLayout(this);
|
||||||
frame = new QFrame(this);
|
frame = new QFrame(this);
|
||||||
@ -94,10 +94,10 @@ void ClickToFlash::toWhitelist()
|
|||||||
|
|
||||||
void ClickToFlash::load()
|
void ClickToFlash::load()
|
||||||
{
|
{
|
||||||
QWidget *parent = parentWidget();
|
QWidget* parent = parentWidget();
|
||||||
QWebView *view = 0;
|
QWebView* view = 0;
|
||||||
while (parent) {
|
while (parent) {
|
||||||
if (QWebView *aView = qobject_cast<QWebView*>(parent)) {
|
if (QWebView* aView = qobject_cast<QWebView*>(parent)) {
|
||||||
view = aView;
|
view = aView;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ void ClickToFlash::load()
|
|||||||
QList<QWebFrame*> frames;
|
QList<QWebFrame*> frames;
|
||||||
frames.append(view->page()->mainFrame());
|
frames.append(view->page()->mainFrame());
|
||||||
while (!frames.isEmpty()) {
|
while (!frames.isEmpty()) {
|
||||||
QWebFrame *frame = frames.takeFirst();
|
QWebFrame* frame = frames.takeFirst();
|
||||||
QWebElement docElement = frame->documentElement();
|
QWebElement docElement = frame->documentElement();
|
||||||
|
|
||||||
QWebElementCollection elements;
|
QWebElementCollection elements;
|
||||||
|
@ -61,7 +61,7 @@ class ClickToFlash : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ClickToFlash(const QUrl &pluginUrl, QWidget *parent = 0);
|
explicit ClickToFlash(const QUrl &pluginUrl, QWidget* parent = 0);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void signalLoadClickToFlash(bool);
|
void signalLoadClickToFlash(bool);
|
||||||
|
@ -25,7 +25,7 @@ PluginProxy::PluginProxy() :
|
|||||||
c2f_loadSettings();
|
c2f_loadSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginProxy::populateWebViewMenu(QMenu *menu, QWebView *view, QWebHitTestResult r)
|
void PluginProxy::populateWebViewMenu(QMenu* menu, QWebView* view, QWebHitTestResult r)
|
||||||
{
|
{
|
||||||
if (!menu || !view || loadedPlugins.count() == 0)
|
if (!menu || !view || loadedPlugins.count() == 0)
|
||||||
return;
|
return;
|
||||||
@ -40,7 +40,7 @@ void PluginProxy::populateWebViewMenu(QMenu *menu, QWebView *view, QWebHitTestRe
|
|||||||
menu->removeAction(menu->actions().at(count));
|
menu->removeAction(menu->actions().at(count));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginProxy::populateToolsMenu(QMenu *menu)
|
void PluginProxy::populateToolsMenu(QMenu* menu)
|
||||||
{
|
{
|
||||||
if (!menu || loadedPlugins.count() == 0)
|
if (!menu || loadedPlugins.count() == 0)
|
||||||
return;
|
return;
|
||||||
@ -54,7 +54,7 @@ void PluginProxy::populateToolsMenu(QMenu *menu)
|
|||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginProxy::populateHelpMenu(QMenu *menu)
|
void PluginProxy::populateHelpMenu(QMenu* menu)
|
||||||
{
|
{
|
||||||
if (!menu || loadedPlugins.count() == 0)
|
if (!menu || loadedPlugins.count() == 0)
|
||||||
return;
|
return;
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "plugininterface.h"
|
#include "plugininterface.h"
|
||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
|
|
||||||
Plugins::Plugins(QObject *parent) :
|
Plugins::Plugins(QObject* parent) :
|
||||||
QObject(parent)
|
QObject(parent)
|
||||||
{
|
{
|
||||||
loadSettings();
|
loadSettings();
|
||||||
@ -53,9 +53,9 @@ void Plugins::loadPlugins()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
QPluginLoader loader(pluginsDir.absoluteFilePath(fileName));
|
QPluginLoader loader(pluginsDir.absoluteFilePath(fileName));
|
||||||
QObject *plugin = loader.instance();
|
QObject* plugin = loader.instance();
|
||||||
if (plugin) {
|
if (plugin) {
|
||||||
PluginInterface *iPlugin = qobject_cast<PluginInterface *>(plugin);
|
PluginInterface* iPlugin = qobject_cast<PluginInterface*>(plugin);
|
||||||
iPlugin->init(mApp->getActiveProfil()+"plugins.ini");
|
iPlugin->init(mApp->getActiveProfil()+"plugins.ini");
|
||||||
if (!iPlugin->testPlugin()) {
|
if (!iPlugin->testPlugin()) {
|
||||||
loader.unload();
|
loader.unload();
|
||||||
@ -76,9 +76,9 @@ PluginInterface* Plugins::getPlugin(QString pluginFileName)
|
|||||||
if (!QFile::exists(path))
|
if (!QFile::exists(path))
|
||||||
return 0;
|
return 0;
|
||||||
QPluginLoader loader(path);
|
QPluginLoader loader(path);
|
||||||
QObject *plugin = loader.instance();
|
QObject* plugin = loader.instance();
|
||||||
if (plugin) {
|
if (plugin) {
|
||||||
PluginInterface *iPlugin = qobject_cast<PluginInterface *>(plugin);
|
PluginInterface* iPlugin = qobject_cast<PluginInterface*>(plugin);
|
||||||
return iPlugin;
|
return iPlugin;
|
||||||
} else
|
} else
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -34,7 +34,7 @@ class Plugins : public QObject
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit Plugins(QObject *parent = 0);
|
explicit Plugins(QObject* parent = 0);
|
||||||
|
|
||||||
QStringList getAvailablePlugins() { return m_availablePluginFileNames; }
|
QStringList getAvailablePlugins() { return m_availablePluginFileNames; }
|
||||||
QStringList getAllowedPlugins () { return m_allowedPluginFileNames; }
|
QStringList getAllowedPlugins () { return m_allowedPluginFileNames; }
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
#include "pluginproxy.h"
|
#include "pluginproxy.h"
|
||||||
|
|
||||||
WebPluginFactory::WebPluginFactory(QObject *parent)
|
WebPluginFactory::WebPluginFactory(QObject* parent)
|
||||||
: QWebPluginFactory(parent)
|
: QWebPluginFactory(parent)
|
||||||
,m_loadClickToFlash(false)
|
,m_loadClickToFlash(false)
|
||||||
{
|
{
|
||||||
|
@ -26,8 +26,8 @@ class WebPluginFactory : public QWebPluginFactory
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
WebPluginFactory(QObject *parent);
|
WebPluginFactory(QObject* parent);
|
||||||
virtual QObject*create (const QString &mimeType, const QUrl &url, const QStringList &argumentNames, const QStringList &argumentValues) const;
|
virtual QObject* create (const QString &mimeType, const QUrl &url, const QStringList &argumentNames, const QStringList &argumentValues) const;
|
||||||
QList<QWebPluginFactory::Plugin> plugins() const;
|
QList<QWebPluginFactory::Plugin> plugins() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "autofillmanager.h"
|
#include "autofillmanager.h"
|
||||||
#include "ui_autofillmanager.h"
|
#include "ui_autofillmanager.h"
|
||||||
|
|
||||||
AutoFillManager::AutoFillManager(QWidget *parent) :
|
AutoFillManager::AutoFillManager(QWidget* parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::AutoFillManager)
|
ui(new Ui::AutoFillManager)
|
||||||
{
|
{
|
||||||
|
@ -40,7 +40,7 @@ class AutoFillManager : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AutoFillManager(QWidget *parent = 0);
|
explicit AutoFillManager(QWidget* parent = 0);
|
||||||
~AutoFillManager();
|
~AutoFillManager();
|
||||||
|
|
||||||
void showExceptions();
|
void showExceptions();
|
||||||
@ -56,7 +56,7 @@ private slots:
|
|||||||
void removeAllExcept();
|
void removeAllExcept();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AutoFillManager *ui;
|
Ui::AutoFillManager* ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // AUTOFILLMANAGER_H
|
#endif // AUTOFILLMANAGER_H
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
#include "plugininterface.h"
|
#include "plugininterface.h"
|
||||||
|
|
||||||
PluginsList::PluginsList(QWidget *parent) :
|
PluginsList::PluginsList(QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::PluginsList)
|
ui(new Ui::PluginsList)
|
||||||
{
|
{
|
||||||
@ -140,7 +140,7 @@ void PluginsList::refresh()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginsList::currentChanged(QListWidgetItem *item)
|
void PluginsList::currentChanged(QListWidgetItem* item)
|
||||||
{
|
{
|
||||||
if (!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
|
@ -34,7 +34,7 @@ class PluginsList : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PluginsList(QWidget *parent = 0);
|
explicit PluginsList(QWidget* parent = 0);
|
||||||
~PluginsList();
|
~PluginsList();
|
||||||
void save();
|
void save();
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void refresh();
|
void refresh();
|
||||||
Ui::PluginsList *ui;
|
Ui::PluginsList* ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PLUGINSLIST_H
|
#endif // PLUGINSLIST_H
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "pluginproxy.h"
|
#include "pluginproxy.h"
|
||||||
#include "sslmanager.h"
|
#include "sslmanager.h"
|
||||||
|
|
||||||
Preferences::Preferences(QupZilla* mainClass, QWidget *parent) :
|
Preferences::Preferences(QupZilla* mainClass, QWidget* parent) :
|
||||||
QDialog(parent)
|
QDialog(parent)
|
||||||
,ui(new Ui::Preferences)
|
,ui(new Ui::Preferences)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
@ -229,7 +229,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget *parent) :
|
|||||||
ui->version->setText(" QupZilla v"+QupZilla::VERSION);
|
ui->version->setText(" QupZilla v"+QupZilla::VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Preferences::showStackedPage(QListWidgetItem *item)
|
void Preferences::showStackedPage(QListWidgetItem* item)
|
||||||
{
|
{
|
||||||
if (!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
@ -367,7 +367,7 @@ void Preferences::showPassManager(bool state)
|
|||||||
m_autoFillManager->setVisible(state);
|
m_autoFillManager->setVisible(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Preferences::buttonClicked(QAbstractButton *button)
|
void Preferences::buttonClicked(QAbstractButton* button)
|
||||||
{
|
{
|
||||||
switch (ui->buttonBox->buttonRole(button)) {
|
switch (ui->buttonBox->buttonRole(button)) {
|
||||||
case QDialogButtonBox::ApplyRole:
|
case QDialogButtonBox::ApplyRole:
|
||||||
|
@ -41,7 +41,7 @@ class Preferences : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit Preferences(QupZilla* mainClass, QWidget *parent = 0);
|
explicit Preferences(QupZilla* mainClass, QWidget* parent = 0);
|
||||||
~Preferences();
|
~Preferences();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -71,7 +71,7 @@ private slots:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void updateBgLabel();
|
void updateBgLabel();
|
||||||
Ui::Preferences *ui;
|
Ui::Preferences* ui;
|
||||||
QupZilla* p_QupZilla;
|
QupZilla* p_QupZilla;
|
||||||
AutoFillManager* m_autoFillManager;
|
AutoFillManager* m_autoFillManager;
|
||||||
PluginsList* m_pluginsList;
|
PluginsList* m_pluginsList;
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "networkmanager.h"
|
#include "networkmanager.h"
|
||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
|
|
||||||
SSLManager::SSLManager(QWidget *parent) :
|
SSLManager::SSLManager(QWidget* parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::SSLManager)
|
ui(new Ui::SSLManager)
|
||||||
{
|
{
|
||||||
|
@ -34,7 +34,7 @@ class SSLManager : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SSLManager(QWidget *parent = 0);
|
explicit SSLManager(QWidget* parent = 0);
|
||||||
~SSLManager();
|
~SSLManager();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
@ -43,7 +43,7 @@ private slots:
|
|||||||
void ignoreAll(bool state);
|
void ignoreAll(bool state);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::SSLManager *ui;
|
Ui::SSLManager* ui;
|
||||||
QList<QSslCertificate> m_certs;
|
QList<QSslCertificate> m_certs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
#include "treewidget.h"
|
#include "treewidget.h"
|
||||||
|
|
||||||
RSSManager::RSSManager(QupZilla* mainClass, QWidget *parent) :
|
RSSManager::RSSManager(QupZilla* mainClass, QWidget* parent) :
|
||||||
QWidget(parent)
|
QWidget(parent)
|
||||||
,ui(new Ui::RSSManager)
|
,ui(new Ui::RSSManager)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
@ -49,7 +49,7 @@ QupZilla* RSSManager::getQupZilla()
|
|||||||
return p_QupZilla;
|
return p_QupZilla;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RSSManager::setMainWindow(QupZilla *window)
|
void RSSManager::setMainWindow(QupZilla* window)
|
||||||
{
|
{
|
||||||
if (window)
|
if (window)
|
||||||
p_QupZilla = window;
|
p_QupZilla = window;
|
||||||
@ -202,7 +202,7 @@ void RSSManager::customContextMenuRequested(const QPoint &position)
|
|||||||
menu.exec(p);
|
menu.exec(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RSSManager::loadFeed(QTreeWidgetItem *item)
|
void RSSManager::loadFeed(QTreeWidgetItem* item)
|
||||||
{
|
{
|
||||||
if (!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
@ -211,7 +211,7 @@ void RSSManager::loadFeed(QTreeWidgetItem *item)
|
|||||||
getQupZilla()->loadAddress(QUrl(item->whatsThis(0)));
|
getQupZilla()->loadAddress(QUrl(item->whatsThis(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RSSManager::controlLoadFeed(QTreeWidgetItem *item)
|
void RSSManager::controlLoadFeed(QTreeWidgetItem* item)
|
||||||
{
|
{
|
||||||
if (!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
@ -222,7 +222,7 @@ void RSSManager::controlLoadFeed(QTreeWidgetItem *item)
|
|||||||
|
|
||||||
void RSSManager::loadFeedInNewTab()
|
void RSSManager::loadFeedInNewTab()
|
||||||
{
|
{
|
||||||
if (QAction *action = qobject_cast<QAction*>(sender()))
|
if (QAction* action = qobject_cast<QAction*>(sender()))
|
||||||
getQupZilla()->tabWidget()->addView(action->data().toUrl(), tr("New Tab"), TabWidget::NewNotSelectedTab);
|
getQupZilla()->tabWidget()->addView(action->data().toUrl(), tr("New Tab"), TabWidget::NewNotSelectedTab);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,10 +231,10 @@ void RSSManager::beginToLoadSlot(const QUrl &url)
|
|||||||
QNetworkReply* reply;
|
QNetworkReply* reply;
|
||||||
reply=m_networkManager->get(QNetworkRequest(QUrl(url)));
|
reply=m_networkManager->get(QNetworkRequest(QUrl(url)));
|
||||||
|
|
||||||
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(finished(QNetworkReply *)));
|
connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(finished(QNetworkReply*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void RSSManager::finished(QNetworkReply *reply)
|
void RSSManager::finished(QNetworkReply* reply)
|
||||||
{
|
{
|
||||||
if (m_networkReplies.contains(reply))
|
if (m_networkReplies.contains(reply))
|
||||||
return;
|
return;
|
||||||
@ -270,7 +270,7 @@ void RSSManager::finished(QNetworkReply *reply)
|
|||||||
currentTag = xml.name().toString();
|
currentTag = xml.name().toString();
|
||||||
} else if (xml.isEndElement()) {
|
} else if (xml.isEndElement()) {
|
||||||
if (xml.name() == "item") {
|
if (xml.name() == "item") {
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem;
|
QTreeWidgetItem* item = new QTreeWidgetItem;
|
||||||
item->setText(0, titleString);
|
item->setText(0, titleString);
|
||||||
item->setWhatsThis(0, linkString);
|
item->setWhatsThis(0, linkString);
|
||||||
item->setIcon(0, QIcon(":/icons/other/feed.png"));
|
item->setIcon(0, QIcon(":/icons/other/feed.png"));
|
||||||
@ -289,7 +289,7 @@ void RSSManager::finished(QNetworkReply *reply)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (treeWidget->topLevelItemCount() == 0) {
|
if (treeWidget->topLevelItemCount() == 0) {
|
||||||
QTreeWidgetItem *item = new QTreeWidgetItem;
|
QTreeWidgetItem* item = new QTreeWidgetItem;
|
||||||
item->setText(0, tr("Error in fetching feed"));
|
item->setText(0, tr("Error in fetching feed"));
|
||||||
treeWidget->addTopLevelItem(item);
|
treeWidget->addTopLevelItem(item);
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ class RSSManager : public QWidget
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit RSSManager(QupZilla* mainClass, QWidget *parent = 0);
|
explicit RSSManager(QupZilla* mainClass, QWidget* parent = 0);
|
||||||
~RSSManager();
|
~RSSManager();
|
||||||
|
|
||||||
bool addRssFeed(const QString &address, const QString &title);
|
bool addRssFeed(const QString &address, const QString &title);
|
||||||
@ -63,7 +63,7 @@ private:
|
|||||||
QupZilla* getQupZilla();
|
QupZilla* getQupZilla();
|
||||||
QList<QNetworkReply*> m_networkReplies;
|
QList<QNetworkReply*> m_networkReplies;
|
||||||
QNetworkAccessManager* m_networkManager;
|
QNetworkAccessManager* m_networkManager;
|
||||||
Ui::RSSManager *ui;
|
Ui::RSSManager* ui;
|
||||||
QPointer<QupZilla> p_QupZilla;
|
QPointer<QupZilla> p_QupZilla;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
#include "qupzilla.h"
|
#include "qupzilla.h"
|
||||||
|
|
||||||
RSSNotification::RSSNotification(QString host, QWidget *parent) :
|
RSSNotification::RSSNotification(QString host, QWidget* parent) :
|
||||||
Notification(parent),
|
Notification(parent),
|
||||||
ui(new Ui::RSSNotification)
|
ui(new Ui::RSSNotification)
|
||||||
{
|
{
|
||||||
|
@ -32,11 +32,11 @@ class RSSNotification : public Notification
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit RSSNotification(QString host, QWidget *parent = 0);
|
explicit RSSNotification(QString host, QWidget* parent = 0);
|
||||||
~RSSNotification();
|
~RSSNotification();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::RSSNotification *ui;
|
Ui::RSSNotification* ui;
|
||||||
QTimeLine* m_animation;
|
QTimeLine* m_animation;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
#include "rssmanager.h"
|
#include "rssmanager.h"
|
||||||
#include "rssnotification.h"
|
#include "rssnotification.h"
|
||||||
|
|
||||||
RSSWidget::RSSWidget(WebView *view, QList<QPair<QString, QString> > availableRss, QWidget *parent)
|
RSSWidget::RSSWidget(WebView* view, QList<QPair<QString, QString> > availableRss, QWidget* parent)
|
||||||
:QMenu(parent)
|
:QMenu(parent)
|
||||||
,ui(new Ui::RSSWidget)
|
,ui(new Ui::RSSWidget)
|
||||||
,m_avRss(availableRss)
|
,m_avRss(availableRss)
|
||||||
@ -54,7 +54,7 @@ void RSSWidget::addRss()
|
|||||||
{
|
{
|
||||||
if(!m_view)
|
if(!m_view)
|
||||||
return;
|
return;
|
||||||
if (QPushButton *button = qobject_cast<QPushButton*>(sender())) {
|
if (QPushButton* button = qobject_cast<QPushButton*>(sender())) {
|
||||||
QUrl url = QUrl(button->whatsThis());
|
QUrl url = QUrl(button->whatsThis());
|
||||||
QString urlString = button->whatsThis();
|
QString urlString = button->whatsThis();
|
||||||
if(url.host().isEmpty()) {
|
if(url.host().isEmpty()) {
|
||||||
|
@ -33,7 +33,7 @@ class RSSWidget : public QMenu
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit RSSWidget(WebView* view, QList<QPair<QString,QString> > availableRss, QWidget *parent = 0);
|
explicit RSSWidget(WebView* view, QList<QPair<QString,QString> > availableRss, QWidget* parent = 0);
|
||||||
~RSSWidget();
|
~RSSWidget();
|
||||||
|
|
||||||
void showAt(QWidget* _parent);
|
void showAt(QWidget* _parent);
|
||||||
@ -42,7 +42,7 @@ private slots:
|
|||||||
void addRss();
|
void addRss();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::RSSWidget *ui;
|
Ui::RSSWidget* ui;
|
||||||
QList<QPair<QString,QString> > m_avRss;
|
QList<QPair<QString,QString> > m_avRss;
|
||||||
WebView* m_view;
|
WebView* m_view;
|
||||||
};
|
};
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
#include "sidebar.h"
|
#include "sidebar.h"
|
||||||
|
|
||||||
SideBar::SideBar(QWidget *parent) :
|
SideBar::SideBar(QWidget* parent) :
|
||||||
QDockWidget(parent)
|
QDockWidget(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ class SideBar : public QDockWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit SideBar(QWidget *parent = 0);
|
explicit SideBar(QWidget* parent = 0);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
@ -17,18 +17,18 @@
|
|||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
#include "clickablelabel.h"
|
#include "clickablelabel.h"
|
||||||
|
|
||||||
ClickableLabel::ClickableLabel(QWidget *parent) :
|
ClickableLabel::ClickableLabel(QWidget* parent) :
|
||||||
QLabel(parent)
|
QLabel(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClickableLabel::mousePressEvent(QMouseEvent *ev)
|
void ClickableLabel::mousePressEvent(QMouseEvent* ev)
|
||||||
{
|
{
|
||||||
if (ev->button() == Qt::LeftButton)
|
if (ev->button() == Qt::LeftButton)
|
||||||
emit clicked(ev->globalPos());
|
emit clicked(ev->globalPos());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClickableLabel::mouseDoubleClickEvent(QMouseEvent *ev)
|
void ClickableLabel::mouseDoubleClickEvent(QMouseEvent* ev)
|
||||||
{
|
{
|
||||||
if (ev->button() == Qt::LeftButton)
|
if (ev->button() == Qt::LeftButton)
|
||||||
emit clicked(ev->globalPos());
|
emit clicked(ev->globalPos());
|
||||||
|
@ -25,14 +25,14 @@ class ClickableLabel : public QLabel
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit ClickableLabel(QWidget *parent = 0);
|
explicit ClickableLabel(QWidget* parent = 0);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void clicked(QPoint);
|
void clicked(QPoint);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void mousePressEvent(QMouseEvent *ev);
|
void mousePressEvent(QMouseEvent* ev);
|
||||||
void mouseDoubleClickEvent(QMouseEvent *ev);
|
void mouseDoubleClickEvent(QMouseEvent* ev);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -17,12 +17,12 @@
|
|||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
#include "frame.h"
|
#include "frame.h"
|
||||||
|
|
||||||
Frame::Frame(QWidget *parent) :
|
Frame::Frame(QWidget* parent) :
|
||||||
QFrame(parent)
|
QFrame(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void Frame::mousePressEvent(QMouseEvent *event)
|
void Frame::mousePressEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
//If we proccess mouse events, then menu from bookmarkswidget
|
//If we proccess mouse events, then menu from bookmarkswidget
|
||||||
//is going to close() with clicking in free space
|
//is going to close() with clicking in free space
|
||||||
|
@ -25,14 +25,14 @@ class Frame : public QFrame
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit Frame(QWidget *parent = 0);
|
explicit Frame(QWidget* parent = 0);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void mousePressEvent(QMouseEvent *event);
|
void mousePressEvent(QMouseEvent* event);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "htmlhighlighter.h"
|
#include "htmlhighlighter.h"
|
||||||
|
|
||||||
HtmlHighlighter::HtmlHighlighter(QTextDocument *parent)
|
HtmlHighlighter::HtmlHighlighter(QTextDocument* parent)
|
||||||
: QSyntaxHighlighter(parent)
|
: QSyntaxHighlighter(parent)
|
||||||
{
|
{
|
||||||
HighlightingRule rule;
|
HighlightingRule rule;
|
||||||
|
@ -69,7 +69,7 @@ class HtmlHighlighter : public QSyntaxHighlighter
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HtmlHighlighter(QTextDocument *parent = 0);
|
HtmlHighlighter(QTextDocument* parent = 0);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void highlightBlock(const QString &text);
|
void highlightBlock(const QString &text);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "notification.h"
|
#include "notification.h"
|
||||||
|
|
||||||
Notification::Notification(QWidget *parent) :
|
Notification::Notification(QWidget* parent) :
|
||||||
QWidget(parent)
|
QWidget(parent)
|
||||||
,m_animation(0)
|
,m_animation(0)
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,7 @@ class Notification : public QWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit Notification(QWidget *parent = 0);
|
explicit Notification(QWidget* parent = 0);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void hide();
|
void hide();
|
||||||
|
@ -17,12 +17,12 @@
|
|||||||
* ============================================================ */
|
* ============================================================ */
|
||||||
#include "treewidget.h"
|
#include "treewidget.h"
|
||||||
|
|
||||||
TreeWidget::TreeWidget(QWidget *parent) :
|
TreeWidget::TreeWidget(QWidget* parent) :
|
||||||
QTreeWidget(parent)
|
QTreeWidget(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void TreeWidget::mousePressEvent(QMouseEvent *event)
|
void TreeWidget::mousePressEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
if (event->modifiers() == Qt::ControlModifier)
|
if (event->modifiers() == Qt::ControlModifier)
|
||||||
emit itemControlClicked(itemAt(event->pos()));
|
emit itemControlClicked(itemAt(event->pos()));
|
||||||
|
@ -26,15 +26,15 @@ class TreeWidget : public QTreeWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit TreeWidget(QWidget *parent = 0);
|
explicit TreeWidget(QWidget* parent = 0);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void itemControlClicked(QTreeWidgetItem *item);
|
void itemControlClicked(QTreeWidgetItem* item);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void mousePressEvent(QMouseEvent *event);
|
void mousePressEvent(QMouseEvent* event);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "webview.h"
|
#include "webview.h"
|
||||||
#include "lineedit.h"
|
#include "lineedit.h"
|
||||||
|
|
||||||
SearchToolBar::SearchToolBar(QupZilla* mainClass, QWidget *parent) :
|
SearchToolBar::SearchToolBar(QupZilla* mainClass, QWidget* parent) :
|
||||||
QToolBar(parent)
|
QToolBar(parent)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
,m_findFlags(0)
|
,m_findFlags(0)
|
||||||
|
@ -36,7 +36,7 @@ class SearchToolBar : public QToolBar
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit SearchToolBar(QupZilla* mainClass, QWidget *parent = 0);
|
explicit SearchToolBar(QupZilla* mainClass, QWidget* parent = 0);
|
||||||
LineEdit* searchLine(){ return m_searchLine; }
|
LineEdit* searchLine(){ return m_searchLine; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "qupzilla.h"
|
#include "qupzilla.h"
|
||||||
#include "webview.h"
|
#include "webview.h"
|
||||||
|
|
||||||
SiteInfo::SiteInfo(QupZilla* mainClass, QWidget *parent) :
|
SiteInfo::SiteInfo(QupZilla* mainClass, QWidget* parent) :
|
||||||
QDialog(parent)
|
QDialog(parent)
|
||||||
,ui(new Ui::SiteInfo)
|
,ui(new Ui::SiteInfo)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
|
@ -34,11 +34,11 @@ class SiteInfo : public QDialog
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SiteInfo(QupZilla* mainClass, QWidget *parent = 0);
|
explicit SiteInfo(QupZilla* mainClass, QWidget* parent = 0);
|
||||||
~SiteInfo();
|
~SiteInfo();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::SiteInfo *ui;
|
Ui::SiteInfo* ui;
|
||||||
QupZilla* p_QupZilla;
|
QupZilla* p_QupZilla;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "ui_siteinfowidget.h"
|
#include "ui_siteinfowidget.h"
|
||||||
#include "qupzilla.h"
|
#include "qupzilla.h"
|
||||||
|
|
||||||
SiteInfoWidget::SiteInfoWidget(QupZilla* mainClass, QWidget *parent) :
|
SiteInfoWidget::SiteInfoWidget(QupZilla* mainClass, QWidget* parent) :
|
||||||
QMenu(parent)
|
QMenu(parent)
|
||||||
,ui(new Ui::SiteInfoWidget)
|
,ui(new Ui::SiteInfoWidget)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
|
@ -31,13 +31,13 @@ class SiteInfoWidget : public QMenu
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SiteInfoWidget(QupZilla* mainClass, QWidget *parent = 0);
|
explicit SiteInfoWidget(QupZilla* mainClass, QWidget* parent = 0);
|
||||||
~SiteInfoWidget();
|
~SiteInfoWidget();
|
||||||
|
|
||||||
void showAt(QWidget* _parent);
|
void showAt(QWidget* _parent);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::SiteInfoWidget *ui;
|
Ui::SiteInfoWidget* ui;
|
||||||
QupZilla* p_QupZilla;
|
QupZilla* p_QupZilla;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "tabwidget.h"
|
#include "tabwidget.h"
|
||||||
#include "qupzilla.h"
|
#include "qupzilla.h"
|
||||||
|
|
||||||
TabBar::TabBar(QupZilla* mainClass, QWidget *parent) :
|
TabBar::TabBar(QupZilla* mainClass, QWidget* parent) :
|
||||||
QTabBar(parent)
|
QTabBar(parent)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
,m_clickedTab(0)
|
,m_clickedTab(0)
|
||||||
@ -49,7 +49,7 @@ void TabBar::loadSettings()
|
|||||||
|
|
||||||
void TabBar::contextMenuRequested(const QPoint &position)
|
void TabBar::contextMenuRequested(const QPoint &position)
|
||||||
{
|
{
|
||||||
TabWidget *tabWidget = qobject_cast<TabWidget*>(parentWidget());
|
TabWidget* tabWidget = qobject_cast<TabWidget*>(parentWidget());
|
||||||
if (!tabWidget)
|
if (!tabWidget)
|
||||||
return;
|
return;
|
||||||
int index = tabAt(position);
|
int index = tabAt(position);
|
||||||
@ -126,9 +126,9 @@ void TabBar::bookmarkTab()
|
|||||||
p_QupZilla->addBookmark(p_QupZilla->weView(m_clickedTab)->url(), p_QupZilla->weView(m_clickedTab)->title());
|
p_QupZilla->addBookmark(p_QupZilla->weView(m_clickedTab)->url(), p_QupZilla->weView(m_clickedTab)->title());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabBar::mouseDoubleClickEvent(QMouseEvent *event)
|
void TabBar::mouseDoubleClickEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
TabWidget *tabWidget = qobject_cast<TabWidget*>(parentWidget());
|
TabWidget* tabWidget = qobject_cast<TabWidget*>(parentWidget());
|
||||||
if (!tabWidget)
|
if (!tabWidget)
|
||||||
return;
|
return;
|
||||||
if (event->button() == Qt::LeftButton && tabAt(event->pos()) == -1) {
|
if (event->button() == Qt::LeftButton && tabAt(event->pos()) == -1) {
|
||||||
|
@ -35,7 +35,7 @@ class TabBar : public QTabBar
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit TabBar(QupZilla* mainClass, QWidget *parent = 0);
|
explicit TabBar(QupZilla* mainClass, QWidget* parent = 0);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void reloadTab(int index);
|
void reloadTab(int index);
|
||||||
@ -60,7 +60,7 @@ private slots:
|
|||||||
void closeTab() { emit closeTab(m_clickedTab); }
|
void closeTab() { emit closeTab(m_clickedTab); }
|
||||||
void bookmarkTab();
|
void bookmarkTab();
|
||||||
private:
|
private:
|
||||||
void mouseDoubleClickEvent(QMouseEvent *event);
|
void mouseDoubleClickEvent(QMouseEvent* event);
|
||||||
|
|
||||||
QupZilla* p_QupZilla;
|
QupZilla* p_QupZilla;
|
||||||
bool m_showCloseButtonWithOneTab;
|
bool m_showCloseButtonWithOneTab;
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
#include "webtab.h"
|
#include "webtab.h"
|
||||||
|
|
||||||
TabWidget::TabWidget(QupZilla* mainClass, QWidget *parent) :
|
TabWidget::TabWidget(QupZilla* mainClass, QWidget* parent) :
|
||||||
QTabWidget(parent)
|
QTabWidget(parent)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
,m_canRestoreTab(false)
|
,m_canRestoreTab(false)
|
||||||
@ -124,7 +124,7 @@ void TabWidget::aboutToShowTabsMenu()
|
|||||||
|
|
||||||
void TabWidget::actionChangeIndex()
|
void TabWidget::actionChangeIndex()
|
||||||
{
|
{
|
||||||
if (QAction *action = qobject_cast<QAction*>(sender())) {
|
if (QAction* action = qobject_cast<QAction*>(sender())) {
|
||||||
setCurrentIndex(action->data().toInt());
|
setCurrentIndex(action->data().toInt());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -275,7 +275,7 @@ QByteArray TabWidget::saveState()
|
|||||||
QStringList tabs;
|
QStringList tabs;
|
||||||
QList<QByteArray> tabsHistory;
|
QList<QByteArray> tabsHistory;
|
||||||
for (int i = 0; i < count(); ++i) {
|
for (int i = 0; i < count(); ++i) {
|
||||||
if (WebView *tab = weView(i)) {
|
if (WebView* tab = weView(i)) {
|
||||||
tabs.append(QString::fromUtf8(tab->url().toEncoded()));
|
tabs.append(QString::fromUtf8(tab->url().toEncoded()));
|
||||||
if (tab->history()->count() != 0) {
|
if (tab->history()->count() != 0) {
|
||||||
QByteArray tabHistory;
|
QByteArray tabHistory;
|
||||||
|
@ -38,7 +38,7 @@ class TabWidget : public QTabWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit TabWidget(QupZilla* mainclass, QWidget *parent = 0);
|
explicit TabWidget(QupZilla* mainclass, QWidget* parent = 0);
|
||||||
~TabWidget();
|
~TabWidget();
|
||||||
enum OpenUrlIn{ CurrentTab, NewSelectedTab, NewNotSelectedTab, NewTab = NewSelectedTab };
|
enum OpenUrlIn{ CurrentTab, NewSelectedTab, NewNotSelectedTab, NewTab = NewSelectedTab };
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include "webpluginfactory.h"
|
#include "webpluginfactory.h"
|
||||||
#include "mainapplication.h"
|
#include "mainapplication.h"
|
||||||
|
|
||||||
WebPage::WebPage(WebView *parent, QupZilla* mainClass)
|
WebPage::WebPage(WebView* parent, QupZilla* mainClass)
|
||||||
: QWebPage(parent)
|
: QWebPage(parent)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
,m_view(parent)
|
,m_view(parent)
|
||||||
@ -59,7 +59,7 @@ void WebPage::handleUnsupportedContent(QNetworkReply* reply)
|
|||||||
qDebug() << "error" << reply->errorString();
|
qDebug() << "error" << reply->errorString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type)
|
bool WebPage::acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest &request, NavigationType type)
|
||||||
{
|
{
|
||||||
m_lastRequest = request;
|
m_lastRequest = request;
|
||||||
m_lastRequestType = type;
|
m_lastRequestType = type;
|
||||||
@ -108,7 +108,7 @@ QWebPage* WebPage::createWindow(QWebPage::WebWindowType type)
|
|||||||
return p_QupZilla->weView(index)->page();
|
return p_QupZilla->weView(index)->page();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebPage::extension(Extension extension, const ExtensionOption *option, ExtensionReturn *output)
|
bool WebPage::extension(Extension extension, const ExtensionOption* option, ExtensionReturn* output)
|
||||||
{
|
{
|
||||||
if (extension == ChooseMultipleFilesExtension)
|
if (extension == ChooseMultipleFilesExtension)
|
||||||
return QWebPage::extension(extension, option, output);
|
return QWebPage::extension(extension, option, output);
|
||||||
|
@ -40,20 +40,20 @@ class WebPage : public QWebPage
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
WebPage(WebView *parent, QupZilla* mainClass);
|
WebPage(WebView* parent, QupZilla* mainClass);
|
||||||
void populateNetworkRequest(QNetworkRequest &request);
|
void populateNetworkRequest(QNetworkRequest &request);
|
||||||
~WebPage();
|
~WebPage();
|
||||||
|
|
||||||
QString userAgentForUrl(const QUrl &url) const;
|
QString userAgentForUrl(const QUrl &url) const;
|
||||||
bool supportsExtension(Extension extension) const { return (extension == ErrorPageExtension); }
|
bool supportsExtension(Extension extension) const { return (extension == ErrorPageExtension); }
|
||||||
bool extension(Extension extension, const ExtensionOption *option, ExtensionReturn *output);
|
bool extension(Extension extension, const ExtensionOption* option, ExtensionReturn* output);
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
QWebPage* createWindow(QWebPage::WebWindowType type);
|
QWebPage* createWindow(QWebPage::WebWindowType type);
|
||||||
void handleUnsupportedContent(QNetworkReply* url);
|
void handleUnsupportedContent(QNetworkReply* url);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type);
|
bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest &request, NavigationType type);
|
||||||
|
|
||||||
QupZilla* p_QupZilla;
|
QupZilla* p_QupZilla;
|
||||||
QNetworkRequest m_lastRequest;
|
QNetworkRequest m_lastRequest;
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#include "qupzilla.h"
|
#include "qupzilla.h"
|
||||||
#include "webview.h"
|
#include "webview.h"
|
||||||
|
|
||||||
WebTab::WebTab(QupZilla* mainClass, QWidget *parent)
|
WebTab::WebTab(QupZilla* mainClass, QWidget* parent)
|
||||||
:QWidget(parent)
|
:QWidget(parent)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
,m_view(0)
|
,m_view(0)
|
||||||
@ -36,7 +36,7 @@ WebTab::WebTab(QupZilla* mainClass, QWidget *parent)
|
|||||||
connect(m_view, SIGNAL(showNotification(QWidget*)), this, SLOT(showNotification(QWidget*)));
|
connect(m_view, SIGNAL(showNotification(QWidget*)), this, SLOT(showNotification(QWidget*)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebTab::showNotification(QWidget *notif)
|
void WebTab::showNotification(QWidget* notif)
|
||||||
{
|
{
|
||||||
if (m_layout->count() > 1)
|
if (m_layout->count() > 1)
|
||||||
delete m_layout->itemAt(0)->widget();
|
delete m_layout->itemAt(0)->widget();
|
||||||
|
@ -28,7 +28,7 @@ class WebTab : public QWidget
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit WebTab(QupZilla* mainClass, QWidget *parent = 0);
|
explicit WebTab(QupZilla* mainClass, QWidget* parent = 0);
|
||||||
~WebTab();
|
~WebTab();
|
||||||
WebView* view() { return m_view; }
|
WebView* view() { return m_view; }
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#include "pluginproxy.h"
|
#include "pluginproxy.h"
|
||||||
#include "webtab.h"
|
#include "webtab.h"
|
||||||
|
|
||||||
WebView::WebView(QupZilla* mainClass, QWidget *parent)
|
WebView::WebView(QupZilla* mainClass, QWidget* parent)
|
||||||
: QWebView(parent)
|
: QWebView(parent)
|
||||||
,p_QupZilla(mainClass)
|
,p_QupZilla(mainClass)
|
||||||
,m_progress(0)
|
,m_progress(0)
|
||||||
@ -135,17 +135,17 @@ void WebView::loadStarted()
|
|||||||
// m_loadingTimer->start(1000*20); //20 seconds timeout to automatically "stop" loading animation
|
// m_loadingTimer->start(1000*20); //20 seconds timeout to automatically "stop" loading animation
|
||||||
}
|
}
|
||||||
|
|
||||||
QLabel *WebView::animationLoading(int index, bool addMovie)
|
QLabel* WebView::animationLoading(int index, bool addMovie)
|
||||||
{
|
{
|
||||||
if (-1 == index)
|
if (-1 == index)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
QLabel *loadingAnimation = qobject_cast<QLabel*>(tabWidget()->getTabBar()->tabButton(index, QTabBar::LeftSide));
|
QLabel* loadingAnimation = qobject_cast<QLabel*>(tabWidget()->getTabBar()->tabButton(index, QTabBar::LeftSide));
|
||||||
if (!loadingAnimation) {
|
if (!loadingAnimation) {
|
||||||
loadingAnimation = new QLabel(this);
|
loadingAnimation = new QLabel(this);
|
||||||
}
|
}
|
||||||
if (addMovie && !loadingAnimation->movie()) {
|
if (addMovie && !loadingAnimation->movie()) {
|
||||||
QMovie *movie = new QMovie(":icons/other/progress.gif", QByteArray(), loadingAnimation);
|
QMovie* movie = new QMovie(":icons/other/progress.gif", QByteArray(), loadingAnimation);
|
||||||
movie->setSpeed(70);
|
movie->setSpeed(70);
|
||||||
loadingAnimation->setMovie(movie);
|
loadingAnimation->setMovie(movie);
|
||||||
movie->start();
|
movie->start();
|
||||||
@ -250,9 +250,9 @@ void WebView::linkHovered(const QString &link, const QString &title, const QStri
|
|||||||
|
|
||||||
TabWidget* WebView::tabWidget() const
|
TabWidget* WebView::tabWidget() const
|
||||||
{
|
{
|
||||||
QObject *widget = this->parent();
|
QObject* widget = this->parent();
|
||||||
while (widget) {
|
while (widget) {
|
||||||
if (TabWidget *tw = qobject_cast<TabWidget*>(widget))
|
if (TabWidget* tw = qobject_cast<TabWidget*>(widget))
|
||||||
return tw;
|
return tw;
|
||||||
widget = widget->parent();
|
widget = widget->parent();
|
||||||
}
|
}
|
||||||
@ -323,7 +323,7 @@ void WebView::checkRss()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::mousePressEvent(QMouseEvent *event)
|
void WebView::mousePressEvent(QMouseEvent* event)
|
||||||
{
|
{
|
||||||
switch (event->button()) {
|
switch (event->button()) {
|
||||||
case Qt::XButton1:
|
case Qt::XButton1:
|
||||||
@ -354,7 +354,7 @@ void WebView::mouseReleaseEvent(QMouseEvent* event)
|
|||||||
QWebView::mouseReleaseEvent(event);
|
QWebView::mouseReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::keyPressEvent(QKeyEvent *event)
|
void WebView::keyPressEvent(QKeyEvent* event)
|
||||||
{
|
{
|
||||||
switch (event->key()) {
|
switch (event->key()) {
|
||||||
case Qt::Key_Back:
|
case Qt::Key_Back:
|
||||||
@ -379,9 +379,9 @@ void WebView::keyPressEvent(QKeyEvent *event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::contextMenuEvent(QContextMenuEvent *event)
|
void WebView::contextMenuEvent(QContextMenuEvent* event)
|
||||||
{
|
{
|
||||||
QMenu *menu = new QMenu(this);
|
QMenu* menu = new QMenu(this);
|
||||||
|
|
||||||
QWebHitTestResult r = page()->mainFrame()->hitTestContent(event->pos());
|
QWebHitTestResult r = page()->mainFrame()->hitTestContent(event->pos());
|
||||||
|
|
||||||
@ -492,42 +492,42 @@ void WebView::contextMenuEvent(QContextMenuEvent *event)
|
|||||||
QWebView::contextMenuEvent(event);
|
QWebView::contextMenuEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::addNotification(QWidget *notif)
|
void WebView::addNotification(QWidget* notif)
|
||||||
{
|
{
|
||||||
emit showNotification(notif);
|
emit showNotification(notif);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::openUrlInNewTab()
|
void WebView::openUrlInNewTab()
|
||||||
{
|
{
|
||||||
if (QAction *action = qobject_cast<QAction*>(sender())) {
|
if (QAction* action = qobject_cast<QAction*>(sender())) {
|
||||||
tabWidget()->addView(action->data().toUrl(), tr("New tab"), TabWidget::NewNotSelectedTab);
|
tabWidget()->addView(action->data().toUrl(), tr("New tab"), TabWidget::NewNotSelectedTab);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::openUrlInNewWindow()
|
void WebView::openUrlInNewWindow()
|
||||||
{
|
{
|
||||||
if (QAction *action = qobject_cast<QAction*>(sender())) {
|
if (QAction* action = qobject_cast<QAction*>(sender())) {
|
||||||
mApp->makeNewWindow(false, action->data().toString());
|
mApp->makeNewWindow(false, action->data().toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::sendLinkByMail()
|
void WebView::sendLinkByMail()
|
||||||
{
|
{
|
||||||
if (QAction *action = qobject_cast<QAction*>(sender())) {
|
if (QAction* action = qobject_cast<QAction*>(sender())) {
|
||||||
QDesktopServices::openUrl(QUrl("mailto:?body="+action->data().toString()));
|
QDesktopServices::openUrl(QUrl("mailto:?body="+action->data().toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::copyLinkToClipboard()
|
void WebView::copyLinkToClipboard()
|
||||||
{
|
{
|
||||||
if (QAction *action = qobject_cast<QAction*>(sender())) {
|
if (QAction* action = qobject_cast<QAction*>(sender())) {
|
||||||
QApplication::clipboard()->setText(action->data().toString());
|
QApplication::clipboard()->setText(action->data().toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::searchOnGoogle()
|
void WebView::searchOnGoogle()
|
||||||
{
|
{
|
||||||
if (QAction *action = qobject_cast<QAction*>(sender())) {
|
if (QAction* action = qobject_cast<QAction*>(sender())) {
|
||||||
load(QUrl("http://www.google.com/search?client=qupzilla&q="+action->data().toString()));
|
load(QUrl("http://www.google.com/search?client=qupzilla&q="+action->data().toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -549,7 +549,7 @@ void WebView::copyImageToClipboard()
|
|||||||
|
|
||||||
void WebView::showImage()
|
void WebView::showImage()
|
||||||
{
|
{
|
||||||
if (QAction *action = qobject_cast<QAction*>(sender())) {
|
if (QAction* action = qobject_cast<QAction*>(sender())) {
|
||||||
load(QUrl(action->data().toString()));
|
load(QUrl(action->data().toString()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -561,7 +561,7 @@ void WebView::showSource()
|
|||||||
|
|
||||||
void WebView::downloadLinkToDisk()
|
void WebView::downloadLinkToDisk()
|
||||||
{
|
{
|
||||||
if (QAction *action = qobject_cast<QAction*>(sender())) {
|
if (QAction* action = qobject_cast<QAction*>(sender())) {
|
||||||
QNetworkRequest request(action->data().toUrl());
|
QNetworkRequest request(action->data().toUrl());
|
||||||
DownloadManager* dManager = mApp->downManager();
|
DownloadManager* dManager = mApp->downManager();
|
||||||
dManager->download(request);
|
dManager->download(request);
|
||||||
@ -576,7 +576,7 @@ void WebView::downloadRequested(const QNetworkRequest &request)
|
|||||||
|
|
||||||
void WebView::bookmarkLink()
|
void WebView::bookmarkLink()
|
||||||
{
|
{
|
||||||
if (QAction *action = qobject_cast<QAction*>(sender())) {
|
if (QAction* action = qobject_cast<QAction*>(sender())) {
|
||||||
if (action->data().isNull())
|
if (action->data().isNull())
|
||||||
p_QupZilla->bookmarkPage();
|
p_QupZilla->bookmarkPage();
|
||||||
else
|
else
|
||||||
@ -623,7 +623,7 @@ void WebView::zoomReset()
|
|||||||
applyZoom();
|
applyZoom();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebView::wheelEvent(QWheelEvent *event)
|
void WebView::wheelEvent(QWheelEvent* event)
|
||||||
{
|
{
|
||||||
if (event->modifiers() & Qt::ControlModifier) {
|
if (event->modifiers() & Qt::ControlModifier) {
|
||||||
int numDegrees = event->delta() / 8;
|
int numDegrees = event->delta() / 8;
|
||||||
|
@ -44,7 +44,7 @@ class WebView : public QWebView
|
|||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit WebView(QupZilla* mainClass, QWidget *parent = 0);
|
explicit WebView(QupZilla* mainClass, QWidget* parent = 0);
|
||||||
~WebView();
|
~WebView();
|
||||||
bool isLoading() { return m_isLoading;}
|
bool isLoading() { return m_isLoading;}
|
||||||
int getLoading() { return m_progress; }
|
int getLoading() { return m_progress; }
|
||||||
@ -104,11 +104,11 @@ private slots:
|
|||||||
void checkRss();
|
void checkRss();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void keyPressEvent(QKeyEvent *event);
|
void keyPressEvent(QKeyEvent* event);
|
||||||
void mousePressEvent(QMouseEvent *event);
|
void mousePressEvent(QMouseEvent* event);
|
||||||
void mouseReleaseEvent(QMouseEvent *event);
|
void mouseReleaseEvent(QMouseEvent* event);
|
||||||
void contextMenuEvent(QContextMenuEvent *event);
|
void contextMenuEvent(QContextMenuEvent* event);
|
||||||
void wheelEvent(QWheelEvent *event);
|
void wheelEvent(QWheelEvent* event);
|
||||||
TabWidget* tabWidget() const;
|
TabWidget* tabWidget() const;
|
||||||
int tabIndex() const;
|
int tabIndex() const;
|
||||||
bool isCurrent();
|
bool isCurrent();
|
||||||
|
Loading…
Reference in New Issue
Block a user