Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
de55c41c
Commit
de55c41c
authored
Jul 25, 2022
by
Pablo Rauzy
Committed by
Christoph Cullmann
Aug 14, 2022
Browse files
fixing oversimplifications
parent
dd11e707
Changes
3
Hide whitespace changes
Inline
Side-by-side
addons/keyboardmacro/keyboardmacrowidget.ui
deleted
100644 → 0
View file @
dd11e707
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
KeyboardMacroWidget
</class>
<widget
class=
"QDialog"
name=
"KeyboardMacroWidget"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
370
</width>
<height>
190
</height>
</rect>
</property>
<property
name=
"windowTitle"
>
<string>
Dialog
</string>
</property>
<layout
class=
"QVBoxLayout"
name=
"verticalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"lblFilter"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Minimum"
vsizetype=
"Preferred"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"text"
>
<string>
Enter command to
&
pipe selected text through:
</string>
</property>
<property
name=
"buddy"
>
<cstring>
filterBox
</cstring>
</property>
</widget>
</item>
<item>
<widget
class=
"KHistoryComboBox"
name=
"filterBox"
/>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"newDoc"
>
<property
name=
"text"
>
<string>
Open results in a new document
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"copyResult"
>
<property
name=
"toolTip"
>
<string>
Copy the result to clipboard leaving a document unchanged.
</string>
</property>
<property
name=
"text"
>
<string>
Copy the result instead of pasting it
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"mergeOutput"
>
<property
name=
"toolTip"
>
<string>
If checked, an output from STDOUT and STDERR will be merged and no errors will be reported.
Otherwise, STDERR will be displayed as a passive message.
</string>
</property>
<property
name=
"text"
>
<string>
Merge STDOUT and STDERR
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QDialogButtonBox"
name=
"buttonBox"
>
<property
name=
"standardButtons"
>
<set>
QDialogButtonBox::Cancel|QDialogButtonBox::Ok
</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>
KComboBox
</class>
<extends>
QComboBox
</extends>
<header>
kcombobox.h
</header>
</customwidget>
<customwidget>
<class>
KHistoryComboBox
</class>
<extends>
KComboBox
</extends>
<header>
khistorycombobox.h
</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>
buttonBox
</sender>
<signal>
accepted()
</signal>
<receiver>
KeyboardMacroWidget
</receiver>
<slot>
accept()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
177
</x>
<y>
136
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
182
</x>
<y>
118
</y>
</hint>
</hints>
</connection>
<connection>
<sender>
buttonBox
</sender>
<signal>
rejected()
</signal>
<receiver>
KeyboardMacroWidget
</receiver>
<slot>
reject()
</slot>
<hints>
<hint
type=
"sourcelabel"
>
<x>
326
</x>
<y>
141
</y>
</hint>
<hint
type=
"destinationlabel"
>
<x>
358
</x>
<y>
117
</y>
</hint>
</hints>
</connection>
</connections>
</ui>
addons/keyboardmacro/plugin_katekeyboardmacro.cpp
View file @
de55c41c
...
...
@@ -5,8 +5,8 @@
#include
"plugin_katekeyboardmacro.h"
#include
<
kt
ext
e
ditor/
e
ditor
.h
>
#include
<
kt
ext
e
ditor/
m
essage
.h
>
#include
<
KT
ext
E
ditor/
E
ditor>
#include
<
KT
ext
E
ditor/
M
essage>
#include
<KLocalizedString>
#include
<QAction>
...
...
@@ -14,12 +14,8 @@
#include
<KActionCollection>
#include
<KPluginFactory>
#include
<KSharedConfig>
#include
<KXMLGUIFactory>
#include
<QApplication>
#include
<QClipboard>
#include
<iostream>
K_PLUGIN_FACTORY_WITH_JSON
(
KeyboardMacroPluginFactory
,
"keyboardmacroplugin.json"
,
registerPlugin
<
PluginKateKeyboardMacro
>
();)
...
...
@@ -38,9 +34,10 @@ PluginKateKeyboardMacro::~PluginKateKeyboardMacro()
delete
m_runCommand
;
}
QObject
*
PluginKateKeyboardMacro
::
createView
(
KTextEditor
::
MainWindow
*
)
QObject
*
PluginKateKeyboardMacro
::
createView
(
KTextEditor
::
MainWindow
*
mainWindow
)
{
return
nullptr
;
m_mainWindow
=
mainWindow
;
return
new
PluginViewKateKeyboardMacro
(
this
,
mainWindow
);
}
bool
PluginKateKeyboardMacro
::
record
(
KTextEditor
::
View
*
)
...
...
@@ -173,10 +170,10 @@ PluginViewKateKeyboardMacro::PluginViewKateKeyboardMacro(PluginKateKeyboardMacro
connect
(
rec
,
&
QAction
::
triggered
,
plugin
,
&
PluginKateKeyboardMacro
::
slotRecord
);
// create run action
QAction
*
exec
=
actionCollection
()
->
addAction
(
QStringLiteral
(
"run_macro"
));
exec
->
setText
(
i18n
(
"&Run Macro"
));
actionCollection
()
->
setDefaultShortcut
(
exec
,
Qt
::
CTRL
|
Qt
::
ALT
|
Qt
::
Key_K
);
connect
(
exec
,
&
QAction
::
triggered
,
plugin
,
&
PluginKateKeyboardMacro
::
slotRun
);
QAction
*
run
=
actionCollection
()
->
addAction
(
QStringLiteral
(
"run_macro"
));
run
->
setText
(
i18n
(
"&Run Macro"
));
actionCollection
()
->
setDefaultShortcut
(
run
,
Qt
::
CTRL
|
Qt
::
ALT
|
Qt
::
Key_K
);
connect
(
run
,
&
QAction
::
triggered
,
plugin
,
&
PluginKateKeyboardMacro
::
slotRun
);
// register us at the UI
mainwindow
->
guiFactory
()
->
addClient
(
this
);
...
...
addons/keyboardmacro/plugin_katekeyboardmacro.h
View file @
de55c41c
...
...
@@ -8,7 +8,6 @@
#include
<KTextEditor/Application>
#include
<KTextEditor/Command>
#include
<KTextEditor/Document>
#include
<KTextEditor/MainWindow>
#include
<KTextEditor/Plugin>
#include
<KTextEditor/View>
...
...
@@ -28,13 +27,15 @@ public:
~
PluginKateKeyboardMacro
()
override
;
virtual
QObject
*
createView
(
KTextEditor
::
MainWindow
*
mainWindow
)
override
;
QObject
*
createView
(
KTextEditor
::
MainWindow
*
mainWindow
)
override
;
bool
record
(
KTextEditor
::
View
*
view
);
bool
run
(
KTextEditor
::
View
*
view
);
bool
isRecording
();
private:
KTextEditor
::
MainWindow
*
m_mainWindow
;
bool
m_recording
=
false
;
QString
m_macro
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment