Changeset View
Changeset View
Standalone View
Standalone View
src/panels/terminal/terminalpanel.cpp
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Line(s) | 141 | if (!m_terminal) { | |||
---|---|---|---|---|---|
144 | KService::Ptr service = KService::serviceByDesktopName(QStringLiteral("konsolepart")); | 144 | KService::Ptr service = KService::serviceByDesktopName(QStringLiteral("konsolepart")); | ||
145 | if (service) { | 145 | if (service) { | ||
146 | factory = KPluginLoader(service->library()).factory(); | 146 | factory = KPluginLoader(service->library()).factory(); | ||
147 | } | 147 | } | ||
148 | m_konsolePart = factory ? (factory->create<KParts::ReadOnlyPart>(this)) : nullptr; | 148 | m_konsolePart = factory ? (factory->create<KParts::ReadOnlyPart>(this)) : nullptr; | ||
149 | if (m_konsolePart) { | 149 | if (m_konsolePart) { | ||
150 | connect(m_konsolePart, &KParts::ReadOnlyPart::destroyed, this, &TerminalPanel::terminalExited); | 150 | connect(m_konsolePart, &KParts::ReadOnlyPart::destroyed, this, &TerminalPanel::terminalExited); | ||
151 | m_terminalWidget = m_konsolePart->widget(); | 151 | m_terminalWidget = m_konsolePart->widget(); | ||
152 | setFocusProxy(m_terminalWidget); | ||||
152 | m_layout->addWidget(m_terminalWidget); | 153 | m_layout->addWidget(m_terminalWidget); | ||
153 | if (m_konsolePartMissingMessage) { | 154 | if (m_konsolePartMissingMessage) { | ||
154 | m_layout->removeWidget(m_konsolePartMissingMessage); | 155 | m_layout->removeWidget(m_konsolePartMissingMessage); | ||
155 | } | 156 | } | ||
156 | m_terminal = qobject_cast<TerminalInterface*>(m_konsolePart); | 157 | m_terminal = qobject_cast<TerminalInterface*>(m_konsolePart); | ||
157 | } else if (!m_konsolePartMissingMessage) { | 158 | } else if (!m_konsolePartMissingMessage) { | ||
158 | const auto konsoleInstallUrl = QUrl("appstream://org.kde.konsole.desktop"); | 159 | const auto konsoleInstallUrl = QUrl("appstream://org.kde.konsole.desktop"); | ||
159 | const auto konsoleNotInstalledText = i18n("Terminal cannot be shown because Konsole is not installed. " | 160 | const auto konsoleNotInstalledText = i18n("Terminal cannot be shown because Konsole is not installed. " | ||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Line(s) | 258 | while (!m_sendCdToTerminalHistory.empty()) { | |||
258 | if (m_konsolePartCurrentDirectory == m_sendCdToTerminalHistory.dequeue()) { | 259 | if (m_konsolePartCurrentDirectory == m_sendCdToTerminalHistory.dequeue()) { | ||
259 | return; | 260 | return; | ||
260 | } | 261 | } | ||
261 | } | 262 | } | ||
262 | 263 | | |||
263 | const QUrl url(QUrl::fromLocalFile(dir)); | 264 | const QUrl url(QUrl::fromLocalFile(dir)); | ||
264 | emit changeUrl(url); | 265 | emit changeUrl(url); | ||
265 | } | 266 | } | ||
267 | | ||||
268 | bool TerminalPanel::terminalHasFocus() const | ||||
269 | { | ||||
270 | return m_terminalWidget->hasFocus(); | ||||
271 | } |