diff --git a/src/lib/adblock/adblockicon.cpp b/src/lib/adblock/adblockicon.cpp index 768aac458..e8fb7ba62 100644 --- a/src/lib/adblock/adblockicon.cpp +++ b/src/lib/adblock/adblockicon.cpp @@ -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 #include -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())); diff --git a/src/lib/adblock/adblockicon.h b/src/lib/adblock/adblockicon.h index 5b91e758a..8f0db1ba0 100644 --- a/src/lib/adblock/adblockicon.h +++ b/src/lib/adblock/adblockicon.h @@ -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 > m_blockedPopups; diff --git a/src/lib/adblock/adblockmanager.cpp b/src/lib/adblock/adblockmanager.cpp index 80482517e..cba3c5318 100644 --- a/src/lib/adblock/adblockmanager.cpp +++ b/src/lib/adblock/adblockmanager.cpp @@ -23,7 +23,7 @@ #include "webpage.h" #include "qztools.h" #include "networkmanager.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "settings.h" #include diff --git a/src/lib/app/qupzilla.cpp b/src/lib/app/browserwindow.cpp similarity index 93% rename from src/lib/app/qupzilla.cpp rename to src/lib/app/browserwindow.cpp index 4699ba90e..d639126b7 100644 --- a/src/lib/app/qupzilla.cpp +++ b/src/lib/app/browserwindow.cpp @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ -#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(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(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(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() { } diff --git a/src/lib/app/qupzilla.h b/src/lib/app/browserwindow.h similarity index 95% rename from src/lib/app/qupzilla.h rename to src/lib/app/browserwindow.h index 12d2f0088..1f49c3575 100644 --- a/src/lib/app/qupzilla.h +++ b/src/lib/app/browserwindow.h @@ -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; diff --git a/src/lib/app/commandlineoptions.cpp b/src/lib/app/commandlineoptions.cpp index 66f0417cc..c0a3867cc 100644 --- a/src/lib/app/commandlineoptions.cpp +++ b/src/lib/app/commandlineoptions.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . * ============================================================ */ #include "commandlineoptions.h" -#include "qupzilla.h" +#include "browserwindow.h" #include #include @@ -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; diff --git a/src/lib/app/mainapplication.cpp b/src/lib/app/mainapplication.cpp index 4958dd51d..feefef5e7 100644 --- a/src/lib/app/mainapplication.cpp +++ b/src/lib/app/mainapplication.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . * ============================================================ */ #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(activeWindow()); + BrowserWindow* activeW = qobject_cast(activeWindow()); if (activeW) { return activeW; } @@ -512,9 +512,9 @@ bool MainApplication::isStateChanged() return false; } -QList MainApplication::mainWindows() +QList MainApplication::mainWindows() { - QList list; + QList 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(actWin); + BrowserWindow* qz = static_cast(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(actWin); + BrowserWindow* qz = qobject_cast(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(); diff --git a/src/lib/app/mainapplication.h b/src/lib/app/mainapplication.h index 3f5f69d04..981ea46e4 100644 --- a/src/lib/app/mainapplication.h +++ b/src/lib/app/mainapplication.h @@ -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 mainWindows(); + QList mainWindows(); static MainApplication* getInstance() { return static_cast(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 > m_mainWindows; + QList > m_mainWindows; QString m_activeProfil; QString m_activeLanguage; diff --git a/src/lib/app/profileupdater.cpp b/src/lib/app/profileupdater.cpp index 7d81abc75..1ddf5e45f 100644 --- a/src/lib/app/profileupdater.cpp +++ b/src/lib/app/profileupdater.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . * ============================================================ */ #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(); } diff --git a/src/lib/app/qz_namespace.h b/src/lib/app/qz_namespace.h index d8cf1551f..b2ee9c541 100644 --- a/src/lib/app/qz_namespace.h +++ b/src/lib/app/qz_namespace.h @@ -19,6 +19,7 @@ #define QZ_NAMESPACE_H #include +#include #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, diff --git a/src/lib/autofill/autofill.cpp b/src/lib/autofill/autofill.cpp index dbf421bd8..49afd5096 100644 --- a/src/lib/autofill/autofill.cpp +++ b/src/lib/autofill/autofill.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . * ============================================================ */ #include "autofill.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "webpage.h" #include "tabbedwebview.h" #include "popupwebview.h" diff --git a/src/lib/autofill/autofill.h b/src/lib/autofill/autofill.h index f28b33ed3..2c1d18ecc 100644 --- a/src/lib/autofill/autofill.h +++ b/src/lib/autofill/autofill.h @@ -26,7 +26,7 @@ class QUrl; class QWebElement; class QNetworkRequest; -class QupZilla; +class BrowserWindow; class WebPage; class PasswordManager; struct PageFormData; diff --git a/src/lib/autofill/passwordbackends/databaseencryptedpasswordbackend.cpp b/src/lib/autofill/passwordbackends/databaseencryptedpasswordbackend.cpp index d7a5f33b9..f678480f0 100644 --- a/src/lib/autofill/passwordbackends/databaseencryptedpasswordbackend.cpp +++ b/src/lib/autofill/passwordbackends/databaseencryptedpasswordbackend.cpp @@ -20,7 +20,7 @@ #include "mainapplication.h" #include "autofill.h" #include "aesinterface.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "ui_masterpassworddialog.h" #include diff --git a/src/lib/bookmarks/bookmarksmanager.cpp b/src/lib/bookmarks/bookmarksmanager.cpp index 8f5e20c76..2494af377 100644 --- a/src/lib/bookmarks/bookmarksmanager.cpp +++ b/src/lib/bookmarks/bookmarksmanager.cpp @@ -22,16 +22,16 @@ #include "bookmarksmodel.h" #include "bookmarkstools.h" #include "mainapplication.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "qztools.h" #include #include -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) diff --git a/src/lib/bookmarks/bookmarksmanager.h b/src/lib/bookmarks/bookmarksmanager.h index 18dfac91a..b0f4b230e 100644 --- a/src/lib/bookmarks/bookmarksmanager.h +++ b/src/lib/bookmarks/bookmarksmanager.h @@ -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 p_QupZilla; + QPointer m_window; Bookmarks* m_bookmarks; BookmarkItem* m_selectedBookmark; diff --git a/src/lib/bookmarks/bookmarksmenu.cpp b/src/lib/bookmarks/bookmarksmenu.cpp index c743c4599..3f04e47cf 100644 --- a/src/lib/bookmarks/bookmarksmenu.cpp +++ b/src/lib/bookmarks/bookmarksmenu.cpp @@ -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; } diff --git a/src/lib/bookmarks/bookmarksmenu.h b/src/lib/bookmarks/bookmarksmenu.h index 1d55c316d..9ff1d7c7b 100644 --- a/src/lib/bookmarks/bookmarksmenu.h +++ b/src/lib/bookmarks/bookmarksmenu.h @@ -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 m_window; + QPointer m_window; bool m_changed; }; diff --git a/src/lib/bookmarks/bookmarkstoolbar.cpp b/src/lib/bookmarks/bookmarkstoolbar.cpp index ab6b9831b..44d2608a2 100644 --- a/src/lib/bookmarks/bookmarkstoolbar.cpp +++ b/src/lib/bookmarks/bookmarkstoolbar.cpp @@ -28,9 +28,9 @@ #include #include -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) { diff --git a/src/lib/bookmarks/bookmarkstoolbar.h b/src/lib/bookmarks/bookmarkstoolbar.h index 81df9bbf1..75fe7cf65 100644 --- a/src/lib/bookmarks/bookmarkstoolbar.h +++ b/src/lib/bookmarks/bookmarkstoolbar.h @@ -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; diff --git a/src/lib/bookmarks/bookmarkstoolbarbutton.cpp b/src/lib/bookmarks/bookmarkstoolbarbutton.cpp index e518f908b..528a25959 100644 --- a/src/lib/bookmarks/bookmarkstoolbarbutton.cpp +++ b/src/lib/bookmarks/bookmarkstoolbarbutton.cpp @@ -47,7 +47,7 @@ BookmarkItem* BookmarksToolbarButton::bookmark() const return m_bookmark; } -void BookmarksToolbarButton::setMainWindow(QupZilla* window) +void BookmarksToolbarButton::setMainWindow(BrowserWindow* window) { m_window = window; } diff --git a/src/lib/bookmarks/bookmarkstoolbarbutton.h b/src/lib/bookmarks/bookmarkstoolbarbutton.h index 9d09cee7b..affcbe271 100644 --- a/src/lib/bookmarks/bookmarkstoolbarbutton.h +++ b/src/lib/bookmarks/bookmarkstoolbarbutton.h @@ -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; diff --git a/src/lib/bookmarks/bookmarkstools.cpp b/src/lib/bookmarks/bookmarkstools.cpp index b6721a9cd..77dd11e43 100644 --- a/src/lib/bookmarks/bookmarkstools.cpp +++ b/src/lib/bookmarks/bookmarkstools.cpp @@ -23,7 +23,7 @@ #include "enhancedmenu.h" #include "tabwidget.h" #include "qzsettings.h" -#include "qupzilla.h" +#include "browserwindow.h" #include #include @@ -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()); diff --git a/src/lib/bookmarks/bookmarkstools.h b/src/lib/bookmarks/bookmarkstools.h index 8b2f676a8..7f61237ed 100644 --- a/src/lib/bookmarks/bookmarkstools.h +++ b/src/lib/bookmarks/bookmarkstools.h @@ -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); diff --git a/src/lib/bookmarks/bookmarkswidget.cpp b/src/lib/bookmarks/bookmarkswidget.cpp index 6bee79717..384f2a825 100644 --- a/src/lib/bookmarks/bookmarkswidget.cpp +++ b/src/lib/bookmarks/bookmarkswidget.cpp @@ -23,7 +23,7 @@ #include "pluginproxy.h" #include "speeddial.h" #include "webview.h" -#include "qupzilla.h" +#include "browserwindow.h" #include diff --git a/src/lib/cookies/cookiejar.cpp b/src/lib/cookies/cookiejar.cpp index 419b3b84f..640b04fb3 100644 --- a/src/lib/cookies/cookiejar.cpp +++ b/src/lib/cookies/cookiejar.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . * ============================================================ */ #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(); diff --git a/src/lib/cookies/cookiejar.h b/src/lib/cookies/cookiejar.h index 6b463b8c4..2e4d421ef 100644 --- a/src/lib/cookies/cookiejar.h +++ b/src/lib/cookies/cookiejar.h @@ -24,12 +24,12 @@ #include #include -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 &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; diff --git a/src/lib/cookies/cookiemanager.cpp b/src/lib/cookies/cookiemanager.cpp index df96933df..18ee2c67e 100644 --- a/src/lib/cookies/cookiemanager.cpp +++ b/src/lib/cookies/cookiemanager.cpp @@ -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" diff --git a/src/lib/cookies/cookiemanager.h b/src/lib/cookies/cookiemanager.h index 706f2670e..14a16f06f 100644 --- a/src/lib/cookies/cookiemanager.h +++ b/src/lib/cookies/cookiemanager.h @@ -29,7 +29,7 @@ class CookieManager; class QTreeWidgetItem; -class QupZilla; +class BrowserWindow; class QT_QUPZILLA_EXPORT CookieManager : public QWidget { diff --git a/src/lib/downloads/downloadfilehelper.cpp b/src/lib/downloads/downloadfilehelper.cpp index b738d2974..af8d30e40 100644 --- a/src/lib/downloads/downloadfilehelper.cpp +++ b/src/lib/downloads/downloadfilehelper.cpp @@ -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" diff --git a/src/lib/downloads/downloaditem.cpp b/src/lib/downloads/downloaditem.cpp index 43ae3334f..056ffd04d 100644 --- a/src/lib/downloads/downloaditem.cpp +++ b/src/lib/downloads/downloaditem.cpp @@ -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); diff --git a/src/lib/downloads/downloadmanager.cpp b/src/lib/downloads/downloadmanager.cpp index 1e048c5e0..db6038826 100644 --- a/src/lib/downloads/downloadmanager.cpp +++ b/src/lib/downloads/downloadmanager.cpp @@ -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" diff --git a/src/lib/history/history.cpp b/src/lib/history/history.cpp index 7251b130d..4e833b226 100644 --- a/src/lib/history/history.cpp +++ b/src/lib/history/history.cpp @@ -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" diff --git a/src/lib/history/historymanager.cpp b/src/lib/history/historymanager.cpp index a9d76de84..0b1ab5a55 100644 --- a/src/lib/history/historymanager.cpp +++ b/src/lib/history/historymanager.cpp @@ -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 -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; } } diff --git a/src/lib/history/historymanager.h b/src/lib/history/historymanager.h index c068a6612..d65f988e9 100644 --- a/src/lib/history/historymanager.h +++ b/src/lib/history/historymanager.h @@ -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 p_QupZilla; + QPointer m_window; }; #endif // HISTORYMANAGER_H diff --git a/src/lib/lib.pro b/src/lib/lib.pro index 8adc01515..657cae1b8 100644 --- a/src/lib/lib.pro +++ b/src/lib/lib.pro @@ -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 \ diff --git a/src/lib/navigation/completer/locationcompletermodel.cpp b/src/lib/navigation/completer/locationcompletermodel.cpp index abb24595c..a41a62348 100644 --- a/src/lib/navigation/completer/locationcompletermodel.cpp +++ b/src/lib/navigation/completer/locationcompletermodel.cpp @@ -21,7 +21,7 @@ #include "bookmarkitem.h" #include "bookmarks.h" #include "qzsettings.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "tabwidget.h" #include @@ -238,11 +238,11 @@ TabPosition LocationCompleterModel::tabPositionForUrl(const QUrl &url) const TabPosition LocationCompleterModel::tabPositionForEncodedUrl(const QString &encodedUrl) const { - QList windows = mApp->mainWindows(); + QList 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 tabs = mainWin->tabWidget()->allTabs(); for (int tab = 0; tab < tabs.count(); ++tab) { if (tabs[tab]->url().toEncoded() == encodedUrl) { diff --git a/src/lib/navigation/completer/locationcompleterview.cpp b/src/lib/navigation/completer/locationcompleterview.cpp index d2ffdbcc3..0dffb1ea9 100644 --- a/src/lib/navigation/completer/locationcompleterview.cpp +++ b/src/lib/navigation/completer/locationcompleterview.cpp @@ -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(); diff --git a/src/lib/navigation/locationbar.cpp b/src/lib/navigation/locationbar.cpp index 8c613e258..adb4e62f1 100644 --- a/src/lib/navigation/locationbar.cpp +++ b/src/lib/navigation/locationbar.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . * ============================================================ */ #include "locationbar.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "tabbedwebview.h" #include "rssmanager.h" #include "mainapplication.h" @@ -45,9 +45,9 @@ #include #include -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; diff --git a/src/lib/navigation/locationbar.h b/src/lib/navigation/locationbar.h index 48ebb2d4c..cec782d3d 100644 --- a/src/lib/navigation/locationbar.h +++ b/src/lib/navigation/locationbar.h @@ -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; diff --git a/src/lib/navigation/navigationbar.cpp b/src/lib/navigation/navigationbar.cpp index 0eca73df9..cb305a3a5 100644 --- a/src/lib/navigation/navigationbar.cpp +++ b/src/lib/navigation/navigationbar.cpp @@ -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(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; diff --git a/src/lib/navigation/navigationbar.h b/src/lib/navigation/navigationbar.h index 28b8586af..fba08d15e 100644 --- a/src/lib/navigation/navigationbar.h +++ b/src/lib/navigation/navigationbar.h @@ -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; diff --git a/src/lib/navigation/navigationcontainer.cpp b/src/lib/navigation/navigationcontainer.cpp index 6acea9b7a..8f38ea941 100644 --- a/src/lib/navigation/navigationcontainer.cpp +++ b/src/lib/navigation/navigationcontainer.cpp @@ -17,13 +17,13 @@ * ============================================================ */ #include "navigationcontainer.h" #include "qzsettings.h" -#include "qupzilla.h" +#include "browserwindow.h" #include -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); } } diff --git a/src/lib/navigation/navigationcontainer.h b/src/lib/navigation/navigationcontainer.h index 84c7ce517..d7c25be62 100644 --- a/src/lib/navigation/navigationcontainer.h +++ b/src/lib/navigation/navigationcontainer.h @@ -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; }; diff --git a/src/lib/navigation/siteicon.cpp b/src/lib/navigation/siteicon.cpp index 1cab71362..157bd233f 100644 --- a/src/lib/navigation/siteicon.cpp +++ b/src/lib/navigation/siteicon.cpp @@ -27,9 +27,9 @@ #include #include -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()); } diff --git a/src/lib/navigation/siteicon.h b/src/lib/navigation/siteicon.h index 61e539de9..10f7bab2e 100644 --- a/src/lib/navigation/siteicon.h +++ b/src/lib/navigation/siteicon.h @@ -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; diff --git a/src/lib/navigation/websearchbar.cpp b/src/lib/navigation/websearchbar.cpp index c695088d0..43e866e04 100644 --- a/src/lib/navigation/websearchbar.cpp +++ b/src/lib/navigation/websearchbar.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . * ============================================================ */ #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]")); diff --git a/src/lib/navigation/websearchbar.h b/src/lib/navigation/websearchbar.h index 808fae37a..6804650e7 100644 --- a/src/lib/navigation/websearchbar.h +++ b/src/lib/navigation/websearchbar.h @@ -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; diff --git a/src/lib/network/cabundleupdater.cpp b/src/lib/network/cabundleupdater.cpp index d19b729d5..bdf7dd728 100644 --- a/src/lib/network/cabundleupdater.cpp +++ b/src/lib/network/cabundleupdater.cpp @@ -18,7 +18,7 @@ #include "cabundleupdater.h" #include "mainapplication.h" #include "networkmanager.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "qztools.h" #include @@ -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())); } diff --git a/src/lib/network/networkmanager.cpp b/src/lib/network/networkmanager.cpp index e59247aa9..aa63c186f 100644 --- a/src/lib/network/networkmanager.cpp +++ b/src/lib/network/networkmanager.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . * ============================================================ */ #include "networkmanager.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "autofill.h" #include "networkmanagerproxy.h" #include "mainapplication.h" diff --git a/src/lib/network/schemehandlers/fileschemehandler.cpp b/src/lib/network/schemehandlers/fileschemehandler.cpp index 52ca93ebd..0e7b7129d 100644 --- a/src/lib/network/schemehandlers/fileschemehandler.cpp +++ b/src/lib/network/schemehandlers/fileschemehandler.cpp @@ -20,7 +20,7 @@ #include "iconprovider.h" #include "downloadoptionsdialog.h" #include "mainapplication.h" -#include "qupzilla.h" +#include "browserwindow.h" #include #include diff --git a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp index 1282f73fc..82cac3773 100644 --- a/src/lib/network/schemehandlers/qupzillaschemehandler.cpp +++ b/src/lib/network/schemehandlers/qupzillaschemehandler.cpp @@ -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 #include +#if QT_VERSION < 0x050000 +#include "qwebkitversion.h" +#else +#include +#endif + static QString authorString(const char* name, const QString &mail) { return QString("%1 <%2>").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("

