@@ -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)
446446void  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) );
0 commit comments