Implement reconnect.
--- freeswitch/trunk/contrib/jmesquita/fsgui/src/plugins/consoleplugin/centralWidget.ui 2009-09-07 23:49:18 UTC (rev 14782)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/plugins/consoleplugin/centralWidget.ui 2009-09-08 04:02:01 UTC (rev 14783)
@@ -47,7 +47,7 @@
<x>0</x>
<y>0</y>
<width>673</width>
- <height>22</height>
+ <height>25</height>
</rect>
</property>
<widget class="QMenu" name="menu_Server">
@@ -57,6 +57,7 @@
<addaction name="action_Server_Manager"/>
<addaction name="separator"/>
<addaction name="action_Connect"/>
+ <addaction name="action_Reconnect"/>
<addaction name="action_Disconnect"/>
</widget>
<widget class="QMenu" name="menu_File">
@@ -151,6 +152,17 @@
<string>&Pastebin Log</string>
</property>
</action>
+ <action name="action_Reconnect">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&Reconnect</string>
+ </property>
+ <property name="shortcut">
+ <string>Ctrl+R</string>
+ </property>
+ </action>
</widget>
<resources>
<include location="../../resources/resources.qrc"/>
--- freeswitch/trunk/contrib/jmesquita/fsgui/src/plugins/consoleplugin/consoleplugin.cpp 2009-09-07 23:49:18 UTC (rev 14782)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/plugins/consoleplugin/consoleplugin.cpp 2009-09-08 04:02:01 UTC (rev 14783)
@@ -25,6 +25,8 @@
this, SLOT(connect()));
QObject::connect(consoleWindow->action_Disconnect, SIGNAL(triggered()),
this, SLOT(disconnect()));
+ QObject::connect(consoleWindow->action_Reconnect, SIGNAL(triggered()),
+ this, SLOT(reconnect()));
QObject::connect(consoleWindow->action_Clear, SIGNAL(triggered()),
this, SLOT(clearLogContents()));
QObject::connect(consoleWindow->action_Save_log, SIGNAL(triggered()),
@@ -440,6 +442,7 @@
{
consoleWindow->action_Connect->setDisabled(esl->isConnected());
consoleWindow->action_Disconnect->setEnabled(esl->isConnected());
+ consoleWindow->action_Reconnect->setEnabled(esl->isConnected());
}
}
@@ -452,6 +455,12 @@
}
}
+void ConsolePlugin::reconnect()
+{
+ disconnect();
+ QTimer::singleShot(500, this, SLOT(connect()));
+}
+
void ConsolePlugin::disconnect()
{
ESLconnection *esl = serverManager->getESLconnection(PLUGIN_NAME, consoleWindow->tabConsole->tabText(consoleWindow->tabConsole->currentIndex()));
--- freeswitch/trunk/contrib/jmesquita/fsgui/src/plugins/consoleplugin/consoleplugin.h 2009-09-07 23:49:18 UTC (rev 14782)
+++ freeswitch/trunk/contrib/jmesquita/fsgui/src/plugins/consoleplugin/consoleplugin.h 2009-09-08 04:02:01 UTC (rev 14783)
@@ -74,6 +74,7 @@
private slots:
void connectionStateChanged();
void connect();
+ void reconnect();
void disconnect();
void newConnection();
void clearLogContents();