[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

eric at webkit.org eric at webkit.org
Thu Oct 29 20:39:26 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 98a890e6ae332242afe4dcf224ada5fd48dc887f
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 5 23:03:21 2009 +0000

    2009-10-05  Girish Ramakrishnan  <girish at forwardbias.in>
    
            Reviewed by Simon Hausmann.
    
            Add screenshot option to menubar
    
            https://bugs.webkit.org/show_bug.cgi?id=30067
    
            * QtLauncher/main.cpp:
            (MainWindow::screenshot):
            (MainWindow::setupUI):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49124 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index c84ebea..dbaa5a2 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -2,6 +2,18 @@
 
         Reviewed by Simon Hausmann.
 
+        Add screenshot option to menubar
+
+        https://bugs.webkit.org/show_bug.cgi?id=30067
+
+        * QtLauncher/main.cpp:
+        (MainWindow::screenshot):
+        (MainWindow::setupUI):
+
+2009-10-05  Girish Ramakrishnan  <girish at forwardbias.in>
+
+        Reviewed by Simon Hausmann.
+
         Setting the env QTLAUNCHER_USE_ARGB_VISUALS makes Qt use WA_TranslucentWindow.
 
         https://bugs.webkit.org/show_bug.cgi?id=30068
diff --git a/WebKit/qt/QtLauncher/main.cpp b/WebKit/qt/QtLauncher/main.cpp
index 394b6a4..83fa97c 100644
--- a/WebKit/qt/QtLauncher/main.cpp
+++ b/WebKit/qt/QtLauncher/main.cpp
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2009 Girish Ramakrishnan <girish at forwardbias.in>
  * Copyright (C) 2006 George Staikos <staikos at kde.org>
  * Copyright (C) 2006 Dirk Mueller <mueller at kde.org>
  * Copyright (C) 2006 Zack Rusin <zack at kde.org>
@@ -210,6 +211,22 @@ protected slots:
 #endif
     }
 
+    void screenshot()
+    {
+        QPixmap pixmap = QPixmap::grabWidget(view);
+        QLabel* label = new QLabel;
+        label->setAttribute(Qt::WA_DeleteOnClose);
+        label->setWindowTitle("Screenshot - Preview");
+        label->setPixmap(pixmap);
+        label->show();
+
+        QString fileName = QFileDialog::getSaveFileName(label, "Screenshot");
+        if (!fileName.isEmpty()) {
+            pixmap.save(fileName, "png");
+            label->setWindowTitle(QString("Screenshot - Saved at %1").arg(fileName));
+        }
+    }
+
     void setEditable(bool on) {
         view->page()->setContentEditable(on);
         formatMenuAction->setVisible(on);
@@ -277,6 +294,7 @@ private:
 #if QT_VERSION >= 0x040400
         fileMenu->addAction(tr("Print"), this, SLOT(print()));
 #endif
+        QAction* screenshot = fileMenu->addAction("Screenshot", this, SLOT(screenshot()));
         fileMenu->addAction("Close", this, SLOT(close()));
 
         QMenu *editMenu = menuBar()->addMenu("&Edit");
@@ -315,6 +333,7 @@ private:
         writingMenu->addAction(view->pageAction(QWebPage::SetTextDirectionRightToLeft));
 
         newWindow->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_N));
+        screenshot->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_S));
         view->pageAction(QWebPage::Back)->setShortcut(QKeySequence::Back);
         view->pageAction(QWebPage::Stop)->setShortcut(Qt::Key_Escape);
         view->pageAction(QWebPage::Forward)->setShortcut(QKeySequence::Forward);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list