2008-06-20 08:43:23 -04:00
|
|
|
/****************************************************************
|
|
|
|
* 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
|
2009-09-12 06:55:40 -04:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
2008-06-20 08:43:23 -04:00
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
#ifndef _CHANNEL_FEED_DIALOG_H
|
|
|
|
#define _CHANNEL_FEED_DIALOG_H
|
|
|
|
|
|
|
|
#include "mainpage.h"
|
|
|
|
#include "ui_ChannelFeed.h"
|
|
|
|
|
2009-09-12 06:55:40 -04:00
|
|
|
#include <QStandardItemModel>
|
|
|
|
|
2008-06-20 08:43:23 -04:00
|
|
|
#include "gui/feeds/FeedHolder.h"
|
|
|
|
|
2009-09-12 06:55:40 -04:00
|
|
|
#define OWN 0
|
|
|
|
#define SUBSCRIBED 1
|
|
|
|
#define POPULAR 2
|
|
|
|
#define OTHER 3
|
|
|
|
|
2008-06-24 00:36:45 -04:00
|
|
|
class ChanMsgItem;
|
|
|
|
|
2008-06-20 08:43:23 -04:00
|
|
|
class ChannelFeed : public MainPage, public FeedHolder, private Ui::ChannelFeed
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
/** Default Constructor */
|
|
|
|
ChannelFeed(QWidget *parent = 0);
|
|
|
|
/** Default Destructor */
|
|
|
|
|
|
|
|
|
|
|
|
virtual void deleteFeedItem(QWidget *item, uint32_t type);
|
|
|
|
virtual void openChat(std::string peerId);
|
|
|
|
virtual void openMsg(uint32_t type, std::string grpId, std::string inReplyTo);
|
|
|
|
|
2008-06-24 00:36:45 -04:00
|
|
|
public slots:
|
|
|
|
|
|
|
|
void selectChannel( std::string );
|
2009-09-12 06:55:40 -04:00
|
|
|
void selectChannel(const QModelIndex &);
|
|
|
|
void toggleSelection(const QModelIndex &);
|
2008-06-24 00:36:45 -04:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
2010-01-19 19:29:40 -05:00
|
|
|
void channelListCustomPopupMenu( QPoint point );
|
|
|
|
|
2008-06-24 00:36:45 -04:00
|
|
|
void checkUpdate();
|
|
|
|
|
|
|
|
void createChannel();
|
|
|
|
|
|
|
|
void channelSelection();
|
|
|
|
|
2008-07-04 10:41:24 -04:00
|
|
|
void subscribeChannel();
|
|
|
|
void unsubscribeChannel();
|
2010-01-18 16:02:16 -05:00
|
|
|
|
|
|
|
void createMsg();
|
|
|
|
|
2010-01-19 19:29:40 -05:00
|
|
|
void showChannelDetails();
|
2008-07-04 10:41:24 -04:00
|
|
|
|
2008-06-20 08:43:23 -04:00
|
|
|
private:
|
|
|
|
|
2008-06-24 00:36:45 -04:00
|
|
|
void updateChannelList();
|
|
|
|
void updateChannelListOwn(std::list<std::string> &ids);
|
|
|
|
void updateChannelListSub(std::list<std::string> &ids);
|
|
|
|
void updateChannelListPop(std::list<std::string> &ids);
|
|
|
|
void updateChannelListOther(std::list<std::string> &ids);
|
|
|
|
|
|
|
|
void updateChannelMsgs();
|
|
|
|
|
2009-09-12 06:55:40 -04:00
|
|
|
QStandardItemModel *model;
|
|
|
|
|
2008-06-24 00:36:45 -04:00
|
|
|
std::string mChannelId; /* current Channel */
|
|
|
|
|
|
|
|
/* Layout Pointers */
|
|
|
|
QBoxLayout *mMsgLayout;
|
|
|
|
|
|
|
|
std::list<ChanMsgItem *> mChanMsgItems;
|
2009-09-12 06:55:40 -04:00
|
|
|
|
2009-09-11 22:15:00 -04:00
|
|
|
QFont mChannelFont;
|
2009-09-14 19:27:05 -04:00
|
|
|
QFont itemFont;
|
2008-06-24 00:36:45 -04:00
|
|
|
|
2008-06-20 08:43:23 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|