summaryrefslogtreecommitdiff
path: root/src/browsermainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/browsermainwindow.cpp')
-rw-r--r--src/browsermainwindow.cpp87
1 files changed, 11 insertions, 76 deletions
diff --git a/src/browsermainwindow.cpp b/src/browsermainwindow.cpp
index f6691101..04447f87 100644
--- a/src/browsermainwindow.cpp
+++ b/src/browsermainwindow.cpp
@@ -278,10 +278,10 @@ void BrowserMainWindow::setupMenu()
// ------------------------------------------------------------- VIEW -------------------------------------------------------------------------------------------------
KMenu *viewMenu = (KMenu *) menuBar()->addMenu( i18n("&View") );
- m_viewStatusbar = new KAction(this);
- updateStatusbarActionText(true);
+ m_viewStatusbar = KStandardAction::showStatusbar( this, SLOT(slotViewStatusbar() ), this);
+/* updateStatusbarActionText(true);
m_viewStatusbar->setShortcut( i18n("Ctrl+/") );
- connect(m_viewStatusbar, SIGNAL(triggered()), this, SLOT(slotViewStatusbar()));
+ connect(m_viewStatusbar, SIGNAL(triggered()), this, SLOT(slotViewStatusbar()));*/
viewMenu->addAction(m_viewStatusbar);
viewMenu->addSeparator();
@@ -355,7 +355,6 @@ void BrowserMainWindow::setupMenu()
toolsMenu->addSeparator();
- toolsMenu->addAction( i18n("Web &Search"), this, SLOT(slotWebSearch()), QKeySequence( tr("Ctrl+K", "Web Search")));
action = (KAction *) toolsMenu->addAction( i18n("Enable Web &Inspector"), this, SLOT(slotToggleInspector(bool)));
action->setCheckable(true);
@@ -370,9 +369,6 @@ void BrowserMainWindow::setupMenu()
}
-
-
-
void BrowserMainWindow::setupToolBar()
{
m_navigationBar = new KToolBar( i18n("Navigation") , this, Qt::TopToolBarArea, true, false, false);
@@ -409,31 +405,21 @@ void BrowserMainWindow::setupToolBar()
}
-
-void BrowserMainWindow::slotAddBookmark()
-{
-// WebView *webView = currentTab();
-// QString url = webView->url().toString();
-// QString title = webView->title();
-// AddBookmarkDialog dialog(url, title);
-// dialog.exec();
-}
-
-
void BrowserMainWindow::updateStatusbarActionText(bool visible)
{
m_viewStatusbar->setText(!visible ? i18n("Show Status Bar") : i18n("Hide Status Bar"));
}
-
-
void BrowserMainWindow::slotViewStatusbar()
{
- if (statusBar()->isVisible()) {
+ if (statusBar()->isVisible())
+ {
updateStatusbarActionText(false);
statusBar()->close();
- } else {
+ }
+ else
+ {
updateStatusbarActionText(true);
statusBar()->show();
}
@@ -441,8 +427,6 @@ void BrowserMainWindow::slotViewStatusbar()
}
-
-
KUrl BrowserMainWindow::guessUrlFromString(const QString &string)
{
QString urlStr = string.trimmed();
@@ -498,23 +482,18 @@ KUrl BrowserMainWindow::guessUrlFromString(const QString &string)
}
-
-
void BrowserMainWindow::loadUrl(const KUrl &url)
{
loadPage( url.url() );
}
-
-
void BrowserMainWindow::slotDownloadManager()
{
BrowserApplication::downloadManager()->show();
}
-
void BrowserMainWindow::slotSelectLineEdit()
{
m_tabWidget->currentLineEdit()->selectAll();
@@ -522,15 +501,12 @@ void BrowserMainWindow::slotSelectLineEdit()
}
-
void BrowserMainWindow::slotFileSaveAs()
{
BrowserApplication::downloadManager()->download(currentTab()->url(), true);
}
-
-
void BrowserMainWindow::slotPreferences()
{
SettingsDialog *s = new SettingsDialog(this);
@@ -538,16 +514,12 @@ void BrowserMainWindow::slotPreferences()
}
-
-
void BrowserMainWindow::slotUpdateStatusbar(const QString &string)
{
statusBar()->showMessage(string, 2000);
}
-
-
void BrowserMainWindow::slotUpdateWindowTitle(const QString &title)
{
if (title.isEmpty()) {
@@ -558,7 +530,6 @@ void BrowserMainWindow::slotUpdateWindowTitle(const QString &title)
}
-
void BrowserMainWindow::slotFileNew()
{
BrowserApplication::instance()->newMainWindow();
@@ -567,8 +538,6 @@ void BrowserMainWindow::slotFileNew()
}
-
-
void BrowserMainWindow::slotFileOpen()
{
QString file = QFileDialog::getOpenFileName(this, i18n("Open Web Resource"), QString(),
@@ -581,8 +550,6 @@ void BrowserMainWindow::slotFileOpen()
}
-
-
void BrowserMainWindow::slotFilePrintPreview()
{
if (!currentTab())
@@ -593,7 +560,6 @@ void BrowserMainWindow::slotFilePrintPreview()
}
-
void BrowserMainWindow::slotFilePrint()
{
if (!currentTab())
@@ -602,7 +568,6 @@ void BrowserMainWindow::slotFilePrint()
}
-
void BrowserMainWindow::printRequested(QWebFrame *frame)
{
QPrinter printer;
@@ -614,7 +579,6 @@ void BrowserMainWindow::printRequested(QWebFrame *frame)
}
-
void BrowserMainWindow::slotPrivateBrowsing()
{
QWebSettings *settings = QWebSettings::globalSettings();
@@ -654,7 +618,6 @@ void BrowserMainWindow::slotPrivateBrowsing()
}
-
void BrowserMainWindow::closeEvent(QCloseEvent *event)
{
if (m_tabWidget->count() > 1)
@@ -710,7 +673,6 @@ void BrowserMainWindow::slotFindPrevious()
}
-
void BrowserMainWindow::slotViewTextBigger()
{
if (!currentTab())
@@ -719,7 +681,6 @@ void BrowserMainWindow::slotViewTextBigger()
}
-
void BrowserMainWindow::slotViewTextNormal()
{
if (!currentTab())
@@ -728,7 +689,6 @@ void BrowserMainWindow::slotViewTextNormal()
}
-
void BrowserMainWindow::slotViewTextSmaller()
{
if (!currentTab())
@@ -737,8 +697,6 @@ void BrowserMainWindow::slotViewTextSmaller()
}
-
-
void BrowserMainWindow::slotViewFullScreen(bool makeFullScreen)
{
if (makeFullScreen)
@@ -766,8 +724,6 @@ void BrowserMainWindow::slotViewFullScreen(bool makeFullScreen)
}
-
-
void BrowserMainWindow::slotViewPageSource()
{
if (!currentTab())
@@ -782,7 +738,6 @@ void BrowserMainWindow::slotViewPageSource()
}
-
void BrowserMainWindow::slotHome()
{
KConfig config("rekonqrc");
@@ -792,17 +747,6 @@ void BrowserMainWindow::slotHome()
}
-
-
-void BrowserMainWindow::slotWebSearch()
-{
-// m_toolbarSearch->lineEdit()->selectAll();
-// m_toolbarSearch->lineEdit()->setFocus();
-}
-
-
-
-
void BrowserMainWindow::slotToggleInspector(bool enable)
{
QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, enable);
@@ -820,8 +764,6 @@ void BrowserMainWindow::slotToggleInspector(bool enable)
}
-
-
void BrowserMainWindow::slotSwapFocus()
{
if (currentTab()->hasFocus())
@@ -831,20 +773,17 @@ void BrowserMainWindow::slotSwapFocus()
}
-
void BrowserMainWindow::loadPage(const QString &page)
{
if (!currentTab() || page.isEmpty())
return;
- QUrl url = guessUrlFromString(page);
- m_tabWidget->currentLineEdit()->setText(url.toString());
+ KUrl url = guessUrlFromString(page);
+ m_tabWidget->currentLineEdit()->setText( url.prettyUrl() );
m_tabWidget->loadUrlInCurrentTab(url);
}
-
-
TabWidget *BrowserMainWindow::tabWidget() const
{
return m_tabWidget;
@@ -879,8 +818,6 @@ void BrowserMainWindow::slotLoadProgress(int progress)
}
-
-
void BrowserMainWindow::slotAboutToShowBackMenu()
{
m_historyBackMenu->clear();
@@ -901,7 +838,6 @@ void BrowserMainWindow::slotAboutToShowBackMenu()
}
-
void BrowserMainWindow::slotShowWindow()
{
if (KAction *action = qobject_cast<KAction*>(sender()))
@@ -918,8 +854,6 @@ void BrowserMainWindow::slotShowWindow()
}
-
-
void BrowserMainWindow::slotOpenActionUrl(QAction *action)
{
int offset = action->data().toInt();
@@ -953,6 +887,7 @@ void BrowserMainWindow::slotOpenNext()
history->goToItem( history->forwardItem() );
}
+
void BrowserMainWindow::geometryChangeRequested(const QRect &geometry)
{
setGeometry(geometry);