KNetAttach: Added SFTP connection type

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/519/head
Mavridis Philippe 7 months ago
parent e6fc9bed16
commit e610fb2466

@ -51,14 +51,6 @@
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>
</property> </property>
<widget class="TQRadioButton" row="4" column="0">
<property name="name">
<cstring>_recent</cstring>
</property>
<property name="text">
<string>&amp;Recent connection:</string>
</property>
</widget>
<widget class="TQRadioButton" row="0" column="0" rowspan="1" colspan="2"> <widget class="TQRadioButton" row="0" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>_webfolder</cstring> <cstring>_webfolder</cstring>
@ -70,18 +62,53 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="TQRadioButton" row="1" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>_ftp</cstring>
</property>
<property name="text">
<string>FT&amp;P</string>
</property>
</widget>
<widget class="TQRadioButton" row="2" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>_smb</cstring>
</property>
<property name="text">
<string>&amp;Microsoft® Windows® network drive</string>
</property>
</widget>
<widget class="TQRadioButton" row="3" column="0" rowspan="1" colspan="2"> <widget class="TQRadioButton" row="3" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>_sftp</cstring>
</property>
<property name="text">
<string>&amp;Secure shell (via SFTP)</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
<widget class="TQRadioButton" row="4" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>_fish</cstring> <cstring>_fish</cstring>
</property> </property>
<property name="text"> <property name="text">
<string>&amp;Secure shell (ssh)</string> <string>&amp;Secure shell (via FISH)</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
<widget class="KComboBox" row="4" column="1"> <widget class="TQRadioButton" row="5" column="0">
<property name="name">
<cstring>_recent</cstring>
</property>
<property name="text">
<string>&amp;Recent connection:</string>
</property>
</widget>
<widget class="KComboBox" row="5" column="1">
<property name="name"> <property name="name">
<cstring>_recentConnectionName</cstring> <cstring>_recentConnectionName</cstring>
</property> </property>
@ -103,22 +130,6 @@
</size> </size>
</property> </property>
</widget> </widget>
<widget class="TQRadioButton" row="1" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>_ftp</cstring>
</property>
<property name="text">
<string>FT&amp;P</string>
</property>
</widget>
<widget class="TQRadioButton" row="2" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>_smb</cstring>
</property>
<property name="text">
<string>&amp;Microsoft® Windows® network drive</string>
</property>
</widget>
</grid> </grid>
</widget> </widget>
<spacer row="3" column="0"> <spacer row="3" column="0">

@ -38,7 +38,7 @@ void KNetAttach::setInformationText( const TQString &type )
if (type=="WebFolder") { if (type=="WebFolder") {
text = i18n("Enter a name for this <i>WebFolder</i> as well as a server address, port and folder path to use and press the <b>Save & Connect</b> button."); text = i18n("Enter a name for this <i>WebFolder</i> as well as a server address, port and folder path to use and press the <b>Save & Connect</b> button.");
} else if (type=="Fish") { } else if (type=="Fish"||type=="SFTP") {
text = i18n("Enter a name for this <i>Secure shell connection</i> as well as a server address, port and folder path to use and press the <b>Save & Connect</b> button."); text = i18n("Enter a name for this <i>Secure shell connection</i> as well as a server address, port and folder path to use and press the <b>Save & Connect</b> button.");
} else if (type=="FTP") { } else if (type=="FTP") {
text = i18n("Enter a name for this <i>File Transfer Protocol connection</i> as well as a server address and folder path to use and press the <b>Save & Connect</b> button."); text = i18n("Enter a name for this <i>File Transfer Protocol connection</i> as well as a server address and folder path to use and press the <b>Save & Connect</b> button.");
@ -64,6 +64,10 @@ void KNetAttach::showPage( TQWidget *page )
setInformationText("Fish"); setInformationText("Fish");
updateForProtocol("Fish"); updateForProtocol("Fish");
_port->setValue(22); _port->setValue(22);
} else if (_sftp->isChecked()) {
setInformationText("SFTP");
updateForProtocol("SFTP");
_port->setValue(22);
} else if (_ftp->isChecked()) { } else if (_ftp->isChecked()) {
setInformationText("FTP"); setInformationText("FTP");
updateForProtocol("FTP"); updateForProtocol("FTP");
@ -139,6 +143,9 @@ void KNetAttach::finished()
} else if (_type == "Fish") { } else if (_type == "Fish") {
url.setProtocol("fish"); url.setProtocol("fish");
url.setPort(_port->value()); url.setPort(_port->value());
} else if (_type == "SFTP") {
url.setProtocol("sftp");
url.setPort(_port->value());
} else if (_type == "FTP") { } else if (_type == "FTP") {
url.setProtocol("ftp"); url.setProtocol("ftp");
url.setPort(_port->value()); url.setPort(_port->value());
@ -207,7 +214,7 @@ void KNetAttach::finished()
} }
recent.setGroup(name); recent.setGroup(name);
recent.writeEntry("URL", url.prettyURL()); recent.writeEntry("URL", url.prettyURL());
if (_type == "WebFolder" || _type == "Fish" || _type == "FTP") { if (_type == "WebFolder" || _type == "Fish" || _type == "SFTP" || _type == "FTP") {
recent.writeEntry("Port", _port->value()); recent.writeEntry("Port", _port->value());
} }
recent.writeEntry("Type", _type); recent.writeEntry("Type", _type);
@ -250,7 +257,7 @@ bool KNetAttach::updateForProtocol(const TQString& protocol)
_port->show(); _port->show();
_userText->show(); _userText->show();
_user->show(); _user->show();
} else if (protocol == "Fish") { } else if (protocol == "Fish" || protocol == "SFTP") {
_useEncryption->hide(); _useEncryption->hide();
_portText->show(); _portText->show();
_port->show(); _port->show();

Loading…
Cancel
Save