Documentation/Source/eric5.Cooperation.ChatWidget.html

Tue, 30 Mar 2010 15:57:01 +0000

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 30 Mar 2010 15:57:01 +0000
changeset 160
32cc58d56d4d
parent 158
6a561f87bc07
child 161
bb3cc98f4104
permissions
-rw-r--r--

Added a context menu to the chat widget to clear the chat, to save it or to copy it to the clipboard.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
<html><head>
<title>eric5.Cooperation.ChatWidget</title>
<style>
body {
    background:white;
    margin: 0em 1em 10em 1em;
    color: black;
}

h1 { color: white; background: #4FA4FF; }
h2 { color: white; background: #4FA4FF; }
h3 { color: white; background: #00557F; }
h4 { color: white; background: #00557F; }
    
a { color: #AA5500; }

</style>
</head>
<body><a NAME="top" ID="top"></a>
<h1>eric5.Cooperation.ChatWidget</h1>
<p>
Module implementing the chat dialog.
</p>
<h3>Global Attributes</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Classes</h3>
<table>
<tr>
<td><a href="#ChatWidget">ChatWidget</a></td>
<td>Class implementing the chat dialog.</td>
</tr>
</table>
<h3>Functions</h3>
<table>
<tr><td>None</td></tr>
</table>
<hr /><hr />
<a NAME="ChatWidget" ID="ChatWidget"></a>
<h2>ChatWidget</h2>
<p>
    Class implementing the chat dialog.
</p><h4>Signals</h4>
<dl>
<dt>cancelEdit()</dt>
<dd>
emitted to cancel a shared edit session
</dd><dt>connected(connected)</dt>
<dd>
emitted to signal a change of the connected
            state (boole)
</dd><dt>editorCommand(hash, filename, message)</dt>
<dd>
emitted when an editor command
            has been received (string, string, string)
</dd><dt>sendEdit()</dt>
<dd>
emitted to send a shared edit session
</dd><dt>shareEditor(share)</dt>
<dd>
emitted to signal a share is requested (bool)
</dd><dt>startEdit()</dt>
<dd>
emitted to start a shared edit session
</dd>
</dl>
<h3>Derived from</h3>
QWidget, Ui_ChatWidget
<h3>Class Attributes</h3>
<table>
<tr><td>cancelEdit</td></tr><tr><td>connected</td></tr><tr><td>editorCommand</td></tr><tr><td>sendEdit</td></tr><tr><td>shareEditor</td></tr><tr><td>startEdit</td></tr>
</table>
<h3>Methods</h3>
<table>
<tr>
<td><a href="#ChatWidget.__init__">ChatWidget</a></td>
<td>Constructor</td>
</tr><tr>
<td><a href="#ChatWidget.__clearChat">__clearChat</a></td>
<td>Private slot to clear the contents of the chat display.</td>
</tr><tr>
<td><a href="#ChatWidget.__copyChat">__copyChat</a></td>
<td>Private slot to copy the contents of the chat display to the clipboard.</td>
</tr><tr>
<td><a href="#ChatWidget.__editorCommandMessage">__editorCommandMessage</a></td>
<td>Private slot to handle editor command messages from the client.</td>
</tr><tr>
<td><a href="#ChatWidget.__handleMessage">__handleMessage</a></td>
<td>Private slot handling the Return key pressed in the message edit.</td>
</tr><tr>
<td><a href="#ChatWidget.__initialConnectionRefused">__initialConnectionRefused</a></td>
<td>Private slot to handle the refusal of the initial connection.</td>
</tr><tr>
<td><a href="#ChatWidget.__newParticipant">__newParticipant</a></td>
<td>Private slot handling a new participant joining.</td>
</tr><tr>
<td><a href="#ChatWidget.__participantLeft">__participantLeft</a></td>
<td>Private slot handling a participant leaving the session.</td>
</tr><tr>
<td><a href="#ChatWidget.__saveChat">__saveChat</a></td>
<td>Private slot to save the contents of the chat display.</td>
</tr><tr>
<td><a href="#ChatWidget.__setConnected">__setConnected</a></td>
<td>Private slot to set the connected state.</td>
</tr><tr>
<td><a href="#ChatWidget.__showErrorMessage">__showErrorMessage</a></td>
<td>Private slot to show an error message.</td>
</tr><tr>
<td><a href="#ChatWidget.appendMessage">appendMessage</a></td>
<td>Public slot to append a message to the display.</td>
</tr><tr>
<td><a href="#ChatWidget.checkEditorActions">checkEditorActions</a></td>
<td>Public slot to set action according to an editor's state.</td>
</tr><tr>
<td><a href="#ChatWidget.getClient">getClient</a></td>
<td>Public method to get a reference to the cooperation client.</td>
</tr><tr>
<td><a href="#ChatWidget.on_cancelEditButton_clicked">on_cancelEditButton_clicked</a></td>
<td>Private slot to cancel a shared edit session.</td>
</tr><tr>
<td><a href="#ChatWidget.on_chatEdit_customContextMenuRequested">on_chatEdit_customContextMenuRequested</a></td>
<td>Private slot to show the context menu for the chat.</td>
</tr><tr>
<td><a href="#ChatWidget.on_connectButton_clicked">on_connectButton_clicked</a></td>
<td>Private slot initiating the connection.</td>
</tr><tr>
<td><a href="#ChatWidget.on_hostEdit_textChanged">on_hostEdit_textChanged</a></td>
<td>Private slot handling the entry of a host to connect to.</td>
</tr><tr>
<td><a href="#ChatWidget.on_sendEditButton_clicked">on_sendEditButton_clicked</a></td>
<td>Private slot to end a shared edit session and send the changes.</td>
</tr><tr>
<td><a href="#ChatWidget.on_serverButton_clicked">on_serverButton_clicked</a></td>
<td>Private slot to start the server.</td>
</tr><tr>
<td><a href="#ChatWidget.on_shareButton_clicked">on_shareButton_clicked</a></td>
<td>Private slot to share the current editor.</td>
</tr><tr>
<td><a href="#ChatWidget.on_startEditButton_clicked">on_startEditButton_clicked</a></td>
<td>Private slot to start a shared edit session.</td>
</tr><tr>
<td><a href="#ChatWidget.preferencesChanged">preferencesChanged</a></td>
<td>Public slot to handle a change of preferences.</td>
</tr>
</table>
<a NAME="ChatWidget.__init__" ID="ChatWidget.__init__"></a>
<h4>ChatWidget (Constructor)</h4>
<b>ChatWidget</b>(<i>port = -1, parent = None</i>)
<p>
        Constructor
</p><dl>
<dt><i>port</i></dt>
<dd>
port to be used for the cooperation server (integer)
</dd><dt><i>parent</i></dt>
<dd>
reference to the parent widget (QWidget)
</dd>
</dl><a NAME="ChatWidget.__clearChat" ID="ChatWidget.__clearChat"></a>
<h4>ChatWidget.__clearChat</h4>
<b>__clearChat</b>(<i></i>)
<p>
        Private slot to clear the contents of the chat display.
</p><a NAME="ChatWidget.__copyChat" ID="ChatWidget.__copyChat"></a>
<h4>ChatWidget.__copyChat</h4>
<b>__copyChat</b>(<i></i>)
<p>
        Private slot to copy the contents of the chat display to the clipboard.
</p><a NAME="ChatWidget.__editorCommandMessage" ID="ChatWidget.__editorCommandMessage"></a>
<h4>ChatWidget.__editorCommandMessage</h4>
<b>__editorCommandMessage</b>(<i>hash, fileName, message</i>)
<p>
        Private slot to handle editor command messages from the client.
</p><dl>
<dt><i>hash</i></dt>
<dd>
hash of the project (string)
</dd><dt><i>fileName</i></dt>
<dd>
project relative file name of the editor (string)
</dd><dt><i>message</i></dt>
<dd>
command message (string)
</dd>
</dl><a NAME="ChatWidget.__handleMessage" ID="ChatWidget.__handleMessage"></a>
<h4>ChatWidget.__handleMessage</h4>
<b>__handleMessage</b>(<i></i>)
<p>
        Private slot handling the Return key pressed in the message edit.
</p><a NAME="ChatWidget.__initialConnectionRefused" ID="ChatWidget.__initialConnectionRefused"></a>
<h4>ChatWidget.__initialConnectionRefused</h4>
<b>__initialConnectionRefused</b>(<i></i>)
<p>
        Private slot to handle the refusal of the initial connection.
</p><a NAME="ChatWidget.__newParticipant" ID="ChatWidget.__newParticipant"></a>
<h4>ChatWidget.__newParticipant</h4>
<b>__newParticipant</b>(<i>nick</i>)
<p>
        Private slot handling a new participant joining.
</p><dl>
<dt><i>nick</i></dt>
<dd>
nick name of the new participant (string)
</dd>
</dl><a NAME="ChatWidget.__participantLeft" ID="ChatWidget.__participantLeft"></a>
<h4>ChatWidget.__participantLeft</h4>
<b>__participantLeft</b>(<i>nick</i>)
<p>
        Private slot handling a participant leaving the session.
</p><dl>
<dt><i>nick</i></dt>
<dd>
nick name of the participant (string)
</dd>
</dl><a NAME="ChatWidget.__saveChat" ID="ChatWidget.__saveChat"></a>
<h4>ChatWidget.__saveChat</h4>
<b>__saveChat</b>(<i></i>)
<p>
        Private slot to save the contents of the chat display.
</p><a NAME="ChatWidget.__setConnected" ID="ChatWidget.__setConnected"></a>
<h4>ChatWidget.__setConnected</h4>
<b>__setConnected</b>(<i>connected</i>)
<p>
        Private slot to set the connected state.
</p><dl>
<dt><i>connected</i></dt>
<dd>
new connected state (boolean)
</dd>
</dl><a NAME="ChatWidget.__showErrorMessage" ID="ChatWidget.__showErrorMessage"></a>
<h4>ChatWidget.__showErrorMessage</h4>
<b>__showErrorMessage</b>(<i>message</i>)
<p>
        Private slot to show an error message.
</p><dl>
<dt><i>message</i></dt>
<dd>
error message to show (string)
</dd>
</dl><a NAME="ChatWidget.appendMessage" ID="ChatWidget.appendMessage"></a>
<h4>ChatWidget.appendMessage</h4>
<b>appendMessage</b>(<i>from_, message</i>)
<p>
        Public slot to append a message to the display.
</p><dl>
<dt><i>from_</i></dt>
<dd>
originator of the message (string)
</dd><dt><i>message</i></dt>
<dd>
message to be appended (string)
</dd>
</dl><a NAME="ChatWidget.checkEditorActions" ID="ChatWidget.checkEditorActions"></a>
<h4>ChatWidget.checkEditorActions</h4>
<b>checkEditorActions</b>(<i>editor</i>)
<p>
        Public slot to set action according to an editor's state.
</p><dl>
<dt><i>editor</i></dt>
<dd>
reference to the editor (Editor)
</dd>
</dl><a NAME="ChatWidget.getClient" ID="ChatWidget.getClient"></a>
<h4>ChatWidget.getClient</h4>
<b>getClient</b>(<i></i>)
<p>
        Public method to get a reference to the cooperation client.
</p><a NAME="ChatWidget.on_cancelEditButton_clicked" ID="ChatWidget.on_cancelEditButton_clicked"></a>
<h4>ChatWidget.on_cancelEditButton_clicked</h4>
<b>on_cancelEditButton_clicked</b>(<i></i>)
<p>
        Private slot to cancel a shared edit session.
</p><a NAME="ChatWidget.on_chatEdit_customContextMenuRequested" ID="ChatWidget.on_chatEdit_customContextMenuRequested"></a>
<h4>ChatWidget.on_chatEdit_customContextMenuRequested</h4>
<b>on_chatEdit_customContextMenuRequested</b>(<i>pos</i>)
<p>
        Private slot to show the context menu for the chat.
</p><dl>
<dt><i>pos</i></dt>
<dd>
the position of the mouse pointer (QPoint)
</dd>
</dl><a NAME="ChatWidget.on_connectButton_clicked" ID="ChatWidget.on_connectButton_clicked"></a>
<h4>ChatWidget.on_connectButton_clicked</h4>
<b>on_connectButton_clicked</b>(<i></i>)
<p>
        Private slot initiating the connection.
</p><a NAME="ChatWidget.on_hostEdit_textChanged" ID="ChatWidget.on_hostEdit_textChanged"></a>
<h4>ChatWidget.on_hostEdit_textChanged</h4>
<b>on_hostEdit_textChanged</b>(<i>host</i>)
<p>
        Private slot handling the entry of a host to connect to.
</p><dl>
<dt><i>host</i></dt>
<dd>
host to connect to (string)
</dd>
</dl><a NAME="ChatWidget.on_sendEditButton_clicked" ID="ChatWidget.on_sendEditButton_clicked"></a>
<h4>ChatWidget.on_sendEditButton_clicked</h4>
<b>on_sendEditButton_clicked</b>(<i></i>)
<p>
        Private slot to end a shared edit session and send the changes.
</p><a NAME="ChatWidget.on_serverButton_clicked" ID="ChatWidget.on_serverButton_clicked"></a>
<h4>ChatWidget.on_serverButton_clicked</h4>
<b>on_serverButton_clicked</b>(<i></i>)
<p>
        Private slot to start the server.
</p><a NAME="ChatWidget.on_shareButton_clicked" ID="ChatWidget.on_shareButton_clicked"></a>
<h4>ChatWidget.on_shareButton_clicked</h4>
<b>on_shareButton_clicked</b>(<i>checked</i>)
<p>
        Private slot to share the current editor.
</p><dl>
<dt><i>checked</i></dt>
<dd>
flag indicating the button state (boolean)
</dd>
</dl><a NAME="ChatWidget.on_startEditButton_clicked" ID="ChatWidget.on_startEditButton_clicked"></a>
<h4>ChatWidget.on_startEditButton_clicked</h4>
<b>on_startEditButton_clicked</b>(<i>checked</i>)
<p>
        Private slot to start a shared edit session.
</p><dl>
<dt><i>checked</i></dt>
<dd>
flag indicating the button state (boolean)
</dd>
</dl><a NAME="ChatWidget.preferencesChanged" ID="ChatWidget.preferencesChanged"></a>
<h4>ChatWidget.preferencesChanged</h4>
<b>preferencesChanged</b>(<i></i>)
<p>
        Public slot to handle a change of preferences.
</p>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>

eric ide

mercurial