From 777b52753ae628b716a0a91015e3ca639a980305 Mon Sep 17 00:00:00 2001 From: defnax Date: Mon, 25 Jan 2010 15:36:24 +0000 Subject: [PATCH] Added Split Text for Compose Message git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2125 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/images.qrc | 1 + .../textedit/hi22-action-insert-more-mark.png | Bin 0 -> 3487 bytes retroshare-gui/src/gui/msgs/ChanMsgDialog.cpp | 18 ++++ retroshare-gui/src/gui/msgs/ChanMsgDialog.h | 2 +- retroshare-gui/src/gui/msgs/ChanMsgDialog.ui | 86 +++++++++++++----- 5 files changed, 83 insertions(+), 24 deletions(-) create mode 100644 retroshare-gui/src/gui/images/textedit/hi22-action-insert-more-mark.png diff --git a/retroshare-gui/src/gui/images.qrc b/retroshare-gui/src/gui/images.qrc index 281e028df..65202ae3b 100644 --- a/retroshare-gui/src/gui/images.qrc +++ b/retroshare-gui/src/gui/images.qrc @@ -366,6 +366,7 @@ images/textedit/format_font_size_less.png images/textedit/hi22-action-format-text-blockquote.png images/textedit/hi22-action-format-text-code.png + images/textedit/hi22-action-insert-more-mark.png images/toaster/chat.png images/toaster/hangup.png images/toaster/pickup.png diff --git a/retroshare-gui/src/gui/images/textedit/hi22-action-insert-more-mark.png b/retroshare-gui/src/gui/images/textedit/hi22-action-insert-more-mark.png new file mode 100644 index 0000000000000000000000000000000000000000..64b3b09750ca0c2911c8c8b1e66961e17b779058 GIT binary patch literal 3487 zcmV;Q4Pf$#P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$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`NG zy!T{T3ZRFFhrie~&1f1&(=1d(m`-Qpd44Z>jFFDHmLI&vKDz>aC&;ma5yA{7_9dJV+`-! z-LP0R3Iit~cgb+Ru3J^Emw+#d^L463S=$>g<&$hL@l1BAx}%_BlcV~n%+0{|@{S-r_j4;KIc N002ovPDHLkV1ln>jG6!d literal 0 HcmV?d00001 diff --git a/retroshare-gui/src/gui/msgs/ChanMsgDialog.cpp b/retroshare-gui/src/gui/msgs/ChanMsgDialog.cpp index fe1fb79fa..3954d69de 100644 --- a/retroshare-gui/src/gui/msgs/ChanMsgDialog.cpp +++ b/retroshare-gui/src/gui/msgs/ChanMsgDialog.cpp @@ -92,6 +92,8 @@ ChanMsgDialog::ChanMsgDialog(bool msg, QWidget *parent, Qt::WFlags flags) connect(ui.sizedecreaseButton, SIGNAL (clicked()), this, SLOT (fontSizeDecrease())); connect(ui.blockquoteButton, SIGNAL (clicked()), this, SLOT (blockQuote())); connect(ui.codeButton, SIGNAL (clicked()), this, SLOT (toggleCode())); + connect(ui.splitPostButton, SIGNAL (clicked()), this, SLOT (addPostSplitter())); + connect(ui.msgText, SIGNAL(currentCharFormatChanged(const QTextCharFormat &)), this, SLOT(currentCharFormatChanged(const QTextCharFormat &))); @@ -1141,6 +1143,22 @@ void ChanMsgDialog::toggleCode() ui.msgText->setFocus( Qt::OtherFocusReason ); } +void ChanMsgDialog::addPostSplitter() +{ + QTextBlockFormat f = ui.msgText->textCursor().blockFormat(); + QTextBlockFormat f1 = f; + + f.setProperty( TextFormat::IsHtmlTagSign, true ); + f.setProperty( QTextFormat::BlockTrailingHorizontalRulerWidth, + QTextLength( QTextLength::PercentageLength, 80 ) ); + if ( ui.msgText->textCursor().block().text().isEmpty() ) { + ui.msgText->textCursor().mergeBlockFormat( f ); + } else { + ui.msgText->textCursor().insertBlock( f ); + } + ui.msgText->textCursor().insertBlock( f1 ); +} + void ChanMsgDialog::attachFile() { // select a file diff --git a/retroshare-gui/src/gui/msgs/ChanMsgDialog.h b/retroshare-gui/src/gui/msgs/ChanMsgDialog.h index 0b78b8761..8541c8552 100644 --- a/retroshare-gui/src/gui/msgs/ChanMsgDialog.h +++ b/retroshare-gui/src/gui/msgs/ChanMsgDialog.h @@ -19,7 +19,6 @@ * Boston, MA 02110-1301, USA. ****************************************************************/ - #ifndef _CHAN_MSG_DIALOG_H #define _CHAN_MSG_DIALOG_H @@ -116,6 +115,7 @@ private slots: void fontSizeDecrease(); void blockQuote(); void toggleCode(); + void addPostSplitter(); private: diff --git a/retroshare-gui/src/gui/msgs/ChanMsgDialog.ui b/retroshare-gui/src/gui/msgs/ChanMsgDialog.ui index 28dd98e41..e7a866517 100644 --- a/retroshare-gui/src/gui/msgs/ChanMsgDialog.ui +++ b/retroshare-gui/src/gui/msgs/ChanMsgDialog.ui @@ -6,8 +6,8 @@ 0 0 - 874 - 528 + 769 + 485 @@ -151,17 +151,34 @@ border: 1px solid #CCCCCC;} QFrame::Raised - + 6 + + 1 + - + + + + 75 + 16777215 + + + - + + + + 100 + 16777215 + + + @@ -176,19 +193,6 @@ border: 1px solid #CCCCCC;} - - - - Qt::Horizontal - - - - 20 - 24 - - - - @@ -384,7 +388,7 @@ border: 1px solid #CCCCCC;} - + @@ -409,7 +413,7 @@ border: 1px solid #CCCCCC;} - + @@ -443,7 +447,7 @@ border: 1px solid #CCCCCC;} - + @@ -501,6 +505,42 @@ border: 1px solid #CCCCCC;} + + + + Qt::Horizontal + + + + 20 + 24 + + + + + + + + Split text + + + + + + + :/images/textedit/hi22-action-insert-more-mark.png:/images/textedit/hi22-action-insert-more-mark.png + + + + 22 + 22 + + + + true + + + @@ -521,7 +561,7 @@ border: 1px solid #CCCCCC;} - + 0 @@ -597,7 +637,7 @@ border: 1px solid #CCCCCC;} 0 0 - 874 + 769 21