Private Browsing

") : QString()); sPage = QzTools::applyDirectionToPage(sPage); @@ -211,14 +217,14 @@ QString QupZillaSchemeReply::aboutPage() aPage.replace(QLatin1String("%COPYRIGHT%"), tr("Copyright")); aPage.replace(QLatin1String("%VERSION-INFO%"), - QString("
%1
%2
").arg(tr("Version"), QupZilla::VERSION + QString("
%1
%2
").arg(tr("Version"), Qz::VERSION #ifdef GIT_REVISION + " (" + GIT_REVISION + ")" #endif ) + - QString("
%1
%2
").arg(tr("WebKit version"), QupZilla::WEBKITVERSION)); + QString("
%1
%2
").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") + "
" + @@ -380,14 +386,14 @@ QString QupZillaSchemeReply::configPage() cPage.replace(QLatin1String("%PL-DESC%"), tr("Description")); cPage.replace(QLatin1String("%VERSION-INFO%"), - QString("
%1
%2
").arg(tr("Application version"), QupZilla::VERSION + QString("
%1
%2
").arg(tr("Application version"), Qz::VERSION #ifdef GIT_REVISION + " (" + GIT_REVISION + ")" #endif ) + QString("
%1
%2
").arg(tr("Qt version"), QT_VERSION_STR) + - QString("
%1
%2
").arg(tr("WebKit version"), QupZilla::WEBKITVERSION) + - QString("
%1
%2
").arg(tr("Build time"), QupZilla::BUILDTIME) + + QString("
%1
%2
").arg(tr("WebKit version"), qWebKitVersion()) + + QString("
%1
%2
").arg(tr("Build time"), Qz::BUILDTIME) + QString("
%1
%2
").arg(tr("Platform"), QzTools::operatingSystem())); cPage.replace(QLatin1String("%PATHS-TEXT%"), diff --git a/src/lib/other/aboutdialog.cpp b/src/lib/other/aboutdialog.cpp index 34d0ab15a..1ab1a72b8 100644 --- a/src/lib/other/aboutdialog.cpp +++ b/src/lib/other/aboutdialog.cpp @@ -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 +#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 += "
"; - m_aboutHtml += tr("

Application version %1
").arg(QupZilla::VERSION + m_aboutHtml += tr("

Application version %1
").arg(Qz::VERSION #ifdef GIT_REVISION + " (" + GIT_REVISION + ")" #endif ); - m_aboutHtml += tr("WebKit version %1

").arg(QupZilla::WEBKITVERSION); - m_aboutHtml += QString("

© %1 %2
").arg(QupZilla::COPYRIGHT, QupZilla::AUTHOR); - m_aboutHtml += tr("Build time: %1

").arg(QupZilla::BUILDTIME); - m_aboutHtml += QString("

%1

").arg(QupZilla::WWWADDRESS); + m_aboutHtml += tr("WebKit version %1

").arg(qWebKitVersion()); + m_aboutHtml += QString("

© %1 %2
").arg(Qz::COPYRIGHT, Qz::AUTHOR); + m_aboutHtml += tr("Build time: %1

").arg(Qz::BUILDTIME); + m_aboutHtml += QString("

%1

").arg(Qz::WWWADDRESS); m_aboutHtml += "

" + (mApp->windowCount() > 0 ? mApp->getWindow()->weView()->page()->userAgentForUrl(QUrl()) : QString()) + "

"; m_aboutHtml += "
"; } @@ -80,7 +86,7 @@ void AboutDialog::showAuthors() ui->authorsButton->setText(tr("< About QupZilla")); if (m_authorsHtml.isEmpty()) { m_authorsHtml += "
"; - m_authorsHtml += tr("

Main developer:
%1 <%2>

").arg(QupZilla::AUTHOR, "nowrep@gmail.com"); + m_authorsHtml += tr("

Main developer:
%1 <%2>

").arg(Qz::AUTHOR, "nowrep@gmail.com"); m_authorsHtml += tr("

Contributors:
%1

").arg( QString::fromUtf8("Mladen Pejaković
" "Alexander Samilov
" diff --git a/src/lib/other/browsinglibrary.cpp b/src/lib/other/browsinglibrary.cpp index 364d23c66..87eeac474 100644 --- a/src/lib/other/browsinglibrary.cpp +++ b/src/lib/other/browsinglibrary.cpp @@ -29,11 +29,11 @@ #include #include -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(); diff --git a/src/lib/other/browsinglibrary.h b/src/lib/other/browsinglibrary.h index 143712bb3..d41aafb16 100644 --- a/src/lib/other/browsinglibrary.h +++ b/src/lib/other/browsinglibrary.h @@ -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(); diff --git a/src/lib/other/clearprivatedata.cpp b/src/lib/other/clearprivatedata.cpp index 7ff102e78..db4899db5 100644 --- a/src/lib/other/clearprivatedata.cpp +++ b/src/lib/other/clearprivatedata.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . * ============================================================ */ #include "clearprivatedata.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "tabwidget.h" #include "cookiejar.h" #include "history.h" @@ -38,9 +38,9 @@ #include #include -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); diff --git a/src/lib/other/clearprivatedata.h b/src/lib/other/clearprivatedata.h index 11d91a32b..3fe669e4d 100644 --- a/src/lib/other/clearprivatedata.h +++ b/src/lib/other/clearprivatedata.h @@ -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; }; diff --git a/src/lib/other/macmenureceiver.cpp b/src/lib/other/macmenureceiver.cpp index bde371e19..e4c8ae6c2 100644 --- a/src/lib/other/macmenureceiver.cpp +++ b/src/lib/other/macmenureceiver.cpp @@ -18,7 +18,7 @@ * ============================================================ */ #include "macmenureceiver.h" #include "mainapplication.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "settings.h" #include @@ -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; diff --git a/src/lib/other/pagescreen.cpp b/src/lib/other/pagescreen.cpp index ef959684b..225cc81d8 100644 --- a/src/lib/other/pagescreen.cpp +++ b/src/lib/other/pagescreen.cpp @@ -20,7 +20,7 @@ #include "tabbedwebview.h" #include "webpage.h" #include "qztools.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "settings.h" #include @@ -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); diff --git a/src/lib/other/statusbarmessage.cpp b/src/lib/other/statusbarmessage.cpp index 142891fc9..597329002 100644 --- a/src/lib/other/statusbarmessage.cpp +++ b/src/lib/other/statusbarmessage.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . * ============================================================ */ #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(); diff --git a/src/lib/other/statusbarmessage.h b/src/lib/other/statusbarmessage.h index a07f5681a..36761ac55 100644 --- a/src/lib/other/statusbarmessage.h +++ b/src/lib/other/statusbarmessage.h @@ -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; }; diff --git a/src/lib/other/updater.cpp b/src/lib/other/updater.cpp index 00a1b8188..d2d2c1857 100644 --- a/src/lib/other/updater.cpp +++ b/src/lib/other/updater.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . * ============================================================ */ #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() diff --git a/src/lib/other/updater.h b/src/lib/other/updater.h index c29de6599..930d9f55b 100644 --- a/src/lib/other/updater.h +++ b/src/lib/other/updater.h @@ -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 diff --git a/src/lib/other/useragentmanager.cpp b/src/lib/other/useragentmanager.cpp index d490d7a2b..33519e184 100644 --- a/src/lib/other/useragentmanager.cpp +++ b/src/lib/other/useragentmanager.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . * ============================================================ */ #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() diff --git a/src/lib/plugins/clicktoflash.cpp b/src/lib/plugins/clicktoflash.cpp index bf5793ba9..d1cdaad78 100644 --- a/src/lib/plugins/clicktoflash.cpp +++ b/src/lib/plugins/clicktoflash.cpp @@ -44,7 +44,7 @@ #include "squeezelabelv2.h" #include "webpage.h" #include "qztools.h" -#include "qupzilla.h" +#include "browserwindow.h" #include #include diff --git a/src/lib/plugins/pluginproxy.cpp b/src/lib/plugins/pluginproxy.cpp index d9af9a92c..09342f40b 100644 --- a/src/lib/plugins/pluginproxy.cpp +++ b/src/lib/plugins/pluginproxy.cpp @@ -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); } diff --git a/src/lib/plugins/pluginproxy.h b/src/lib/plugins/pluginproxy.h index 0d898c58f..c62395ad2 100644 --- a/src/lib/plugins/pluginproxy.h +++ b/src/lib/plugins/pluginproxy.h @@ -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); diff --git a/src/lib/popupwindow/popupstatusbarmessage.cpp b/src/lib/popupwindow/popupstatusbarmessage.cpp index 84b6e7eeb..214197ca6 100644 --- a/src/lib/popupwindow/popupstatusbarmessage.cpp +++ b/src/lib/popupwindow/popupstatusbarmessage.cpp @@ -26,9 +26,9 @@ #include #include -PopupStatusBarMessage::PopupStatusBarMessage(PopupWindow* mainClass) - : m_popupWindow(mainClass) - , m_statusBarText(new TipLabel(mainClass)) +PopupStatusBarMessage::PopupStatusBarMessage(PopupWindow* window) + : m_popupWindow(window) + , m_statusBarText(new TipLabel(window)) { } diff --git a/src/lib/popupwindow/popupstatusbarmessage.h b/src/lib/popupwindow/popupstatusbarmessage.h index af4cc9a1b..88a2685ae 100644 --- a/src/lib/popupwindow/popupstatusbarmessage.h +++ b/src/lib/popupwindow/popupstatusbarmessage.h @@ -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(); diff --git a/src/lib/popupwindow/popupwebpage.cpp b/src/lib/popupwindow/popupwebpage.cpp index 7551e6797..8d5deb933 100644 --- a/src/lib/popupwindow/popupwebpage.cpp +++ b/src/lib/popupwindow/popupwebpage.cpp @@ -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) { diff --git a/src/lib/popupwindow/popupwebpage.h b/src/lib/popupwindow/popupwebpage.h index 5889a8084..bc92b1c06 100644 --- a/src/lib/popupwindow/popupwebpage.h +++ b/src/lib/popupwindow/popupwebpage.h @@ -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; diff --git a/src/lib/popupwindow/popupwebview.cpp b/src/lib/popupwindow/popupwebview.cpp index 2b6901677..6cd779f7b 100644 --- a/src/lib/popupwindow/popupwebview.cpp +++ b/src/lib/popupwindow/popupwebview.cpp @@ -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); diff --git a/src/lib/preferences/preferences.cpp b/src/lib/preferences/preferences.cpp index 4d52711e8..5b49655d2 100644 --- a/src/lib/preferences/preferences.cpp +++ b/src/lib/preferences/preferences.cpp @@ -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 pbColor = settings.value("CustomProgressColor", m_window->palette().color(QPalette::Highlight)).value(); 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); diff --git a/src/lib/preferences/preferences.h b/src/lib/preferences/preferences.h index 9985342da..a2d70be51 100644 --- a/src/lib/preferences/preferences.h +++ b/src/lib/preferences/preferences.h @@ -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; diff --git a/src/lib/rss/rssmanager.cpp b/src/lib/rss/rssmanager.cpp index eeea1adcd..aa5b1355f 100644 --- a/src/lib/rss/rssmanager.cpp +++ b/src/lib/rss/rssmanager.cpp @@ -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 #include -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; } } diff --git a/src/lib/rss/rssmanager.h b/src/lib/rss/rssmanager.h index ad3aff398..9805e25fe 100644 --- a/src/lib/rss/rssmanager.h +++ b/src/lib/rss/rssmanager.h @@ -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 > m_replies; @@ -74,7 +74,7 @@ private: Ui::RSSManager* ui; QToolButton* m_reloadButton; - QPointer p_QupZilla; + QPointer m_window; }; #endif // RSSMANAGER_H diff --git a/src/lib/session/recoverywidget.cpp b/src/lib/session/recoverywidget.cpp index bc7968184..8a2f7ff18 100644 --- a/src/lib/session/recoverywidget.cpp +++ b/src/lib/session/recoverywidget.cpp @@ -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(); } diff --git a/src/lib/session/recoverywidget.h b/src/lib/session/recoverywidget.h index a008e06cc..e9379b850 100644 --- a/src/lib/session/recoverywidget.h +++ b/src/lib/session/recoverywidget.h @@ -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 diff --git a/src/lib/sidebar/bookmarkssidebar.cpp b/src/lib/sidebar/bookmarkssidebar.cpp index ba8059cf4..b94258120 100644 --- a/src/lib/sidebar/bookmarkssidebar.cpp +++ b/src/lib/sidebar/bookmarkssidebar.cpp @@ -24,10 +24,10 @@ #include -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); diff --git a/src/lib/sidebar/bookmarkssidebar.h b/src/lib/sidebar/bookmarkssidebar.h index 2e64846d3..7c5ef646b 100644 --- a/src/lib/sidebar/bookmarkssidebar.h +++ b/src/lib/sidebar/bookmarkssidebar.h @@ -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; }; diff --git a/src/lib/sidebar/historysidebar.cpp b/src/lib/sidebar/historysidebar.cpp index 0ce8788aa..fef5e44e0 100644 --- a/src/lib/sidebar/historysidebar.cpp +++ b/src/lib/sidebar/historysidebar.cpp @@ -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); } } diff --git a/src/lib/sidebar/historysidebar.h b/src/lib/sidebar/historysidebar.h index 760029e5f..3af4705e9 100644 --- a/src/lib/sidebar/historysidebar.h +++ b/src/lib/sidebar/historysidebar.h @@ -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 diff --git a/src/lib/sidebar/sidebar.cpp b/src/lib/sidebar/sidebar.cpp index 816136d5d..f8ec6fdf7 100644 --- a/src/lib/sidebar/sidebar.cpp +++ b/src/lib/sidebar/sidebar.cpp @@ -21,16 +21,16 @@ #include "bookmarkssidebar.h" #include "historysidebar.h" #include "mainapplication.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "settings.h" #include QHash > 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(); } diff --git a/src/lib/sidebar/sidebar.h b/src/lib/sidebar/sidebar.h index 46eb3d582..ba7a34368 100644 --- a/src/lib/sidebar/sidebar.h +++ b/src/lib/sidebar/sidebar.h @@ -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 m_sideBar; QMenu* m_menu; diff --git a/src/lib/sidebar/sidebarinterface.h b/src/lib/sidebar/sidebarinterface.h index 0f11bd239..9f947943d 100644 --- a/src/lib/sidebar/sidebarinterface.h +++ b/src/lib/sidebar/sidebarinterface.h @@ -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 diff --git a/src/lib/tools/menubar.cpp b/src/lib/tools/menubar.cpp index a67e2e556..65fdd820c 100644 --- a/src/lib/tools/menubar.cpp +++ b/src/lib/tools/menubar.cpp @@ -16,11 +16,11 @@ * along with this program. If not, see . * ============================================================ */ #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)); } } diff --git a/src/lib/tools/menubar.h b/src/lib/tools/menubar.h index 456094616..bf4f3ff67 100644 --- a/src/lib/tools/menubar.h +++ b/src/lib/tools/menubar.h @@ -22,19 +22,19 @@ #include -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; }; diff --git a/src/lib/webview/siteinfowidget.cpp b/src/lib/webview/siteinfowidget.cpp index ea8c6052e..eeffae371 100644 --- a/src/lib/webview/siteinfowidget.cpp +++ b/src/lib/webview/siteinfowidget.cpp @@ -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 #include -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 %1 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() diff --git a/src/lib/webview/siteinfowidget.h b/src/lib/webview/siteinfowidget.h index 910ad05dd..67b0e0b31 100644 --- a/src/lib/webview/siteinfowidget.h +++ b/src/lib/webview/siteinfowidget.h @@ -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 diff --git a/src/lib/webview/tabbar.cpp b/src/lib/webview/tabbar.cpp index 72d6eee39..344a4b3fb 100644 --- a/src/lib/webview/tabbar.cpp +++ b/src/lib/webview/tabbar.cpp @@ -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 #include -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(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)); } diff --git a/src/lib/webview/tabbar.h b/src/lib/webview/tabbar.h index f60eb5527..79ccd98d3 100644 --- a/src/lib/webview/tabbar.h +++ b/src/lib/webview/tabbar.h @@ -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; diff --git a/src/lib/webview/tabbedwebview.cpp b/src/lib/webview/tabbedwebview.cpp index 9e0c0bc4f..558fbbe09 100644 --- a/src/lib/webview/tabbedwebview.cpp +++ b/src/lib/webview/tabbedwebview.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . * ============================================================ */ #include "tabbedwebview.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "webpage.h" #include "tabwidget.h" #include "networkmanager.h" @@ -38,9 +38,9 @@ #include #include -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(); } diff --git a/src/lib/webview/tabbedwebview.h b/src/lib/webview/tabbedwebview.h index d1c91da22..900fc7cb5 100644 --- a/src/lib/webview/tabbedwebview.h +++ b/src/lib/webview/tabbedwebview.h @@ -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; diff --git a/src/lib/webview/tabpreview.cpp b/src/lib/webview/tabpreview.cpp index b59c76b64..698d4fb6c 100644 --- a/src/lib/webview/tabpreview.cpp +++ b/src/lib/webview/tabpreview.cpp @@ -16,7 +16,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * ============================================================ */ -#include "qupzilla.h" +#include "browserwindow.h" #include "tabpreview.h" #include "qztools.h" #include "webtab.h" @@ -31,9 +31,9 @@ #include #include -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); } diff --git a/src/lib/webview/tabpreview.h b/src/lib/webview/tabpreview.h index 017f50853..6aa6516f9 100644 --- a/src/lib/webview/tabpreview.h +++ b/src/lib/webview/tabpreview.h @@ -26,7 +26,7 @@ #include #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; diff --git a/src/lib/webview/tabwidget.cpp b/src/lib/webview/tabwidget.cpp index 3f813b5fa..a51bff3bd 100644 --- a/src/lib/webview/tabwidget.cpp +++ b/src/lib/webview/tabwidget.cpp @@ -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 &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() diff --git a/src/lib/webview/tabwidget.h b/src/lib/webview/tabwidget.h index 8140f61a5..4d2423f7a 100644 --- a/src/lib/webview/tabwidget.h +++ b/src/lib/webview/tabwidget.h @@ -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; diff --git a/src/lib/webview/webinspectordockwidget.cpp b/src/lib/webview/webinspectordockwidget.cpp index c2d8e2c9a..52eb804d4 100644 --- a/src/lib/webview/webinspectordockwidget.cpp +++ b/src/lib/webview/webinspectordockwidget.cpp @@ -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 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 { diff --git a/src/lib/webview/webinspectordockwidget.h b/src/lib/webview/webinspectordockwidget.h index 9592d79ab..55cbf0e8c 100644 --- a/src/lib/webview/webinspectordockwidget.h +++ b/src/lib/webview/webinspectordockwidget.h @@ -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 > m_inspectors; QPointer m_currentInspector; diff --git a/src/lib/webview/webpage.cpp b/src/lib/webview/webpage.cpp index bde6e3e75..77c43b86a 100644 --- a/src/lib/webview/webpage.cpp +++ b/src/lib/webview/webpage.cpp @@ -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" diff --git a/src/lib/webview/webpage.h b/src/lib/webview/webpage.h index ed8e50c33..01d58f178 100644 --- a/src/lib/webview/webpage.h +++ b/src/lib/webview/webpage.h @@ -28,7 +28,7 @@ class QWebSecurityOrigin; class QEventLoop; -class QupZilla; +class BrowserWindow; class AdBlockRule; class TabbedWebView; class SpeedDial; diff --git a/src/lib/webview/webtab.cpp b/src/lib/webview/webtab.cpp index bd7119fc5..b44c448f8 100644 --- a/src/lib/webview/webtab.cpp +++ b/src/lib/webview/webtab.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . * ============================================================ */ #include "webtab.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "tabbedwebview.h" #include "webpage.h" #include "tabbar.h" @@ -88,9 +88,9 @@ QDataStream &operator >>(QDataStream &stream, WebTab::SavedTab &tab) return stream; } -WebTab::WebTab(QupZilla* mainClass, LocationBar* locationBar) +WebTab::WebTab(BrowserWindow* window, LocationBar* locationBar) : QWidget() - , p_QupZilla(mainClass) + , m_window(window) , m_navigationContainer(0) , m_locationBar(locationBar) , m_pinned(false) @@ -105,7 +105,7 @@ WebTab::WebTab(QupZilla* mainClass, LocationBar* locationBar) m_layout->setContentsMargins(0, 0, 0, 0); m_layout->setSpacing(0); - m_view = new TabbedWebView(p_QupZilla, this); + m_view = new TabbedWebView(m_window, this); m_view->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); WebPage* page = new WebPage; m_view->setWebPage(page); @@ -176,11 +176,11 @@ QWebHistory* WebTab::history() const return m_view->history(); } -void WebTab::moveToWindow(QupZilla* window) +void WebTab::moveToWindow(BrowserWindow* window) { - p_QupZilla = window; + m_window = window; - m_view->moveToWindow(p_QupZilla); + m_view->moveToWindow(m_window); } void WebTab::setHistoryData(const QByteArray &data) @@ -301,7 +301,7 @@ void WebTab::p_restoreTab(const WebTab::SavedTab &tab) QPixmap WebTab::renderTabPreview() { - TabbedWebView* currentWebView = p_QupZilla->weView(); + TabbedWebView* currentWebView = m_window->weView(); WebPage* page = m_view->page(); const QSize oldSize = page->viewportSize(); const QPoint originalScrollPosition = page->mainFrame()->scrollPosition(); @@ -369,7 +369,7 @@ int WebTab::tabIndex() const void WebTab::pinTab(int index) { - TabWidget* tabWidget = p_QupZilla->tabWidget(); + TabWidget* tabWidget = m_window->tabWidget(); if (!tabWidget) { return; } diff --git a/src/lib/webview/webtab.h b/src/lib/webview/webtab.h index 3e623a594..708d10f19 100644 --- a/src/lib/webview/webtab.h +++ b/src/lib/webview/webtab.h @@ -28,7 +28,7 @@ class QVBoxLayout; class QWebHistory; -class QupZilla; +class BrowserWindow; class LocationBar; class WebView; class TabbedWebView; @@ -53,7 +53,7 @@ public: friend QT_QUPZILLA_EXPORT QDataStream &operator>>(QDataStream &stream, SavedTab &tab); }; - explicit WebTab(QupZilla* mainClass, LocationBar* locationBar); + explicit WebTab(BrowserWindow* window, LocationBar* locationBar); ~WebTab(); TabbedWebView* view() const; @@ -64,7 +64,7 @@ public: QIcon icon() const; QWebHistory* history() const; - void moveToWindow(QupZilla* window); + void moveToWindow(BrowserWindow* window); void setHistoryData(const QByteArray &data); QByteArray historyData() const; @@ -103,7 +103,7 @@ private slots: void enableUpdates(); private: - QupZilla* p_QupZilla; + BrowserWindow* m_window; TabbedWebView* m_view; QVBoxLayout* m_layout; QWidget* m_navigationContainer; diff --git a/src/main/main.cpp b/src/main/main.cpp index acdf9bfeb..90ddf6e61 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -25,8 +25,6 @@ #include #include -#include "qupzilla.h" - #include #include #include @@ -93,7 +91,7 @@ void qupzilla_signal_handler(int s) QTextStream stream(&file); stream << "Time: " << currentDateTime.toString() << endl; stream << "Qt version: " << qVersion() << " (compiled with " << QT_VERSION_STR << ")" << endl; - stream << "QupZilla version: " << QupZilla::VERSION << endl; + stream << "QupZilla version: " << Qz::VERSION << endl; stream << "WebKit version: " << qWebKitVersion() << endl; stream << endl; stream << "============== BACKTRACE ==============" << endl; diff --git a/src/plugins/AccessKeysNavigation/akn_plugin.cpp b/src/plugins/AccessKeysNavigation/akn_plugin.cpp index cbb4c934a..902e28e33 100644 --- a/src/plugins/AccessKeysNavigation/akn_plugin.cpp +++ b/src/plugins/AccessKeysNavigation/akn_plugin.cpp @@ -20,7 +20,7 @@ #include "akn_settings.h" #include "mainapplication.h" #include "pluginproxy.h" -#include "qupzilla.h" +#include "browserwindow.h" #include @@ -64,7 +64,7 @@ bool AKN_Plugin::testPlugin() { // Let's be sure, require latest version of QupZilla - return (QupZilla::VERSION == QLatin1String("1.7.0")); + return (Qz::VERSION == QLatin1String("1.7.0")); } QTranslator* AKN_Plugin::getTranslator(const QString &locale) diff --git a/src/plugins/AutoScroll/autoscrollplugin.cpp b/src/plugins/AutoScroll/autoscrollplugin.cpp index e6b9252cb..47b63e027 100644 --- a/src/plugins/AutoScroll/autoscrollplugin.cpp +++ b/src/plugins/AutoScroll/autoscrollplugin.cpp @@ -18,7 +18,7 @@ #include "autoscrollplugin.h" #include "autoscrollsettings.h" #include "autoscroller.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "pluginproxy.h" #include "mainapplication.h" @@ -62,7 +62,7 @@ void AutoScrollPlugin::unload() bool AutoScrollPlugin::testPlugin() { - return (QupZilla::VERSION == QLatin1String("1.7.0")); + return (Qz::VERSION == QLatin1String("1.7.0")); } QTranslator* AutoScrollPlugin::getTranslator(const QString &locale) diff --git a/src/plugins/GnomeKeyringPasswords/gnomekeyringplugin.cpp b/src/plugins/GnomeKeyringPasswords/gnomekeyringplugin.cpp index 08e474249..ab9f4cd9e 100644 --- a/src/plugins/GnomeKeyringPasswords/gnomekeyringplugin.cpp +++ b/src/plugins/GnomeKeyringPasswords/gnomekeyringplugin.cpp @@ -18,7 +18,7 @@ #include "gnomekeyringplugin.h" #include "gnomekeyringpasswordbackend.h" #include "pluginproxy.h" -#include "qupzilla.h" +#include "browserwindow.h" #include @@ -59,7 +59,7 @@ void GnomeKeyringPlugin::unload() bool GnomeKeyringPlugin::testPlugin() { - return (QupZilla::VERSION == QLatin1String("1.7.0")); + return (Qz::VERSION == QLatin1String("1.7.0")); } QTranslator* GnomeKeyringPlugin::getTranslator(const QString &locale) diff --git a/src/plugins/GreaseMonkey/gm_addscriptdialog.cpp b/src/plugins/GreaseMonkey/gm_addscriptdialog.cpp index 182ca9cf4..517169e39 100644 --- a/src/plugins/GreaseMonkey/gm_addscriptdialog.cpp +++ b/src/plugins/GreaseMonkey/gm_addscriptdialog.cpp @@ -22,7 +22,7 @@ #include "gm_notification.h" #include "mainapplication.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "tabwidget.h" #include "tabbedwebview.h" #include "qztools.h" @@ -61,7 +61,7 @@ GM_AddScriptDialog::GM_AddScriptDialog(GM_Manager* manager, GM_Script* script, Q void GM_AddScriptDialog::showSource() { - QupZilla* qz = mApp->getWindow(); + BrowserWindow* qz = mApp->getWindow(); if (!qz) { return; } diff --git a/src/plugins/GreaseMonkey/gm_icon.cpp b/src/plugins/GreaseMonkey/gm_icon.cpp index 899a58d23..35920603c 100644 --- a/src/plugins/GreaseMonkey/gm_icon.cpp +++ b/src/plugins/GreaseMonkey/gm_icon.cpp @@ -17,9 +17,9 @@ * ============================================================ */ #include "gm_icon.h" #include "gm_manager.h" -#include "qupzilla.h" +#include "browserwindow.h" -GM_Icon::GM_Icon(GM_Manager* manager, QupZilla* window) +GM_Icon::GM_Icon(GM_Manager* manager, BrowserWindow* window) : ClickableLabel(window) , m_manager(manager) , m_window(window) diff --git a/src/plugins/GreaseMonkey/gm_icon.h b/src/plugins/GreaseMonkey/gm_icon.h index d979620be..4278c67cb 100644 --- a/src/plugins/GreaseMonkey/gm_icon.h +++ b/src/plugins/GreaseMonkey/gm_icon.h @@ -20,7 +20,7 @@ #include "clickablelabel.h" -class QupZilla; +class BrowserWindow; class GM_Manager; class GM_Icon : public ClickableLabel @@ -28,14 +28,14 @@ class GM_Icon : public ClickableLabel Q_OBJECT public: - explicit GM_Icon(GM_Manager* manager, QupZilla* window); + explicit GM_Icon(GM_Manager* manager, BrowserWindow* window); private slots: void openSettings(); private: GM_Manager* m_manager; - QupZilla* m_window; + BrowserWindow* m_window; }; #endif // GM_ICON_H diff --git a/src/plugins/GreaseMonkey/gm_manager.cpp b/src/plugins/GreaseMonkey/gm_manager.cpp index 7678d3a05..46360bf45 100644 --- a/src/plugins/GreaseMonkey/gm_manager.cpp +++ b/src/plugins/GreaseMonkey/gm_manager.cpp @@ -22,7 +22,7 @@ #include "gm_icon.h" #include "settings/gm_settings.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "webpage.h" #include "qztools.h" #include "mainapplication.h" @@ -100,7 +100,7 @@ void GM_Manager::unloadPlugin() delete m_settings.data(); // Remove icons from all windows - QHashIterator it(m_windows); + QHashIterator it(m_windows); while (it.hasNext()) { it.next(); mainWindowDeleted(it.key()); @@ -280,14 +280,14 @@ bool GM_Manager::canRunOnScheme(const QString &scheme) || scheme == QLatin1String("data") || scheme == QLatin1String("ftp")); } -void GM_Manager::mainWindowCreated(QupZilla* window) +void GM_Manager::mainWindowCreated(BrowserWindow* window) { GM_Icon* icon = new GM_Icon(this, window); window->statusBar()->addPermanentWidget(icon); m_windows[window] = icon; } -void GM_Manager::mainWindowDeleted(QupZilla* window) +void GM_Manager::mainWindowDeleted(BrowserWindow* window) { window->statusBar()->removeWidget(m_windows[window]); delete m_windows[window]; diff --git a/src/plugins/GreaseMonkey/gm_manager.h b/src/plugins/GreaseMonkey/gm_manager.h index bf80bbb26..776cc13e7 100644 --- a/src/plugins/GreaseMonkey/gm_manager.h +++ b/src/plugins/GreaseMonkey/gm_manager.h @@ -26,7 +26,7 @@ class QUrl; class QNetworkRequest; -class QupZilla; +class BrowserWindow; class GM_Script; class GM_JSObject; class GM_Settings; @@ -64,8 +64,8 @@ signals: void scriptsChanged(); public slots: - void mainWindowCreated(QupZilla* window); - void mainWindowDeleted(QupZilla* window); + void mainWindowCreated(BrowserWindow* window); + void mainWindowDeleted(BrowserWindow* window); void pageLoadStart(); @@ -82,7 +82,7 @@ private: QList m_endScripts; QList m_startScripts; - QHash m_windows; + QHash m_windows; }; #endif // GM_MANAGER_H diff --git a/src/plugins/GreaseMonkey/gm_plugin.cpp b/src/plugins/GreaseMonkey/gm_plugin.cpp index a8574b5b8..2fc2e8024 100644 --- a/src/plugins/GreaseMonkey/gm_plugin.cpp +++ b/src/plugins/GreaseMonkey/gm_plugin.cpp @@ -17,7 +17,7 @@ * ============================================================ */ #include "gm_plugin.h" #include "gm_manager.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "webpage.h" #include "pluginproxy.h" #include "mainapplication.h" @@ -55,12 +55,12 @@ void GM_Plugin::init(InitState state, const QString &settingsPath) m_settingsPath = settingsPath; connect(mApp->plugins(), SIGNAL(webPageCreated(WebPage*)), this, SLOT(webPageCreated(WebPage*))); - connect(mApp->plugins(), SIGNAL(mainWindowCreated(QupZilla*)), m_manager, SLOT(mainWindowCreated(QupZilla*))); - connect(mApp->plugins(), SIGNAL(mainWindowDeleted(QupZilla*)), m_manager, SLOT(mainWindowDeleted(QupZilla*))); + connect(mApp->plugins(), SIGNAL(mainWindowCreated(BrowserWindow*)), m_manager, SLOT(mainWindowCreated(BrowserWindow*))); + connect(mApp->plugins(), SIGNAL(mainWindowDeleted(BrowserWindow*)), m_manager, SLOT(mainWindowDeleted(BrowserWindow*))); // Make sure userscripts works also with already created WebPages if (state == LateInitState) { - foreach (QupZilla* window, mApp->mainWindows()) { + foreach (BrowserWindow* window, mApp->mainWindows()) { m_manager->mainWindowCreated(window); for (int i = 0; i < window->tabWidget()->count(); ++i) { @@ -81,7 +81,7 @@ void GM_Plugin::unload() bool GM_Plugin::testPlugin() { - return (QupZilla::VERSION == QLatin1String("1.7.0")); + return (Qz::VERSION == QLatin1String("1.7.0")); } QTranslator* GM_Plugin::getTranslator(const QString &locale) diff --git a/src/plugins/KWalletPasswords/kwalletplugin.cpp b/src/plugins/KWalletPasswords/kwalletplugin.cpp index 88b0ee140..d4d15b15b 100644 --- a/src/plugins/KWalletPasswords/kwalletplugin.cpp +++ b/src/plugins/KWalletPasswords/kwalletplugin.cpp @@ -18,7 +18,7 @@ #include "kwalletplugin.h" #include "kwalletpasswordbackend.h" #include "pluginproxy.h" -#include "qupzilla.h" +#include "browserwindow.h" #include @@ -59,7 +59,7 @@ void KWalletPlugin::unload() bool KWalletPlugin::testPlugin() { - return (QupZilla::VERSION == QLatin1String("1.7.0")); + return (Qz::VERSION == QLatin1String("1.7.0")); } QTranslator* KWalletPlugin::getTranslator(const QString &locale) diff --git a/src/plugins/MouseGestures/mousegestures.cpp b/src/plugins/MouseGestures/mousegestures.cpp index 3335ba674..da17288fd 100644 --- a/src/plugins/MouseGestures/mousegestures.cpp +++ b/src/plugins/MouseGestures/mousegestures.cpp @@ -20,7 +20,7 @@ #include "tabbedwebview.h" #include "tabwidget.h" #include "mainapplication.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "mousegesturessettingsdialog.h" #include "QjtMouseGestureFilter.h" diff --git a/src/plugins/MouseGestures/mousegesturesplugin.cpp b/src/plugins/MouseGestures/mousegesturesplugin.cpp index 59dda77b2..53d5ffe1f 100644 --- a/src/plugins/MouseGestures/mousegesturesplugin.cpp +++ b/src/plugins/MouseGestures/mousegesturesplugin.cpp @@ -19,7 +19,7 @@ #include "pluginproxy.h" #include "mousegestures.h" #include "mainapplication.h" -#include "qupzilla.h" +#include "browserwindow.h" #include @@ -65,7 +65,7 @@ bool MouseGesturesPlugin::testPlugin() { // Let's be sure, require latest version of QupZilla - return (QupZilla::VERSION == QLatin1String("1.7.0")); + return (Qz::VERSION == QLatin1String("1.7.0")); } QTranslator* MouseGesturesPlugin::getTranslator(const QString &locale) diff --git a/src/plugins/PIM/PIM_plugin.cpp b/src/plugins/PIM/PIM_plugin.cpp index d6784fe3c..29451ae4a 100644 --- a/src/plugins/PIM/PIM_plugin.cpp +++ b/src/plugins/PIM/PIM_plugin.cpp @@ -21,7 +21,7 @@ #include "PIM_settings.h" #include "mainapplication.h" #include "pluginproxy.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "webview.h" #include @@ -67,7 +67,7 @@ bool PIM_Plugin::testPlugin() { // Let's be sure, require latest version of QupZilla - return (QupZilla::VERSION == QLatin1String("1.7.0")); + return (Qz::VERSION == QLatin1String("1.7.0")); } QTranslator* PIM_Plugin::getTranslator(const QString &locale) diff --git a/src/plugins/PIM/PIM_plugin.h b/src/plugins/PIM/PIM_plugin.h index 321afa6f0..9c8e0f335 100644 --- a/src/plugins/PIM/PIM_plugin.h +++ b/src/plugins/PIM/PIM_plugin.h @@ -22,7 +22,7 @@ #include "plugininterface.h" class WebPage; -class QupZilla; +class BrowserWindow; class PIM_Handler; class PIM_Plugin : public QObject, public PluginInterface diff --git a/src/plugins/StatusBarIcons/sbi_iconsmanager.cpp b/src/plugins/StatusBarIcons/sbi_iconsmanager.cpp index 093f8f606..a93cf221c 100644 --- a/src/plugins/StatusBarIcons/sbi_iconsmanager.cpp +++ b/src/plugins/StatusBarIcons/sbi_iconsmanager.cpp @@ -20,7 +20,7 @@ #include "sbi_javascripticon.h" #include "sbi_networkicon.h" #include "sbi_networkmanager.h" -#include "qupzilla.h" +#include "browserwindow.h" #include #include @@ -88,7 +88,7 @@ void SBI_IconsManager::setShowNetworkIcon(bool show) void SBI_IconsManager::reloadIcons() { - QHashIterator it(m_windows); + QHashIterator it(m_windows); while (it.hasNext()) { it.next(); @@ -99,7 +99,7 @@ void SBI_IconsManager::reloadIcons() void SBI_IconsManager::destroyIcons() { - QHashIterator it(m_windows); + QHashIterator it(m_windows); while (it.hasNext()) { it.next(); @@ -107,7 +107,7 @@ void SBI_IconsManager::destroyIcons() } } -void SBI_IconsManager::mainWindowCreated(QupZilla* window) +void SBI_IconsManager::mainWindowCreated(BrowserWindow* window) { if (m_showImagesIcon) { SBI_ImagesIcon* w = new SBI_ImagesIcon(window, m_settingsPath); @@ -132,7 +132,7 @@ void SBI_IconsManager::mainWindowCreated(QupZilla* window) } } -void SBI_IconsManager::mainWindowDeleted(QupZilla* window) +void SBI_IconsManager::mainWindowDeleted(BrowserWindow* window) { foreach (QWidget* w, m_windows[window]) { window->statusBar()->removeWidget(w); diff --git a/src/plugins/StatusBarIcons/sbi_iconsmanager.h b/src/plugins/StatusBarIcons/sbi_iconsmanager.h index 61c6be457..19c89c8ca 100644 --- a/src/plugins/StatusBarIcons/sbi_iconsmanager.h +++ b/src/plugins/StatusBarIcons/sbi_iconsmanager.h @@ -21,7 +21,7 @@ #include #include -class QupZilla; +class BrowserWindow; class SBI_NetworkManager; class SBI_IconsManager : public QObject @@ -48,8 +48,8 @@ public: signals: public slots: - void mainWindowCreated(QupZilla* window); - void mainWindowDeleted(QupZilla* window); + void mainWindowCreated(BrowserWindow* window); + void mainWindowDeleted(BrowserWindow* window); private: QString m_settingsPath; @@ -57,7 +57,7 @@ private: bool m_showJavaScriptIcon; bool m_showNetworkIcon; - QHash m_windows; + QHash m_windows; SBI_NetworkManager* m_networkManager; }; diff --git a/src/plugins/StatusBarIcons/sbi_imagesicon.cpp b/src/plugins/StatusBarIcons/sbi_imagesicon.cpp index 91fa3cc35..d9537d9f8 100644 --- a/src/plugins/StatusBarIcons/sbi_imagesicon.cpp +++ b/src/plugins/StatusBarIcons/sbi_imagesicon.cpp @@ -17,7 +17,7 @@ * ============================================================ */ #include "sbi_imagesicon.h" #include "mainapplication.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "tabwidget.h" #include "tabbedwebview.h" #include "webpage.h" @@ -27,9 +27,9 @@ #include #include -SBI_ImagesIcon::SBI_ImagesIcon(QupZilla* window, const QString &settingsPath) +SBI_ImagesIcon::SBI_ImagesIcon(BrowserWindow* window, const QString &settingsPath) : ClickableLabel(window) - , p_QupZilla(window) + , m_window(window) , m_settingsFile(settingsPath + "extensions.ini") { setCursor(Qt::PointingHandCursor); @@ -47,7 +47,7 @@ SBI_ImagesIcon::SBI_ImagesIcon(QupZilla* window, const QString &settingsPath) updateIcon(); - connect(p_QupZilla->tabWidget(), SIGNAL(currentChanged(int)), this, SLOT(updateIcon())); + connect(m_window->tabWidget(), SIGNAL(currentChanged(int)), this, SLOT(updateIcon())); connect(this, SIGNAL(clicked(QPoint)), this, SLOT(showMenu(QPoint))); } @@ -84,7 +84,7 @@ void SBI_ImagesIcon::toggleLoadingImages() // We should reload page on disabling images if (current) { - p_QupZilla->weView()->reload(); + m_window->weView()->reload(); } updateIcon(); @@ -105,13 +105,13 @@ void SBI_ImagesIcon::setGlobalLoadingImages(bool enable) // We should reload page on disabling images if (!enable) { - p_QupZilla->weView()->reload(); + m_window->weView()->reload(); } } QWebSettings* SBI_ImagesIcon::currentPageSettings() { - return p_QupZilla->weView()->page()->settings(); + return m_window->weView()->page()->settings(); } void SBI_ImagesIcon::updateIcon() diff --git a/src/plugins/StatusBarIcons/sbi_imagesicon.h b/src/plugins/StatusBarIcons/sbi_imagesicon.h index cd3ad50ef..a597524e4 100644 --- a/src/plugins/StatusBarIcons/sbi_imagesicon.h +++ b/src/plugins/StatusBarIcons/sbi_imagesicon.h @@ -24,14 +24,14 @@ class QWebSettings; -class QupZilla; +class BrowserWindow; class SBI_ImagesIcon : public ClickableLabel { Q_OBJECT public: - explicit SBI_ImagesIcon(QupZilla* window, const QString &settingsPath); + explicit SBI_ImagesIcon(BrowserWindow* window, const QString &settingsPath); private slots: void showMenu(const QPoint &point); @@ -43,7 +43,7 @@ private slots: private: QWebSettings* currentPageSettings(); - QupZilla* p_QupZilla; + BrowserWindow* m_window; QString m_settingsFile; QIcon m_icon; diff --git a/src/plugins/StatusBarIcons/sbi_javascripticon.cpp b/src/plugins/StatusBarIcons/sbi_javascripticon.cpp index 4f456d089..4be58afa6 100644 --- a/src/plugins/StatusBarIcons/sbi_javascripticon.cpp +++ b/src/plugins/StatusBarIcons/sbi_javascripticon.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see . * ============================================================ */ #include "sbi_javascripticon.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "tabwidget.h" #include "tabbedwebview.h" #include "webpage.h" @@ -26,9 +26,9 @@ #include #include -SBI_JavaScriptIcon::SBI_JavaScriptIcon(QupZilla* window) +SBI_JavaScriptIcon::SBI_JavaScriptIcon(BrowserWindow* window) : ClickableLabel(window) - , p_QupZilla(window) + , m_window(window) { setCursor(Qt::PointingHandCursor); setToolTip(tr("Modify JavaScript settings per-site and globally")); @@ -36,7 +36,7 @@ SBI_JavaScriptIcon::SBI_JavaScriptIcon(QupZilla* window) m_icon = QIcon::fromTheme("application-x-javascript", QIcon(":sbi/data/javascript.png")); setPixmap(m_icon.pixmap(16)); - connect(p_QupZilla->tabWidget(), SIGNAL(currentChanged(int)), this, SLOT(updateIcon())); + connect(m_window->tabWidget(), SIGNAL(currentChanged(int)), this, SLOT(updateIcon())); connect(this, SIGNAL(clicked(QPoint)), this, SLOT(showMenu(QPoint))); } @@ -83,20 +83,20 @@ void SBI_JavaScriptIcon::toggleJavaScript() bool current = currentPageSettings()->testAttribute(QWebSettings::JavascriptEnabled); currentPage()->setJavaScriptEnabled(!current); - p_QupZilla->weView()->reload(); + m_window->weView()->reload(); updateIcon(); } void SBI_JavaScriptIcon::openJavaScriptSettings() { - JsOptions dialog(p_QupZilla); + JsOptions dialog(m_window); dialog.exec(); } WebPage* SBI_JavaScriptIcon::currentPage() { - return p_QupZilla->weView()->page(); + return m_window->weView()->page(); } QWebSettings* SBI_JavaScriptIcon::currentPageSettings() diff --git a/src/plugins/StatusBarIcons/sbi_javascripticon.h b/src/plugins/StatusBarIcons/sbi_javascripticon.h index d5f5e5501..d517a5c7d 100644 --- a/src/plugins/StatusBarIcons/sbi_javascripticon.h +++ b/src/plugins/StatusBarIcons/sbi_javascripticon.h @@ -24,7 +24,7 @@ class QWebSettings; -class QupZilla; +class BrowserWindow; class WebPage; class SBI_JavaScriptIcon : public ClickableLabel @@ -32,7 +32,7 @@ class SBI_JavaScriptIcon : public ClickableLabel Q_OBJECT public: - explicit SBI_JavaScriptIcon(QupZilla* window); + explicit SBI_JavaScriptIcon(BrowserWindow* window); private slots: void showMenu(const QPoint &point); @@ -45,7 +45,7 @@ private: WebPage* currentPage(); QWebSettings* currentPageSettings(); - QupZilla* p_QupZilla; + BrowserWindow* m_window; QIcon m_icon; }; diff --git a/src/plugins/StatusBarIcons/sbi_networkicon.cpp b/src/plugins/StatusBarIcons/sbi_networkicon.cpp index 8798c5094..a44aed816 100644 --- a/src/plugins/StatusBarIcons/sbi_networkicon.cpp +++ b/src/plugins/StatusBarIcons/sbi_networkicon.cpp @@ -22,15 +22,15 @@ #include "mainapplication.h" #include "networkmanager.h" #include "networkproxyfactory.h" -#include "qupzilla.h" +#include "browserwindow.h" #include #include #include -SBI_NetworkIcon::SBI_NetworkIcon(QupZilla* window) +SBI_NetworkIcon::SBI_NetworkIcon(BrowserWindow* window) : ClickableLabel(window) - , p_QupZilla(window) + , m_window(window) , m_networkConfiguration(new QNetworkConfigurationManager(this)) { setCursor(Qt::PointingHandCursor); @@ -55,7 +55,7 @@ void SBI_NetworkIcon::onlineStateChanged(bool online) void SBI_NetworkIcon::showDialog() { - SBI_NetworkIconDialog dialog(p_QupZilla); + SBI_NetworkIconDialog dialog(m_window); dialog.exec(); } diff --git a/src/plugins/StatusBarIcons/sbi_networkicon.h b/src/plugins/StatusBarIcons/sbi_networkicon.h index 072da75f1..a691893ce 100644 --- a/src/plugins/StatusBarIcons/sbi_networkicon.h +++ b/src/plugins/StatusBarIcons/sbi_networkicon.h @@ -24,14 +24,14 @@ class QNetworkConfigurationManager; -class QupZilla; +class BrowserWindow; class SBI_NetworkIcon : public ClickableLabel { Q_OBJECT public: - explicit SBI_NetworkIcon(QupZilla* window); + explicit SBI_NetworkIcon(BrowserWindow* window); private slots: void onlineStateChanged(bool online); @@ -44,7 +44,7 @@ private: void updateToolTip(); void enterEvent(QEvent* event); - QupZilla* p_QupZilla; + BrowserWindow* m_window; QNetworkConfigurationManager* m_networkConfiguration; }; diff --git a/src/plugins/StatusBarIcons/statusbariconsplugin.cpp b/src/plugins/StatusBarIcons/statusbariconsplugin.cpp index 188f536c7..5a371c58d 100644 --- a/src/plugins/StatusBarIcons/statusbariconsplugin.cpp +++ b/src/plugins/StatusBarIcons/statusbariconsplugin.cpp @@ -19,7 +19,7 @@ #include "sbi_iconsmanager.h" #include "sbi_settingsdialog.h" #include "pluginproxy.h" -#include "qupzilla.h" +#include "browserwindow.h" #include @@ -47,12 +47,12 @@ void StatusBarIconsPlugin::init(InitState state, const QString &settingsPath) { m_manager = new SBI_IconsManager(settingsPath); - connect(mApp->plugins(), SIGNAL(mainWindowCreated(QupZilla*)), m_manager, SLOT(mainWindowCreated(QupZilla*))); - connect(mApp->plugins(), SIGNAL(mainWindowDeleted(QupZilla*)), m_manager, SLOT(mainWindowDeleted(QupZilla*))); + connect(mApp->plugins(), SIGNAL(mainWindowCreated(BrowserWindow*)), m_manager, SLOT(mainWindowCreated(BrowserWindow*))); + connect(mApp->plugins(), SIGNAL(mainWindowDeleted(BrowserWindow*)), m_manager, SLOT(mainWindowDeleted(BrowserWindow*))); // Make sure icons are added also to already created windows if (state == LateInitState) { - foreach (QupZilla* window, mApp->mainWindows()) { + foreach (BrowserWindow* window, mApp->mainWindows()) { m_manager->mainWindowCreated(window); } } @@ -62,7 +62,7 @@ void StatusBarIconsPlugin::unload() { // Make sure icons are properly removed when unloading plugin (but not when closing app) if (!mApp->isClosing()) { - foreach (QupZilla* window, mApp->mainWindows()) { + foreach (BrowserWindow* window, mApp->mainWindows()) { m_manager->mainWindowDeleted(window); } @@ -72,7 +72,7 @@ void StatusBarIconsPlugin::unload() bool StatusBarIconsPlugin::testPlugin() { - return (QupZilla::VERSION == QLatin1String("1.7.0")); + return (Qz::VERSION == QLatin1String("1.7.0")); } QTranslator* StatusBarIconsPlugin::getTranslator(const QString &locale) diff --git a/src/plugins/TestPlugin/testplugin.cpp b/src/plugins/TestPlugin/testplugin.cpp index dda237b1e..16b7585dd 100644 --- a/src/plugins/TestPlugin/testplugin.cpp +++ b/src/plugins/TestPlugin/testplugin.cpp @@ -17,7 +17,7 @@ * ============================================================ */ #include "testplugin.h" #include "testplugin_sidebar.h" -#include "qupzilla.h" +#include "browserwindow.h" #include "webview.h" #include "pluginproxy.h" #include "mainapplication.h" @@ -97,7 +97,7 @@ bool TestPlugin::testPlugin() //There should be some testing if plugin is loaded correctly //If this function returns false, plugin is automatically unloaded - return (QupZilla::VERSION == QLatin1String("1.7.0")); + return (Qz::VERSION == QLatin1String("1.7.0")); } QTranslator* TestPlugin::getTranslator(const QString &locale) diff --git a/src/plugins/TestPlugin/testplugin_sidebar.cpp b/src/plugins/TestPlugin/testplugin_sidebar.cpp index 1333f347b..d9896f597 100644 --- a/src/plugins/TestPlugin/testplugin_sidebar.cpp +++ b/src/plugins/TestPlugin/testplugin_sidebar.cpp @@ -40,7 +40,7 @@ QAction* TestPlugin_Sidebar::createMenuAction() return act; } -QWidget* TestPlugin_Sidebar::createSideBarWidget(QupZilla* mainWindow) +QWidget* TestPlugin_Sidebar::createSideBarWidget(BrowserWindow* mainWindow) { Q_UNUSED(mainWindow) diff --git a/src/plugins/TestPlugin/testplugin_sidebar.h b/src/plugins/TestPlugin/testplugin_sidebar.h index 03f6a3614..279d39aee 100644 --- a/src/plugins/TestPlugin/testplugin_sidebar.h +++ b/src/plugins/TestPlugin/testplugin_sidebar.h @@ -29,7 +29,7 @@ public: QString title() const; QAction* createMenuAction(); - QWidget* createSideBarWidget(QupZilla* mainWindow); + QWidget* createSideBarWidget(BrowserWindow* mainWindow); }; #endif // TESTPLUGIN_SIDEBAR_H