<h1>Project "FreeSWITCH user-contributed scripts, etc" received a push.</h1>
<h2>branch: master updated</h2>
<pre>
via: 7896938aefaf21adc42a01b4d8e9dd3d42ffbc82 (commit)
from: 9c0deb98bbc4aa6a9e5e6f792e911b550f4db83f (commit)
</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Mitch Capper
comments:
Make accounts default to 0 last rather than after 1, add a proper remove account function and kill it out of sofia first, don't add a new account if a user clicks cancel.
<span style="color: #000080; font-weight: bold">diff --git a/mitchcapper/FSClient/Account.cs b/mitchcapper/FSClient/Account.cs</span>
<span style="color: #000080; font-weight: bold">index d987ced..59f0197 100644</span>
<span style="color: #A00000">--- a/mitchcapper/FSClient/Account.cs</span>
<span style="color: #00A000">+++ b/mitchcapper/FSClient/Account.cs</span>
<span style="color: #800080; font-weight: bold">@@ -125,7 +125,11 @@ namespace FSClient {</span>
                        account.guid = "";
                        account.guid = old_guid;
                }
<span style="color: #A00000">-</span>
<span style="color: #00A000">+                public static void RemoveAccount(Account account){</span>
<span style="color: #00A000">+                        account.KillGateway();</span>
<span style="color: #00A000">+                        accounts.Remove(account);</span>
<span style="color: #00A000">+                        ReloadSofia();</span>
<span style="color: #00A000">+                }</span>
                public static void create_gateway_nodes(XmlNode gateways_node) {
                        foreach (Account account in accounts) {
<span style="color: #800080; font-weight: bold">@@ -170,9 +174,10 @@ namespace FSClient {</span>
                        _guid.PropertyChanged += (s, e) => {
                                if (!guid_ok(this, _guid.value) || String.IsNullOrEmpty(_guid.value)) {
<span style="color: #A00000">-                                        for (int i = 0; i < 10; i++) {</span>
<span style="color: #A00000">-                                                if (guid_ok(this, i.ToString())) {</span>
<span style="color: #A00000">-                                                        _guid.value = i.ToString();</span>
<span style="color: #00A000">+                                        for (int i = 1; i <= 10; i++){</span>
<span style="color: #00A000">+                                                int val = i == 10 ? 0 : i; // want 0 checked last.</span>
<span style="color: #00A000">+                                                if (guid_ok(this, val.ToString())) {</span>
<span style="color: #00A000">+                                                        _guid.value = val.ToString();</span>
                                                        return;
                                                }
                                        }
<span style="color: #800080; font-weight: bold">@@ -329,13 +334,16 @@ namespace FSClient {</span>
                        KillGateway();
                        ReloadSofia();
                }
<span style="color: #A00000">-                public void edit() {</span>
<span style="color: #00A000">+                public bool edit() {</span>
                        current_editing_account = this;
                        GenericEditor editor = new GenericEditor();
                        editor.Init("Editing Account", values);
                        editor.ShowDialog();
                        if (editor.DialogResult == true)
                                ReloadAccount();
<span style="color: #00A000">+                        else</span>
<span style="color: #00A000">+                                return false;</span>
<span style="color: #00A000">+                        return true;</span>
                }
        }
}
<span style="color: #000080; font-weight: bold">diff --git a/mitchcapper/FSClient/Broker.cs b/mitchcapper/FSClient/Broker.cs</span>
<span style="color: #000080; font-weight: bold">index b774695..58d6d91 100644</span>
<span style="color: #A00000">--- a/mitchcapper/FSClient/Broker.cs</span>
<span style="color: #00A000">+++ b/mitchcapper/FSClient/Broker.cs</span>
<span style="color: #800080; font-weight: bold">@@ -228,7 +228,7 @@ namespace FSClient {</span>
                }
                public void DialString(String str){
                        if (string.IsNullOrWhiteSpace(str))
<span style="color: #A00000">-                                return;</span>
<span style="color: #00A000">+                                return;</span>
                        MainWindowRemoveFocus(true);
                        if (str.StartsWith("#") && str.Length > 2) {
<span style="color: #800080; font-weight: bold">@@ -572,8 +572,8 @@ namespace FSClient {</span>
                public OurAutoCompleteBox GetContactSearchBox() {
                        return MainWindow.get_instance().GetContactSearchBox();
                }
<span style="color: #A00000">-                public void MainWindowRemoveFocus(bool ResetContactSearchText=false){</span>
<span style="color: #A00000">-                        MainWindow.get_instance().RemoveFocus(ResetContactSearchText);</span>
<span style="color: #00A000">+                public void MainWindowRemoveFocus(bool ResetContactSearchText=false){</span>
<span style="color: #00A000">+                        MainWindow.get_instance().RemoveFocus(ResetContactSearchText);</span>
                }
                private delegate void BroadcastEventDel(FSEvent evt);
                BroadcastEventDel BroadcastHandler;
<span style="color: #000080; font-weight: bold">diff --git a/mitchcapper/FSClient/MainWindow.xaml.cs b/mitchcapper/FSClient/MainWindow.xaml.cs</span>
<span style="color: #000080; font-weight: bold">index 2201cf0..1ea68a4 100644</span>
<span style="color: #A00000">--- a/mitchcapper/FSClient/MainWindow.xaml.cs</span>
<span style="color: #00A000">+++ b/mitchcapper/FSClient/MainWindow.xaml.cs</span>
<span style="color: #800080; font-weight: bold">@@ -365,7 +365,8 @@ namespace FSClient {</span>
                private void AccountNew_Click(object sender, RoutedEventArgs e) {
                        Account acct = new Account();
                        Account.AddAccount(acct);
<span style="color: #A00000">-                        acct.edit();</span>
<span style="color: #00A000">+                        if (!acct.edit())</span>
<span style="color: #00A000">+                                Account.RemoveAccount(acct);</span>
                }
<span style="color: #800080; font-weight: bold">@@ -387,7 +388,7 @@ namespace FSClient {</span>
                        Account acct = gridAccounts.SelectedItem as Account;
                        if (acct == null)
                                return;
<span style="color: #A00000">-                        Account.accounts.Remove(acct);</span>
<span style="color: #00A000">+                        Account.RemoveAccount(acct);</span>
                }
</pre></div>
========================================================================<pre>
Summary of changes:
mitchcapper/FSClient/Account.cs | 18 +++++++++++++-----
mitchcapper/FSClient/Broker.cs | 6 +++---
mitchcapper/FSClient/MainWindow.xaml.cs | 5 +++--
3 files changed, 19 insertions(+), 10 deletions(-)
</pre>
<p>this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email<br />
For more info, see <a href="http://blog.chomperstomp.com/?p=630">http://blog.chomperstomp.com/?p=630</a>
-- <br />
FreeSWITCH user-contributed scripts, etc</p>