parent
18f24e03ab
commit
03fab13c88
@ -0,0 +1,15 @@
|
||||
# lubuntu-connection-editor - A simple application for creating, removing, and modifying NetworkManager connections
|
||||
|
||||
This is a straightforward-as-possible Qt reimplmentation of the nm-connection-editor tool from GNOME. It uses NetworkManagerQt (from the KDE project) behind the scenes to do all the heavy lifting.
|
||||
|
||||
THIS PROJECT IS IN EARLY ALPHA. It may crash or eat your computer, so treat it with caution.
|
||||
|
||||
## Build instructions
|
||||
|
||||
sudo apt build-dep lubuntu-connection-editor
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make -j$(nproc)
|
||||
|
||||
Do not use `sudo make install` - this will bypass the apt package manager and possibly cause trouble. Instead, package this for your distribution following the guidelines and best practices of that distro. If building for Ubuntu, we recommend using either `debuild` (if working on Ubuntu packages is something you do rarely and you want something that's quick to set up) or `sbuild` (if you need to build packages all the time).
|
@ -0,0 +1,16 @@
|
||||
#include "connectionsettingsengine.h"
|
||||
|
||||
/*
|
||||
* The configuration map:
|
||||
*
|
||||
* autoconnectEnabled: bool
|
||||
* autoconnectPriority: int
|
||||
* allUsersMayConnect: bool
|
||||
* vpnAutoconnectEnabled: bool
|
||||
* autoconnectVpn: QString
|
||||
* meteredConnection: QString
|
||||
*/
|
||||
|
||||
ConnectionSettingsEngine::ConnectionSettingsEngine()
|
||||
{
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
#ifndef CONNECTIONSETTINGSENGINE_H
|
||||
#define CONNECTIONSETTINGSENGINE_H
|
||||
|
||||
#include <QString>
|
||||
#include <QVariant>
|
||||
|
||||
class ConnectionSettingsEngine
|
||||
{
|
||||
public:
|
||||
ConnectionSettingsEngine();
|
||||
|
||||
static QVariantMap readConnectionSettings(QString connUuidStr);
|
||||
static void modifyConnectionSettings(QString connUuidStr, QVariantMap settings);
|
||||
};
|
||||
|
||||
#endif // CONNECTIONSETTINGSENGINE_H
|
@ -1,15 +1,22 @@
|
||||
#include "ethernetsettings.h"
|
||||
#include "ui_ethernetsettings.h"
|
||||
#include "ui_genericsettings.h"
|
||||
|
||||
EthernetSettings::EthernetSettings(QString title, QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::EthernetSettings)
|
||||
ui(new Ui::GenericSettings)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setWindowTitle(title);
|
||||
ui->connectionNameLineEdit->setText(title);
|
||||
generalSettingsTab = new GeneralSettingsTab();
|
||||
ethernetSettingsTab = new EthernetSettingsTab();
|
||||
ui->tabWidget->addTab(generalSettingsTab, "General");
|
||||
ui->tabWidget->addTab(ethernetSettingsTab, "Ethernet");
|
||||
}
|
||||
|
||||
EthernetSettings::~EthernetSettings()
|
||||
{
|
||||
delete ui;
|
||||
delete generalSettingsTab;
|
||||
delete ethernetSettingsTab;
|
||||
}
|
||||
|
@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>EthernetSettings</class>
|
||||
<widget class="QDialog" name="EthernetSettings">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,14 @@
|
||||
#include "ethernetsettingstab.h"
|
||||
#include "ui_ethernetsettingstab.h"
|
||||
|
||||
EthernetSettingsTab::EthernetSettingsTab(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::EthernetSettingsTab)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
EthernetSettingsTab::~EthernetSettingsTab()
|
||||
{
|
||||
delete ui;
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
#ifndef ETHERNETSETTINGSTAB_H
|
||||
#define ETHERNETSETTINGSTAB_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
namespace Ui {
|
||||
class EthernetSettingsTab;
|
||||
}
|
||||
|
||||
class EthernetSettingsTab : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit EthernetSettingsTab(QWidget *parent = nullptr);
|
||||
~EthernetSettingsTab();
|
||||
|
||||
private:
|
||||
Ui::EthernetSettingsTab *ui;
|
||||
};
|
||||
|
||||
#endif // ETHERNETSETTINGSTAB_H
|
@ -0,0 +1,207 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>EthernetSettingsTab</class>
|
||||
<widget class="QWidget" name="EthernetSettingsTab">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>665</width>
|
||||
<height>238</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="deviceComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="linkNegotiationComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cloned MAC address</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QComboBox" name="duplexComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Link negotiation</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QComboBox" name="speedComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Device</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Duplex</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="clonedMacAddressComboBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>MTU</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Speed</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QSpinBox" name="mtuSpinBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>bytes</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,50 @@
|
||||
#include "generalsettingstab.h"
|
||||
#include "ui_generalsettingstab.h"
|
||||
|
||||
GeneralSettingsTab::GeneralSettingsTab(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::GeneralSettingsTab)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
GeneralSettingsTab::~GeneralSettingsTab()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
// Refer to connectionsettingsengine.cpp for configuration map details
|
||||
|
||||
QVariantMap GeneralSettingsTab::readSettings()
|
||||
{
|
||||
QVariantMap output;
|
||||
output.insert("autoconnectEnabled", QVariant(ui->autoconnectCheckBox->isChecked()));
|
||||
output.insert("autoconnectPriority", QVariant(ui->autoconnectPrioritySpinBox->value()));
|
||||
output.insert("allUsersMayConnect", QVariant(ui->allUsersMayConnectCheckBox->isChecked()));
|
||||
output.insert("vpnAutoconnectEnabled", QVariant(ui->vpnAutoconnectCheckBox->isChecked()));
|
||||
output.insert("autoconnectVpn", QVariant(ui->vpnSelectComboBox->currentText()));
|
||||
output.insert("meteredConnection", QVariant(ui->meteredConnectionComboBox->currentText()));
|
||||
return output;
|
||||
}
|
||||
|
||||
void GeneralSettingsTab::loadSettings(QVariantMap settings)
|
||||
{
|
||||
if (settings["autoconnectEnabled"].isValid()) {
|
||||
ui->autoconnectCheckBox->setChecked(settings["autoconnectEnabled"].toBool());
|
||||
}
|
||||
if (settings["autoconnectPriority"].isValid()) {
|
||||
ui->autoconnectPrioritySpinBox->setValue(settings["autoconnectPriority"].toInt());
|
||||
}
|
||||
if (settings["allUsersMayConnect"].isValid()) {
|
||||
ui->allUsersMayConnectCheckBox->setChecked(settings["allUsersMayConnect"].toBool());
|
||||
}
|
||||
if (settings["vpnAutoconnectEnabled"].isValid()) {
|
||||
ui->vpnAutoconnectCheckBox->setChecked(settings["vpnAutoconnectEnabled"].toBool());
|
||||
}
|
||||
if (settings["autoconnectVpn"].isValid()) {
|
||||
ui->vpnSelectComboBox->setCurrentText(settings["autoconnectVpn"].toString());
|
||||
}
|
||||
if (settings["meteredConnection"].isValid()) {
|
||||
ui->meteredConnectionComboBox->setCurrentText(settings["meteredConnection"].toString());
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
#ifndef GENERALSETTINGSTAB_H
|
||||
#define GENERALSETTINGSTAB_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QString>
|
||||
#include <QVariant>
|
||||
|
||||
namespace Ui {
|
||||
class GeneralSettingsTab;
|
||||
}
|
||||
|
||||
class GeneralSettingsTab : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit GeneralSettingsTab(QWidget *parent = nullptr);
|
||||
~GeneralSettingsTab();
|
||||
|
||||
QVariantMap readSettings();
|
||||
void loadSettings(QVariantMap settings);
|
||||
|
||||
private:
|
||||
Ui::GeneralSettingsTab *ui;
|
||||
};
|
||||
|
||||
#endif // GENERALSETTINGSTAB_H
|
@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>GeneralSettingsTab</class>
|
||||
<widget class="QWidget" name="GeneralSettingsTab">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="allUsersMayConnectCheckBox">
|
||||
<property name="text">
|
||||
<string>All users may connect to this network</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="autoconnectCheckBox">
|
||||
<property name="text">
|
||||
<string>Connect automatically with priority</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Metered connection:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="meteredConnectionComboBox"/>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QComboBox" name="vpnSelectComboBox"/>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="autoconnectPrioritySpinBox"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="vpnAutoconnectCheckBox">
|
||||
<property name="text">
|
||||
<string>Automatically connect to VPN</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>GenericSettings</class>
|
||||
<widget class="QDialog" name="GenericSettings">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Connection name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="connectionNameLineEdit"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cancel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Save</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Reference in new issue