138 connect(chatEditLine, SIGNAL(returnPressed()), this, SLOT(returnPressed())); |
138 connect(chatEditLine, SIGNAL(returnPressed()), this, SLOT(returnPressed())); |
139 |
139 |
140 mainLayout.addWidget(chatEditLine, 2, 0); |
140 mainLayout.addWidget(chatEditLine, 2, 0); |
141 |
141 |
142 chatText = new QTextBrowser(this); |
142 chatText = new QTextBrowser(this); |
143 chatText->document()->setDefaultStyleSheet(STYLE); |
143 |
|
144 // load external stylesheet if there is any |
|
145 QFile * file = |
|
146 new QFile(HWDataManager::instance().findFileForRead("css/chat.css")); |
|
147 |
|
148 if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text)) |
|
149 { |
|
150 QString style = ""; |
|
151 QTextStream in(file); |
|
152 while (!in.atEnd()) |
|
153 { |
|
154 QString line = in.readLine(); |
|
155 if(!line.isEmpty()) |
|
156 style.append(line); |
|
157 } |
|
158 chatText->document()->setDefaultStyleSheet(style); |
|
159 } |
|
160 else |
|
161 chatText->document()->setDefaultStyleSheet(STYLE); |
|
162 |
144 chatText->setMinimumHeight(20); |
163 chatText->setMinimumHeight(20); |
145 chatText->setMinimumWidth(10); |
164 chatText->setMinimumWidth(10); |
146 chatText->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
165 chatText->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); |
147 chatText->setOpenLinks(false); |
166 chatText->setOpenLinks(false); |
148 connect(chatText, SIGNAL(anchorClicked(const QUrl&)), |
167 connect(chatText, SIGNAL(anchorClicked(const QUrl&)), |