2011-01-03 Yi Shen <yi.4.shen@nokia.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Jan 2011 23:42:33 +0000 (23:42 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Jan 2011 23:42:33 +0000 (23:42 +0000)
        Reviewed by Adam Barth.

        [Qt] Add SelectAll option to the context menu for the editor
        https://bugs.webkit.org/show_bug.cgi?id=50049

        Set shortcut for the SelectAll action.

        * QtTestBrowser/mainwindow.cpp:
        (MainWindow::buildUI):
2011-01-03  Yi Shen  <yi.4.shen@nokia.com>

        Reviewed by Adam Barth.

        [Qt] Add SelectAll option to the context menu for the editor
        https://bugs.webkit.org/show_bug.cgi?id=50049

        Enable SelectAll for the Qt context menu.

        * page/ContextMenuController.cpp:
        (WebCore::ContextMenuController::populate):
        * platform/ContextMenuItem.h:
        * platform/LocalizationStrategy.h:
        * platform/LocalizedStrings.cpp:
        (WebCore::contextMenuItemTagSelectAll):
        * platform/LocalizedStrings.h:
2011-01-03  Yi Shen  <yi.4.shen@nokia.com>

        Reviewed by Adam Barth.

        [Qt] Add SelectAll option to the context menu for the editor
        https://bugs.webkit.org/show_bug.cgi?id=50049

        Enable SelectAll for the Qt context menu.

        * Api/qwebpage.cpp:
        (webActionForContextMenuAction):
        (QWebPage::action):
        * WebCoreSupport/WebPlatformStrategies.cpp:
        (WebPlatformStrategies::contextMenuItemTagSelectAll):
        * WebCoreSupport/WebPlatformStrategies.h:
2011-01-03  Yi Shen  <yi.4.shen@nokia.com>

        Reviewed by Adam Barth.

        [Qt] Add SelectAll option to the context menu for the editor
        https://bugs.webkit.org/show_bug.cgi?id=50049

        Add WebPlatformStrategies::contextMenuItemTagSelectAll for Qt.

        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
        (WebKit::WebPlatformStrategies::contextMenuItemTagSelectAll):
        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74941 268f45cc-cd09-0410-ab3c-d52691b4dbfc

15 files changed:
Tools/ChangeLog
Tools/QtTestBrowser/mainwindow.cpp
WebCore/ChangeLog
WebCore/page/ContextMenuController.cpp
WebCore/platform/ContextMenuItem.h
WebCore/platform/LocalizationStrategy.h
WebCore/platform/LocalizedStrings.cpp
WebCore/platform/LocalizedStrings.h
WebKit/qt/Api/qwebpage.cpp
WebKit/qt/ChangeLog
WebKit/qt/WebCoreSupport/WebPlatformStrategies.cpp
WebKit/qt/WebCoreSupport/WebPlatformStrategies.h
WebKit2/ChangeLog
WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp
WebKit2/WebProcess/WebCoreSupport/WebPlatformStrategies.h

index 4b841d8..90096b0 100644 (file)
@@ -1,3 +1,15 @@
+2011-01-03  Yi Shen  <yi.4.shen@nokia.com>
+
+        Reviewed by Adam Barth.
+
+        [Qt] Add SelectAll option to the context menu for the editor
+        https://bugs.webkit.org/show_bug.cgi?id=50049
+
+        Set shortcut for the SelectAll action.
+
+        * QtTestBrowser/mainwindow.cpp:
+        (MainWindow::buildUI):
+
 2011-01-03  David Levin  <levin@chromium.org>
 
         Reviewed by Eric Seidel.
index f361fa8..756c3c2 100644 (file)
@@ -95,6 +95,7 @@ void MainWindow::buildUI()
     page()->action(QWebPage::Cut)->setShortcut(QKeySequence::Cut);
     page()->action(QWebPage::Copy)->setShortcut(QKeySequence::Copy);
     page()->action(QWebPage::Paste)->setShortcut(QKeySequence::Paste);
+    page()->action(QWebPage::SelectAll)->setShortcut(QKeySequence::SelectAll);
 
     page()->action(QWebPage::ToggleBold)->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_B));
     page()->action(QWebPage::ToggleItalic)->setShortcut(QKeySequence(Qt::CTRL | Qt::Key_I));
index 279b989..f29a71c 100644 (file)
@@ -1,3 +1,20 @@
+2011-01-03  Yi Shen  <yi.4.shen@nokia.com>
+
+        Reviewed by Adam Barth.
+
+        [Qt] Add SelectAll option to the context menu for the editor
+        https://bugs.webkit.org/show_bug.cgi?id=50049
+
+        Enable SelectAll for the Qt context menu.
+
+        * page/ContextMenuController.cpp:
+        (WebCore::ContextMenuController::populate):
+        * platform/ContextMenuItem.h:
+        * platform/LocalizationStrategy.h:
+        * platform/LocalizedStrings.cpp:
+        (WebCore::contextMenuItemTagSelectAll):
+        * platform/LocalizedStrings.h:
+
 2011-01-03  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Darin Adler.
