Changeset View
Changeset View
Standalone View
Standalone View
shell/mainwindow_p.cpp
Show First 20 Lines • Show All 425 Lines • ▼ Show 20 Line(s) | 425 | if (!it.key()->allowMultiple() && Core::self()->uiControllerInternal()->toolViewPresent(it.value(), m_mainWindow->area())) { | |||
---|---|---|---|---|---|
426 | action->setDisabled(true); | 426 | action->setDisabled(true); | ||
427 | } | 427 | } | ||
428 | actionToFactory.insert(action, it.key()); | 428 | actionToFactory.insert(action, it.key()); | ||
429 | actionMap[action->text()] = action; | 429 | actionMap[action->text()] = action; | ||
430 | } | 430 | } | ||
431 | menu.addActions(actionMap.values()); | 431 | menu.addActions(actionMap.values()); | ||
432 | } | 432 | } | ||
433 | 433 | | |||
434 | QAction* lockAction = new QAction(this); | ||||
435 | lockAction->setCheckable(true); | ||||
436 | lockAction->setText(i18n("Lock the Panel from Hiding")); | ||||
437 | | ||||
438 | KConfigGroup config = KSharedConfig::openConfig()->group("UI"); | ||||
439 | lockAction->setChecked(config.readEntry(QStringLiteral("Toolview Bar (%1) Is Locked").arg(area), false)); | ||||
440 | | ||||
441 | menu.addSeparator(); | ||||
442 | menu.addAction(lockAction); | ||||
443 | | ||||
434 | QAction* triggered = menu.exec(position); | 444 | QAction* triggered = menu.exec(position); | ||
435 | if ( !triggered ) { | 445 | if ( !triggered ) { | ||
436 | return; | 446 | return; | ||
437 | } | 447 | } | ||
448 | | ||||
449 | if (triggered == lockAction) { | ||||
450 | KConfigGroup config = KSharedConfig::openConfig()->group("UI"); | ||||
451 | config.writeEntry(QStringLiteral("Toolview Bar (%1) Is Locked").arg(area), lockAction->isChecked()); | ||||
452 | return; | ||||
453 | } | ||||
454 | | ||||
438 | Core::self()->uiControllerInternal()->addToolViewToDockArea( | 455 | Core::self()->uiControllerInternal()->addToolViewToDockArea( | ||
439 | actionToFactory[triggered], | 456 | actionToFactory[triggered], | ||
440 | area | 457 | area | ||
441 | ); | 458 | ); | ||
442 | } | 459 | } | ||
443 | 460 | | |||
444 | bool MainWindowPrivate::changingActiveView() const | 461 | bool MainWindowPrivate::changingActiveView() const | ||
445 | { | 462 | { | ||
Show All 12 Lines |