diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp index 22d90e5a2..a1d5f69a8 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp @@ -35,6 +35,7 @@ #include "util/HandleRichText.h" #include "util/DateTime.h" #include "util/stringutil.h" +#include "gui/gxschannels/CreateGxsChannelMsg.h" #include @@ -127,6 +128,7 @@ void GxsChannelPostItem::setup() connect(ui->commentButton, SIGNAL(clicked()), this, SLOT(loadComments())); 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->readButton, SIGNAL(toggled(bool)), this, SLOT(readToggled(bool))); @@ -690,6 +692,12 @@ void GxsChannelPostItem::download() updateItem(); } +void GxsChannelPostItem::edit() +{ + CreateGxsChannelMsg *msgDialog = new CreateGxsChannelMsg(mGroup.mMeta.mGroupId,mPost.mMeta.mMsgId); + msgDialog->show(); +} + void GxsChannelPostItem::play() { std::list::iterator it; diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h index 8574f4e16..a591e5e22 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h @@ -78,6 +78,7 @@ private slots: void readAndClearItem(); void download(); void play(); + void edit(); void loadComments(); void readToggled(bool checked); diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui index 010436d7b..1d72a0693 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.ui @@ -6,8 +6,8 @@ 0 0 - 840 - 180 + 1052 + 338 @@ -332,6 +332,13 @@ + + + + Edit + + + diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp index 24972b955..76c777607 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.cpp @@ -67,14 +67,11 @@ GxsChannelPostsWidget::GxsChannelPostsWidget(const RsGxsGroupId &channelId, QWid mStateHelper->addLoadPlaceholder(mTokenTypeGroupData, ui->nameLabel); mStateHelper->addWidget(mTokenTypeGroupData, ui->postButton); - mStateHelper->addWidget(mTokenTypeGroupData, ui->editButton); mStateHelper->addWidget(mTokenTypeGroupData, ui->logoLabel); mStateHelper->addWidget(mTokenTypeGroupData, ui->subscribeToolButton); /* Connect signals */ 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(NotifyQt::getInstance(), SIGNAL(settingsChanged()), this, SLOT(settingsChanged())); @@ -214,21 +211,7 @@ void GxsChannelPostsWidget::openComments(uint32_t /*type*/, const RsGxsGroupId & { 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() { if (groupId().isNull()) { @@ -261,12 +244,10 @@ void GxsChannelPostsWidget::insertChannelDetails(const RsGxsChannelGroup &group) if (group.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_PUBLISH) { mStateHelper->setWidgetEnabled(ui->postButton, true); - mStateHelper->setWidgetEnabled(ui->editButton, true); } else { mStateHelper->setWidgetEnabled(ui->postButton, false); - mStateHelper->setWidgetEnabled(ui->editButton, false); } ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(group.mMeta.mSubscribeFlags)); diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.h b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.h index 2d3677b4f..541fcc506 100644 --- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.h +++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidget.h @@ -79,7 +79,6 @@ protected: private slots: void createMsg(); - void editMsg(); void toggleAutoDownload(); void subscribeGroup(bool subscribe); void filterChanged(int filter);