mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 21:58:57 -04:00
Significant changes to the GUI to introduce new display style.
* Completed much of General Msg Dialog. * Completed much of ChannelFeed. * Added Channel Messages to News Feed. * Connected Blog/Channels to GeneralMsgDialog. * Improved SubFileItem display. * Completed ChanGroup/Menu/MsgItems. * Added SubDestItem for use in GeneralMsgDialog. * Generalise CreateForum to cover Channels as well. * Restricted CreateForum to public forums/private channels. * Demo of Drag-N-Drop Files for Linux (filesystem->GenMsgDialog) * Updates to rsiface stuff (blog/channels/types) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@621 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
b9ccbd54e8
commit
c6a595c7db
26 changed files with 1489 additions and 206 deletions
108
retroshare-gui/src/gui/feeds/SubDestItem.cpp
Normal file
108
retroshare-gui/src/gui/feeds/SubDestItem.cpp
Normal file
|
@ -0,0 +1,108 @@
|
|||
/****************************************************************
|
||||
* RetroShare is distributed under the following license:
|
||||
*
|
||||
* Copyright (C) 2008 Robert Fernie
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
#include <QtGui>
|
||||
|
||||
#include "SubDestItem.h"
|
||||
#include "FeedHolder.h"
|
||||
|
||||
#include "rsiface/rspeers.h"
|
||||
#include "rsiface/rsforums.h"
|
||||
#include "rsiface/rschannels.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#define DEBUG_ITEM 1
|
||||
|
||||
/** Constructor */
|
||||
SubDestItem::SubDestItem(uint32_t type, std::string groupId, std::string inReplyTo)
|
||||
:QWidget(NULL), mType(type), mGroupId(groupId), mInReplyTo(inReplyTo)
|
||||
{
|
||||
/* Invoke the Qt Designer generated object setup routine */
|
||||
setupUi(this);
|
||||
|
||||
connect( cancelButton, SIGNAL( clicked( void ) ), this, SLOT( cancel ( void ) ) );
|
||||
|
||||
updateItemStatic();
|
||||
}
|
||||
|
||||
void SubDestItem::updateItemStatic()
|
||||
{
|
||||
/* fill in */
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "SubDestItem::updateItemStatic()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
QString name = "Unknown";
|
||||
switch(mType)
|
||||
{
|
||||
case FEEDHOLDER_MSG_MESSAGE:
|
||||
{
|
||||
typeLabel->setText("Message To: ");
|
||||
if (rsPeers)
|
||||
{
|
||||
name = QString::fromStdString(rsPeers->getPeerName(mGroupId));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case FEEDHOLDER_MSG_FORUM:
|
||||
{
|
||||
typeLabel->setText("Forum Post To: ");
|
||||
ForumInfo fi;
|
||||
if ((rsForums) && (rsForums->getForumInfo(mGroupId, fi)))
|
||||
{
|
||||
name = QString::fromStdWString(fi.forumName);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case FEEDHOLDER_MSG_CHANNEL:
|
||||
{
|
||||
typeLabel->setText("Channel Post To: ");
|
||||
ChannelInfo ci;
|
||||
if ((rsChannels) && (rsChannels->getChannelInfo(mGroupId, ci)))
|
||||
{
|
||||
name = QString::fromStdWString(ci.channelName);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case FEEDHOLDER_MSG_BLOG:
|
||||
{
|
||||
typeLabel->setText("Blog Post");
|
||||
name = "";
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
nameLabel->setText(name);
|
||||
}
|
||||
|
||||
void SubDestItem::cancel()
|
||||
{
|
||||
#ifdef DEBUG_ITEM
|
||||
std::cerr << "SubDestItem::cancel()";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
hide();
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue