diff options
| author | OmniTroid <davidskoland@gmail.com> | 2017-03-25 02:27:17 +0100 |
|---|---|---|
| committer | OmniTroid <davidskoland@gmail.com> | 2017-03-25 02:27:17 +0100 |
| commit | 332d20c858fa300cd5895122a5bc438e99a784d2 (patch) | |
| tree | a4d9dad5134879a0ee088772f1bf5aab8a4ac914 | |
| parent | 924d29e46c95aaad47116b5c21f0daf1521fa05a (diff) | |
added aotextarea class and prepared to refactor ooc chats and fix another bug related to hyperlinks
| -rw-r--r-- | Attorney_Online_remake.pro | 6 | ||||
| -rw-r--r-- | aotextarea.cpp | 6 | ||||
| -rw-r--r-- | aotextarea.h | 14 | ||||
| -rw-r--r-- | courtroom.cpp | 6 |
4 files changed, 28 insertions, 4 deletions
diff --git a/Attorney_Online_remake.pro b/Attorney_Online_remake.pro index 5e988c8c..0c9ed9d1 100644 --- a/Attorney_Online_remake.pro +++ b/Attorney_Online_remake.pro @@ -43,7 +43,8 @@ SOURCES += main.cpp\ aoblipplayer.cpp \ evidence.cpp \ aoevidencebutton.cpp \ - charselect.cpp + charselect.cpp \ + aotextarea.cpp HEADERS += lobby.h \ aoimage.h \ @@ -68,7 +69,8 @@ HEADERS += lobby.h \ aosfxplayer.h \ aomusicplayer.h \ aoblipplayer.h \ - aoevidencebutton.h + aoevidencebutton.h \ + aotextarea.h unix:LIBS += -L$$PWD -lbass win32:LIBS += "$$PWD/bass.dll" diff --git a/aotextarea.cpp b/aotextarea.cpp new file mode 100644 index 00000000..1cffd258 --- /dev/null +++ b/aotextarea.cpp @@ -0,0 +1,6 @@ +#include "aotextarea.h" + +AOTextArea::AOTextArea() +{ + +} diff --git a/aotextarea.h b/aotextarea.h new file mode 100644 index 00000000..b5a2e0df --- /dev/null +++ b/aotextarea.h @@ -0,0 +1,14 @@ +#ifndef AOTEXTAREA_H +#define AOTEXTAREA_H + +#include <QTextBrowser> + +class AOTextArea : public QTextBrowser +{ +public: + AOTextArea(); + + append_text(); +}; + +#endif // AOTEXTAREA_H diff --git a/courtroom.cpp b/courtroom.cpp index 1a2eb7c0..db2ab069 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -9,6 +9,7 @@ #include <QDebug> #include <QScrollBar> +#include <QRegExp> Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() { @@ -774,13 +775,14 @@ void Courtroom::append_server_chatmessage(QString f_name, QString f_message) ui_server_chatlog->insertPlainText(f_name + ": "); - QStringList word_list = f_message.split(" "); + QRegExp split_rx("(\\ |\\n)"); + QStringList word_list = f_message.split(split_rx); for (QString i_word : word_list) { if (i_word.startsWith("http")) { - i_word.replace("\n", "").replace("\r", ""); + i_word.replace("\r", ""); ui_server_chatlog->insertHtml("<a href=\"" + i_word + "\">" + i_word + "</a> "); } else |
