Commit c9169540 authored by Alf Gaida's avatar Alf Gaida

Cherry-picked upstream version 2018.01.06.

parent f3d8b07c
cmst
====
QT GUI for Connman with system tray icon.
The program provides graphical user interface to control the connman daemon. The connman daemon
must be started as you normally would, this program just interfaces with that daemon. You can see
what technologies and services connman has found, and for wifi services an agent is registered to
assist in obtaining the information from you necessary to logon the wifi service.
As of 2016.01.26 support for VPN connections (create, edit, delete, connect and disconnect) has been added. It is also possible to import an OpenVPN .opvn file. The import function will scan the .opvn file extracting and saving keys and certificates, and then place the proper lines into the provisioning editor.
The program requires that connman be installed and running. The program depends on QT5, but only the base package.
The [Wiki](https://github.com/andrew-bibb/cmst/wiki) has been started and announcements, news, and other information can be found there.
[Screen shots:](https://github.com/andrew-bibb/cmst/wiki/Screenshots) are now included in the Wiki
There is a PKGBUILD for this project in the Arch Linux AUR.
The Provisioning Editor and VPN Provisioning Editor both register a root helper to assist in editing files in directories owned by root (/var/lib/connman and /var/lib/connman-vpn). In order to use the root helper you must be a member of the proper group, and this group varies by distribution. To get the proper file for your distribution you need to provide it on the qmake line. Currently there are files for Arch Linux, Slackware, and Debian. If you are on Arch you don't actually need to supply the distro as that is the default if one is not supplied, but it is not wrong to do so.
If you are not on Arch or don't choose to use the AUR download the release and extract the files. Then run:
qmake DISTRO=xxxx
make
make install (as root)
Where xxx is one of [arch, debian, slackware). Distro names are case sensitive.
Development Status: The program is really kind of feature complete as of October 2016. There are several ConnMan features we've not implemented but they are all currently marked experimental. As a rule we've tried to avoid these, although we have made exceptions. I still subscribe to the ConnMan developer mailing list to keep an eye on what is happening there and will update this program accordingly. If there is a feature you need or want, either a ConnMan feature or in the CMST UI, please do not hesitate to open up an issue about it.
......@@ -4,7 +4,7 @@
Code for the user agent registered on DBus. When the connman daemon
needs to communicate with the user it does so through this agent.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -3,7 +3,7 @@
Code for the user agent registered on DBus. When the connman daemon
needs to communicate with the user it does so through this agent.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -5,7 +5,7 @@ needs to communicate with the user it does so through the agent. The
agent has a QDialog as a class member, and agent_dialog.cpp manages
that dialog.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -5,7 +5,7 @@ needs to communicate with the user it does so through the agent. The
agent has a QDialog as a class member, and agent_dialog.cpp manages
that dialog.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -3,7 +3,7 @@
Code to manage the primary user interface to include the QDialog the
user interfaces with and the system tray icon.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......@@ -100,6 +100,7 @@ class ControlBox : public QDialog
public slots:
void aboutCMST();
void aboutIconSet();
void aboutOtherArt();
void showLicense();
void showChangeLog();
......
......@@ -3,7 +3,7 @@
Code for the connection counter registered on DBus. When registered the
connman daemon will communicate to this object with signals.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -3,7 +3,7 @@
Code for the connection counter registered on DBus. When registered the
connman daemon will communicate to this object with signals.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -3,7 +3,7 @@
Class to manage icons and allow the user to provide substitutions based
on the the system theme.
Copyright (C) 2015-2017
Copyright (C) 2015-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -3,7 +3,7 @@
Class to manage icons and allow the user to provide substitutions based
on the the system theme.
Copyright (C) 2015-2017
Copyright (C) 2015-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -2,7 +2,7 @@
C++ main routine.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......@@ -83,8 +83,8 @@ int main(int argc, char *argv[])
QCoreApplication::translate("main.cpp", "Bypass restoring any start options in the settings file.") );
parser.addOption(bypassStartOptions);
QCommandLineOption disableCounters(QStringList() << "c" << "disable-counters",
QCoreApplication::translate("main.cpp", "[Experimental] Disable data counters. May be used to minimize load on your system.") );
QCommandLineOption disableCounters(QStringList() << "c" << "enable-counters",
QCoreApplication::translate("main.cpp", "[Experimental] Enable data counters.") );
parser.addOption(disableCounters);
QCommandLineOption disableTrayIcon(QStringList() << "d" << "disable-tray-icon",
......
......@@ -3,7 +3,7 @@
Code for a notify client to interface with a desktop notification
server.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -3,7 +3,7 @@
Code for a notify client to interface with a desktop notification
server.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -2,7 +2,7 @@
Code to manage the Properties Editor dialog.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......@@ -49,6 +49,13 @@ PropertiesEditor::PropertiesEditor(QWidget* parent, const arrayElement& ae)
sl_ipv6_privacy << "disabled" << "enabled" << "prefered"; // misspelling prefered is necessary
sl_proxy_method << "direct" << "auto" << "manual";
// connect signals to slots
connect(ui.toolButton_whatsthis, SIGNAL(clicked()), this, SLOT(showWhatsThis()));
connect(ui.pushButton_resetpage, SIGNAL(clicked()), this, SLOT(resetPage()));
connect(ui.pushButton_resetall, SIGNAL(clicked()), this, SLOT(resetAll()));
connect(ui.pushButton_ok, SIGNAL(clicked()), this, SLOT(updateConfiguration()));
connect(ui.comboBox_ipv4method, SIGNAL(currentIndexChanged(int)), this, SLOT(ipv4Method(int)));
// Setup comboboxes
ui.comboBox_ipv4method->addItems(TranslateStrings::cmtr_sl(sl_ipv4_method) );
ui.comboBox_ipv6method->addItems(TranslateStrings::cmtr_sl(sl_ipv6_method) );
......@@ -95,7 +102,7 @@ PropertiesEditor::PropertiesEditor(QWidget* parent, const arrayElement& ae)
// ipv4 page
if (! ipv4map.value("Method").toString().isEmpty() ) {
ui.comboBox_ipv4method->setCurrentIndex(sl_ipv4_method.indexOf(QRegExp(ipv4map.value("Method").toString())) );
ui.comboBox_ipv4method->setCurrentIndex(sl_ipv4_method.indexOf(QRegularExpression(ipv4map.value("Method").toString())) );
}
ui.lineEdit_ipv4address->setText(ipv4map.value("Address").toString() );
ui.lineEdit_ipv4netmask->setText(ipv4map.value("Netmask").toString() );
......@@ -126,13 +133,7 @@ PropertiesEditor::PropertiesEditor(QWidget* parent, const arrayElement& ae)
ui.stackedWidget_proxy01->setCurrentIndex(0);
else
ui.stackedWidget_proxy01->setCurrentIndex(ui.comboBox_proxymethod->currentIndex() );
// connect signals to slots
connect(ui.toolButton_whatsthis, SIGNAL(clicked()), this, SLOT(showWhatsThis()));
connect(ui.pushButton_resetpage, SIGNAL(clicked()), this, SLOT(resetPage()));
connect(ui.pushButton_resetall, SIGNAL(clicked()), this, SLOT(resetAll()));
connect(ui.pushButton_ok, SIGNAL(clicked()), this, SLOT(updateConfiguration()));
// disable pages not needed for a service (mainly vpn)
if (objmap.value("Type").toString() == "vpn") {
ui.ipv4->setDisabled(true);
......@@ -280,7 +281,7 @@ void PropertiesEditor::updateConfiguration()
for (int i = 0; i < lep.count(); ++i) {
s = lep.at(i)->text();
s = s.simplified(); // really should not be needed with the validator
if (s.isEmpty() ) s.clear();
if (s.isEmpty() ) break;
dict.insert(slp.at(i), s);
} // for
......@@ -295,9 +296,9 @@ void PropertiesEditor::updateConfiguration()
// Only update if an entry has changed.
if ((ui.comboBox_ipv6method->currentText() != TranslateStrings::cmtr(ipv6map.value("Method").toString()) ) |
(static_cast<uint>(ui.spinBox_ipv6prefixlength->value()) != ipv6map.value("PrefixLength").toUInt() ) |
(ui.lineEdit_ipv6gateway->text() != TranslateStrings::cmtr(ipv6map.value("Privacy").toString()) ) |
(ui.lineEdit_ipv6address->text() != TranslateStrings::cmtr(ipv6map.value("Address").toString()) ) |
(ui.lineEdit_ipv6gateway->text() != TranslateStrings::cmtr(ipv6map.value("Gateway").toString()) ) |
(ui.comboBox_ipv6privacy->currentText() != TranslateStrings::cmtr(ipv6map.value("Privacy").toString())) ) {
(ui.comboBox_ipv6privacy->currentText() != TranslateStrings::cmtr(ipv6map.value("Gateway").toString())) ) {
vlist.clear();
lep.clear();
......@@ -315,7 +316,7 @@ void PropertiesEditor::updateConfiguration()
for (int i = 0; i < lep.count(); ++i) {
s = lep.at(i)->text();
s = s.simplified(); // really should not be needed with the validator
if (s.isEmpty() ) s.clear();
if (s.isEmpty() ) break;
dict.insert(slp.at(i), s);
} // for
......@@ -358,7 +359,6 @@ void PropertiesEditor::updateConfiguration()
} // for
vlist << QVariant::fromValue(QDBusVariant(dict) );
//qDebug() << dict;
shared::processReply(iface_serv->callWithArgumentList(QDBus::AutoDetect, "SetProperty", vlist) );
} // if proxy changed
......@@ -366,3 +366,28 @@ void PropertiesEditor::updateConfiguration()
iface_serv->deleteLater();
this->accept();
}
//
// Slot to hide or show boxes based on ipv4 method
void PropertiesEditor::ipv4Method(int idx)
{
// variables
if (idx == 1 ) { // index 1 is manual
ui.label_ipv4address->show();
ui.label_ipv4netmask->show();
ui.label_ipv4gateway->show();
ui.lineEdit_ipv4address->show();
ui.lineEdit_ipv4netmask->show();
ui.lineEdit_ipv4gateway->show();
}
else {
ui.label_ipv4address->hide();
ui.label_ipv4netmask->hide();
ui.label_ipv4gateway->hide();
ui.lineEdit_ipv4address->hide();
ui.lineEdit_ipv4netmask->hide();
ui.lineEdit_ipv4gateway->hide();
}
return;
}
......@@ -2,7 +2,7 @@
Code to manage the Properties Editor dialog.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......@@ -67,6 +67,7 @@ class PropertiesEditor : public QDialog
void resetPage(int page = -1);
void resetAll();
void updateConfiguration();
void ipv4Method(int);
public:
inline void setWhatsThisIcon(QIcon icon) {ui.toolButton_whatsthis->setIcon(icon);}
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
Code to manage the Provisioning Editor dialog.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -2,7 +2,7 @@
Code to manage the Provisioning Editor dialog.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -3,7 +3,7 @@
Dialog to display text to the user. Kind of like a neutered QMessageBox
except it has scroll bars built in.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -3,7 +3,7 @@
Dialog to display text to the user. Kind of like a neutered QMessageBox
except it has scroll bars built in.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
/**************************** shared.cpp ***************************
Functions shared across various classes
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -2,7 +2,7 @@
/**************************** shared.h ***************************
Functions shared across various classes
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -4,7 +4,7 @@ Class to manage and present strings that need to be translated. These
are typically not inline strings, rather strings used globally or strings
returned by third parties, for instance, Connman.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -4,7 +4,7 @@ Class to manage and present strings that need to be translated. These
are typically not inline strings, rather strings used globally or strings
returned by third parties, for instance, Connman.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -4,7 +4,7 @@
Code for the user agent registered on DBus. When the connman vpn daemon
needs to communicate with the user it does so through this agent.
Copyright (C) 2013-2017
Copyright (C) 2016-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -3,7 +3,7 @@
Code for the user agent registered on DBus. When the connman vpn daemon
needs to communicate with the user it does so through this agent.
Copyright (C) 2013-2017
Copyright (C) 2016-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -5,7 +5,7 @@ needs to communicate with the user it does so through the agent. The
agent has a QDialog as a class member, and agent_dialog.cpp manages
that dialog.
Copyright (C) 2017
Copyright (C) 2016-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -5,7 +5,7 @@ needs to communicate with the user it does so through the agent. The
agent has a QDialog as a class member, and agent_dialog.cpp manages
that dialog.
Copyright (C) 2017
Copyright (C) 2016-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -2,7 +2,7 @@
Code to manage the VPN Provisioning Editor dialog.
Copyright (C) 2017
Copyright (C) 2016-2018
by: Andrew J. Bibb
License: MIT
......@@ -149,7 +149,6 @@ VPN_Editor::VPN_Editor(QWidget* parent) : QDialog(parent)
group_yes->addAction(ui.actionPPPD_ReqMPPEStateful);
group_yes->addAction(ui.actionVPNC_SingleDES);
group_yes->addAction(ui.actionVPNC_NoEncryption);
group_yes->addAction(ui.actionOpenVPN_AskPass);
group_yes->addAction(ui.actionOpenVPN_AuthNoCache);
group_yes->addAction(ui.actionOpenConnect_MTU);
group_yes->addAction(ui.actionOpenConnect_Cookie);
......@@ -182,6 +181,7 @@ VPN_Editor::VPN_Editor(QWidget* parent) : QDialog(parent)
group_selectfile->addAction(ui.actionOpenConnect_CACert);
group_selectfile->addAction(ui.actionOpenConnect_ClientCert);
group_selectfile->addAction(ui.actionOpenVPN_AuthUserPass);
group_selectfile->addAction(ui.actionOpenVPN_AskPass);
// Add Actions from UI to menu's
menu_global = new QMenu(tr("Global"), this);
......
......@@ -2,7 +2,7 @@
Code to manage the VPN Provisioning Editor dialog.
Copyright (C) 2017
Copyright (C) 2016-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -6,7 +6,7 @@ we've moved a lot of that to txt files inside the /text directory which
are compiled in as a resource. This seems to result in a faster
compile, but we now have manage information in two locations.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......@@ -35,10 +35,10 @@ DEALINGS IN THE SOFTWARE.
///////////////////////////////// Program Values ///////////////////////
//
// Program Info (may be visible, but don't mark for tranalation)
#define VERSION "2017.09.1-15"
#define VERSION "2018.01.06-1"
#define RELEASE_DATE "19 September 2017"
#define COPYRIGHT_DATE "2013-2017"
#define RELEASE_DATE "6 January 2018"
#define COPYRIGHT_DATE "2013-2018"
// Program Values:
// QApplication (not user visible)
......
......@@ -2,7 +2,7 @@
main program for the roothelper application
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -6,7 +6,7 @@ name implies roothelper is run as the root user, since we need to read
and write to /var/lib/connman. This program is started by DBus and the
configuration files necessary to make that happen are in the system dir.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
......@@ -6,7 +6,7 @@ name implies roothelper is run as the root user, since we need to read
and write to /var/lib/connman. This program is started by DBus and the
configuration files necessary to make that happen are in the system dir.
Copyright (C) 2013-2017
Copyright (C) 2013-2018
by: Andrew J. Bibb
License: MIT
......
############# Building and Installing ###########################
As of 2014.10.30 CMST has had the ability to create and edit config
(provisioning) files. These files are located in /var/lib/connman
which is owned by root:root. To enable reading and writing in this
directory we have had to add a roothelper program. This roothelper
is activated automatically by DBus, however it has necessitated a change
in how you build and install.
In the examples below we use the command "qmake", but if you have
multiple versions of QT installed on your system "qmake" should be
replaced with "qmake-qt5"
DISTRO= command line option:
In order to use the provisioning editor you must be a member of a group
granted access to network services. In Arch Linux this is the "network"
group, in Slackware it is the "netdev" group. The DISTRO= command line
option is provided to make sure the conf file in /etc/dbus-1/system.d
contains the proper group name. Usage Examples:
qmake DISTRO=arch // to install on an Arch Linux system
qmake DISTRO=slackware // to install on Slackware
If the DISTRO= option is omitted then qmake will default to the Arch
Linux options (network group is "network").
There is no error checking in the .pro files so it is important to make
sure that the options are spelled correctly and in the proper case.
Currently we only have information on Arch Linux and Slackware. If your
distro uses something different please open up an issue on GitHub, let
us know what your network group is called and we'll add it in.
Roothelper install file location:
By default the roothelper (called cmstroothelper) will be installed in
/usr/lib/cmst. In Slackware /usr/lib is apparently not used for every
architecture so if you specify and export a variable called USE_LIBPATH
pointing to your install location that location will be used as the
install target instead.
Manpage file location:
By default the man page will be installed to the appropriate
subdirectory below /usr/share/man. If you wish to specify a different
location you must specify and export a variable called USE_MANPATH that
contains the install location you want.
......@@ -10,6 +10,8 @@
<file>text/license.txt</file>
</qresource>
<qresource prefix="stylesheets">
<file>stylesheets/airplane.qss</file>
<file>stylesheets/tabwidget.qss</file>
<file>stylesheets/vpn_connecting.qss</file>
</qresource>
<qresource prefix="translations">
......@@ -21,6 +23,8 @@
<file>translations/cmst_en_US.qm</file>
</qresource>
<qresource prefix="icons">
<file>images/interface/radio.png</file>
<file>images/interface/basic-plane.png</file>
<file>images/raw_art/blank.png</file>
<file>images/raw_art/network-vpn-acquiring.png</file>
<file>images/raw_art/stock_lock.png</file>
......
.TH CMST 1 "29 April 2016" "Version: 2016.04.29"
.TH CMST 1 "20 October 2017" "Version: 2017.10.20"
.SH NAME
CMST - Connman System Tray
.SH SYNOPSIS
......@@ -7,6 +7,12 @@ Usage: cmst [options]
A QT5 based GUI front end for the Connman network daemon
.SH OPTIONS
.TP
\fB-b, --bypass-restore-state\fP
If restore state is specified in the settings file this take precedence over that setting and not restore the state when starting.
.TP
\fB-B, --bypass-start-options\fP
Ignore completely any start options specified in the settings file.
.TP
\fB-c, --disable-counters [Experimental] \fP
Disable the counters. May be used to minimize load on your system.
.TP
......@@ -27,6 +33,9 @@ Log the Connman inputRequest for debugging purposes.
\fB-m, --minimized\fP
Start the GUI minimized in the system tray.
.TP
\fB-M, --disable-minimize
Disable the minimize button. Use when you want the window manager to have sole control in minimizing the interface.
.TP
\fB-n, --disable-vpn\fP
Disable VPN support. This will disable (grey out) the VPN tab and the VPN editor button. More importantly it will also bypass
setting up a DBUS connection to connman-vpn. If Connman is compiled without VPN support this option should be supplied.
......
QToolButton {
border: none;
}
QProgressBar{
margin-top: 6px;
margin-right: 11px;
margin-bottom: 6px;
margin-left: 7px;
border: 1px solid black;
border-radius: 4px;
text-align: center;
}
QProgressBar::chunk {
}
QTabBar::tab:disabled {
width: 0;
height: 0;
margin: 0;
padding: 0;
border: none;
}
<b><center>Connman System Tray (CMST)</center></b>
<b><center>Change Log</center></b>
<b> 2018.01.06</b>
<ul>
<li>Counters disabled by default, changed command line option -c to enable.</li>
<li>Disabled tabs are now hidden from view.</li>
<li>Do not change the visible service in the details tab if a service property changes and the service still exists.</li>
<li>Properties editor fixed to allow an empty gateway field in IPv4 and IPv6 connections (issue #148a)</li>
<li>Revise and enhance the properties editor dialog.</li>
<li>In VPN editor OpenVPN.AskPass changed from yes/no to file selector.</li>
<li>Allow move before/after on connected VPN services (issue #167).</li>
<li>Offline mode pixmap label now a pushbutton.</li>
<li>Offline mode engaged now shown as airplane, disengaged shown as radio.</li>
</ul>
<b> 2017.09.1</b>
<ul>
<li>Removed padding hack (issue #166) from id buttons.</li>
......
......@@ -127,13 +127,13 @@ fdo_name = emblem-favorite
[icon]
icon_name = offline_mode_engaged
resource = :/icons/images/interface/golfball_green.png
colorize = no
resource = :/icons/images/interface/basic-plane.png
colorize = yes
[icon]
icon_name = offline_mode_disengaged
resource = :/icons/images/interface/golfball_red.png
colorize = no
resource = :/icons/images/interface/radio.png
colorize = yes
[icon]
icon_name = whats_this
......
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