Changeset View
Changeset View
Standalone View
Standalone View
src/MainWindow.cpp
Show All 15 Lines | 1 | /* | |||
---|---|---|---|---|---|
16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | ||
17 | 02110-1301 USA. | 17 | 02110-1301 USA. | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | // Own | 20 | // Own | ||
21 | #include "MainWindow.h" | 21 | #include "MainWindow.h" | ||
22 | 22 | | |||
23 | // Qt | 23 | // Qt | ||
24 | #include <QVBoxLayout> | 24 | #include <QVBoxLayout> | ||
hallas: I think this include can be removed now that the only user of it is gone :) | |||||
25 | 25 | | |||
26 | // KDE | 26 | // KDE | ||
27 | #include <KAcceleratorManager> | 27 | #include <KAcceleratorManager> | ||
28 | #include <KActionCollection> | 28 | #include <KActionCollection> | ||
29 | #include <KActionMenu> | 29 | #include <KActionMenu> | ||
30 | #include <KShortcutsDialog> | 30 | #include <KShortcutsDialog> | ||
31 | #include <KLocalizedString> | 31 | #include <KLocalizedString> | ||
32 | #include <KToggleAction> | 32 | #include <KToggleAction> | ||
▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Line(s) | 110 | connect(_viewManager, | |||
112 | this, | 112 | this, | ||
113 | &Konsole::MainWindow::newFromProfile); | 113 | &Konsole::MainWindow::newFromProfile); | ||
114 | connect(_viewManager, | 114 | connect(_viewManager, | ||
115 | static_cast<void (ViewManager::*)()>(&Konsole::ViewManager::newViewRequest), this, | 115 | static_cast<void (ViewManager::*)()>(&Konsole::ViewManager::newViewRequest), this, | ||
116 | &Konsole::MainWindow::newTab); | 116 | &Konsole::MainWindow::newTab); | ||
117 | connect(_viewManager, &Konsole::ViewManager::viewDetached, this, | 117 | connect(_viewManager, &Konsole::ViewManager::viewDetached, this, | ||
118 | &Konsole::MainWindow::viewDetached); | 118 | &Konsole::MainWindow::viewDetached); | ||
119 | 119 | | |||
120 | // create the main widget | 120 | setCentralWidget(_viewManager->widget()); | ||
121 | setupMainWidget(); | | |||
122 | 121 | | |||
123 | // disable automatically generated accelerators in top-level | 122 | // disable automatically generated accelerators in top-level | ||
124 | // menu items - to avoid conflicting with Alt+[Letter] shortcuts | 123 | // menu items - to avoid conflicting with Alt+[Letter] shortcuts | ||
125 | // in terminal applications | 124 | // in terminal applications | ||
126 | KAcceleratorManager::setNoAccel(menuBar()); | 125 | KAcceleratorManager::setNoAccel(menuBar()); | ||
127 | 126 | | |||
128 | // create menus | 127 | // create menus | ||
129 | createGUI(); | 128 | createGUI(); | ||
▲ Show 20 Lines • Show All 654 Lines • ▼ Show 20 Line(s) | 771 | { | |||
784 | 783 | | |||
785 | // First menu action should be 'File' | 784 | // First menu action should be 'File' | ||
786 | QAction *menuAction = menuActions.first(); | 785 | QAction *menuAction = menuActions.first(); | ||
787 | 786 | | |||
788 | // TODO: Handle when menubar is top level (MacOS) | 787 | // TODO: Handle when menubar is top level (MacOS) | ||
789 | menuBar()->setActiveAction(menuAction); | 788 | menuBar()->setActiveAction(menuAction); | ||
790 | } | 789 | } | ||
791 | 790 | | |||
792 | void MainWindow::setupMainWidget() | | |||
793 | { | | |||
794 | auto mainWindowWidget = new QWidget(this); | | |||
795 | auto mainWindowLayout = new QVBoxLayout(); | | |||
796 | | ||||
797 | mainWindowLayout->addWidget(_viewManager->widget()); | | |||
798 | mainWindowLayout->setContentsMargins(0, 0, 0, 0); | | |||
799 | mainWindowLayout->setSpacing(0); | | |||
800 | | ||||
801 | mainWindowWidget->setLayout(mainWindowLayout); | | |||
802 | | ||||
803 | setCentralWidget(mainWindowWidget); | | |||
804 | } | | |||
805 | | ||||
806 | void MainWindow::configureNotifications() | 791 | void MainWindow::configureNotifications() | ||
807 | { | 792 | { | ||
808 | KNotifyConfigWidget::configure(this); | 793 | KNotifyConfigWidget::configure(this); | ||
809 | } | 794 | } | ||
810 | 795 | | |||
811 | void MainWindow::setBlur(bool blur) | 796 | void MainWindow::setBlur(bool blur) | ||
812 | { | 797 | { | ||
813 | if (_pluggedController.isNull()) { | 798 | if (_pluggedController.isNull()) { | ||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |
I think this include can be removed now that the only user of it is gone :)