<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][14262] </title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=14262">14262</a></dd>
<dt>Author</dt> <dd>jmesquita</dd>
<dt>Date</dt> <dd>2009-07-15 17:20:13 -0500 (Wed, 15 Jul 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>Added the ability to store server configurations</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#freeswitchtrunkcontribjmesquitafsguiresourcesserver_managerui">freeswitch/trunk/contrib/jmesquita/fsgui/resources/server_manager.ui</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcincludeserver_managerh">freeswitch/trunk/contrib/jmesquita/fsgui/src/include/server_manager.h</a></li>
<li><a href="#freeswitchtrunkcontribjmesquitafsguisrcserver_managercpp">freeswitch/trunk/contrib/jmesquita/fsgui/src/server_manager.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunkcontribjmesquitafsguiresourcesserver_managerui"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/resources/server_manager.ui (14261 => 14262)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/resources/server_manager.ui        2009-07-15 20:31:12 UTC (rev 14261)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/resources/server_manager.ui        2009-07-15 22:20:13 UTC (rev 14262)
</span><span class="lines">@@ -19,131 +19,174 @@
</span><span class="cx">   &lt;property name=&quot;windowTitle&quot;&gt;
</span><span class="cx">    &lt;string&gt;Server Manager&lt;/string&gt;
</span><span class="cx">   &lt;/property&gt;
</span><del>-  &lt;layout class=&quot;QVBoxLayout&quot; name=&quot;verticalLayout&quot;&gt;
-   &lt;item&gt;
-    &lt;layout class=&quot;QHBoxLayout&quot; name=&quot;horizontalLayout&quot;&gt;
-     &lt;item&gt;
-      &lt;widget class=&quot;QTreeView&quot; name=&quot;treeView&quot;/&gt;
-     &lt;/item&gt;
-     &lt;item&gt;
-      &lt;widget class=&quot;QGroupBox&quot; name=&quot;groupBox&quot;&gt;
-       &lt;property name=&quot;title&quot;&gt;
-        &lt;string&gt;Server Settings&lt;/string&gt;
-       &lt;/property&gt;
-       &lt;layout class=&quot;QFormLayout&quot; name=&quot;formLayout&quot;&gt;
-        &lt;item row=&quot;0&quot; column=&quot;0&quot;&gt;
-         &lt;widget class=&quot;QLabel&quot; name=&quot;label&quot;&gt;
</del><ins>+  &lt;widget class=&quot;QWidget&quot; name=&quot;&quot;&gt;
+   &lt;property name=&quot;geometry&quot;&gt;
+    &lt;rect&gt;
+     &lt;x&gt;9&lt;/x&gt;
+     &lt;y&gt;9&lt;/y&gt;
+     &lt;width&gt;500&lt;/width&gt;
+     &lt;height&gt;232&lt;/height&gt;
+    &lt;/rect&gt;
+   &lt;/property&gt;
+   &lt;layout class=&quot;QVBoxLayout&quot; name=&quot;verticalLayout&quot;&gt;
+    &lt;item&gt;
+     &lt;layout class=&quot;QHBoxLayout&quot; name=&quot;horizontalLayout&quot;&gt;
+      &lt;item&gt;
+       &lt;widget class=&quot;QTreeWidget&quot; name=&quot;serverTreeWidget&quot;&gt;
+        &lt;column&gt;
+         &lt;property name=&quot;text&quot;&gt;
+          &lt;string&gt;Servers&lt;/string&gt;
+         &lt;/property&gt;
+        &lt;/column&gt;
+       &lt;/widget&gt;
+      &lt;/item&gt;
+      &lt;item&gt;
+       &lt;widget class=&quot;QGroupBox&quot; name=&quot;groupBox&quot;&gt;
+        &lt;property name=&quot;title&quot;&gt;
+         &lt;string&gt;Server Settings&lt;/string&gt;
+        &lt;/property&gt;
+        &lt;layout class=&quot;QFormLayout&quot; name=&quot;formLayout&quot;&gt;
+         &lt;item row=&quot;0&quot; column=&quot;0&quot;&gt;
+          &lt;widget class=&quot;QLabel&quot; name=&quot;label&quot;&gt;
+           &lt;property name=&quot;text&quot;&gt;
+            &lt;string&gt;Host&lt;/string&gt;
+           &lt;/property&gt;
+          &lt;/widget&gt;
+         &lt;/item&gt;
+         &lt;item row=&quot;0&quot; column=&quot;1&quot;&gt;
+          &lt;widget class=&quot;QLineEdit&quot; name=&quot;host&quot;&gt;
+           &lt;property name=&quot;text&quot;&gt;
+            &lt;string&gt;localhost&lt;/string&gt;
+           &lt;/property&gt;
+          &lt;/widget&gt;
+         &lt;/item&gt;
+         &lt;item row=&quot;1&quot; column=&quot;0&quot;&gt;
+          &lt;widget class=&quot;QLabel&quot; name=&quot;label_2&quot;&gt;
+           &lt;property name=&quot;text&quot;&gt;
+            &lt;string&gt;Password&lt;/string&gt;
+           &lt;/property&gt;
+          &lt;/widget&gt;
+         &lt;/item&gt;
+         &lt;item row=&quot;1&quot; column=&quot;1&quot;&gt;
+          &lt;widget class=&quot;QLineEdit&quot; name=&quot;pass&quot;&gt;
+           &lt;property name=&quot;text&quot;&gt;
+            &lt;string&gt;ClueCon&lt;/string&gt;
+           &lt;/property&gt;
+          &lt;/widget&gt;
+         &lt;/item&gt;
+         &lt;item row=&quot;2&quot; column=&quot;0&quot;&gt;
+          &lt;widget class=&quot;QLabel&quot; name=&quot;label_3&quot;&gt;
+           &lt;property name=&quot;text&quot;&gt;
+            &lt;string&gt;Port&lt;/string&gt;
+           &lt;/property&gt;
+          &lt;/widget&gt;
+         &lt;/item&gt;
+         &lt;item row=&quot;2&quot; column=&quot;1&quot;&gt;
+          &lt;widget class=&quot;QLineEdit&quot; name=&quot;port&quot;&gt;
+           &lt;property name=&quot;text&quot;&gt;
+            &lt;string&gt;8021&lt;/string&gt;
+           &lt;/property&gt;
+          &lt;/widget&gt;
+         &lt;/item&gt;
+         &lt;item row=&quot;3&quot; column=&quot;0&quot;&gt;
+          &lt;widget class=&quot;QPushButton&quot; name=&quot;btnSave&quot;&gt;
+           &lt;property name=&quot;text&quot;&gt;
+            &lt;string&gt;Save&lt;/string&gt;
+           &lt;/property&gt;
+          &lt;/widget&gt;
+         &lt;/item&gt;
+         &lt;item row=&quot;3&quot; column=&quot;1&quot;&gt;
+          &lt;widget class=&quot;QPushButton&quot; name=&quot;btnDelete&quot;&gt;
+           &lt;property name=&quot;text&quot;&gt;
+            &lt;string&gt;Delete&lt;/string&gt;
+           &lt;/property&gt;
+          &lt;/widget&gt;
+         &lt;/item&gt;
+        &lt;/layout&gt;
+       &lt;/widget&gt;
+      &lt;/item&gt;
+     &lt;/layout&gt;
+    &lt;/item&gt;
+    &lt;item&gt;
+     &lt;layout class=&quot;QHBoxLayout&quot; name=&quot;horizontalLayout_3&quot;&gt;
+      &lt;item&gt;
+       &lt;spacer name=&quot;horizontalSpacer&quot;&gt;
+        &lt;property name=&quot;orientation&quot;&gt;
+         &lt;enum&gt;Qt::Horizontal&lt;/enum&gt;
+        &lt;/property&gt;
+        &lt;property name=&quot;sizeHint&quot; stdset=&quot;0&quot;&gt;
+         &lt;size&gt;
+          &lt;width&gt;308&lt;/width&gt;
+          &lt;height&gt;20&lt;/height&gt;
+         &lt;/size&gt;
+        &lt;/property&gt;
+       &lt;/spacer&gt;
+      &lt;/item&gt;
+      &lt;item&gt;
+       &lt;layout class=&quot;QHBoxLayout&quot; name=&quot;horizontalLayout_2&quot;&gt;
+        &lt;item&gt;
+         &lt;widget class=&quot;QPushButton&quot; name=&quot;btnConnect&quot;&gt;
</ins><span class="cx">           &lt;property name=&quot;text&quot;&gt;
</span><del>-           &lt;string&gt;Host&lt;/string&gt;
</del><ins>+           &lt;string&gt;Connect&lt;/string&gt;
</ins><span class="cx">           &lt;/property&gt;
</span><del>-         &lt;/widget&gt;
-        &lt;/item&gt;
-        &lt;item row=&quot;0&quot; column=&quot;1&quot;&gt;
-         &lt;widget class=&quot;QLineEdit&quot; name=&quot;host&quot;&gt;
-          &lt;property name=&quot;text&quot;&gt;
-           &lt;string&gt;localhost&lt;/string&gt;
</del><ins>+          &lt;property name=&quot;default&quot;&gt;
+           &lt;bool&gt;true&lt;/bool&gt;
</ins><span class="cx">           &lt;/property&gt;
</span><span class="cx">          &lt;/widget&gt;
</span><span class="cx">         &lt;/item&gt;
</span><del>-        &lt;item row=&quot;1&quot; column=&quot;0&quot;&gt;
-         &lt;widget class=&quot;QLabel&quot; name=&quot;label_2&quot;&gt;
</del><ins>+        &lt;item&gt;
+         &lt;widget class=&quot;QPushButton&quot; name=&quot;btnCancel&quot;&gt;
</ins><span class="cx">           &lt;property name=&quot;text&quot;&gt;
</span><del>-           &lt;string&gt;Password&lt;/string&gt;
</del><ins>+           &lt;string&gt;Cancel&lt;/string&gt;
</ins><span class="cx">           &lt;/property&gt;
</span><span class="cx">          &lt;/widget&gt;
</span><span class="cx">         &lt;/item&gt;
</span><del>-        &lt;item row=&quot;1&quot; column=&quot;1&quot;&gt;
-         &lt;widget class=&quot;QLineEdit&quot; name=&quot;pass&quot;&gt;
-          &lt;property name=&quot;text&quot;&gt;
-           &lt;string&gt;ClueCon&lt;/string&gt;
-          &lt;/property&gt;
-         &lt;/widget&gt;
-        &lt;/item&gt;
-        &lt;item row=&quot;2&quot; column=&quot;0&quot;&gt;
-         &lt;widget class=&quot;QLabel&quot; name=&quot;label_3&quot;&gt;
-          &lt;property name=&quot;text&quot;&gt;
-           &lt;string&gt;Port&lt;/string&gt;
-          &lt;/property&gt;
-         &lt;/widget&gt;
-        &lt;/item&gt;
-        &lt;item row=&quot;2&quot; column=&quot;1&quot;&gt;
-         &lt;widget class=&quot;QLineEdit&quot; name=&quot;port&quot;&gt;
-          &lt;property name=&quot;text&quot;&gt;
-           &lt;string&gt;8021&lt;/string&gt;
-          &lt;/property&gt;
-         &lt;/widget&gt;
-        &lt;/item&gt;
-        &lt;item row=&quot;3&quot; column=&quot;0&quot;&gt;
-         &lt;widget class=&quot;QPushButton&quot; name=&quot;pushButton&quot;&gt;
-          &lt;property name=&quot;text&quot;&gt;
-           &lt;string&gt;Save&lt;/string&gt;
-          &lt;/property&gt;
-         &lt;/widget&gt;
-        &lt;/item&gt;
-        &lt;item row=&quot;3&quot; column=&quot;1&quot;&gt;
-         &lt;widget class=&quot;QPushButton&quot; name=&quot;pushButton_2&quot;&gt;
-          &lt;property name=&quot;text&quot;&gt;
-           &lt;string&gt;Delete&lt;/string&gt;
-          &lt;/property&gt;
-         &lt;/widget&gt;
-        &lt;/item&gt;
</del><span class="cx">        &lt;/layout&gt;
</span><del>-      &lt;/widget&gt;
-     &lt;/item&gt;
-    &lt;/layout&gt;
-   &lt;/item&gt;
-   &lt;item&gt;
-    &lt;widget class=&quot;QDialogButtonBox&quot; name=&quot;buttonBox&quot;&gt;
-     &lt;property name=&quot;orientation&quot;&gt;
-      &lt;enum&gt;Qt::Horizontal&lt;/enum&gt;
-     &lt;/property&gt;
-     &lt;property name=&quot;standardButtons&quot;&gt;
-      &lt;set&gt;QDialogButtonBox::Cancel|QDialogButtonBox::Ok&lt;/set&gt;
-     &lt;/property&gt;
-    &lt;/widget&gt;
-   &lt;/item&gt;
-  &lt;/layout&gt;
</del><ins>+      &lt;/item&gt;
+     &lt;/layout&gt;
+    &lt;/item&gt;
+   &lt;/layout&gt;
+  &lt;/widget&gt;
</ins><span class="cx">  &lt;/widget&gt;
</span><span class="cx">  &lt;tabstops&gt;
</span><span class="cx">   &lt;tabstop&gt;host&lt;/tabstop&gt;
</span><span class="cx">   &lt;tabstop&gt;pass&lt;/tabstop&gt;
</span><span class="cx">   &lt;tabstop&gt;port&lt;/tabstop&gt;
</span><del>-  &lt;tabstop&gt;treeView&lt;/tabstop&gt;
-  &lt;tabstop&gt;pushButton&lt;/tabstop&gt;
-  &lt;tabstop&gt;pushButton_2&lt;/tabstop&gt;
-  &lt;tabstop&gt;buttonBox&lt;/tabstop&gt;
</del><ins>+  &lt;tabstop&gt;serverTreeWidget&lt;/tabstop&gt;
+  &lt;tabstop&gt;btnSave&lt;/tabstop&gt;
+  &lt;tabstop&gt;btnDelete&lt;/tabstop&gt;
</ins><span class="cx">  &lt;/tabstops&gt;
</span><span class="cx">  &lt;resources/&gt;
</span><span class="cx">  &lt;connections&gt;
</span><span class="cx">   &lt;connection&gt;
</span><del>-   &lt;sender&gt;buttonBox&lt;/sender&gt;
-   &lt;signal&gt;accepted()&lt;/signal&gt;
</del><ins>+   &lt;sender&gt;btnConnect&lt;/sender&gt;
+   &lt;signal&gt;clicked(bool)&lt;/signal&gt;
</ins><span class="cx">    &lt;receiver&gt;CserverManager&lt;/receiver&gt;
</span><span class="cx">    &lt;slot&gt;accept()&lt;/slot&gt;
</span><span class="cx">    &lt;hints&gt;
</span><span class="cx">     &lt;hint type=&quot;sourcelabel&quot;&gt;
</span><del>-     &lt;x&gt;248&lt;/x&gt;
-     &lt;y&gt;254&lt;/y&gt;
</del><ins>+     &lt;x&gt;383&lt;/x&gt;
+     &lt;y&gt;224&lt;/y&gt;
</ins><span class="cx">     &lt;/hint&gt;
</span><span class="cx">     &lt;hint type=&quot;destinationlabel&quot;&gt;
</span><del>-     &lt;x&gt;157&lt;/x&gt;
-     &lt;y&gt;274&lt;/y&gt;
</del><ins>+     &lt;x&gt;257&lt;/x&gt;
+     &lt;y&gt;124&lt;/y&gt;
</ins><span class="cx">     &lt;/hint&gt;
</span><span class="cx">    &lt;/hints&gt;
</span><span class="cx">   &lt;/connection&gt;
</span><span class="cx">   &lt;connection&gt;
</span><del>-   &lt;sender&gt;buttonBox&lt;/sender&gt;
-   &lt;signal&gt;rejected()&lt;/signal&gt;
</del><ins>+   &lt;sender&gt;btnCancel&lt;/sender&gt;
+   &lt;signal&gt;clicked(bool)&lt;/signal&gt;
</ins><span class="cx">    &lt;receiver&gt;CserverManager&lt;/receiver&gt;
</span><span class="cx">    &lt;slot&gt;reject()&lt;/slot&gt;
</span><span class="cx">    &lt;hints&gt;
</span><span class="cx">     &lt;hint type=&quot;sourcelabel&quot;&gt;
</span><del>-     &lt;x&gt;316&lt;/x&gt;
-     &lt;y&gt;260&lt;/y&gt;
</del><ins>+     &lt;x&gt;460&lt;/x&gt;
+     &lt;y&gt;228&lt;/y&gt;
</ins><span class="cx">     &lt;/hint&gt;
</span><span class="cx">     &lt;hint type=&quot;destinationlabel&quot;&gt;
</span><del>-     &lt;x&gt;286&lt;/x&gt;
-     &lt;y&gt;274&lt;/y&gt;
</del><ins>+     &lt;x&gt;292&lt;/x&gt;
+     &lt;y&gt;224&lt;/y&gt;
</ins><span class="cx">     &lt;/hint&gt;
</span><span class="cx">    &lt;/hints&gt;
</span><span class="cx">   &lt;/connection&gt;
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcincludeserver_managerh"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/include/server_manager.h (14261 => 14262)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/include/server_manager.h        2009-07-15 20:31:12 UTC (rev 14261)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/include/server_manager.h        2009-07-15 22:20:13 UTC (rev 14262)
</span><span class="lines">@@ -54,10 +54,19 @@
</span><span class="cx">     QString getHost();
</span><span class="cx">     QString getPass();
</span><span class="cx">     QString getPort();
</span><ins>+    void readSettings();
+    void writeSettings();
+    void addChildSettings(QSettings &amp;, QTreeWidgetItem *, const QString &amp;);
</ins><span class="cx"> protected:
</span><span class="cx">     virtual void changeEvent(QEvent *e);
</span><span class="cx"> private:
</span><span class="cx">     Ui::CserverManager *m_ui;
</span><ins>+    QString settingsApplication;
+    QString settingsOrganization;
+private slots:
+    void addNewServer();
+    void deleteServer();
+    void serverSelected(QTreeWidgetItem *, int);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #endif // SERVER_MANAGER_H
</span></span></pre></div>
<a id="freeswitchtrunkcontribjmesquitafsguisrcserver_managercpp"></a>
<div class="modfile"><h4>Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/server_manager.cpp (14261 => 14262)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/contrib/jmesquita/fsgui/src/server_manager.cpp        2009-07-15 20:31:12 UTC (rev 14261)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/server_manager.cpp        2009-07-15 22:20:13 UTC (rev 14262)
</span><span class="lines">@@ -44,8 +44,18 @@
</span><span class="cx">     m_ui(new Ui::CserverManager)
</span><span class="cx"> {
</span><span class="cx">     m_ui-&gt;setupUi(this);
</span><ins>+
+    settingsApplication = &quot;FsGUI&quot;;
+    settingsOrganization = &quot;FreeSWITCH&quot;;
+    readSettings();
+    connect(m_ui-&gt;btnSave, SIGNAL(clicked()),
+            this, SLOT(addNewServer()));
+    connect(m_ui-&gt;btnDelete, SIGNAL(clicked()),
+            this, SLOT(deleteServer()));
+
+    connect(m_ui-&gt;serverTreeWidget, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
+            this, SLOT(serverSelected(QTreeWidgetItem*,int)));
</ins><span class="cx"> }
</span><del>-
</del><span class="cx"> CserverManager::~CserverManager()
</span><span class="cx"> {
</span><span class="cx">     delete m_ui;
</span><span class="lines">@@ -62,7 +72,6 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> }
</span><del>-
</del><span class="cx"> QString CserverManager::getHost()
</span><span class="cx"> {
</span><span class="cx">     return m_ui-&gt;host-&gt;text();
</span><span class="lines">@@ -75,3 +84,73 @@
</span><span class="cx"> {
</span><span class="cx">     return m_ui-&gt;pass-&gt;text();
</span><span class="cx"> }
</span><ins>+void CserverManager::readSettings()
+{
+    QSettings settings(settingsOrganization, settingsApplication);
+    m_ui-&gt;serverTreeWidget-&gt;clear();
+    m_ui-&gt;serverTreeWidget-&gt;setFocus();
+    addChildSettings(settings, 0, &quot;servers&quot;);
+}
+void CserverManager::writeSettings()
+{
+}
+void CserverManager::addChildSettings(QSettings &amp;settings, QTreeWidgetItem *parent, const QString &amp;group)
+{
+    if(!parent)
+        parent = m_ui-&gt;serverTreeWidget-&gt;invisibleRootItem();
+    QTreeWidgetItem *item;
+
+
+
+    settings.beginGroup(group);
+
+    foreach(QString group, settings.childGroups())
+    {
+        item = new QTreeWidgetItem(parent);
+        item-&gt;setText(0, group);
+    }
+    settings.endGroup();
+}
+void CserverManager::addNewServer()
+{
+    QSettings settings(settingsOrganization, settingsApplication);
+
+    settings.beginGroup(&quot;servers&quot;);
+    settings.beginGroup(m_ui-&gt;host-&gt;text());
+    settings.setValue(&quot;password&quot;, m_ui-&gt;pass-&gt;text());
+    settings.setValue(&quot;port&quot;, m_ui-&gt;port-&gt;text());
+    settings.endGroup();
+    settings.endGroup();
+
+    m_ui-&gt;serverTreeWidget-&gt;clear();
+    addChildSettings(settings, 0, &quot;servers&quot;);
+}
+void CserverManager::deleteServer()
+{
+    QTreeWidgetItem *item = m_ui-&gt;serverTreeWidget-&gt;currentItem();
+    if (item)
+    {
+        QSettings settings(settingsOrganization, settingsApplication);
+        settings.beginGroup(&quot;servers&quot;);
+        settings.remove(item-&gt;text(0));
+        settings.endGroup();
+        readSettings();
+        m_ui-&gt;host-&gt;clear();
+        m_ui-&gt;pass-&gt;clear();
+        m_ui-&gt;port-&gt;clear();
+    }
+}
+void CserverManager::serverSelected(QTreeWidgetItem *item, int col)
+{
+    QSettings settings(settingsOrganization, settingsApplication);
+
+    settings.beginGroup(&quot;servers&quot;);
+    settings.beginGroup(item-&gt;text(col));
+
+    m_ui-&gt;host-&gt;setText(item-&gt;text(col));
+    m_ui-&gt;port-&gt;setText(settings.value(&quot;port&quot;).toString());
+    m_ui-&gt;pass-&gt;setText(settings.value(&quot;password&quot;).toString());
+
+    settings.endGroup();
+    settings.endGroup();
+}
</ins></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>