diff --git a/src/Emulation.cpp b/src/Emulation.cpp index e1b485661cd9d7fd223b500e3e181f1ba520df35..9adbc72062d875c6ec0b0e674ab57c2971176b88 100644 --- a/src/Emulation.cpp +++ b/src/Emulation.cpp @@ -67,10 +67,11 @@ Emulation::Emulation() : _currentScreen(0), _codec(0), _decoder(0), - _keyTranslator(0) + _keyTranslator(0), + _usesMouse(false) { - //initialize screens with a default size + // create screens with a default size _screen[0] = new Screen(40,80); _screen[1] = new Screen(40,80); _currentScreen = _screen[0]; @@ -78,7 +79,22 @@ Emulation::Emulation() : QObject::connect(&_bulkTimer1, SIGNAL(timeout()), this, SLOT(showBulk()) ); QObject::connect(&_bulkTimer2, SIGNAL(timeout()), this, SLOT(showBulk()) ); - setKeyBindings(0); // Default keymap + // default keymap + setKeyBindings(0); + + // listen for mouse status changes + connect( this , SIGNAL(programUsesMouseChanged(bool)) , + SLOT(usesMouseChanged(bool)) ); +} + +bool Emulation::programUsesMouse() const +{ + return _usesMouse; +} + +void Emulation::usesMouseChanged(bool usesMouse) +{ + _usesMouse = usesMouse; } ScreenWindow* Emulation::createWindow() diff --git a/src/Emulation.h b/src/Emulation.h index 8a4e0585e926133ea2e674bd75a0fc621c04d997..e5aeb325c878d0d984db6f320f5d40e904840ede 100644 --- a/src/Emulation.h +++ b/src/Emulation.h @@ -427,8 +427,11 @@ private slots: // view void showBulk(); + void usesMouseChanged(bool usesMouse); + private: + bool _usesMouse; QTimer _bulkTimer1; QTimer _bulkTimer2; diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 4d0f85d5a0dc441de9bae064c0d9fdd02b7cd5aa..42a16a44aa602e274b71c5aff065f6eb9115f062 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -120,10 +120,7 @@ void MainWindow::activeViewChanged(SessionController* controller) connect( bookmarkHandler() , SIGNAL(openUrl(const KUrl&)) , controller , SLOT(openUrl(const KUrl&)) ); - // set the current session's search bar - controller->setSearchBar( searchBar() ); - controller->setShowMenuAction( _toggleMenuBarAction ); - + // listen for title changes from the current session if ( _pluggedController ) { @@ -139,6 +136,10 @@ void MainWindow::activeViewChanged(SessionController* controller) guiFactory()->addClient(controller); + // set the current session's search bar + controller->setSearchBar( searchBar() ); + controller->setShowMenuAction( _toggleMenuBarAction ); + // update session title to match newly activated session activeViewTitleChanged(controller); diff --git a/src/Session.cpp b/src/Session.cpp index 19887bd952994c6068a643cf8f24f7655e244dc9..b49aee0ba5d5b7de8c2ad11d3d182c440d69cd33 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -207,6 +207,8 @@ void Session::addView(TerminalDisplay* widget) // indicates whether or not it is interested in mouse signals connect( _emulation , SIGNAL(programUsesMouseChanged(bool)) , widget , SLOT(setUsesMouse(bool)) ); + + widget->setUsesMouse( _emulation->programUsesMouse() ); widget->setScreenWindow(_emulation->createWindow()); } diff --git a/src/SessionController.cpp b/src/SessionController.cpp index 15e404343e139d59bc6384a5fac81d0bd724fd42..21c719f8210cbb192fafb20a1ee6a5403c2d4acf 100644 --- a/src/SessionController.cpp +++ b/src/SessionController.cpp @@ -645,10 +645,12 @@ void SessionController::searchClosed() _searchToggleAction->toggle(); } +#if 0 void SessionController::searchHistory() { searchHistory(true); } +#endif // searchHistory() may be called either as a result of clicking a menu item or // as a result of changing the search bar widget