Commit d15e0ce4 authored by Robert Knight's avatar Robert Knight

Make ViewManager emit a signal to request the creation of a new view rather...

Make ViewManager emit a signal to request the creation of a new view rather than accessing the menu item directly.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=711798
parent b4b1e1d4
......@@ -71,8 +71,9 @@ MainWindow::MainWindow()
connect( _viewManager , SIGNAL(viewPropertiesChanged(const QList<ViewProperties*>&)) ,
bookmarkHandler() , SLOT(setViews(const QList<ViewProperties*>&)) );
connect( _viewManager , SIGNAL(setMenuBarVisible(bool)) , menuBar() ,
connect( _viewManager , SIGNAL(setMenuBarVisibleRequest(bool)) , menuBar() ,
SLOT(setVisible(bool)) );
connect( _viewManager , SIGNAL(newViewRequest()) , this , SLOT(newTab()) );
// create main window widgets
setupWidgets();
......
......@@ -530,7 +530,7 @@ ViewContainer* ViewManager::createContainer(const QString& profileKey)
SLOT(map()) );
_containerSignalMapper->setMapping(container,container);
connect( container, SIGNAL(newViewRequest()), _actionCollection->action("new-tab"), SLOT(trigger()) );
connect( container, SIGNAL(newViewRequest()), this , SIGNAL(newViewRequest()) );
connect( container , SIGNAL(viewRemoved(QWidget*)) , this , SLOT(viewCloseRequest(QWidget*)) );
connect( container , SIGNAL(closeRequest(QWidget*)) , this , SLOT(viewCloseRequest(QWidget*)) );
connect( container , SIGNAL(activeViewChanged(QWidget*)) , this , SLOT(viewActivated(QWidget*)));
......@@ -611,7 +611,7 @@ void ViewManager::applyProfile(TerminalDisplay* view , const QString& profileKey
const ColorScheme* colorScheme = colorSchemeForProfile(profileKey);
// menu bar visibility
emit setMenuBarVisible( info->property(Profile::ShowMenuBar).value<bool>() );
emit setMenuBarVisibleRequest( info->property(Profile::ShowMenuBar).value<bool>() );
// tab bar visibility
ViewContainer* container = _viewSplitter->activeContainer();
......
......@@ -157,15 +157,26 @@ signals:
*/
void viewPropertiesChanged(const QList<ViewProperties*>& propertiesList);
// internal
// 'multipleViews' - true if the manager has multiple containers or false otherwise
/**
* Emitted when the number of views containers changes. This is used to disable or
* enable menu items which can only be used when there are one or multiple containers
* visible.
*
* @param multipleViews True if there are multiple view containers open or false if there is
* just a single view.
*/
void splitViewToggle(bool multipleViews);
/**
* Emitted when menu bar visibility changes because a profile that requires so is
* activated.
*/
void setMenuBarVisible(bool);
void setMenuBarVisibleRequest(bool);
/**
* Requests creation of a new view.
*/
void newViewRequest();
private slots:
// called when the "Split View Left/Right" menu item is selected
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment