Skip to content

Commit 037466b

Browse files
committed
added notification for kill switch engaged
1 parent aa58227 commit 037466b

File tree

5 files changed

+22
-18
lines changed

5 files changed

+22
-18
lines changed

apps/cmstapp/code/control_box/controlbox.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,10 @@ void ControlBox::dbsServicesChanged(QList<QVariant> vlist, QList<QDBusObjectPath
10411041
shared::processReply(iface_tech.call(QDBus::AutoDetect, "SetProperty", "Powered", QVariant::fromValue(QDBusVariant(false))) );
10421042
} // if technology is currently powered
10431043
} // for each technology
1044+
notifyclient->init();
1045+
notifyclient->setSummary(tr("VPN Kill Switch Engaged"));
1046+
notifyclient->setBody(tr("The connection to VPN service %1 was dropped and the VPN kill switch was engaged. All network devices are powered off.").arg(topmap.value("Name").toString()));
1047+
this->sendNotifications();
10441048
} // if curtopmap type = vpn
10451049
} // if topmap type == vpn
10461050
} // if kill swich
@@ -3179,7 +3183,7 @@ void ControlBox::cleanUp()
31793183

31803184
if (vpn_manager != NULL) {
31813185
if (vpn_manager->isValid() ) {
3182-
shared::processReply(vpn_manager->call(QDBus::AutoDetect, "UnregisterAgent", QVariant::fromValue(QDBusObjectPath(VPN_AGENT_OBJECT))) );
3186+
shared::processReply(vpn_manager->call(QDBus::AutoDetect, "UnregisterAgent", QVariant::fromValue(QDBusObjectPath(VPN_AGENT_OBJECT))) );
31833187
} // ivpn_manager isValid
31843188
} // not null
31853189

apps/cmstapp/code/control_box/ui/controlbox.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@
10411041
<property name="geometry">
10421042
<rect>
10431043
<x>0</x>
1044-
<y>-240</y>
1044+
<y>-274</y>
10451045
<width>693</width>
10461046
<height>740</height>
10471047
</rect>

apps/cmstapp/code/notify/notify.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void NotifyClient::init()
9898
s_icon.clear();
9999
i_urgency = Nc::UrgencyNormal;
100100
i_expire_timeout = -1;
101-
b_overwrite = true;
101+
b_overwrite = false;
102102

103103
return;
104104
}
@@ -173,20 +173,20 @@ void NotifyClient::sendNotification ()
173173
// process the icon, if we are using a fallback icon create a temporary file to hold it
174174
QTemporaryFile* tempfileicon = NULL;
175175
if (! s_icon.isEmpty() ) {
176-
if (QFile::exists(s_icon) ) {
177-
tempfileicon = new QTemporaryFile(this);
178-
tempfileicon->setAutoRemove(false);
179-
if (tempfileicon->open() ) {
180-
QPixmap px = QPixmap(s_icon);
181-
px.save(tempfileicon->fileName(),"PNG");
182-
app_icon = tempfileicon->fileName().prepend("file://");
183-
} // if tempfileicon could be opened
184-
} // if s_icon exists as a disk file
176+
if (QFile::exists(s_icon) ) {
177+
tempfileicon = new QTemporaryFile(this);
178+
tempfileicon->setAutoRemove(false);
179+
if (tempfileicon->open() ) {
180+
QPixmap px = QPixmap(s_icon);
181+
px.save(tempfileicon->fileName(),"PNG");
182+
app_icon = tempfileicon->fileName().prepend("file://");
183+
} // if tempfileicon could be opened
184+
} // if s_icon exists as a disk file
185185

186-
// assume s_icon exists as a theme icon, don't check it here. That
187-
// check needs to be done in the calling program.
188-
else app_icon = s_icon;
189-
} // if s_icon is not empty
186+
// assume s_icon exists as a theme icon, don't check it here. That
187+
// check needs to be done in the calling program.
188+
else app_icon = s_icon;
189+
} // if s_icon is not empty
190190

191191
QDBusReply<quint32> reply = notifyclient->call(QLatin1String("Notify"), app_name, replaces_id, app_icon, summary, body, actions, hints, expire_timeout);
192192

apps/resource.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ DEALINGS IN THE SOFTWARE.
3535
///////////////////////////////// Program Values ///////////////////////
3636
//
3737
// Program Info (may be visible, but don't mark for tranalation)
38-
#define VERSION "2020.05.06-1"
38+
#define VERSION "2020.05.08-1"
3939

4040
#define RELEASE_DATE "12 April 2020"
4141
#define COPYRIGHT_DATE "2013-2020"

text/changelog.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<li>Work on Prefereneces tab to make start options clearer (issue #210).</li>
88
<li>Added VPN internet kill switch.</li>
99
</ul>
10-
<b> 2020.04.12</b>
10+
b> 2020.04.12</b>
1111
<ul>
1212
<li>Fixed wrong validator on fields that accept either IPV4 or IPv6 addresses.</li>
1313
<li>Expanded IPv6 validator to accept most abbreviated addresses.</li>

0 commit comments

Comments
 (0)