summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-11-19 01:32:04 +0100
committerAndrea Diamantini <adjam7@gmail.com>2010-11-19 01:32:04 +0100
commitfe21365ffafb922a6b24959f3d1096e4c6171427 (patch)
tree7380e1486a65ab57e39a663442876ff1912715d3 /src/mainwindow.cpp
parentAPI clean up (diff)
downloadrekonq-fe21365ffafb922a6b24959f3d1096e4c6171427.tar.xz
Print && Find actions for the parts :)
- handle print & find with different signals in mainwindow - show right tab title (moving titleChanged signal from view to tab)
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 5f508506..f662d7aa 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -72,6 +72,9 @@
#include <KStandardDirs>
#include <KToggleFullScreenAction>
+#include <KParts/Part>
+#include <KParts/BrowserExtension>
+
// Qt Includes
#include <QtCore/QTimer>
@@ -707,6 +710,25 @@ void MainWindow::printRequested(QWebFrame *frame)
if (!currentTab())
return;
+ if(currentTab()->page()->isOnRekonqPage())
+ {
+ // trigger print part action instead of ours..
+ KParts::ReadOnlyPart *p = currentTab()->part();
+ if(p)
+ {
+ KParts::BrowserExtension *ext = p->browserExtension();
+ if(ext)
+ {
+ KParts::BrowserExtension::ActionSlotMap *actionSlotMap = KParts::BrowserExtension::actionSlotMapPtr();
+
+ connect(this, SIGNAL(triggerPartPrint()), ext, actionSlotMap->value("print"));
+ emit triggerPartPrint();
+
+ return;
+ }
+ }
+ }
+
QWebFrame *printFrame = 0;
if (frame == 0)
{
@@ -753,6 +775,18 @@ void MainWindow::findNext()
if (!currentTab())
return;
+ if(currentTab()->page()->isOnRekonqPage())
+ {
+ // trigger part find action
+ KParts::ReadOnlyPart *p = currentTab()->part();
+ if(p)
+ {
+ connect(this, SIGNAL(triggerPartFind()), p, SLOT(slotFind()));
+ emit triggerPartFind();
+ return;
+ }
+ }
+
if (m_findBar->isHidden())
{
QPoint previous_position = currentTab()->view()->page()->currentFrame()->scrollPosition();