From 98820697d464e15fd3b3802e1619b33135302bff Mon Sep 17 00:00:00 2001 From: defnax Date: Mon, 18 Jan 2010 23:59:49 +0000 Subject: [PATCH] Added for Create Channel the Channel Logo Button + Display Added for Forums Collapse all/Expand all git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2079 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/ForumsDialog.cpp | 12 +- retroshare-gui/src/gui/forums/CreateForum.cpp | 29 ++++ retroshare-gui/src/gui/forums/CreateForum.h | 4 + retroshare-gui/src/gui/forums/CreateForum.ui | 160 +++++++++++++++++- 4 files changed, 197 insertions(+), 8 deletions(-) diff --git a/retroshare-gui/src/gui/ForumsDialog.cpp b/retroshare-gui/src/gui/ForumsDialog.cpp index b3fb05449..dea841f86 100644 --- a/retroshare-gui/src/gui/ForumsDialog.cpp +++ b/retroshare-gui/src/gui/ForumsDialog.cpp @@ -178,11 +178,21 @@ void ForumsDialog::threadListCustomPopupMenu( QPoint point ) QAction *replyauthorAct = new QAction(QIcon(IMAGE_MESSAGEREPLY), tr( "Reply to Author" ), this ); connect( replyauthorAct , SIGNAL( triggered() ), this, SLOT( replytomessage() ) ); + + QAction* expandAll = new QAction(tr( "Expand all" ), this ); + connect( expandAll , SIGNAL( triggered() ), ui.threadTreeWidget, SLOT (expandAll()) ); + + QAction* collapseAll = new QAction(tr( "Collapse all" ), this ); + connect( collapseAll , SIGNAL( triggered() ), ui.threadTreeWidget, SLOT(collapseAll()) ); + contextMnu.clear(); contextMnu.addAction( replyAct); contextMnu.addAction( viewAct); contextMnu.addAction( replyauthorAct); + contextMnu.addSeparator(); + contextMnu.addAction( expandAll); + contextMnu.addAction( collapseAll); contextMnu.exec( mevent->globalPos() ); } @@ -1040,7 +1050,7 @@ void ForumsDialog::replytomessage() } fId = mCurrForumId; - pId = mCurrPostId; + pId = mCurrPostId; ForumMsgInfo msgInfo ; rsForums->getForumMessage(fId,pId,msgInfo) ; diff --git a/retroshare-gui/src/gui/forums/CreateForum.cpp b/retroshare-gui/src/gui/forums/CreateForum.cpp index adb266f99..da05e048b 100644 --- a/retroshare-gui/src/gui/forums/CreateForum.cpp +++ b/retroshare-gui/src/gui/forums/CreateForum.cpp @@ -19,6 +19,7 @@ * Boston, MA 02110-1301, USA. ****************************************************************/ +#include #include #include "CreateForum.h" @@ -36,6 +37,9 @@ CreateForum::CreateForum(QWidget *parent, bool isForum) // connect up the buttons. connect( ui.cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancelForum( ) ) ); connect( ui.createButton, SIGNAL( clicked ( bool ) ), this, SLOT( createForum( ) ) ); + + connect( ui.LogoButton, SIGNAL(clicked() ), this , SLOT(addChannelLogo())); + connect( ui.ChannelLogoButton, SIGNAL(clicked() ), this , SLOT(addChannelLogo())); newForum(); @@ -64,6 +68,7 @@ void CreateForum::newForum() ui.msgAnon->setChecked(true); //ui.msgAuth->setEnabled(false); + ui.groupBoxLogo->hide(); } else { @@ -143,3 +148,27 @@ void CreateForum::cancelForum() return; } +void CreateForum::addChannelLogo() +{ + QString fileName = QFileDialog::getOpenFileName(this, "Load File", QDir::homePath(), "Pictures (*.png *.xpm *.jpg)"); + if(!fileName.isEmpty()) + { + picture = QPixmap(fileName).scaled(64,64, Qt::IgnoreAspectRatio); + + // to show the selected + ui.ChannelLogoButton->setIcon(picture); + + std::cerr << "Sending avatar image down the pipe" << std::endl ; + + // send avatar down the pipe for other peers to get it. + QByteArray ba; + QBuffer buffer(&ba); + buffer.open(QIODevice::WriteOnly); + picture.save(&buffer, "PNG"); // writes image into ba in PNG format + + std::cerr << "Image size = " << ba.size() << std::endl ; + + //rsMsgs->setOwnAvatarData((unsigned char *)(ba.data()),ba.size()) ; // last char 0 included. + + } +} diff --git a/retroshare-gui/src/gui/forums/CreateForum.h b/retroshare-gui/src/gui/forums/CreateForum.h index 3c4d33f3f..e91b265da 100644 --- a/retroshare-gui/src/gui/forums/CreateForum.h +++ b/retroshare-gui/src/gui/forums/CreateForum.h @@ -39,6 +39,7 @@ void newForum(); /* cleanup */ /** Qt Designer generated object */ Ui::CreateForum ui; + QPixmap picture; public slots: /** Overloaded QWidget.show */ @@ -50,6 +51,9 @@ private slots: void createForum(); void cancelForum(); +void addChannelLogo(); + + private: diff --git a/retroshare-gui/src/gui/forums/CreateForum.ui b/retroshare-gui/src/gui/forums/CreateForum.ui index e47632058..a0032b7d1 100644 --- a/retroshare-gui/src/gui/forums/CreateForum.ui +++ b/retroshare-gui/src/gui/forums/CreateForum.ui @@ -6,8 +6,8 @@ 0 0 - 482 - 419 + 534 + 481 @@ -26,6 +26,12 @@ + + + 16777215 + 64 + + QFrame#frame_2{background-image: url(:/images/connect/connectFriendBanner.png);} @@ -89,9 +95,9 @@ p, li { white-space: pre-wrap; } QFrame::Raised - + - + @@ -124,6 +130,12 @@ p, li { white-space: pre-wrap; } Type: + + 0 + + + 6 + @@ -154,6 +166,12 @@ p, li { white-space: pre-wrap; } Allowed Messages + + 0 + + + 6 + @@ -168,10 +186,136 @@ p, li { white-space: pre-wrap; } + + + + Qt::Vertical + + + + 20 + 40 + + + + - + + + + Channel Logo + + + + 6 + + + 6 + + + 6 + + + 2 + + + 6 + + + + + + + + 64 + 64 + + + + + 64 + 64 + + + + +border: 2px solid white; +border-radius: 10px; + + + + + + + + :/images/channels.png:/images/channels.png + + + + 64 + 64 + + + + + + + + Add Channel Logo + + + + :/images/add_image24.png:/images/add_image24.png + + + + + + + Qt::Horizontal + + + + 118 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal @@ -184,14 +328,14 @@ p, li { white-space: pre-wrap; } - + Cancel - + Create @@ -216,6 +360,8 @@ p, li { white-space: pre-wrap; } + +