summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp43
1 files changed, 15 insertions, 28 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index a9364ef1..5f112abd 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -103,7 +103,6 @@ MainWindow::MainWindow()
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
// --------- connect signals and slots
- connect(m_view, SIGNAL(loadUrlPage(const KUrl &)), this, SLOT(loadUrl(const KUrl &)));
connect(m_view, SIGNAL(setCurrentTitle(const QString &)), this, SLOT(slotUpdateWindowTitle(const QString &)));
connect(m_view, SIGNAL(loadProgress(int)), this, SLOT(slotLoadProgress(int)));
connect(m_view, SIGNAL(geometryChangeRequested(const QRect &)), this, SLOT(geometryChangeRequested(const QRect &)));
@@ -118,9 +117,6 @@ MainWindow::MainWindow()
// update toolbar actions
connect(m_view, SIGNAL(tabsChanged()), this, SLOT(slotUpdateActions()));
connect(m_view, SIGNAL(currentChanged(int)), this, SLOT(slotUpdateActions()));
-
- // bookmarks loading
- connect(Application::bookmarkProvider(), SIGNAL(openUrl(const KUrl&)), this, SLOT(loadUrl(const KUrl&)));
slotUpdateWindowTitle();
@@ -184,7 +180,7 @@ void MainWindow::setupToolBars()
a = new KAction(i18n("Search Bar"), this);
a->setShortcut(KShortcut(Qt::CTRL + Qt::Key_K));
a->setDefaultWidget(m_searchBar);
- connect(m_searchBar, SIGNAL(search(const KUrl&)), this, SLOT(loadUrl(const KUrl&)));
+ connect(m_searchBar, SIGNAL(search(const KUrl&)), m_view, SLOT(openUrl(const KUrl &)));
actionCollection()->addAction(QLatin1String("search_bar"), a);
// bookmarks bar
@@ -311,11 +307,12 @@ void MainWindow::setupSidePanel()
{
// Setup history side panel
m_sidePanel = new SidePanel(i18n("History"), this);
- connect(m_sidePanel, SIGNAL(openUrl(const KUrl&)), this, SLOT(loadUrl(const KUrl&)));
+ connect(m_sidePanel, SIGNAL(openUrl(const KUrl &, Rekonq::OpenType)),
+ m_view, SLOT(openUrl(const KUrl &, Rekonq::OpenType)));
connect(m_sidePanel, SIGNAL(destroyed()), Application::instance(), SLOT(slotSaveConfiguration()));
-
+
addDockWidget(Qt::LeftDockWidgetArea, m_sidePanel);
-
+
// setup side panel actions
KAction* a = new KAction(this);
a->setText(i18n("History"));
@@ -323,7 +320,7 @@ void MainWindow::setupSidePanel()
a->setChecked(ReKonfig::showSideBar());
a->setShortcut(KShortcut(Qt::CTRL + Qt::Key_H));
actionCollection()->addAction(QLatin1String("show_history_panel"), a);
-
+
// connect to toogle action
connect(a, SIGNAL(triggered(bool)), m_sidePanel->toggleViewAction(), SLOT(trigger()));
}
@@ -332,7 +329,7 @@ void MainWindow::setupSidePanel()
void MainWindow::setupHistoryMenu()
{
HistoryMenu *historyMenu = new HistoryMenu(this);
- connect(historyMenu, SIGNAL(openUrl(const KUrl&)), m_view, SLOT(loadUrlInCurrentTab(const KUrl&)));
+ connect(historyMenu, SIGNAL(openUrl(const KUrl &)), m_view, SLOT(openUrl(const KUrl &)));
connect(historyMenu, SIGNAL(hovered(const QString&)), this, SLOT(slotUpdateStatusbar(const QString&)));
historyMenu->setTitle(i18n("&History"));
@@ -454,16 +451,6 @@ KUrl MainWindow::guessUrlFromString(const QString &string)
}
-void MainWindow::loadUrl(const KUrl &url)
-{
- if (!currentTab() || url.isEmpty())
- return;
-
- m_view->currentUrlBar()->setUrl(url.prettyUrl());
- m_view->loadUrlInCurrentTab(url);
-}
-
-
void MainWindow::slotOpenLocation()
{
m_view->currentUrlBar()->selectAll();
@@ -532,7 +519,7 @@ void MainWindow::slotFileOpen()
if (filePath.isEmpty())
return;
- loadUrl(guessUrlFromString(filePath));
+ mainView()->openUrl(guessUrlFromString(filePath));
}
@@ -693,7 +680,7 @@ void MainWindow::slotViewFullScreen(bool makeFullScreen)
static bool bookmarksToolBarFlag;
static bool statusBarFlag;
static bool sidePanelFlag;
-
+
if (makeFullScreen == true)
{
// save current state
@@ -703,7 +690,7 @@ void MainWindow::slotViewFullScreen(bool makeFullScreen)
bookmarksToolBarFlag = toolBar("bookmarksToolBar")->isHidden();
statusBarFlag = statusBar()->isHidden();
sidePanelFlag = sidePanel()->isHidden();
-
+
menuBar()->hide();
toolBar("mainToolBar")->hide();
toolBar("locationToolBar")->hide();
@@ -745,12 +732,12 @@ void MainWindow::slotViewPageSource()
/// TODO: autochoose tempfile suffix
sourceFile.setSuffix(QString(".html"));
sourceFile.setAutoRemove(false);
-
+
if (sourceFile.open())
{
QDataStream stream(&sourceFile);
stream << currentTab()->page()->mainFrame()->toHtml().toUtf8();
-
+
url = KUrl();
url.setPath(sourceFile.fileName());
isTempFile = true;
@@ -762,7 +749,7 @@ void MainWindow::slotViewPageSource()
void MainWindow::slotHome()
{
- loadUrl(KUrl(m_homePage));
+ mainView()->openUrl(KUrl(m_homePage));
}
@@ -896,7 +883,7 @@ bool MainWindow::queryClose()
if (m_view->count() > 1)
{
- int answer = KMessageBox::questionYesNoCancel(
+ int answer = KMessageBox::questionYesNoCancel(
this,
i18n("Are you sure you want to close the window?\n" "You have %1 tab(s) open" , m_view->count()),
i18n("Are you sure you want to close the window?"),
@@ -906,7 +893,7 @@ bool MainWindow::queryClose()
"confirmClosingMultipleTabs"
);
- switch (answer)
+ switch (answer)
{
case KMessageBox::Yes:
// Quit