From 67d1a8af84afe8fe5aeacae645543dfb995578ee Mon Sep 17 00:00:00 2001 From: nowrep Date: Sun, 10 Feb 2013 11:17:44 +0100 Subject: [PATCH] [popupwindow] Fixed copying text from locationbar. --- src/lib/popupwindow/popupwindow.cpp | 15 +++++++++++++++ src/lib/popupwindow/popupwindow.h | 1 + tests/popupwindows.html | 4 ++-- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/lib/popupwindow/popupwindow.cpp b/src/lib/popupwindow/popupwindow.cpp index 21025080b..0db49ee6c 100644 --- a/src/lib/popupwindow/popupwindow.cpp +++ b/src/lib/popupwindow/popupwindow.cpp @@ -78,6 +78,7 @@ PopupWindow::PopupWindow(PopupWebView* view) m_menuEdit->addAction(QIcon::fromTheme("edit-select-all"), tr("Select All"), m_view, SLOT(selectAll()))->setShortcut(QKeySequence("Ctrl+A")); m_menuEdit->addAction(QIcon::fromTheme("edit-find"), tr("Find"), this, SLOT(searchOnPage()))->setShortcut(QKeySequence("Ctrl+F")); connect(m_menuEdit, SIGNAL(aboutToShow()), this, SLOT(aboutToShowEditMenu())); + connect(m_menuEdit, SIGNAL(aboutToHide()), this, SLOT(aboutToHideEditMenu())); m_menuBar->addMenu(m_menuEdit); m_menuView = new QMenu(tr("View")); @@ -108,6 +109,8 @@ PopupWindow::PopupWindow(PopupWebView* view) m_layout->addWidget(m_statusBar); setLayout(m_layout); + aboutToHideEditMenu(); + connect(m_view, SIGNAL(showNotification(QWidget*)), this, SLOT(showNotification(QWidget*))); connect(m_view, SIGNAL(titleChanged(QString)), this, SLOT(titleChanged())); connect(m_view, SIGNAL(urlChanged(QUrl)), m_locationBar, SLOT(showUrl(QUrl))); @@ -230,6 +233,18 @@ void PopupWindow::aboutToShowEditMenu() m_menuEdit->actions().at(7)->setEnabled(m_view->pageAction(QWebPage::SelectAll)->isEnabled()); } +void PopupWindow::aboutToHideEditMenu() +{ + m_menuEdit->actions().at(0)->setEnabled(false); + m_menuEdit->actions().at(1)->setEnabled(false); + // Separator + m_menuEdit->actions().at(3)->setEnabled(false); + m_menuEdit->actions().at(4)->setEnabled(false); + m_menuEdit->actions().at(5)->setEnabled(false); + // Separator + m_menuEdit->actions().at(7)->setEnabled(false); +} + void PopupWindow::savePageScreen() { PageScreen* pageScreen = new PageScreen(m_view, this); diff --git a/src/lib/popupwindow/popupwindow.h b/src/lib/popupwindow/popupwindow.h index 0d702e501..d9daf3a84 100644 --- a/src/lib/popupwindow/popupwindow.h +++ b/src/lib/popupwindow/popupwindow.h @@ -67,6 +67,7 @@ private slots: void editSelectAll(); void aboutToShowEditMenu(); + void aboutToHideEditMenu(); void savePageScreen(); void searchOnPage(); diff --git a/tests/popupwindows.html b/tests/popupwindows.html index a256817e5..e9ba1ac75 100644 --- a/tests/popupwindows.html +++ b/tests/popupwindows.html @@ -41,8 +41,8 @@

-Popup 8 -- with toolbar +Popup 8 +- with toolbar (form.html)