mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-22 22:21:09 -04:00
moved the edit button from top bar to each channel post
This commit is contained in:
parent
5406da92fa
commit
5044ac12ca
5 changed files with 18 additions and 22 deletions
|
@ -35,6 +35,7 @@
|
||||||
#include "util/HandleRichText.h"
|
#include "util/HandleRichText.h"
|
||||||
#include "util/DateTime.h"
|
#include "util/DateTime.h"
|
||||||
#include "util/stringutil.h"
|
#include "util/stringutil.h"
|
||||||
|
#include "gui/gxschannels/CreateGxsChannelMsg.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
@ -127,6 +128,7 @@ void GxsChannelPostItem::setup()
|
||||||
connect(ui->commentButton, SIGNAL(clicked()), this, SLOT(loadComments()));
|
connect(ui->commentButton, SIGNAL(clicked()), this, SLOT(loadComments()));
|
||||||
|
|
||||||
connect(ui->playButton, SIGNAL(clicked()), this, SLOT(play(void)));
|
connect(ui->playButton, SIGNAL(clicked()), this, SLOT(play(void)));
|
||||||
|
connect(ui->editButton, SIGNAL(clicked()), this, SLOT(edit(void)));
|
||||||
connect(ui->copyLinkButton, SIGNAL(clicked()), this, SLOT(copyMessageLink()));
|
connect(ui->copyLinkButton, SIGNAL(clicked()), this, SLOT(copyMessageLink()));
|
||||||
|
|
||||||
connect(ui->readButton, SIGNAL(toggled(bool)), this, SLOT(readToggled(bool)));
|
connect(ui->readButton, SIGNAL(toggled(bool)), this, SLOT(readToggled(bool)));
|
||||||
|
@ -690,6 +692,12 @@ void GxsChannelPostItem::download()
|
||||||
updateItem();
|
updateItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GxsChannelPostItem::edit()
|
||||||
|
{
|
||||||
|
CreateGxsChannelMsg *msgDialog = new CreateGxsChannelMsg(mGroup.mMeta.mGroupId,mPost.mMeta.mMsgId);
|
||||||
|
msgDialog->show();
|
||||||
|
}
|
||||||
|
|
||||||
void GxsChannelPostItem::play()
|
void GxsChannelPostItem::play()
|
||||||
{
|
{
|
||||||
std::list<SubFileItem *>::iterator it;
|
std::list<SubFileItem *>::iterator it;
|
||||||
|
|
|
@ -78,6 +78,7 @@ private slots:
|
||||||
void readAndClearItem();
|
void readAndClearItem();
|
||||||
void download();
|
void download();
|
||||||
void play();
|
void play();
|
||||||
|
void edit();
|
||||||
void loadComments();
|
void loadComments();
|
||||||
|
|
||||||
void readToggled(bool checked);
|
void readToggled(bool checked);
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>840</width>
|
<width>1052</width>
|
||||||
<height>180</height>
|
<height>338</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gxsChannelPostItem_GLayout">
|
<layout class="QGridLayout" name="gxsChannelPostItem_GLayout">
|
||||||
|
@ -332,6 +332,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="editButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>Edit</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
|
|
@ -67,14 +67,11 @@ GxsChannelPostsWidget::GxsChannelPostsWidget(const RsGxsGroupId &channelId, QWid
|
||||||
mStateHelper->addLoadPlaceholder(mTokenTypeGroupData, ui->nameLabel);
|
mStateHelper->addLoadPlaceholder(mTokenTypeGroupData, ui->nameLabel);
|
||||||
|
|
||||||
mStateHelper->addWidget(mTokenTypeGroupData, ui->postButton);
|
mStateHelper->addWidget(mTokenTypeGroupData, ui->postButton);
|
||||||
mStateHelper->addWidget(mTokenTypeGroupData, ui->editButton);
|
|
||||||
mStateHelper->addWidget(mTokenTypeGroupData, ui->logoLabel);
|
mStateHelper->addWidget(mTokenTypeGroupData, ui->logoLabel);
|
||||||
mStateHelper->addWidget(mTokenTypeGroupData, ui->subscribeToolButton);
|
mStateHelper->addWidget(mTokenTypeGroupData, ui->subscribeToolButton);
|
||||||
|
|
||||||
/* Connect signals */
|
/* Connect signals */
|
||||||
connect(ui->postButton, SIGNAL(clicked()), this, SLOT(createMsg()));
|
connect(ui->postButton, SIGNAL(clicked()), this, SLOT(createMsg()));
|
||||||
connect(ui->editButton, SIGNAL(clicked()), this, SLOT(editMsg()));
|
|
||||||
|
|
||||||
connect(ui->subscribeToolButton, SIGNAL(subscribe(bool)), this, SLOT(subscribeGroup(bool)));
|
connect(ui->subscribeToolButton, SIGNAL(subscribe(bool)), this, SLOT(subscribeGroup(bool)));
|
||||||
connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
|
connect(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged()));
|
||||||
|
|
||||||
|
@ -214,21 +211,7 @@ void GxsChannelPostsWidget::openComments(uint32_t /*type*/, const RsGxsGroupId &
|
||||||
{
|
{
|
||||||
emit loadComment(groupId, msgId, title);
|
emit loadComment(groupId, msgId, title);
|
||||||
}
|
}
|
||||||
void GxsChannelPostsWidget::editMsg()
|
|
||||||
{
|
|
||||||
if (groupId().isNull()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!IS_GROUP_SUBSCRIBED(subscribeFlags())) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
CreateGxsChannelMsg *msgDialog = new CreateGxsChannelMsg(groupId(),mCurrentMessageId);
|
|
||||||
msgDialog->show();
|
|
||||||
|
|
||||||
/* window will destroy itself! */
|
|
||||||
}
|
|
||||||
void GxsChannelPostsWidget::createMsg()
|
void GxsChannelPostsWidget::createMsg()
|
||||||
{
|
{
|
||||||
if (groupId().isNull()) {
|
if (groupId().isNull()) {
|
||||||
|
@ -261,12 +244,10 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group)
|
||||||
if (group.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_PUBLISH)
|
if (group.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_PUBLISH)
|
||||||
{
|
{
|
||||||
mStateHelper->setWidgetEnabled(ui->postButton, true);
|
mStateHelper->setWidgetEnabled(ui->postButton, true);
|
||||||
mStateHelper->setWidgetEnabled(ui->editButton, true);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mStateHelper->setWidgetEnabled(ui->postButton, false);
|
mStateHelper->setWidgetEnabled(ui->postButton, false);
|
||||||
mStateHelper->setWidgetEnabled(ui->editButton, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags));
|
ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags));
|
||||||
|
|
|
@ -79,7 +79,6 @@ protected:
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void createMsg();
|
void createMsg();
|
||||||
void editMsg();
|
|
||||||
void toggleAutoDownload();
|
void toggleAutoDownload();
|
||||||
void subscribeGroup(bool subscribe);
|
void subscribeGroup(bool subscribe);
|
||||||
void filterChanged(int filter);
|
void filterChanged(int filter);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue