1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 12:46:35 +01:00

[popupwindow] Fixed copying text from locationbar.

This commit is contained in:
nowrep 2013-02-10 11:17:44 +01:00
parent 15f2471f93
commit 67d1a8af84
3 changed files with 18 additions and 2 deletions

View File

@ -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);

View File

@ -67,6 +67,7 @@ private slots:
void editSelectAll();
void aboutToShowEditMenu();
void aboutToHideEditMenu();
void savePageScreen();
void searchOnPage();

View File

@ -41,8 +41,8 @@
</p>
<p>
<p>
<a href="javascript:window.open('popup.html', '_blank', 'toolbar=yes')">Popup 8</a>
- with toolbar
<a href="javascript:window.open('form.html', '_blank', 'toolbar=yes')">Popup 8</a>
- with toolbar (form.html)
</p>
<p>
</body>