File indexing completed on 2024-04-14 04:53:29
0001 /* 0002 SPDX-FileCopyrightText: 2008 Urs Wolfer <uwolfer@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #include "rdpviewfactory.h" 0008 0009 #include <QStandardPaths> 0010 0011 #include <KPluginFactory> 0012 0013 K_PLUGIN_CLASS_WITH_JSON(RdpViewFactory, "krdc_rdp.json") 0014 0015 RdpViewFactory::RdpViewFactory(QObject *parent, const QVariantList &args) 0016 : RemoteViewFactory(parent) 0017 { 0018 Q_UNUSED(args); 0019 0020 KLocalizedString::setApplicationDomain("krdc"); 0021 0022 m_connectToolTipString = i18n("Connect to a Windows Remote Desktop (RDP)"); 0023 } 0024 0025 RdpViewFactory::~RdpViewFactory() 0026 { 0027 } 0028 0029 bool RdpViewFactory::supportsUrl(const QUrl &url) const 0030 { 0031 return (url.scheme().compare(QStringLiteral("rdp"), Qt::CaseInsensitive) == 0); 0032 } 0033 0034 RemoteView *RdpViewFactory::createView(QWidget *parent, const QUrl &url, KConfigGroup configGroup) 0035 { 0036 return new RdpView(parent, url, configGroup); 0037 } 0038 0039 HostPreferences *RdpViewFactory::createHostPreferences(KConfigGroup configGroup, QWidget *parent) 0040 { 0041 return new RdpHostPreferences(configGroup, parent); 0042 } 0043 0044 QString RdpViewFactory::scheme() const 0045 { 0046 return QStringLiteral("rdp"); 0047 } 0048 0049 QString RdpViewFactory::connectActionText() const 0050 { 0051 return i18n("New RDP Connection..."); 0052 } 0053 0054 QString RdpViewFactory::connectButtonText() const 0055 { 0056 return m_connectToolTipString; 0057 } 0058 0059 QString RdpViewFactory::connectToolTipText() const 0060 { 0061 return i18n( 0062 "<html>Enter the address here. Port is optional.<br />" 0063 "<i>Example: rdpserver:3389 (host:port)</i></html>"); 0064 } 0065 0066 #include "rdpviewfactory.moc"