mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-11 07:40:21 -04:00
FriendList:
- Added customize of columns with RSTreeWidget. - Reduced display menu. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8583 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
e8e02b9c79
commit
c0ad7d3e46
6 changed files with 70 additions and 387 deletions
|
@ -48,13 +48,23 @@ class FriendList : public RsAutoUpdatePage
|
|||
Q_PROPERTY(QColor textColorStatusOnline READ textColorStatusOnline WRITE setTextColorStatusOnline)
|
||||
Q_PROPERTY(QColor textColorStatusInactive READ textColorStatusInactive WRITE setTextColorStatusInactive)
|
||||
|
||||
public:
|
||||
enum Column
|
||||
{
|
||||
COLUMN_NAME = 0,
|
||||
COLUMN_AVATAR = 1,
|
||||
COLUMN_STATE = 2,
|
||||
COLUMN_LAST_CONTACT = 3,
|
||||
COLUMN_IP = 4
|
||||
};
|
||||
|
||||
public:
|
||||
explicit FriendList(QWidget *parent = 0);
|
||||
~FriendList();
|
||||
|
||||
// Add a tool button to the tool area
|
||||
void addToolButton(QToolButton *toolButton);
|
||||
void processSettings(bool bLoad);
|
||||
void processSettings(bool load);
|
||||
void addGroupToExpand(const std::string &groupId);
|
||||
bool getExpandedGroups(std::set<std::string> &groups) const;
|
||||
void addPeerToExpand(const std::string &gpgId);
|
||||
|
@ -63,6 +73,8 @@ public:
|
|||
std::string getSelectedGroupId() const;
|
||||
|
||||
virtual void updateDisplay();
|
||||
void setColumnVisible(Column column, bool visible);
|
||||
void sortByColumn(Column column, Qt::SortOrder sortOrder);
|
||||
|
||||
QColor textColorGroup() const { return mTextColorGroup; }
|
||||
QColor textColorStatusOffline() const { return mTextColorStatus[RS_STATUS_OFFLINE]; }
|
||||
|
@ -85,17 +97,9 @@ public slots:
|
|||
void setShowGroups(bool show);
|
||||
void setHideUnconnected(bool hidden);
|
||||
void setHideState(bool hidden);
|
||||
void setShowStatusColumn(bool show);
|
||||
void setShowLastContactColumn(bool show);
|
||||
void setShowIPColumn(bool show);
|
||||
void setShowAvatarColumn(bool show);
|
||||
void setRootIsDecorated(bool show);
|
||||
void setSortByName();
|
||||
void setSortByState();
|
||||
void setSortByLastContact();
|
||||
void setSortByIP();
|
||||
void sortPeersAscendingOrder();
|
||||
void sortPeersDescendingOrder();
|
||||
|
||||
private slots:
|
||||
void peerTreeColumnVisibleChanged(int column, bool visible);
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
@ -111,7 +115,7 @@ private:
|
|||
bool mHideState;
|
||||
bool mHideUnconnected;
|
||||
|
||||
QString filterText;
|
||||
QString mFilterText;
|
||||
|
||||
bool groupsHasChanged;
|
||||
std::set<std::string> *openGroups;
|
||||
|
@ -122,8 +126,6 @@ private:
|
|||
QColor mTextColorStatus[RS_STATUS_COUNT];
|
||||
|
||||
QTreeWidgetItem *getCurrentPeer() const;
|
||||
static bool filterItem(QTreeWidgetItem *item, const QString &text);
|
||||
void updateHeader();
|
||||
void initializeHeader(bool afterLoadSettings);
|
||||
void getSslIdsFromItem(QTreeWidgetItem *item, std::list<RsPeerId> &sslIds);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue