Skip to content

Commit a2ff6e6

Browse files
committed
cleaned up some VPN provisioning editor validated entries
1 parent 0145e7b commit a2ff6e6

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

apps/cmstapp/code/vpn_prov_ed/ui/vpn_prov_editor.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ that the peer is no longer connected.</string>
894894
<string>WireGuard.DNS</string>
895895
</property>
896896
<property name="toolTip">
897-
<string>A comma separated list of name servers (optional).</string>
897+
<string>List of name servers (optional).</string>
898898
</property>
899899
</action>
900900
<action name="actionWireGuard_PrivateKey">

apps/cmstapp/code/vpn_prov_ed/vpn_ed.cpp

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,9 @@ VPN_Editor::VPN_Editor(QWidget* parent, const float& ver) : QDialog(parent)
105105
group_freeform->addAction(ui.actionVPNC_AppVersion);
106106
group_freeform->addAction(ui.actionOpenVPN_Cipher);
107107
group_freeform->addAction(ui.actionOpenVPN_Auth);
108-
group_freeform->addAction(ui.actionWireGuard_Address);
109-
group_freeform->addAction(ui.actionWireGuard_PrivateKey);
110-
group_freeform->addAction(ui.actionWireGuard_PublicKey);
111-
group_freeform->addAction(ui.actionWireGuard_PresharedKey);
112-
group_freeform->addAction(ui.actionWireGuard_AllowedIPs);
113108
group_freeform->addAction(ui.actionOpenConnect_Usergroup);
114-
109+
group_freeform->addAction(ui.actionWireGuard_Address);
110+
115111
group_combobox = new QActionGroup(this);
116112
group_combobox->addAction(ui.actionVPNC_IKE_Authmode);
117113
group_combobox->addAction(ui.actionVPNC_IKE_DHGroup);
@@ -186,6 +182,10 @@ VPN_Editor::VPN_Editor(QWidget* parent, const float& ver) : QDialog(parent)
186182
group_validated->addAction(ui.actionOpenConnect_VPNHost);
187183
group_validated->addAction(ui.actionWireGuard_ListPort);
188184
group_validated->addAction(ui.actionWireGuard_DNS);
185+
group_validated->addAction(ui.actionWireGuard_PrivateKey);
186+
group_validated->addAction(ui.actionWireGuard_PublicKey);
187+
group_validated->addAction(ui.actionWireGuard_PresharedKey);
188+
group_validated->addAction(ui.actionWireGuard_AllowedIPs);
189189
group_validated->addAction(ui.actionWireGuard_EndpointPort);
190190
group_validated->addAction(ui.actionWireGuard_PersistentKeepalive);
191191

@@ -446,6 +446,7 @@ void VPN_Editor::inputSelectFile(QAction* act)
446446
void VPN_Editor::inputValidated(QAction* act, QString key)
447447
{
448448
// variables
449+
QChar delim(','); // default delim character for plurals
449450
if (key.isEmpty() ) key = act->text();
450451

451452
// create the dialog
@@ -473,9 +474,14 @@ void VPN_Editor::inputValidated(QAction* act, QString key)
473474
if (act == ui.actionOpenConnect_VPNHost) vd->setValidator(CMST::ValDialog_46, false);
474475
if (act == ui.actionWireGuard_ListPort) vd->setValidator(CMST::ValDialog_Int, false);
475476
if (act == ui.actionWireGuard_DNS) vd->setValidator(CMST::ValDialog_46, true);
477+
if (act == ui.actionWireGuard_PrivateKey) vd->setValidator(CMST::ValDialog_Word, false);
478+
if (act == ui.actionWireGuard_PublicKey) vd->setValidator(CMST::ValDialog_Word, false);
479+
if (act == ui.actionWireGuard_PresharedKey) vd->setValidator(CMST::ValDialog_Word, false);
480+
if (act == ui.actionWireGuard_AllowedIPs) vd->setValidator(CMST::ValDialog_46, true);
476481
if (act == ui.actionWireGuard_EndpointPort) vd->setValidator(CMST::ValDialog_Int, false);
477482
if (act == ui.actionWireGuard_PersistentKeepalive) vd->setValidator(CMST::ValDialog_Int, false);
478-
// if accepted put an entry in the textedit
483+
484+
// if accepted put an entry in the textedit
479485
if (vd->exec() == QDialog::Accepted) {
480486
QString s = vd->getText();
481487
key.append(" = %1\n");
@@ -485,7 +491,7 @@ void VPN_Editor::inputValidated(QAction* act, QString key)
485491
s.replace(',', ' ');
486492
s.replace(';', ' ');
487493
s = s.simplified();
488-
s.replace(' ', ',');
494+
s.replace(' ', delim);
489495
}
490496

491497
ui.plainTextEdit_main->insertPlainText(key.arg(s) );

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.03.03-1"
38+
#define VERSION "2020.03.05-1"
3939

4040
#define RELEASE_DATE "1 January 2020"
4141
#define COPYRIGHT_DATE "2013-2020"

0 commit comments

Comments
 (0)