[ekiga] Make Login field optional in SIP account creation and edition



commit ae7236aa8f1a8db8264549e5661c1b83b8c36579
Author: Eugen Dedu <eugen dedu univ-fcomte fr>
Date:   Mon Apr 27 18:21:09 2015 +0200

    Make Login field optional in SIP account creation and edition

 lib/engine/components/opal/opal-account.cpp |    6 +++---
 lib/engine/components/opal/opal-bank.cpp    |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/lib/engine/components/opal/opal-account.cpp b/lib/engine/components/opal/opal-account.cpp
index 74d0497..41d46e3 100644
--- a/lib/engine/components/opal/opal-account.cpp
+++ b/lib/engine/components/opal/opal-account.cpp
@@ -698,7 +698,7 @@ Opal::Account::edit ()
     request->hidden ("host", get_host ());
     request->text ("user", _("_Account ID"), get_username (), _("1234567890"),
                    Ekiga::FormVisitor::NUMBER, false, false);
-    request->hidden ("authentication_user", get_authentication_username ());
+    request->hidden ("authentication_user", "");  // will be copied from user
     request->text ("password", _("_PIN Code"), get_password (), _("1234"),
                    Ekiga::FormVisitor::NUMBER, false, false);
     request->text ("outbound_proxy", _("Outbound _Proxy"), get_outbound_proxy (), _("proxy.company.com"),
@@ -730,8 +730,8 @@ Opal::Account::edit ()
      * for the authentication procedure ("Authentication user"), aka Login
      * to make it understandable
      */
-    request->text ("authentication_user", _("_Login"), get_authentication_username (), _("jon.doe"),
-                   Ekiga::FormVisitor::STANDARD, false, false);
+    request->text ("authentication_user", _("_Login"), get_authentication_username () != get_username () ? 
get_authentication_username () : "", _("jon.doe"),
+                   Ekiga::FormVisitor::STANDARD, true, true);
     request->text ("password", _("_Password"), get_password (), _("1234"),
                    Ekiga::FormVisitor::PASSWORD, false, false);
     request->text ("outbound_proxy", _("Outbound _Proxy"), get_outbound_proxy (), _("proxy.company.com"),
diff --git a/lib/engine/components/opal/opal-bank.cpp b/lib/engine/components/opal/opal-bank.cpp
index eeee6f6..3c998cd 100644
--- a/lib/engine/components/opal/opal-bank.cpp
+++ b/lib/engine/components/opal/opal-bank.cpp
@@ -195,7 +195,7 @@ Opal::Bank::new_account (Account::Type acc_type,
     request->text ("user", _("_User"), username, _("jon"),
                    Ekiga::FormVisitor::STANDARD, false, false);
     request->text ("authentication_user", _("_Login"), std::string (), _("jon.doe"),
-                   Ekiga::FormVisitor::STANDARD, false, false);
+                   Ekiga::FormVisitor::STANDARD, true, true);
     request->text ("password", _("_Password"), password, _("1234"),
                    Ekiga::FormVisitor::PASSWORD, false, false);
     request->text ("outbound_proxy", _("Outbound _Proxy"), "", _("proxy.company.com"),
@@ -226,7 +226,7 @@ Opal::Bank::on_new_account_form_submitted (bool submitted,
   std::string new_host = (acc_type == Opal::Account::SIP
                          || acc_type == Opal::Account::H323) ? result.text ("host") : result.hidden ("host");
   std::string new_user = result.text ("user");
-  std::string new_authentication_user = (acc_type == Opal::Account::SIP) ? result.text 
("authentication_user") : new_user;
+  std::string new_authentication_user = (acc_type == Opal::Account::SIP && ! result.text 
("authentication_user").empty ()) ? result.text ("authentication_user") : new_user;
   std::string new_password = result.text ("password");
   std::string new_outbound_proxy = result.text ("outbound_proxy");
   bool new_enabled = result.boolean ("enabled");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]