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
Konsole
Commits
c02168f4
Commit
c02168f4
authored
May 26, 2022
by
Tomaz Canabrava
Committed by
Tomaz Canabrava
Jul 13, 2022
Browse files
Add option to not change the profile when acessing a SSH host
parent
33514818
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/SSHManager/sshmanagerpluginwidget.cpp
View file @
c02168f4
...
...
@@ -85,8 +85,9 @@ SSHManagerTreeWidget::SSHManagerTreeWidget(QWidget *parent)
d
->
filterModel
->
invalidate
();
});
ui
->
profile
->
setModel
(
Konsole
::
ProfileModel
::
instance
());
ui
->
profile
->
setModelColumn
(
Konsole
::
ProfileModel
::
PROFILE
);
connect
(
Konsole
::
ProfileModel
::
instance
(),
&
Konsole
::
ProfileModel
::
rowsRemoved
,
this
,
&
SSHManagerTreeWidget
::
updateProfileList
);
connect
(
Konsole
::
ProfileModel
::
instance
(),
&
Konsole
::
ProfileModel
::
rowsInserted
,
this
,
&
SSHManagerTreeWidget
::
updateProfileList
);
updateProfileList
();
ui
->
treeView
->
setContextMenuPolicy
(
Qt
::
CustomContextMenu
);
...
...
@@ -132,6 +133,20 @@ SSHManagerTreeWidget::SSHManagerTreeWidget(QWidget *parent)
SSHManagerTreeWidget
::~
SSHManagerTreeWidget
()
=
default
;
void
SSHManagerTreeWidget
::
updateProfileList
()
{
ui
->
profile
->
clear
();
ui
->
profile
->
addItem
(
i18n
(
"Don't Change"
));
auto
model
=
Konsole
::
ProfileModel
::
instance
();
for
(
int
i
=
0
,
end
=
model
->
rowCount
(
QModelIndex
());
i
<
end
;
i
++
)
{
const
int
column
=
Konsole
::
ProfileModel
::
Column
::
PROFILE
;
const
int
role
=
Qt
::
DisplayRole
;
const
QModelIndex
currIdx
=
model
->
index
(
i
,
column
);
const
auto
profileName
=
model
->
data
(
currIdx
,
role
).
toString
();
ui
->
profile
->
addItem
(
profileName
);
}
}
void
SSHManagerTreeWidget
::
addSshInfo
()
{
SSHConfigurationData
data
;
...
...
src/plugins/SSHManager/sshmanagerpluginwidget.h
View file @
c02168f4
...
...
@@ -65,6 +65,8 @@ public:
void
handleImportedData
(
bool
isImported
);
private:
void
updateProfileList
();
std
::
pair
<
bool
,
QString
>
checkFields
()
const
;
SSHConfigurationData
info
()
const
;
...
...
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