mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
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
This commit is contained in:
parent
c62daadacd
commit
98820697d4
@ -178,11 +178,21 @@ void ForumsDialog::threadListCustomPopupMenu( QPoint point )
|
|||||||
|
|
||||||
QAction *replyauthorAct = new QAction(QIcon(IMAGE_MESSAGEREPLY), tr( "Reply to Author" ), this );
|
QAction *replyauthorAct = new QAction(QIcon(IMAGE_MESSAGEREPLY), tr( "Reply to Author" ), this );
|
||||||
connect( replyauthorAct , SIGNAL( triggered() ), this, SLOT( replytomessage() ) );
|
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.clear();
|
||||||
contextMnu.addAction( replyAct);
|
contextMnu.addAction( replyAct);
|
||||||
contextMnu.addAction( viewAct);
|
contextMnu.addAction( viewAct);
|
||||||
contextMnu.addAction( replyauthorAct);
|
contextMnu.addAction( replyauthorAct);
|
||||||
|
contextMnu.addSeparator();
|
||||||
|
contextMnu.addAction( expandAll);
|
||||||
|
contextMnu.addAction( collapseAll);
|
||||||
contextMnu.exec( mevent->globalPos() );
|
contextMnu.exec( mevent->globalPos() );
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1040,7 +1050,7 @@ void ForumsDialog::replytomessage()
|
|||||||
}
|
}
|
||||||
|
|
||||||
fId = mCurrForumId;
|
fId = mCurrForumId;
|
||||||
pId = mCurrPostId;
|
pId = mCurrPostId;
|
||||||
|
|
||||||
ForumMsgInfo msgInfo ;
|
ForumMsgInfo msgInfo ;
|
||||||
rsForums->getForumMessage(fId,pId,msgInfo) ;
|
rsForums->getForumMessage(fId,pId,msgInfo) ;
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
* Boston, MA 02110-1301, USA.
|
* Boston, MA 02110-1301, USA.
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
|
#include <QtGui>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
#include "CreateForum.h"
|
#include "CreateForum.h"
|
||||||
@ -36,6 +37,9 @@ CreateForum::CreateForum(QWidget *parent, bool isForum)
|
|||||||
// connect up the buttons.
|
// connect up the buttons.
|
||||||
connect( ui.cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancelForum( ) ) );
|
connect( ui.cancelButton, SIGNAL( clicked ( bool ) ), this, SLOT( cancelForum( ) ) );
|
||||||
connect( ui.createButton, SIGNAL( clicked ( bool ) ), this, SLOT( createForum( ) ) );
|
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();
|
newForum();
|
||||||
|
|
||||||
@ -64,6 +68,7 @@ void CreateForum::newForum()
|
|||||||
|
|
||||||
ui.msgAnon->setChecked(true);
|
ui.msgAnon->setChecked(true);
|
||||||
//ui.msgAuth->setEnabled(false);
|
//ui.msgAuth->setEnabled(false);
|
||||||
|
ui.groupBoxLogo->hide();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -143,3 +148,27 @@ void CreateForum::cancelForum()
|
|||||||
return;
|
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.
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -39,6 +39,7 @@ void newForum(); /* cleanup */
|
|||||||
/** Qt Designer generated object */
|
/** Qt Designer generated object */
|
||||||
Ui::CreateForum ui;
|
Ui::CreateForum ui;
|
||||||
|
|
||||||
|
QPixmap picture;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
/** Overloaded QWidget.show */
|
/** Overloaded QWidget.show */
|
||||||
@ -50,6 +51,9 @@ private slots:
|
|||||||
void createForum();
|
void createForum();
|
||||||
void cancelForum();
|
void cancelForum();
|
||||||
|
|
||||||
|
void addChannelLogo();
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,8 +6,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>482</width>
|
<width>534</width>
|
||||||
<height>419</height>
|
<height>481</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@ -26,6 +26,12 @@
|
|||||||
</property>
|
</property>
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QFrame" name="frame_2">
|
<widget class="QFrame" name="frame_2">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">QFrame#frame_2{background-image: url(:/images/connect/connectFriendBanner.png);}</string>
|
<string notr="true">QFrame#frame_2{background-image: url(:/images/connect/connectFriendBanner.png);}</string>
|
||||||
</property>
|
</property>
|
||||||
@ -89,9 +95,9 @@ p, li { white-space: pre-wrap; }
|
|||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
<item row="0" column="0" colspan="3">
|
<item row="0" column="0" colspan="3">
|
||||||
<layout class="QHBoxLayout" name="_2">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -124,6 +130,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<string>Type:</string>
|
<string>Type:</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="_3">
|
<layout class="QVBoxLayout" name="_3">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="typePublic">
|
<widget class="QRadioButton" name="typePublic">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -154,6 +166,12 @@ p, li { white-space: pre-wrap; }
|
|||||||
<string>Allowed Messages</string>
|
<string>Allowed Messages</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="_4">
|
<layout class="QVBoxLayout" name="_4">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QRadioButton" name="msgAuth">
|
<widget class="QRadioButton" name="msgAuth">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -168,10 +186,136 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<spacer name="verticalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="4" column="0" colspan="3">
|
||||||
|
<widget class="QGroupBox" name="groupBoxLogo">
|
||||||
|
<property name="title">
|
||||||
|
<string>Channel Logo</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="verticalSpacing">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0" rowspan="2">
|
||||||
|
<widget class="QToolButton" name="ChannelLogoButton">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">
|
||||||
|
border: 2px solid white;
|
||||||
|
border-radius: 10px;
|
||||||
|
</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../images.qrc">
|
||||||
|
<normaloff>:/images/channels.png</normaloff>:/images/channels.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QPushButton" name="LogoButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Add Channel Logo</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../images.qrc">
|
||||||
|
<normaloff>:/images/add_image24.png</normaloff>:/images/add_image24.png</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<spacer name="horizontalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>118</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<spacer name="verticalSpacer">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Vertical</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>40</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<spacer name="horizontalSpacer_2">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>40</width>
|
||||||
|
<height>20</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
@ -184,14 +328,14 @@ p, li { white-space: pre-wrap; }
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QPushButton" name="cancelButton">
|
<widget class="QPushButton" name="cancelButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Cancel</string>
|
<string>Cancel</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="2">
|
<item row="5" column="2">
|
||||||
<widget class="QPushButton" name="createButton">
|
<widget class="QPushButton" name="createButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Create</string>
|
<string>Create</string>
|
||||||
@ -216,6 +360,8 @@ p, li { white-space: pre-wrap; }
|
|||||||
<include location="../images.qrc"/>
|
<include location="../images.qrc"/>
|
||||||
<include location="../images.qrc"/>
|
<include location="../images.qrc"/>
|
||||||
<include location="../images.qrc"/>
|
<include location="../images.qrc"/>
|
||||||
|
<include location="../images.qrc"/>
|
||||||
|
<include location="../images.qrc"/>
|
||||||
</resources>
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
Loading…
Reference in New Issue
Block a user