2018-11-15 21:49:12 +01:00
|
|
|
/*******************************************************************************
|
|
|
|
* retroshare-gui/src/gui/Identity/IdDialog.h *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2012 by Robert Fernie <retroshare.project@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
* published by the Free Software Foundation, either version 3 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 Affero General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
2012-02-13 18:43:15 +00:00
|
|
|
|
2013-07-10 21:57:23 +00:00
|
|
|
#ifndef IDENTITYDIALOG_H
|
|
|
|
#define IDENTITYDIALOG_H
|
2012-02-13 18:43:15 +00:00
|
|
|
|
2013-07-14 18:48:40 +00:00
|
|
|
#include "gui/gxs/RsGxsUpdateBroadcastPage.h"
|
2012-02-13 18:43:15 +00:00
|
|
|
|
2012-06-14 00:36:25 +00:00
|
|
|
#include <retroshare/rsidentity.h>
|
2012-02-13 18:43:15 +00:00
|
|
|
|
2012-06-14 00:36:25 +00:00
|
|
|
#include "util/TokenQueue.h"
|
2012-02-13 18:43:15 +00:00
|
|
|
|
2016-08-16 22:02:30 +02:00
|
|
|
#define IMAGE_IDDIALOG ":/icons/png/people.png"
|
2014-05-10 02:38:47 +00:00
|
|
|
|
2014-12-24 14:43:06 +00:00
|
|
|
namespace Ui {
|
|
|
|
class IdDialog;
|
|
|
|
}
|
|
|
|
|
2013-07-10 21:57:23 +00:00
|
|
|
class UIStateHelper;
|
2014-12-24 14:43:06 +00:00
|
|
|
class QTreeWidgetItem;
|
2013-07-10 21:57:23 +00: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 ;
|
|
|
|
};
|
|
|
|
|
2020-02-06 19:57:23 +01:00
|
|
|
class IdDialog : public MainPage, public TokenResponse
|
2012-02-13 18:43:15 +00:00
|
|
|
{
|
2013-07-10 21:57:23 +00:00
|
|
|
Q_OBJECT
|
2012-02-13 18:43:15 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
IdDialog(QWidget *parent = 0);
|
2014-10-12 10:46:09 +00:00
|
|
|
~IdDialog();
|
2012-02-13 18:43:15 +00:00
|
|
|
|
2014-05-10 02:38:47 +00:00
|
|
|
virtual QIcon iconPixmap() const { return QIcon(IMAGE_IDDIALOG) ; } //MainPage
|
2015-01-23 14:42:28 +00:00
|
|
|
virtual QString pageName() const { return tr("People") ; } //MainPage
|
2014-05-10 02:38:47 +00:00
|
|
|
virtual QString helpText() const { return ""; } //MainPage
|
|
|
|
|
2013-07-10 21:57:23 +00:00
|
|
|
void loadRequest(const TokenQueue *queue, const TokenRequest &req);
|
2012-06-14 00:36:25 +00:00
|
|
|
|
2016-12-27 20:42:47 +01:00
|
|
|
void navigate(const RsGxsId& gxs_id) ; // shows the info about this particular ID
|
2013-07-14 18:48:40 +00:00
|
|
|
protected:
|
2013-07-19 09:48:51 +00: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 18:43:15 +00: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 11:43:35 +02: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 21:57:23 +00:00
|
|
|
void filterChanged(const QString &text);
|
2016-07-29 20:54:26 +02:00
|
|
|
void filterToggled(const bool &value);
|
2012-02-13 18:43:15 +00:00
|
|
|
|
2013-07-10 21:57:23 +00:00
|
|
|
void addIdentity();
|
2014-05-06 17:15:20 +00:00
|
|
|
void removeIdentity();
|
2013-07-10 21:57:23 +00:00
|
|
|
void editIdentity();
|
2014-06-12 10:28:23 +00:00
|
|
|
void chatIdentity();
|
2018-11-20 00:11:00 +01:00
|
|
|
void chatIdentityItem(QTreeWidgetItem* item);
|
2015-01-23 16:35:06 +00:00
|
|
|
void sendMsg();
|
2017-04-08 21:12:48 +02:00
|
|
|
void copyRetroshareLink();
|
2017-01-29 19:01:38 +01:00
|
|
|
void on_closeInfoFrameButton_clicked();
|
2012-02-13 18:43:15 +00:00
|
|
|
|
|
|
|
void updateSelection();
|
|
|
|
|
2014-02-19 11:11:06 +00:00
|
|
|
void modifyReputation();
|
2014-12-24 14:43:06 +00:00
|
|
|
|
|
|
|
/** Create the context popup menu and it's submenus */
|
2014-05-03 17:56:12 +00: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 21:57:23 +00:00
|
|
|
private:
|
2014-12-24 14:43:06 +00:00
|
|
|
void processSettings(bool load);
|
2017-01-03 23:31:29 +01:00
|
|
|
QString createUsageString(const RsIdentityUsage& u) const;
|
2014-12-24 14:43:06 +00:00
|
|
|
|
|
|
|
void requestIdDetails();
|
2012-06-07 17:11:57 +00:00
|
|
|
void insertIdDetails(uint32_t token);
|
2012-02-13 18:43:15 +00:00
|
|
|
|
2012-06-07 17:11:57 +00:00
|
|
|
void requestIdList();
|
2014-12-24 14:43:06 +00:00
|
|
|
void requestIdData(std::list<RsGxsGroupId> &ids);
|
2014-03-17 20:56:06 +00:00
|
|
|
bool fillIdListItem(const RsGxsIdGroup& data, QTreeWidgetItem *&item, const RsPgpId &ownPgpId, int accept);
|
2012-06-07 17:11:57 +00:00
|
|
|
void insertIdList(uint32_t token);
|
2013-07-10 21:57:23 +00:00
|
|
|
void filterIds();
|
2012-02-13 18:43:15 +00:00
|
|
|
|
2014-12-24 14:43:06 +00:00
|
|
|
void requestRepList();
|
2013-06-04 21:00:43 +00:00
|
|
|
void insertRepList(uint32_t token);
|
2017-04-10 20:02:14 +02:00
|
|
|
void handleSerializedGroupData(uint32_t token);
|
2013-06-04 21:00:43 +00:00
|
|
|
|
2012-06-07 17:11:57 +00:00
|
|
|
void requestIdEdit(std::string &id);
|
|
|
|
void showIdEdit(uint32_t token);
|
2012-02-13 18:43:15 +00:00
|
|
|
|
2018-01-05 17:48:18 +01:00
|
|
|
void clearPerson();
|
|
|
|
|
2013-07-10 21:57:23 +00:00
|
|
|
private:
|
2012-06-14 00:36:25 +00:00
|
|
|
TokenQueue *mIdQueue;
|
2015-09-06 23:53:21 -04:00
|
|
|
TokenQueue *mCircleQueue;
|
2016-01-01 22:18:43 -05:00
|
|
|
|
2013-07-10 21:57:23 +00:00
|
|
|
UIStateHelper *mStateHelper;
|
2012-02-13 18:43:15 +00: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;
|
2019-01-06 15:56:39 +01:00
|
|
|
QTreeWidgetItem *mMyCircleItem;
|
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 14:43:06 +00:00
|
|
|
RsGxsGroupId mId;
|
2017-07-20 14:29:31 +02:00
|
|
|
RsGxsGroupId mIdToNavigate;
|
2016-07-29 20:54:26 +02:00
|
|
|
int filter;
|
2014-12-24 14:43:06 +00:00
|
|
|
|
2020-01-27 23:02:04 +01:00
|
|
|
void handleEvent_main_thread(std::shared_ptr<const RsEvent> event);
|
2020-01-28 22:22:04 +01:00
|
|
|
RsEventsHandlerId_t mEventHandlerId_identity;
|
|
|
|
RsEventsHandlerId_t mEventHandlerId_circles;
|
2020-01-27 23:02:04 +01:00
|
|
|
|
2015-02-07 20:24:27 +00:00
|
|
|
/* UI - Designer */
|
2014-12-24 14:43:06 +00:00
|
|
|
Ui::IdDialog *ui;
|
2012-02-13 18:43:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|