summaryrefslogtreecommitdiffstats
path: root/knetattach
diff options
context:
space:
mode:
Diffstat (limited to 'knetattach')
-rw-r--r--knetattach/CMakeLists.txt2
-rw-r--r--knetattach/knetattach.ui71
-rw-r--r--knetattach/knetattach.ui.h23
-rw-r--r--knetattach/tdeconf_update/CMakeLists.txt18
-rw-r--r--knetattach/tdeconf_update/remote_folder_icon.upd2
-rwxr-xr-xknetattach/tdeconf_update/remote_folder_icon_upd.sh4
6 files changed, 82 insertions, 38 deletions
diff --git a/knetattach/CMakeLists.txt b/knetattach/CMakeLists.txt
index e5c4d7aa1..adf1ae32e 100644
--- a/knetattach/CMakeLists.txt
+++ b/knetattach/CMakeLists.txt
@@ -9,6 +9,8 @@
#
#################################################
+add_subdirectory( tdeconf_update )
+
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${TDE_INCLUDE_DIR}
diff --git a/knetattach/knetattach.ui b/knetattach/knetattach.ui
index 781643ff1..44504aff5 100644
--- a/knetattach/knetattach.ui
+++ b/knetattach/knetattach.ui
@@ -51,14 +51,6 @@
<property name="margin">
<number>0</number>
</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">
<property name="name">
<cstring>_webfolder</cstring>
@@ -70,18 +62,53 @@
<bool>true</bool>
</property>
</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">
<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">
<cstring>_fish</cstring>
</property>
<property name="text">
- <string>&amp;Secure shell (ssh)</string>
+ <string>&amp;Secure shell (via FISH)</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
</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">
<cstring>_recentConnectionName</cstring>
</property>
@@ -103,22 +130,6 @@
</size>
</property>
</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>
</widget>
<spacer row="3" column="0">
@@ -411,9 +422,9 @@
<include location="global" impldecl="in implementation">kiconloader.h</include>
<include location="global" impldecl="in implementation">tdelocale.h</include>
<include location="global" impldecl="in implementation">tdeglobalsettings.h</include>
- <include location="global" impldecl="in implementation">ksimpleconfig.h</include>
+ <include location="global" impldecl="in implementation">tdesimpleconfig.h</include>
<include location="global" impldecl="in implementation">tdeapplication.h</include>
- <include location="global" impldecl="in implementation">kstandarddirs.h</include>
+ <include location="global" impldecl="in implementation">tdestandarddirs.h</include>
<include location="global" impldecl="in implementation">kdirnotify_stub.h</include>
<include location="global" impldecl="in implementation">kcombobox.h</include>
<include location="global" impldecl="in implementation">klineedit.h</include>
@@ -424,7 +435,7 @@
<variables>
<variable access="private">TQString _type;</variable>
</variables>
-<Q_SLOTS>
+<slots>
<slot access="private">init()</slot>
<slot>setInformationText( const TQString &amp; type )</slot>
<slot access="private">showPage( TQWidget * page )</slot>
@@ -432,7 +443,7 @@
<slot access="private">finished()</slot>
<slot access="private">updatePort( bool encryption )</slot>
<slot access="private">updateFinishButtonText( bool save )</slot>
-</Q_SLOTS>
+</slots>
<functions>
<function access="private" returnType="bool">doConnectionTest( const KURL &amp; url )</function>
<function access="private" returnType="bool">updateForProtocol( const TQString &amp; protocol )</function>
diff --git a/knetattach/knetattach.ui.h b/knetattach/knetattach.ui.h
index f71240990..07678f2b5 100644
--- a/knetattach/knetattach.ui.h
+++ b/knetattach/knetattach.ui.h
@@ -13,8 +13,8 @@
void KNetAttach::init()
{
setIcon(SmallIcon("knetattach"));
- disconnect(finishButton(), TQT_SIGNAL(clicked()), (TQDialog*)this, TQT_SLOT(accept()));
- connect(finishButton(), TQT_SIGNAL(clicked()), this, TQT_SLOT(finished()));
+ disconnect(finishButton(), TQ_SIGNAL(clicked()), (TQDialog*)this, TQ_SLOT(accept()));
+ connect(finishButton(), TQ_SIGNAL(clicked()), this, TQ_SLOT(finished()));
finishButton()->setText(i18n("Save && C&onnect"));
//setResizeMode(Fixed); FIXME: make the wizard fixed-geometry
setFinishEnabled(_folderParameters, false);
@@ -38,7 +38,7 @@ void KNetAttach::setInformationText( const TQString &type )
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.");
- } 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.");
} 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.");
@@ -64,6 +64,10 @@ void KNetAttach::showPage( TQWidget *page )
setInformationText("Fish");
updateForProtocol("Fish");
_port->setValue(22);
+ } else if (_sftp->isChecked()) {
+ setInformationText("SFTP");
+ updateForProtocol("SFTP");
+ _port->setValue(22);
} else if (_ftp->isChecked()) {
setInformationText("FTP");
updateForProtocol("FTP");
@@ -139,6 +143,9 @@ void KNetAttach::finished()
} else if (_type == "Fish") {
url.setProtocol("fish");
url.setPort(_port->value());
+ } else if (_type == "SFTP") {
+ url.setProtocol("sftp");
+ url.setPort(_port->value());
} else if (_type == "FTP") {
url.setProtocol("ftp");
url.setPort(_port->value());
@@ -164,7 +171,7 @@ void KNetAttach::finished()
return;
}
- kapp->invokeBrowser(url.url());
+ tdeApp->invokeBrowser(url.url());
TQString name = _connectionName->text().stripWhiteSpace();
@@ -174,9 +181,9 @@ void KNetAttach::finished()
TQString path = TDEGlobal::dirs()->saveLocation("remote_entries");
path += name + ".desktop";
- KSimpleConfig desktopFile(path, false);
+ TDESimpleConfig desktopFile(path, false);
desktopFile.setGroup("Desktop Entry");
- desktopFile.writeEntry("Icon", "applications-internet");
+ desktopFile.writeEntry("Icon", "server");
desktopFile.writeEntry("Name", name);
desktopFile.writeEntry("Type", "Link");
desktopFile.writeEntry("URL", url.prettyURL());
@@ -207,7 +214,7 @@ void KNetAttach::finished()
}
recent.setGroup(name);
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("Type", _type);
@@ -250,7 +257,7 @@ bool KNetAttach::updateForProtocol(const TQString& protocol)
_port->show();
_userText->show();
_user->show();
- } else if (protocol == "Fish") {
+ } else if (protocol == "Fish" || protocol == "SFTP") {
_useEncryption->hide();
_portText->show();
_port->show();
diff --git a/knetattach/tdeconf_update/CMakeLists.txt b/knetattach/tdeconf_update/CMakeLists.txt
new file mode 100644
index 000000000..b32f6417c
--- /dev/null
+++ b/knetattach/tdeconf_update/CMakeLists.txt
@@ -0,0 +1,18 @@
+###############################################################################
+# #
+# Copyright © 2024 Mavridis Philippe <mavridisf@gmail.com #
+# #
+# Licensed under the terms of GNU General Public License v2 or later. #
+# Improvements are welcome! #
+# #
+###############################################################################
+
+install(
+ FILES remote_folder_icon.upd
+ DESTINATION ${KCONF_UPDATE_INSTALL_DIR}
+)
+
+install(
+ PROGRAMS remote_folder_icon_upd.sh
+ DESTINATION ${KCONF_UPDATE_INSTALL_DIR}
+) \ No newline at end of file
diff --git a/knetattach/tdeconf_update/remote_folder_icon.upd b/knetattach/tdeconf_update/remote_folder_icon.upd
new file mode 100644
index 000000000..66f75f96d
--- /dev/null
+++ b/knetattach/tdeconf_update/remote_folder_icon.upd
@@ -0,0 +1,2 @@
+Id=remote_folder_icon_update
+Script=remote_folder_icon_upd.sh \ No newline at end of file
diff --git a/knetattach/tdeconf_update/remote_folder_icon_upd.sh b/knetattach/tdeconf_update/remote_folder_icon_upd.sh
new file mode 100755
index 000000000..b859896ff
--- /dev/null
+++ b/knetattach/tdeconf_update/remote_folder_icon_upd.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+find "$HOME/.trinity/share/apps/remoteview" -type f -iname "*.desktop" -print0 2>/dev/null | \
+ xargs -r0 sed -ri "s|Icon=applications-internet|Icon=server|g" \ No newline at end of file