Enable copy action only when some text are selected.

FEATURE: 203768
FIXED-IN: 4.8
This commit is contained in:
Jekyll Wu
2011-08-27 00:56:14 +08:00
parent 0ddf722e08
commit f5772ab06b
7 changed files with 57 additions and 0 deletions

View File

@@ -92,6 +92,8 @@ ScreenWindow* Emulation::createWindow()
connect(window , SIGNAL(selectionChanged()),
this , SLOT(bufferedUpdate()));
connect(window, SIGNAL(selectionChanged()),
this, SLOT(checkSelectedText()));
connect(this , SIGNAL(outputChanged()),
window , SLOT(notifyOutputChanged()) );
@@ -104,6 +106,12 @@ void Emulation::checkScreenInUse()
emit primaryScreenInUse( _currentScreen == _screen[0] );
}
void Emulation::checkSelectedText()
{
QString text = _currentScreen->selectedText(true);
emit selectedText(text);
}
Emulation::~Emulation()
{
QListIterator<ScreenWindow*> windowIter(_windows);
@@ -129,6 +137,7 @@ void Emulation::setScreen(int n)
window->setScreen(_currentScreen);
checkScreenInUse();
checkSelectedText();
}
}