Commit f997b451 authored by Jan Grulich's avatar Jan Grulich

Drop the old legacy connection editor

It has been replaced by the new KCM module in Plasma 5.9 and it is just
basically redundant
parent c5e02189
......@@ -84,7 +84,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR} # for config.h
${CMAKE_CURRENT_SOURCE_DIR}/libs/editor/)
add_subdirectory(applet)
add_subdirectory(editor)
add_subdirectory(kded)
add_subdirectory(kcm)
add_subdirectory(libs)
......
include_directories(${CMAKE_SOURCE_DIR}/libs/editor
${CMAKE_SOURCE_DIR}/libs/editor/widgets
${CMAKE_SOURCE_DIR}/libs/models)
set(connectioneditor_SRCS
../libs/debug.cpp
connectioneditor.cpp
main.cpp
)
ki18n_wrap_ui(connectioneditor_SRCS
ui/connectioneditor.ui
)
add_executable(kde5-nm-connection-editor ${connectioneditor_SRCS})
target_link_libraries(kde5-nm-connection-editor
plasmanm_internal
plasmanm_editor
Qt5::Widgets
Qt5::Network
Qt5::DBus
KF5::NetworkManagerQt
KF5::Service
KF5::Completion
KF5::I18n
KF5::WidgetsAddons
KF5::KIOCore
KF5::KIOWidgets
KF5::CoreAddons
KF5::Wallet
KF5::ItemViews
KF5::XmlGui
KF5::DBusAddons
)
if (WITH_MODEMMANAGER_SUPPORT)
target_link_libraries(kde5-nm-connection-editor KF5::ModemManagerQt)
endif()
install(TARGETS kde5-nm-connection-editor DESTINATION ${INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS kde5-nm-connection-editor.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install(FILES kde5-nm-connection-editorui.rc DESTINATION ${KXMLGUI_INSTALL_DIR}/kde5-nm-connection-editor)
#! /usr/bin/env bash
$EXTRACTRC `find . -name "*.ui" -o -name "*.rc"` >> rc.cpp
$XGETTEXT `find . -name "*.cpp"` -o $podir/kde5-nm-connection-editor.pot
rm -f rc.cpp
This diff is collapsed.
/*
Copyright 2013 Lukas Tinkl <ltinkl@redhat.com>
Copyright 2013-2014 Jan Grulich <jgrulich@redhat.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) version 3, or any
later version accepted by the membership of KDE e.V. (or its
successor approved by the membership of KDE e.V.), which shall
act as a proxy defined in Section 6 of version 3 of the license.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PLASMA_NM_CONNECTION_EDITOR_H
#define PLASMA_NM_CONNECTION_EDITOR_H
#include "handler.h"
#include <QMenu>
#include <QModelIndex>
#include <QItemSelection>
#include <KXmlGuiWindow>
#include <KActionMenu>
#include <NetworkManagerQt/Connection>
namespace Ui
{
class ConnectionEditor;
}
class QTreeWidgetItem;
class ConnectionEditor : public KXmlGuiWindow
{
Q_OBJECT
public:
explicit ConnectionEditor(QWidget* parent = 0, Qt::WindowFlags flags = 0);
virtual ~ConnectionEditor();
void importVpnAtPath(const QString &path);
public Q_SLOTS:
void activateAndRaise();
private Q_SLOTS:
void addConnection(QAction * action);
void connectionAdded(const QString & connection);
void connectConnection();
void dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight, const QVector<int> & roles = QVector<int> ());
void disconnectConnection();
void editConnection();
void exportVpn();
void importVpn();
void initializeConnections();
void removeConnection();
void slotContextMenuRequested(const QPoint& point);
void slotSelectionChanged();
void slotItemDoubleClicked(const QModelIndex& index);
private:
Ui::ConnectionEditor * m_editor;
Handler * m_handler;
KActionMenu * m_menu;
QTimer *m_timer;
void addConnection(const NetworkManager::ConnectionSettings::Ptr &connectionSettings);
void initializeMenu();
void importSecretsFromPlainTextFiles();
void storeSecrets(const QMap<QString, QMap<QString, QString> > & map);
};
#endif // PLASMA_NM_CONNECTION_EDITOR_H
[Desktop Entry]
Name=kde5-nm-connection-editor
Name[bs]=kde5-nm-editor-konekcije
Name[ca]=kde5-nm-connection-editor
Name[ca@valencia]=kde5-nm-connection-editor
Name[cs]=kde5-nm-connection-editor
Name[da]=kde5-nm-connection-editor
Name[de]=KDE5-NM-Verbindungseditor
Name[el]=kde5-nm-connection-editor
Name[en_GB]=kde5-nm-connection-editor
Name[es]=kde5-nm-connection-editor
Name[et]=kde5-nm-connection-editor
Name[eu]=kde5-nm-connection-editor
Name[fi]=kde5-nm-connection-editor
Name[fr]=kde5-nm-connection-editor
Name[gl]=kde5-nm-connection-editor
Name[hu]=kde5-nm-connection-editor
Name[it]=kde5-nm-connection-editor
Name[ko]=kde5-nm-connection-editor
Name[lt]=kde5-nm-connection-editor
Name[nb]=kde5-nm-connection-editor
Name[nds]=NM-Verbinnenpleger för KDE-5
Name[nl]=Bewerker van verbindingen voor kde5-nm
Name[nn]=kde5-nm-connection-editor
Name[pa]=kde5-nm-connection-editor
Name[pl]=kde5-nm-connection-editor
Name[pt]=kde5-nm-connection-editor
Name[pt_BR]=kde5-nm-connection-editor
Name[ru]=kde5-nm-connection-editor
Name[sk]=kde5-nm-connection-editor
Name[sl]=kde5-nm-connection-editor
Name[sr]=kde5-nm-connection-editor
Name[sr@ijekavian]=kde5-nm-connection-editor
Name[sr@ijekavianlatin]=kde5-nm-connection-editor
Name[sr@latin]=kde5-nm-connection-editor
Name[sv]=kde5-nm-connection-editor
Name[tr]=kde5-nm-connection-editor
Name[uk]=Редактор з’єднань kde5-nm
Name[x-test]=xxkde5-nm-connection-editorxx
Name[zh_CN]=kde5-nm-connection-editor
Name[zh_TW]=kde5-nm-connection-editor
GenericName=Connection editor
GenericName[ar]=محرّر الاتّصالات
GenericName[bg]=Редактор на мрежи
GenericName[bs]=Uređivač konekcije
GenericName[ca]=Editor de la connexió
GenericName[ca@valencia]=Editor de la connexió
GenericName[cs]=Editor spojení
GenericName[da]=Forbindelseseditor
GenericName[de]=Verbindungs-Editor
GenericName[el]=Επεξεργαστής συνδέσεων
GenericName[en_GB]=Connection editor
GenericName[es]=Editor de conexiones
GenericName[et]=Ühenduste muutja
GenericName[eu]=Konexio-editorea
GenericName[fi]=Yhteysmuokkain
GenericName[fr]=Éditeur de connexion
GenericName[gl]=Editor de conexións
GenericName[he]=עורך חיבורים
GenericName[hu]=Kapcsolatszerkesztő
GenericName[ia]=Editor de connexion
GenericName[it]=Editor delle connessioni
GenericName[ko]=연결 편집기
GenericName[lt]=Ryšio tvarkyklė
GenericName[nb]=Tilkoblingsredigering
GenericName[nds]=Verbinneneditor
GenericName[nl]=Bewerker van verbindingen
GenericName[nn]=Tilkoplingredigering
GenericName[pa]=ਕਨੈਕਸ਼ਨ ਐਡੀਟਰ
GenericName[pl]=Edytor połączenia
GenericName[pt]=Editor de ligações
GenericName[pt_BR]=Editor de conexão
GenericName[ro]=Redactor de conexiuni
GenericName[ru]=Редактор соединений
GenericName[sk]=Editor pripojení
GenericName[sl]=Urejevalnik povezav
GenericName[sr]=Уређивач веза
GenericName[sr@ijekavian]=Уређивач веза
GenericName[sr@ijekavianlatin]=Uređivač veza
GenericName[sr@latin]=Uređivač veza
GenericName[sv]=Anslutningseditor
GenericName[tr]=Bağlantı düzenleyici
GenericName[uk]=Редактор з’єднань
GenericName[x-test]=xxConnection editorxx
GenericName[zh_CN]=连接编辑器
GenericName[zh_TW]=連線編輯器
Comment=Edit your network connections
Comment[ar]=حرّر اتّصالاتك الشّبكيّة
Comment[bg]=Управление на мрежовите връзки
Comment[bs]=Uredi mrežne konekcije
Comment[ca]=Edita les vostres connexions de xarxa
Comment[ca@valencia]=Edita les vostres connexions de xarxa
Comment[cs]=Upravit vaše síťová spojení
Comment[da]=Redigér dine netværksforbindelser
Comment[de]=Bearbeiten Sie Ihre Netzwerkverbindungen
Comment[el]=Επεξεργασία των συνδέσεων δικτύου
Comment[en_GB]=Edit your network connections
Comment[es]=Editar las conexiones de red
Comment[et]=Võrguühenduste muutmine
Comment[eu]=Editatu zure sareko konexioak
Comment[fi]=Verkkoyhteyksiesi muokkaus
Comment[fr]=Modifier vos connexions réseau
Comment[gl]=Edite as súas conexións de rede
Comment[he]=ערוך את חיבורי הרשת שלך
Comment[hu]=A hálózati kapcsolatok szerkesztése
Comment[ia]=Modifica tu connexiones de rete
Comment[it]=Modifica le tue connessioni di rete
Comment[ko]=네트워크 연결 편집
Comment[lt]=Tvarkykite savo tinklo ryšius
Comment[mr]=तुमच्या संजाळ जुळवण्या संपादित करा
Comment[nb]=Rediger dine nettverkstilkoblinger
Comment[nds]=Dien Nettwarkverbinnen bewerken
Comment[nl]=Bewerk uw netwerkverbindingen
Comment[nn]=Rediger nettverkstilkoplingar
Comment[pa]=ਆਪਣੇ ਨੈੱਟਵਰਕ ਕਨੈਕਸ਼ਨਾਂ ਨੂੰ ਸੋਧੋ
Comment[pl]=Edytuj swoje połączenia sieciowe
Comment[pt]=Edite as suas ligações de rede
Comment[pt_BR]=Edite as suas conexões de rede
Comment[ro]=Redactați-vă conexiunile de rețea
Comment[ru]=Настройка сетевых соединений
Comment[sk]=Upraviť vaše sieťové pripojenia
Comment[sl]=Uredite vaše omrežne povezave
Comment[sr]=Уређујте мрежне везе
Comment[sr@ijekavian]=Уређујте мрежне везе
Comment[sr@ijekavianlatin]=Uređujte mrežne veze
Comment[sr@latin]=Uređujte mrežne veze
Comment[sv]=Redigera dina nätverksanslutningar
Comment[tr]=Ağ bağlantılarınızı düzenleyin
Comment[uk]=Редагування ваших записів з’єднань з мережею
Comment[x-test]=xxEdit your network connectionsxx
Comment[zh_CN]=编辑您的网络连接
Comment[zh_TW]=編輯您的網路連線
Exec=kde5-nm-connection-editor
Icon=preferences-system-network
Type=Application
Terminal=false
X-DBUS-StartupType=Unique
X-DBUS-ServiceName=org.kde.kde5-nm-connection-editor
Categories=Qt;KDE;Network;
NoDisplay=true
<?xml version="1.0" encoding="UTF-8"?>
<gui name="kde-nm-connection-editor"
version="5"
xmlns="http://www.kde.org/standards/kxmlgui/1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0
http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd" >
<MenuBar>
<Menu name="connection">
<text>Connection</text>
<Action name="connect_connection" />
<Action name="disconnect_connection" />
<Action name="add_connection" />
<Action name="edit_connection" />
<Action name="delete_connection" />
<Action name="import_vpn" />
<Action name="export_vpn" />
</Menu>
</MenuBar>
<ToolBar name="mainToolBar" >
<text>Main Toolbar</text>
<Action name="add_connection" />
<Separator/>
<Action name="connect_connection" />
<Action name="disconnect_connection" />
<Action name="edit_connection" />
<Action name="delete_connection" />
</ToolBar>
</gui>
/*
Copyright 2013-2014 Jan Grulich <jgrulich@redhat.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) version 3, or any
later version accepted by the membership of KDE e.V. (or its
successor approved by the membership of KDE e.V.), which shall
act as a proxy defined in Section 6 of version 3 of the license.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "connectioneditor.h"
#include <config.h>
#include <KAboutData>
#include <KLocalizedString>
#include <KDBusService>
#include <QApplication>
#include <QCommandLineParser>
#include <NetworkManagerQt/Manager>
int main(int argc, char *argv[])
{
KLocalizedString::setApplicationDomain("kde5-nm-connection-editor");
QApplication app(argc, argv);
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("preferences-system-network")));
KAboutData about(QStringLiteral("kde5-nm-connection-editor"), i18n("Connection editor"),
PLASMA_NM_VERSION_STRING, i18n("Manage your network connections"),
KAboutLicense::GPL, i18n("(C) 2013-2015 Jan Grulich and Lukáš Tinkl"),
i18n("This application allows you to create, edit and delete network connections.\n\nUsing NM version: %1", NetworkManager::version()));
about.addAuthor(i18n("Jan Grulich"), i18n("Developer"), QStringLiteral("jgrulich@redhat.com"));
about.addAuthor(i18n("Lukáš Tinkl"), i18n("Developer"), QStringLiteral("ltinkl@redhat.com"));
about.addCredit(i18n("Lamarque Souza"), i18n("libnm-qt author"), QStringLiteral("lamarque@kde.org"));
about.addCredit(i18n("Daniel Nicoletti"), i18n("various bugfixes"), QStringLiteral("dantti12@gmail.com"));
about.addCredit(i18n("Will Stephenson"), i18n("VPN plugins"), QStringLiteral("wstephenson@kde.org"));
about.addCredit(i18n("Ilia Kats"), i18n("VPN plugins"), QStringLiteral("ilia-kats@gmx.net"));
about.setProductName(QByteArrayLiteral("plasma-nm/editor"));
KAboutData::setApplicationData(about);
KDBusService service(KDBusService::Unique);
QCommandLineParser parser;
QCommandLineOption importVpnOption(QStringLiteral("import-vpn"), i18n("Import VPN Connection"), QStringLiteral("path"));
parser.addOption(importVpnOption);
parser.addHelpOption();
parser.addVersionOption();
about.setupCommandLine(&parser);
parser.process(app);
about.processCommandLine(&parser);
ConnectionEditor * editor = new ConnectionEditor();
if (parser.isSet(importVpnOption)) {
editor->importVpnAtPath(parser.value(importVpnOption));
}
editor->show();
QObject::connect(&service, &KDBusService::activateRequested, editor, &ConnectionEditor::activateAndRaise);
return app.exec();
}
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ConnectionEditor</class>
<widget class="QWidget" name="ConnectionEditor">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>552</width>
<height>561</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Connection Editor</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="KMessageWidget" name="messageWidget" native="true"/>
</item>
<item>
<widget class="KFilterProxySearchLine" name="ktreewidgetsearchline"/>
</item>
<item>
<widget class="QTreeView" name="connectionsWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KFilterProxySearchLine</class>
<extends>QWidget</extends>
<header>kfilterproxysearchline.h</header>
</customwidget>
<customwidget>
<class>KMessageWidget</class>
<extends>QWidget</extends>
<header>kmessagewidget.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>ktreewidgetsearchline</tabstop>
<tabstop>connectionsWidget</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>
......@@ -394,13 +394,6 @@ void Handler::enableWwan(bool enable)
NetworkManager::setWwanEnabled(enable);
}
// void Handler::editConnection(const QString& uuid)
// {
// QStringList args;
// args << uuid;
// KProcess::startDetached("kde5-nm-connection-editor", args);
// }
void Handler::removeConnection(const QString& connection)
{
NetworkManager::Connection::Ptr con = NetworkManager::findConnection(connection);
......@@ -434,11 +427,6 @@ void Handler::updateConnection(const NetworkManager::Connection::Ptr& connection
connect(watcher, &QDBusPendingCallWatcher::finished, this, &Handler::replyFinished);
}
void Handler::openEditor()
{
KProcess::startDetached("kde5-nm-connection-editor");
}
void Handler::requestScan()
{
Q_FOREACH (NetworkManager::Device::Ptr device, NetworkManager::networkInterfaces()) {
......
......@@ -91,11 +91,6 @@ public Q_SLOTS:
#endif
void enableWwan(bool enable);
// /**
// * Opens connection editor for given connection
// * @uuid - uuid of the connection you want to edit
// */
// void editConnection(const QString & uuid);
/**
* Removes given connection
* @connection - d-bus path of the connection you want to edit
......@@ -107,7 +102,6 @@ public Q_SLOTS:
* @map - NMVariantMapMap with new connection settings
*/
void updateConnection(const NetworkManager::Connection::Ptr &connection, const NMVariantMapMap &map);
void openEditor();
void requestScan();
private Q_SLOTS:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment