2012-02-13 13:43:15 -05:00
|
|
|
/*
|
|
|
|
* Retroshare Identity.
|
|
|
|
*
|
|
|
|
* Copyright 2012-2012 by Robert Fernie.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License Version 2.1 as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library 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
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
* USA.
|
|
|
|
*
|
|
|
|
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2013-07-10 17:57:23 -04:00
|
|
|
#ifndef IDENTITYDIALOG_H
|
|
|
|
#define IDENTITYDIALOG_H
|
2012-02-13 13:43:15 -05:00
|
|
|
|
2013-07-14 14:48:40 -04:00
|
|
|
#include "gui/gxs/RsGxsUpdateBroadcastPage.h"
|
2012-02-13 13:43:15 -05:00
|
|
|
|
2012-06-13 20:36:25 -04:00
|
|
|
#include <retroshare/rsidentity.h>
|
2012-02-13 13:43:15 -05:00
|
|
|
|
2012-06-13 20:36:25 -04:00
|
|
|
#include "util/TokenQueue.h"
|
2012-02-13 13:43:15 -05:00
|
|
|
|
2016-08-16 16:02:30 -04:00
|
|
|
#define IMAGE_IDDIALOG ":/icons/png/people.png"
|
2014-05-09 22:38:47 -04:00
|
|
|
|
2014-12-24 09:43:06 -05:00
|
|
|
namespace Ui {
|
|
|
|
class IdDialog;
|
|
|
|
}
|
|
|
|
|
2013-07-10 17:57:23 -04:00
|
|
|
class UIStateHelper;
|
2014-12-24 09:43:06 -05:00
|
|
|
class QTreeWidgetItem;
|
2013-07-10 17:57:23 -04:00
|
|
|
|
2016-06-08 21:00:26 -04:00
|
|
|
struct CircleUpdateOrder
|
|
|
|
{
|
|
|
|
enum { UNKNOWN_ACTION=0x00, GRANT_MEMBERSHIP=0x01, REVOKE_MEMBERSHIP=0x02 };
|
|
|
|
|
|
|
|
uint32_t token ;
|
|
|
|
RsGxsId gxs_id ;
|
|
|
|
uint32_t action ;
|
|
|
|
};
|
|
|
|
|
2013-07-14 14:48:40 -04:00
|
|
|
class IdDialog : public RsGxsUpdateBroadcastPage, public TokenResponse
|
2012-02-13 13:43:15 -05:00
|
|
|
{
|
2013-07-10 17:57:23 -04:00
|
|
|
Q_OBJECT
|
2012-02-13 13:43:15 -05:00
|
|
|
|
|
|
|
public:
|
|
|
|
IdDialog(QWidget *parent = 0);
|
2014-10-12 06:46:09 -04:00
|
|
|
~IdDialog();
|
2012-02-13 13:43:15 -05:00
|
|
|
|
2014-05-09 22:38:47 -04:00
|
|
|
virtual QIcon iconPixmap() const { return QIcon(IMAGE_IDDIALOG) ; } //MainPage
|
2015-01-23 09:42:28 -05:00
|
|
|
virtual QString pageName() const { return tr("People") ; } //MainPage
|
2014-05-09 22:38:47 -04:00
|
|
|
virtual QString helpText() const { return ""; } //MainPage
|
|
|
|
|
2013-07-10 17:57:23 -04:00
|
|
|
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
2012-06-13 20:36:25 -04:00
|
|
|
|
2016-12-27 14:42:47 -05:00
|
|
|
void navigate(const RsGxsId& gxs_id) ; // shows the info about this particular ID
|
2013-07-14 14:48:40 -04:00
|
|
|
protected:
|
2013-07-19 05:48:51 -04:00
|
|
|
virtual void updateDisplay(bool complete);
|
2016-06-08 21:00:26 -04:00
|
|
|
|
|
|
|
void loadCircleGroupMeta(const uint32_t &token);
|
|
|
|
void loadCircleGroupData(const uint32_t &token);
|
|
|
|
void updateCircleGroup(const uint32_t& token);
|
|
|
|
|
|
|
|
void requestCircleGroupMeta();
|
|
|
|
//void requestCircleGroupData(const RsGxsCircleId& circle_id);
|
|
|
|
bool getItemCircleId(QTreeWidgetItem *item,RsGxsCircleId& id) ;
|
|
|
|
|
2012-02-13 13:43:15 -05:00
|
|
|
private slots:
|
2016-06-08 21:00:26 -04:00
|
|
|
void createExternalCircle();
|
|
|
|
void showEditExistingCircle();
|
2016-04-17 00:51:45 -04:00
|
|
|
void updateCirclesDisplay();
|
2016-08-04 05:43:35 -04:00
|
|
|
void toggleAutoBanIdentities(bool b);
|
2016-06-08 21:00:26 -04:00
|
|
|
|
|
|
|
void acceptCircleSubscription() ;
|
|
|
|
void cancelCircleSubscription() ;
|
|
|
|
void grantCircleMembership() ;
|
|
|
|
void revokeCircleMembership() ;
|
2016-01-01 22:18:43 -05:00
|
|
|
|
2013-07-10 17:57:23 -04:00
|
|
|
void filterChanged(const QString &text);
|
2016-07-29 14:54:26 -04:00
|
|
|
void filterToggled(const bool &value);
|
2012-02-13 13:43:15 -05:00
|
|
|
|
2013-07-10 17:57:23 -04:00
|
|
|
void addIdentity();
|
2014-05-06 13:15:20 -04:00
|
|
|
void removeIdentity();
|
2013-07-10 17:57:23 -04:00
|
|
|
void editIdentity();
|
2014-06-12 06:28:23 -04:00
|
|
|
void chatIdentity();
|
2015-01-23 11:35:06 -05:00
|
|
|
void sendMsg();
|
|
|
|
|
2012-02-13 13:43:15 -05:00
|
|
|
|
|
|
|
void updateSelection();
|
|
|
|
|
2014-02-19 06:11:06 -05:00
|
|
|
void modifyReputation();
|
2014-12-24 09:43:06 -05:00
|
|
|
|
|
|
|
/** Create the context popup menu and it's submenus */
|
2014-05-03 13:56:12 -04:00
|
|
|
void IdListCustomPopupMenu( QPoint point );
|
2015-12-31 16:50:52 -05:00
|
|
|
|
2016-01-01 15:15:19 -05:00
|
|
|
void CircleListCustomPopupMenu(QPoint point) ;
|
2016-05-26 21:16:21 -04:00
|
|
|
#ifdef SUSPENDED
|
2016-01-01 15:15:19 -05:00
|
|
|
void circle_selected() ;
|
2016-05-26 21:16:21 -04:00
|
|
|
#endif
|
2016-01-01 15:15:19 -05:00
|
|
|
|
|
|
|
void addtoContacts();
|
2016-06-08 21:00:26 -04:00
|
|
|
void removefromContacts();
|
2016-01-01 15:15:19 -05:00
|
|
|
|
2016-01-16 20:44:52 -05:00
|
|
|
void negativePerson();
|
|
|
|
void positivePerson();
|
|
|
|
void neutralPerson();
|
2016-06-08 21:00:26 -04:00
|
|
|
|
2016-01-01 15:15:19 -05:00
|
|
|
static QString inviteMessage();
|
|
|
|
void sendInvite();
|
|
|
|
|
2013-07-10 17:57:23 -04:00
|
|
|
private:
|
2014-12-24 09:43:06 -05:00
|
|
|
void processSettings(bool load);
|
2017-01-03 17:31:29 -05:00
|
|
|
QString createUsageString(const RsIdentityUsage& u) const;
|
2014-12-24 09:43:06 -05:00
|
|
|
|
|
|
|
void requestIdDetails();
|
2012-06-07 13:11:57 -04:00
|
|
|
void insertIdDetails(uint32_t token);
|
2012-02-13 13:43:15 -05:00
|
|
|
|
2012-06-07 13:11:57 -04:00
|
|
|
void requestIdList();
|
2014-12-24 09:43:06 -05:00
|
|
|
void requestIdData(std::list<RsGxsGroupId> &ids);
|
2014-03-17 16:56:06 -04:00
|
|
|
bool fillIdListItem(const RsGxsIdGroup& data, QTreeWidgetItem *&item, const RsPgpId &ownPgpId, int accept);
|
2012-06-07 13:11:57 -04:00
|
|
|
void insertIdList(uint32_t token);
|
2013-07-10 17:57:23 -04:00
|
|
|
void filterIds();
|
2012-02-13 13:43:15 -05:00
|
|
|
|
2014-12-24 09:43:06 -05:00
|
|
|
void requestRepList();
|
2013-06-04 17:00:43 -04:00
|
|
|
void insertRepList(uint32_t token);
|
|
|
|
|
2012-06-07 13:11:57 -04:00
|
|
|
void requestIdEdit(std::string &id);
|
|
|
|
void showIdEdit(uint32_t token);
|
2012-02-13 13:43:15 -05:00
|
|
|
|
2013-07-10 17:57:23 -04:00
|
|
|
private:
|
2012-06-13 20:36:25 -04:00
|
|
|
TokenQueue *mIdQueue;
|
2015-09-06 23:53:21 -04:00
|
|
|
TokenQueue *mCircleQueue;
|
2016-01-01 22:18:43 -05:00
|
|
|
|
2013-07-10 17:57:23 -04:00
|
|
|
UIStateHelper *mStateHelper;
|
2012-02-13 13:43:15 -05:00
|
|
|
|
2016-01-01 15:15:19 -05:00
|
|
|
QTreeWidgetItem *contactsItem;
|
|
|
|
QTreeWidgetItem *allItem;
|
2016-04-09 17:50:46 -04:00
|
|
|
QTreeWidgetItem *ownItem;
|
2016-04-19 22:00:32 -04:00
|
|
|
QTreeWidgetItem *mExternalBelongingCircleItem;
|
2016-03-16 20:59:52 -04:00
|
|
|
QTreeWidgetItem *mExternalOtherCircleItem;
|
2016-06-08 21:00:26 -04:00
|
|
|
RsGxsUpdateBroadcastBase *mCirclesBroadcastBase ;
|
|
|
|
|
|
|
|
std::map<uint32_t, CircleUpdateOrder> mCircleUpdates ;
|
2016-01-01 15:15:19 -05:00
|
|
|
|
2014-12-24 09:43:06 -05:00
|
|
|
RsGxsGroupId mId;
|
2016-07-29 14:54:26 -04:00
|
|
|
int filter;
|
2014-12-24 09:43:06 -05:00
|
|
|
|
2015-02-07 15:24:27 -05:00
|
|
|
/* UI - Designer */
|
2014-12-24 09:43:06 -05:00
|
|
|
Ui::IdDialog *ui;
|
2012-02-13 13:43:15 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|