Verified Commit e4ed9aad authored by Alf Gaida's avatar Alf Gaida

Adding upstream version 2019.01.13.

Signed-off-by: Alf Gaida's avatarAlf Gaida <agaida@siduction.org>
parent af8c7032
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-2018
Copyright (C) 2013-2019
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-2018
Copyright (C) 2013-2019
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-2018
Copyright (C) 2013-2019
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-2018
Copyright (C) 2013-2019
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-2018
Copyright (C) 2013-2019
by: Andrew J. Bibb
License: MIT
......@@ -205,15 +205,14 @@ ControlBox::ControlBox(const QCommandLineParser& parser, QWidget *parent)
settings->endGroup();
}
// Make sure the controlbox will fit onto small acreens
// Make sure the controlbox will fit onto small screens (& resize to sizeHint() for HiDPI screens)
QSize sz_target = (qApp->desktop()->availableGeometry(this)).size();
QSize sz_source = this->sizeHint();
sz_target.scale(sz_target.width() - 100, sz_target.height() - 100, Qt::KeepAspectRatio); // give me a little buffer
if (sz_source.width() > sz_target.width() || sz_source.height() > sz_target.height() ) {
sz_source.scale(sz_target.width(), sz_target.height(), Qt::KeepAspectRatio);
resize(sz_source);
move(25, 25);
sz_source.scale(sz_target.width() - 100, sz_target.height() - 100, Qt::KeepAspectRatio); // keep min. 100 pixels around dialog
}
resize(sz_source);
move((sz_target.width() - this->width()) / 2, (sz_target.height() - this->height()) / 2); // re-centre if needed
// set a flag if we sent a commandline option to log the connman inputrequest
agent->setLogInputRequest(parser.isSet("log-input-request"));
......@@ -308,15 +307,21 @@ ControlBox::ControlBox(const QCommandLineParser& parser, QWidget *parent)
ui.groupBox_process->setVisible(ui.checkBox_advanced->isChecked() );
enableRunOnStartup(ui.checkBox_runonstartup->isChecked() );
// Create the notifyclient, make four tries; first immediately in constructor, then
// at 1/2 second, 2 seconds and finally at 8 seconds
// Create the notifyclient.
notifyclient = new NotifyClient(this);
this->connectNotifyClient();
QTimer::singleShot(500, this, SLOT(connectNotifyClient()));
QTimer::singleShot(2 * 1000, this, SLOT(connectNotifyClient()));
QTimer::singleShot(8 * 1000, this, SLOT(connectNotifyClient()));
// Only try to connect to the notifyclient if we actually need it
if(this->settings->value("enable_daemon_notifications").toBool()) {
// Make four tries; first immediately, then
// at 1/2 second, 2 seconds and finally at 8 seconds
this->connectNotifyClient();
QTimer::singleShot(500, this, SLOT(connectNotifyClient()));
QTimer::singleShot(2 * 1000, this, SLOT(connectNotifyClient()));
QTimer::singleShot(8 * 1000, this, SLOT(connectNotifyClient()));
}
// setup the dbus interface to connman.manager
con_manager = NULL;
vpn_manager = NULL;
if (! QDBusConnection::systemBus().isConnected() ) logErrors(CMST::Err_No_DBus);
else {
con_manager = new QDBusInterface(DBUS_CON_SERVICE, DBUS_PATH, DBUS_CON_MANAGER, QDBusConnection::systemBus(), this);
......@@ -352,7 +357,6 @@ ControlBox::ControlBox(const QCommandLineParser& parser, QWidget *parent)
this->clearCounters();
// VPN manager. Disable if commandline or option is set
vpn_manager = NULL;
if (parser.isSet("disable-vpn") ? true : (b_so && ui.checkBox_disablevpn->isChecked()) ) {
ui.tabWidget->setTabEnabled(ui.tabWidget->indexOf(ui.VPN), false);
ui.pushButton_vpn_editor->setDisabled(true);
......@@ -485,11 +489,6 @@ void ControlBox::aboutCMST()
"<center>Copyright c %4<center>by"
"<center>Andrew J. Bibb"
"<center>Vermont, USA"
"<br><center><b>Contributors:</b>"
"<center>Brett Dutro"
"<center>Adam Fontenot"
"<center>Lester Bico"
"<center>Yaohan Chen"
"<br><center><b>Translations:</b>"
"<center>Jianfeng Zhang (Chinese)"
"<center>sqozz (German)"
......@@ -1148,7 +1147,7 @@ void ControlBox::dbsServicePropertyChanged(QString property, QDBusVariant dbvalu
}
else {
notifyclient->setSummary(QString(tr("VPN Disengaged")) );
notifyclient->setIcon(iconman->getIconName("onnection_not_ready") );
notifyclient->setIcon(iconman->getIconName("connection_not_ready") );
}
notifyclient->setBody(QString(tr("Object Path: %1")).arg(s_path) );
notifyclient->setUrgency(Nc::UrgencyNormal);
......@@ -2681,8 +2680,9 @@ bool ControlBox::getTechnologies()
}
//
// Function to query connman.manager.GetServices
// Return a bool, true on success, false otherwise
// Function to query connman.manager.GetServices
// Return a bool, true on success, false otherwise
// Called from managerRescan()
bool ControlBox::getServices()
{
// call connman and GetServices
......@@ -3021,13 +3021,15 @@ void ControlBox::cleanUp()
if (counter->cnxns() > 0) {
shared::processReply(con_manager->call(QDBus::AutoDetect, "UnregisterCounter", QVariant::fromValue(QDBusObjectPath(CNTR_OBJECT))) );
} // if counters are connected to anything
} // if con_manager isValid
if (vpn_manager != NULL) {
if (vpn_manager->isValid() ) {
shared::processReply(vpn_manager->call(QDBus::AutoDetect, "UnregisterAgent", QVariant::fromValue(QDBusObjectPath(VPN_AGENT_OBJECT))) );
} // ivpn_manager isValid
} // not null
if (vpn_manager != NULL) {
if (vpn_manager->isValid() ) {
shared::processReply(vpn_manager->call(QDBus::AutoDetect, "UnregisterAgent", QVariant::fromValue(QDBusObjectPath(VPN_AGENT_OBJECT))) );
} // ivpn_manager isValid
} // not null
} // if con_manager isValid
return;
}
......
......@@ -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-2018
Copyright (C) 2013-2019
by: Andrew J. Bibb
License: MIT
......
......@@ -1080,7 +1080,7 @@
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<y>-112</y>
<width>633</width>
<height>578</height>
</rect>
......@@ -1092,17 +1092,7 @@
<string>Program Control</string>
</property>
<layout class="QGridLayout" name="gridLayout_10">
<item row="1" column="0">
<widget class="QCheckBox" name="checkBox_runonstartup">
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked CMST will place an entry in the autostart directory for the current user, unchecking will remove said entry. This directory is typically: &lt;span style=&quot; font-weight:600;&quot;&gt;${HOME}/.config/autostart&lt;/span&gt;. &lt;/p&gt;&lt;p&gt;CMST only add or remove the .desktop file from the autostart directory. Autostarting is typically dependent upon your Desktop Environment and must be enabled from there.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Enable Autostart</string>
</property>
</widget>
</item>
<item row="0" column="0">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="checkBox_retryfailed">
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If a Connman service falls into the &amp;quot;Failed&amp;quot; state it will normally remain in that state.&lt;/p&gt;&lt;p&gt;If this box is checked CMST will try to automatically reconnect a WiFi service that enters the &amp;quot;Failed&amp;quot; state. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
......@@ -1112,7 +1102,7 @@
</property>
</widget>
</item>
<item row="2" column="0">
<item row="3" column="0" colspan="2">
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
......@@ -1125,6 +1115,16 @@
</property>
</spacer>
</item>
<item row="1" column="0" colspan="2">
<widget class="QCheckBox" name="checkBox_runonstartup">
<property name="whatsThis">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;If checked CMST will place an entry in the autostart directory for the current user, unchecking will remove said entry. This directory is typically: &lt;span style=&quot; font-weight:600;&quot;&gt;${HOME}/.config/autostart&lt;/span&gt;. &lt;/p&gt;&lt;p&gt;CMST only add or remove the .desktop file from the autostart directory. Autostarting is typically dependent upon your Desktop Environment and must be enabled from there.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Enable Autostart</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......
......@@ -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-2018
Copyright (C) 2013-2019
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-2018
Copyright (C) 2013-2019
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-2018
Copyright (C) 2015-2019
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-2018
Copyright (C) 2015-2019
by: Andrew J. Bibb
License: MIT
......
......@@ -2,7 +2,7 @@
C++ main routine.
Copyright (C) 2013-2018
Copyright (C) 2013-2019
by: Andrew J. Bibb
License: MIT
......@@ -83,9 +83,9 @@ 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" << "enable-counters",
QCommandLineOption enableCounters(QStringList() << "c" << "enable-counters",
QCoreApplication::translate("main.cpp", "[Experimental] Enable data counters.") );
parser.addOption(disableCounters);
parser.addOption(enableCounters);
QCommandLineOption disableTrayIcon(QStringList() << "d" << "disable-tray-icon",
QCoreApplication::translate("main.cpp", "Disable the system tray icon. May be needed for system trays not compliant with the Freedesktop.org system tray specification.") );
......
......@@ -3,7 +3,7 @@
Code for a notify client to interface with a desktop notification
server.
Copyright (C) 2013-2018
Copyright (C) 2013-2019
by: Andrew J. Bibb
License: MIT
......@@ -59,9 +59,6 @@ NotifyClient::NotifyClient(QObject* parent)
// Create our client and try to connect to the notify server
if (! QDBusConnection::sessionBus().isConnected() )
qCritical("CMST - Cannot connect to the session bus.");
// else try to connect to a notification server
else
connectToServer();
// Signals and slots
connect(qApp, SIGNAL(aboutToQuit()), this, SLOT(cleanUp()));
......@@ -77,7 +74,7 @@ void NotifyClient::connectToServer()
{
// return now if we already have a valid connection
if (b_validconnection) return;
notifyclient = new QDBusInterface(DBUS_NOTIFY_SERVICE, DBUS_NOTIFY_PATH, DBUS_NOTIFY_INTERFACE, QDBusConnection::sessionBus(), this);
if (notifyclient->isValid() ) {
b_validconnection = true;
......
......@@ -3,7 +3,7 @@
Code for a notify client to interface with a desktop notification
server.
Copyright (C) 2013-2018
Copyright (C) 2013-2019
by: Andrew J. Bibb
License: MIT
......
......@@ -2,7 +2,7 @@
Code to manage the Properties Editor dialog.
Copyright (C) 2013-2018
Copyright (C) 2013-2019
by: Andrew J. Bibb
License: MIT
......
......@@ -2,7 +2,7 @@
Code to manage the Properties Editor dialog.
Copyright (C) 2013-2018
Copyright (C) 2013-2019
by: Andrew J. Bibb
License: MIT
......
......@@ -2,7 +2,7 @@
Code to manage the Provisioning Editor dialog.
Copyright (C) 2013-2018
Copyright (C) 2013-2019
by: Andrew J. Bibb
License: MIT
......
......@@ -2,7 +2,7 @@
Code to manage the Provisioning Editor dialog.
Copyright (C) 2013-2018
Copyright (C) 2013-2019
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-2018
Copyright (C) 2013-2019
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-2018
Copyright (C) 2013-2019
by: Andrew J. Bibb
License: MIT
......
/**************************** shared.cpp ***************************
Functions shared across various classes
Copyright (C) 2013-2018
Copyright (C) 2013-2019
by: Andrew J. Bibb
License: MIT
......
......@@ -2,7 +2,7 @@
/**************************** shared.h ***************************
Functions shared across various classes
Copyright (C) 2013-2018
Copyright (C) 2013-2019
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-2018
Copyright (C) 2013-2019
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-2018
Copyright (C) 2013-2019
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) 2016-2018
Copyright (C) 2016-2019
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) 2016-2018
Copyright (C) 2016-2019
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) 2016-2018
Copyright (C) 2016-2019
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) 2016-2018
Copyright (C) 2016-2019
by: Andrew J. Bibb
License: MIT
......
......@@ -2,7 +2,7 @@
Code to manage the VPN Provisioning Editor dialog.
Copyright (C) 2016-2018
Copyright (C) 2016-2019
by: Andrew J. Bibb
License: MIT
......
......@@ -2,7 +2,7 @@
Code to manage the VPN Provisioning Editor dialog.
Copyright (C) 2016-2018
Copyright (C) 2016-2019
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-2018
Copyright (C) 2013-2019
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 "2018.01.06-1"
#define VERSION "2019.01.13-1"
#define RELEASE_DATE "6 January 2018"
#define COPYRIGHT_DATE "2013-2018"
#define RELEASE_DATE "13 January 2019"
#define COPYRIGHT_DATE "2013-2019"
// Program Values:
// QApplication (not user visible)
......
......@@ -2,7 +2,7 @@
main program for the roothelper application
Copyright (C) 2013-2018
Copyright (C) 2013-2019
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-2018
Copyright (C) 2013-2019
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-2018
Copyright (C) 2013-2019
by: Andrew J. Bibb
License: MIT
......
......@@ -9,7 +9,7 @@
<allow send_destination="org.cmst.roothelper"
send_interface="org.cmst.roothelper"/>
</policy>
<policy group="network">
<policy group="netdev">
<allow send_destination="org.cmst.roothelper"
send_interface="org.cmst.roothelper"/>
</policy>
......
......@@ -9,7 +9,7 @@
<allow send_destination="org.cmst.roothelper"
send_interface="org.cmst.roothelper"/>
</policy>
<policy group="network">
<policy group="netdev">
<allow send_destination="org.cmst.roothelper"
send_interface="org.cmst.roothelper"/>
</policy>
......
#!/bin/bash
#
# Script to enerate differnet size icons.
# dmenu
#
#
for i in 16 20 22 24 32 36 40 48 64 72 96 128 192 256 384 512; do
mkdir -p "./${i}x${i}"
convert ./cmst-icon.svg -transparent white -filter box -resize ${i}x${i} -unsharp 0x6+0.5+0 -background "rgba(0,0,0,0)" -flatten "./${i}x${i}/cmst.png"
done
.TH CMST 1 "20 October 2017" "Version: 2017.10.20"
.TH CMST 1 "06 January 2018" "Version: 2018.01.06"
.SH NAME
CMST - Connman System Tray
.SH SYNOPSIS
......@@ -13,8 +13,8 @@ If restore state is specified in the settings file this take precedence over tha
\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.
\fB-c, --enable-counters [Experimental] \fP
Enable the counters. Counters are disabled by default to minimize load on your system.
.TP
\fB-d, --disable-tray-icon\fP
Disable the system tray icon. May be needed for system trays not compliant with the Freedesktop.org system tray specification.
......
<b><center>Connman System Tray (CMST)</center></b>
<b><center>Change Log</center></b>
<b> 2019.01.13</b>
<ul>
<li>Fixed segfaul on close when running without Connman.</li>
<li>Revert network group to "netdev" in Slackware and Debian.</li>
<li>Pull request #183 (fixed typo in notification icon name).</li>
<li>Pull request #184 (correct dialog size on high DPI monitors).</li>
<li>PUll request #197 (add Spanish translation).</li>
<li>Fixed #188 missing README in tarball</li>
</ul>
<b> 2018.01.06</b>
<ul>
<li>Counters disabled by default, changed command line option -c to enable.</li>
......
This diff is collapsed.
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