2008-04-09 08:57:26 -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
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
****************************************************************/
|
|
|
|
|
|
|
|
#ifndef _FORUMSDIALOG_H
|
|
|
|
#define _FORUMSDIALOG_H
|
|
|
|
|
|
|
|
#include "mainpage.h"
|
2010-07-05 15:41:46 -04:00
|
|
|
#include "RsAutoUpdatePage.h"
|
2008-04-09 08:57:26 -04:00
|
|
|
#include "ui_ForumsDialog.h"
|
|
|
|
|
2010-07-05 15:41:46 -04:00
|
|
|
class ForumsDialog : public RsAutoUpdatePage
|
2008-04-09 08:57:26 -04:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2010-08-08 18:58:10 -04:00
|
|
|
ForumsDialog(QWidget *parent = 0);
|
|
|
|
~ForumsDialog();
|
|
|
|
|
|
|
|
/* overloaded from RsAuthUpdatePage */
|
|
|
|
virtual void updateDisplay();
|
|
|
|
|
2008-04-09 08:57:26 -04:00
|
|
|
private slots:
|
2010-08-08 18:58:10 -04:00
|
|
|
void anchorClicked (const QUrl &);
|
|
|
|
/** Create the context popup menu and it's submenus */
|
|
|
|
void forumListCustomPopupMenu( QPoint point );
|
|
|
|
void threadListCustomPopupMenu( QPoint point );
|
2008-04-09 08:57:26 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
void newforum();
|
2008-04-09 08:57:26 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
void changedForum( QTreeWidgetItem *curr, QTreeWidgetItem *prev );
|
|
|
|
void changedThread();
|
|
|
|
void clickedThread (QTreeWidgetItem *item, int column);
|
2008-04-09 08:57:26 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
void replytomessage();
|
|
|
|
//void print();
|
|
|
|
//void printpreview();
|
2008-04-15 12:40:38 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
//void removemessage();
|
|
|
|
void markMsgAsRead();
|
|
|
|
void markMsgAsReadAll();
|
|
|
|
void markMsgAsUnread();
|
|
|
|
void markMsgAsUnreadAll();
|
2008-04-15 12:40:38 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
/* handle splitter */
|
|
|
|
void togglethreadview();
|
2008-04-09 08:57:26 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
void createthread();
|
|
|
|
void createmessage();
|
2008-04-15 12:40:38 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
void subscribeToForum();
|
|
|
|
void unsubscribeToForum();
|
2008-06-13 11:46:34 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
void showForumDetails();
|
2010-05-01 15:03:35 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
void previousMessage ();
|
|
|
|
void nextMessage ();
|
2010-05-01 15:03:35 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
void changedViewBox();
|
2010-05-19 16:17:43 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
void filterColumnChanged();
|
|
|
|
void filterRegExpChanged();
|
|
|
|
void clearFilter();
|
2010-05-19 16:17:43 -04:00
|
|
|
|
2008-04-09 08:57:26 -04:00
|
|
|
private:
|
2010-08-08 18:58:10 -04:00
|
|
|
void insertForums();
|
|
|
|
void insertThreads();
|
|
|
|
void insertPost();
|
2010-08-09 17:20:34 -04:00
|
|
|
void updateMessageSummaryList(std::string forumId);
|
2010-08-08 18:58:10 -04:00
|
|
|
|
|
|
|
void forumSubscribe(bool subscribe);
|
|
|
|
void FillForums(QTreeWidgetItem *Forum, QList<QTreeWidgetItem *> &ChildList);
|
|
|
|
void FillThreads(QList<QTreeWidgetItem *> &ThreadList, bool bExpandNewMessages, std::list<QTreeWidgetItem*> &itemToExpand);
|
|
|
|
void FillChildren(QTreeWidgetItem *Parent, QTreeWidgetItem *NewParent, bool bExpandNewMessages, std::list<QTreeWidgetItem*> &itemToExpand);
|
2010-05-01 15:03:35 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
int getSelectedMsgCount(QList<QTreeWidgetItem*> *pRows, QList<QTreeWidgetItem*> *pRowsRead, QList<QTreeWidgetItem*> *pRowsUnread);
|
|
|
|
void setMsgAsReadUnread(QList<QTreeWidgetItem*> &Rows, bool bRead);
|
|
|
|
void markMsgAsReadUnread(bool bRead, bool bAll);
|
|
|
|
void CalculateIconsAndFonts(QTreeWidgetItem *pItem = NULL);
|
|
|
|
void CalculateIconsAndFonts(QTreeWidgetItem *pItem, bool &bHasReadChilddren, bool &bHasUnreadChilddren);
|
2010-05-19 16:17:43 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
void processSettings(bool bLoad);
|
|
|
|
void togglethreadview_internal();
|
2010-05-19 16:17:43 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
void FilterItems();
|
|
|
|
bool FilterItem(QTreeWidgetItem *pItem, QString &sPattern, int nFilterColumn);
|
2010-05-20 17:53:27 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
bool m_bProcessSettings;
|
2008-04-09 08:57:26 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
QTreeWidgetItem *YourForums;
|
|
|
|
QTreeWidgetItem *SubscribedForums;
|
|
|
|
QTreeWidgetItem *PopularForums;
|
|
|
|
QTreeWidgetItem *OtherForums;
|
2010-05-19 16:17:43 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
std::string mCurrForumId;
|
|
|
|
std::string mCurrThreadId;
|
|
|
|
bool m_bIsForumSubscribed;
|
2010-05-19 16:17:43 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
QFont m_ForumNameFont;
|
|
|
|
QFont m_ItemFont;
|
|
|
|
int m_LastViewType;
|
|
|
|
std::string m_LastForumID;
|
2010-05-19 16:17:43 -04:00
|
|
|
|
2010-08-08 18:58:10 -04:00
|
|
|
/** Qt Designer generated object */
|
|
|
|
Ui::ForumsDialog ui;
|
2008-04-09 08:57:26 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|