Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
2b1da5ec
Commit
2b1da5ec
authored
Jan 30, 2007
by
Robert Knight
Browse files
Update window caption when session title changes.
svn path=/branches/work/konsole-split-view/; revision=628527
parent
c383d7aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
konsole/ViewManager.cpp
View file @
2b1da5ec
...
...
@@ -155,18 +155,31 @@ void ViewManager::viewActivated( QWidget* view )
view
->
setFocus
(
Qt
::
OtherFocusReason
);
}
void
ViewManager
::
activeViewTitleChanged
(
ViewProperties
*
properties
)
{
// set a plain caption (ie. without the automatic addition of " - AppName" at the end)
// to make the taskbar entry cleaner and easier to read
_mainWindow
->
setPlainCaption
(
properties
->
title
()
);
}
void
ViewManager
::
viewFocused
(
SessionController
*
controller
)
{
if
(
_pluggedController
!=
controller
)
{
if
(
_pluggedController
)
{
_mainWindow
->
guiFactory
()
->
removeClient
(
_pluggedController
);
disconnect
(
controller
,
SIGNAL
(
titleChanged
(
ViewProperties
*
)),
this
,
SLOT
(
activeViewTitleChanged
(
ViewProperties
*
))
);
}
// update the menus in the main window to use the actions from the active
// controller
_mainWindow
->
guiFactory
()
->
addClient
(
controller
);
// update the caption of the main window to match that of the focused session
_mainWindow
->
setPlainCaption
(
controller
->
session
()
->
displayTitle
()
);
connect
(
controller
,
SIGNAL
(
titleChanged
(
ViewProperties
*
)),
this
,
SLOT
(
activeViewTitleChanged
(
ViewProperties
*
))
);
_pluggedController
=
controller
;
...
...
@@ -274,7 +287,7 @@ ViewContainer* ViewManager::createContainer()
// connect signals and slots
connect( container , SIGNAL(closeRequest(QWidget*)) , this , SLOT(viewCloseRequest(QWidget*)) );
*/
ViewContainer
*
container
=
new
List
ViewContainer
(
_viewSplitter
);
ViewContainer
*
container
=
new
Stacked
ViewContainer
(
_viewSplitter
);
connect
(
container
,
SIGNAL
(
activeViewChanged
(
QWidget
*
))
,
this
,
SLOT
(
viewActivated
(
QWidget
*
)));
return
container
;
...
...
konsole/ViewManager.h
View file @
2b1da5ec
...
...
@@ -32,6 +32,7 @@ class TESession;
class
TEWidget
;
class
SessionController
;
class
ViewProperties
;
class
ViewContainer
;
class
ViewSplitter
;
...
...
@@ -97,6 +98,8 @@ private slots:
// that we can plug the appropriate actions into the UI
void
viewActivated
(
QWidget
*
view
);
// called when the title of the active view changes
void
activeViewTitleChanged
(
ViewProperties
*
);
private:
void
setupActions
();
void
focusActiveView
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment