mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-25 09:11:06 -04:00
added missing files
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4646 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
01a93b5f36
commit
521e9cb7c2
3 changed files with 1862 additions and 0 deletions
1637
retroshare-gui/src/gui/common/FriendList.cpp
Normal file
1637
retroshare-gui/src/gui/common/FriendList.cpp
Normal file
File diff suppressed because it is too large
Load diff
138
retroshare-gui/src/gui/common/FriendList.h
Normal file
138
retroshare-gui/src/gui/common/FriendList.h
Normal file
|
@ -0,0 +1,138 @@
|
||||||
|
/****************************************************************
|
||||||
|
* RShare is distributed under the following license:
|
||||||
|
*
|
||||||
|
* Copyright (C) 2011 RetroShare Team
|
||||||
|
*
|
||||||
|
* 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 FRIENDLIST_H
|
||||||
|
#define FRIENDLIST_H
|
||||||
|
|
||||||
|
#include <set>
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
#include "gui/RsAutoUpdatePage.h"
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class FriendList;
|
||||||
|
}
|
||||||
|
|
||||||
|
class RSTreeWidgetItemCompareRole;
|
||||||
|
class QTreeWidgetItem;
|
||||||
|
|
||||||
|
class FriendList : public RsAutoUpdatePage
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit FriendList(QWidget *parent = 0);
|
||||||
|
~FriendList();
|
||||||
|
|
||||||
|
void addGroupToExpand(const std::string &groupId);
|
||||||
|
bool getExpandedGroups(std::set<std::string> &groups) const;
|
||||||
|
void addPeerToExpand(const std::string &gpgId);
|
||||||
|
bool getExpandedPeers(std::set<std::string> &peers) const;
|
||||||
|
|
||||||
|
std::string getSelectedGroupId() const;
|
||||||
|
|
||||||
|
void restoreHeaderState(const QByteArray &state);
|
||||||
|
QByteArray saveHeaderState() const;
|
||||||
|
|
||||||
|
virtual void updateDisplay();
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void peerSortColumnChanged(bool sortedByState);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void filterItems(const QString &sPattern);
|
||||||
|
|
||||||
|
void setBigName(bool bigName); // show customStateString in second line of the name cell
|
||||||
|
void setHideAvatarColumn(bool hidden);
|
||||||
|
void setHideGroups(bool hidden);
|
||||||
|
void setHideUnconnected(bool hidden);
|
||||||
|
void setHideState(bool hidden);
|
||||||
|
void setHideStatusColumn(bool hidden);
|
||||||
|
void setHideHeader(bool hidden);
|
||||||
|
void setRootIsDecorated(bool show);
|
||||||
|
void setSortByState(bool sortByState);
|
||||||
|
void sortPeersAscendingOrder();
|
||||||
|
void sortPeersDescendingOrder();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void showEvent(QShowEvent *event);
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::FriendList *ui;
|
||||||
|
RSTreeWidgetItemCompareRole *m_compareRole;
|
||||||
|
|
||||||
|
// Settings for peer list display
|
||||||
|
bool mBigName;
|
||||||
|
bool mHideAvatarColumn;
|
||||||
|
bool mHideGroups;
|
||||||
|
bool mHideState;
|
||||||
|
bool mHideStatusColumn;
|
||||||
|
bool mHideUnconnected;
|
||||||
|
|
||||||
|
QString filterText;
|
||||||
|
|
||||||
|
bool groupsHasChanged;
|
||||||
|
std::set<std::string> *openGroups;
|
||||||
|
std::set<std::string> *openPeers;
|
||||||
|
|
||||||
|
QTreeWidgetItem *getCurrentPeer() const;
|
||||||
|
static bool filterItem(QTreeWidgetItem *pItem, const QString &sPattern);
|
||||||
|
void updateHeaderSizes();
|
||||||
|
|
||||||
|
bool correctColumnStatusSize;
|
||||||
|
bool firstTimeShown;
|
||||||
|
|
||||||
|
|
||||||
|
// QString fileName;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void groupsChanged();
|
||||||
|
void insertPeers();
|
||||||
|
void peerSortIndicatorChanged(int,Qt::SortOrder);
|
||||||
|
void peerTreeWidgetCostumPopupMenu();
|
||||||
|
void updateAvatar(const QString &);
|
||||||
|
|
||||||
|
void pastePerson();
|
||||||
|
|
||||||
|
void connectfriend();
|
||||||
|
void configurefriend();
|
||||||
|
void chatfriend(QTreeWidgetItem *);
|
||||||
|
void chatfriendproxy();
|
||||||
|
void copyLink();
|
||||||
|
// void exportfriend();
|
||||||
|
void addFriend();
|
||||||
|
void msgfriend();
|
||||||
|
void recommendfriend();
|
||||||
|
void removefriend();
|
||||||
|
#ifdef UNFINISHED
|
||||||
|
void viewprofile();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void addToGroup();
|
||||||
|
void moveToGroup();
|
||||||
|
void removeFromGroup();
|
||||||
|
|
||||||
|
void editGroup();
|
||||||
|
void removeGroup();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // FRIENDLIST_H
|
87
retroshare-gui/src/gui/common/FriendList.ui
Normal file
87
retroshare-gui/src/gui/common/FriendList.ui
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>FriendList</class>
|
||||||
|
<widget class="QWidget" name="FriendList">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>337</width>
|
||||||
|
<height>229</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QTreeWidget" name="peerTreeWidget">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Arial</family>
|
||||||
|
<pointsize>9</pointsize>
|
||||||
|
<stylestrategy>PreferAntialias</stylestrategy>
|
||||||
|
<kerning>true</kerning>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="contextMenuPolicy">
|
||||||
|
<enum>Qt::CustomContextMenu</enum>
|
||||||
|
</property>
|
||||||
|
<property name="acceptDrops">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="autoScroll">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>38</width>
|
||||||
|
<height>38</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="autoExpandDelay">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="indentation">
|
||||||
|
<number>20</number>
|
||||||
|
</property>
|
||||||
|
<property name="itemsExpandable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="sortingEnabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="allColumnsShowFocus">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="expandsOnDoubleClick">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="columnCount">
|
||||||
|
<number>3</number>
|
||||||
|
</property>
|
||||||
|
<attribute name="headerDefaultSectionSize">
|
||||||
|
<number>200</number>
|
||||||
|
</attribute>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Friends</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Status</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
<column>
|
||||||
|
<property name="text">
|
||||||
|
<string>Avatar</string>
|
||||||
|
</property>
|
||||||
|
</column>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
Loading…
Add table
Add a link
Reference in a new issue