mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-20 13:19:07 -04:00
Merge 75e03f91ff
into c3640306bd
This commit is contained in:
commit
0de656b1f6
5 changed files with 129 additions and 71 deletions
|
@ -914,11 +914,22 @@ void ChatLobbyWidget::showBlankPage(ChatLobbyId id, bool subscribed /*= false*/)
|
||||||
{
|
{
|
||||||
ui.lobbyname_lineEdit->setText( RsHtml::plainText(it->lobby_name) );
|
ui.lobbyname_lineEdit->setText( RsHtml::plainText(it->lobby_name) );
|
||||||
ui.lobbyid_lineEdit->setText( QString::number((*it).lobby_id,16) );
|
ui.lobbyid_lineEdit->setText( QString::number((*it).lobby_id,16) );
|
||||||
ui.lobbytopic_lineEdit->setText( RsHtml::plainText(it->lobby_topic) );
|
//ui.lobbytopic_lineEdit->setText( RsHtml::plainText(it->lobby_topic) );
|
||||||
ui.lobbytype_lineEdit->setText( (( (*it).lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC)?tr("Public"):tr("Private")) );
|
ui.lobbytype_lineEdit->setText( (( (*it).lobby_flags & RS_CHAT_LOBBY_FLAGS_PUBLIC)?tr("Public"):tr("Private")) );
|
||||||
ui.lobbysec_lineEdit->setText( (( (*it).lobby_flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED)?tr("No anonymous IDs"):tr("Anonymous IDs accepted")) );
|
ui.lobbysec_lineEdit->setText( (( (*it).lobby_flags & RS_CHAT_LOBBY_FLAGS_PGP_SIGNED)?tr("No anonymous IDs"):tr("Anonymous IDs accepted")) );
|
||||||
ui.lobbypeers_lineEdit->setText( QString::number((*it).total_number_of_peers) );
|
ui.lobbypeers_lineEdit->setText( QString::number((*it).total_number_of_peers) );
|
||||||
|
|
||||||
|
QString Topic = RsHtml::plainText(it->lobby_topic);
|
||||||
|
QString shortTopic = Topic.left(130) + "...";
|
||||||
|
ui.lobbytopic_lineEdit->setText(shortTopic);
|
||||||
|
|
||||||
|
QString formatDescription = QString::fromUtf8(it->lobby_topic.c_str());
|
||||||
|
unsigned int formatFlag = RSHTML_FORMATTEXT_EMBED_LINKS;
|
||||||
|
|
||||||
|
formatDescription = RsHtml().formatText(NULL, formatDescription, formatFlag);
|
||||||
|
|
||||||
|
ui.lobbydesc_textBrowser->setText(formatDescription);
|
||||||
|
|
||||||
QString text = tr("You're subscribed to this chat room; Double click to show window and chat.") ;
|
QString text = tr("You're subscribed to this chat room; Double click to show window and chat.") ;
|
||||||
if (!subscribed)
|
if (!subscribed)
|
||||||
{
|
{
|
||||||
|
@ -942,6 +953,7 @@ void ChatLobbyWidget::showBlankPage(ChatLobbyId id, bool subscribed /*= false*/)
|
||||||
ui.lobbytype_lineEdit->clear();
|
ui.lobbytype_lineEdit->clear();
|
||||||
ui.lobbypeers_lineEdit->clear();
|
ui.lobbypeers_lineEdit->clear();
|
||||||
ui.lobbysec_lineEdit->clear();
|
ui.lobbysec_lineEdit->clear();
|
||||||
|
ui.lobbydesc_textBrowser->clear();
|
||||||
|
|
||||||
QString text = tr("No chat room selected. \nSelect chat rooms at left to show details.\nDouble click a chat room to enter and chat.") ;
|
QString text = tr("No chat room selected. \nSelect chat rooms at left to show details.\nDouble click a chat room to enter and chat.") ;
|
||||||
ui.info_Label_Lobby->setText(text) ;
|
ui.info_Label_Lobby->setText(text) ;
|
||||||
|
|
|
@ -254,17 +254,10 @@
|
||||||
<property name="topMargin">
|
<property name="topMargin">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="4" column="1">
|
||||||
<widget class="QLabel" name="lobbyname_label">
|
<widget class="QLabel" name="lobbysec_lineEdit">
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<pointsize>12</pointsize>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Chat room Name:</string>
|
<string>TextLabel</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -288,17 +281,29 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="3" column="1">
|
||||||
<widget class="QLabel" name="lobbyid_label">
|
<widget class="QLabel" name="lobbytype_lineEdit">
|
||||||
<property name="font">
|
<property name="sizePolicy">
|
||||||
<font>
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
<pointsize>12</pointsize>
|
<horstretch>0</horstretch>
|
||||||
<weight>75</weight>
|
<verstretch>0</verstretch>
|
||||||
<bold>true</bold>
|
</sizepolicy>
|
||||||
</font>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Chat room Id:</string>
|
<string>TextLabel</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="1">
|
||||||
|
<widget class="QLabel" name="lobbypeers_lineEdit">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>TextLabel</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -315,8 +320,8 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="lobbytopic_label">
|
<widget class="QLabel" name="lobbytype_label">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>12</pointsize>
|
<pointsize>12</pointsize>
|
||||||
|
@ -325,7 +330,35 @@
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Topic:</string>
|
<string>Type:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="lobbyname_label">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Chat room Name:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="lobbyid_label">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Chat room Id:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -345,8 +378,8 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="5" column="0">
|
||||||
<widget class="QLabel" name="lobbytype_label">
|
<widget class="QLabel" name="lobbypeers_label">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>12</pointsize>
|
<pointsize>12</pointsize>
|
||||||
|
@ -355,20 +388,7 @@
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Type:</string>
|
<string>Peers:</string>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QLabel" name="lobbytype_lineEdit">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>TextLabel</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -386,15 +406,33 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="6" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="lobbysec_lineEdit">
|
<widget class="QGroupBox" name="groupBox">
|
||||||
<property name="text">
|
<property name="font">
|
||||||
<string>TextLabel</string>
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="title">
|
||||||
|
<string>Room infos</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QTextBrowser" name="lobbydesc_textBrowser">
|
||||||
|
<property name="textInteractionFlags">
|
||||||
|
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse</set>
|
||||||
|
</property>
|
||||||
|
<property name="openExternalLinks">
|
||||||
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="0">
|
</layout>
|
||||||
<widget class="QLabel" name="lobbypeers_label">
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="lobbytopic_label">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>12</pointsize>
|
<pointsize>12</pointsize>
|
||||||
|
@ -403,35 +441,12 @@
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Peers:</string>
|
<string>Topic:</string>
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="1">
|
|
||||||
<widget class="QLabel" name="lobbypeers_lineEdit">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>TextLabel</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="info_Label_Lobby">
|
|
||||||
<property name="text">
|
|
||||||
<string notr="true">TextLabel</string>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<spacer name="lobbyInfoVSpacer">
|
<spacer name="lobbyInfoVSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
@ -445,6 +460,16 @@
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="info_Label_Lobby">
|
||||||
|
<property name="text">
|
||||||
|
<string notr="true">TextLabel</string>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -998,7 +998,10 @@ void ChatWidget::scrollToAnchor(QString anchor)
|
||||||
|
|
||||||
void ChatWidget::setWelcomeMessage(QString &text)
|
void ChatWidget::setWelcomeMessage(QString &text)
|
||||||
{
|
{
|
||||||
ui->textBrowser->setText(text);
|
unsigned int formatTextFlag = RSHTML_FORMATTEXT_EMBED_LINKS | RSHTML_FORMATTEXT_OPTIMIZE;
|
||||||
|
QString formattedWelcomeMessage = RsHtml().formatText(ui->textBrowser->document(), text, formatTextFlag);
|
||||||
|
|
||||||
|
ui->textBrowser->setText(formattedWelcomeMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime &sendTime, const QDateTime &recvTime, const QString &message, MsgType chatType)
|
void ChatWidget::addChatMsg(bool incoming, const QString &name, const QDateTime &sendTime, const QDateTime &recvTime, const QString &message, MsgType chatType)
|
||||||
|
|
|
@ -129,6 +129,8 @@ void CreateLobbyDialog::createLobby()
|
||||||
// create chat lobby !!
|
// create chat lobby !!
|
||||||
std::string lobby_name = ui->lobbyName_LE->text().toUtf8().constData() ;
|
std::string lobby_name = ui->lobbyName_LE->text().toUtf8().constData() ;
|
||||||
std::string lobby_topic = ui->lobbyTopic_LE->text().toUtf8().constData() ;
|
std::string lobby_topic = ui->lobbyTopic_LE->text().toUtf8().constData() ;
|
||||||
|
std::string lobby_description = ui->lobbyDescription_TE->toPlainText().toUtf8().constData() ;
|
||||||
|
std::string lobby_topicwithdesc = lobby_topic + "\n" + lobby_description;
|
||||||
|
|
||||||
// set nick name !
|
// set nick name !
|
||||||
RsGxsId gxs_id ;
|
RsGxsId gxs_id ;
|
||||||
|
@ -149,7 +151,7 @@ void CreateLobbyDialog::createLobby()
|
||||||
if(ui->pgp_signed_CB->isChecked())
|
if(ui->pgp_signed_CB->isChecked())
|
||||||
lobby_flags |= RS_CHAT_LOBBY_FLAGS_PGP_SIGNED ;
|
lobby_flags |= RS_CHAT_LOBBY_FLAGS_PGP_SIGNED ;
|
||||||
|
|
||||||
ChatLobbyId id = rsMsgs->createChatLobby(lobby_name,gxs_id, lobby_topic, shareList, lobby_flags);
|
ChatLobbyId id = rsMsgs->createChatLobby(lobby_name,gxs_id, lobby_topicwithdesc, shareList, lobby_flags);
|
||||||
|
|
||||||
std::cerr << "gui: Created chat room " << std::hex << id << std::dec << std::endl ;
|
std::cerr << "gui: Created chat room " << std::hex << id << std::dec << std::endl ;
|
||||||
|
|
||||||
|
|
|
@ -149,6 +149,22 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Room info</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QTextEdit" name="lobbyDescription_TE">
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>Add additional room rules, links & infos</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="roomVSpacer">
|
<spacer name="roomVSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue