mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-26 07:59:35 -05:00
fixed Group Chats Chat Dialog with little changes for a basic formating
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@405 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9652da42b4
commit
06cb4cf01f
@ -57,6 +57,10 @@ ChatDialog::ChatDialog(QWidget *parent)
|
|||||||
|
|
||||||
connect( ui.msgSendList, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( msgSendListCostumPopupMenu( QPoint ) ) );
|
connect( ui.msgSendList, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( msgSendListCostumPopupMenu( QPoint ) ) );
|
||||||
|
|
||||||
|
connect(ui.textboldChatButton, SIGNAL(clicked()), this, SLOT(insertBold()));
|
||||||
|
connect(ui.textunderlineChatButton, SIGNAL(clicked()), this, SLOT(insertUnderline()));
|
||||||
|
connect(ui.textitalicChatButton, SIGNAL(clicked()), this, SLOT(insertItalic()));
|
||||||
|
|
||||||
// connect(ui.msgSendList, SIGNAL(itemChanged( QTreeWidgetItem *, int ) ),
|
// connect(ui.msgSendList, SIGNAL(itemChanged( QTreeWidgetItem *, int ) ),
|
||||||
// this, SLOT(toggleSendItem( QTreeWidgetItem *, int ) ));
|
// this, SLOT(toggleSendItem( QTreeWidgetItem *, int ) ));
|
||||||
|
|
||||||
@ -317,4 +321,44 @@ void ChatDialog::clearOldChats()
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ChatDialog::insertBold()
|
||||||
|
{
|
||||||
|
|
||||||
|
this->insertAutour(tr("<b>"), tr("</b>"));
|
||||||
|
this->ui.lineEdit->setFocus();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ChatDialog::insertItalic()
|
||||||
|
{
|
||||||
|
|
||||||
|
this->insertAutour(tr("<i>"), tr("</i>"));
|
||||||
|
this->ui.lineEdit->setFocus();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ChatDialog::insertUnderline()
|
||||||
|
{
|
||||||
|
|
||||||
|
this->insertAutour(tr("<u>"), tr("</u>"));
|
||||||
|
this->ui.lineEdit->setFocus();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ChatDialog::insertStrike()
|
||||||
|
{
|
||||||
|
|
||||||
|
this->insertAutour(tr("<s>"), tr("</s>"));
|
||||||
|
this->ui.lineEdit->setFocus();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ChatDialog::insertAutour(QString leftTruc,QString rightTruc)
|
||||||
|
{
|
||||||
|
int p0 = ui.lineEdit->cursorPosition();
|
||||||
|
QString stringToInsert = leftTruc ;
|
||||||
|
stringToInsert.append(rightTruc);
|
||||||
|
ui.lineEdit->insert(stringToInsert);
|
||||||
|
ui.lineEdit->setCursorPosition(p0 + leftTruc.size());
|
||||||
|
|
||||||
|
}
|
||||||
|
@ -59,6 +59,12 @@ void toggleSendItem( QTreeWidgetItem *item, int col );
|
|||||||
|
|
||||||
void privchat();
|
void privchat();
|
||||||
|
|
||||||
|
void insertBold();
|
||||||
|
void insertItalic();
|
||||||
|
void insertUnderline();
|
||||||
|
void insertStrike();
|
||||||
|
void insertAutour(QString leftTruc,QString rightTruc);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,14 +5,12 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>455</width>
|
<width>432</width>
|
||||||
<height>303</height>
|
<height>329</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy>
|
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||||
<hsizetype>7</hsizetype>
|
|
||||||
<vsizetype>7</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@ -507,35 +505,61 @@
|
|||||||
<iconset/>
|
<iconset/>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" >
|
||||||
<property name="margin" >
|
<property name="leftMargin" >
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing" >
|
<property name="topMargin" >
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<widget class="QSplitter" name="splitter_2" >
|
|
||||||
<property name="orientation" >
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<widget class="QSplitter" name="splitter" >
|
<widget class="QSplitter" name="splitter" >
|
||||||
<property name="orientation" >
|
<property name="orientation" >
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="layoutWidget" >
|
<widget class="QWidget" name="layoutWidget" >
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" >
|
||||||
<property name="margin" >
|
<property name="leftMargin" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing" >
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalSpacing" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" >
|
||||||
<property name="margin" >
|
<property name="leftMargin" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing" >
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalSpacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="1" >
|
<item row="0" column="1" >
|
||||||
@ -553,10 +577,22 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" >
|
||||||
<property name="margin" >
|
<property name="leftMargin" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing" >
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalSpacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
@ -590,9 +626,7 @@
|
|||||||
<item row="1" column="0" >
|
<item row="1" column="0" >
|
||||||
<widget class="QTextBrowser" name="msgText" >
|
<widget class="QTextBrowser" name="msgText" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy>
|
<sizepolicy vsizetype="MinimumExpanding" hsizetype="Expanding" >
|
||||||
<hsizetype>7</hsizetype>
|
|
||||||
<vsizetype>3</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@ -609,18 +643,42 @@
|
|||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="layoutWidget" >
|
<widget class="QWidget" name="layoutWidget" >
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" >
|
||||||
<property name="margin" >
|
<property name="leftMargin" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing" >
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalSpacing" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" >
|
||||||
<property name="margin" >
|
<property name="leftMargin" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing" >
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalSpacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="1" >
|
<item row="0" column="1" >
|
||||||
@ -641,18 +699,28 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
<layout class="QGridLayout" >
|
<layout class="QGridLayout" >
|
||||||
<property name="margin" >
|
<property name="leftMargin" >
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing" >
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalSpacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="1" >
|
<item row="0" column="1" >
|
||||||
<widget class="QLabel" name="label_14" >
|
<widget class="QLabel" name="label_14" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy>
|
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
|
||||||
<hsizetype>5</hsizetype>
|
|
||||||
<vsizetype>0</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@ -686,9 +754,7 @@
|
|||||||
<item row="1" column="0" >
|
<item row="1" column="0" >
|
||||||
<widget class="QTreeWidget" name="msgSendList" >
|
<widget class="QTreeWidget" name="msgSendList" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy>
|
<sizepolicy vsizetype="Ignored" hsizetype="Ignored" >
|
||||||
<hsizetype>13</hsizetype>
|
|
||||||
<vsizetype>13</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@ -705,25 +771,52 @@
|
|||||||
<property name="sortingEnabled" >
|
<property name="sortingEnabled" >
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<column>
|
||||||
|
<property name="text" >
|
||||||
|
<string>1</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="layoutWidget" >
|
</item>
|
||||||
|
<item row="1" column="0" >
|
||||||
<layout class="QVBoxLayout" >
|
<layout class="QVBoxLayout" >
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="spacing" >
|
<property name="spacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<property name="leftMargin" >
|
||||||
<layout class="QGridLayout" >
|
|
||||||
<property name="margin" >
|
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="spacing" >
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<layout class="QGridLayout" >
|
||||||
|
<property name="leftMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin" >
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalSpacing" >
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing" >
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0" >
|
<item row="0" column="0" >
|
||||||
@ -760,7 +853,7 @@
|
|||||||
<iconset resource="images.qrc" >:/images/edit-underline.png</iconset>
|
<iconset resource="images.qrc" >:/images/edit-underline.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable" >
|
<property name="checkable" >
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -785,7 +878,7 @@
|
|||||||
<iconset resource="images.qrc" >:/images/edit-italic.png</iconset>
|
<iconset resource="images.qrc" >:/images/edit-italic.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable" >
|
<property name="checkable" >
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -810,7 +903,7 @@
|
|||||||
<iconset resource="images.qrc" >:/images/edit-bold.png</iconset>
|
<iconset resource="images.qrc" >:/images/edit-bold.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable" >
|
<property name="checkable" >
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -838,9 +931,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QLineEdit" name="lineEdit" >
|
<widget class="QLineEdit" name="lineEdit" >
|
||||||
<property name="sizePolicy" >
|
<property name="sizePolicy" >
|
||||||
<sizepolicy>
|
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
|
||||||
<hsizetype>7</hsizetype>
|
|
||||||
<vsizetype>3</vsizetype>
|
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@ -848,7 +939,7 @@
|
|||||||
<property name="minimumSize" >
|
<property name="minimumSize" >
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
<height>40</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="font" >
|
<property name="font" >
|
||||||
@ -859,8 +950,6 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
Loading…
Reference in New Issue
Block a user