1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

[Cleanup] Renamed QupZilla class to BrowserWindow

This commit is contained in:
nowrep 2014-02-19 22:07:21 +01:00
parent 118478351f
commit 404fa68a1b
129 changed files with 720 additions and 713 deletions

View File

@ -20,7 +20,7 @@
#include "adblockmanager.h"
#include "adblocksubscription.h"
#include "mainapplication.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "webpage.h"
#include "tabbedwebview.h"
#include "tabwidget.h"
@ -29,9 +29,9 @@
#include <QMenu>
#include <QTimer>
AdBlockIcon::AdBlockIcon(QupZilla* mainClass, QWidget* parent)
AdBlockIcon::AdBlockIcon(BrowserWindow* window, QWidget* parent)
: ClickableLabel(parent)
, p_QupZilla(mainClass)
, m_window(window)
, m_menuAction(0)
, m_flashTimer(0)
, m_timerTicks(0)
@ -104,7 +104,7 @@ void AdBlockIcon::createMenu(QMenu* menu)
AdBlockManager* manager = AdBlockManager::instance();
AdBlockCustomList* customList = manager->customList();
WebPage* page = p_QupZilla->weView()->page();
WebPage* page = m_window->weView()->page();
const QUrl pageUrl = page->url();
menu->addAction(tr("Show AdBlock &Settings"), manager, SLOT(showDialog()));

View File

