diff --git a/src/chatdlg.cpp b/src/chatdlg.cpp index 98bd4531..8dfd3176 100755 --- a/src/chatdlg.cpp +++ b/src/chatdlg.cpp @@ -31,17 +31,26 @@ CChatDlg::CChatDlg ( QWidget* parent, Qt::WindowFlags f ) : { setupUi ( this ); + // add help text to controls ----------------------------------------------- + lineEditLocalInputText->setAccessibleName ( "New chat text edit box" ); + TextViewChatWindow->setAccessibleName ( "Chat history" ); + + // clear chat window and edit line TextViewChatWindow->clear(); lineEditLocalInputText->clear(); // Connections ------------------------------------------------------------- - QObject::connect ( lineEditLocalInputText, SIGNAL ( textChanged ( const QString& ) ), + QObject::connect ( lineEditLocalInputText, + SIGNAL ( textChanged ( const QString& ) ), this, SLOT ( OnChatTextChanged ( const QString& ) ) ); QObject::connect ( lineEditLocalInputText, SIGNAL ( returnPressed() ), this, SLOT ( OnNewLocalInputText() ) ); + + QObject::connect ( pbClear, SIGNAL ( pressed() ), + this, SLOT ( OnClearButtonPressed() ) ); } void CChatDlg::OnChatTextChanged ( const QString& strNewText ) @@ -61,8 +70,18 @@ void CChatDlg::OnNewLocalInputText() lineEditLocalInputText->clear(); } +void CChatDlg::OnClearButtonPressed() +{ + // clear chat window + TextViewChatWindow->clear(); +} + void CChatDlg::AddChatText ( QString strChatText ) { // add new text in chat window TextViewChatWindow->append ( strChatText ); + + // notify accessibility plugin that text has changed + QAccessible::updateAccessibility ( TextViewChatWindow, 0, + QAccessible::ValueChanged ); } diff --git a/src/chatdlg.h b/src/chatdlg.h index eba87f89..1a744c45 100755 --- a/src/chatdlg.h +++ b/src/chatdlg.h @@ -28,6 +28,7 @@ #include #include #include +#include #include "global.h" #ifdef _WIN32 # include "../windows/moc/chatdlgbase.h" @@ -49,6 +50,7 @@ public: public slots: void OnNewLocalInputText(); void OnChatTextChanged ( const QString& strNewText ); + void OnClearButtonPressed(); signals: void NewLocalInputText ( QString strNewText ); diff --git a/src/chatdlgbase.ui b/src/chatdlgbase.ui index facd372b..43366470 100755 --- a/src/chatdlgbase.ui +++ b/src/chatdlgbase.ui @@ -26,28 +26,17 @@ - + + + Qt::LinksAccessibleByKeyboard|Qt::LinksAccessibleByMouse|Qt::NoTextInteraction|Qt::TextBrowserInteraction|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + - - 6 - - - 0 - - - 0 - - - 0 - - - 0 - @@ -58,12 +47,22 @@ - 20 - 20 + 181 + 27 + + + + Cl&ear + + + false + + + @@ -83,8 +82,9 @@ lineEditLocalInputText - buttonClose TextViewChatWindow + pbClear + buttonClose