| 148 | }; |
| 149 | |
| 150 | KXMLGUIClient* ContextBrowserPlugin::createGUIForMainWindow(Sublime::MainWindow* window) |
| 151 | { |
| 152 | m_browseManager = new BrowseManager(this); |
| 153 | |
| 154 | KXMLGUIClient* ret = KDevelop::IPlugin::createGUIForMainWindow(window); |
| 155 | |
| 156 | connect( |
| 157 | ICore::self()->documentController(), &IDocumentController::documentJumpPerformed, this, |
| 158 | &ContextBrowserPlugin::documentJumpPerformed); |
| 159 | |
| 160 | m_previousButton = new QToolButton(); |
| 161 | m_previousButton->setToolTip(i18nc("@info:tooltip", "Go back in context history")); |
| 162 | m_previousButton->setAutoRaise(true); |
| 163 | m_previousButton->setPopupMode(QToolButton::MenuButtonPopup); |
| 164 | m_previousButton->setIcon(QIcon::fromTheme(QStringLiteral("go-previous"))); |
| 165 | m_previousButton->setEnabled(false); |
| 166 | m_previousButton->setFocusPolicy(Qt::NoFocus); |
| 167 | m_previousMenu = new QMenu(m_previousButton); |
| 168 | m_previousButton->setMenu(m_previousMenu); |
| 169 | connect(m_previousButton.data(), &QToolButton::clicked, this, &ContextBrowserPlugin::historyPrevious); |
| 170 | connect(m_previousMenu.data(), &QMenu::aboutToShow, this, &ContextBrowserPlugin::previousMenuAboutToShow); |
| 171 | |
| 172 | m_nextButton = new QToolButton(); |
| 173 | m_nextButton->setToolTip(i18nc("@info:tooltip", "Go forward in context history")); |
| 174 | m_nextButton->setAutoRaise(true); |
| 175 | m_nextButton->setPopupMode(QToolButton::MenuButtonPopup); |
| 176 | m_nextButton->setIcon(QIcon::fromTheme(QStringLiteral("go-next"))); |
| 177 | m_nextButton->setEnabled(false); |
| 178 | m_nextButton->setFocusPolicy(Qt::NoFocus); |
| 179 | m_nextMenu = new QMenu(m_nextButton); |
| 180 | m_nextButton->setMenu(m_nextMenu); |
| 181 | connect(m_nextButton.data(), &QToolButton::clicked, this, &ContextBrowserPlugin::historyNext); |
| 182 | connect(m_nextMenu.data(), &QMenu::aboutToShow, this, &ContextBrowserPlugin::nextMenuAboutToShow); |
| 183 | |
| 184 | auto* quickOpen = |
| 185 | KDevelop::ICore::self()->pluginController()->extensionForPlugin<IQuickOpen>(QStringLiteral( |
| 186 | "org.kdevelop.IQuickOpen")); |
| 187 | |
| 188 | if (quickOpen) { |
| 189 | m_outlineLine = quickOpen->createQuickOpenLine(QStringList(), QStringList(i18nc("item quick open item type", "Outline")), IQuickOpen::Outline); |
| 190 | m_outlineLine->setPlaceholderText(i18nc("@info:placeholder", "Outline")); |
| 191 | m_outlineLine->setToolTip(i18nc("@info:tooltip", "Navigate outline of active document, click to browse")); |
| 192 | } |
| 193 | |
| 194 | connect(m_browseManager, &BrowseManager::startDelayedBrowsing, |
| 195 | this, &ContextBrowserPlugin::startDelayedBrowsing); |
| 196 | connect(m_browseManager, &BrowseManager::stopDelayedBrowsing, |
| 197 | this, &ContextBrowserPlugin::stopDelayedBrowsing); |
| 198 | connect(m_browseManager, &BrowseManager::invokeAction, |
| 199 | this, &ContextBrowserPlugin::invokeAction); |
| 200 | |
| 201 | m_toolbarWidget = toolbarWidgetForMainWindow(window); |
| 202 | m_toolbarWidgetLayout = new QHBoxLayout; |
| 203 | m_toolbarWidgetLayout->setSizeConstraint(QLayout::SetMaximumSize); |
| 204 | m_previousButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); |
| 205 | m_nextButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); |
| 206 | m_toolbarWidgetLayout->setContentsMargins(0, 0, 0, 0); |
| 207 |
nothing calls this directly
no test coverage detected