@ -25,13 +25,13 @@
class QMenu;
class QUrl;
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT AdBlockIcon : public ClickableLabel
{
Q_OBJECT
public:
explicit AdBlockIcon(QupZilla* mainClass, QWidget* parent = 0);
explicit AdBlockIcon(BrowserWindow* window, QWidget* parent = 0);
~AdBlockIcon();
void popupBlocked(const QString &ruleString, const QUrl &url);
@ -51,7 +51,7 @@ private slots:
void stopAnimation();
private:
QupZilla* p_QupZilla;
BrowserWindow* m_window;
QAction* m_menuAction;
QVector<QPair<AdBlockRule, QUrl> > m_blockedPopups;

View File

@ -23,7 +23,7 @@
#include "webpage.h"
#include "qztools.h"
#include "networkmanager.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "settings.h"
#include <QDateTime>

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "qupzilla.h"
#include "browserwindow.h"
#include "tabwidget.h"
#include "tabbar.h"
#include "webpage.h"
@ -106,15 +106,9 @@
#define MENU_RECEIVER mApp->macMenuReceiver()
#endif
const QString QupZilla::VERSION = "1.7.0";
const QString QupZilla::BUILDTIME = __DATE__" "__TIME__;
const QString QupZilla::AUTHOR = "David Rosca";
const QString QupZilla::COPYRIGHT = "2010-2014";
const QString QupZilla::WWWADDRESS = "http://www.qupzilla.com";
const QString QupZilla::WIKIADDRESS = "https://github.com/QupZilla/qupzilla/wiki";
const QString QupZilla::WEBKITVERSION = qWebKitVersion();
const QString BrowserWindow::WEBKITVERSION = qWebKitVersion();
QupZilla::QupZilla(Qz::BrowserWindow type, QUrl startUrl)
BrowserWindow::BrowserWindow(Qz::BrowserWindowType type, QUrl startUrl)
: QMainWindow(0)
, m_historyMenuChanged(true)
, m_bookmarksMenuChanged(true)
@ -164,12 +158,12 @@ QupZilla::QupZilla(Qz::BrowserWindow type, QUrl startUrl)
}
}
void QupZilla::openWithTab(WebTab* tab)
void BrowserWindow::openWithTab(WebTab* tab)
{
m_startTab = tab;
}
void QupZilla::postLaunch()
void BrowserWindow::postLaunch()
{
#ifdef QZ_WS_X11
setUpdatesEnabled(false);
@ -280,7 +274,7 @@ void QupZilla::postLaunch()
QTimer::singleShot(0, tabWidget()->getTabBar(), SLOT(ensureVisible()));
}
void QupZilla::setupUi()
void BrowserWindow::setupUi()
{
int locationBarWidth;
int websearchBarWidth;
@ -377,7 +371,7 @@ void QupZilla::setupUi()
QToolTip::setPalette(pal);
}
void QupZilla::setupMenu()
void BrowserWindow::setupMenu()
{
#ifdef Q_OS_MAC
if (menuBar()) {
@ -674,7 +668,7 @@ void QupZilla::setupMenu()
#endif
}
void QupZilla::setupOtherActions()
void BrowserWindow::setupOtherActions()
{
m_actionRestoreTab = new QAction(QIcon::fromTheme("user-trash"), tr("Restore &Closed Tab"), this);
m_actionRestoreTab->setShortcut(QKeySequence("Ctrl+Shift+T"));
@ -708,7 +702,7 @@ void QupZilla::setupOtherActions()
}
}
QKeySequence QupZilla::actionShortcut(QKeySequence shortcut, QKeySequence fallBack,
QKeySequence BrowserWindow::actionShortcut(QKeySequence shortcut, QKeySequence fallBack,
QKeySequence shortcutRTL, QKeySequence fallbackRTL)
{
if (isRightToLeft() && (!shortcutRTL.isEmpty() || !fallbackRTL.isEmpty())) {
@ -769,7 +763,7 @@ void QupZilla::refreshStateOfAllActions()
}
#endif
void QupZilla::loadSettings()
void BrowserWindow::loadSettings()
{
Settings settings;
@ -881,17 +875,17 @@ void QupZilla::loadSettings()
#endif
}
void QupZilla::goNext()
void BrowserWindow::goNext()
{
weView()->forward();
}
void QupZilla::goBack()
void BrowserWindow::goBack()
{
weView()->back();
}
QMenuBar* QupZilla::menuBar() const
QMenuBar* BrowserWindow::menuBar() const
{
#ifdef Q_OS_MAC
return mApp->macMenuReceiver()->menuBar();
@ -900,12 +894,12 @@ QMenuBar* QupZilla::menuBar() const
#endif
}
TabbedWebView* QupZilla::weView() const
TabbedWebView* BrowserWindow::weView() const
{
return weView(m_tabWidget->currentIndex());
}
TabbedWebView* QupZilla::weView(int index) const
TabbedWebView* BrowserWindow::weView(int index) const
{
WebTab* webTab = qobject_cast<WebTab*>(m_tabWidget->widget(index));
if (!webTab) {
@ -915,29 +909,29 @@ TabbedWebView* QupZilla::weView(int index) const
return webTab->view();
}
LocationBar* QupZilla::locationBar() const
LocationBar* BrowserWindow::locationBar() const
{
return qobject_cast<LocationBar*>(m_tabWidget->locationBars()->currentWidget());
}
Qz::BrowserWindow QupZilla::windowType() const
Qz::BrowserWindowType BrowserWindow::windowType() const
{
return m_windowType;
}
void QupZilla::popupToolbarsMenu(const QPoint &pos)
void BrowserWindow::popupToolbarsMenu(const QPoint &pos)
{
aboutToShowViewMenu();
m_toolbarsMenu->exec(pos);
aboutToHideViewMenu();
}
bool QupZilla::isTransparentBackgroundAllowed()
bool BrowserWindow::isTransparentBackgroundAllowed()
{
return m_usingTransparentBackground && !isFullScreen();
}
bool QupZilla::tabsOnTop() const
bool BrowserWindow::tabsOnTop() const
{
if (m_tabsOnTopState == -1) {
m_tabsOnTopState = qzSettings->tabsOnTop ? 1 : 0;
@ -946,7 +940,7 @@ bool QupZilla::tabsOnTop() const
return m_tabsOnTopState == 1;
}
void QupZilla::setWindowTitle(const QString &t)
void BrowserWindow::setWindowTitle(const QString &t)
{
QString title = t;
@ -962,7 +956,7 @@ void QupZilla::setWindowTitle(const QString &t)
QMainWindow::setWindowTitle(title);
}
void QupZilla::receiveMessage(Qz::AppMessageType mes, bool state)
void BrowserWindow::receiveMessage(Qz::AppMessageType mes, bool state)
{
switch (mes) {
case Qz::AM_SetAdBlockIconEnabled:
@ -994,19 +988,19 @@ void QupZilla::receiveMessage(Qz::AppMessageType mes, bool state)
}
}
void QupZilla::aboutToShowFileMenu()
void BrowserWindow::aboutToShowFileMenu()
{
#ifndef Q_OS_MAC
m_actionCloseWindow->setEnabled(mApp->windowCount() > 1);
#endif
}
void QupZilla::aboutToHideFileMenu()
void BrowserWindow::aboutToHideFileMenu()
{
m_actionCloseWindow->setEnabled(true);
}
void QupZilla::aboutToShowHistoryMenu()
void BrowserWindow::aboutToShowHistoryMenu()
{
TabbedWebView* view = weView();
if (!view) {
@ -1017,13 +1011,13 @@ void QupZilla::aboutToShowHistoryMenu()
m_menuHistory->actions().at(1)->setEnabled(view->history()->canGoForward());
}
void QupZilla::aboutToHideHistoryMenu()
void BrowserWindow::aboutToHideHistoryMenu()
{
m_menuHistory->actions().at(0)->setEnabled(true);
m_menuHistory->actions().at(1)->setEnabled(true);
}
void QupZilla::aboutToShowClosedTabsMenu()
void BrowserWindow::aboutToShowClosedTabsMenu()
{
m_menuClosedTabs->clear();
int i = 0;
@ -1046,7 +1040,7 @@ void QupZilla::aboutToShowClosedTabsMenu()
}
}
void QupZilla::aboutToShowHistoryRecentMenu()
void BrowserWindow::aboutToShowHistoryRecentMenu()
{
m_menuHistoryRecent->clear();
QSqlQuery query;
@ -1071,7 +1065,7 @@ void QupZilla::aboutToShowHistoryRecentMenu()
}
}
void QupZilla::aboutToShowHistoryMostMenu()
void BrowserWindow::aboutToShowHistoryMostMenu()
{
m_menuHistoryMost->clear();
@ -1096,7 +1090,7 @@ void QupZilla::aboutToShowHistoryMostMenu()
}
}
void QupZilla::aboutToShowViewMenu()
void BrowserWindow::aboutToShowViewMenu()
{
m_actionShowToolbar->setChecked(m_navigationBar->isVisible());
#ifndef Q_OS_MAC
@ -1116,14 +1110,14 @@ void QupZilla::aboutToShowViewMenu()
#endif
}
void QupZilla::aboutToHideViewMenu()
void BrowserWindow::aboutToHideViewMenu()
{
#ifndef Q_OS_MAC
m_actionPageSource->setEnabled(false);
#endif
}
void QupZilla::aboutToShowEditMenu()
void BrowserWindow::aboutToShowEditMenu()
{
WebView* view = weView();
@ -1137,7 +1131,7 @@ void QupZilla::aboutToShowEditMenu()
m_menuEdit->actions().at(7)->setEnabled(view->pageAction(QWebPage::SelectAll)->isEnabled());
}
void QupZilla::aboutToHideEditMenu()
void BrowserWindow::aboutToHideEditMenu()
{
#ifndef Q_OS_MAC
foreach (QAction* act, m_menuEdit->actions()) {
@ -1149,19 +1143,19 @@ void QupZilla::aboutToHideEditMenu()
m_actionPreferences->setEnabled(true);
}
void QupZilla::aboutToShowToolsMenu()
void BrowserWindow::aboutToShowToolsMenu()
{
m_actionPageInfo->setEnabled(true);
}
void QupZilla::aboutToHideToolsMenu()
void BrowserWindow::aboutToHideToolsMenu()
{
#ifndef Q_OS_MAC
m_actionPageInfo->setEnabled(false);
#endif
}
void QupZilla::aboutToShowEncodingMenu()
void BrowserWindow::aboutToShowEncodingMenu()
{
m_menuEncoding->clear();
QMenu* menuISO = new QMenu("ISO", this);
@ -1228,7 +1222,7 @@ void QupZilla::aboutToShowEncodingMenu()
}
}
void QupZilla::changeEncoding(QObject* obj)
void BrowserWindow::changeEncoding(QObject* obj)
{
if (!obj) {
obj = sender();
@ -1245,7 +1239,7 @@ void QupZilla::changeEncoding(QObject* obj)
}
}
void QupZilla::triggerCaretBrowsing()
void BrowserWindow::triggerCaretBrowsing()
{
#if QTWEBKIT_FROM_2_3
bool enable = !mApp->webSettings()->testAttribute(QWebSettings::CaretBrowsingEnabled);
@ -1259,98 +1253,98 @@ void QupZilla::triggerCaretBrowsing()
#endif
}
void QupZilla::bookmarkPage()
void BrowserWindow::bookmarkPage()
{
TabbedWebView* view = weView();
BookmarksTools::addBookmarkDialog(this, view->url(), view->title());
}
void QupZilla::bookmarkAllTabs()
void BrowserWindow::bookmarkAllTabs()
{
BookmarksTools::bookmarkAllTabsDialog(this, m_tabWidget);
}
void QupZilla::addBookmark(const QUrl &url, const QString &title)
void BrowserWindow::addBookmark(const QUrl &url, const QString &title)
{
BookmarksTools::addBookmarkDialog(this, url, title);
}
void QupZilla::newWindow()
void BrowserWindow::newWindow()
{
mApp->makeNewWindow(Qz::BW_NewWindow);
}
void QupZilla::goHome()
void BrowserWindow::goHome()
{
loadAddress(m_homepage);
}
void QupZilla::editUndo()
void BrowserWindow::editUndo()
{
weView()->triggerPageAction(QWebPage::Undo);
}
void QupZilla::editRedo()
void BrowserWindow::editRedo()
{
weView()->triggerPageAction(QWebPage::Redo);
}
void QupZilla::editCut()
void BrowserWindow::editCut()
{
weView()->triggerPageAction(QWebPage::Cut);
}
void QupZilla::editCopy()
void BrowserWindow::editCopy()
{
weView()->triggerPageAction(QWebPage::Copy);
}
void QupZilla::editPaste()
void BrowserWindow::editPaste()
{
weView()->triggerPageAction(QWebPage::Paste);
}
void QupZilla::editSelectAll()
void BrowserWindow::editSelectAll()
{
weView()->selectAll();
}
void QupZilla::zoomIn()
void BrowserWindow::zoomIn()
{
weView()->zoomIn();
}
void QupZilla::zoomOut()
void BrowserWindow::zoomOut()
{
weView()->zoomOut();
}
void QupZilla::zoomReset()
void BrowserWindow::zoomReset()
{
weView()->zoomReset();
}
void QupZilla::goHomeInNewTab()
void BrowserWindow::goHomeInNewTab()
{
m_tabWidget->addView(m_homepage, Qz::NT_SelectedTab);
}
void QupZilla::stop()
void BrowserWindow::stop()
{
weView()->stop();
}
void QupZilla::reload()
void BrowserWindow::reload()
{
weView()->reload();
}
void QupZilla::reloadByPassCache()
void BrowserWindow::reloadByPassCache()
{
weView()->triggerPageAction(QWebPage::ReloadAndBypassCache);
}
void QupZilla::loadActionUrl(QObject* obj)
void BrowserWindow::loadActionUrl(QObject* obj)
{
if (!obj) {
obj = sender();
@ -1361,7 +1355,7 @@ void QupZilla::loadActionUrl(QObject* obj)
}
}
void QupZilla::loadActionUrlInNewTab(QObject* obj)
void BrowserWindow::loadActionUrlInNewTab(QObject* obj)
{
if (!obj) {
obj = sender();
@ -1372,7 +1366,7 @@ void QupZilla::loadActionUrlInNewTab(QObject* obj)
}
}
void QupZilla::loadActionUrlInNewNotSelectedTab(QObject* obj)
void BrowserWindow::loadActionUrlInNewNotSelectedTab(QObject* obj)
{
if (!obj) {
obj = sender();
@ -1383,7 +1377,7 @@ void QupZilla::loadActionUrlInNewNotSelectedTab(QObject* obj)
}
}
void QupZilla::loadAddress(const QUrl &url)
void BrowserWindow::loadAddress(const QUrl &url)
{
if (weView()->webTab()->isPinned()) {
int index = m_tabWidget->addView(url, qzSettings->newTabPosition);
@ -1395,7 +1389,7 @@ void QupZilla::loadAddress(const QUrl &url)
}
}
void QupZilla::showCookieManager()
void BrowserWindow::showCookieManager()
{
CookieManager* m = mApp->cookieManager();
m->refreshTable();
@ -1405,39 +1399,39 @@ void QupZilla::showCookieManager()
}
void QupZilla::showHistoryManager()
void BrowserWindow::showHistoryManager()
{
mApp->browsingLibrary()->showHistory(this);
}
void QupZilla::showRSSManager()
void BrowserWindow::showRSSManager()
{
mApp->browsingLibrary()->showRSS(this);
}
void QupZilla::showBookmarksManager()
void BrowserWindow::showBookmarksManager()
{
mApp->browsingLibrary()->showBookmarks(this);
}
void QupZilla::showClearPrivateData()
void BrowserWindow::showClearPrivateData()
{
ClearPrivateData clear(this, this);
clear.exec();
}
void QupZilla::showDownloadManager()
void BrowserWindow::showDownloadManager()
{
mApp->downManager()->show();
}
void QupZilla::showPreferences()
void BrowserWindow::showPreferences()
{
Preferences* prefs = new Preferences(this, this);
prefs->show();
}
void QupZilla::showSource(QWebFrame* frame, const QString &selectedHtml)
void BrowserWindow::showSource(QWebFrame* frame, const QString &selectedHtml)
{
if (!frame) {
frame = weView()->page()->mainFrame();
@ -1448,14 +1442,14 @@ void QupZilla::showSource(QWebFrame* frame, const QString &selectedHtml)
source->show();
}
void QupZilla::showPageInfo()
void BrowserWindow::showPageInfo()
{
SiteInfo* info = new SiteInfo(weView(), this);
info->setAttribute(Qt::WA_DeleteOnClose);
info->show();
}
void QupZilla::showBookmarksToolbar()
void BrowserWindow::showBookmarksToolbar()
{
bool status = m_bookmarksToolbar->isVisible();
@ -1467,7 +1461,7 @@ void QupZilla::showBookmarksToolbar()
settings.setValue("Browser-View-Settings/showBookmarksToolbar", !status);
}
SideBar* QupZilla::addSideBar()
SideBar* BrowserWindow::addSideBar()
{
if (m_sideBar) {
return m_sideBar.data();
@ -1490,7 +1484,7 @@ SideBar* QupZilla::addSideBar()
return m_sideBar.data();
}
void QupZilla::saveSideBarWidth()
void BrowserWindow::saveSideBarWidth()
{
// That +1 is important here, without it, the sidebar width would
// decrease by 1 pixel every close
@ -1499,7 +1493,7 @@ void QupZilla::saveSideBarWidth()
m_webViewWidth = width() - m_sideBarWidth;
}
void QupZilla::showNavigationToolbar()
void BrowserWindow::showNavigationToolbar()
{
if (!menuBar()->isVisible() && !m_actionShowToolbar->isChecked()) {
showMenubar();
@ -1516,7 +1510,7 @@ void QupZilla::showNavigationToolbar()
setUpdatesEnabled(true);
}
void QupZilla::showMenubar()
void BrowserWindow::showMenubar()
{
#ifndef Q_OS_MAC
if (!m_navigationBar->isVisible() && !m_actionShowMenubar->isChecked()) {
@ -1535,7 +1529,7 @@ void QupZilla::showMenubar()
#endif
}
void QupZilla::showStatusbar()
void BrowserWindow::showStatusbar()
{
setUpdatesEnabled(false);
@ -1548,7 +1542,7 @@ void QupZilla::showStatusbar()
setUpdatesEnabled(true);
}
void QupZilla::showWebInspector(bool toggle)
void BrowserWindow::showWebInspector(bool toggle)
{
if (m_webInspectorDock) {
if (toggle) {
@ -1572,13 +1566,13 @@ void QupZilla::showWebInspector(bool toggle)
#endif
}
void QupZilla::showBookmarkImport()
void BrowserWindow::showBookmarkImport()
{
BookmarksImportDialog* b = new BookmarksImportDialog(this);
b->show();
}
void QupZilla::triggerTabsOnTop(bool enable)
void BrowserWindow::triggerTabsOnTop(bool enable)
{
if (enable) {
m_mainLayout->insertWidget(0, m_tabWidget->getTabBar());
@ -1604,12 +1598,12 @@ void QupZilla::triggerTabsOnTop(bool enable)
#endif
}
void QupZilla::refreshHistory()
void BrowserWindow::refreshHistory()
{
m_navigationBar->refreshHistory();
}
void QupZilla::currentTabChanged()
void BrowserWindow::currentTabChanged()
{
TabbedWebView* view = weView();
if (!view) {
@ -1632,7 +1626,7 @@ void QupZilla::currentTabChanged()
setTabOrder(m_navigationBar->searchLine(), view);
}
void QupZilla::updateLoadingActions()
void BrowserWindow::updateLoadingActions()
{
TabbedWebView* view = weView();
if (!view) {
@ -1655,37 +1649,37 @@ void QupZilla::updateLoadingActions()
}
}
void QupZilla::addDeleteOnCloseWidget(QWidget* widget)
void BrowserWindow::addDeleteOnCloseWidget(QWidget* widget)
{
if (!m_deleteOnCloseWidgets.contains(widget)) {
m_deleteOnCloseWidgets.append(widget);
}
}
void QupZilla::restoreWindowState(const RestoreManager::WindowData &d)
void BrowserWindow::restoreWindowState(const RestoreManager::WindowData &d)
{
restoreState(d.windowState);
m_tabWidget->restoreState(d.tabsState, d.currentTab);
}
void QupZilla::aboutQupZilla()
void BrowserWindow::aboutQupZilla()
{
AboutDialog about(this);
about.exec();
}
void QupZilla::addTab()
void BrowserWindow::addTab()
{
m_tabWidget->addView(QUrl(), Qz::NT_SelectedNewEmptyTab, true);
}
void QupZilla::webSearch()
void BrowserWindow::webSearch()
{
m_navigationBar->searchLine()->setFocus();
m_navigationBar->searchLine()->selectAll();
}
void QupZilla::searchOnPage()
void BrowserWindow::searchOnPage()
{
SearchToolBar* toolBar = searchToolBar();
@ -1706,7 +1700,7 @@ void QupZilla::searchOnPage()
#endif
}
void QupZilla::openFile()
void BrowserWindow::openFile()
{
const QString fileTypes = QString("%1(*.html *.htm *.shtml *.shtm *.xhtml);;"
"%2(*.png *.jpg *.jpeg *.bmp *.gif *.svg *.tiff);;"
@ -1720,18 +1714,18 @@ void QupZilla::openFile()
}
}
void QupZilla::openLocation()
void BrowserWindow::openLocation()
{
locationBar()->setFocus();
locationBar()->selectAll();
}
bool QupZilla::fullScreenNavigationVisible() const
bool BrowserWindow::fullScreenNavigationVisible() const
{
return m_navigationContainer->isVisible();
}
void QupZilla::showNavigationWithFullScreen()
void BrowserWindow::showNavigationWithFullScreen()
{
if (m_hideNavigationTimer->isActive()) {
m_hideNavigationTimer->stop();
@ -1741,14 +1735,14 @@ void QupZilla::showNavigationWithFullScreen()
m_tabWidget->getTabBar()->updateVisibilityWithFullscreen(true);
}
void QupZilla::hideNavigationWithFullScreen()
void BrowserWindow::hideNavigationWithFullScreen()
{
if (!m_hideNavigationTimer->isActive()) {
m_hideNavigationTimer->start();
}
}
void QupZilla::hideNavigationSlot()
void BrowserWindow::hideNavigationSlot()
{
TabbedWebView* view = weView();
bool mouseInView = view && view->underMouse();
@ -1759,7 +1753,7 @@ void QupZilla::hideNavigationSlot()
}
}
bool QupZilla::event(QEvent* event)
bool BrowserWindow::event(QEvent* event)
{
switch (event->type()) {
case QEvent::WindowStateChange: {
@ -1822,7 +1816,7 @@ bool QupZilla::event(QEvent* event)
return QMainWindow::event(event);
}
void QupZilla::toggleFullScreen()
void BrowserWindow::toggleFullScreen()
{
if (isFullScreen()) {
showNormal();
@ -1832,21 +1826,21 @@ void QupZilla::toggleFullScreen()
}
}
void QupZilla::savePage()
void BrowserWindow::savePage()
{
weView()->savePageAs();
}
void QupZilla::sendLink()
void BrowserWindow::sendLink()
{
weView()->sendPageByMail();
}
void QupZilla::printPage(QWebFrame* frame)
void BrowserWindow::printPage(QWebFrame* frame)
{
QPrintPreviewDialog* dialog = new QPrintPreviewDialog(this);
dialog->resize(800, 750);
dialog->printer()->setCreator(tr("QupZilla %1 (%2)").arg(VERSION, WWWADDRESS));
dialog->printer()->setCreator(tr("QupZilla %1 (%2)").arg(Qz::VERSION, Qz::WWWADDRESS));
if (!frame) {
dialog->printer()->setDocName(QzTools::getFileNameFromUrl(weView()->url()));
@ -1864,20 +1858,20 @@ void QupZilla::printPage(QWebFrame* frame)
dialog->deleteLater();
}
void QupZilla::savePageScreen()
void BrowserWindow::savePageScreen()
{
PageScreen* p = new PageScreen(weView(), this);
p->show();
}
void QupZilla::resizeEvent(QResizeEvent* event)
void BrowserWindow::resizeEvent(QResizeEvent* event)
{
m_bookmarksToolbar->setMaximumWidth(width());
QMainWindow::resizeEvent(event);
}
void QupZilla::keyPressEvent(QKeyEvent* event)
void BrowserWindow::keyPressEvent(QKeyEvent* event)
{
if (mApp->plugins()->processKeyPress(Qz::ON_QupZilla, this, event)) {
return;
@ -2057,7 +2051,7 @@ void QupZilla::keyPressEvent(QKeyEvent* event)
QMainWindow::keyPressEvent(event);
}
void QupZilla::keyReleaseEvent(QKeyEvent* event)
void BrowserWindow::keyReleaseEvent(QKeyEvent* event)
{
if (mApp->plugins()->processKeyRelease(Qz::ON_QupZilla, this, event)) {
return;
@ -2066,7 +2060,7 @@ void QupZilla::keyReleaseEvent(QKeyEvent* event)
QMainWindow::keyReleaseEvent(event);
}
void QupZilla::closeEvent(QCloseEvent* event)
void BrowserWindow::closeEvent(QCloseEvent* event)
{
if (mApp->isClosing()) {
return;
@ -2121,7 +2115,7 @@ void QupZilla::closeEvent(QCloseEvent* event)
event->accept();
}
SearchToolBar* QupZilla::searchToolBar()
SearchToolBar* BrowserWindow::searchToolBar()
{
SearchToolBar* toolBar = 0;
const int searchPos = 3;
@ -2133,7 +2127,7 @@ SearchToolBar* QupZilla::searchToolBar()
return toolBar;
}
void QupZilla::disconnectObjects()
void BrowserWindow::disconnectObjects()
{
// Disconnecting all important widgets before deleting this window
// so it cannot happen that slots will be invoked after the object
@ -2164,7 +2158,7 @@ void QupZilla::disconnectObjects()
mApp->plugins()->emitMainWindowDeleted(this);
}
void QupZilla::closeWindow()
void BrowserWindow::closeWindow()
{
#ifdef Q_OS_MAC
close();
@ -2175,7 +2169,7 @@ void QupZilla::closeWindow()
#endif
}
bool QupZilla::quitApp()
bool BrowserWindow::quitApp()
{
if (m_sideBar) {
saveSideBarWidth();
@ -2200,7 +2194,7 @@ bool QupZilla::quitApp()
return true;
}
void QupZilla::closeTab()
void BrowserWindow::closeTab()
{
// Don't close pinned tabs with keyboard shortcuts (Ctrl+W, Ctrl+F4)
if (weView() && !weView()->webTab()->isPinned()) {
@ -2208,7 +2202,7 @@ void QupZilla::closeTab()
}
}
void QupZilla::restoreClosedTab(QObject* obj)
void BrowserWindow::restoreClosedTab(QObject* obj)
{
if (!obj) {
obj = sender();
@ -2216,17 +2210,17 @@ void QupZilla::restoreClosedTab(QObject* obj)
m_tabWidget->restoreClosedTab(obj);
}
void QupZilla::restoreAllClosedTabs()
void BrowserWindow::restoreAllClosedTabs()
{
m_tabWidget->restoreAllClosedTabs();
}
void QupZilla::clearClosedTabsList()
void BrowserWindow::clearClosedTabsList()
{
m_tabWidget->clearClosedTabsList();
}
bool QupZilla::bookmarksMenuChanged()
bool BrowserWindow::bookmarksMenuChanged()
{
#ifdef Q_OS_MAC
return mApp->macMenuReceiver()->bookmarksMenuChanged();
@ -2235,7 +2229,7 @@ bool QupZilla::bookmarksMenuChanged()
#endif
}
void QupZilla::setBookmarksMenuChanged(bool changed)
void BrowserWindow::setBookmarksMenuChanged(bool changed)
{
#ifdef Q_OS_MAC
mApp->macMenuReceiver()->setBookmarksMenuChanged(changed);
@ -2244,7 +2238,7 @@ void QupZilla::setBookmarksMenuChanged(bool changed)
#endif
}
QAction* QupZilla::menuBookmarksAction()
QAction* BrowserWindow::menuBookmarksAction()
{
#ifdef Q_OS_MAC
return mApp->macMenuReceiver()->menuBookmarksAction();
@ -2253,7 +2247,7 @@ QAction* QupZilla::menuBookmarksAction()
#endif
}
void QupZilla::setMenuBookmarksAction(QAction* action)
void BrowserWindow::setMenuBookmarksAction(QAction* action)
{
#ifdef Q_OS_MAC
mApp->macMenuReceiver()->setMenuBookmarksAction(action);
@ -2262,7 +2256,7 @@ void QupZilla::setMenuBookmarksAction(QAction* action)
#endif
}
QByteArray QupZilla::saveState(int version) const
QByteArray BrowserWindow::saveState(int version) const
{
#if defined(QZ_WS_X11) && !defined(NO_X11)
QByteArray data;
@ -2277,7 +2271,7 @@ QByteArray QupZilla::saveState(int version) const
#endif
}
bool QupZilla::restoreState(const QByteArray &state, int version)
bool BrowserWindow::restoreState(const QByteArray &state, int version)
{
#if defined(QZ_WS_X11) && !defined(NO_X11)
QByteArray windowState;
@ -2296,7 +2290,7 @@ bool QupZilla::restoreState(const QByteArray &state, int version)
}
#if defined(QZ_WS_X11) && !defined(NO_X11)
int QupZilla::getCurrentVirtualDesktop() const
int BrowserWindow::getCurrentVirtualDesktop() const
{
Display* display = static_cast<Display*>(QzTools::X11Display(this));
Atom actual_type;
@ -2324,7 +2318,7 @@ int QupZilla::getCurrentVirtualDesktop() const
return desktop;
}
void QupZilla::moveToVirtualDesktop(int desktopId)
void BrowserWindow::moveToVirtualDesktop(int desktopId)
{
// Don't move when window is already visible or it is first app window
if (desktopId < 0 || isVisible() || m_windowType == Qz::BW_FirstAppWindow) {
@ -2490,6 +2484,6 @@ bool QupZilla::eventFilter(QObject* object, QEvent* event)
}
#endif
QupZilla::~QupZilla()
BrowserWindow::~BrowserWindow()
{
}

View File

@ -51,21 +51,15 @@ class ClickableLabel;
class WebInspectorDockWidget;
class LocationBar;
class QT_QUPZILLA_EXPORT QupZilla : public QMainWindow
class QT_QUPZILLA_EXPORT BrowserWindow : public QMainWindow
{
Q_OBJECT
public:
static const QString VERSION;
static const QString BUILDTIME;
static const QString AUTHOR;
static const QString COPYRIGHT;
static const QString WWWADDRESS;
static const QString WIKIADDRESS;
static const QString WEBKITVERSION;
explicit QupZilla(Qz::BrowserWindow type, QUrl startUrl = QUrl());
~QupZilla();
explicit BrowserWindow(Qz::BrowserWindowType type, QUrl startUrl = QUrl());
~BrowserWindow();
void openWithTab(WebTab* tab);
@ -94,7 +88,7 @@ public:
TabbedWebView* weView(int index) const;
LocationBar* locationBar() const;
Qz::BrowserWindow windowType() const;
Qz::BrowserWindowType windowType() const;
TabWidget* tabWidget() { return m_tabWidget; }
BookmarksToolbar* bookmarksToolbar() { return m_bookmarksToolbar; }
StatusBarMessage* statusBarMessage() { return m_statusBarMessage; }
@ -268,7 +262,7 @@ private:
bool m_isStarting;
QUrl m_startingUrl;
QUrl m_homepage;
Qz::BrowserWindow m_windowType;
Qz::BrowserWindowType m_windowType;
WebTab* m_startTab;
QVBoxLayout* m_mainLayout;

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "commandlineoptions.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include <QCoreApplication>
#include <QFileInfo>
@ -63,7 +63,7 @@ void CommandLineOptions::showHelp()
" For more information please visit wiki at \n"
" https://github.com/QupZilla/qupzilla/wiki \n";
cout << help << " > " << QupZilla::WWWADDRESS.toUtf8().data() << endl;
cout << help << " > " << Qz::WWWADDRESS.toUtf8().data() << endl;
}
void CommandLineOptions::parseActions()
@ -97,11 +97,11 @@ void CommandLineOptions::parseActions()
}
if (arg == QLatin1String("-v") || arg == QLatin1String("--version")) {
cout << "QupZilla v" << QupZilla::VERSION.toUtf8().data()
cout << "QupZilla v" << Qz::VERSION.toUtf8().data()
#ifdef GIT_REVISION
<< " rev " << GIT_REVISION << " "
#endif
<< "(build " << QupZilla::BUILDTIME.toUtf8().data() << ")"
<< "(build " << Qz::BUILDTIME.toUtf8().data() << ")"
<< endl;
ActionPair pair;
pair.action = Qz::CL_ExitAction;

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "mainapplication.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "tabwidget.h"
#include "bookmarkstoolbar.h"
#include "cookiemanager.h"
@ -119,7 +119,7 @@ MainApplication::MainApplication(int &argc, char** argv)
#endif
{
setApplicationName("QupZilla");
setApplicationVersion(QupZilla::VERSION);
setApplicationVersion(Qz::VERSION);
setOrganizationDomain("qupzilla");
#if defined(QZ_WS_X11) && !defined(NO_SYSTEM_DATAPATH)
@ -303,7 +303,7 @@ MainApplication::MainApplication(int &argc, char** argv)
translateApp();
QupZilla* qupzilla = new QupZilla(Qz::BW_FirstAppWindow, startUrl);
BrowserWindow* qupzilla = new BrowserWindow(Qz::BW_FirstAppWindow, startUrl);
m_mainWindows.prepend(qupzilla);
connect(qupzilla, SIGNAL(message(Qz::AppMessageType,bool)), this, SLOT(sendMessages(Qz::AppMessageType,bool)));
@ -479,9 +479,9 @@ void MainApplication::setupJumpList()
QtWin::setupJumpList();
}
QupZilla* MainApplication::getWindow()
BrowserWindow* MainApplication::getWindow()
{
QupZilla* activeW = qobject_cast<QupZilla*>(activeWindow());
BrowserWindow* activeW = qobject_cast<BrowserWindow*>(activeWindow());
if (activeW) {
return activeW;
}
@ -512,9 +512,9 @@ bool MainApplication::isStateChanged()
return false;
}
QList<QupZilla*> MainApplication::mainWindows()
QList<BrowserWindow*> MainApplication::mainWindows()
{
QList<QupZilla*> list;
QList<BrowserWindow*> list;
for (int i = 0; i < m_mainWindows.count(); i++) {
if (!m_mainWindows.at(i)) {
@ -610,7 +610,7 @@ void MainApplication::receiveAppMessage(QString message)
actWin = downManager();
}
else if (text == QLatin1String("ToggleFullScreen") && actWin) {
QupZilla* qz = static_cast<QupZilla*>(actWin);
BrowserWindow* qz = static_cast<BrowserWindow*>(actWin);
qz->toggleFullScreen();
}
else if (text.startsWith(QLatin1String("OpenUrlInCurrentTab"))) {
@ -635,7 +635,7 @@ void MainApplication::receiveAppMessage(QString message)
actWin->activateWindow();
actWin->setFocus();
QupZilla* qz = qobject_cast<QupZilla*>(actWin);
BrowserWindow* qz = qobject_cast<BrowserWindow*>(actWin);
if (qz && !actUrl.isEmpty()) {
qz->loadAddress(actUrl);
@ -651,13 +651,13 @@ void MainApplication::addNewTab(const QUrl &url)
getWindow()->tabWidget()->addView(url, url.isEmpty() ? Qz::NT_SelectedNewEmptyTab : Qz::NT_SelectedTabAtTheEnd);
}
QupZilla* MainApplication::makeNewWindow(Qz::BrowserWindow type, const QUrl &startUrl)
BrowserWindow* MainApplication::makeNewWindow(Qz::BrowserWindowType type, const QUrl &startUrl)
{
if (m_mainWindows.count() == 0 && type != Qz::BW_MacFirstWindow) {
type = Qz::BW_FirstAppWindow;
}
QupZilla* newWindow = new QupZilla(type, startUrl);
BrowserWindow* newWindow = new BrowserWindow(type, startUrl);
m_mainWindows.prepend(newWindow);
return newWindow;
@ -1166,7 +1166,7 @@ QUrl MainApplication::userStyleSheet(const QString &filePath) const
return QUrl(dataString);
}
void MainApplication::aboutToCloseWindow(QupZilla* window)
void MainApplication::aboutToCloseWindow(BrowserWindow* window)
{
if (!window) {
return;
@ -1199,7 +1199,7 @@ bool MainApplication::saveStateSlot()
stream << m_mainWindows.count();
for (int i = 0; i < m_mainWindows.count(); i++) {
QupZilla* qz = m_mainWindows.at(i).data();
BrowserWindow* qz = m_mainWindows.at(i).data();
if (!qz) {
continue;
}
@ -1213,7 +1213,7 @@ bool MainApplication::saveStateSlot()
}
file.close();
QupZilla* qupzilla_ = getWindow();
BrowserWindow* qupzilla_ = getWindow();
if (qupzilla_ && m_mainWindows.count() == 1) {
qupzilla_->tabWidget()->savePinnedTabs();
}
@ -1225,7 +1225,7 @@ bool MainApplication::saveStateSlot()
return true;
}
bool MainApplication::restoreStateSlot(QupZilla* window, RestoreData recoveryData)
bool MainApplication::restoreStateSlot(BrowserWindow* window, RestoreData recoveryData)
{
if (m_isPrivateSession || recoveryData.isEmpty()) {
return false;
@ -1242,7 +1242,7 @@ bool MainApplication::restoreStateSlot(QupZilla* window, RestoreData recoveryDat
// some new tabs.
// Instead create new one and restore pinned tabs there
QupZilla* newWin = makeNewWindow(Qz::BW_OtherRestoredWindow);
BrowserWindow* newWin = makeNewWindow(Qz::BW_OtherRestoredWindow);
newWin->restoreWindowState(recoveryData.first());
recoveryData.remove(0);
}
@ -1260,7 +1260,7 @@ bool MainApplication::restoreStateSlot(QupZilla* window, RestoreData recoveryDat
}
foreach (const RestoreManager::WindowData &data, recoveryData) {
QupZilla* window = makeNewWindow(Qz::BW_OtherRestoredWindow);
BrowserWindow* window = makeNewWindow(Qz::BW_OtherRestoredWindow);
window->restoreWindowState(data);
// for correct geometry calculation in QupZilla::setupUi()
mApp->processEvents();
@ -1318,7 +1318,7 @@ bool MainApplication::checkSettingsDir()
QFile versionFile(PROFILEDIR + "profiles/default/version");
versionFile.open(QFile::WriteOnly);
versionFile.write(QupZilla::VERSION.toUtf8());
versionFile.write(Qz::VERSION.toUtf8());
versionFile.close();
return dir.isReadable();

View File

@ -32,7 +32,7 @@ class QMenu;
class QWebSettings;
class QNetworkDiskCache;
class QupZilla;
class BrowserWindow;
class CookieManager;
class BrowsingLibrary;
class History;
@ -73,12 +73,12 @@ public:
void connectDatabase();
void reloadSettings();
bool restoreStateSlot(QupZilla* window, RestoreData recoveryData);
QupZilla* makeNewWindow(Qz::BrowserWindow type, const QUrl &startUrl = QUrl());
void aboutToCloseWindow(QupZilla* window);
bool restoreStateSlot(BrowserWindow* window, RestoreData recoveryData);
BrowserWindow* makeNewWindow(Qz::BrowserWindowType type, const QUrl &startUrl = QUrl());
void aboutToCloseWindow(BrowserWindow* window);
bool isStateChanged();
QList<QupZilla*> mainWindows();
QList<BrowserWindow*> mainWindows();
static MainApplication* getInstance() { return static_cast<MainApplication*>(QCoreApplication::instance()); }
@ -102,7 +102,7 @@ public:
QString currentStyle() const;
QString tempPath() const;
QupZilla* getWindow();
BrowserWindow* getWindow();
CookieManager* cookieManager();
BrowsingLibrary* browsingLibrary();
History* history();
@ -191,7 +191,7 @@ private:
#endif
DatabaseWriter* m_dbWriter;
UserAgentManager* m_uaManager;
QList<QPointer<QupZilla> > m_mainWindows;
QList<QPointer<BrowserWindow> > m_mainWindows;
QString m_activeProfil;
QString m_activeLanguage;

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "profileupdater.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "updater.h"
#include "qztools.h"
#include "mainapplication.h"
@ -47,14 +47,14 @@ void ProfileUpdater::checkProfile()
versionFile.close();
versionFile.remove();
updateProfile(QupZilla::VERSION, profileVersion.trimmed());
updateProfile(Qz::VERSION, profileVersion.trimmed());
}
else {
copyDataToProfile();
}
versionFile.open(QFile::WriteOnly);
versionFile.write(QupZilla::VERSION.toUtf8());
versionFile.write(Qz::VERSION.toUtf8());
versionFile.close();
}

View File

@ -19,6 +19,7 @@
#define QZ_NAMESPACE_H
#include <QFlags>
#include <QString>
#ifdef QUPZILLA_SHAREDLIBRARY
#define QT_QUPZILLA_EXPORT Q_DECL_EXPORT
@ -46,6 +47,14 @@ static const int sessionVersion = 0x0003;
// Version of bookmarks.json file
static const int bookmarksVersion = 1;
static const QString APPNAME = "QupZilla";
static const QString VERSION = "1.7.0";
static const QString BUILDTIME = __DATE__" "__TIME__;
static const QString AUTHOR = "David Rosca";
static const QString COPYRIGHT = "2010-2014";
static const QString WWWADDRESS = "http://www.qupzilla.com";
static const QString WIKIADDRESS = "https://github.com/QupZilla/qupzilla/wiki";
enum AppMessageType {
AM_SetAdBlockIconEnabled,
AM_CheckPrivateBrowsing,
@ -54,7 +63,7 @@ enum AppMessageType {
AM_BookmarksChanged
};
enum BrowserWindow {
enum BrowserWindowType {
BW_FirstAppWindow,
BW_OtherRestoredWindow,
BW_NewWindow,

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "autofill.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "webpage.h"
#include "tabbedwebview.h"
#include "popupwebview.h"

View File

@ -26,7 +26,7 @@ class QUrl;
class QWebElement;
class QNetworkRequest;
class QupZilla;
class BrowserWindow;
class WebPage;
class PasswordManager;
struct PageFormData;

View File

@ -20,7 +20,7 @@
#include "mainapplication.h"
#include "autofill.h"
#include "aesinterface.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "ui_masterpassworddialog.h"
#include <QVector>

View File

@ -22,16 +22,16 @@
#include "bookmarksmodel.h"
#include "bookmarkstools.h"
#include "mainapplication.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "qztools.h"
#include <QMenu>
#include <QTimer>
BookmarksManager::BookmarksManager(QupZilla* mainClass, QWidget* parent)
BookmarksManager::BookmarksManager(BrowserWindow* window, QWidget* parent)
: QWidget(parent)
, ui(new Ui::BookmarksManager)
, p_QupZilla(mainClass)
, m_window(window)
, m_bookmarks(mApp->bookmarks())
, m_selectedBookmark(0)
, m_blockDescriptionChangedSignal(false)
@ -59,10 +59,10 @@ BookmarksManager::~BookmarksManager()
delete ui;
}
void BookmarksManager::setMainWindow(QupZilla* window)
void BookmarksManager::setMainWindow(BrowserWindow* window)
{
if (window) {
p_QupZilla = window;
m_window = window;
}
}
@ -319,12 +319,12 @@ void BookmarksManager::keyPressEvent(QKeyEvent* event)
QWidget::keyPressEvent(event);
}
QupZilla* BookmarksManager::getQupZilla()
BrowserWindow* BookmarksManager::getQupZilla()
{
if (!p_QupZilla) {
p_QupZilla = mApp->getWindow();
if (!m_window) {
m_window = mApp->getWindow();
}
return p_QupZilla.data();
return m_window.data();
}
void BookmarksManager::showEvent(QShowEvent* event)

View File

@ -30,7 +30,7 @@ class BookmarksManager;
class QUrl;
class QupZilla;
class BrowserWindow;
class Bookmarks;
class BookmarkItem;
@ -39,10 +39,10 @@ class QT_QUPZILLA_EXPORT BookmarksManager : public QWidget
Q_OBJECT
public:
explicit BookmarksManager(QupZilla* mainClass, QWidget* parent = 0);
explicit BookmarksManager(BrowserWindow* window, QWidget* parent = 0);
~BookmarksManager();
void setMainWindow(QupZilla* window);
void setMainWindow(BrowserWindow* window);
public slots:
void search(const QString &string);
@ -72,13 +72,13 @@ private:
bool bookmarkEditable(BookmarkItem* item) const;
void addBookmark(BookmarkItem* item);
BookmarkItem* parentForNewBookmark() const;
QupZilla* getQupZilla();
BrowserWindow* getQupZilla();
void showEvent(QShowEvent* event);
void keyPressEvent(QKeyEvent* event);
Ui::BookmarksManager* ui;
QPointer<QupZilla> p_QupZilla;
QPointer<BrowserWindow> m_window;
Bookmarks* m_bookmarks;
BookmarkItem* m_selectedBookmark;

View File

@ -22,7 +22,7 @@
#include "mainapplication.h"
#include "browsinglibrary.h"
#include "iconprovider.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "qzsettings.h"
#include "tabwidget.h"
@ -38,7 +38,7 @@ BookmarksMenu::BookmarksMenu(QWidget* parent)
connect(mApp->bookmarks(), SIGNAL(bookmarkChanged(BookmarkItem*)), this, SLOT(bookmarksChanged()));
}
void BookmarksMenu::setMainWindow(QupZilla* window)
void BookmarksMenu::setMainWindow(BrowserWindow* window)
{
m_window = window;
}

View File

@ -23,7 +23,7 @@
#include "enhancedmenu.h"
#include "qz_namespace.h"
class QupZilla;
class BrowserWindow;
class BookmarkItem;
class QT_QUPZILLA_EXPORT BookmarksMenu : public Menu
@ -33,7 +33,7 @@ class QT_QUPZILLA_EXPORT BookmarksMenu : public Menu
public:
explicit BookmarksMenu(QWidget* parent = 0);
void setMainWindow(QupZilla* window);
void setMainWindow(BrowserWindow* window);
private slots:
void bookmarkPage();
@ -57,7 +57,7 @@ private:
void init();
void refresh();
QPointer<QupZilla> m_window;
QPointer<BrowserWindow> m_window;
bool m_changed;
};

View File

@ -28,9 +28,9 @@
#include <QTimer>
#include <QFrame>
BookmarksToolbar::BookmarksToolbar(QupZilla* mainClass, QWidget* parent)
BookmarksToolbar::BookmarksToolbar(BrowserWindow* window, QWidget* parent)
: QWidget(parent)
, m_window(mainClass)
, m_window(window)
, m_bookmarks(mApp->bookmarks())
, m_clickedBookmark(0)
{

View File

@ -25,7 +25,7 @@
class QHBoxLayout;
class QTimer;
class QupZilla;
class BrowserWindow;
class Bookmarks;
class BookmarkItem;
class BookmarksToolbarButton;
@ -34,7 +34,7 @@ class QT_QUPZILLA_EXPORT BookmarksToolbar : public QWidget
{
Q_OBJECT
public:
explicit BookmarksToolbar(QupZilla* mainClass, QWidget* parent = 0);
explicit BookmarksToolbar(BrowserWindow* window, QWidget* parent = 0);
private slots:
void contextMenuRequested(const QPoint &pos);
@ -55,7 +55,7 @@ private:
void dropEvent(QDropEvent* e);
void dragEnterEvent(QDragEnterEvent* e);
QupZilla* m_window;
BrowserWindow* m_window;
Bookmarks* m_bookmarks;
BookmarkItem* m_clickedBookmark;
QHBoxLayout* m_layout;

View File

@ -47,7 +47,7 @@ BookmarkItem* BookmarksToolbarButton::bookmark() const
return m_bookmark;
}
void BookmarksToolbarButton::setMainWindow(QupZilla* window)
void BookmarksToolbarButton::setMainWindow(BrowserWindow* window)
{
m_window = window;
}

View File

@ -23,7 +23,7 @@
#include "qz_namespace.h"
class Menu;
class QupZilla;
class BrowserWindow;
class BookmarkItem;
class QT_QUPZILLA_EXPORT BookmarksToolbarButton : public QPushButton
@ -34,7 +34,7 @@ public:
explicit BookmarksToolbarButton(BookmarkItem* bookmark, QWidget* parent = 0);
BookmarkItem* bookmark() const;
void setMainWindow(QupZilla* window);
void setMainWindow(BrowserWindow* window);
bool showOnlyIcon() const;
void setShowOnlyIcon(bool show);
@ -65,7 +65,7 @@ private:
void paintEvent(QPaintEvent* event);
BookmarkItem* m_bookmark;
QupZilla* m_window;
BrowserWindow* m_window;
Qt::MouseButtons m_buttons;
Qt::KeyboardModifiers m_modifiers;

View File

@ -23,7 +23,7 @@
#include "enhancedmenu.h"
#include "tabwidget.h"
#include "qzsettings.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include <iostream>
#include <QSqlQuery>
@ -215,7 +215,7 @@ bool BookmarksTools::bookmarkAllTabsDialog(QWidget* parent, TabWidget* tabWidget
return true;
}
void BookmarksTools::openBookmark(QupZilla* window, BookmarkItem* item)
void BookmarksTools::openBookmark(BrowserWindow* window, BookmarkItem* item)
{
Q_ASSERT(window);
@ -232,7 +232,7 @@ void BookmarksTools::openBookmark(QupZilla* window, BookmarkItem* item)
}
}
void BookmarksTools::openBookmarkInNewTab(QupZilla* window, BookmarkItem* item)
void BookmarksTools::openBookmarkInNewTab(BrowserWindow* window, BookmarkItem* item)
{
Q_ASSERT(window);
@ -259,7 +259,7 @@ void BookmarksTools::openBookmarkInNewWindow(BookmarkItem* item)
mApp->makeNewWindow(Qz::BW_NewWindow, item->url());
}
void BookmarksTools::openFolderInTabs(QupZilla* window, BookmarkItem* folder)
void BookmarksTools::openFolderInTabs(BrowserWindow* window, BookmarkItem* folder)
{
Q_ASSERT(window);
Q_ASSERT(folder->isFolder());

View File

@ -70,7 +70,7 @@ private:
BookmarkItem* m_selectedFolder;
};
class QupZilla;
class BrowserWindow;
class TabWidget;
class Action;
class Menu;
@ -83,10 +83,10 @@ public:
static bool bookmarkAllTabsDialog(QWidget* parent, TabWidget* tabWidget, BookmarkItem* folder = 0);
// Open Bookmarks
static void openBookmark(QupZilla* window, BookmarkItem* item);
static void openBookmarkInNewTab(QupZilla* window, BookmarkItem* item);
static void openBookmark(BrowserWindow* window, BookmarkItem* item);
static void openBookmarkInNewTab(BrowserWindow* window, BookmarkItem* item);
static void openBookmarkInNewWindow(BookmarkItem* item);
static void openFolderInTabs(QupZilla* window, BookmarkItem* folder);
static void openFolderInTabs(BrowserWindow* window, BookmarkItem* folder);
// Create Menu
static void addActionToMenu(QObject* receiver, Menu* menu, BookmarkItem* item);

View File

@ -23,7 +23,7 @@
#include "pluginproxy.h"
#include "speeddial.h"
#include "webview.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include <QTimer>

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "cookiejar.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "mainapplication.h"
#include "settings.h"
#include "qztools.h"
@ -29,9 +29,9 @@
//#define COOKIE_DEBUG
CookieJar::CookieJar(QupZilla* mainClass, QObject* parent)
CookieJar::CookieJar(BrowserWindow* window, QObject* parent)
: QNetworkCookieJar(parent)
, p_QupZilla(mainClass)
, m_window(window)
{
m_activeProfil = mApp->currentProfilePath();
loadSettings();

View File

@ -24,12 +24,12 @@
#include <QStringList>
#include <QNetworkCookieJar>
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT CookieJar : public QNetworkCookieJar
{
public:
explicit CookieJar(QupZilla* mainClass, QObject* parent = 0);
explicit CookieJar(BrowserWindow* window, QObject* parent = 0);
void loadSettings();
bool setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const QUrl &url);
@ -48,7 +48,7 @@ public:
private:
bool rejectCookie(const QString &domain, const QNetworkCookie &cookie) const;
QupZilla* p_QupZilla;
BrowserWindow* m_window;
bool m_allowCookies;
bool m_filterTrackingCookie;

View File

@ -17,7 +17,7 @@
* ============================================================ */
#include "cookiemanager.h"
#include "ui_cookiemanager.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "cookiejar.h"
#include "mainapplication.h"
#include "qztools.h"

View File

@ -29,7 +29,7 @@ class CookieManager;
class QTreeWidgetItem;
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT CookieManager : public QWidget
{

View File

@ -20,7 +20,7 @@
#include "tabbedwebview.h"
#include "downloadoptionsdialog.h"
#include "mainapplication.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "downloaditem.h"
#include "downloadmanager.h"
#include "qztools.h"

View File

@ -18,7 +18,7 @@
#include "downloaditem.h"
#include "ui_downloaditem.h"
#include "mainapplication.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "tabwidget.h"
#include "webpage.h"
#include "downloadmanager.h"
@ -389,7 +389,7 @@ void DownloadItem::customContextMenuRequested(const QPoint &pos)
void DownloadItem::goToDownloadPage()
{
QupZilla* qz = mApp->getWindow();
BrowserWindow* qz = mApp->getWindow();
if (qz) {
qz->tabWidget()->addView(m_downloadPage, Qz::NT_SelectedTab);

View File

@ -17,7 +17,7 @@
* ============================================================ */
#include "downloadmanager.h"
#include "ui_downloadmanager.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "mainapplication.h"
#include "downloadoptionsdialog.h"
#include "downloaditem.h"

View File

@ -18,7 +18,7 @@
#include "history.h"
#include "historymodel.h"
#include "tabbedwebview.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "iconprovider.h"
#include "settings.h"

View File

@ -17,7 +17,7 @@
* ============================================================ */
#include "historymanager.h"
#include "ui_historymanager.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "mainapplication.h"
#include "history.h"
#include "browsinglibrary.h"
@ -29,10 +29,10 @@
#include <QMessageBox>
HistoryManager::HistoryManager(QupZilla* mainClass, QWidget* parent)
HistoryManager::HistoryManager(BrowserWindow* window, QWidget* parent)
: QWidget(parent)
, ui(new Ui::HistoryManager)
, p_QupZilla(mainClass)
, m_window(window)
{
ui->setupUi(this);
@ -44,18 +44,18 @@ HistoryManager::HistoryManager(QupZilla* mainClass, QWidget* parent)
ui->historyTree->setFocus();
}
QupZilla* HistoryManager::getQupZilla()
BrowserWindow* HistoryManager::getQupZilla()
{
if (!p_QupZilla) {
p_QupZilla = mApp->getWindow();
if (!m_window) {
m_window = mApp->getWindow();
}
return p_QupZilla.data();
return m_window.data();
}
void HistoryManager::setMainWindow(QupZilla* window)
void HistoryManager::setMainWindow(BrowserWindow* window)
{
if (window) {
p_QupZilla = window;
m_window = window;
}
}

View File

@ -31,17 +31,17 @@ class HistoryManager;
class QTreeWidgetItem;
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT HistoryManager : public QWidget
{
Q_OBJECT
public:
explicit HistoryManager(QupZilla* mainClass, QWidget* parent = 0);
explicit HistoryManager(BrowserWindow* window, QWidget* parent = 0);
~HistoryManager();
void setMainWindow(QupZilla* window);
void setMainWindow(BrowserWindow* window);
void restoreState(const QByteArray &state);
QByteArray saveState();
@ -54,10 +54,10 @@ private slots:
void clearHistory();
private:
QupZilla* getQupZilla();
BrowserWindow* getQupZilla();
Ui::HistoryManager* ui;
QPointer<QupZilla> p_QupZilla;
QPointer<BrowserWindow> m_window;
};
#endif // HISTORYMANAGER_H

View File

@ -70,7 +70,6 @@ SOURCES += \
webview/tabpreview.cpp \
3rdparty/qtwin.cpp \
3rdparty/lineedit.cpp \
app/qupzilla.cpp \
app/mainapplication.cpp \
app/autosaver.cpp \
preferences/autofillmanager.cpp \
@ -257,14 +256,14 @@ SOURCES += \
bookmarks/bookmarkstoolbarbutton.cpp \
bookmarks/bookmarksexport/bookmarksexporter.cpp \
bookmarks/bookmarksexport/bookmarksexportdialog.cpp \
bookmarks/bookmarksexport/htmlexporter.cpp
bookmarks/bookmarksexport/htmlexporter.cpp \
app/browserwindow.cpp
HEADERS += \
webview/tabpreview.h \
3rdparty/qtwin.h \
3rdparty/lineedit.h \
app/qupzilla.h \
app/mainapplication.h \
app/autosaver.h \
preferences/autofillmanager.h \
@ -455,7 +454,8 @@ HEADERS += \
bookmarks/bookmarkstoolbarbutton.h \
bookmarks/bookmarksexport/bookmarksexporter.h \
bookmarks/bookmarksexport/bookmarksexportdialog.h \
bookmarks/bookmarksexport/htmlexporter.h
bookmarks/bookmarksexport/htmlexporter.h \
app/browserwindow.h
FORMS += \
preferences/autofillmanager.ui \

View File

@ -21,7 +21,7 @@
#include "bookmarkitem.h"
#include "bookmarks.h"
#include "qzsettings.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "tabwidget.h"
#include <QSqlQuery>
@ -238,11 +238,11 @@ TabPosition LocationCompleterModel::tabPositionForUrl(const QUrl &url) const
TabPosition LocationCompleterModel::tabPositionForEncodedUrl(const QString &encodedUrl) const
{
QList<QupZilla*> windows = mApp->mainWindows();
QList<BrowserWindow*> windows = mApp->mainWindows();
int currentWindowIdx = windows.indexOf(mApp->getWindow());
windows.prepend(mApp->getWindow());
for (int win = 0; win < windows.count(); ++win) {
QupZilla* mainWin = windows.at(win);
BrowserWindow* mainWin = windows.at(win);
QList<WebTab*> tabs = mainWin->tabWidget()->allTabs();
for (int tab = 0; tab < tabs.count(); ++tab) {
if (tabs[tab]->url().toEncoded() == encodedUrl) {

View File

@ -19,7 +19,7 @@
#include "locationcompletermodel.h"
#include "locationcompleterdelegate.h"
#include "mainapplication.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "history.h"
#include "tabwidget.h"
#include "qzsettings.h"
@ -264,7 +264,7 @@ void LocationCompleterView::mouseReleaseEvent(QMouseEvent* event)
void LocationCompleterView::activateTab(TabPosition pos)
{
QupZilla* win = mApp->mainWindows().at(pos.windowIndex);
BrowserWindow* win = mApp->mainWindows().at(pos.windowIndex);
if (mApp->getWindow() != win || mApp->getWindow()->tabWidget()->currentIndex() != pos.tabIndex) {
emit aboutToActivateTab(pos);
close();

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "locationbar.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "tabbedwebview.h"
#include "rssmanager.h"
#include "mainapplication.h"
@ -45,9 +45,9 @@
#include <QAction>
#include <QMenu>
LocationBar::LocationBar(QupZilla* mainClass)
: LineEdit(mainClass)
, p_QupZilla(mainClass)
LocationBar::LocationBar(BrowserWindow* window)
: LineEdit(window)
, m_window(window)
, m_webView(0)
, m_pasteAndGoAction(0)
, m_clearAction(0)
@ -65,7 +65,7 @@ LocationBar::LocationBar(QupZilla* mainClass)
m_bookmarkIcon = new BookmarksIcon(this);
m_goIcon = new GoIcon(this);
m_rssIcon = new RssIcon(this);
m_siteIcon = new SiteIcon(p_QupZilla, this);
m_siteIcon = new SiteIcon(m_window, this);
m_autofillIcon = new AutoFillIcon(this);
DownIcon* down = new DownIcon(this);
@ -515,7 +515,7 @@ void LocationBar::keyPressEvent(QKeyEvent* event)
case Qt::AltModifier:
m_completer.closePopup();
p_QupZilla->tabWidget()->addView(createUrl());
m_window->tabWidget()->addView(createUrl());
m_holdingAlt = false;
break;

View File

@ -24,7 +24,7 @@
#include "lineedit.h"
#include "completer/locationcompleter.h"
class QupZilla;
class BrowserWindow;
class LineEdit;
class LocationCompleter;
class ClickableLabel;
@ -43,7 +43,7 @@ class QT_QUPZILLA_EXPORT LocationBar : public LineEdit
Q_PROPERTY(int fixedheight READ height WRITE setFixedHeight)
public:
explicit LocationBar(QupZilla* mainClass);
explicit LocationBar(BrowserWindow* window);
~LocationBar();
void setWebView(TabbedWebView* view);
@ -111,7 +111,7 @@ private:
SiteIcon* m_siteIcon;
AutoFillIcon* m_autofillIcon;
QupZilla* p_QupZilla;
BrowserWindow* m_window;
TabbedWebView* m_webView;
QAction* m_pasteAndGoAction;

View File

@ -17,7 +17,7 @@
* ============================================================ */
#include "navigationbar.h"
#include "toolbutton.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "mainapplication.h"
#include "iconprovider.h"
#include "websearchbar.h"
@ -69,9 +69,9 @@ static inline void setButtonIconSize(ToolButton* button)
button->setIconSize(QSize(size, size));
}
NavigationBar::NavigationBar(QupZilla* mainClass)
: QWidget(mainClass)
, p_QupZilla(mainClass)
NavigationBar::NavigationBar(BrowserWindow* window)
: QWidget(window)
, m_window(window)
{
setObjectName("navigationbar");
m_layout = new QHBoxLayout(this);
@ -137,15 +137,15 @@ NavigationBar::NavigationBar(QupZilla* mainClass)
m_supMenu->setToolTip(tr("Main Menu"));
m_supMenu->setAutoRaise(true);
m_supMenu->setFocusPolicy(Qt::NoFocus);
m_supMenu->setMenu(p_QupZilla->superMenu());
m_supMenu->setMenu(m_window->superMenu());
m_supMenu->setShowMenuInside(true);
setButtonIconSize(m_supMenu);
#endif
m_searchLine = new WebSearchBar(p_QupZilla);
m_searchLine = new WebSearchBar(m_window);
m_navigationSplitter = new QSplitter(this);
m_navigationSplitter->addWidget(p_QupZilla->tabWidget()->locationBars());
m_navigationSplitter->addWidget(m_window->tabWidget()->locationBars());
m_navigationSplitter->addWidget(m_searchLine);
m_navigationSplitter->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
@ -182,14 +182,14 @@ NavigationBar::NavigationBar(QupZilla* mainClass)
connect(m_buttonNext, SIGNAL(middleMouseClicked()), this, SLOT(goForwardInNewTab()));
connect(m_buttonNext, SIGNAL(controlClicked()), this, SLOT(goForwardInNewTab()));
connect(m_reloadStop->buttonStop(), SIGNAL(clicked()), p_QupZilla, SLOT(stop()));
connect(m_reloadStop->buttonReload(), SIGNAL(clicked()), p_QupZilla, SLOT(reload()));
connect(m_buttonHome, SIGNAL(clicked()), p_QupZilla, SLOT(goHome()));
connect(m_buttonHome, SIGNAL(middleMouseClicked()), p_QupZilla, SLOT(goHomeInNewTab()));
connect(m_buttonHome, SIGNAL(controlClicked()), p_QupZilla, SLOT(goHomeInNewTab()));
connect(m_buttonAddTab, SIGNAL(clicked()), p_QupZilla, SLOT(addTab()));
connect(m_buttonAddTab, SIGNAL(middleMouseClicked()), p_QupZilla->tabWidget(), SLOT(addTabFromClipboard()));
connect(m_exitFullscreen, SIGNAL(clicked(bool)), p_QupZilla, SLOT(toggleFullScreen()));
connect(m_reloadStop->buttonStop(), SIGNAL(clicked()), m_window, SLOT(stop()));
connect(m_reloadStop->buttonReload(), SIGNAL(clicked()), m_window, SLOT(reload()));
connect(m_buttonHome, SIGNAL(clicked()), m_window, SLOT(goHome()));
connect(m_buttonHome, SIGNAL(middleMouseClicked()), m_window, SLOT(goHomeInNewTab()));
connect(m_buttonHome, SIGNAL(controlClicked()), m_window, SLOT(goHomeInNewTab()));
connect(m_buttonAddTab, SIGNAL(clicked()), m_window, SLOT(addTab()));
connect(m_buttonAddTab, SIGNAL(middleMouseClicked()), m_window->tabWidget(), SLOT(addTabFromClipboard()));
connect(m_exitFullscreen, SIGNAL(clicked(bool)), m_window, SLOT(toggleFullScreen()));
}
void NavigationBar::setSplitterSizes(int locationBar, int websearchBar)
@ -244,11 +244,11 @@ void NavigationBar::setLayoutSpacing(int spacing)
void NavigationBar::aboutToShowHistoryBackMenu()
{
if (!m_menuBack || !p_QupZilla->weView()) {
if (!m_menuBack || !m_window->weView()) {
return;
}
m_menuBack->clear();
QWebHistory* history = p_QupZilla->weView()->history();
QWebHistory* history = m_window->weView()->history();
int curindex = history->currentItemIndex();
int count = 0;
@ -278,12 +278,12 @@ void NavigationBar::aboutToShowHistoryBackMenu()
void NavigationBar::aboutToShowHistoryNextMenu()
{
if (!m_menuForward || !p_QupZilla->weView()) {
if (!m_menuForward || !m_window->weView()) {
return;
}
m_menuForward->clear();
QWebHistory* history = p_QupZilla->weView()->history();
QWebHistory* history = m_window->weView()->history();
int curindex = history->currentItemIndex();
int count = 0;
@ -312,19 +312,19 @@ void NavigationBar::aboutToShowHistoryNextMenu()
void NavigationBar::clearHistory()
{
QWebHistory* history = p_QupZilla->weView()->page()->history();
QWebHistory* history = m_window->weView()->page()->history();
history->clear();
refreshHistory();
}
void NavigationBar::contextMenuRequested(const QPoint &pos)
{
p_QupZilla->popupToolbarsMenu(mapToGlobal(pos));
m_window->popupToolbarsMenu(mapToGlobal(pos));
}
void NavigationBar::goAtHistoryIndex()
{
QWebHistory* history = p_QupZilla->weView()->page()->history();
QWebHistory* history = m_window->weView()->page()->history();
if (QAction* action = qobject_cast<QAction*>(sender())) {
history->goToItem(history->itemAt(action->data().toInt()));
@ -343,10 +343,10 @@ void NavigationBar::goAtHistoryIndexInNewTab(int index)
return;
}
TabWidget* tabWidget = p_QupZilla->tabWidget();
TabWidget* tabWidget = m_window->tabWidget();
int tabIndex = tabWidget->duplicateTab(tabWidget->currentIndex());
QWebHistory* history = p_QupZilla->weView(tabIndex)->page()->history();
QWebHistory* history = m_window->weView(tabIndex)->page()->history();
history->goToItem(history->itemAt(index));
if (qzSettings->newTabPosition == Qz::NT_SelectedTab) {
@ -356,24 +356,24 @@ void NavigationBar::goAtHistoryIndexInNewTab(int index)
void NavigationBar::refreshHistory()
{
if (mApp->isClosing() || p_QupZilla->isClosing() || !p_QupZilla->weView()) {
if (mApp->isClosing() || m_window->isClosing() || !m_window->weView()) {
return;
}
QWebHistory* history = p_QupZilla->weView()->page()->history();
QWebHistory* history = m_window->weView()->page()->history();
m_buttonBack->setEnabled(history->canGoBack());
m_buttonNext->setEnabled(history->canGoForward());
}
void NavigationBar::goBack()
{
QWebHistory* history = p_QupZilla->weView()->page()->history();
QWebHistory* history = m_window->weView()->page()->history();
history->back();
}
void NavigationBar::goBackInNewTab()
{
QWebHistory* history = p_QupZilla->weView()->page()->history();
QWebHistory* history = m_window->weView()->page()->history();
if (!history->canGoBack()) {
return;
@ -389,13 +389,13 @@ void NavigationBar::goBackInNewTab()
void NavigationBar::goForward()
{
QWebHistory* history = p_QupZilla->weView()->page()->history();
QWebHistory* history = m_window->weView()->page()->history();
history->forward();
}
void NavigationBar::goForwardInNewTab()
{
QWebHistory* history = p_QupZilla->weView()->page()->history();
QWebHistory* history = m_window->weView()->page()->history();
if (!history->canGoForward()) {
return;

View File

@ -27,7 +27,7 @@ class QSplitter;
class ToolButton;
class WebSearchBar;
class QupZilla;
class BrowserWindow;
class ReloadStopButton;
class Menu;
class QUrl;
@ -36,7 +36,7 @@ class QT_QUPZILLA_EXPORT NavigationBar : public QWidget
{
Q_OBJECT
public:
explicit NavigationBar(QupZilla* mainClass);
explicit NavigationBar(BrowserWindow* window);
Q_PROPERTY(int layoutMargin READ layoutMargin WRITE setLayoutMargin)
Q_PROPERTY(int layoutSpacing READ layoutSpacing WRITE setLayoutSpacing)
@ -87,7 +87,7 @@ private:
QString titleForUrl(QString title, const QUrl &url);
QIcon iconForPage(const QUrl &url, const QIcon &sIcon);
QupZilla* p_QupZilla;
BrowserWindow* m_window;
QHBoxLayout* m_layout;
QSplitter* m_navigationSplitter;

View File

@ -17,13 +17,13 @@
* ============================================================ */
#include "navigationcontainer.h"
#include "qzsettings.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include <QPainter>
NavigationContainer::NavigationContainer(QupZilla* parent)
NavigationContainer::NavigationContainer(BrowserWindow* parent)
: QWidget(parent)
, p_QupZilla(parent)
, m_window(parent)
{
}
@ -31,12 +31,12 @@ void NavigationContainer::paintEvent(QPaintEvent* event)
{
QWidget::paintEvent(event);
if (p_QupZilla->tabsOnTop()) {
if (m_window->tabsOnTop()) {
// Draw line at the bottom of navigation bar if tabs are on top
// To visually distinguish navigation bar from the page
QPainter p(this);
QRect lineRect(0, height() - 1, width(), 1);
QColor c = p_QupZilla->palette().window().color().darker(125);
QColor c = m_window->palette().window().color().darker(125);
p.fillRect(lineRect, c);
}
}

View File

@ -22,17 +22,17 @@
#include "qzsettings.h"
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT NavigationContainer : public QWidget
{
public:
explicit NavigationContainer(QupZilla* parent = 0);
explicit NavigationContainer(BrowserWindow* parent = 0);
private:
void paintEvent(QPaintEvent* event);
QupZilla* p_QupZilla;
BrowserWindow* m_window;
};

View File

@ -27,9 +27,9 @@
#include <QApplication>
#include <QContextMenuEvent>
SiteIcon::SiteIcon(QupZilla* window, LocationBar* parent)
SiteIcon::SiteIcon(BrowserWindow* window, LocationBar* parent)
: ToolButton(parent)
, p_QupZilla(window)
, m_window(window)
, m_locationBar(parent)
, m_view(0)
{
@ -49,7 +49,7 @@ void SiteIcon::setWebView(WebView* view)
void SiteIcon::iconClicked()
{
if (!m_view || !p_QupZilla) {
if (!m_view || !m_window) {
return;
}
@ -59,7 +59,7 @@ void SiteIcon::iconClicked()
return;
}
SiteInfoWidget* info = new SiteInfoWidget(p_QupZilla);
SiteInfoWidget* info = new SiteInfoWidget(m_window);
info->showAt(parentWidget());
}

View File

@ -23,14 +23,14 @@
class LocationBar;
class WebView;
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT SiteIcon : public ToolButton
{
Q_OBJECT
public:
explicit SiteIcon(QupZilla* window, LocationBar* parent);
explicit SiteIcon(BrowserWindow* window, LocationBar* parent);
void setWebView(WebView* view);
@ -42,7 +42,7 @@ private:
void mousePressEvent(QMouseEvent* e);
void mouseMoveEvent(QMouseEvent* e);
QupZilla* p_QupZilla;
BrowserWindow* m_window;
LocationBar* m_locationBar;
WebView* m_view;

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "websearchbar.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "mainapplication.h"
#include "tabbedwebview.h"
#include "webpage.h"
@ -52,9 +52,9 @@ void WebSearchBar_Button::contextMenuEvent(QContextMenuEvent* event)
event->accept();
}
WebSearchBar::WebSearchBar(QupZilla* mainClass)
: LineEdit(mainClass)
, p_QupZilla(mainClass)
WebSearchBar::WebSearchBar(BrowserWindow* window)
: LineEdit(window)
, m_window(window)
, m_pasteAndGoAction(0)
, m_clearAction(0)
, m_reloadingEngines(false)
@ -202,25 +202,25 @@ void WebSearchBar::instantSearchChanged(bool enable)
void WebSearchBar::search()
{
p_QupZilla->weView()->setFocus();
m_window->weView()->setFocus();
SearchEnginesManager::SearchResult res = m_searchManager->searchResult(m_activeEngine, text());
p_QupZilla->weView()->load(res.request, res.operation, res.data);
m_window->weView()->load(res.request, res.operation, res.data);
}
void WebSearchBar::searchInNewTab()
{
p_QupZilla->weView()->setFocus();
m_window->weView()->setFocus();
int index = p_QupZilla->tabWidget()->addView(QUrl());
int index = m_window->tabWidget()->addView(QUrl());
SearchEnginesManager::SearchResult res = m_searchManager->searchResult(m_activeEngine, text());
p_QupZilla->weView(index)->load(res.request, res.operation, res.data);
m_window->weView(index)->load(res.request, res.operation, res.data);
}
void WebSearchBar::completeMenuWithAvailableEngines(QMenu* menu)
{
WebView* view = p_QupZilla->weView();
WebView* view = m_window->weView();
QWebFrame* frame = view->page()->mainFrame();
QWebElementCollection elements = frame->documentElement().findAll(QLatin1String("link[rel=search]"));

View File

@ -28,7 +28,7 @@
class QStringListModel;
class QupZilla;
class BrowserWindow;
class LineEdit;
class ClickableLabel;
class SearchEnginesManager;
@ -52,7 +52,7 @@ class QT_QUPZILLA_EXPORT WebSearchBar : public LineEdit
Q_PROPERTY(int fixedheight READ height WRITE setFixedHeight)
public:
explicit WebSearchBar(QupZilla* mainClass);
explicit WebSearchBar(BrowserWindow* window);
private slots:
void searchChanged(const ButtonWithMenu::Item &item);
@ -85,7 +85,7 @@ private:
OpenSearchEngine* m_openSearchEngine;
SearchEngine m_activeEngine;
QupZilla* p_QupZilla;
BrowserWindow* m_window;
WebSearchBar_Button* m_buttonSearch;
ButtonWithMenu* m_boxSearchType;

View File

@ -18,7 +18,7 @@
#include "cabundleupdater.h"
#include "mainapplication.h"
#include "networkmanager.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "qztools.h"
#include <QTimer>
@ -69,7 +69,7 @@ void CaBundleUpdater::start()
if (updateNow) {
m_progress = CheckLastUpdate;
QUrl url = QUrl::fromEncoded(QString(QupZilla::WWWADDRESS + "/certs/bundle_version").toUtf8());
QUrl url = QUrl::fromEncoded(QString(Qz::WWWADDRESS + "/certs/bundle_version").toUtf8());
m_reply = m_manager->get(QNetworkRequest(url));
connect(m_reply, SIGNAL(finished()), this, SLOT(replyFinished()));
}
@ -96,7 +96,7 @@ void CaBundleUpdater::replyFinished()
if (m_latestBundleVersion > currentBundleVersion) {
m_progress = LoadBundle;
QUrl url = QUrl::fromEncoded(QString(QupZilla::WWWADDRESS + "/certs/ca-bundle.crt").toUtf8());
QUrl url = QUrl::fromEncoded(QString(Qz::WWWADDRESS + "/certs/ca-bundle.crt").toUtf8());
m_reply = m_manager->get(QNetworkRequest(url));
connect(m_reply, SIGNAL(finished()), this, SLOT(replyFinished()));
}

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "networkmanager.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "autofill.h"
#include "networkmanagerproxy.h"
#include "mainapplication.h"

View File

@ -20,7 +20,7 @@
#include "iconprovider.h"
#include "downloadoptionsdialog.h"
#include "mainapplication.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include <QFileIconProvider>
#include <QFileDialog>

View File

@ -17,7 +17,7 @@
* ============================================================ */
#include "qupzillaschemehandler.h"
#include "qztools.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "mainapplication.h"
#include "tabbedwebview.h"
#include "webpage.h"
@ -32,6 +32,12 @@
#include <QSettings>
#include <QWebSecurityOrigin>
#if QT_VERSION < 0x050000
#include "qwebkitversion.h"
#else
#include <QWebPage>
#endif
static QString authorString(const char* name, const QString &mail)
{
return QString("%1 &lt;<a href=\"mailto:%2\">%2</a>&gt;").arg(QString::fromUtf8(name), mail);
@ -158,13 +164,13 @@ QString QupZillaSchemeReply::reportbugPage()
bPage.replace(QLatin1String("%FIELDS-ARE-REQUIRED%"), tr("Please fill out all required fields!"));
bPage.replace(QLatin1String("%INFO_OS%"), QzTools::operatingSystem());
bPage.replace(QLatin1String("%INFO_APP%"), QupZilla::VERSION
bPage.replace(QLatin1String("%INFO_APP%"), Qz::VERSION
#ifdef GIT_REVISION
+ " (" + GIT_REVISION + ")"
#endif
);
bPage.replace(QLatin1String("%INFO_QT%"), QString("%1 (built with %2)").arg(qVersion(), QT_VERSION_STR));
bPage.replace(QLatin1String("%INFO_WEBKIT%"), QupZilla::WEBKITVERSION),
bPage.replace(QLatin1String("%INFO_WEBKIT%"), qWebKitVersion()),
bPage = QzTools::applyDirectionToPage(bPage);
return bPage;
@ -186,7 +192,7 @@ QString QupZillaSchemeReply::startPage()
sPage.replace(QLatin1String("%TITLE%"), tr("Start Page"));
sPage.replace(QLatin1String("%BUTTON-LABEL%"), tr("Search on Web"));
sPage.replace(QLatin1String("%SEARCH-BY%"), tr("Search results provided by DuckDuckGo"));
sPage.replace(QLatin1String("%WWW%"), QupZilla::WIKIADDRESS);
sPage.replace(QLatin1String("%WWW%"), Qz::WIKIADDRESS);
sPage.replace(QLatin1String("%ABOUT-QUPZILLA%"), tr("About QupZilla"));
sPage.replace(QLatin1String("%PRIVATE-BROWSING%"), mApp->isPrivateSession() ? tr("<h1>Private Browsing</h1>") : QString());
sPage = QzTools::applyDirectionToPage(sPage);
@ -211,14 +217,14 @@ QString QupZillaSchemeReply::aboutPage()
aPage.replace(QLatin1String("%COPYRIGHT%"), tr("Copyright"));
aPage.replace(QLatin1String("%VERSION-INFO%"),
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Version"), QupZilla::VERSION
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Version"), Qz::VERSION
#ifdef GIT_REVISION
+ " (" + GIT_REVISION + ")"
#endif
) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("WebKit version"), QupZilla::WEBKITVERSION));
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("WebKit version"), qWebKitVersion()));
aPage.replace(QLatin1String("%MAIN-DEVELOPER%"), tr("Main developer"));
aPage.replace(QLatin1String("%MAIN-DEVELOPER-TEXT%"), authorString(QupZilla::AUTHOR.toUtf8(), "nowrep@gmail.com"));
aPage.replace(QLatin1String("%MAIN-DEVELOPER-TEXT%"), authorString(Qz::AUTHOR.toUtf8(), "nowrep@gmail.com"));
aPage.replace(QLatin1String("%CONTRIBUTORS%"), tr("Contributors"));
aPage.replace(QLatin1String("%CONTRIBUTORS-TEXT%"),
authorString("Mladen Pejaković", "pejakm@autistici.org") + "<br/>" +
@ -380,14 +386,14 @@ QString QupZillaSchemeReply::configPage()
cPage.replace(QLatin1String("%PL-DESC%"), tr("Description"));
cPage.replace(QLatin1String("%VERSION-INFO%"),
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Application version"), QupZilla::VERSION
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Application version"), Qz::VERSION
#ifdef GIT_REVISION
+ " (" + GIT_REVISION + ")"
#endif
) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Qt version"), QT_VERSION_STR) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("WebKit version"), QupZilla::WEBKITVERSION) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Build time"), QupZilla::BUILDTIME) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("WebKit version"), qWebKitVersion()) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Build time"), Qz::BUILDTIME) +
QString("<dt>%1</dt><dd>%2<dd>").arg(tr("Platform"), QzTools::operatingSystem()));
cPage.replace(QLatin1String("%PATHS-TEXT%"),

View File

@ -17,12 +17,18 @@
* ============================================================ */
#include "aboutdialog.h"
#include "ui_aboutdialog.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "mainapplication.h"
#include "tabbedwebview.h"
#include "webpage.h"
#include "qtwin.h"
#if QT_VERSION < 0x050000
#include "qwebkitversion.h"
#else
#include <QWebPage>
#endif
AboutDialog::AboutDialog(QWidget* parent)
: QDialog(parent),
ui(new Ui::AboutDialog)
@ -60,15 +66,15 @@ void AboutDialog::showAbout()
ui->authorsButton->setText(tr("Authors and Contributors"));
if (m_aboutHtml.isEmpty()) {
m_aboutHtml += "<center><div style='margin:10px;'>";
m_aboutHtml += tr("<p><b>Application version %1</b><br/>").arg(QupZilla::VERSION
m_aboutHtml += tr("<p><b>Application version %1</b><br/>").arg(Qz::VERSION
#ifdef GIT_REVISION
+ " (" + GIT_REVISION + ")"
#endif
);
m_aboutHtml += tr("<b>WebKit version %1</b></p>").arg(QupZilla::WEBKITVERSION);
m_aboutHtml += QString("<p>&copy; %1 %2<br/>").arg(QupZilla::COPYRIGHT, QupZilla::AUTHOR);
m_aboutHtml += tr("<small>Build time: %1 </small></p>").arg(QupZilla::BUILDTIME);
m_aboutHtml += QString("<p><a href=%1>%1</a></p>").arg(QupZilla::WWWADDRESS);
m_aboutHtml += tr("<b>WebKit version %1</b></p>").arg(qWebKitVersion());
m_aboutHtml += QString("<p>&copy; %1 %2<br/>").arg(Qz::COPYRIGHT, Qz::AUTHOR);
m_aboutHtml += tr("<small>Build time: %1 </small></p>").arg(Qz::BUILDTIME);
m_aboutHtml += QString("<p><a href=%1>%1</a></p>").arg(Qz::WWWADDRESS);
m_aboutHtml += "<p>" + (mApp->windowCount() > 0 ? mApp->getWindow()->weView()->page()->userAgentForUrl(QUrl()) : QString()) + "</p>";
m_aboutHtml += "</div></center>";
}
@ -80,7 +86,7 @@ void AboutDialog::showAuthors()
ui->authorsButton->setText(tr("< About QupZilla"));
if (m_authorsHtml.isEmpty()) {
m_authorsHtml += "<center><div style='margin:10px;'>";
m_authorsHtml += tr("<p><b>Main developer:</b><br/>%1 &lt;%2&gt;</p>").arg(QupZilla::AUTHOR, "<a href=mailto:nowrep@gmail.com>nowrep@gmail.com</a>");
m_authorsHtml += tr("<p><b>Main developer:</b><br/>%1 &lt;%2&gt;</p>").arg(Qz::AUTHOR, "<a href=mailto:nowrep@gmail.com>nowrep@gmail.com</a>");
m_authorsHtml += tr("<p><b>Contributors:</b><br/>%1</p>").arg(
QString::fromUtf8("Mladen Pejaković<br/>"
"Alexander Samilov<br/>"

View File

@ -29,11 +29,11 @@
#include <QMenu>
#include <QCloseEvent>
BrowsingLibrary::BrowsingLibrary(QupZilla* mainClass, QWidget* parent)
BrowsingLibrary::BrowsingLibrary(BrowserWindow* window, QWidget* parent)
: QWidget(parent)
, ui(new Ui::BrowsingLibrary)
, m_historyManager(new HistoryManager(mainClass))
, m_bookmarksManager(new BookmarksManager(mainClass))
, m_historyManager(new HistoryManager(window))
, m_bookmarksManager(new BookmarksManager(window))
, m_rssManager(mApp->rssManager())
, m_rssLoaded(false)
{
@ -112,31 +112,31 @@ void BrowsingLibrary::exportBookmarks()
d->show();
}
void BrowsingLibrary::showHistory(QupZilla* mainClass)
void BrowsingLibrary::showHistory(BrowserWindow* window)
{
ui->tabs->SetCurrentIndex(0);
show();
m_historyManager->setMainWindow(mainClass);
m_historyManager->setMainWindow(window);
raise();
activateWindow();
}
void BrowsingLibrary::showBookmarks(QupZilla* mainClass)
void BrowsingLibrary::showBookmarks(BrowserWindow* window)
{
ui->tabs->SetCurrentIndex(1);
show();
m_bookmarksManager->setMainWindow(mainClass);
m_bookmarksManager->setMainWindow(window);
raise();
activateWindow();
}
void BrowsingLibrary::showRSS(QupZilla* mainClass)
void BrowsingLibrary::showRSS(BrowserWindow* window)
{
ui->tabs->SetCurrentIndex(2);
show();
m_rssManager->setMainWindow(mainClass);
m_rssManager->setMainWindow(window);
if (!m_rssLoaded) {
m_rssManager->refreshTable();

View File

@ -30,18 +30,18 @@ class BrowsingLibrary;
class HistoryManager;
class BookmarksManager;
class RSSManager;
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT BrowsingLibrary : public QWidget
{
Q_OBJECT
public:
explicit BrowsingLibrary(QupZilla* mainClass, QWidget* parent = 0);
explicit BrowsingLibrary(BrowserWindow* window, QWidget* parent = 0);
~BrowsingLibrary();
void showHistory(QupZilla* mainClass);
void showBookmarks(QupZilla* mainClass);
void showRSS(QupZilla* mainClass);
void showHistory(BrowserWindow* window);
void showBookmarks(BrowserWindow* window);
void showRSS(BrowserWindow* window);
void optimizeDatabase();

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "clearprivatedata.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "tabwidget.h"
#include "cookiejar.h"
#include "history.h"
@ -38,9 +38,9 @@
#include <QCloseEvent>
#include <QFileInfo>
ClearPrivateData::ClearPrivateData(QupZilla* mainClass, QWidget* parent)
ClearPrivateData::ClearPrivateData(BrowserWindow* window, QWidget* parent)
: QDialog(parent)
, p_QupZilla(mainClass)
, m_window(window)
, ui(new Ui::ClearPrivateData)
{
ui->setupUi(this);

View File

@ -27,12 +27,12 @@ namespace Ui
class ClearPrivateData;
}
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT ClearPrivateData : public QDialog
{
Q_OBJECT
public:
explicit ClearPrivateData(QupZilla* mainClass, QWidget* parent = 0);
explicit ClearPrivateData(BrowserWindow* window, QWidget* parent = 0);
static void clearLocalStorage();
static void clearWebDatabases();
@ -50,7 +50,7 @@ private:
void restoreState(const QByteArray &state);
QByteArray saveState();
QupZilla* p_QupZilla;
BrowserWindow* m_window;
Ui::ClearPrivateData* ui;
};

View File

@ -18,7 +18,7 @@
* ============================================================ */
#include "macmenureceiver.h"
#include "mainapplication.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "settings.h"
#include <QAction>
@ -78,7 +78,7 @@ bool MacMenuReceiver::callSlot(const char* member, bool makeIfNoWindow, QGeneric
{
//qDebug("MacMenuReceiver::callSlot: \'QupZilla::%s()\'", member);
QupZilla* qzWindow = mApp->getWindow();
BrowserWindow* qzWindow = mApp->getWindow();
if (!qzWindow) {
if (!makeIfNoWindow) {
return false;

View File

@ -20,7 +20,7 @@
#include "tabbedwebview.h"
#include "webpage.h"
#include "qztools.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "settings.h"
#include <QFileDialog>
@ -169,7 +169,7 @@ void PageScreen::saveAsDocument(const QString &format)
}
QPrinter printer;
printer.setCreator(QupZilla::tr("QupZilla %1 (%2)").arg(QupZilla::VERSION, QupZilla::WWWADDRESS));
printer.setCreator(BrowserWindow::tr("QupZilla %1 (%2)").arg(Qz::VERSION, Qz::WWWADDRESS));
printer.setOutputFileName(pathWithoutSuffix + suffix);
printer.setOutputFormat(QPrinter::PdfFormat);
printer.setPaperSize(m_pageImages.first().size(), QPrinter::DevicePixel);

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "statusbarmessage.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "tabwidget.h"
#include "tabbedwebview.h"
#include "squeezelabelv1.h"
@ -101,28 +101,28 @@ bool TipLabel::eventFilter(QObject* o, QEvent* e)
return false;
}
StatusBarMessage::StatusBarMessage(QupZilla* mainClass)
: p_QupZilla(mainClass)
, m_statusBarText(new TipLabel(mainClass))
StatusBarMessage::StatusBarMessage(BrowserWindow* window)
: m_window(window)
, m_statusBarText(new TipLabel(window))
{
}
void StatusBarMessage::showMessage(const QString &message)
{
if (p_QupZilla->statusBar()->isVisible()) {
p_QupZilla->statusBar()->showMessage(message);
if (m_window->statusBar()->isVisible()) {
m_window->statusBar()->showMessage(message);
}
#ifdef Q_OS_WIN
else if (mApp->activeWindow() == p_QupZilla) {
else if (mApp->activeWindow() == m_window) {
#else
else {
#endif
WebView* view = p_QupZilla->weView();
WebView* view = m_window->weView();
QWebFrame* mainFrame = view->page()->mainFrame();
int horizontalScrollSize = 0;
int verticalScrollSize = 0;
const int scrollbarSize = p_QupZilla->style()->pixelMetric(QStyle::PM_ScrollBarExtent);
const int scrollbarSize = m_window->style()->pixelMetric(QStyle::PM_ScrollBarExtent);
if (mainFrame->scrollBarMaximum(Qt::Horizontal)) {
horizontalScrollSize = scrollbarSize;
@ -149,8 +149,8 @@ void StatusBarMessage::showMessage(const QString &message)
void StatusBarMessage::clearMessage()
{
if (p_QupZilla->statusBar()->isVisible()) {
p_QupZilla->statusBar()->showMessage(QString());
if (m_window->statusBar()->isVisible()) {
m_window->statusBar()->showMessage(QString());
}
else {
m_statusBarText->hideDelayed();

View File

@ -26,7 +26,7 @@
class QTimer;
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT TipLabel : public SqueezeLabelV1
{
@ -48,13 +48,13 @@ private:
class QT_QUPZILLA_EXPORT StatusBarMessage
{
public:
explicit StatusBarMessage(QupZilla* mainClass);
explicit StatusBarMessage(BrowserWindow* window);
void showMessage(const QString &message);
void clearMessage();
private:
QupZilla* p_QupZilla;
BrowserWindow* m_window;
TipLabel* m_statusBarText;
};

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "updater.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "qztools.h"
#include "mainapplication.h"
#include "tabwidget.h"
@ -111,17 +111,17 @@ QString Updater::Version::versionString() const
return QString("%1.%2.%3").arg(majorVersion, minorVersion, revisionNumber);
}
Updater::Updater(QupZilla* mainClass, QObject* parent)
Updater::Updater(BrowserWindow* window, QObject* parent)
: QObject(parent)
, p_QupZilla(mainClass)
, m_window(window)
{
QTimer::singleShot(60 * 1000, this, SLOT(start())); // Start checking after 1 minute
}
void Updater::start()
{
QUrl url = QUrl(QString("%1/update.php?v=%2&os=%3").arg(QupZilla::WWWADDRESS,
QupZilla::VERSION,
QUrl url = QUrl(QString("%1/update.php?v=%2&os=%3").arg(Qz::WWWADDRESS,
Qz::VERSION,
QzTools::operatingSystem()));
startDownloadingUpdateInfo(url);
@ -141,7 +141,7 @@ void Updater::downCompleted(QNetworkReply* reply)
if (html.startsWith(QLatin1String("Version:"))) {
html.remove(QLatin1String("Version:"));
Version current(QupZilla::VERSION);
Version current(Qz::VERSION);
Version updated(html);
if (current.isValid && updated.isValid && current < updated) {
@ -154,7 +154,7 @@ void Updater::downCompleted(QNetworkReply* reply)
void Updater::downloadNewVersion()
{
p_QupZilla->tabWidget()->addView(QUrl(QupZilla::WWWADDRESS + "/download"), tr("Update"), Qz::NT_NotSelectedTab);
m_window->tabWidget()->addView(QUrl(Qz::WWWADDRESS + "/download"), tr("Update"), Qz::NT_NotSelectedTab);
}
Updater::~Updater()

View File

@ -25,13 +25,13 @@
class QNetworkReply;
class QUrl;
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT Updater : public QObject
{
Q_OBJECT
public:
explicit Updater(QupZilla* mainClass, QObject* parent = 0);
explicit Updater(BrowserWindow* window, QObject* parent = 0);
~Updater();
struct QT_QUPZILLA_EXPORT Version {
@ -60,7 +60,7 @@ private slots:
private:
void startDownloadingUpdateInfo(const QUrl &url);
QupZilla* p_QupZilla;
BrowserWindow* m_window;
};
#endif // UPDATER_H

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "useragentmanager.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "qztools.h"
#include "settings.h"
@ -25,7 +25,7 @@
UserAgentManager::UserAgentManager()
: m_usePerDomainUserAgent(false)
{
m_fakeUserAgent = QString("Mozilla/5.0 (%1) AppleWebKit/%2 (KHTML, like Gecko) Chrome/10.0 Safari/%2").arg(QzTools::operatingSystem(), QupZilla::WEBKITVERSION);
m_fakeUserAgent = QString("Mozilla/5.0 (%1) AppleWebKit/%2 (KHTML, like Gecko) Chrome/10.0 Safari/%2").arg(QzTools::operatingSystem(), BrowserWindow::WEBKITVERSION);
}
void UserAgentManager::loadSettings()

View File

@ -44,7 +44,7 @@
#include "squeezelabelv2.h"
#include "webpage.h"
#include "qztools.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include <QHBoxLayout>
#include <QToolButton>

View File

@ -213,12 +213,12 @@ void PluginProxy::emitWebPageDeleted(WebPage* page)
emit webPageDeleted(page);
}
void PluginProxy::emitMainWindowCreated(QupZilla* window)
void PluginProxy::emitMainWindowCreated(BrowserWindow* window)
{
emit mainWindowCreated(window);
}
void PluginProxy::emitMainWindowDeleted(QupZilla* window)
void PluginProxy::emitMainWindowDeleted(BrowserWindow* window)
{
emit mainWindowDeleted(window);
}

View File

@ -21,7 +21,7 @@
#include "plugins.h"
#include "qz_namespace.h"
class QupZilla;
class BrowserWindow;
class WebPage;
class QT_QUPZILLA_EXPORT PluginProxy : public Plugins
@ -54,15 +54,15 @@ public:
void emitWebPageCreated(WebPage* page);
void emitWebPageDeleted(WebPage* page);
void emitMainWindowCreated(QupZilla* window);
void emitMainWindowDeleted(QupZilla* window);
void emitMainWindowCreated(BrowserWindow* window);
void emitMainWindowDeleted(BrowserWindow* window);
signals:
void webPageCreated(WebPage* page);
void webPageDeleted(WebPage* page);
void mainWindowCreated(QupZilla* window);
void mainWindowDeleted(QupZilla* window);
void mainWindowCreated(BrowserWindow* window);
void mainWindowDeleted(BrowserWindow* window);
private slots:
void pluginUnloaded(PluginInterface* plugin);

View File

@ -26,9 +26,9 @@
#include <QStyle>
#include <QWebFrame>
PopupStatusBarMessage::PopupStatusBarMessage(PopupWindow* mainClass)
: m_popupWindow(mainClass)
, m_statusBarText(new TipLabel(mainClass))
PopupStatusBarMessage::PopupStatusBarMessage(PopupWindow* window)
: m_popupWindow(window)
, m_statusBarText(new TipLabel(window))
{
}

View File

@ -26,7 +26,7 @@ class TipLabel;
class QT_QUPZILLA_EXPORT PopupStatusBarMessage
{
public:
explicit PopupStatusBarMessage(PopupWindow* mainClass);
explicit PopupStatusBarMessage(PopupWindow* window);
void showMessage(const QString &message);
void clearMessage();

View File

@ -18,7 +18,7 @@
#include "popupwebpage.h"
#include "popupwebview.h"
#include "popupwindow.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "tabwidget.h"
#include "tabbedwebview.h"
@ -31,9 +31,9 @@
//
// Got an idea how to determine it from kWebKitPart.
PopupWebPage::PopupWebPage(QWebPage::WebWindowType type, QupZilla* mainClass)
PopupWebPage::PopupWebPage(QWebPage::WebWindowType type, BrowserWindow* window)
: WebPage()
, p_QupZilla(mainClass)
, m_window(window)
, m_type(type)
, m_createNewWindow(false)
, m_menuBarVisible(false)
@ -54,9 +54,9 @@ PopupWebPage::PopupWebPage(QWebPage::WebWindowType type, QupZilla* mainClass)
QTimer::singleShot(0, this, SLOT(checkBehaviour()));
}
QupZilla* PopupWebPage::mainWindow() const
BrowserWindow* PopupWebPage::mainWindow() const
{
return p_QupZilla;
return m_window;
}
void PopupWebPage::slotGeometryChangeRequested(const QRect &rect)
@ -129,7 +129,7 @@ void PopupWebPage::checkBehaviour()
view->fakeLoadingProgress(m_progress);
}
p_QupZilla->addDeleteOnCloseWidget(popup);
m_window->addDeleteOnCloseWidget(popup);
disconnect(this, SIGNAL(geometryChangeRequested(QRect)), this, SLOT(slotGeometryChangeRequested(QRect)));
disconnect(this, SIGNAL(menuBarVisibilityChangeRequested(bool)), this, SLOT(slotMenuBarVisibilityChangeRequested(bool)));
@ -141,8 +141,8 @@ void PopupWebPage::checkBehaviour()
disconnect(this, SIGNAL(loadFinished(bool)), this, SLOT(slotLoadFinished(bool)));
}
else {
int index = p_QupZilla->tabWidget()->addView(QUrl(), Qz::NT_CleanSelectedTab);
TabbedWebView* view = p_QupZilla->weView(index);
int index = m_window->tabWidget()->addView(QUrl(), Qz::NT_CleanSelectedTab);
TabbedWebView* view = m_window->weView(index);
view->setWebPage(this);
if (m_isLoading) {

View File

@ -21,15 +21,15 @@
#include "qz_namespace.h"
#include "webpage.h"
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT PopupWebPage : public WebPage
{
Q_OBJECT
public:
explicit PopupWebPage(WebWindowType type, QupZilla* mainClass);
explicit PopupWebPage(WebWindowType type, BrowserWindow* window);
QupZilla* mainWindow() const;
BrowserWindow* mainWindow() const;
private slots:
void slotGeometryChangeRequested(const QRect &rect);
@ -44,7 +44,7 @@ private slots:
void checkBehaviour();
private:
QupZilla* p_QupZilla;
BrowserWindow* m_window;
QWebPage::WebWindowType m_type;
bool m_createNewWindow;

View File

@ -18,7 +18,7 @@
#include "popupwebview.h"
#include "popupwebpage.h"
#include "mainapplication.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "tabwidget.h"
#include "tabbedwebview.h"
#include "iconprovider.h"
@ -65,7 +65,7 @@ void PopupWebView::loadInNewTab(const QNetworkRequest &req, QNetworkAccessManage
{
Q_UNUSED(position)
QupZilla* window = mApp->getWindow();
BrowserWindow* window = mApp->getWindow();
if (window) {
QNetworkRequest r(req);

View File

@ -17,7 +17,7 @@
* ============================================================ */
#include "preferences.h"
#include "ui_preferences.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "bookmarkstoolbar.h"
#include "history.h"
#include "tabwidget.h"
@ -70,10 +70,10 @@ static QString createLanguageItem(const QString &lang)
return QString("%1, %2 (%3)").arg(language, country, lang);
}
Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
Preferences::Preferences(BrowserWindow* window, QWidget* parent)
: QDialog(parent)
, ui(new Ui::Preferences)
, p_QupZilla(mainClass)
, m_window(window)
, m_autoFillManager(0)
, m_pluginsList(0)
, m_autoFillEnabled(false)
@ -169,7 +169,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
afterLaunchChanged(ui->afterLaunch->currentIndex());
connect(ui->afterLaunch, SIGNAL(currentIndexChanged(int)), this, SLOT(afterLaunchChanged(int)));
connect(ui->newTab, SIGNAL(currentIndexChanged(int)), this, SLOT(newTabChanged(int)));
if (p_QupZilla) {
if (m_window) {
connect(ui->useCurrentBut, SIGNAL(clicked()), this, SLOT(useActualHomepage()));
connect(ui->newTabUseCurrent, SIGNAL(clicked()), this, SLOT(useActualNewTab()));
}
@ -206,9 +206,9 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
//APPEREANCE
settings.beginGroup("Browser-View-Settings");
ui->showStatusbar->setChecked(settings.value("showStatusBar", true).toBool());
if (p_QupZilla) {
ui->showBookmarksToolbar->setChecked(p_QupZilla->bookmarksToolbar()->isVisible());
ui->showNavigationToolbar->setChecked(p_QupZilla->navigationBar()->isVisible());
if (m_window) {
ui->showBookmarksToolbar->setChecked(m_window->bookmarksToolbar()->isVisible());
ui->showNavigationToolbar->setChecked(m_window->navigationBar()->isVisible());
}
else {
ui->showBookmarksToolbar->setChecked(settings.value("showBookmarksToolbar", true).toBool());
@ -260,7 +260,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
bool pbInABuseCC = settings.value("UseCustomProgressColor", false).toBool();
ui->checkBoxCustomProgressColor->setChecked(pbInABuseCC);
ui->progressBarColorSelector->setEnabled(pbInABuseCC);
QColor pbColor = settings.value("CustomProgressColor", p_QupZilla->palette().color(QPalette::Highlight)).value<QColor>();
QColor pbColor = settings.value("CustomProgressColor", m_window->palette().color(QPalette::Highlight)).value<QColor>();
setProgressBarColorIcon(pbColor);
connect(ui->customColorToolButton, SIGNAL(clicked(bool)), SLOT(selectCustomProgressBarColor()));
connect(ui->resetProgressBarcolor, SIGNAL(clicked()), SLOT(setProgressBarColorIcon()));
@ -478,7 +478,7 @@ Preferences::Preferences(QupZilla* mainClass, QWidget* parent)
connect(ui->listWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(showStackedPage(QListWidgetItem*)));
ui->listWidget->setItemSelected(ui->listWidget->itemAt(5, 5), true);
ui->version->setText(" QupZilla v" + QupZilla::VERSION);
ui->version->setText(" QupZilla v" + Qz::VERSION);
ui->listWidget->setCurrentRow(currentSettingsPage);
QDesktopWidget* desktop = QApplication::desktop();
@ -575,12 +575,12 @@ void Preferences::allowCacheChanged(bool state)
void Preferences::useActualHomepage()
{
ui->homepage->setText(p_QupZilla->weView()->url().toString());
ui->homepage->setText(m_window->weView()->url().toString());
}
void Preferences::useActualNewTab()
{
ui->newTabUrl->setText(p_QupZilla->weView()->url().toString());
ui->newTabUrl->setText(m_window->weView()->url().toString());
}
void Preferences::chooseDownPath()
@ -807,7 +807,7 @@ void Preferences::createProfile()
QFile versionFile(dir.absolutePath() + "/version");
versionFile.open(QFile::WriteOnly);
versionFile.write(QupZilla::VERSION.toUtf8());
versionFile.write(Qz::VERSION.toUtf8());
versionFile.close();
ui->startProfile->insertItem(0, name);
@ -1096,7 +1096,7 @@ void Preferences::setProgressBarColorIcon(QColor color)
const int size = style()->pixelMetric(QStyle::PM_ToolBarIconSize);
QPixmap pm(QSize(size, size));
if (!color.isValid()) {
color = p_QupZilla->palette().color(QPalette::Highlight);
color = m_window->palette().color(QPalette::Highlight);
}
pm.fill(color);
ui->customColorToolButton->setIcon(pm);

View File

@ -32,7 +32,7 @@ class QAbstractButton;
class QListWidgetItem;
class AutoFillManager;
class QupZilla;
class BrowserWindow;
class PluginsManager;
class DesktopNotification;
class ThemeManager;
@ -42,7 +42,7 @@ class QT_QUPZILLA_EXPORT Preferences : public QDialog
Q_OBJECT
public:
explicit Preferences(QupZilla* mainClass, QWidget* parent = 0);
explicit Preferences(BrowserWindow* window, QWidget* parent = 0);
~Preferences();
private slots:
@ -97,7 +97,7 @@ private:
void closeEvent(QCloseEvent* event);
Ui::Preferences* ui;
QupZilla* p_QupZilla;
BrowserWindow* m_window;
AutoFillManager* m_autoFillManager;
PluginsManager* m_pluginsList;
ThemeManager* m_themesManager;

View File

@ -17,7 +17,7 @@
* ============================================================ */
#include "rssmanager.h"
#include "ui_rssmanager.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "tabwidget.h"
#include "mainapplication.h"
#include "treewidget.h"
@ -38,10 +38,10 @@
#include <QBuffer>
#include <QSqlQuery>
RSSManager::RSSManager(QupZilla* mainClass, QWidget* parent)
RSSManager::RSSManager(BrowserWindow* window, QWidget* parent)
: QWidget(parent)
, ui(new Ui::RSSManager)
, p_QupZilla(mainClass)
, m_window(window)
{
ui->setupUi(this);
#ifdef Q_OS_MAC
@ -63,12 +63,12 @@ RSSManager::RSSManager(QupZilla* mainClass, QWidget* parent)
connect(ui->edit, SIGNAL(clicked()), this, SLOT(editFeed()));
}
QupZilla* RSSManager::getQupZilla()
BrowserWindow* RSSManager::getQupZilla()
{
if (!p_QupZilla) {
p_QupZilla = mApp->getWindow();
if (!m_window) {
m_window = mApp->getWindow();
}
return p_QupZilla.data();
return m_window.data();
}
void RSSManager::deleteAllTabs()
@ -80,10 +80,10 @@ void RSSManager::deleteAllTabs()
}
}
void RSSManager::setMainWindow(QupZilla* window)
void RSSManager::setMainWindow(BrowserWindow* window)
{
if (window) {
p_QupZilla = window;
m_window = window;
}
}

View File

@ -35,7 +35,7 @@ namespace Ui
class RSSManager;
}
class QupZilla;
class BrowserWindow;
class FollowRedirectReply;
class NetworkManager;
class QT_QUPZILLA_EXPORT RSSManager : public QWidget
@ -44,11 +44,11 @@ class QT_QUPZILLA_EXPORT RSSManager : public QWidget
friend class BrowsingLibrary;
public:
explicit RSSManager(QupZilla* mainClass, QWidget* parent = 0);
explicit RSSManager(BrowserWindow* window, QWidget* parent = 0);
~RSSManager();
bool addRssFeed(const QUrl &url, const QString &title, const QIcon &icon);
void setMainWindow(QupZilla* window);
void setMainWindow(BrowserWindow* window);
public slots:
void refreshTable();
@ -66,7 +66,7 @@ private slots:
void loadFeedInNewTab();
private:
QupZilla* getQupZilla();
BrowserWindow* getQupZilla();
void deleteAllTabs();
QList<QPair<FollowRedirectReply*, QUrl> > m_replies;
@ -74,7 +74,7 @@ private:
Ui::RSSManager* ui;
QToolButton* m_reloadButton;
QPointer<QupZilla> p_QupZilla;
QPointer<BrowserWindow> m_window;
};
#endif // RSSMANAGER_H

View File

@ -21,13 +21,13 @@
#include "restoremanager.h"
#include "mainapplication.h"
#include "webview.h"
#include "qupzilla.h"
#include "browserwindow.h"
RecoveryWidget::RecoveryWidget(WebView* view, QupZilla* mainClass)
RecoveryWidget::RecoveryWidget(WebView* view, BrowserWindow* window)
: QWidget()
, ui(new Ui::RecoveryWidget)
, m_view(view)
, p_QupZilla(mainClass)
, m_window(window)
{
ui->setupUi(this);
@ -96,14 +96,14 @@ void RecoveryWidget::restoreSession()
}
}
if (!mApp->restoreStateSlot(p_QupZilla, data)) {
if (!mApp->restoreStateSlot(m_window, data)) {
newSession();
}
}
void RecoveryWidget::newSession()
{
m_view->load(p_QupZilla->homepageUrl());
m_view->load(m_window->homepageUrl());
mApp->destroyRestoreManager();
}

View File

@ -29,14 +29,14 @@ class RecoveryWidget;
class QTreeWidgetItem;
class WebView;
class QupZilla;
class BrowserWindow;
class RecoveryWidget : public QWidget
{
Q_OBJECT
public:
explicit RecoveryWidget(WebView* view, QupZilla* mainClass);
explicit RecoveryWidget(WebView* view, BrowserWindow* window);
~RecoveryWidget();
private slots:
@ -47,7 +47,7 @@ private:
Ui::RecoveryWidget* ui;
WebView* m_view;
QupZilla* p_QupZilla;
BrowserWindow* m_window;
};
#endif // RECOVERYWIDGET_H

View File

@ -24,10 +24,10 @@
#include <QMenu>
BookmarksSidebar::BookmarksSidebar(QupZilla* mainClass, QWidget* parent)
BookmarksSidebar::BookmarksSidebar(BrowserWindow* window, QWidget* parent)
: QWidget(parent)
, ui(new Ui::BookmarksSideBar)
, m_window(mainClass)
, m_window(window)
, m_bookmarks(mApp->bookmarks())
{
ui->setupUi(this);

View File

@ -27,7 +27,7 @@ namespace Ui
class BookmarksSideBar;
}
class QupZilla;
class BrowserWindow;
class Bookmarks;
class BookmarkItem;
@ -36,7 +36,7 @@ class QT_QUPZILLA_EXPORT BookmarksSidebar : public QWidget
Q_OBJECT
public:
explicit BookmarksSidebar(QupZilla* mainClass, QWidget* parent = 0);
explicit BookmarksSidebar(BrowserWindow* window, QWidget* parent = 0);
~BookmarksSidebar();
private slots:
@ -53,7 +53,7 @@ private slots:
private:
Ui::BookmarksSideBar* ui;
QupZilla* m_window;
BrowserWindow* m_window;
Bookmarks* m_bookmarks;
};

View File

@ -17,17 +17,17 @@
* ============================================================ */
#include "historysidebar.h"
#include "ui_historysidebar.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "tabwidget.h"
#include "tabbedwebview.h"
#include "mainapplication.h"
#include "historymodel.h"
#include "qzsettings.h"
HistorySideBar::HistorySideBar(QupZilla* mainClass, QWidget* parent)
HistorySideBar::HistorySideBar(BrowserWindow* window, QWidget* parent)
: QWidget(parent)
, ui(new Ui::HistorySideBar)
, p_QupZilla(mainClass)
, m_window(window)
{
ui->setupUi(this);
@ -43,10 +43,10 @@ HistorySideBar::HistorySideBar(QupZilla* mainClass, QWidget* parent)
void HistorySideBar::openLink(const QUrl &url, HistoryView::OpenBehavior openIn)
{
if (openIn == HistoryView::OpenInNewTab) {
p_QupZilla->tabWidget()->addView(url, qzSettings->newTabPosition);
m_window->tabWidget()->addView(url, qzSettings->newTabPosition);
}
else {
p_QupZilla->weView()->load(url);
m_window->weView()->load(url);
}
}

View File

@ -28,14 +28,14 @@ namespace Ui
class HistorySideBar;
}
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT HistorySideBar : public QWidget
{
Q_OBJECT
public:
explicit HistorySideBar(QupZilla* mainClass, QWidget* parent = 0);
explicit HistorySideBar(BrowserWindow* window, QWidget* parent = 0);
~HistorySideBar();
private slots:
@ -43,7 +43,7 @@ private slots:
private:
Ui::HistorySideBar* ui;
QupZilla* p_QupZilla;
BrowserWindow* m_window;
};
#endif // HISTORYSIDEBAR_H

View File

@ -21,16 +21,16 @@
#include "bookmarkssidebar.h"
#include "historysidebar.h"
#include "mainapplication.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "settings.h"
#include <QMenu>
QHash<QString, QPointer<SideBarInterface> > SideBarManager::s_sidebars;
SideBar::SideBar(SideBarManager* manager, QupZilla* mainClass)
: QWidget(mainClass)
, p_QupZilla(mainClass)
SideBar::SideBar(SideBarManager* manager, BrowserWindow* window)
: QWidget(window)
, m_window(window)
, m_manager(manager)
{
setObjectName("sidebar");
@ -62,14 +62,14 @@ void SideBar::setWidget(QWidget* widget)
void SideBar::showBookmarks()
{
m_titleBar->setTitle(tr("Bookmarks"));
BookmarksSidebar* bar = new BookmarksSidebar(p_QupZilla);
BookmarksSidebar* bar = new BookmarksSidebar(m_window);
setWidget(bar);
}
void SideBar::showHistory()
{
m_titleBar->setTitle(tr("History"));
HistorySideBar* bar = new HistorySideBar(p_QupZilla);
HistorySideBar* bar = new HistorySideBar(m_window);
setWidget(bar);
}
@ -85,9 +85,9 @@ void SideBar::close()
QWidget::close();
}
SideBarManager::SideBarManager(QupZilla* parent)
SideBarManager::SideBarManager(BrowserWindow* parent)
: QObject(parent)
, p_QupZilla(parent)
, m_window(parent)
, m_menu(0)
{
}
@ -103,7 +103,7 @@ void SideBarManager::addSidebar(const QString &id, SideBarInterface* interface)
{
s_sidebars[id] = interface;
foreach (QupZilla* window, mApp->mainWindows()) {
foreach (BrowserWindow* window, mApp->mainWindows()) {
window->sideBarManager()->refreshMenu();
}
}
@ -112,7 +112,7 @@ void SideBarManager::removeSidebar(const QString &id)
{
s_sidebars.remove(id);
foreach (QupZilla* window, mApp->mainWindows()) {
foreach (BrowserWindow* window, mApp->mainWindows()) {
window->sideBarManager()->sideBarRemoved(id);
}
}
@ -124,7 +124,7 @@ void SideBarManager::refreshMenu()
}
foreach (QAction* action, m_menu->actions()) {
p_QupZilla->removeAction(action);
m_window->removeAction(action);
}
m_menu->clear();
@ -150,7 +150,7 @@ void SideBarManager::refreshMenu()
m_menu->addAction(act);
}
p_QupZilla->addActions(m_menu->actions());
m_window->addActions(m_menu->actions());
updateActions();
}
@ -180,7 +180,7 @@ void SideBarManager::showSideBar(const QString &id, bool toggle)
}
if (!m_sideBar) {
m_sideBar = p_QupZilla->addSideBar();
m_sideBar = m_window->addSideBar();
}
if (id == m_activeBar) {
@ -209,7 +209,7 @@ void SideBarManager::showSideBar(const QString &id, bool toggle)
}
m_sideBar.data()->setTitle(sidebar->title());
m_sideBar.data()->setWidget(sidebar->createSideBarWidget(p_QupZilla));
m_sideBar.data()->setWidget(sidebar->createSideBarWidget(m_window));
}
m_activeBar = id;
@ -239,7 +239,7 @@ void SideBarManager::closeSideBar()
Settings settings;
settings.setValue("Browser-View-Settings/SideBar", m_activeBar);
p_QupZilla->saveSideBarWidth();
m_window->saveSideBarWidth();
updateActions();
}

View File

@ -30,13 +30,13 @@ class QMenu;
class DockTitleBarWidget;
class SideBarInterface;
class SideBarManager;
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT SideBar : public QWidget
{
Q_OBJECT
public:
explicit SideBar(SideBarManager* manager, QupZilla* mainClass);
explicit SideBar(SideBarManager* manager, BrowserWindow* window);
void showBookmarks();
void showHistory();
@ -48,7 +48,7 @@ public slots:
void close();
private:
QupZilla* p_QupZilla;
BrowserWindow* m_window;
QVBoxLayout* m_layout;
DockTitleBarWidget* m_titleBar;
SideBarManager* m_manager;
@ -58,7 +58,7 @@ class QT_QUPZILLA_EXPORT SideBarManager : public QObject
{
Q_OBJECT
public:
explicit SideBarManager(QupZilla* parent);
explicit SideBarManager(BrowserWindow* parent);
void setSideBarMenu(QMenu* menu);
void refreshMenu();
@ -77,7 +77,7 @@ private slots:
private:
void updateActions();
QupZilla* p_QupZilla;
BrowserWindow* m_window;
QPointer<SideBar> m_sideBar;
QMenu* m_menu;

View File

@ -24,7 +24,7 @@
class QAction;
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT SideBarInterface : public QObject
{
@ -34,7 +34,7 @@ public:
virtual QString title() const = 0;
virtual QAction* createMenuAction() = 0;
virtual QWidget* createSideBarWidget(QupZilla* mainWindow) = 0;
virtual QWidget* createSideBarWidget(BrowserWindow* mainWindow) = 0;
};
#endif // SIDEBARINTERFACE_H

View File

@ -16,11 +16,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "menubar.h"
#include "qupzilla.h"
#include "browserwindow.h"
MenuBar::MenuBar(QupZilla* parent)
MenuBar::MenuBar(BrowserWindow* parent)
: QMenuBar(parent)
, p_QupZilla(parent)
, m_window(parent)
{
setObjectName("mainwindow-menubar");
setCursor(Qt::ArrowCursor);
@ -33,6 +33,6 @@ MenuBar::MenuBar(QupZilla* parent)
void MenuBar::contextMenuRequested(const QPoint &pos)
{
if (!actionAt(pos)) {
p_QupZilla->popupToolbarsMenu(mapToGlobal(pos));
m_window->popupToolbarsMenu(mapToGlobal(pos));
}
}

View File

@ -22,19 +22,19 @@
#include <QMenuBar>
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT MenuBar : public QMenuBar
{
Q_OBJECT
public:
explicit MenuBar(QupZilla* parent);
explicit MenuBar(BrowserWindow* parent);
private slots:
void contextMenuRequested(const QPoint &pos);
private:
QupZilla* p_QupZilla;
BrowserWindow* m_window;
};

View File

@ -18,7 +18,7 @@
#include "qztools.h"
#include "siteinfowidget.h"
#include "ui_siteinfowidget.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "mainapplication.h"
#include "webpage.h"
#include "tabbedwebview.h"
@ -26,17 +26,17 @@
#include <QToolTip>
#include <QSqlQuery>
SiteInfoWidget::SiteInfoWidget(QupZilla* mainClass, QWidget* parent)
SiteInfoWidget::SiteInfoWidget(BrowserWindow* window, QWidget* parent)
: LocationBarPopup(parent)
, ui(new Ui::SiteInfoWidget)
, p_QupZilla(mainClass)
, m_window(window)
{
this->setAttribute(Qt::WA_DeleteOnClose);
ui->setupUi(this);
setPopupAlignment(Qt::AlignLeft);
WebView* view = p_QupZilla->weView();
WebView* view = m_window->weView();
WebPage* webPage = view->page();
QUrl url = view->url();
@ -82,7 +82,7 @@ SiteInfoWidget::SiteInfoWidget(QupZilla* mainClass, QWidget* parent)
ui->historyLabel->setText(tr("This is your <b>%1</b> visit of this site.").arg(text));
}
}
connect(ui->pushButton, SIGNAL(clicked()), p_QupZilla, SLOT(showPageInfo()));
connect(ui->pushButton, SIGNAL(clicked()), m_window, SLOT(showPageInfo()));
}
SiteInfoWidget::~SiteInfoWidget()

View File

@ -28,18 +28,18 @@ namespace Ui
class SiteInfoWidget;
}
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT SiteInfoWidget : public LocationBarPopup
{
Q_OBJECT
public:
explicit SiteInfoWidget(QupZilla* mainClass, QWidget* parent = 0);
explicit SiteInfoWidget(BrowserWindow* window, QWidget* parent = 0);
~SiteInfoWidget();
private:
Ui::SiteInfoWidget* ui;
QupZilla* p_QupZilla;
BrowserWindow* m_window;
};
#endif // SITEINFOWIDGET_H

View File

@ -18,7 +18,7 @@
#include "tabbar.h"
#include "tabwidget.h"
#include "tabpreview.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "webtab.h"
#include "iconprovider.h"
#include "toolbutton.h"
@ -40,11 +40,11 @@
#include <QHBoxLayout>
#include <QToolTip>
TabBar::TabBar(QupZilla* mainClass, TabWidget* tabWidget)
TabBar::TabBar(BrowserWindow* window, TabWidget* tabWidget)
: ComboTabBar()
, p_QupZilla(mainClass)
, m_window(window)
, m_tabWidget(tabWidget)
, m_tabPreview(new TabPreview(mainClass, mainClass))
, m_tabPreview(new TabPreview(window, window))
, m_showTabPreviews(false)
, m_hideTabBarWithOneTab(false)
, m_clickedTab(0)
@ -77,7 +77,7 @@ TabBar::TabBar(QupZilla* mainClass, TabWidget* tabWidget)
// ComboTabBar features
setUsesScrollButtons(true);
setCloseButtonsToolTip(QupZilla::tr("Close Tab"));
setCloseButtonsToolTip(BrowserWindow::tr("Close Tab"));
connect(this, SIGNAL(overFlowChanged(bool)), this, SLOT(overFlowChange(bool)));
connect(this, SIGNAL(scrollBarValueChanged(int)), this, SLOT(hideTabPreview()));
}
@ -122,7 +122,7 @@ void TabBar::updateVisibilityWithFullscreen(bool visible)
void TabBar::setVisible(bool visible)
{
if (visible && p_QupZilla->isFullScreen()) {
if (visible && m_window->isFullScreen()) {
return;
}
@ -149,7 +149,7 @@ void TabBar::contextMenuRequested(const QPoint &position)
m_clickedTab = index;
QMenu menu;
menu.addAction(QIcon::fromTheme("tab-new", QIcon(":/icons/menu/tab-new.png")), tr("&New tab"), p_QupZilla, SLOT(addTab()));
menu.addAction(QIcon::fromTheme("tab-new", QIcon(":/icons/menu/tab-new.png")), tr("&New tab"), m_window, SLOT(addTab()));
menu.addSeparator();
if (index != -1) {
WebTab* webTab = qobject_cast<WebTab*>(m_tabWidget->widget(m_clickedTab));
@ -157,7 +157,7 @@ void TabBar::contextMenuRequested(const QPoint &position)
return;
}
if (p_QupZilla->weView(m_clickedTab)->isLoading()) {
if (m_window->weView(m_clickedTab)->isLoading()) {
menu.addAction(qIconProvider->standardIcon(QStyle::SP_BrowserStop), tr("&Stop Tab"), this, SLOT(stopTab()));
}
else {
@ -174,9 +174,9 @@ void TabBar::contextMenuRequested(const QPoint &position)
menu.addSeparator();
menu.addAction(tr("Re&load All Tabs"), m_tabWidget, SLOT(reloadAllTabs()));
menu.addAction(tr("&Bookmark This Tab"), this, SLOT(bookmarkTab()));
menu.addAction(tr("Bookmark &All Tabs"), p_QupZilla, SLOT(bookmarkAllTabs()));
menu.addAction(tr("Bookmark &All Tabs"), m_window, SLOT(bookmarkAllTabs()));
menu.addSeparator();
QAction* action = p_QupZilla->actionRestoreTab();
QAction* action = m_window->actionRestoreTab();
action->setEnabled(m_tabWidget->canRestoreTab());
menu.addAction(action);
menu.addSeparator();
@ -186,7 +186,7 @@ void TabBar::contextMenuRequested(const QPoint &position)
}
else {
menu.addAction(tr("Reloa&d All Tabs"), m_tabWidget, SLOT(reloadAllTabs()));
menu.addAction(tr("Bookmark &All Tabs"), p_QupZilla, SLOT(bookmarkAllTabs()));
menu.addAction(tr("Bookmark &All Tabs"), m_window, SLOT(bookmarkAllTabs()));
menu.addSeparator();
QAction* action = menu.addAction(QIcon::fromTheme("user-trash"), tr("Restore &Closed Tab"), m_tabWidget, SLOT(restoreClosedTab()));
action->setEnabled(m_tabWidget->canRestoreTab());
@ -197,7 +197,7 @@ void TabBar::contextMenuRequested(const QPoint &position)
QPoint p(pos.x(), pos.y() + 1);
menu.exec(p);
p_QupZilla->actionRestoreTab()->setEnabled(true);
m_window->actionRestoreTab()->setEnabled(true);
}
void TabBar::closeAllButCurrent()
@ -451,14 +451,14 @@ void TabBar::currentTabChanged(int index)
void TabBar::bookmarkTab()
{
TabbedWebView* view = p_QupZilla->weView(m_clickedTab);
TabbedWebView* view = m_window->weView(m_clickedTab);
if (!view) {
return;
}
WebTab* tab = view->webTab();
p_QupZilla->addBookmark(tab->url(), tab->title());
m_window->addBookmark(tab->url(), tab->title());
}
void TabBar::pinTab()
@ -510,8 +510,8 @@ void TabBar::showTabPreview(bool delayed)
m_tabPreview->setWebTab(webTab, m_tabPreview->previewIndex() == currentIndex());
QRect r(tabRect(m_tabPreview->previewIndex()));
r.setTopLeft(mapTo(p_QupZilla, r.topLeft()));
r.setBottomRight(mapTo(p_QupZilla, r.bottomRight()));
r.setTopLeft(mapTo(m_window, r.topLeft()));
r.setBottomRight(mapTo(m_window, r.bottomRight()));
m_tabPreview->showOnRect(r);
}
@ -734,7 +734,7 @@ void TabBar::dropEvent(QDropEvent* event)
}
}
else {
WebTab* tab = p_QupZilla->weView(index)->webTab();
WebTab* tab = m_window->weView(index)->webTab();
if (tab->isRestored()) {
tab->view()->load(mime->urls().at(0));
}

View File

@ -24,7 +24,7 @@
#include "qz_namespace.h"
class QupZilla;
class BrowserWindow;
class TabWidget;
class TabPreview;
@ -32,7 +32,7 @@ class QT_QUPZILLA_EXPORT TabBar : public ComboTabBar
{
Q_OBJECT
public:
explicit TabBar(QupZilla* mainClass, TabWidget* tabWidget);
explicit TabBar(BrowserWindow* window, TabWidget* tabWidget);
void loadSettings();
@ -104,7 +104,7 @@ private:
QSize tabSizeHint(int index, bool fast) const;
int comboTabBarPixelMetric(ComboTabBar::SizeType sizeType) const;
QupZilla* p_QupZilla;
BrowserWindow* m_window;
TabWidget* m_tabWidget;
TabPreview* m_tabPreview;
QTimer* m_tabPreviewShowTimer;

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "tabbedwebview.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "webpage.h"
#include "tabwidget.h"
#include "networkmanager.h"
@ -38,9 +38,9 @@
#include <QWebFrame>
#include <QContextMenuEvent>
TabbedWebView::TabbedWebView(QupZilla* mainClass, WebTab* webTab)
TabbedWebView::TabbedWebView(BrowserWindow* window, WebTab* webTab)
: WebView(webTab)
, p_QupZilla(mainClass)
, m_window(window)
, m_webTab(webTab)
, m_menu(new Menu(this))
, m_mouseTrack(false)
@ -55,11 +55,11 @@ TabbedWebView::TabbedWebView(QupZilla* mainClass, WebTab* webTab)
connect(this, SIGNAL(titleChanged(QString)), this, SLOT(titleChanged()));
connect(this, SIGNAL(iconChanged()), this, SLOT(showIcon()));
connect(this, SIGNAL(statusBarMessage(QString)), p_QupZilla->statusBar(), SLOT(showMessage(QString)));
connect(p_QupZilla, SIGNAL(setWebViewMouseTracking(bool)), this, SLOT(trackMouse(bool)));
connect(this, SIGNAL(statusBarMessage(QString)), m_window->statusBar(), SLOT(showMessage(QString)));
connect(m_window, SIGNAL(setWebViewMouseTracking(bool)), this, SLOT(trackMouse(bool)));
// Tracking mouse also on tabs created in fullscreen
trackMouse(p_QupZilla->isFullScreen());
trackMouse(m_window->isFullScreen());
}
void TabbedWebView::setWebPage(WebPage* page)
@ -73,7 +73,7 @@ void TabbedWebView::setWebPage(WebPage* page)
void TabbedWebView::inspectElement()
{
p_QupZilla->showWebInspector(false);
m_window->showWebInspector(false);
triggerPageAction(QWebPage::InspectElement);
}
@ -84,7 +84,7 @@ WebTab* TabbedWebView::webTab() const
TabWidget* TabbedWebView::tabWidget() const
{
return p_QupZilla->tabWidget();
return m_window->tabWidget();
}
QString TabbedWebView::getIp() const
@ -105,7 +105,7 @@ bool TabbedWebView::isCurrent()
void TabbedWebView::urlChanged(const QUrl &url)
{
if (isCurrent()) {
p_QupZilla->navigationBar()->refreshHistory();
m_window->navigationBar()->refreshHistory();
}
if (lastUrl() != url) {
@ -118,7 +118,7 @@ void TabbedWebView::loadProgress(int prog)
Q_UNUSED(prog)
if (isCurrent()) {
p_QupZilla->updateLoadingActions();
m_window->updateLoadingActions();
}
}
@ -149,7 +149,7 @@ void TabbedWebView::slotLoadFinished()
QHostInfo::lookupHost(url().host(), this, SLOT(setIp(QHostInfo)));
if (isCurrent()) {
p_QupZilla->updateLoadingActions();
m_window->updateLoadingActions();
}
}
@ -171,7 +171,7 @@ void TabbedWebView::titleChanged()
const QString t = title();
if (isCurrent()) {
p_QupZilla->setWindowTitle(tr("%1 - QupZilla").arg(t));
m_window->setWindowTitle(tr("%1 - QupZilla").arg(t));
}
tabWidget()->setTabText(tabIndex(), t);
@ -198,14 +198,14 @@ void TabbedWebView::linkHovered(const QString &link, const QString &title, const
if (isCurrent()) {
if (link.isEmpty()) {
p_QupZilla->statusBarMessage()->clearMessage();
m_window->statusBarMessage()->clearMessage();
}
else {
// QUrl::fromEncoded(link.toUtf8());
// Don't decode link from percent encoding (to show all utf8 chars), as it doesn't
// works correctly in all cases
// See #1095
p_QupZilla->statusBarMessage()->showMessage(link);
m_window->statusBarMessage()->showMessage(link);
}
}
}
@ -215,23 +215,23 @@ int TabbedWebView::tabIndex() const
return tabWidget()->indexOf(m_webTab);
}
QupZilla* TabbedWebView::mainWindow() const
BrowserWindow* TabbedWebView::mainWindow() const
{
return p_QupZilla;
return m_window;
}
void TabbedWebView::moveToWindow(QupZilla* window)
void TabbedWebView::moveToWindow(BrowserWindow* window)
{
disconnect(this, SIGNAL(statusBarMessage(QString)), p_QupZilla->statusBar(), SLOT(showMessage(QString)));
disconnect(p_QupZilla, SIGNAL(setWebViewMouseTracking(bool)), this, SLOT(trackMouse(bool)));
disconnect(this, SIGNAL(statusBarMessage(QString)), m_window->statusBar(), SLOT(showMessage(QString)));
disconnect(m_window, SIGNAL(setWebViewMouseTracking(bool)), this, SLOT(trackMouse(bool)));
p_QupZilla = window;
m_window = window;
connect(this, SIGNAL(statusBarMessage(QString)), p_QupZilla->statusBar(), SLOT(showMessage(QString)));
connect(p_QupZilla, SIGNAL(setWebViewMouseTracking(bool)), this, SLOT(trackMouse(bool)));
connect(this, SIGNAL(statusBarMessage(QString)), m_window->statusBar(), SLOT(showMessage(QString)));
connect(m_window, SIGNAL(setWebViewMouseTracking(bool)), this, SLOT(trackMouse(bool)));
// Tracking mouse also on tabs created in fullscreen
trackMouse(p_QupZilla->isFullScreen());
trackMouse(m_window->isFullScreen());
}
QWidget* TabbedWebView::overlayForJsAlert()
@ -251,8 +251,8 @@ void TabbedWebView::loadInNewTab(const QNetworkRequest &req, QNetworkAccessManag
r.setRawHeader("X-QupZilla-UserLoadAction", QByteArray("1"));
int index = tabWidget()->addView(QUrl(), position);
p_QupZilla->weView(index)->webTab()->locationBar()->showUrl(r.url());
p_QupZilla->weView(index)->load(r, op, data);
m_window->weView(index)->webTab()->locationBar()->showUrl(r.url());
m_window->weView(index)->load(r, op, data);
}
void TabbedWebView::contextMenuEvent(QContextMenuEvent* event)
@ -264,7 +264,7 @@ void TabbedWebView::contextMenuEvent(QContextMenuEvent* event)
createContextMenu(m_menu, hitTest, event->pos());
if (!hitTest.isContentEditable() && !hitTest.isContentSelected()) {
m_menu->addAction(p_QupZilla->adBlockIcon()->menuAction());
m_menu->addAction(m_window->adBlockIcon()->menuAction());
}
m_menu->addSeparator();
@ -301,11 +301,11 @@ void TabbedWebView::setAsCurrentTab()
void TabbedWebView::mouseMoveEvent(QMouseEvent* event)
{
if (m_mouseTrack) {
if (p_QupZilla->fullScreenNavigationVisible()) {
p_QupZilla->hideNavigationWithFullScreen();
if (m_window->fullScreenNavigationVisible()) {
m_window->hideNavigationWithFullScreen();
}
else if (event->y() < 5) {
p_QupZilla->showNavigationWithFullScreen();
m_window->showNavigationWithFullScreen();
}
}
@ -315,7 +315,7 @@ void TabbedWebView::mouseMoveEvent(QMouseEvent* event)
void TabbedWebView::disconnectObjects()
{
disconnect(this);
disconnect(p_QupZilla->statusBar());
disconnect(m_window->statusBar());
WebView::disconnectObjects();
}

View File

@ -24,7 +24,7 @@
class QLabel;
class QHostInfo;
class QupZilla;
class BrowserWindow;
class TabWidget;
class WebPage;
class WebTab;
@ -34,7 +34,7 @@ class QT_QUPZILLA_EXPORT TabbedWebView : public WebView
{
Q_OBJECT
public:
explicit TabbedWebView(QupZilla* mainClass, WebTab* webTab);
explicit TabbedWebView(BrowserWindow* window, WebTab* webTab);
~TabbedWebView();
void setWebPage(WebPage* pag);
@ -45,8 +45,8 @@ public:
QString getIp() const;
int tabIndex() const;
QupZilla* mainWindow() const;
void moveToWindow(QupZilla* window);
BrowserWindow* mainWindow() const;
void moveToWindow(BrowserWindow* window);
QWidget* overlayForJsAlert();
void disconnectObjects();
@ -88,7 +88,7 @@ private:
bool isCurrent();
QupZilla* p_QupZilla;
BrowserWindow* m_window;
WebTab* m_webTab;
Menu* m_menu;

View File

@ -16,7 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#include "qupzilla.h"
#include "browserwindow.h"
#include "tabpreview.h"
#include "qztools.h"
#include "webtab.h"
@ -31,9 +31,9 @@
#include <QVBoxLayout>
#include <QStyleOptionFrame>
TabPreview::TabPreview(QupZilla* mainClass, QWidget* parent)
TabPreview::TabPreview(BrowserWindow* window, QWidget* parent)
: QFrame(parent)
, p_QupZilla(mainClass)
, m_window(window)
, m_previewIndex(-1)
, m_animationsEnabled(true)
, m_stepX(0)
@ -280,8 +280,8 @@ QPoint TabPreview::calculatePosition(const QRect &tabRect, const QSize &previewS
if (p.x() < 0) {
p.setX(0);
}
if (p.x() + previewSize.width() > p_QupZilla->width()) {
int extraWidth = p.x() + previewSize.width() - p_QupZilla->width();
if (p.x() + previewSize.width() > m_window->width()) {
int extraWidth = p.x() + previewSize.width() - m_window->width();
p.setX(p.x() - extraWidth);
}

View File

@ -26,7 +26,7 @@
#include <QGraphicsOpacityEffect>
#endif
class QupZilla;
class BrowserWindow;
class WebTab;
class QLabel;
@ -34,7 +34,7 @@ class TabPreview : public QFrame
{
Q_OBJECT
public:
explicit TabPreview(QupZilla* mainClass, QWidget* parent);
explicit TabPreview(BrowserWindow* window, QWidget* parent);
void setWebTab(WebTab* webTab, bool noPixmap);
void showOnRect(const QRect &rect);
@ -65,7 +65,7 @@ private:
void calculateSteps(const QRect &oldGeometry, const QRect &newGeometry);
QPoint calculatePosition(const QRect &tabRect, const QSize &previewSize);
QupZilla* p_QupZilla;
BrowserWindow* m_window;
QLabel* m_pixmapLabel;
QLabel* m_title;

View File

@ -19,7 +19,7 @@
#include "tabbar.h"
#include "tabbedwebview.h"
#include "webpage.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "iconprovider.h"
#include "mainapplication.h"
#include "webtab.h"
@ -112,9 +112,9 @@ void MenuTabs::mouseReleaseEvent(QMouseEvent* event)
QMenu::mouseReleaseEvent(event);
}
TabWidget::TabWidget(QupZilla* mainClass, QWidget* parent)
TabWidget::TabWidget(BrowserWindow* window, QWidget* parent)
: TabStackedWidget(parent)
, p_QupZilla(mainClass)
, m_window(window)
, m_lastTabIndex(-1)
, m_lastBackgroundTabIndex(-1)
, m_isClosingToLastTabIndex(false)
@ -123,10 +123,10 @@ TabWidget::TabWidget(QupZilla* mainClass, QWidget* parent)
, m_locationBars(new QStackedWidget)
{
setObjectName("tabwidget");
m_tabBar = new TabBar(p_QupZilla, this);
m_tabBar = new TabBar(m_window, this);
setTabBar(m_tabBar);
connect(this, SIGNAL(currentChanged(int)), p_QupZilla, SLOT(refreshHistory()));
connect(this, SIGNAL(currentChanged(int)), m_window, SLOT(refreshHistory()));
connect(m_tabBar, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));
connect(m_tabBar, SIGNAL(reloadTab(int)), this, SLOT(reloadTab(int)));
@ -153,7 +153,7 @@ TabWidget::TabWidget(QupZilla* mainClass, QWidget* parent)
m_buttonAddTab = new AddTabButton(this, m_tabBar);
connect(m_buttonAddTab, SIGNAL(clicked()), p_QupZilla, SLOT(addTab()));
connect(m_buttonAddTab, SIGNAL(clicked()), m_window, SLOT(addTab()));
connect(m_menuTabs, SIGNAL(aboutToShow()), this, SLOT(aboutToShowClosedTabsMenu()));
// Copy of buttons
@ -169,7 +169,7 @@ TabWidget::TabWidget(QupZilla* mainClass, QWidget* parent)
m_buttonAddTab2 = new AddTabButton(this, m_tabBar);
m_buttonAddTab2->setProperty("outside-tabbar", true);
connect(m_buttonAddTab2, SIGNAL(clicked()), p_QupZilla, SLOT(addTab()));
connect(m_buttonAddTab2, SIGNAL(clicked()), m_window, SLOT(addTab()));
m_tabBar->addMainBarWidget(m_buttonAddTab2, Qt::AlignRight);
m_tabBar->addMainBarWidget(m_buttonListTabs2, Qt::AlignRight);
@ -322,8 +322,8 @@ int TabWidget::addView(const QUrl &url, const QString &title, const Qz::NewTabPo
int TabWidget::addView(QNetworkRequest req, const QString &title, const Qz::NewTabPositionFlags &openFlags, bool selectLine, int position, bool pinned)
{
#ifdef Q_OS_WIN
if (p_QupZilla->isTransparentBackgroundAllowed()) {
QtWin::extendFrameIntoClientArea(p_QupZilla);
if (m_window->isTransparentBackgroundAllowed()) {
QtWin::extendFrameIntoClientArea(m_window);
}
#endif
setUpdatesEnabled(false);
@ -352,15 +352,15 @@ int TabWidget::addView(QNetworkRequest req, const QString &title, const Qz::NewT
}
}
LocationBar* locBar = new LocationBar(p_QupZilla);
LocationBar* locBar = new LocationBar(m_window);
m_locationBars->addWidget(locBar);
int index;
if (position == -1) {
index = addTab(new WebTab(p_QupZilla, locBar), QString(), pinned);
index = addTab(new WebTab(m_window, locBar), QString(), pinned);
}
else {
index = insertTab(position, new WebTab(p_QupZilla, locBar), QString(), pinned);
index = insertTab(position, new WebTab(m_window, locBar), QString(), pinned);
}
TabbedWebView* webView = weTab(index)->view();
@ -379,15 +379,15 @@ int TabWidget::addView(QNetworkRequest req, const QString &title, const Qz::NewT
connect(webView, SIGNAL(wantsCloseTab(int)), this, SLOT(closeTab(int)));
connect(webView, SIGNAL(changed()), mApp, SLOT(setStateChanged()));
connect(webView, SIGNAL(ipChanged(QString)), p_QupZilla->ipLabel(), SLOT(setText(QString)));
connect(webView, SIGNAL(ipChanged(QString)), m_window->ipLabel(), SLOT(setText(QString)));
if (url.isValid()) {
req.setUrl(url);
webView->load(req);
}
if (selectLine && p_QupZilla->locationBar()->text().isEmpty()) {
p_QupZilla->locationBar()->setFocus();
if (selectLine && m_window->locationBar()->text().isEmpty()) {
m_window->locationBar()->setFocus();
}
if (openFlags & Qz::NT_SelectedTab || openFlags & Qz::NT_NotSelectedTab) {
@ -408,7 +408,7 @@ int TabWidget::addView(QNetworkRequest req, const QString &title, const Qz::NewT
setUpdatesEnabled(true);
#ifdef Q_OS_WIN
QTimer::singleShot(0, p_QupZilla, SLOT(applyBlurToMainWindow()));
QTimer::singleShot(0, m_window, SLOT(applyBlurToMainWindow()));
#endif
return index;
}
@ -430,7 +430,7 @@ int TabWidget::addView(WebTab* tab)
connect(tab->view(), SIGNAL(wantsCloseTab(int)), this, SLOT(closeTab(int)));
connect(tab->view(), SIGNAL(changed()), mApp, SLOT(setStateChanged()));
connect(tab->view(), SIGNAL(ipChanged(QString)), p_QupZilla->ipLabel(), SLOT(setText(QString)));
connect(tab->view(), SIGNAL(ipChanged(QString)), m_window->ipLabel(), SLOT(setText(QString)));
return index;
}
@ -470,7 +470,7 @@ void TabWidget::closeTab(int index, bool force)
return;
}
else {
p_QupZilla->close();
m_window->close();
return;
}
}
@ -487,7 +487,7 @@ void TabWidget::closeTab(int index, bool force)
m_locationBars->removeWidget(webView->webTab()->locationBar());
disconnect(webView, SIGNAL(wantsCloseTab(int)), this, SLOT(closeTab(int)));
disconnect(webView, SIGNAL(changed()), mApp, SLOT(setStateChanged()));
disconnect(webView, SIGNAL(ipChanged(QString)), p_QupZilla->ipLabel(), SLOT(setText(QString)));
disconnect(webView, SIGNAL(ipChanged(QString)), m_window->ipLabel(), SLOT(setText(QString)));
if (m_isClosingToLastTabIndex && m_lastTabIndex < count() && index == currentIndex()) {
setCurrentIndex(m_lastTabIndex);
@ -525,7 +525,7 @@ void TabWidget::currentTabChanged(int index)
}
webTab->setCurrentTab();
p_QupZilla->currentTabChanged();
m_window->currentTabChanged();
}
void TabWidget::tabMoved(int before, int after)
@ -708,9 +708,9 @@ void TabWidget::detachTab(int index)
m_locationBars->removeWidget(tab->locationBar());
disconnect(tab->view(), SIGNAL(wantsCloseTab(int)), this, SLOT(closeTab(int)));
disconnect(tab->view(), SIGNAL(changed()), mApp, SLOT(setStateChanged()));
disconnect(tab->view(), SIGNAL(ipChanged(QString)), p_QupZilla->ipLabel(), SLOT(setText(QString)));
disconnect(tab->view(), SIGNAL(ipChanged(QString)), m_window->ipLabel(), SLOT(setText(QString)));
QupZilla* window = mApp->makeNewWindow(Qz::BW_NewWindow);
BrowserWindow* window = mApp->makeNewWindow(Qz::BW_NewWindow);
tab->moveToWindow(window);
window->openWithTab(tab);
@ -985,7 +985,7 @@ bool TabWidget::restoreState(const QVector<WebTab::SavedTab> &tabs, int currentT
m_isRestoringState = true;
setUpdatesEnabled(false);
Qz::BrowserWindow type = p_QupZilla->windowType();
Qz::BrowserWindowType type = m_window->windowType();
if (type == Qz::BW_FirstAppWindow || type == Qz::BW_MacFirstWindow) {
restorePinnedTabs();
@ -1021,8 +1021,8 @@ void TabWidget::disconnectObjects()
{
disconnect(this);
disconnect(mApp);
disconnect(p_QupZilla);
disconnect(p_QupZilla->ipLabel());
disconnect(m_window);
disconnect(m_window->ipLabel());
}
TabWidget::~TabWidget()

View File

@ -31,7 +31,7 @@
class QStackedWidget;
class QMenu;
class QupZilla;
class BrowserWindow;
class TabbedWebView;
class TabBar;
class TabWidget;
@ -69,7 +69,7 @@ class QT_QUPZILLA_EXPORT TabWidget : public TabStackedWidget
{
Q_OBJECT
public:
explicit TabWidget(QupZilla* mainclass, QWidget* parent = 0);
explicit TabWidget(BrowserWindow* mainclass, QWidget* parent = 0);
~TabWidget();
void loadSettings();
@ -152,7 +152,7 @@ private:
bool m_newEmptyTabAfterActive;
QUrl m_urlOnNewTab;
QupZilla* p_QupZilla;
BrowserWindow* m_window;
int m_lastTabIndex;
int m_lastBackgroundTabIndex;

View File

@ -20,11 +20,11 @@
#include "webpage.h"
#include "tabbedwebview.h"
#include "webtab.h"
#include "qupzilla.h"
#include "browserwindow.h"
WebInspectorDockWidget::WebInspectorDockWidget(QupZilla* mainClass)
: QDockWidget(mainClass)
, p_QupZilla(mainClass)
WebInspectorDockWidget::WebInspectorDockWidget(BrowserWindow* window)
: QDockWidget(window)
, m_window(window)
{
setWindowTitle(tr("Web Inspector"));
setObjectName("WebInspector");
@ -46,20 +46,20 @@ void WebInspectorDockWidget::toggleVisibility()
void WebInspectorDockWidget::close()
{
p_QupZilla->weView()->webTab()->setInspectorVisible(false);
p_QupZilla->weView()->setFocus();
m_window->weView()->webTab()->setInspectorVisible(false);
m_window->weView()->setFocus();
hide();
}
void WebInspectorDockWidget::show()
{
QWebPage* page = p_QupZilla->weView()->page();
QWebPage* page = m_window->weView()->page();
QPointer<WebInspector> inspector = m_inspectors[page];
if (!inspector) {
inspector = new WebInspector(this);
inspector.data()->setPage(p_QupZilla->weView()->page());
inspector.data()->setPage(m_window->weView()->page());
m_inspectors[page] = inspector;
}
@ -69,14 +69,14 @@ void WebInspectorDockWidget::show()
m_currentInspector = inspector;
}
p_QupZilla->weView()->webTab()->setInspectorVisible(true);
m_window->weView()->webTab()->setInspectorVisible(true);
QDockWidget::show();
}
void WebInspectorDockWidget::tabChanged()
{
if (p_QupZilla->weView()->webTab()->inspectorVisible()) {
if (m_window->weView()->webTab()->inspectorVisible()) {
show();
}
else {

View File

@ -36,12 +36,12 @@ private:
}
};
class QupZilla;
class BrowserWindow;
class QT_QUPZILLA_EXPORT WebInspectorDockWidget : public QDockWidget
{
Q_OBJECT
public:
explicit WebInspectorDockWidget(QupZilla* mainClass);
explicit WebInspectorDockWidget(BrowserWindow* window);
~WebInspectorDockWidget();
void toggleVisibility();
@ -55,7 +55,7 @@ public slots:
void show();
private:
QupZilla* p_QupZilla;
BrowserWindow* m_window;
QHash<QWebPage*, QPointer<WebInspector> > m_inspectors;
QPointer<WebInspector> m_currentInspector;

View File

@ -18,7 +18,7 @@
#include "webpage.h"
#include "tabbedwebview.h"
#include "tabwidget.h"
#include "qupzilla.h"
#include "browserwindow.h"
#include "pluginproxy.h"
#include "downloadmanager.h"
#include "webpluginfactory.h"

View File

@ -28,7 +28,7 @@
class QWebSecurityOrigin;
class QEventLoop;
class QupZilla;
class BrowserWindow;
class AdBlockRule;
class TabbedWebView;
class SpeedDial;

Some files were not shown because too many files have changed in this diff Show More