summaryrefslogtreecommitdiff
path: root/src/webwindow
diff options
context:
space:
mode:
Diffstat (limited to 'src/webwindow')
-rw-r--r--src/webwindow/webwindow.cpp33
-rw-r--r--src/webwindow/webwindow.h2
2 files changed, 26 insertions, 9 deletions
diff --git a/src/webwindow/webwindow.cpp b/src/webwindow/webwindow.cpp
index e76d1d5d..f7adb1b6 100644
--- a/src/webwindow/webwindow.cpp
+++ b/src/webwindow/webwindow.cpp
@@ -128,6 +128,8 @@ WebWindow::WebWindow(QWidget *parent, WebPage *pg)
connect(_tab->view(), SIGNAL(loadFinished(bool)), this, SLOT(webLoadFinished(bool)));
connect(_tab->view(), SIGNAL(loadProgress(int)), this, SLOT(webLoadProgress(int)));
+ connect(_bar, SIGNAL(focusIn()), this, SLOT(urlbarFocused()));
+
// page signals
connect(page(), SIGNAL(pageCreated(WebPage *)), this, SIGNAL(pageCreated(WebPage *)));
@@ -187,10 +189,7 @@ void WebWindow::setupActions()
m_loadStopReloadAction = new KAction(this);
actionCollection()->addAction(QL1S("load_stop_reload") , m_loadStopReloadAction);
m_loadStopReloadAction->setShortcutConfigurable(false);
-
- m_loadStopReloadAction->setIcon(KIcon("go-jump-locationbar"));
- m_loadStopReloadAction->setToolTip(i18n("Go"));
- m_loadStopReloadAction->setText(i18n("Go"));
+ urlbarFocused();
// new window action
a = new KAction(KIcon("window-new"), i18n("&New Window"), this);
@@ -362,15 +361,31 @@ void WebWindow::webLoadFinished(bool b)
{
emit loadFinished(b);
- m_loadStopReloadAction->setIcon(KIcon("view-refresh"));
- m_loadStopReloadAction->setToolTip(i18n("Reload the current page"));
- m_loadStopReloadAction->setText(i18n("Reload"));
- connect(m_loadStopReloadAction, SIGNAL(triggered(bool)), _tab->view(), SLOT(reload()));
-
+ if (_bar->hasFocus())
+ {
+ urlbarFocused();
+ }
+ else
+ {
+ m_loadStopReloadAction->setIcon(KIcon("view-refresh"));
+ m_loadStopReloadAction->setToolTip(i18n("Reload the current page"));
+ m_loadStopReloadAction->setText(i18n("Reload"));
+ connect(m_loadStopReloadAction, SIGNAL(triggered(bool)), _tab->view(), SLOT(reload()));
+ }
+
updateHistoryActions();
}
+void WebWindow::urlbarFocused()
+{
+ m_loadStopReloadAction->setIcon(KIcon("go-jump-locationbar"));
+ m_loadStopReloadAction->setToolTip(i18n("Go"));
+ m_loadStopReloadAction->setText(i18n("Go"));
+ connect(m_loadStopReloadAction, SIGNAL(triggered(bool)), _bar, SLOT(loadTypedUrl()));
+}
+
+
void WebWindow::aboutToShowBackMenu()
{
m_historyBackMenu->clear();
diff --git a/src/webwindow/webwindow.h b/src/webwindow/webwindow.h
index fa465ddc..a333f310 100644
--- a/src/webwindow/webwindow.h
+++ b/src/webwindow/webwindow.h
@@ -97,6 +97,8 @@ private Q_SLOTS:
void webLoadStarted();
void webLoadFinished(bool);
+ void urlbarFocused();
+
// history related
void aboutToShowBackMenu();
void aboutToShowForwardMenu();