00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include "chatpage.h"
00011
00012 #include <qvariant.h>
00013 #include <qlistbox.h>
00014 #include <qtextedit.h>
00015 #include <qlayout.h>
00016 #include <qtooltip.h>
00017 #include <qwhatsthis.h>
00018 #include <qimage.h>
00019 #include <qpixmap.h>
00020
00021 #include <qsplitter.h>
00022 #include <qvaluelist.h>
00023
00024 #include "mtpbrowser.h"
00025
00026
00027
00028
00029
00030 ChatPage::ChatPage( QWidget* parent, const char* name, WFlags fl )
00031 : Master( parent, name, fl )
00032 {
00033 if ( !name )
00034 setName( "ChatPage" );
00035
00036 ChatPageLayout = new QGridLayout( this, 1, 1, 6, 6, "ChatPageLayout");
00037
00038 QSplitter *vsplit = new QSplitter(Qt::Vertical,this);
00039 QSplitter *hsplit = new QSplitter(Qt::Horizontal,vsplit);
00040
00041
00042 chat_view = new MtpBrowser(hsplit,"chat_view");
00043 users_box = new QListBox(hsplit,"users_box");
00044
00045 users_box->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)7, 0, 0, users_box->sizePolicy().hasHeightForWidth() ) );
00046 users_box->setMinimumSize( QSize( 75, 200 ) );
00047
00048 chat_edit = new QTextEdit(vsplit,"chat_edit");
00049
00050 chat_edit->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, chat_edit->sizePolicy().hasHeightForWidth() ) );
00051 chat_edit->setMinimumSize( QSize( 300, 50 ) );
00052 chat_edit->setFrameShape( QTextEdit::LineEditPanel );
00053
00054
00055 QValueList<int> list = vsplit->sizes();
00056 int tmp = list[1];
00057 list[1] = 0;
00058 list[0] += tmp-list[1];
00059 vsplit->setSizes(list);
00060
00061 list = hsplit->sizes();
00062 tmp = list[1];
00063 list[1] = 0;
00064 list[0] += tmp-list[1];
00065 hsplit->setSizes(list);
00066
00067 ChatPageLayout->addWidget(vsplit,0,0);
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 resize( QSize(573, 361).expandedTo(minimumSizeHint()) );
00090 repaint();
00091 }
00092
00093
00094
00095
00096 ChatPage::~ChatPage()
00097 {
00098
00099 }
00100
00101
00102
00103
00104
00105 void ChatPage::languageChange()
00106 {
00107 setCaption( tr( "Form1" ) );
00108 QToolTip::add( chat_edit, tr( "SHIFT+UP/DOWN for history - CTRL+ENTER to insert a new line" ) );
00109 }
00110
00111 void ChatPage::returnPressed()
00112 {
00113 qWarning( "ChatPage::returnPressed(): Not implemented yet" );
00114 }
00115