Revision
14265
Author
jmesquita
Date
2009-07-15 21:08:21 -0500 (Wed, 15 Jul 2009)

Log Message

We are still unstable, but we can close tabs as well. Send with enter fixed again after I broke it.

Modified Paths

Diff

Modified: freeswitch/trunk/contrib/jmesquita/fsgui/resources/consolepage.ui (14264 => 14265)


--- freeswitch/trunk/contrib/jmesquita/fsgui/resources/consolepage.ui	2009-07-16 00:49:41 UTC (rev 14264)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/resources/consolepage.ui	2009-07-16 02:08:21 UTC (rev 14265)
@@ -30,6 +30,9 @@
        <property name="text">
         <string>Send</string>
        </property>
+       <property name="shortcut">
+        <string>Return</string>
+       </property>
        <property name="autoDefault">
         <bool>true</bool>
        </property>

Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/consolepage.cpp (14264 => 14265)


--- freeswitch/trunk/contrib/jmesquita/fsgui/src/consolepage.cpp	2009-07-16 00:49:41 UTC (rev 14264)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/consolepage.cpp	2009-07-16 02:08:21 UTC (rev 14265)
@@ -50,6 +50,14 @@
 consolePage::~consolePage()
 {
     delete m_ui;
+    if (eslConnection->isRunning())
+    {
+        qDebug() << "Thread is running, lets wait.";
+        eslConnection->disconnect();
+        eslConnection->wait();
+    }
+    delete eslConnection;
+    qDebug() << "We quit!!!";
 }
 void consolePage::init(QString host)
 {
@@ -71,7 +79,6 @@
     settings.endGroup();
     settings.endGroup();
 
-    qDebug() << settings.allKeys();
     eslConnection = new ESLconnection(host.toAscii(),
                                       port.toAscii(),
                                       pass.toAscii());

Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/esl_connection.cpp (14264 => 14265)


--- freeswitch/trunk/contrib/jmesquita/fsgui/src/esl_connection.cpp	2009-07-16 00:49:41 UTC (rev 14264)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/esl_connection.cpp	2009-07-16 02:08:21 UTC (rev 14265)
@@ -75,8 +75,6 @@
 {
     int x_port = _port->toInt();
 
-    esl_global_set_default_logger(7);
-
     if (esl_connect(&handle, _host->toAscii(), x_port, _pass->toAscii()) == ESL_SUCCESS)
     {
         sendRecv("log 7");
@@ -302,6 +300,7 @@
             }
         }
     }
+    qDebug() << "Do we ever get here?";
 
 }
 

Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp (14264 => 14265)


--- freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp	2009-07-16 00:49:41 UTC (rev 14264)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/fs_gui.cpp	2009-07-16 02:08:21 UTC (rev 14265)
@@ -54,6 +54,8 @@
             this, SLOT(newConnectionFromDialog()));
     connect(m_ui->actionAbout, SIGNAL(triggered()),
             this, SLOT(showAbout()));
+    connect(m_ui->tabWidget, SIGNAL(tabCloseRequested(int)),
+            this, SLOT(closeTab(int)));
 
     m_ui->tabWidget->clear();
 }
@@ -102,5 +104,12 @@
         consolePage *page = new consolePage();
         m_ui->tabWidget->addTab(page, serverDialog->getHost());
         page->init(serverDialog->getHost());
+        m_ui->tabWidget->setCurrentWidget(page);
     }
 }
+void Cfsgui::closeTab(int index)
+{
+    QWidget *tab = m_ui->tabWidget->widget(index);
+    m_ui->tabWidget->removeTab(index);
+    delete tab;
+}

Modified: freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h (14264 => 14265)


--- freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h	2009-07-16 00:49:41 UTC (rev 14264)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/include/fs_gui.h	2009-07-16 02:08:21 UTC (rev 14265)
@@ -61,6 +61,7 @@
 private slots:
     void showAbout();
     void newConnectionFromDialog();
+    void closeTab(int);
 
 private:
     Ui::Cfsgui *m_ui;