summaryrefslogtreecommitdiff
path: root/src/webwindow
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2012-10-14 21:52:46 +0200
committerAndrea Diamantini <adjam7@gmail.com>2012-12-10 02:48:05 +0100
commit35cdc4f30f167037ef25f8f0a2d134cff74a599a (patch)
tree7a086a30651ad84d3bcfcb7a0710ef6f2f35de54 /src/webwindow
parentFix opening when there are no pinned tabs (diff)
downloadrekonq-35cdc4f30f167037ef25f8f0a2d134cff74a599a.tar.xz
clean up urlbar url loading. We really are lighter now :)
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();