Changeset View
Changeset View
Standalone View
Standalone View
src/MainWindow.cpp
Show First 20 Lines • Show All 221 Lines • ▼ Show 20 Line(s) | 215 | { | |||
---|---|---|---|---|---|
222 | 222 | | |||
223 | // KXmlGuiFactory::removeClient() will try to access actions associated | 223 | // KXmlGuiFactory::removeClient() will try to access actions associated | ||
224 | // with the controller internally, which may not be valid after the controller | 224 | // with the controller internally, which may not be valid after the controller | ||
225 | // itself is no longer valid (after the associated session and or view have | 225 | // itself is no longer valid (after the associated session and or view have | ||
226 | // been destroyed) | 226 | // been destroyed) | ||
227 | if (controller->isValid()) { | 227 | if (controller->isValid()) { | ||
228 | guiFactory()->removeClient(controller); | 228 | guiFactory()->removeClient(controller); | ||
229 | } | 229 | } | ||
230 | | ||||
231 | controller->setSearchBar(nullptr); | | |||
232 | } | 230 | } | ||
233 | 231 | | |||
234 | void MainWindow::activeViewChanged(SessionController *controller) | 232 | void MainWindow::activeViewChanged(SessionController *controller) | ||
235 | { | 233 | { | ||
236 | // associate bookmark menu with current session | 234 | // associate bookmark menu with current session | ||
237 | bookmarkHandler()->setActiveView(controller); | 235 | bookmarkHandler()->setActiveView(controller); | ||
238 | disconnect(bookmarkHandler(), &Konsole::BookmarkHandler::openUrl, nullptr, nullptr); | 236 | disconnect(bookmarkHandler(), &Konsole::BookmarkHandler::openUrl, nullptr, nullptr); | ||
239 | connect(bookmarkHandler(), &Konsole::BookmarkHandler::openUrl, controller, | 237 | connect(bookmarkHandler(), &Konsole::BookmarkHandler::openUrl, controller, | ||
Show All 14 Lines | |||||
254 | connect(controller, &Konsole::SessionController::rawTitleChanged, this, | 252 | connect(controller, &Konsole::SessionController::rawTitleChanged, this, | ||
255 | &Konsole::MainWindow::updateWindowCaption); | 253 | &Konsole::MainWindow::updateWindowCaption); | ||
256 | connect(controller, &Konsole::SessionController::iconChanged, this, | 254 | connect(controller, &Konsole::SessionController::iconChanged, this, | ||
257 | &Konsole::MainWindow::updateWindowIcon); | 255 | &Konsole::MainWindow::updateWindowIcon); | ||
258 | 256 | | |||
259 | controller->setShowMenuAction(_toggleMenuBarAction); | 257 | controller->setShowMenuAction(_toggleMenuBarAction); | ||
260 | guiFactory()->addClient(controller); | 258 | guiFactory()->addClient(controller); | ||
261 | 259 | | |||
262 | // set the current session's search bar | | |||
263 | controller->setSearchBar(searchBar()); | | |||
264 | | ||||
265 | // update session title to match newly activated session | 260 | // update session title to match newly activated session | ||
266 | activeViewTitleChanged(controller); | 261 | activeViewTitleChanged(controller); | ||
267 | 262 | | |||
268 | // Update window icon to newly activated session's icon | 263 | // Update window icon to newly activated session's icon | ||
269 | updateWindowIcon(); | 264 | updateWindowIcon(); | ||
270 | } | 265 | } | ||
271 | 266 | | |||
272 | void MainWindow::activeViewTitleChanged(ViewProperties *properties) | 267 | void MainWindow::activeViewTitleChanged(ViewProperties *properties) | ||
Show All 31 Lines | |||||
304 | 299 | | |||
305 | void MainWindow::updateWindowIcon() | 300 | void MainWindow::updateWindowIcon() | ||
306 | { | 301 | { | ||
307 | if ((!_pluggedController.isNull()) && !_pluggedController->icon().isNull()) { | 302 | if ((!_pluggedController.isNull()) && !_pluggedController->icon().isNull()) { | ||
308 | setWindowIcon(_pluggedController->icon()); | 303 | setWindowIcon(_pluggedController->icon()); | ||
309 | } | 304 | } | ||
310 | } | 305 | } | ||
311 | 306 | | |||
312 | IncrementalSearchBar *MainWindow::searchBar() const | | |||
313 | { | | |||
314 | return _viewManager->searchBar(); | | |||
315 | } | | |||
316 | | ||||
317 | void MainWindow::setupActions() | 307 | void MainWindow::setupActions() | ||
318 | { | 308 | { | ||
319 | KActionCollection *collection = actionCollection(); | 309 | KActionCollection *collection = actionCollection(); | ||
320 | 310 | | |||
321 | // File Menu | 311 | // File Menu | ||
322 | _newTabMenuAction = new KActionMenu(QIcon::fromTheme(QStringLiteral("tab-new")), | 312 | _newTabMenuAction = new KActionMenu(QIcon::fromTheme(QStringLiteral("tab-new")), | ||
323 | i18nc("@action:inmenu", "&New Tab"), collection); | 313 | i18nc("@action:inmenu", "&New Tab"), collection); | ||
324 | collection->setDefaultShortcut(_newTabMenuAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_T); | 314 | collection->setDefaultShortcut(_newTabMenuAction, Konsole::ACCEL + Qt::SHIFT + Qt::Key_T); | ||
▲ Show 20 Lines • Show All 609 Lines • Show Last 20 Lines |