index 65399de..36d880d 100644 (file)
@@ -680,6 +680,8 @@ void ContextMenuController::populate()
     ContextMenuItem PasteItem(ActionType, ContextMenuItemTagPaste, contextMenuItemTagPaste());
 #if PLATFORM(GTK)
     ContextMenuItem DeleteItem(ActionType, ContextMenuItemTagDelete, contextMenuItemTagDelete());
+#endif
+#if PLATFORM(GTK) || PLATFORM(QT)
     ContextMenuItem SelectAllItem(ActionType, ContextMenuItemTagSelectAll, contextMenuItemTagSelectAll());
 #endif
 
@@ -862,6 +864,8 @@ void ContextMenuController::populate()
 #if PLATFORM(GTK)
         appendItem(DeleteItem, m_contextMenu.get());
         appendItem(*separatorItem(), m_contextMenu.get());
+#endif
+#if PLATFORM(GTK) || PLATFORM(QT)
         appendItem(SelectAllItem, m_contextMenu.get());
 #endif
 
index 64d9e4b..255750e 100644 (file)
@@ -76,7 +76,11 @@ namespace WebCore {
         ContextMenuItemTagPaste,
 #if PLATFORM(GTK)
         ContextMenuItemTagDelete,
+#endif
+#if PLATFORM(GTK) || PLATFORM(QT)
         ContextMenuItemTagSelectAll,
+#endif
+#if PLATFORM(GTK)
         ContextMenuItemTagInputMethods,
         ContextMenuItemTagUnicode,
 #endif
index 1fe138a..5596c81 100644 (file)
@@ -65,10 +65,12 @@ public:
     virtual String contextMenuItemTagPaste() = 0;
 #if PLATFORM(GTK)
     virtual String contextMenuItemTagDelete() = 0;
-    virtual String contextMenuItemTagSelectAll() = 0;
     virtual String contextMenuItemTagInputMethods() = 0;
     virtual String contextMenuItemTagUnicode() = 0;
 #endif
+#if PLATFORM(GTK) || PLATFORM(QT)
+    virtual String contextMenuItemTagSelectAll() = 0;
+#endif
     virtual String contextMenuItemTagNoGuessesFound() = 0;
     virtual String contextMenuItemTagIgnoreSpelling() = 0;
     virtual String contextMenuItemTagLearnSpelling() = 0;
index 8739c74..f342c6d 100644 (file)
@@ -144,6 +144,13 @@ String contextMenuItemTagPaste()
     return platformStrategies()->localizationStrategy()->contextMenuItemTagPaste();
 }
 
+#if PLATFORM(QT)
+String contextMenuItemTagSelectAll()
+{
+    return platformStrategies()->localizationStrategy()->contextMenuItemTagSelectAll();
+}
+#endif
+
 String contextMenuItemTagNoGuessesFound()
 {
     return platformStrategies()->localizationStrategy()->contextMenuItemTagNoGuessesFound();
index b168651..da0fe86 100644 (file)
@@ -61,10 +61,12 @@ namespace WebCore {
     String contextMenuItemTagPaste();
 #if PLATFORM(GTK)
     String contextMenuItemTagDelete();
-    String contextMenuItemTagSelectAll();
     String contextMenuItemTagInputMethods();
     String contextMenuItemTagUnicode();
 #endif
+#if PLATFORM(GTK) || PLATFORM(QT)
+    String contextMenuItemTagSelectAll();
+#endif
     String contextMenuItemTagNoGuessesFound();
     String contextMenuItemTagIgnoreSpelling();
     String contextMenuItemTagLearnSpelling();
index 16b5c78..d2e2c22 100644 (file)
@@ -418,6 +418,7 @@ static QWebPage::WebAction webActionForContextMenuAction(WebCore::ContextMenuAct
         case WebCore::ContextMenuItemTagBold: return QWebPage::ToggleBold;
         case WebCore::ContextMenuItemTagItalic: return QWebPage::ToggleItalic;
         case WebCore::ContextMenuItemTagUnderline: return QWebPage::ToggleUnderline;
+        case WebCore::ContextMenuItemTagSelectAll: return QWebPage::SelectAll;
 #if ENABLE(INSPECTOR)
         case WebCore::ContextMenuItemTagInspectElement: return QWebPage::InspectElement;
 #endif
@@ -2734,6 +2735,9 @@ QAction *QWebPage::action(WebAction action) const
         case Paste:
             text = contextMenuItemTagPaste();
             break;
+        case SelectAll:
+            text = contextMenuItemTagSelectAll();
+            break;
 #ifndef QT_NO_UNDOSTACK
         case Undo: {
             QAction *a = undoStack()->createUndoAction(d->q);
@@ -2782,9 +2786,6 @@ QAction *QWebPage::action(WebAction action) const
         case MoveToEndOfDocument:
             text = tr("Move the cursor to the end of the document");
             break;
-        case SelectAll:
-            text = tr("Select all");
-            break;
         case SelectNextChar:
             text = tr("Select to the next character");
             break;
index ecd6442..a57a323 100644 (file)
@@ -1,3 +1,19 @@
+2011-01-03  Yi Shen  <yi.4.shen@nokia.com>
+
+        Reviewed by Adam Barth.
+
+        [Qt] Add SelectAll option to the context menu for the editor
+        https://bugs.webkit.org/show_bug.cgi?id=50049
+
+        Enable SelectAll for the Qt context menu.
+
+        * Api/qwebpage.cpp:
+        (webActionForContextMenuAction):
+        (QWebPage::action):
+        * WebCoreSupport/WebPlatformStrategies.cpp:
+        (WebPlatformStrategies::contextMenuItemTagSelectAll):
+        * WebCoreSupport/WebPlatformStrategies.h:
+
 2011-01-03  Antonio Gomes  <agomes@rim.com>
 
         Unreviewed crash fix.
index 7cd255f..c67ec2f 100644 (file)
@@ -290,6 +290,11 @@ String WebPlatformStrategies::contextMenuItemTagPaste()
     return QCoreApplication::translate("QWebPage", "Paste", "Paste context menu item");
 }
 
+String WebPlatformStrategies::contextMenuItemTagSelectAll()
+{
+    return QCoreApplication::translate("QWebPage", "Select All", "Select All context menu item");
+}
+
 String WebPlatformStrategies::contextMenuItemTagNoGuessesFound()
 {
     return QCoreApplication::translate("QWebPage", "No Guesses Found", "No Guesses Found context menu item");
index ea366e0..5f72f46 100644 (file)
@@ -74,6 +74,7 @@ private:
     virtual WTF::String contextMenuItemTagReload();
     virtual WTF::String contextMenuItemTagCut();
     virtual WTF::String contextMenuItemTagPaste();
+    virtual WTF::String contextMenuItemTagSelectAll();
     virtual WTF::String contextMenuItemTagNoGuessesFound();
     virtual WTF::String contextMenuItemTagIgnoreSpelling();
     virtual WTF::String contextMenuItemTagLearnSpelling();
index c87f2c3..521dc87 100644 (file)
@@ -1,3 +1,16 @@
+2011-01-03  Yi Shen  <yi.4.shen@nokia.com>
+
+        Reviewed by Adam Barth.
+
+        [Qt] Add SelectAll option to the context menu for the editor
+        https://bugs.webkit.org/show_bug.cgi?id=50049
+
+        Add WebPlatformStrategies::contextMenuItemTagSelectAll for Qt.
+
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
+        (WebKit::WebPlatformStrategies::contextMenuItemTagSelectAll):
+        * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
+
 2011-01-03  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Anders Carlsson.
index 3809319..40f0032 100644 (file)
@@ -302,12 +302,6 @@ String WebPlatformStrategies::contextMenuItemTagDelete()
     return "Delete";
 }
 
-String WebPlatformStrategies::contextMenuItemTagSelectAll()
-{
-    notImplemented();
-    return "Select All";
-}
-
 String WebPlatformStrategies::contextMenuItemTagInputMethods()
 {
     notImplemented();
@@ -322,6 +316,16 @@ String WebPlatformStrategies::contextMenuItemTagUnicode()
 
 #endif
 
+#if PLATFORM(GTK) || PLATFORM(QT)
+
+String WebPlatformStrategies::contextMenuItemTagSelectAll()
+{
+    notImplemented();
+    return "Select All";
+}
+
+#endif
+
 String WebPlatformStrategies::contextMenuItemTagNoGuessesFound()
 {
     return UI_STRING("No Guesses Found", "No Guesses Found context menu item");
index aada9e0..b584f8d 100644 (file)
@@ -78,10 +78,12 @@ private:
     virtual String contextMenuItemTagPaste();
 #if PLATFORM(GTK)
     virtual String contextMenuItemTagDelete();
-    virtual String contextMenuItemTagSelectAll();
     virtual String contextMenuItemTagInputMethods();
     virtual String contextMenuItemTagUnicode();
 #endif
+#if PLATFORM(GTK) || PLATFORM(QT)
+    virtual String contextMenuItemTagSelectAll();
+#endif
     virtual String contextMenuItemTagNoGuessesFound();
     virtual String contextMenuItemTagIgnoreSpelling();
     virtual String contextMenuItemTagLearnSpelling();