Changeset View
Changeset View
Standalone View
Standalone View
addons/konsole/kateconsole.cpp
Show First 20 Lines • Show All 125 Lines • ▼ Show 20 Line(s) | 123 | { | |||
---|---|---|---|---|---|
126 | 126 | | |||
127 | // make sure we have a vertical layout | 127 | // make sure we have a vertical layout | ||
128 | new QVBoxLayout(this); | 128 | new QVBoxLayout(this); | ||
129 | layout()->setContentsMargins(0, 0, 0, 0); | 129 | layout()->setContentsMargins(0, 0, 0, 0); | ||
130 | 130 | | |||
131 | QAction* a = actionCollection()->addAction(QStringLiteral("katekonsole_tools_pipe_to_terminal")); | 131 | QAction* a = actionCollection()->addAction(QStringLiteral("katekonsole_tools_pipe_to_terminal")); | ||
132 | a->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal"))); | 132 | a->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal"))); | ||
133 | a->setText(i18nc("@action", "&Pipe to Terminal")); | 133 | a->setText(i18nc("@action", "&Pipe to Terminal")); | ||
134 | connect(a, SIGNAL(triggered()), this, SLOT(slotPipeToConsole())); | 134 | connect(a, &QAction::triggered, this, &KateConsole::slotPipeToConsole); | ||
135 | | ||||
136 | a = actionCollection()->addAction(QStringLiteral("katekonsole_tools_sync")); | 135 | a = actionCollection()->addAction(QStringLiteral("katekonsole_tools_sync")); | ||
137 | a->setText(i18nc("@action", "S&ynchronize Terminal with Current Document")); | 136 | a->setText(i18nc("@action", "S&ynchronize Terminal with Current Document")); | ||
138 | connect(a, SIGNAL(triggered()), this, SLOT(slotManualSync())); | 137 | connect(a, &QAction::triggered, this, &KateConsole::slotManualSync); | ||
139 | 138 | | |||
140 | a = actionCollection()->addAction(QStringLiteral("katekonsole_tools_toggle_focus")); | 139 | a = actionCollection()->addAction(QStringLiteral("katekonsole_tools_toggle_focus")); | ||
141 | a->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal"))); | 140 | a->setIcon(QIcon::fromTheme(QStringLiteral("utilities-terminal"))); | ||
142 | a->setText(i18nc("@action", "&Focus Terminal")); | 141 | a->setText(i18nc("@action", "&Focus Terminal")); | ||
143 | connect(a, SIGNAL(triggered()), this, SLOT(slotToggleFocus())); | 142 | connect(a, &QAction::triggered, this, &KateConsole::slotToggleFocus); | ||
144 | 143 | | |||
145 | m_mw->guiFactory()->addClient (this); | 144 | m_mw->guiFactory()->addClient (this); | ||
146 | 145 | | |||
147 | readConfig(); | 146 | readConfig(); | ||
148 | } | 147 | } | ||
149 | 148 | | |||
150 | KateConsole::~KateConsole () | 149 | KateConsole::~KateConsole () | ||
151 | { | 150 | { | ||
152 | m_mw->guiFactory()->removeClient (this); | 151 | m_mw->guiFactory()->removeClient (this); | ||
153 | if (m_part) | 152 | if (m_part) | ||
154 | disconnect ( m_part, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) ); | 153 | disconnect(m_part, &KParts::ReadOnlyPart::destroyed, this, &KateConsole::slotDestroyed); | ||
155 | } | 154 | } | ||
156 | 155 | | |||
157 | void KateConsole::loadConsoleIfNeeded() | 156 | void KateConsole::loadConsoleIfNeeded() | ||
158 | { | 157 | { | ||
159 | if (m_part) return; | 158 | if (m_part) return; | ||
160 | 159 | | |||
161 | if (!window() || !parentWidget()) return; | 160 | if (!window() || !parentWidget()) return; | ||
162 | if (!window() || !isVisibleTo(window())) return; | 161 | if (!window() || !isVisibleTo(window())) return; | ||
Show All 15 Lines | |||||
178 | // start the terminal | 177 | // start the terminal | ||
179 | qobject_cast<TerminalInterface*>(m_part)->showShellInDir( QString() ); | 178 | qobject_cast<TerminalInterface*>(m_part)->showShellInDir( QString() ); | ||
180 | 179 | | |||
181 | // KGlobal::locale()->insertCatalog("konsole"); // FIXME KF5: insert catalog | 180 | // KGlobal::locale()->insertCatalog("konsole"); // FIXME KF5: insert catalog | ||
182 | 181 | | |||
183 | setFocusProxy(m_part->widget()); | 182 | setFocusProxy(m_part->widget()); | ||
184 | m_part->widget()->show(); | 183 | m_part->widget()->show(); | ||
185 | 184 | | |||
186 | connect ( m_part, SIGNAL(destroyed()), this, SLOT(slotDestroyed()) ); | 185 | connect(m_part, &KParts::ReadOnlyPart::destroyed, this, &KateConsole::slotDestroyed); | ||
187 | connect ( m_part, SIGNAL(overrideShortcut(QKeyEvent*,bool&)), | 186 | connect ( m_part, SIGNAL(overrideShortcut(QKeyEvent*,bool&)), | ||
188 | this, SLOT(overrideShortcut(QKeyEvent*,bool&))); | 187 | this, SLOT(overrideShortcut(QKeyEvent*,bool&))); | ||
189 | slotSync(); | 188 | slotSync(); | ||
190 | } | 189 | } | ||
191 | 190 | | |||
192 | void KateConsole::slotDestroyed () | 191 | void KateConsole::slotDestroyed () | ||
193 | { | 192 | { | ||
194 | m_part = nullptr; | 193 | m_part = nullptr; | ||
▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Line(s) | 336 | { | |||
342 | lo->addWidget( cbAutoSyncronize ); | 341 | lo->addWidget( cbAutoSyncronize ); | ||
343 | cbSetEditor = new QCheckBox( i18n("Set &EDITOR environment variable to 'kate -b'"), this ); | 342 | cbSetEditor = new QCheckBox( i18n("Set &EDITOR environment variable to 'kate -b'"), this ); | ||
344 | lo->addWidget( cbSetEditor ); | 343 | lo->addWidget( cbSetEditor ); | ||
345 | QLabel *tmp = new QLabel(this); | 344 | QLabel *tmp = new QLabel(this); | ||
346 | tmp->setText(i18n("Important: The document has to be closed to make the console application continue")); | 345 | tmp->setText(i18n("Important: The document has to be closed to make the console application continue")); | ||
347 | lo->addWidget(tmp); | 346 | lo->addWidget(tmp); | ||
348 | reset(); | 347 | reset(); | ||
349 | lo->addStretch(); | 348 | lo->addStretch(); | ||
350 | connect( cbAutoSyncronize, SIGNAL(stateChanged(int)), SIGNAL(changed()) ); | 349 | connect(cbAutoSyncronize, &QCheckBox::stateChanged, this, &KateKonsoleConfigPage::changed); | ||
351 | connect( cbSetEditor, SIGNAL(stateChanged(int)), SIGNAL(changed()) ); | 350 | connect(cbSetEditor, &QCheckBox::stateChanged, this, &KateKonsoleConfigPage::changed); | ||
352 | } | 351 | } | ||
353 | 352 | | |||
354 | QString KateKonsoleConfigPage::name() const | 353 | QString KateKonsoleConfigPage::name() const | ||
355 | { | 354 | { | ||
356 | return i18n("Terminal"); | 355 | return i18n("Terminal"); | ||
357 | } | 356 | } | ||
358 | 357 | | |||
359 | QString KateKonsoleConfigPage::fullName() const | 358 | QString KateKonsoleConfigPage::fullName() const | ||
Show All 29 Lines |